def __init__(self, status_dict: dict, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.vlayout = QtWidgets.QVBoxLayout()
        self.table = QtWidgets.QTableWidget()
        self.vlayout.addWidget(self.table)
        self.setLayout(self.vlayout)

        self.table.setSortingEnabled(True)
        self.table.setSelectionMode(
            QtWidgets.QAbstractItemView.SingleSelection)
        self.table.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)

        self.status_dict = status_dict
        self.headr = ['SerialNumber_SectorNumber_Frequency'] + list(
            self.status_dict[list(self.status_dict.keys())[0]].keys())

        self.table.setColumnCount(len(self.headr))
        self.table.setColumnWidth(0, 250)
        for i in range(len(self.headr) - 1):
            self.table.setColumnWidth(i + 1, 100)

        self.table.setHorizontalHeaderLabels(self.headr)
        # self.table.horizontalHeader().setSectionResizeMode(0, QtWidgets.QHeaderView.Stretch)

        self.populate()
        self.setMinimumHeight(300)
        self.vlayout.layout()
    def add_line(self, line_data: list):
        if line_data:
            self.setSortingEnabled(False)
            pair_number, linename, heading = line_data
            if linename in self.row_full_attribution:
                raise Exception(
                    "ERROR: PatchTest - Unable to add line {} when this line already exists"
                    .format(linename))
            self.row_full_attribution[linename] = [pair_number, heading]
            next_row = self.rowCount()
            self.insertRow(next_row)

            for column_index, column_data in enumerate(line_data):
                if column_index == 0:
                    item = QtWidgets.QComboBox()
                    item.addItems([str(i) for i in range(0, 15)])
                    item.setCurrentText(str(column_data))
                    self.setCellWidget(next_row, column_index, item)
                else:
                    if column_index == 2:  # heading
                        item = QtWidgets.QTableWidgetItem('{:3.3f}'.format(
                            float(column_data)).zfill(7))
                    else:
                        item = QtWidgets.QTableWidgetItem(str(column_data))
                    self.setItem(next_row, column_index, item)
            self.setSortingEnabled(True)
Exemple #3
0
    def __init__(self, parent):
        super().__init__(parent)

        self.layout = QtWidgets.QHBoxLayout()

        self.list_widget = DeletableListWidget(self)
        list_size_policy = QtWidgets.QSizePolicy(
            QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred)
        list_size_policy.setHorizontalStretch(2)
        self.list_widget.setSizePolicy(list_size_policy)
        self.layout.addWidget(self.list_widget)

        self.button_layout = QtWidgets.QVBoxLayout()
        self.button_layout.addStretch(1)
        self.insert_button = QtWidgets.QPushButton("Insert", self)
        self.button_layout.addWidget(self.insert_button)
        self.remove_button = QtWidgets.QPushButton("Remove", self)
        self.button_layout.addWidget(self.remove_button)
        self.button_layout.addStretch(1)
        self.layout.addLayout(self.button_layout)

        self.setLayout(self.layout)

        self.opts = {}
        self.setup()
        self.insert_button.clicked.connect(self.file_browse)
        self.remove_button.clicked.connect(self.remove_item)
        self.list_widget.files_updated.connect(self.files_changed)
    def __init__(self, parent=None):
        super().__init__(parent)

        self.resize(800, 400)
        self.setWindowTitle('Kluster Output Window')
        self.top_widget = QtWidgets.QWidget()
        self.setCentralWidget(self.top_widget)
        layout = QtWidgets.QHBoxLayout()
        self.top_widget.setLayout(layout)

        self.k_output = KlusterOutput(self)
        self.k_output.moveCursor(QtGui.QTextCursor.Start)
        self.k_output.setLineWrapColumnOrWidth(500)
        self.k_output.setLineWrapMode(QtWidgets.QTextEdit.FixedPixelWidth)
        self.k_output.setSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                    QtWidgets.QSizePolicy.Expanding)
        layout.addWidget(self.k_output)

        layout.layout()
        self.setLayout(layout)
        self.centralWidget().setLayout(layout)
        self.show()

        print('test stdout', file=sys.stdout)
        print('test stderr', file=sys.stderr)
