Commit b8a0643c authored by Milosz Malczak's avatar Milosz Malczak

gui: adc_label made private

parent 106a4070
...@@ -14,14 +14,14 @@ class ChannelClosure: ...@@ -14,14 +14,14 @@ class ChannelClosure:
def __init__(self, channel_inputs_layout, ver_set_layout, zmq_rpc, def __init__(self, channel_inputs_layout, ver_set_layout, zmq_rpc,
plot, GUI_name, channel_count, update_triggers, GUI): plot, GUI_name, channel_count, update_triggers, GUI):
self.adc_label = QLabel("") self.__adc_label = QLabel("")
self.adc_label.setAlignment(Qt.AlignCenter | Qt.AlignVCenter) self.__adc_label.setAlignment(Qt.AlignCenter | Qt.AlignVCenter)
self.channel_label = QLabel("") self.channel_label = QLabel("")
self.channel_label.setAlignment(Qt.AlignCenter | Qt.AlignVCenter) self.channel_label.setAlignment(Qt.AlignCenter | Qt.AlignVCenter)
self.menu = ChannelsMenu(self, channel_count, plot, self.adc_label, self.menu = ChannelsMenu(self, channel_count, plot, self.__adc_label,
self.channel_label, GUI) self.channel_label, GUI)
self.channel_count = channel_count self.channel_count = channel_count
self.chan_in_layout = ChannelInputsLayout(self.menu, self.adc_label, self.chan_in_layout = ChannelInputsLayout(self.menu, self.__adc_label,
self.channel_label, self.channel_label,
channel_count) channel_count)
self.chan_in_layout.setAlignment(Qt.AlignCenter | Qt.AlignVCenter) self.chan_in_layout.setAlignment(Qt.AlignCenter | Qt.AlignVCenter)
...@@ -73,7 +73,7 @@ class ChannelClosure: ...@@ -73,7 +73,7 @@ class ChannelClosure:
contain the information that they are not connected to any of contain the information that they are not connected to any of
the ADCs""" the ADCs"""
self.set_channel_properties(None, 0) self.set_channel_properties(None, 0)
self.adc_label.setText('') self.__adc_label.setText('')
self.channel_label.setText('') self.channel_label.setText('')
def channel_exists(self): def channel_exists(self):
...@@ -133,7 +133,7 @@ class ChannelsMenu(QMenuBar): ...@@ -133,7 +133,7 @@ class ChannelsMenu(QMenuBar):
channel_label, GUI): channel_label, GUI):
super().__init__() super().__init__()
self.GUI = GUI self.GUI = GUI
self.adc_label = adc_label self.__adc_label = adc_label
self.channel_label = channel_label self.channel_label = channel_label
self.channel_count = channel_count self.channel_count = channel_count
self.channel_closure = channel_closure self.channel_closure = channel_closure
...@@ -173,7 +173,7 @@ class ChannelsMenu(QMenuBar): ...@@ -173,7 +173,7 @@ class ChannelsMenu(QMenuBar):
str_chan = self.sender().text() str_chan = self.sender().text()
idx = int(str_chan.split()[1]) idx = int(str_chan.split()[1])
display_name = self.selected_ADC.replace('._tcp.local.', '') display_name = self.selected_ADC.replace('._tcp.local.', '')
self.adc_label.setText(display_name) self.__adc_label.setText(display_name)
self.channel_label.setText(str_chan) self.channel_label.setText(str_chan)
self.channel_closure.set_channel_properties(self.selected_ADC, idx) self.channel_closure.set_channel_properties(self.selected_ADC, idx)
self.plot.add_channel(self.channel_count) self.plot.add_channel(self.channel_count)
......
...@@ -12,12 +12,12 @@ class TriggerClosure: ...@@ -12,12 +12,12 @@ class TriggerClosure:
def __init__(self, trigger_inputs_layout, trig_set_layout, zmq_rpc, def __init__(self, trigger_inputs_layout, trig_set_layout, zmq_rpc,
plot, GUI_name, GUI_trigger_idx, channels, available_ADCs, plot, GUI_name, GUI_trigger_idx, channels, available_ADCs,
GUI): GUI):
self.adc_label = QLabel("") self.__adc_label = QLabel("")
self.adc_label.setAlignment(Qt.AlignCenter | Qt.AlignVCenter) self.__adc_label.setAlignment(Qt.AlignCenter | Qt.AlignVCenter)
self.trigger_type = 'internal' # default one self.trigger_type = 'internal' # default one
self.GUI_trigger_idx = GUI_trigger_idx self.GUI_trigger_idx = GUI_trigger_idx
self.menu_type = TriggerTypeMenu(self) self.menu_type = TriggerTypeMenu(self)
self.trig_in_layout = TriggerInputsLayout(self.adc_label) self.trig_in_layout = TriggerInputsLayout(self.__adc_label)
self.trig_set_layout = TriggerSettingsLayout(self.menu_type) self.trig_set_layout = TriggerSettingsLayout(self.menu_type)
self.plot = plot self.plot = plot
self.GUI_name = GUI_name self.GUI_name = GUI_name
...@@ -50,7 +50,7 @@ class TriggerClosure: ...@@ -50,7 +50,7 @@ class TriggerClosure:
self.plot, self.channels, self.plot, self.channels,
self.GUI) self.GUI)
self.ext_trig_menu = ExtTriggersMenu(self, self.GUI_trigger_idx, self.ext_trig_menu = ExtTriggersMenu(self, self.GUI_trigger_idx,
self.adc_label, self.GUI) self.__adc_label, self.GUI)
if(self.trigger_type == 'internal'): if(self.trigger_type == 'internal'):
self.int_trig_menu.setEnabled(True) self.int_trig_menu.setEnabled(True)
self.ext_trig_menu.setEnabled(False) self.ext_trig_menu.setEnabled(False)
...@@ -66,7 +66,7 @@ class TriggerClosure: ...@@ -66,7 +66,7 @@ class TriggerClosure:
if not remote: if not remote:
self.zmq_rpc.send_RPC('remove_trigger', self.GUI_name) self.zmq_rpc.send_RPC('remove_trigger', self.GUI_name)
self.set_trigger_properties(None, 0) self.set_trigger_properties(None, 0)
self.adc_label.setText('') self.__adc_label.setText('')
self.int_trig_menu.ADCs_menu.setTitle("Select channel to trigger") self.int_trig_menu.ADCs_menu.setTitle("Select channel to trigger")
def set_trigger_properties(self, unique_ADC_name, idx=0): def set_trigger_properties(self, unique_ADC_name, idx=0):
...@@ -271,7 +271,7 @@ class ExtTriggersMenu(TriggersMenu): ...@@ -271,7 +271,7 @@ class ExtTriggersMenu(TriggersMenu):
def __init__(self, trigger_closure, GUI_trigger_idx, adc_label, GUI): def __init__(self, trigger_closure, GUI_trigger_idx, adc_label, GUI):
super().__init__(trigger_closure, GUI_trigger_idx) super().__init__(trigger_closure, GUI_trigger_idx)
self.ADCs_menu = self.addMenu("Select external trigger") self.ADCs_menu = self.addMenu("Select external trigger")
self.adc_label = adc_label self.__adc_label = adc_label
self.GUI = GUI self.GUI = GUI
def update_triggers(self): def update_triggers(self):
...@@ -294,7 +294,7 @@ class ExtTriggersMenu(TriggersMenu): ...@@ -294,7 +294,7 @@ class ExtTriggersMenu(TriggersMenu):
self.remove_trigger() self.remove_trigger()
self.trigger_closure.set_trigger_properties(self.selected_ADC) self.trigger_closure.set_trigger_properties(self.selected_ADC)
display_name = self.selected_ADC.replace('._tcp.local.', '') display_name = self.selected_ADC.replace('._tcp.local.', '')
self.adc_label.setText(display_name) self.__adc_label.setText(display_name)
rpc = self.trigger_closure rpc = self.trigger_closure
rpc.zmq_rpc.send_RPC('add_trigger', 'external', selected_ADC, ADC_idx, rpc.zmq_rpc.send_RPC('add_trigger', 'external', selected_ADC, ADC_idx,
self.trigger_closure.GUI_name) self.trigger_closure.GUI_name)
...@@ -305,7 +305,7 @@ class TriggerInputsLayout(QVBoxLayout): ...@@ -305,7 +305,7 @@ class TriggerInputsLayout(QVBoxLayout):
def __init__(self, adc_label): def __init__(self, adc_label):
super().__init__() super().__init__()
self.adc_label = adc_label self.__adc_label = adc_label
self.menu = None self.menu = None
self.ADCs = {} self.ADCs = {}
self.trigger = None self.trigger = None
...@@ -315,7 +315,7 @@ class TriggerInputsLayout(QVBoxLayout): ...@@ -315,7 +315,7 @@ class TriggerInputsLayout(QVBoxLayout):
self.menu.deleteLater() self.menu.deleteLater()
self.menu = menu self.menu = menu
self.addWidget(self.menu) self.addWidget(self.menu)
self.addWidget(self.adc_label) self.addWidget(self.__adc_label)
class TriggerSettingsLayout(QVBoxLayout): class TriggerSettingsLayout(QVBoxLayout):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment