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
|
@ -5,10 +5,9 @@ import logging
|
|||
from pathlib import Path
|
||||
from typing import Dict, List, Optional, Set
|
||||
|
||||
from core.config import ConfigGroup, Configuration
|
||||
from core.config import ConfigBool, ConfigGroup, ConfigString, Configuration
|
||||
from core.emane import emanemanifest
|
||||
from core.emulator.data import LinkOptions
|
||||
from core.emulator.enumerations import ConfigDataTypes
|
||||
from core.errors import CoreError
|
||||
from core.location.mobility import WirelessModel
|
||||
from core.nodes.interface import CoreInterface
|
||||
|
@ -55,13 +54,9 @@ class EmaneModel(WirelessModel):
|
|||
|
||||
# support for external configurations
|
||||
external_config: List[Configuration] = [
|
||||
Configuration("external", ConfigDataTypes.BOOL, default="0"),
|
||||
Configuration(
|
||||
"platformendpoint", ConfigDataTypes.STRING, default="127.0.0.1:40001"
|
||||
),
|
||||
Configuration(
|
||||
"transportendpoint", ConfigDataTypes.STRING, default="127.0.0.1:50002"
|
||||
),
|
||||
ConfigBool(id="external", default="0"),
|
||||
ConfigString(id="platformendpoint", default="127.0.0.1:40001"),
|
||||
ConfigString(id="transportendpoint", default="127.0.0.1:50002"),
|
||||
]
|
||||
|
||||
config_ignore: Set[str] = set()
|
||||
|
|
|
@ -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