Skip to content

Commit

Permalink
Merge pull request sandialabs#32 from zachbthomas/add_subtype
Browse files Browse the repository at this point in the history
Updated sceptre app to add field device config option 'subtype'
  • Loading branch information
GhostofGoes authored May 9, 2024
2 parents 6ad9aee + f7ef601 commit 87c29e5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/python/phenix_apps/apps/sceptre/configs/configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def get_fdconfig_class(infrastructure: str) -> type:
raise error.AppError(f"Infrastructure: {infrastructure} not supported")

class FieldDeviceConfig(base_class):
def __init__(self, provider, name: str, interfaces, devices_by_protocol, publish_endpoint, server_endpoint, reg_config, counter):
def __init__(self, provider, name: str, interfaces, devices_by_protocol, publish_endpoint, server_endpoint, device_subtype, reg_config, counter):
super().__init__()
if name in reg_config.keys():
self.reg_config = reg_config[name]
Expand All @@ -36,6 +36,7 @@ def __init__(self, provider, name: str, interfaces, devices_by_protocol, publish
self.protocols = self.__generate_protocols(devices_by_protocol, base_class)
self.server_endpoint = server_endpoint
self.publish_endpoint = publish_endpoint
self.device_subtype = device_subtype
self.counter = counter

def __generate_protocols(self, devices_by_protocol: dict, base_class: type) -> list:
Expand Down
2 changes: 2 additions & 0 deletions src/python/phenix_apps/apps/sceptre/sceptre.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,7 @@ def pre_start(self):
srv_name = fd_.metadata.get("server_hostname", None)
fd_logic = fd_.metadata.get("logic", None)
fd_cycle_time = fd_.metadata.get("cycle_time", None)
subtype = fd_.metadata.get("subtype", "single")
parsed = SceptreMetadataParser(fd_.metadata)

if self.is_power_provider(provider):
Expand Down Expand Up @@ -766,6 +767,7 @@ def pre_start(self):
devices_by_protocol=parsed.devices_by_protocol,
publish_endpoint=pub_endpoint,
server_endpoint=srv_endpoint,
device_subtype=subtype,
reg_config=reg_config,
counter=fd_counter,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def intercambio(dictionary, string):
<rpoll-rate>2</rpoll-rate>
<endpoint>tcp://${fd_config.ipaddr}:2404</endpoint>
<event-logging>${fd_config.name}-104-outstation.log</event-logging>
<subtype>${fd_config.device_subtype}</subtype>
% else:
<NOT IMPLEMENTED ERROR!>
% endif
Expand Down

0 comments on commit 87c29e5

Please sign in to comment.