Changed event saving to list.

This commit is contained in:
jupfi 2023-07-14 15:07:54 +02:00
parent 13c4910630
commit 0e755a6cc5
2 changed files with 9 additions and 6 deletions

View file

@ -33,6 +33,9 @@ class BaseSpectrometerModel(ModuleModel):
logger.debug("Setting %s changed to %s", self.name, value) logger.debug("Setting %s changed to %s", self.name, value)
self.value = value self.value = value
def get_setting(self):
return float(self.value)
class PulseParameter: class PulseParameter:
def __init__(self, name): def __init__(self, name):
self.name = name self.name = name

View file

@ -7,7 +7,7 @@ class PulseSequence:
"""A pulse sequence is a collection of events that are executed in a certain order.""" """A pulse sequence is a collection of events that are executed in a certain order."""
def __init__(self, name) -> None: def __init__(self, name) -> None:
self.name = name self.name = name
self.events = OrderedDict() self.events = list()
def get_event_names(self) -> list: def get_event_names(self) -> list:
return [event.name for event in self.events] return [event.name for event in self.events]
@ -33,16 +33,16 @@ class PulseSequence:
"name": self.name, "name": self.name,
"events": [] "events": []
} }
for event in self.events.keys(): for event in self.events:
event_data = { event_data = {
"name": self.events[event].name, "name": event.name,
"duration": self.events[event].duration, "duration": event.duration,
"parameters": [] "parameters": []
} }
for parameter in self.events[event].parameters.keys(): for parameter in event.parameters.keys():
event_data["parameters"].append({ event_data["parameters"].append({
"name": parameter, "name": parameter,
"value": self.events[event].parameters[parameter].get_options() "value": event.parameters[parameter].get_options()
}) })
data["events"].append(event_data) data["events"].append(event_data)
return data return data