Exemple #5
0
    def __init__(self, parent=None):
        super().__init__()
        self.parent = parent
        self.vlayout = QtWidgets.QVBoxLayout()
        self.total_files = []
        self.total_monitors = 20
        self.monitors = []
        self.file_buffer = []
        self.seen_files = []

        scroll = QtWidgets.QScrollArea()

        scroll_content = QtWidgets.QWidget()
        scroll_layout = QtWidgets.QVBoxLayout(scroll_content)
        scroll_content.setLayout(scroll_layout)

        for i in range(self.total_monitors):
            if self.parent is not None:
                self.monitors.append(MonitorPath(self))
            else:
                self.monitors.append(MonitorPath())
            scroll_layout.addWidget(self.monitors[i])

        scroll.setWidget(scroll_content)
        scroll.setWidgetResizable(True)
        self.vlayout.addWidget(scroll)
        scroll_layout.addStretch(1)

        self.setLayout(self.vlayout)
    def __init__(self, multibeam_dict: dict, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.vlayout = QtWidgets.QVBoxLayout()
        self.table = QtWidgets.QTableWidget()
        self.vlayout.addWidget(self.table)
        self.setLayout(self.vlayout)

        self.table.setSortingEnabled(True)
        self.table.setSelectionMode(
            QtWidgets.QAbstractItemView.SingleSelection)
        self.table.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
        self.table.setColumnCount(3)
        self.table.setColumnWidth(0, 350)
        self.table.setColumnWidth(1, 200)
        self.table.setColumnWidth(2, 200)

        self.table.setHorizontalHeaderLabels([
            'Multibeam File Name', 'Multibeam Start Time', 'Multibeam End Time'
        ])
        self.table.horizontalHeader().setSectionResizeMode(
            0, QtWidgets.QHeaderView.Stretch)

        self.multibeam_dict = multibeam_dict
        self.populate()
        self.setMinimumHeight(600)
        self.vlayout.layout()
 def contextMenuEvent(self, event):
     mymenu = QtWidgets.QMenu(self)
     copy_action = QtWidgets.QAction('Copy', self)
     copy_action.triggered.connect(self.copy_data)
     mymenu.addAction(copy_action)
     mymenu.popup(QtGui.QCursor.pos())
     self._tablewithcopy_pos = event.pos()
    def __init__(self, lastrun_dict: dict, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.vlayout = QtWidgets.QVBoxLayout()
        self.table = QtWidgets.QTableWidget()
        self.vlayout.addWidget(self.table)
        self.setLayout(self.vlayout)

        self.table.setSortingEnabled(True)
        self.table.setSelectionMode(
            QtWidgets.QAbstractItemView.SingleSelection)
        self.table.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)

        self.lastrun_dict = lastrun_dict
        self.headr = ['SerialNumber_SectorNumber_Frequency'] + [
            x[1:] + '_utc' for x in list(self.lastrun_dict[list(
                self.lastrun_dict.keys())[0]].keys())
        ]

        self.table.setColumnCount(len(self.headr))
        self.table.setColumnWidth(0, 250)
        self.table.setColumnWidth(1, 160)
        self.table.setColumnWidth(2, 200)
        self.table.setColumnWidth(3, 215)
        self.table.setColumnWidth(4, 215)
        self.table.setColumnWidth(5, 230)
        self.table.setColumnWidth(6, 200)

        self.table.setHorizontalHeaderLabels(self.headr)
        # self.table.horizontalHeader().setSectionResizeMode(0, QtWidgets.QHeaderView.Stretch)

        self.populate()
        self.setMinimumHeight(300)
        self.vlayout.layout()
    def __init__(self, parent=None):
        super().__init__(parent)

        self.resize(450, 800)
        self.setWindowTitle('Kluster Project Tree')
        self.top_widget = QtWidgets.QWidget()
        self.setCentralWidget(self.top_widget)
        layout = QtWidgets.QHBoxLayout()
        self.top_widget.setLayout(layout)

        self.project = FqprProject()

        self.k_tree = KlusterProjectTree(self)
        self.k_tree.setObjectName('kluster_project_tree')
        self.k_tree.setSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                  QtWidgets.QSizePolicy.Expanding)
        self.k_tree.setMinimumWidth(300)
        layout.addWidget(self.k_tree)

        self.k_tree.file_added.connect(self.update_ktree)

        layout.layout()
        self.setLayout(layout)
        self.centralWidget().setLayout(layout)
        self.show()
 def populate(self):
     for sector, counts in self.status_dict.items():
         status_values = list(counts.values())
         next_row = self.table.rowCount()
         self.table.insertRow(next_row)
         self.table.setItem(next_row, 0, QtWidgets.QTableWidgetItem(sector))
         for cnt, val in enumerate(status_values):
             self.table.setItem(next_row, cnt + 1,
                                QtWidgets.QTableWidgetItem(str(val)))
    def __init__(self, parent=None, settings=None):
        super().__init__(parent)
        self.external_settings = settings

        self.parent = parent
        self.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
        self.model = QtGui.QStandardItemModel()  # row can be 0 even when there are more than 0 rows
        self.setModel(self.model)
        self.setUniformRowHeights(False)
        self.setAcceptDrops(False)
        self.viewport().setAcceptDrops(False)  # viewport is the total rendered area, this is recommended from my reading

        # ExtendedSelection - allows multiselection with shift/ctrl
        self.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
        self.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)

        # set up the context menu per item
        self.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
        self.right_click_menu_files = None
        self.setup_menu()

        # makes it so no editing is possible with the table
        self.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)

        self.categories = ['Next Action', 'All Actions', 'Queued Files', 'Unmatched Files']
        self.tree_data = {}
        self.actions = None
        self.unmatched = None
        self.exclude_buffer = []

        self.start_button = QtWidgets.QPushButton('Start Process')
        self.start_button.clicked.connect(self.start_process)
        self.start_button.setDisabled(True)

        self.auto_checkbox = QtWidgets.QCheckBox('Auto')
        self.auto_checkbox.setCheckable(True)
        self.auto_checkbox.clicked.connect(self.auto_process)

        self.button_widget = QtWidgets.QWidget()
        self.button_sizer = QtWidgets.QHBoxLayout()
        self.button_sizer.addWidget(self.start_button)
        self.button_sizer.addWidget(self.auto_checkbox)
        self.button_sizer.setAlignment(QtCore.Qt.AlignLeft)
        self.button_widget.setLayout(self.button_sizer)
        self.button_widget.setToolTip('Start the action below by clicking "Start Process".\n' +
                                      'If the "Start Process" button is greyed out, there is no viable action to run.\n\n' +
                                      'If the "Auto" check box is checked, Kluster will automatically run all actions as they appear.\n' +
                                      'You will not need to use the "Start Process" button with "Auto" enabled.')

        self.stop_auto = Event()
        self.stop_auto.set()
        self.auto_thread = AutoThread(self.stop_auto, self.emit_auto_signal)

        self.customContextMenuRequested.connect(self.show_context_menu)
        self.configure()
        self.read_settings()
