setup a simple default way for dealing with configurable options and added conifg group opbjects as a better way to access the same information formatted within a string
This commit is contained in:
parent
8e3cd0e013
commit
82c3d57dd3
7 changed files with 107 additions and 75 deletions
|
@ -3,6 +3,7 @@ commeffect.py: EMANE CommEffect model for CORE
|
|||
"""
|
||||
|
||||
from core import logger
|
||||
from core.conf import ConfigGroup
|
||||
from core.emane import emanemanifest
|
||||
from core.emane import emanemodel
|
||||
|
||||
|
@ -41,7 +42,9 @@ class EmaneCommEffectModel(emanemodel.EmaneModel):
|
|||
|
||||
@classmethod
|
||||
def config_groups(cls):
|
||||
return "CommEffect SHIM Parameters:1-%d" % len(cls.configurations())
|
||||
return [
|
||||
ConfigGroup("CommEffect SHIM Parameters", 1, len(cls.configurations()))
|
||||
]
|
||||
|
||||
def build_xml_files(self, emane_manager, interface):
|
||||
"""
|
||||
|
|
|
@ -990,7 +990,6 @@ class EmaneGlobalModel(EmaneModel):
|
|||
_DEFAULT_DEV = "ctrl0"
|
||||
|
||||
name = "emane"
|
||||
configuration_maps = {}
|
||||
|
||||
emulator_xml = "/usr/share/emane/manifest/nemmanager.xml"
|
||||
emulator_defaults = {
|
||||
|
|
|
@ -3,6 +3,7 @@ Defines Emane Models used within CORE.
|
|||
"""
|
||||
|
||||
from core import logger
|
||||
from core.conf import ConfigGroup
|
||||
from core.emane import emanemanifest
|
||||
from core.misc import utils
|
||||
from core.mobility import WirelessModel
|
||||
|
@ -68,7 +69,10 @@ class EmaneModel(WirelessModel):
|
|||
def config_groups(cls):
|
||||
mac_len = len(cls.mac_config)
|
||||
config_len = len(cls.configurations())
|
||||
return "MAC Parameters:1-%d|PHY Parameters:%d-%d" % (mac_len, mac_len + 1, config_len)
|
||||
return [
|
||||
ConfigGroup("MAC Parameters", 1, mac_len),
|
||||
ConfigGroup("PHY Parameters", mac_len + 1, config_len)
|
||||
]
|
||||
|
||||
def build_xml_files(self, emane_manager, interface):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue