initial changes to mark older style services as deprecated and make configurable services the defaults for the python gui, added attribute to still allow supporting the legacy gui for time being and logic to compensate

This commit is contained in:
Blake Harnden 2021-05-07 13:10:05 -07:00
parent ca8b4f1f6e
commit ad09bd5504
12 changed files with 24 additions and 15 deletions

View file

@ -393,7 +393,7 @@ class CoreClient:
self.client.connect()
# get current core configurations services/config services
core_config = self.client.get_config()
self.emane_models = core_config.emane_models
self.emane_models = sorted(core_config.emane_models)
for service in core_config.services:
group_services = self.services.setdefault(service.group, set())
group_services.add(service.name)
@ -664,12 +664,12 @@ class CoreClient:
)
if nutils.is_custom(node):
services = nutils.get_custom_services(self.app.guiconfig, model)
node.services = set(services)
node.config_services = set(services)
# assign default services to CORE node
else:
services = self.session.default_services.get(model)
if services:
node.services = services.copy()
node.config_services = services.copy()
logger.info(
"add node(%s) to session(%s), coordinates(%s, %s)",
node.name,

View file

@ -116,7 +116,7 @@ class EmaneConfigDialog(Dialog):
self.radiovar.set(1)
self.emane_models: List[str] = [
x.split("_")[1] for x in sorted(self.app.core.emane_models)
x.split("_")[1] for x in self.app.core.emane_models
]
model = self.emane_models[0]
self.emane_model: tk.StringVar = tk.StringVar(value=model)

View file

@ -17,7 +17,7 @@ if TYPE_CHECKING:
class NodeServiceDialog(Dialog):
def __init__(self, app: "Application", node: Node) -> None:
title = f"{node.name} Services"
title = f"{node.name} Services (Deprecated)"
super().__init__(app, title)
self.node: Node = node
self.groups: Optional[ListboxScroll] = None

View file

@ -28,7 +28,7 @@ class ServiceConfigDialog(Dialog):
def __init__(
self, master: tk.BaseWidget, app: "Application", service_name: str, node: Node
) -> None:
title = f"{service_name} Service"
title = f"{service_name} Service (Deprecated)"
super().__init__(app, title, master=master)
self.core: "CoreClient" = app.core
self.node: Node = node

View file

@ -255,10 +255,12 @@ class CanvasNode:
else:
self.context.add_command(label="Configure", command=self.show_config)
if nutils.is_container(self.core_node):
self.context.add_command(label="Services", command=self.show_services)
self.context.add_command(
label="Config Services", command=self.show_config_services
)
self.context.add_command(
label="Services (Deprecated)", command=self.show_services
)
if is_emane:
self.context.add_command(
label="EMANE Config", command=self.show_emane_config