def main():
    sys.excepthook = uncaught_exceptions
    logging.basicConfig(level=logging.INFO)
    logging.getLogger().setLevel(logging.INFO)
    try:  # pyside2
        app = QtWidgets.QApplication()
    except TypeError:  # pyqt5
        app = QtWidgets.QApplication([])
    win = MainWindow()
    win.show()
    app.exec_()
Exemple #13
0
    def __init__(self,
                 parent: None,
                 title: str,
                 animation_duration: int,
                 set_expanded_height: int = 0):
        super().__init__(parent=parent)

        self.parent = parent
        self.animation_duration = animation_duration
        self.title = title
        self.set_expanded_height = set_expanded_height

        self.toggle_button = QtWidgets.QToolButton()
        self.header_line = QtWidgets.QFrame()
        self.toggle_animation = QtCore.QParallelAnimationGroup()
        self.content_area = QtWidgets.QScrollArea()
        self.main_layout = QtWidgets.QGridLayout()

        self.toggle_button.setStyleSheet("QToolButton { border: none; }")
        self.toggle_button.setToolButtonStyle(
            QtCore.Qt.ToolButtonTextBesideIcon)
        self.toggle_button.setArrowType(QtCore.Qt.RightArrow)
        self.toggle_button.setText(str(title))
        self.toggle_button.setCheckable(True)
        self.toggle_button.setChecked(False)

        self.header_line.setFrameShape(QtWidgets.QFrame.HLine)
        self.header_line.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.header_line.setSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                       QtWidgets.QSizePolicy.Maximum)

        self.content_area.setSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                        QtWidgets.QSizePolicy.Fixed)
        self.content_area.setMaximumHeight(0)
        self.content_area.setMinimumHeight(0)

        self.toggle_animation.addAnimation(
            QtCore.QPropertyAnimation(self, b'minimumHeight'))
        self.toggle_animation.addAnimation(
            QtCore.QPropertyAnimation(self, b'maximumHeight'))
        self.toggle_animation.addAnimation(
            QtCore.QPropertyAnimation(self.content_area, b'maximumHeight'))

        self.main_layout.setVerticalSpacing(0)
        self.main_layout.setContentsMargins(0, 0, 0, 0)

        self.main_layout.addWidget(self.toggle_button, 0, 0, 1, 1,
                                   QtCore.Qt.AlignLeft)
        self.main_layout.addWidget(self.header_line, 0, 2, 1, 1)
        self.main_layout.addWidget(self.content_area, 1, 0, 1, 3)
        self.setLayout(self.main_layout)

        self.toggle_button.toggled.connect(self.toggle)
    def setup_menu(self):
        """
        Setup the menu that is generated on right clicking in the action tree.
        """
        self.right_click_menu_files = QtWidgets.QMenu('menu', self)

        exclude_dat = QtWidgets.QAction('Exclude File', self)
        exclude_dat.triggered.connect(self.exclude_file_event)
        undo_exclude_dat = QtWidgets.QAction('Undo Exclude', self)
        undo_exclude_dat.triggered.connect(self.undo_exclude)

        self.right_click_menu_files.addAction(exclude_dat)
        self.right_click_menu_files.addAction(undo_exclude_dat)
