2023-07-10 07:44:55 +00:00
|
|
|
import logging
|
|
|
|
from collections import OrderedDict
|
|
|
|
from PyQt6.QtCore import pyqtSignal
|
2023-07-07 13:07:27 +00:00
|
|
|
from nqrduck.module.module_model import ModuleModel
|
|
|
|
|
2023-07-10 07:44:55 +00:00
|
|
|
logger = logging.getLogger(__name__)
|
2023-07-07 13:07:27 +00:00
|
|
|
|
|
|
|
class PulseProgrammerModel(ModuleModel):
|
2023-07-10 07:44:55 +00:00
|
|
|
pulse_parameter_options_changed = pyqtSignal()
|
2023-07-10 14:29:42 +00:00
|
|
|
events_changed = pyqtSignal()
|
2023-07-10 07:44:55 +00:00
|
|
|
|
|
|
|
def __init__(self, module):
|
|
|
|
super().__init__(module)
|
|
|
|
self.pulse_parameter_options = OrderedDict()
|
|
|
|
self.events = []
|
|
|
|
|
2023-07-10 14:29:42 +00:00
|
|
|
def add_event(self, event_name):
|
|
|
|
self.events.append(event_name)
|
|
|
|
self.events_changed.emit()
|
|
|
|
|
2023-07-10 07:44:55 +00:00
|
|
|
@property
|
|
|
|
def events(self):
|
|
|
|
return self._events
|
|
|
|
|
|
|
|
@events.setter
|
|
|
|
def events(self, value):
|
|
|
|
self._events = value
|
2023-07-10 14:29:42 +00:00
|
|
|
self.events_changed.emit()
|
2023-07-10 07:44:55 +00:00
|
|
|
|
|
|
|
@property
|
|
|
|
def pulse_parameter_options(self):
|
|
|
|
return self._pulse_parameter_options
|
|
|
|
|
|
|
|
@pulse_parameter_options.setter
|
|
|
|
def pulse_parameter_options(self, value):
|
|
|
|
self._pulse_parameter_options = value
|
|
|
|
logger.debug("Pulse parameter options changed - emitting signal")
|
|
|
|
self.pulse_parameter_options_changed.emit()
|