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)
self.value = value
def get_setting(self):
return float(self.value)
class PulseParameter:
def __init__(self, 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."""
def __init__(self, name) -> None:
self.name = name
self.events = OrderedDict()
self.events = list()
def get_event_names(self) -> list:
return [event.name for event in self.events]
@ -33,16 +33,16 @@ class PulseSequence:
"name": self.name,
"events": []
}
for event in self.events.keys():
for event in self.events:
event_data = {
"name": self.events[event].name,
"duration": self.events[event].duration,
"name": event.name,
"duration": event.duration,
"parameters": []
}
for parameter in self.events[event].parameters.keys():
for parameter in event.parameters.keys():
event_data["parameters"].append({
"name": parameter,
"value": self.events[event].parameters[parameter].get_options()
"value": event.parameters[parameter].get_options()
})
data["events"].append(event_data)
return data