Exemple #15
0
 def add_line(self, line_data: list):
     if line_data:
         next_row = self.rowCount()
         self.insertRow(next_row)
         self.row_full_attribution.append(line_data)
         for column_index, _ in enumerate(self.headr):
             if column_index == 0:
                 item = QtWidgets.QCheckBox()
                 self.setCellWidget(next_row, column_index, item)
             else:
                 item = QtWidgets.QTableWidgetItem(
                     str(line_data[column_index - 1]))
                 self.setItem(next_row, column_index, item)
    def __init__(self, parent, fqpr_inst: Fqpr, *args, **kwargs):
        super().__init__(*args, **kwargs)

        self.parent = parent

        # fqpr = fully qualified ping record, the term for the datastore in kluster
        self.fqpr_inst = fqpr_inst
        self.dashboard_data = fqpr_inst.return_processing_dashboard()

        self.vlayout = QtWidgets.QVBoxLayout()
        self.tree = QtWidgets.QTreeWidget()
        self.tree.setHeaderHidden(True)

        mfile = QtWidgets.QTreeWidgetItem(['multibeam files'])
        l1 = QtWidgets.QTreeWidgetItem(mfile)
        self.mfile_table = MultibeamTable(
            self.dashboard_data['multibeam_files'])
        self.tree.setItemWidget(l1, 0, self.mfile_table)
        self.tree.addTopLevelItem(mfile)

        sstatus = QtWidgets.QTreeWidgetItem(['sounding status'])
        l2 = QtWidgets.QTreeWidgetItem(sstatus)
        self.soundingstatus_table = StatusTable(
            self.dashboard_data['sounding_status'])
        self.tree.setItemWidget(l2, 0, self.soundingstatus_table)
        self.tree.addTopLevelItem(sstatus)

        lrun = QtWidgets.QTreeWidgetItem(['last run process'])
        l3 = QtWidgets.QTreeWidgetItem(lrun)
        self.lastrun_table = LastRunTable(self.dashboard_data['last_run'])
        self.tree.setItemWidget(l3, 0, self.lastrun_table)
        self.tree.addTopLevelItem(lrun)

        self.vlayout.addWidget(self.tree)
        self.setLayout(self.vlayout)
    def __init__(self, parent=None, settings=None):
        super().__init__(parent)
        self.external_settings = settings

        self.setWindowTitle('Settings')
        layout = QtWidgets.QVBoxLayout()

        self.parallel_write = QtWidgets.QCheckBox('Enable Parallel Writes')
        self.parallel_write.setChecked(True)

        self.hlayout_one = QtWidgets.QHBoxLayout()
        self.vdatum_label = QtWidgets.QLabel('VDatum Directory')
        self.hlayout_one.addWidget(self.vdatum_label)
        self.vdatum_text = QtWidgets.QLineEdit('', self)
        self.vdatum_text.setReadOnly(True)
        self.hlayout_one.addWidget(self.vdatum_text)
        self.browse_button = QtWidgets.QPushButton("Browse", self)
        self.hlayout_one.addWidget(self.browse_button)

        self.status_msg = QtWidgets.QLabel('')
        self.status_msg.setStyleSheet("QLabel { " +
                                      kluster_variables.error_color + "; }")

        self.hlayout_five = QtWidgets.QHBoxLayout()
        self.hlayout_five.addStretch(1)
        self.ok_button = QtWidgets.QPushButton('OK', self)
        self.hlayout_five.addWidget(self.ok_button)
        self.hlayout_five.addStretch(1)
        self.cancel_button = QtWidgets.QPushButton('Cancel', self)
        self.hlayout_five.addWidget(self.cancel_button)
        self.hlayout_five.addStretch(1)

        layout.addWidget(self.parallel_write)
        layout.addLayout(self.hlayout_one)
        layout.addStretch()
        layout.addWidget(self.status_msg)
        layout.addLayout(self.hlayout_five)
        self.setLayout(layout)

        self.vdatum_pth = None

        self.canceled = False

        self.browse_button.clicked.connect(self.vdatum_browse)
        self.ok_button.clicked.connect(self.start)
        self.cancel_button.clicked.connect(self.cancel)

        self.read_settings()
        self._refresh_error_message()
        self.resize(600, 150)
