turned transport type usages of raw and virtual across the board to an enumerated type

This commit is contained in:
Blake Harnden 2020-05-29 22:48:00 -07:00
parent 8ad3f7961a
commit b034ba6cc3
8 changed files with 61 additions and 49 deletions

View file

@ -11,6 +11,7 @@ from lxml import etree
from core.config import ConfigGroup, Configuration
from core.emane import emanemanifest, emanemodel
from core.emane.nodes import EmaneNet
from core.emulator.enumerations import TransportType
from core.nodes.interface import CoreInterface
from core.xml import emanexml
@ -79,9 +80,9 @@ class EmaneCommEffectModel(emanemodel.EmaneModel):
# create and write nem document
nem_element = etree.Element("nem", name=f"{self.name} NEM", type="unstructured")
transport_type = "virtual"
if interface and interface.transport_type == "raw":
transport_type = "raw"
transport_type = TransportType.VIRTUAL
if interface and interface.transport_type == TransportType.RAW:
transport_type = TransportType.RAW
transport_file = emanexml.transport_file_name(self.id, transport_type)
etree.SubElement(nem_element, "transport", definition=transport_file)