added metaclass to reduce emane model code, fixed broken emaneuniversal references

This commit is contained in:
Blake J. Harnden 2018-03-30 12:52:10 -07:00
parent fd32e1cf78
commit 405614bbd8
7 changed files with 59 additions and 47 deletions

View file

@ -22,20 +22,14 @@ class EmaneTdmaModel(emanemodel.EmaneModel):
mac_defaults = {
"pcrcurveuri": "/usr/share/emane/xml/models/mac/tdmaeventscheduler/tdmabasemodelpcr.xml",
}
config_mac = emanemanifest.parse(mac_xml, mac_defaults)
mac_config = emanemanifest.parse(mac_xml, mac_defaults)
# add custom schedule options and ignore it when writing emane xml
schedule_name = "schedule"
default_schedule = os.path.join(constants.CORE_DATA_DIR, "examples", "tdma", "schedule.xml")
config_mac.insert(0, (schedule_name, ConfigDataTypes.STRING.value, default_schedule, "", "TDMA schedule file"))
mac_config.insert(0, (schedule_name, ConfigDataTypes.STRING.value, default_schedule, "", "TDMA schedule file"))
config_ignore = {schedule_name}
# defines overall config
config_matrix = config_mac + emanemodel.EmaneModel.config_phy
# gui display tabs
config_groups = emanemodel.create_config_groups(config_mac, config_matrix)
def post_startup(self, emane_manager):
"""
Logic to execute after the emane manager is finished with startup.