Exemple #18
0
    def setup_menu(self):
        """
        Build the right click menu for added lines
        """

        self.right_click_menu = QtWidgets.QMenu('menu', self)

        close_dat = QtWidgets.QAction('Close', self)
        close_dat.triggered.connect(self.right_click_close_row)
        show_explorer = QtWidgets.QAction('Open Explorer', self)
        show_explorer.triggered.connect(self.show_file_in_explorer)

        self.right_click_menu.addAction(close_dat)
        self.right_click_menu.addAction(show_explorer)
    def __init__(self, param=None):
        """Main Window for holding the Vispy Canvas and the parameter
        control menu.
        """
        QtWidgets.QMainWindow.__init__(self)

        self.resize(1067, 800)
        icon = load_data_file('wiggly_bar/spring.ico')
        self.setWindowIcon(QtGui.QIcon(icon))
        self.setWindowTitle('Nonlinear Physical Model Simulation')

        self.parameter_object = SetupWidget(self)
        self.parameter_object.param = (param if param is not None else
                                       self.parameter_object.param)
        self.parameter_object.changed_parameter_sig.connect(self.update_view)

        self.view_box = WigglyBar(**self.parameter_object.param.props)

        self.view_box.create_native()
        self.view_box.native.setParent(self)

        splitter = QtWidgets.QSplitter(QtCore.Qt.Horizontal)
        splitter.addWidget(self.parameter_object)
        splitter.addWidget(self.view_box.native)

        self.setCentralWidget(splitter)
    def __init__(self, parent=None):
        super().__init__(parent)

        self.first_position = 1
        self.second_position = 8

        self.opt = QtWidgets.QStyleOptionSlider()
        self.opt.minimum = 0
        self.opt.maximum = 10

        self.setTickPosition(QtWidgets.QSlider.TicksAbove)
        self.setTickInterval(1)

        self.setSizePolicy(
            QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Slider)
        )
 def contextMenuEvent(self, e: QtGui.QContextMenuEvent) -> None:
     # add a clear action
     menu = self.createStandardContextMenu(e.pos())
     newaction = QtWidgets.QAction('Clear', self)
     newaction.triggered.connect(self._clr_window)
     menu.addAction(newaction)
     menu.exec(e.globalPos())
    def __init__(self, parent=None):
        super().__init__(parent)

        self.top_widget = QtWidgets.QWidget()
        self.setCentralWidget(self.top_widget)
        layout = QtWidgets.QHBoxLayout()
        self.top_widget.setLayout(layout)

        self.k_view = KlusterProjectView()
        self.k_view.setObjectName('kluster_projectview')
        layout.addWidget(self.k_view)

        layout.layout()
        self.setLayout(layout)
        self.centralWidget().setLayout(layout)
        self.show()
 def populate(self):
     for mbesfile, times in self.multibeam_dict.items():
         next_row = self.table.rowCount()
         self.table.insertRow(next_row)
         self.table.setItem(next_row, 0,
                            QtWidgets.QTableWidgetItem(mbesfile))
         self.table.setItem(
             next_row, 1,
             QtWidgets.QTableWidgetItem(
                 datetime.fromtimestamp(times[0],
                                        tz=timezone.utc).strftime('%c')))
         self.table.setItem(
             next_row, 2,
             QtWidgets.QTableWidgetItem(
                 datetime.fromtimestamp(times[1],
                                        tz=timezone.utc).strftime('%c')))
    def __init__(self, parent=None):
        super().__init__(parent)

        self.setWindowTitle('Kluster Monitor')
        self.top_widget = QtWidgets.QWidget()
        self.setCentralWidget(self.top_widget)
        layout = QtWidgets.QHBoxLayout()
        self.top_widget.setLayout(layout)

        self.k_monitor = KlusterMonitor(self)
        layout.addWidget(self.k_monitor)

        layout.layout()
        self.setLayout(layout)
        self.centralWidget().setLayout(layout)
        self.show()
    def populate_explorer_with_lines(self, linename, raw_attrs):
        """
        Uses line name and attribution for the project that line is associated with.

        Returns translated attribution for that line.  If it is the first time seeing this line, will build out
        all the line attribution for all lines in raw_attrs

        Parameters
        ----------
        linename: str, line name
        raw_attrs: dict, attribution of fqpr_generation.Fqpr instance that the linename is in
        """

        self.setSortingEnabled(False)
        if self.mode != 'line':
            self.set_mode('line')
        line_data = self.build_line_attribution(linename, raw_attrs)
        if line_data is not None:
            next_row = self.rowCount()
            self.insertRow(next_row)

            for column_index, column_data in enumerate(line_data):
                item = QtWidgets.QTableWidgetItem(line_data[column_data])

                if self.headr[column_index] == 'Source':
                    item.setToolTip(raw_attrs['output_path'])

                self.setItem(next_row, column_index, item)
        self.setSortingEnabled(True)
    def __init__(self, parent=None):
        super().__init__(parent)

        self.parent = parent
        self.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
        self.model = QtGui.QStandardItemModel(
        )  # row can be 0 even when there are more than 0 rows
        self.setModel(self.model)
        self.setUniformRowHeights(False)
        self.setAcceptDrops(False)
        self.viewport().setAcceptDrops(
            False
        )  # viewport is the total rendered area, this is recommended from my reading

        # ExtendedSelection - allows multiselection with shift/ctrl
        self.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
        self.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)

        # set up the context menu per item
        self.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
        self.right_click_menu_files = None
        self.setup_menu()

        # makes it so no editing is possible with the table
        self.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)

        self.categories = [
            'Next Action', 'All Actions', 'Queued Files', 'Unmatched Files'
        ]
        self.tree_data = {}
        self.actions = None
        self.unmatched = None
        self.exclude_buffer = []

        self.start_button = QtWidgets.QPushButton('Start Process')
        self.start_button.setMinimumWidth(120)
        self.start_button.setMaximumWidth(150)
        self.start_button.setMinimumHeight(30)
        self.start_button.clicked.connect(self.start_process)
        self.start_button.setDisabled(True)

        self.progress = QtWidgets.QProgressBar(self)
        self.progress.setMaximum(1)
        self.progress.setMinimum(0)

        self.customContextMenuRequested.connect(self.show_context_menu)
        self.configure()
    def __init__(self, parent: QtWidgets.QWidget = None):
        """
        initialize

        Parameters
        ----------
        parent
            MonitorDashboard
        """
        super().__init__()

        self.parent = parent
        self.vlayout = QtWidgets.QVBoxLayout()

        self.hlayoutone = QtWidgets.QHBoxLayout()
        self.statuslight = QtWidgets.QCheckBox('')
        self.statuslight.setStyleSheet(
            "QCheckBox::indicator {background-color : black;}")
        self.statuslight.setDisabled(True)
        self.hlayoutone.addWidget(self.statuslight)
        self.fil_text = QtWidgets.QLineEdit('')
        self.fil_text.setReadOnly(True)
        self.hlayoutone.addWidget(self.fil_text)
        self.browse_button = QtWidgets.QPushButton("Browse")
        self.hlayoutone.addWidget(self.browse_button)

        self.hlayouttwo = QtWidgets.QHBoxLayout()
        self.start_button = QtWidgets.QPushButton('Start')
        self.hlayouttwo.addWidget(self.start_button)
        self.stop_button = QtWidgets.QPushButton('Stop')
        self.hlayouttwo.addWidget(self.stop_button)
        spcr = QtWidgets.QLabel('    ')
        self.hlayouttwo.addWidget(spcr)
        self.include_subdirectories = QtWidgets.QCheckBox(
            'Include Subdirectories')
        self.hlayouttwo.addWidget(self.include_subdirectories)

        self.vlayout.addLayout(self.hlayoutone)
        self.vlayout.addLayout(self.hlayouttwo)
        self.setLayout(self.vlayout)

        self.browse_button.clicked.connect(self.dir_browse)
        self.start_button.clicked.connect(self.start_monitoring)
        self.stop_button.clicked.connect(self.stop_monitoring)

        self.monitor = None
