daemon: Use Emane.version directly instead of checking if EventService

exists.
This commit is contained in:
Tom Goff 2015-09-30 14:41:13 -04:00
parent 026f54d658
commit 3a13b8c92d
5 changed files with 11 additions and 11 deletions

View file

@ -18,7 +18,7 @@ except:
pass pass
from core.api import coreapi from core.api import coreapi
from core.constants import * from core.constants import *
from emane import EmaneModel from emane import Emane, EmaneModel
try: try:
import emaneeventservice import emaneeventservice
@ -53,7 +53,7 @@ class EmaneCommEffectModel(EmaneModel):
("defaultconnectivitymode", coreapi.CONF_DATA_TYPE_BOOL, '0', ("defaultconnectivitymode", coreapi.CONF_DATA_TYPE_BOOL, '0',
'On,Off', 'defaultconnectivity'), 'On,Off', 'defaultconnectivity'),
] ]
if 'EventService' in globals(): if Emane.version >= Emane.EMANE091:
_confmatrix_shim = _confmatrix_shim_base + _confmatrix_shim_091 _confmatrix_shim = _confmatrix_shim_base + _confmatrix_shim_091
else: else:
_confmatrix_shim = _confmatrix_shim_base + _confmatrix_shim_081 _confmatrix_shim = _confmatrix_shim_base + _confmatrix_shim_081

View file

@ -1363,7 +1363,7 @@ class EmaneGlobalModel(EmaneModel):
'', 'starting NEM ID'), '', 'starting NEM ID'),
] ]
if 'EventService' in globals(): if Emane.version >= Emane.EMANE091:
_confmatrix_platform = _confmatrix_platform_base + \ _confmatrix_platform = _confmatrix_platform_base + \
_confmatrix_platform_091 _confmatrix_platform_091
if Emane.version >= Emane.EMANE092: if Emane.version >= Emane.EMANE092:

View file

@ -17,7 +17,7 @@ except:
pass pass
from core.api import coreapi from core.api import coreapi
from core.constants import * from core.constants import *
from emane import EmaneModel from emane import Emane, EmaneModel
from universal import EmaneUniversalModel from universal import EmaneUniversalModel
class EmaneIeee80211abgModel(EmaneModel): class EmaneIeee80211abgModel(EmaneModel):
@ -29,7 +29,7 @@ class EmaneIeee80211abgModel(EmaneModel):
_80211rates = '1 1 Mbps,2 2 Mbps,3 5.5 Mbps,4 11 Mbps,5 6 Mbps,' + \ _80211rates = '1 1 Mbps,2 2 Mbps,3 5.5 Mbps,4 11 Mbps,5 6 Mbps,' + \
'6 9 Mbps,7 12 Mbps,8 18 Mbps,9 24 Mbps,10 36 Mbps,11 48 Mbps,' + \ '6 9 Mbps,7 12 Mbps,8 18 Mbps,9 24 Mbps,10 36 Mbps,11 48 Mbps,' + \
'12 54 Mbps' '12 54 Mbps'
if 'EventService' in globals(): if Emane.version >= Emane.EMANE091:
xml_path = '/usr/share/emane/xml/models/mac/ieee80211abg' xml_path = '/usr/share/emane/xml/models/mac/ieee80211abg'
else: else:
xml_path = "/usr/share/emane/models/ieee80211abg/xml" xml_path = "/usr/share/emane/models/ieee80211abg/xml"
@ -120,7 +120,7 @@ class EmaneIeee80211abgModel(EmaneModel):
phynames = names[len(self._confmatrix_mac):] phynames = names[len(self._confmatrix_mac):]
# append all MAC options to macdoc # append all MAC options to macdoc
if 'EventService' in globals(): if Emane.version >= Emane.EMANE091:
for macname in macnames: for macname in macnames:
mac9xnvpairlist = self.get9xmacparamequivalent(macname, values) mac9xnvpairlist = self.get9xmacparamequivalent(macname, values)
for nvpair in mac9xnvpairlist: for nvpair in mac9xnvpairlist:

View file

@ -18,7 +18,7 @@ except:
pass pass
from core.api import coreapi from core.api import coreapi
from core.constants import * from core.constants import *
from emane import EmaneModel from emane import Emane, EmaneModel
from universal import EmaneUniversalModel from universal import EmaneUniversalModel
class EmaneRfPipeModel(EmaneModel): class EmaneRfPipeModel(EmaneModel):
@ -27,7 +27,7 @@ class EmaneRfPipeModel(EmaneModel):
# model name # model name
_name = "emane_rfpipe" _name = "emane_rfpipe"
if 'EventService' in globals(): if Emane.version >= Emane.EMANE091:
xml_path = '/usr/share/emane/xml/models/mac/rfpipe' xml_path = '/usr/share/emane/xml/models/mac/rfpipe'
else: else:
xml_path = "/usr/share/emane/models/rfpipe/xml" xml_path = "/usr/share/emane/models/rfpipe/xml"
@ -64,7 +64,7 @@ class EmaneRfPipeModel(EmaneModel):
("delay", coreapi.CONF_DATA_TYPE_FLOAT, '0.0', ("delay", coreapi.CONF_DATA_TYPE_FLOAT, '0.0',
'', 'transmission delay (sec)'), '', 'transmission delay (sec)'),
] ]
if 'EventService' in globals(): if Emane.version >= Emane.EMANE091:
_confmatrix_mac = _confmatrix_mac_base + _confmatrix_mac_091 _confmatrix_mac = _confmatrix_mac_base + _confmatrix_mac_091
else: else:
_confmatrix_mac = _confmatrix_mac_base + _confmatrix_mac_081 _confmatrix_mac = _confmatrix_mac_base + _confmatrix_mac_081

View file

@ -18,7 +18,7 @@ except:
pass pass
from core.api import coreapi from core.api import coreapi
from core.constants import * from core.constants import *
from emane import EmaneModel from emane import Emane, EmaneModel
class EmaneUniversalModel(EmaneModel): class EmaneUniversalModel(EmaneModel):
''' This Univeral PHY model is meant to be imported by other models, ''' This Univeral PHY model is meant to be imported by other models,
@ -80,7 +80,7 @@ class EmaneUniversalModel(EmaneModel):
("propagationmodel", coreapi.CONF_DATA_TYPE_STRING, '2ray', ("propagationmodel", coreapi.CONF_DATA_TYPE_STRING, '2ray',
'precomputed,2ray,freespace','path loss mode'), 'precomputed,2ray,freespace','path loss mode'),
] ]
if 'EventService' in globals(): if Emane.version >= Emane.EMANE091:
_confmatrix = _confmatrix_base + _confmatrix_091 _confmatrix = _confmatrix_base + _confmatrix_091
else: else:
_confmatrix = _confmatrix_base + _confmatrix_081 _confmatrix = _confmatrix_base + _confmatrix_081