<s> '''<STR_LIT>''' <EOL> import sys <EOL> import string <EOL> try : <EOL> from emanesh . events import EventService <EOL> except : <EOL> pass <EOL> from core . api import coreapi <EOL> from core . constants import * <EOL> from emane import Emane , EmaneModel <EOL> class EmaneUniversalModel ( EmaneModel ) : <EOL> '''<STR_LIT>''' <EOL> def __init__ ( self , session , objid = None , verbose = False ) : <EOL> raise SyntaxError <EOL> _name = "<STR_LIT>" <EOL> _xmlname = "<STR_LIT>" <EOL> _xmllibrary = "<STR_LIT>" <EOL> _confmatrix_base = [ <EOL> ( "<STR_LIT>" , coreapi . CONF_DATA_TYPE_UINT64 , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( "<STR_LIT>" , coreapi . CONF_DATA_TYPE_UINT64 , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( "<STR_LIT>" , coreapi . CONF_DATA_TYPE_UINT64 , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( "<STR_LIT>" , coreapi . CONF_DATA_TYPE_UINT16 , '<STR_LIT:1>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( "<STR_LIT>" , coreapi . CONF_DATA_TYPE_FLOAT , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( "<STR_LIT>" , coreapi . CONF_DATA_TYPE_FLOAT , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] <EOL> _confmatrix_081 = [ <EOL> ( "<STR_LIT>" , coreapi . CONF_DATA_TYPE_FLOAT , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( "<STR_LIT>" , coreapi . CONF_DATA_TYPE_FLOAT , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( "<STR_LIT>" , coreapi . CONF_DATA_TYPE_FLOAT , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( "<STR_LIT>" , coreapi . CONF_DATA_TYPE_STRING , '<STR_LIT:1>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( "<STR_LIT>" , coreapi . CONF_DATA_TYPE_STRING , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( "<STR_LIT>" , coreapi . CONF_DATA_TYPE_BOOL , '<STR_LIT:0>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( "<STR_LIT>" , coreapi . CONF_DATA_TYPE_BOOL , '<STR_LIT:1>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( "<STR_LIT>" , coreapi . CONF_DATA_TYPE_BOOL , '<STR_LIT:1>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( "<STR_LIT>" , coreapi . CONF_DATA_TYPE_BOOL , '<STR_LIT:0>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( "<STR_LIT>" , coreapi . CONF_DATA_TYPE_STRING , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] <EOL> _confmatrix_091 = [ <EOL> ( "<STR_LIT>" , coreapi . CONF_DATA_TYPE_FLOAT , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( "<STR_LIT>" , coreapi . CONF_DATA_TYPE_BOOL , '<STR_LIT:1>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( "<STR_LIT>" , coreapi . CONF_DATA_TYPE_STRING , '<STR_LIT:none>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( "<STR_LIT>" , coreapi . CONF_DATA_TYPE_UINT64 , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( "<STR_LIT>" , coreapi . CONF_DATA_TYPE_STRING , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] <EOL> if Emane . version >= Emane . EMANE091 : <EOL> _confmatrix = _confmatrix_base + _confmatrix_091 <EOL> else : <EOL> _confmatrix = _confmatrix_base + _confmatrix_081 <EOL> _confmatrix_ver074 = [ <EOL> ( "<STR_LIT>" , coreapi . CONF_DATA_TYPE_FLOAT , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( "<STR_LIT>" , coreapi . CONF_DATA_TYPE_FLOAT , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( "<STR_LIT>" , coreapi . CONF_DATA_TYPE_STRING , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] <EOL> _update_ver074 = ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> _remove_ver074 = ( "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" ) <EOL> @ classmethod <EOL> def getphydoc ( cls , e , mac , values , phynames ) : <EOL> phydoc = e . xmldoc ( "<STR_LIT>" ) <EOL> phy = phydoc . getElementsByTagName ( "<STR_LIT>" ) . pop ( ) <EOL> phy . setAttribute ( "<STR_LIT:name>" , cls . _xmlname ) <EOL> if e . version < e . EMANE091 : <EOL> phy . setAttribute ( "<STR_LIT>" , cls . _xmllibrary ) <EOL> if e . version == e . EMANE074 : <EOL> names = mac . getnames ( ) <EOL> values = list ( values ) <EOL> phynames = list ( phynames ) <EOL> for p in cls . _update_ver074 : <EOL> i = names . index ( p ) <EOL> values [ i ] = cls . emane074_fixup ( values [ i ] , <NUM_LIT:1000> ) <EOL> for p in cls . _remove_ver074 : <EOL> phynames . remove ( p ) <EOL> for old in cls . _confmatrix_ver074 : <EOL> phy . appendChild ( e . xmlparam ( phydoc , old [ <NUM_LIT:0> ] , old [ <NUM_LIT:2> ] ) ) <EOL> frequencies = None <EOL> if e . version >= e . EMANE091 : <EOL> name = "<STR_LIT>" <EOL> value = mac . valueof ( name , values ) <EOL> frequencies = cls . valuestrtoparamlist ( phydoc , name , value ) <EOL> if frequencies : <EOL> phynames = list ( phynames ) <EOL> phynames . remove ( "<STR_LIT>" ) <EOL> map ( lambda n : phy . appendChild ( e . xmlparam ( phydoc , n , mac . valueof ( n , values ) ) ) , phynames ) <EOL> if frequencies : <EOL> phy . appendChild ( frequencies ) <EOL> return phydoc </s>
