daemon: updates to provide config types for configurable values, without the need to specify the enumerated type
This commit is contained in:
parent
bd3e2f5d0e
commit
22e92111d0
10 changed files with 115 additions and 240 deletions
|
@ -4,9 +4,8 @@ EMANE Bypass model for CORE
|
|||
from pathlib import Path
|
||||
from typing import List, Set
|
||||
|
||||
from core.config import Configuration
|
||||
from core.config import ConfigBool, Configuration
|
||||
from core.emane import emanemodel
|
||||
from core.emulator.enumerations import ConfigDataTypes
|
||||
|
||||
|
||||
class EmaneBypassModel(emanemodel.EmaneModel):
|
||||
|
@ -18,9 +17,8 @@ class EmaneBypassModel(emanemodel.EmaneModel):
|
|||
# mac definitions
|
||||
mac_library: str = "bypassmaclayer"
|
||||
mac_config: List[Configuration] = [
|
||||
Configuration(
|
||||
ConfigBool(
|
||||
id="none",
|
||||
type=ConfigDataTypes.BOOL,
|
||||
default="0",
|
||||
label="There are no parameters for the bypass model.",
|
||||
)
|
||||
|
|
|
@ -7,10 +7,9 @@ from pathlib import Path
|
|||
from typing import Set
|
||||
|
||||
from core import constants, utils
|
||||
from core.config import Configuration
|
||||
from core.config import ConfigString
|
||||
from core.emane import emanemodel
|
||||
from core.emane.nodes import EmaneNet
|
||||
from core.emulator.enumerations import ConfigDataTypes
|
||||
from core.nodes.interface import CoreInterface
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -38,9 +37,8 @@ class EmaneTdmaModel(emanemodel.EmaneModel):
|
|||
/ "share/emane/xml/models/mac/tdmaeventscheduler/tdmabasemodelpcr.xml"
|
||||
)
|
||||
super().load(emane_prefix)
|
||||
config_item = Configuration(
|
||||
config_item = ConfigString(
|
||||
id=cls.schedule_name,
|
||||
type=ConfigDataTypes.STRING,
|
||||
default=str(cls.default_schedule),
|
||||
label="TDMA schedule file (core)",
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue