Example #1
0
 def __init__(self, name, parent=None):
     # Instantiate Widget
     super().__init__(parent=parent)
     self.subdisplays = dict()
     # Instantiate UI
     self.ui = uic.loadUi(os.path.join(ui_dir, 'base.ui'), self)
     self.device_button_group = QButtonGroup()
     self.device_button_group.addButton(self.ui.hide_button)
     self.ui.hide_button.clicked.connect(self.hide_subdevices)
     # Set Label Names
     self.ui.name_label.setText(name)
     # Create Panels
     self.method_panel = FunctionPanel(parent=self)
     self.read_panel = SignalPanel("Read", parent=self)
     self.config_panel = SignalPanel("Configuration", parent=self)
     self.misc_panel = SignalPanel("Miscellaneous", parent=self)
     self.image_widget = RotatingImage()
     # Add all the panels
     self.ui.main_layout.insertWidget(2, self.read_panel)
     self.ui.main_layout.insertWidget(3, self.misc_panel)
     self.ui.widget_layout.insertWidget(0, self.image_widget)
     # Create tabs
     self.ui.signal_tab.clear()
     self.ui.signal_tab.addTab(self.config_panel, 'Configuration')
     self.ui.signal_tab.addTab(self.misc_panel, 'Miscellaneous')
     # Hide widgets until signals are added to them
     self.ui.buttons.hide()
     self.ui.component_widget.hide()
     self.method_panel.hide()
     self.ui.hint_plot.hide()
     self.image_widget.hide()
Example #2
0
 def __init__(self, parent=None):
     super().__init__(parent=parent)
     # Load generated user interface file
     self.ui = uic.loadUi(os.path.join(ui_dir, 'plot.ui'), self)
     # Connect create button
     self.create_button.clicked.connect(self.creation_requested)
     # Data structure for name / ChannelDisplay mapping
     self.channel_map = dict()
Example #3
0
 def __init__(self, name, parent=None):
     # Basic widget setup
     super().__init__(parent=parent)
     self.setCheckable(True)
     # Instantiate UI
     self.ui = uic.loadUi(os.path.join(ui_dir, 'button.ui'), self)
     self.ui.name_label.setText(name)
     self.toggled.connect(self.setChecked)
     # Store orignal stylesheet
     self.fixed_style = self.styleSheet()
Example #4
0
 def __init__(self, name, image=None, parent=None):
     # Instantiate Widget
     super().__init__(parent=parent)
     self.subdisplays = dict()
     # Instantiate UI
     self.ui = uic.loadUi(os.path.join(ui_dir, 'base.ui'), self)
     # Set Label Names
     self.ui.name_label.setText(name)
     # Create Panels
     self.method_panel = FunctionPanel(parent=self)
     self.read_panel = SignalPanel(parent=self)
     self.config_panel = SignalPanel(parent=self)
     self.misc_panel = SignalPanel(parent=self)
     # Add all the panels
     self.ui.main_layout.insertWidget(2, self.read_panel, 0,
                                      Qt.AlignHCenter)
     self.ui.main_layout.insertWidget(3, self.method_panel, 0,
                                      Qt.AlignHCenter)
     # Create tabs
     self.ui.signal_tab.clear()
     self.add_tab('Configuration', self.config_panel)
     self.add_tab('Miscellaneous', self.misc_panel)
     # Connect signals to slots
     self.ui.hide_button.clicked.connect(self.hide_subdisplays)
     self.ui.tool_list.clicked.connect(self.show_subdisplay)
     self.ui.tool_list.clicked.connect(
         self.ui.component_list.clearSelection)
     self.ui.component_list.clicked.connect(self.show_subdisplay)
     self.ui.component_list.clicked.connect(
         self.ui.tool_list.clearSelection)
     # Hide widgets until objects are added to them
     self.ui.subwindow.hide()
     self.ui.tool_sidebar.hide()
     self.ui.component_sidebar.hide()
     self.method_panel.hide()
     # Create PyDMDrawingImage
     self.image_widget = None
     if image:
         self.add_image(image)
Example #5
0
 def load_ui(self):
     f = THIS_FOLDER + '/' + self.get_ui_filename()
     self.ui = uic.loadUi(f, baseinstance=self)
     self.load_images()
Example #6
0
 def load_ui(self):
     f = macro.substitute_in_file(
         THIS_FOLDER + '/' + self.get_ui_filename(), self.fields_map)
     self.ui = uic.loadUi(f, baseinstance=self)
Example #7
0
 def __init__(self, name, color, parent=None):
     super().__init__(parent=parent)
     self.ui = uic.loadUi(os.path.join(ui_dir, 'plotitem.ui'), self)
     self.ui.name.setText(name)
     self.ui.color.brush = QBrush(color, Qt.SolidPattern)