Exemple #28
0
    def __init__(self):
        """
        Build out the dock widgets with the kluster widgets inside.  Will use QSettings object to retain size and
        position.
        """

        super().__init__()

        self.setWindowTitle('Kluster Intelligence')
        self.setDockNestingEnabled(True)

        self.iconpath = os.path.join(
            os.path.dirname(os.path.dirname(__file__)), 'images',
            'kluster_img.ico')
        self.setWindowIcon(QtGui.QIcon(self.iconpath))

        self.widget_obj_names = []

        self.project = fqpr_project.FqprProject(
            is_gui=False
        )  # is_gui controls the progress bar text, used to disable it for gui, no longer

        # fqpr = fully qualified ping record, the term for the datastore in kluster
        self.intelligence = fqpr_intelligence.FqprIntel(project=self.project)

        self.action_tab = ActionTab(self)
        self.monitor_dashboard = MonitorDashboard(self)
        self.project_view = kluster_projectview.KlusterProjectView(self)

        self.multibeam_intel = MultibeamIntel()
        self.nav_intel = NavIntel()
        self.naverror_intel = NavErrorIntel()
        self.navlog_intel = NavLogIntel()
        self.svp_intel = SvpIntel()

        self.lyout = QtWidgets.QGridLayout()
        self.top_widget = QtWidgets.QWidget()
        self.intel_tab = IntelTab()
        self.output_window = IntelOutput()

        self.setup_widgets()
        self.setup_signals()

        self.seen_files = []
        self.intelligence.bind_to_action_update(self.action_tab.update_actions)
Exemple #29
0
    def __init__(self, parent=None):
        super().__init__(parent)

        self.setWindowTitle('Test Window')
        self.top_widget = PlotDataHandler()
        self.setCentralWidget(self.top_widget)
        layout = QtWidgets.QHBoxLayout()
        self.top_widget.setLayout(layout)

        layout.layout()
        self.setLayout(layout)
        self.show()
    def setup_menu(self):
        """
        Setup the menu that is generated on right clicking in the project tree.
        """
        self.right_click_menu_converted = QtWidgets.QMenu('menu', self)
        self.right_click_menu_surfaces = QtWidgets.QMenu('menu', self)

        close_dat = QtWidgets.QAction('Close', self)
        close_dat.triggered.connect(self.close_item_event)
        load_in_console = QtWidgets.QAction('Load in console', self)
        load_in_console.triggered.connect(self.load_in_console_event)
        zoom_extents = QtWidgets.QAction('Zoom Extents', self)
        zoom_extents.triggered.connect(self.zoom_extents_event)

        self.right_click_menu_converted.addAction(close_dat)
        self.right_click_menu_converted.addAction(load_in_console)
        self.right_click_menu_converted.addAction(zoom_extents)

        self.right_click_menu_surfaces.addAction(close_dat)
        self.right_click_menu_surfaces.addAction(load_in_console)
        self.right_click_menu_surfaces.addAction(zoom_extents)