def new_prompt(self, prompt): """ Display a new prompt, and start a new input buffer. """ self._input_state = "readline" ConsoleWidget.new_prompt(self, prompt) i = self.current_prompt_line self._markers[i] = self.MarkerAdd(i, _INPUT_MARKER)
def __init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.CLIP_CHILDREN|wx.WANTS_CHARS, styledef=None, *args, **kwds): """ Create Shell instance. Parameters ----------- styledef : dict, optional styledef is the dictionary of options used to define the style. """ if styledef is not None: self.style = styledef ConsoleWidget.__init__(self, parent, id, pos, size, style) PrefilterFrontEnd.__init__(self, **kwds) # Stick in our own raw_input: self.ipython0.raw_input = self.raw_input # A time for flushing the write buffer BUFFER_FLUSH_TIMER_ID = 100 self._buffer_flush_timer = wx.Timer(self, BUFFER_FLUSH_TIMER_ID) wx.EVT_TIMER(self, BUFFER_FLUSH_TIMER_ID, self._buffer_flush) if 'debug' in kwds: self.debug = kwds['debug'] kwds.pop('debug') # Inject self in namespace, for debug if self.debug: self.shell.user_ns['self'] = self # Inject our own raw_input in namespace self.shell.user_ns['raw_input'] = self.raw_input
def new_prompt(self, prompt): """ Display a new prompt, and start a new input buffer. """ self._input_state = 'readline' ConsoleWidget.new_prompt(self, prompt) i = self.current_prompt_line self._markers[i] = self.MarkerAdd(i, _INPUT_MARKER)
class ConsoleDockWidget(StaticDockWidget): def __init__(self, spreadsheet, parent=None): super(ConsoleDockWidget, self).__init__("Console") self.console = ConsoleWidget() self.cells = [] self.plots = [] self.console.createdPlot.connect(self.added_plot) self.console.createdPlot.connect(spreadsheet.tabController.currentWidget().totalPlotsChanged) self.console.updatedVar.connect(spreadsheet.tabController.currentWidget().totalPlotsChanged) spreadsheet.emitAllPlots.connect(self.updateAllPlots) self.setWidget(self.console) def added_plot(self, displayplot): for cell in self.cells: if displayplot.name in cell.canvas.display_names: cell.loadPlot(displayplot) break def updateAllPlots(self, cells): plots = [] self.cells = [] for cell in cells: cell = cell.containedWidget self.cells.append(cell) # cell is now a QCDATWidget plotter = cell.getPlotters() plots.extend(plotter) self.plots = plots self.console.updateAllPlots(self.plots)
def setupUi(self, ConfigurationPanel): ConfigurationPanel.setObjectName("ConfigurationPanel") ConfigurationPanel.resize(562, 480) self.verticalLayout_2 = QtWidgets.QVBoxLayout(ConfigurationPanel) self.verticalLayout_2.setObjectName("verticalLayout_2") self.header = HeaderWidget(ConfigurationPanel) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.header.sizePolicy().hasHeightForWidth()) self.header.setSizePolicy(sizePolicy) self.header.setObjectName("header") self.verticalLayout_2.addWidget(self.header) self.line = QtWidgets.QFrame(ConfigurationPanel) self.line.setFrameShape(QtWidgets.QFrame.HLine) self.line.setFrameShadow(QtWidgets.QFrame.Sunken) self.line.setObjectName("line") self.verticalLayout_2.addWidget(self.line) self.splitter = QtWidgets.QSplitter(ConfigurationPanel) self.splitter.setOrientation(QtCore.Qt.Horizontal) self.splitter.setObjectName("splitter") self.conf_widget = ConfWidget(self.splitter) self.conf_widget.setObjectName("conf_widget") self.widget_2 = QtWidgets.QWidget(self.splitter) self.widget_2.setObjectName("widget_2") self.verticalLayout = QtWidgets.QVBoxLayout(self.widget_2) self.verticalLayout.setContentsMargins(0, 0, 0, 0) self.verticalLayout.setObjectName("verticalLayout") self.build_widget = BuildWidget(self.widget_2) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.build_widget.sizePolicy().hasHeightForWidth()) self.build_widget.setSizePolicy(sizePolicy) self.build_widget.setMinimumSize(QtCore.QSize(0, 0)) self.build_widget.setObjectName("build_widget") self.verticalLayout.addWidget(self.build_widget) self.programs_widget = QtWidgets.QFrame(self.widget_2) self.programs_widget.setFrameShape(QtWidgets.QFrame.StyledPanel) self.programs_widget.setFrameShadow(QtWidgets.QFrame.Raised) self.programs_widget.setObjectName("programs_widget") self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.programs_widget) self.verticalLayout_3.setObjectName("verticalLayout_3") self.verticalLayout.addWidget(self.programs_widget) self.console_widget = ConsoleWidget(self.widget_2) self.console_widget.setObjectName("console_widget") self.verticalLayout.addWidget(self.console_widget) self.verticalLayout.setStretch(2, 1) self.verticalLayout_2.addWidget(self.splitter) self.save_conf_action = QtWidgets.QAction(ConfigurationPanel) self.save_conf_action.setObjectName("save_conf_action") self.retranslateUi(ConfigurationPanel) QtCore.QMetaObject.connectSlotsByName(ConfigurationPanel)
def _on_key_up(self, event, skip=True): """ Called when any key is released. """ if event.KeyCode in (59, ord(".")): # Intercepting '.' event.Skip() wx.CallAfter(self._popup_completion, create=True) else: ConsoleWidget._on_key_up(self, event, skip=skip)
def _on_key_up(self, event, skip=True): """ Called when any key is released. """ if event.KeyCode in (59, ord('.')): # Intercepting '.' event.Skip() wx.CallAfter(self._popup_completion, create=True) else: ConsoleWidget._on_key_up(self, event, skip=skip)
def __init__(self, spreadsheet, parent=None): super(ConsoleDockWidget, self).__init__("Console") self.console = ConsoleWidget() self.cells = [] self.plots = [] self.console.createdPlot.connect(self.added_plot) self.console.createdPlot.connect(spreadsheet.tabController.currentWidget().totalPlotsChanged) self.console.updatedVar.connect(spreadsheet.tabController.currentWidget().totalPlotsChanged) spreadsheet.emitAllPlots.connect(self.updateAllPlots) self.setWidget(self.console)
class DisplayContainer(QWidget, DisplayContainerGeneric): def __init__(self, main): QWidget.__init__(self) DisplayContainerGeneric.__init__(self) self._main = main vbox = QVBoxLayout(self) self.stack = StackedWidget() vbox.addWidget(self.stack) self._console = ConsoleWidget() self.stack.addWidget(self._console) self.runWidget = RunWidget() self.stack.addWidget(self.runWidget) self.web = WebRender() self.stack.addWidget(self.web) self.combo = QComboBox() self.combo.addItem(QIcon(resources.images['console']), '') self.combo.addItem(QIcon(resources.images['play']), '') self.combo.addItem(QIcon(resources.images['web']), '') self.connect(self.combo, SIGNAL("currentIndexChanged(int)"), self._item_changed) def gain_focus(self): self._console.setFocus() @pyqtSignature('int') def _item_changed(self, val): if not self.isVisible(): self._main.containerIsVisible = True self.show() self.stack.show_display(val) def load_toolbar(self, toolbar): toolbar.addSeparator() toolbar.addWidget(self.combo) def run_application(self, fileName): self.combo.setCurrentIndex(1) self.runWidget.start_process(fileName) def kill_application(self): self.runWidget.kill_process() def render_web_page(self, url): self.combo.setCurrentIndex(2) self.web.render_page(url) def add_to_stack(self, widget, icon): self.stack.addWidget(widget) self.combo.addItem(QIcon(icon), '')
def __init__(self, filename): super().__init__() self.centralwidget = QWidget() self.setCentralWidget(self.centralwidget) self.resize(1000, 600) # Window layout -------------------------------------------------------- self.tree = QTreeWidget() self.tree.itemClicked.connect(self.onItemClicked) self.push1_0 = QPushButton('Open NWB file') self.push1_0.clicked.connect(self.open_file) self.push2_0 = QPushButton('Export NWB file') self.push2_0.clicked.connect(self.export_file) self.push3_0 = QPushButton('Auto-clear') self.push3_0.setCheckable(True) self.push3_0.setChecked(True) self.push3_0.clicked.connect(self.toggle_auto_clear) self.auto_clear = True self.grid1 = QGridLayout() self.grid1.addWidget(self.push1_0, 0, 0, 1, 6) self.grid1.addWidget(self.push2_0, 1, 0, 1, 6) self.grid1.addWidget(self.push3_0, 2, 0, 1, 6) self.vbox1 = QVBoxLayout() self.vbox1.addWidget(self.tree) self.grid1.addLayout(self.vbox1, 3, 0, 2, 6) self.console = ConsoleWidget(par=self) self.vbox2 = QVBoxLayout() self.vbox2.addWidget(self.console) self.hbox = QHBoxLayout(self.centralwidget) self.hbox.addLayout(self.grid1) #add first tree self.hbox.addLayout(self.vbox2) #add second tree # Open file ------------------------------------------------------------ if not os.path.isfile(filename): self.open_file() else: self.file = filename self.io = NWBHDF5IO(self.file, 'r+') self.nwb = self.io.read() #reads NWB file self.fields = list(self.nwb.fields.keys()) self.init_tree() self.init_console() self.setWindowTitle('NWB explorer - ' + os.path.split(os.path.abspath(self.file))[1]) self.show()
def setupUi(self, OperationPanel): OperationPanel.setObjectName("OperationPanel") OperationPanel.resize(400, 300) self.verticalLayout = QtWidgets.QVBoxLayout(OperationPanel) self.verticalLayout.setObjectName("verticalLayout") self.splitter = QtWidgets.QSplitter(OperationPanel) self.splitter.setOrientation(QtCore.Qt.Vertical) self.splitter.setObjectName("splitter") self.session = SessionWidget(self.splitter) self.session.setObjectName("session") self.console = ConsoleWidget(self.splitter) self.console.setObjectName("console") self.verticalLayout.addWidget(self.splitter) self.retranslateUi(OperationPanel) QtCore.QMetaObject.connectSlotsByName(OperationPanel)
def OnUpdateUI(self, event): """ Override the OnUpdateUI of the EditWindow class, to prevent syntax highlighting both for faster redraw, and for more consistent look and feel. """ if not self._input_state == 'readline': ConsoleWidget.OnUpdateUI(self, event)
def __init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.CLIP_CHILDREN | wx.WANTS_CHARS, *args, **kwds): """ Create Shell instance. """ ConsoleWidget.__init__(self, parent, id, pos, size, style) PrefilterFrontEnd.__init__(self, **kwds) # Stick in our own raw_input: self.ipython0.raw_input = self.raw_input # Marker for complete buffer. self.MarkerDefine(_COMPLETE_BUFFER_MARKER, stc.STC_MARK_BACKGROUND, background=_COMPLETE_BUFFER_BG) # Marker for current input buffer. self.MarkerDefine(_INPUT_MARKER, stc.STC_MARK_BACKGROUND, background=_INPUT_BUFFER_BG) # Marker for tracebacks. self.MarkerDefine(_ERROR_MARKER, stc.STC_MARK_BACKGROUND, background=_ERROR_BG) # A time for flushing the write buffer BUFFER_FLUSH_TIMER_ID = 100 self._buffer_flush_timer = wx.Timer(self, BUFFER_FLUSH_TIMER_ID) wx.EVT_TIMER(self, BUFFER_FLUSH_TIMER_ID, self._buffer_flush) if 'debug' in kwds: self.debug = kwds['debug'] kwds.pop('debug') # Inject self in namespace, for debug if self.debug: self.shell.user_ns['self'] = self # Inject our own raw_input in namespace self.shell.user_ns['raw_input'] = self.raw_input
def _on_key_up(self, event, skip=True): """ Called when any key is released. """ if event.GetKeyCode() in (59, ord('.')): # Intercepting '.' event.Skip() wx.CallAfter(self._popup_completion, create=True) else: ConsoleWidget._on_key_up(self, event, skip=skip) # Make sure the continuation_prompts are always followed by a # whitespace new_lines = [] if self._input_state == 'readline': position = self.GetCurrentPos() continuation_prompt = self.continuation_prompt()[:-1] for line in self.input_buffer.split('\n'): if not line == continuation_prompt: new_lines.append(line) self.input_buffer = '\n'.join(new_lines) self.GotoPos(position)
class Ui_OperationPanel(object): def setupUi(self, OperationPanel): OperationPanel.setObjectName("OperationPanel") OperationPanel.resize(400, 300) self.verticalLayout = QtWidgets.QVBoxLayout(OperationPanel) self.verticalLayout.setObjectName("verticalLayout") self.splitter = QtWidgets.QSplitter(OperationPanel) self.splitter.setOrientation(QtCore.Qt.Vertical) self.splitter.setObjectName("splitter") self.session = SessionWidget(self.splitter) self.session.setObjectName("session") self.console = ConsoleWidget(self.splitter) self.console.setObjectName("console") self.verticalLayout.addWidget(self.splitter) self.retranslateUi(OperationPanel) QtCore.QMetaObject.connectSlotsByName(OperationPanel) def retranslateUi(self, OperationPanel): _translate = QtCore.QCoreApplication.translate OperationPanel.setWindowTitle(_translate("OperationPanel", "Form"))
def __init__( self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.CLIP_CHILDREN | wx.WANTS_CHARS, *args, **kwds ): """ Create Shell instance. """ ConsoleWidget.__init__(self, parent, id, pos, size, style) PrefilterFrontEnd.__init__(self, **kwds) # Stick in our own raw_input: self.ipython0.raw_input = self.raw_input # Marker for complete buffer. self.MarkerDefine(_COMPLETE_BUFFER_MARKER, stc.STC_MARK_BACKGROUND, background=_COMPLETE_BUFFER_BG) # Marker for current input buffer. self.MarkerDefine(_INPUT_MARKER, stc.STC_MARK_BACKGROUND, background=_INPUT_BUFFER_BG) # Marker for tracebacks. self.MarkerDefine(_ERROR_MARKER, stc.STC_MARK_BACKGROUND, background=_ERROR_BG) # A time for flushing the write buffer BUFFER_FLUSH_TIMER_ID = 100 self._buffer_flush_timer = wx.Timer(self, BUFFER_FLUSH_TIMER_ID) wx.EVT_TIMER(self, BUFFER_FLUSH_TIMER_ID, self._buffer_flush) if "debug" in kwds: self.debug = kwds["debug"] kwds.pop("debug") # Inject self in namespace, for debug if self.debug: self.shell.user_ns["self"] = self # Inject our own raw_input in namespace self.shell.user_ns["raw_input"] = self.raw_input
def __init__(self, main): QWidget.__init__(self) DisplayContainerGeneric.__init__(self) self._main = main vbox = QVBoxLayout(self) self.stack = StackedWidget() vbox.addWidget(self.stack) self._console = ConsoleWidget() self.stack.addWidget(self._console) self.runWidget = RunWidget() self.stack.addWidget(self.runWidget) self.web = WebRender() self.stack.addWidget(self.web) self.combo = QComboBox() self.combo.addItem(QIcon(resources.images['console']), '') self.combo.addItem(QIcon(resources.images['play']), '') self.combo.addItem(QIcon(resources.images['web']), '') self.connect(self.combo, SIGNAL("currentIndexChanged(int)"), self._item_changed)
def __init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.CLIP_CHILDREN | wx.WANTS_CHARS, styledef=None, *args, **kwds): """ Create Shell instance. Parameters ----------- styledef : dict, optional styledef is the dictionary of options used to define the style. """ if styledef is not None: self.style = styledef ConsoleWidget.__init__(self, parent, id, pos, size, style) PrefilterFrontEnd.__init__(self, **kwds) # Stick in our own raw_input: self.ipython0.raw_input = self.raw_input # A time for flushing the write buffer BUFFER_FLUSH_TIMER_ID = 100 self._buffer_flush_timer = wx.Timer(self, BUFFER_FLUSH_TIMER_ID) wx.EVT_TIMER(self, BUFFER_FLUSH_TIMER_ID, self._buffer_flush) if 'debug' in kwds: self.debug = kwds['debug'] kwds.pop('debug') # Inject self in namespace, for debug if self.debug: self.shell.user_ns['self'] = self # Inject our own raw_input in namespace self.shell.user_ns['raw_input'] = self.raw_input
def _on_key_down(self, event, skip=True): """ Capture the character events, let the parent widget handle them, and put our logic afterward. """ # FIXME: This method needs to be broken down in smaller ones. current_line_number = self.GetCurrentLine() if event.KeyCode in (ord('c'), ord('C')) and event.ControlDown(): # Capture Control-C if self._input_state == 'subprocess': if self.debug: print >> sys.__stderr__, 'Killing running process' if hasattr(self._running_process, 'process'): self._running_process.process.kill() elif self._input_state == 'buffering': if self.debug: print >> sys.__stderr__, 'Raising KeyboardInterrupt' raise KeyboardInterrupt # XXX: We need to make really sure we # get back to a prompt. elif self._input_state == 'subprocess' and ( (event.KeyCode < 256 and not event.ControlDown()) or (event.KeyCode in (ord('d'), ord('D')) and event.ControlDown())): # We are running a process, we redirect keys. ConsoleWidget._on_key_down(self, event, skip=skip) char = chr(event.KeyCode) # Deal with some inconsistency in wx keycodes: if char == '\r': char = '\n' elif not event.ShiftDown(): char = char.lower() if event.ControlDown() and event.KeyCode in (ord('d'), ord('D')): char = '\04' self._running_process.process.stdin.write(char) self._running_process.process.stdin.flush() elif event.KeyCode in (ord('('), 57, 53): # Calltips event.Skip() self.do_calltip() elif self.AutoCompActive() and not event.KeyCode == ord('\t'): event.Skip() if event.KeyCode in (wx.WXK_BACK, wx.WXK_DELETE): wx.CallAfter(self._popup_completion, create=True) elif not event.KeyCode in (wx.WXK_UP, wx.WXK_DOWN, wx.WXK_LEFT, wx.WXK_RIGHT, wx.WXK_ESCAPE): wx.CallAfter(self._popup_completion) else: # Up history if event.KeyCode == wx.WXK_UP and ( (current_line_number == self.current_prompt_line and event.Modifiers in (wx.MOD_NONE, wx.MOD_WIN)) or event.ControlDown()): new_buffer = self.get_history_previous(self.input_buffer) if new_buffer is not None: self.input_buffer = new_buffer if self.GetCurrentLine() > self.current_prompt_line: # Go to first line, for seemless history up. self.GotoPos(self.current_prompt_pos) # Down history elif event.KeyCode == wx.WXK_DOWN and ( (current_line_number == self.LineCount - 1 and event.Modifiers in (wx.MOD_NONE, wx.MOD_WIN)) or event.ControlDown()): new_buffer = self.get_history_next() if new_buffer is not None: self.input_buffer = new_buffer # Tab-completion elif event.KeyCode == ord('\t'): current_line, current_line_number = self.CurLine if not re.match(r'^\s*$', current_line): self.complete_current_input() if self.AutoCompActive(): wx.CallAfter(self._popup_completion, create=True) else: event.Skip() else: ConsoleWidget._on_key_down(self, event, skip=skip)
def write(self, *args, **kwargs): # Avoid multiple inheritence, be explicit about which # parent method class gets called ConsoleWidget.write(self, *args, **kwargs)
def _on_key_down(self, event, skip=True): """ Capture the character events, let the parent widget handle them, and put our logic afterward. """ # FIXME: This method needs to be broken down in smaller ones. current_line_num = self.GetCurrentLine() key_code = event.GetKeyCode() if key_code in (ord('c'), ord('C')) and event.ControlDown(): # Capture Control-C if self._input_state == 'subprocess': if self.debug: print >>sys.__stderr__, 'Killing running process' if hasattr(self._running_process, 'process'): self._running_process.process.kill() elif self._input_state == 'buffering': if self.debug: print >>sys.__stderr__, 'Raising KeyboardInterrupt' raise KeyboardInterrupt # XXX: We need to make really sure we # get back to a prompt. elif self._input_state == 'subprocess' and ( ( key_code <256 and not event.ControlDown() ) or ( key_code in (ord('d'), ord('D')) and event.ControlDown())): # We are running a process, we redirect keys. ConsoleWidget._on_key_down(self, event, skip=skip) char = chr(key_code) # Deal with some inconsistency in wx keycodes: if char == '\r': char = '\n' elif not event.ShiftDown(): char = char.lower() if event.ControlDown() and key_code in (ord('d'), ord('D')): char = '\04' self._running_process.process.stdin.write(char) self._running_process.process.stdin.flush() elif key_code in (ord('('), 57, 53): # Calltips event.Skip() self.do_calltip() elif self.AutoCompActive() and not key_code == ord('\t'): event.Skip() if key_code in (wx.WXK_BACK, wx.WXK_DELETE): wx.CallAfter(self._popup_completion, create=True) elif not key_code in (wx.WXK_UP, wx.WXK_DOWN, wx.WXK_LEFT, wx.WXK_RIGHT, wx.WXK_ESCAPE): wx.CallAfter(self._popup_completion) else: # Up history if key_code == wx.WXK_UP and ( event.ControlDown() or current_line_num == self.current_prompt_line ): new_buffer = self.get_history_previous( self.input_buffer) if new_buffer is not None: self.input_buffer = new_buffer if self.GetCurrentLine() > self.current_prompt_line: # Go to first line, for seemless history up. self.GotoPos(self.current_prompt_pos) # Down history elif key_code == wx.WXK_DOWN and ( event.ControlDown() or current_line_num == self.LineCount -1 ): new_buffer = self.get_history_next() if new_buffer is not None: self.input_buffer = new_buffer # Tab-completion elif key_code == ord('\t'): current_line, current_line_num = self.CurLine if not re.match(r'^%s\s*$' % self.continuation_prompt(), current_line): self.complete_current_input() if self.AutoCompActive(): wx.CallAfter(self._popup_completion, create=True) else: event.Skip() elif key_code == wx.WXK_BACK: # If characters where erased, check if we have to # remove a line. # XXX: What about DEL? # FIXME: This logics should be in ConsoleWidget, as it is # independant of IPython current_line, _ = self.CurLine current_pos = self.GetCurrentPos() current_line_num = self.LineFromPosition(current_pos) current_col = self.GetColumn(current_pos) len_prompt = len(self.continuation_prompt()) if ( current_line.startswith(self.continuation_prompt()) and current_col == len_prompt): new_lines = [] for line_num, line in enumerate( self.input_buffer.split('\n')): if (line_num + self.current_prompt_line == current_line_num): new_lines.append(line[len_prompt:]) else: new_lines.append('\n'+line) # The first character is '\n', due to the above # code: self.input_buffer = ''.join(new_lines)[1:] self.GotoPos(current_pos - 1 - len_prompt) else: ConsoleWidget._on_key_down(self, event, skip=skip) else: ConsoleWidget._on_key_down(self, event, skip=skip)
class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(1465, 869) MainWindow.setCursor(QtCore.Qt.ArrowCursor) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap("BOUTguilogo.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) MainWindow.setWindowIcon(icon) MainWindow.setTabShape(QtGui.QTabWidget.Rounded) self.centralwidget = QtGui.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.gridLayout_2 = QtGui.QGridLayout(self.centralwidget) self.gridLayout_2.setObjectName("gridLayout_2") self.tabWidget = QtGui.QTabWidget(self.centralwidget) self.tabWidget.setToolTip("") self.tabWidget.setTabShape(QtGui.QTabWidget.Rounded) self.tabWidget.setTabsClosable(False) self.tabWidget.setMovable(False) self.tabWidget.setObjectName("tabWidget") self.Load = QtGui.QWidget() self.Load.setEnabled(True) self.Load.setObjectName("Load") self.pushButton = QtGui.QPushButton(self.Load) self.pushButton.setGeometry(QtCore.QRect(1320, 716, 81, 25)) self.pushButton.setObjectName("pushButton") self.tableWidget = QtGui.QTableWidget(self.Load) self.tableWidget.setGeometry(QtCore.QRect(20, 20, 1381, 691)) self.tableWidget.setAlternatingRowColors(True) self.tableWidget.setSelectionMode( QtGui.QAbstractItemView.SingleSelection) self.tableWidget.setSelectionBehavior( QtGui.QAbstractItemView.SelectRows) self.tableWidget.setColumnCount(5) self.tableWidget.setObjectName("tableWidget") self.tableWidget.setColumnCount(5) self.tableWidget.setRowCount(0) item = QtGui.QTableWidgetItem() self.tableWidget.setHorizontalHeaderItem(0, item) item = QtGui.QTableWidgetItem() self.tableWidget.setHorizontalHeaderItem(1, item) item = QtGui.QTableWidgetItem() self.tableWidget.setHorizontalHeaderItem(2, item) item = QtGui.QTableWidgetItem() self.tableWidget.setHorizontalHeaderItem(3, item) item = QtGui.QTableWidgetItem() self.tableWidget.setHorizontalHeaderItem(4, item) self.tableWidget.horizontalHeader().setDefaultSectionSize(150) self.tableWidget.horizontalHeader().setSortIndicatorShown(False) self.tableWidget.horizontalHeader().setStretchLastSection(True) self.tableWidget.verticalHeader().setStretchLastSection(False) self.archivePath = QtGui.QLabel(self.Load) self.archivePath.setGeometry(QtCore.QRect(177, 718, 951, 20)) self.archivePath.setObjectName("archivePath") self.label_18 = QtGui.QLabel(self.Load) self.label_18.setGeometry(QtCore.QRect(20, 720, 201, 16)) self.label_18.setObjectName("label_18") self.tabWidget.addTab(self.Load, "") self.tab_2 = QtGui.QWidget() self.tab_2.setObjectName("tab_2") self.checkBox = QtGui.QCheckBox(self.tab_2) self.checkBox.setGeometry(QtCore.QRect(1171, 725, 71, 20)) self.checkBox.setObjectName("checkBox") self.pushButton_3 = QtGui.QPushButton(self.tab_2) self.pushButton_3.setGeometry(QtCore.QRect(1250, 692, 161, 25)) self.pushButton_3.setObjectName("pushButton_3") self.procSpin = QtGui.QSpinBox(self.tab_2) self.procSpin.setGeometry(QtCore.QRect(1060, 693, 53, 22)) self.procSpin.setObjectName("procSpin") self.niceSpin = QtGui.QSpinBox(self.tab_2) self.niceSpin.setGeometry(QtCore.QRect(1060, 723, 53, 22)) self.niceSpin.setMinimum(-99) self.niceSpin.setObjectName("niceSpin") self.groupBox_18 = QtGui.QGroupBox(self.tab_2) self.groupBox_18.setGeometry(QtCore.QRect(913, 617, 501, 71)) self.groupBox_18.setObjectName("groupBox_18") self.plainTextEdit = QtGui.QPlainTextEdit(self.groupBox_18) self.plainTextEdit.setGeometry(QtCore.QRect(4, 14, 491, 51)) self.plainTextEdit.setObjectName("plainTextEdit") self.label_2 = QtGui.QLabel(self.tab_2) self.label_2.setGeometry(QtCore.QRect(959, 725, 101, 16)) self.label_2.setObjectName("label_2") self.label = QtGui.QLabel(self.tab_2) self.label.setGeometry(QtCore.QRect(919, 695, 151, 16)) self.label.setObjectName("label") self.pushButton_2 = QtGui.QPushButton(self.tab_2) self.pushButton_2.setGeometry(QtCore.QRect(1170, 692, 75, 25)) self.pushButton_2.setObjectName("pushButton_2") self.runScanningSimulation = QtGui.QPushButton(self.tab_2) self.runScanningSimulation.setGeometry(QtCore.QRect( 1250, 720, 161, 25)) self.runScanningSimulation.setObjectName("runScanningSimulation") self.fileLabel = QtGui.QLabel(self.tab_2) self.fileLabel.setGeometry(QtCore.QRect(90, 723, 771, 16)) self.fileLabel.setObjectName("fileLabel") self.label_15 = QtGui.QLabel(self.tab_2) self.label_15.setGeometry(QtCore.QRect(10, 723, 91, 16)) self.label_15.setObjectName("label_15") self.label_17 = QtGui.QLabel(self.tab_2) self.label_17.setGeometry(QtCore.QRect(10, 708, 201, 16)) self.label_17.setObjectName("label_17") self.simulationFile = QtGui.QLabel(self.tab_2) self.simulationFile.setGeometry(QtCore.QRect(200, 708, 771, 16)) self.simulationFile.setObjectName("simulationFile") self.tabWidget.addTab(self.tab_2, "") self.tab = QtGui.QWidget() self.tab.setObjectName("tab") self.outputStream = QtGui.QTextBrowser(self.tab) self.outputStream.setGeometry(QtCore.QRect(10, 10, 1401, 691)) self.outputStream.setObjectName("outputStream") self.stopSimulation = QtGui.QPushButton(self.tab) self.stopSimulation.setGeometry(QtCore.QRect(10, 710, 1401, 25)) self.stopSimulation.setObjectName("stopSimulation") self.tabWidget.addTab(self.tab, "") self.tab_3 = QtGui.QWidget() self.tab_3.setObjectName("tab_3") self.textOutput = QtGui.QTextEdit(self.tab_3) self.textOutput.setGeometry(QtCore.QRect(22, 430, 661, 261)) self.textOutput.setReadOnly(True) self.textOutput.setObjectName("textOutput") self.label_64 = QtGui.QLabel(self.tab_3) self.label_64.setGeometry(QtCore.QRect(20, 700, 64, 25)) self.label_64.setObjectName("label_64") self.dataTable = QtGui.QTableWidget(self.tab_3) self.dataTable.setGeometry(QtCore.QRect(23, 210, 661, 221)) self.dataTable.setAlternatingRowColors(True) self.dataTable.setSelectionMode(QtGui.QAbstractItemView.MultiSelection) self.dataTable.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) self.dataTable.setShowGrid(False) self.dataTable.setGridStyle(QtCore.Qt.SolidLine) self.dataTable.setObjectName("dataTable") self.dataTable.setColumnCount(4) self.dataTable.setRowCount(0) item = QtGui.QTableWidgetItem() self.dataTable.setHorizontalHeaderItem(0, item) item = QtGui.QTableWidgetItem() self.dataTable.setHorizontalHeaderItem(1, item) item = QtGui.QTableWidgetItem() self.dataTable.setHorizontalHeaderItem(2, item) item = QtGui.QTableWidgetItem() self.dataTable.setHorizontalHeaderItem(3, item) self.dataTable.horizontalHeader().setStretchLastSection(True) self.dataTable.verticalHeader().setDefaultSectionSize(20) self.commandButton = QtGui.QPushButton(self.tab_3) self.commandButton.setGeometry(QtCore.QRect(610, 700, 75, 25)) self.commandButton.setObjectName("commandButton") self.frame = QtGui.QFrame(self.tab_3) self.frame.setGeometry(QtCore.QRect(700, 104, 701, 621)) self.frame.setFrameShape(QtGui.QFrame.StyledPanel) self.frame.setFrameShadow(QtGui.QFrame.Raised) self.frame.setObjectName("frame") self.commandInput = ConsoleWidget(self.tab_3) self.commandInput.setGeometry(QtCore.QRect(89, 702, 511, 21)) self.commandInput.setObjectName("commandInput") self.groupBox = QtGui.QGroupBox(self.tab_3) self.groupBox.setGeometry(QtCore.QRect(23, 4, 661, 201)) self.groupBox.setObjectName("groupBox") self.pushButton_7 = QtGui.QPushButton(self.groupBox) self.pushButton_7.setGeometry(QtCore.QRect(10, 30, 101, 25)) font = QtGui.QFont() font.setWeight(75) font.setBold(True) self.pushButton_7.setFont(font) self.pushButton_7.setObjectName("pushButton_7") self.collectedLabel_3 = QtGui.QLabel(self.groupBox) self.collectedLabel_3.setGeometry(QtCore.QRect(10, 89, 171, 16)) self.collectedLabel_3.setObjectName("collectedLabel_3") self.extraVarsCombo = QtGui.QComboBox(self.groupBox) self.extraVarsCombo.setGeometry(QtCore.QRect(10, 109, 151, 22)) self.extraVarsCombo.setObjectName("extraVarsCombo") self.collectExtraVariable = QtGui.QPushButton(self.groupBox) self.collectExtraVariable.setGeometry(QtCore.QRect(170, 109, 101, 25)) self.collectExtraVariable.setObjectName("collectExtraVariable") self.collectedLabel = QtGui.QLabel(self.groupBox) self.collectedLabel.setGeometry(QtCore.QRect(100, 160, 760, 16)) self.collectedLabel.setObjectName("collectedLabel") self.label_22 = QtGui.QLabel(self.groupBox) self.label_22.setGeometry(QtCore.QRect(10, 160, 150, 16)) self.label_22.setObjectName("label_22") self.groupBox_2 = QtGui.QGroupBox(self.tab_3) self.groupBox_2.setGeometry(QtCore.QRect(700, 4, 701, 91)) self.groupBox_2.setObjectName("groupBox_2") self.collectedLabel_2 = QtGui.QLabel(self.groupBox_2) self.collectedLabel_2.setGeometry(QtCore.QRect(10, 15, 181, 16)) self.collectedLabel_2.setObjectName("collectedLabel_2") self.saveDefaultButton = QtGui.QPushButton(self.groupBox_2) self.saveDefaultButton.setGeometry(QtCore.QRect(10, 60, 81, 25)) self.saveDefaultButton.setObjectName("saveDefaultButton") self.defaultCombo = QtGui.QComboBox(self.groupBox_2) self.defaultCombo.setGeometry(QtCore.QRect(10, 35, 171, 22)) self.defaultCombo.setObjectName("defaultCombo") self.defaultCombo.addItem("") self.zall = QtGui.QCheckBox(self.groupBox_2) self.zall.setGeometry(QtCore.QRect(500, 65, 41, 20)) self.zall.setObjectName("zall") self.yall = QtGui.QCheckBox(self.groupBox_2) self.yall.setGeometry(QtCore.QRect(440, 65, 41, 20)) self.yall.setObjectName("yall") self.xall = QtGui.QCheckBox(self.groupBox_2) self.xall.setGeometry(QtCore.QRect(380, 65, 41, 20)) self.xall.setObjectName("xall") self.deleteButton = QtGui.QPushButton(self.groupBox_2) self.deleteButton.setGeometry(QtCore.QRect(100, 60, 81, 25)) self.deleteButton.setObjectName("deleteButton") self.label_16 = QtGui.QLabel(self.groupBox_2) self.label_16.setGeometry(QtCore.QRect(230, 14, 301, 16)) self.label_16.setObjectName("label_16") self.variableCombo = QtGui.QComboBox(self.groupBox_2) self.variableCombo.setGeometry(QtCore.QRect(230, 35, 81, 22)) self.variableCombo.setObjectName("variableCombo") self.tall = QtGui.QCheckBox(self.groupBox_2) self.tall.setGeometry(QtCore.QRect(320, 65, 41, 20)) self.tall.setObjectName("tall") self.xspin = QtGui.QSpinBox(self.groupBox_2) self.xspin.setGeometry(QtCore.QRect(380, 35, 53, 22)) self.xspin.setMinimum(-10000000) self.xspin.setMaximum(10000000) self.xspin.setObjectName("xspin") self.zspin = QtGui.QSpinBox(self.groupBox_2) self.zspin.setGeometry(QtCore.QRect(500, 35, 53, 22)) self.zspin.setMinimum(-1000000) self.zspin.setMaximum(10000000) self.zspin.setObjectName("zspin") self.yspin = QtGui.QSpinBox(self.groupBox_2) self.yspin.setGeometry(QtCore.QRect(440, 35, 53, 22)) self.yspin.setMinimum(-999900) self.yspin.setMaximum(100000000) self.yspin.setObjectName("yspin") self.tspin = QtGui.QSpinBox(self.groupBox_2) self.tspin.setGeometry(QtCore.QRect(320, 35, 53, 22)) self.tspin.setMinimum(-10000000) self.tspin.setMaximum(10000000) self.tspin.setProperty("value", 0) self.tspin.setObjectName("tspin") self.createGraph = QtGui.QPushButton(self.groupBox_2) self.createGraph.setGeometry(QtCore.QRect(590, 34, 101, 25)) self.createGraph.setObjectName("createGraph") self.tabWidget.addTab(self.tab_3, "") self.gridLayout_2.addWidget(self.tabWidget, 0, 0, 1, 1) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtGui.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 1465, 20)) self.menubar.setObjectName("menubar") self.menuFile = QtGui.QMenu(self.menubar) self.menuFile.setObjectName("menuFile") self.menuHelp = QtGui.QMenu(self.menubar) self.menuHelp.setObjectName("menuHelp") self.menuView = QtGui.QMenu(self.menubar) self.menuView.setObjectName("menuView") MainWindow.setMenuBar(self.menubar) self.statusbar = QtGui.QStatusBar(MainWindow) self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar) self.actionCompare = QtGui.QAction(MainWindow) self.actionCompare.setObjectName("actionCompare") self.actionFileHistory = QtGui.QAction(MainWindow) self.actionFileHistory.setObjectName("actionFileHistory") self.actionExit = QtGui.QAction(MainWindow) self.actionExit.setObjectName("actionExit") self.actionHelp = QtGui.QAction(MainWindow) self.actionHelp.setObjectName("actionHelp") self.actionStop_Simulation = QtGui.QAction(MainWindow) self.actionStop_Simulation.setObjectName("actionStop_Simulation") self.actionPositioning = QtGui.QAction(MainWindow) self.actionPositioning.setObjectName("actionPositioning") self.actionArchive = QtGui.QAction(MainWindow) self.actionArchive.setObjectName("actionArchive") self.actionCreate_Example = QtGui.QAction(MainWindow) self.actionCreate_Example.setObjectName("actionCreate_Example") self.actionSimulation_Code = QtGui.QAction(MainWindow) self.actionSimulation_Code.setObjectName("actionSimulation_Code") self.actionDefault_Variables = QtGui.QAction(MainWindow) self.actionDefault_Variables.setObjectName("actionDefault_Variables") self.actionAbout = QtGui.QAction(MainWindow) self.actionAbout.setObjectName("actionAbout") self.menuFile.addSeparator() self.menuFile.addAction(self.actionArchive) self.menuFile.addAction(self.actionSimulation_Code) self.menuFile.addAction(self.actionDefault_Variables) self.menuFile.addSeparator() self.menuFile.addAction(self.actionFileHistory) self.menuFile.addAction(self.actionCompare) self.menuFile.addSeparator() self.menuFile.addAction(self.actionStop_Simulation) self.menuFile.addSeparator() self.menuFile.addAction(self.actionExit) self.menuHelp.addAction(self.actionAbout) self.menuHelp.addAction(self.actionHelp) self.menuView.addAction(self.actionPositioning) self.menubar.addAction(self.menuFile.menuAction()) self.menubar.addAction(self.menuView.menuAction()) self.menubar.addAction(self.menuHelp.menuAction()) self.retranslateUi(MainWindow) self.tabWidget.setCurrentIndex(0) QtCore.QMetaObject.connectSlotsByName(MainWindow) def retranslateUi(self, MainWindow): MainWindow.setWindowTitle( QtGui.QApplication.translate("MainWindow", "BOUTgui", None, QtGui.QApplication.UnicodeUTF8)) self.pushButton.setToolTip( QtGui.QApplication.translate( "MainWindow", "Loads the selected file for simualtion after editing", None, QtGui.QApplication.UnicodeUTF8)) self.pushButton.setText( QtGui.QApplication.translate("MainWindow", "Load", None, QtGui.QApplication.UnicodeUTF8)) self.tableWidget.horizontalHeaderItem(0).setText( QtGui.QApplication.translate("MainWindow", "File Path", None, QtGui.QApplication.UnicodeUTF8)) self.tableWidget.horizontalHeaderItem(1).setText( QtGui.QApplication.translate("MainWindow", "Date Created", None, QtGui.QApplication.UnicodeUTF8)) self.tableWidget.horizontalHeaderItem(2).setText( QtGui.QApplication.translate("MainWindow", "Date Modified", None, QtGui.QApplication.UnicodeUTF8)) self.tableWidget.horizontalHeaderItem(3).setText( QtGui.QApplication.translate("MainWindow", "No of Processors", None, QtGui.QApplication.UnicodeUTF8)) self.tableWidget.horizontalHeaderItem(4).setText( QtGui.QApplication.translate("MainWindow", "Comments", None, QtGui.QApplication.UnicodeUTF8)) self.archivePath.setToolTip( QtGui.QApplication.translate( "MainWindow", "Shows the file path of the current archive", None, QtGui.QApplication.UnicodeUTF8)) self.archivePath.setText( QtGui.QApplication.translate( "MainWindow", "None loaded or bad file path, click File -> Archive Location to load", None, QtGui.QApplication.UnicodeUTF8)) self.label_18.setText( QtGui.QApplication.translate("MainWindow", "Current Archive Folder =", None, QtGui.QApplication.UnicodeUTF8)) self.tabWidget.setTabText( self.tabWidget.indexOf(self.Load), QtGui.QApplication.translate("MainWindow", "Load", None, QtGui.QApplication.UnicodeUTF8)) self.checkBox.setToolTip( QtGui.QApplication.translate( "MainWindow", "If checked runs the simulations from the previous data", None, QtGui.QApplication.UnicodeUTF8)) self.checkBox.setText( QtGui.QApplication.translate("MainWindow", "Restart", None, QtGui.QApplication.UnicodeUTF8)) self.pushButton_3.setToolTip( QtGui.QApplication.translate( "MainWindow", "Run the simulation with all the user settings ", None, QtGui.QApplication.UnicodeUTF8)) self.pushButton_3.setText( QtGui.QApplication.translate("MainWindow", "Run Simulation", None, QtGui.QApplication.UnicodeUTF8)) self.procSpin.setToolTip( QtGui.QApplication.translate( "MainWindow", "Change the number of processor to run the simulation on", None, QtGui.QApplication.UnicodeUTF8)) self.niceSpin.setToolTip( QtGui.QApplication.translate( "MainWindow", "Set the niceness level of the simulation", None, QtGui.QApplication.UnicodeUTF8)) self.groupBox_18.setTitle( QtGui.QApplication.translate("MainWindow", "Comments", None, QtGui.QApplication.UnicodeUTF8)) self.plainTextEdit.setToolTip( QtGui.QApplication.translate( "MainWindow", "Type comments in here that will be saved in the archive", None, QtGui.QApplication.UnicodeUTF8)) self.plainTextEdit.setPlainText( QtGui.QApplication.translate("MainWindow", "Write any useful comments here...", None, QtGui.QApplication.UnicodeUTF8)) self.label_2.setToolTip( QtGui.QApplication.translate( "MainWindow", "Set the niceness level of the simulation", None, QtGui.QApplication.UnicodeUTF8)) self.label_2.setText( QtGui.QApplication.translate("MainWindow", "\'Niceness\' level:", None, QtGui.QApplication.UnicodeUTF8)) self.label.setToolTip( QtGui.QApplication.translate( "MainWindow", "Change the number of processor to run the simulation on", None, QtGui.QApplication.UnicodeUTF8)) self.label.setText( QtGui.QApplication.translate("MainWindow", "Number of Processors:", None, QtGui.QApplication.UnicodeUTF8)) self.pushButton_2.setToolTip( QtGui.QApplication.translate( "MainWindow", "Save changes made to the control file without running anything", None, QtGui.QApplication.UnicodeUTF8)) self.pushButton_2.setText( QtGui.QApplication.translate("MainWindow", "Write to file", None, QtGui.QApplication.UnicodeUTF8)) self.runScanningSimulation.setToolTip( QtGui.QApplication.translate( "MainWindow", "Runs a series of simulations given an increment, a starting variable and a final variable", None, QtGui.QApplication.UnicodeUTF8)) self.runScanningSimulation.setText( QtGui.QApplication.translate("MainWindow", "Run Scanning Simulation", None, QtGui.QApplication.UnicodeUTF8)) self.fileLabel.setToolTip( QtGui.QApplication.translate("MainWindow", "Current config filepath", None, QtGui.QApplication.UnicodeUTF8)) self.fileLabel.setText( QtGui.QApplication.translate("MainWindow", "None", None, QtGui.QApplication.UnicodeUTF8)) self.label_15.setText( QtGui.QApplication.translate("MainWindow", "Open File =", None, QtGui.QApplication.UnicodeUTF8)) self.label_17.setText( QtGui.QApplication.translate("MainWindow", "Current Simulation Code File = ", None, QtGui.QApplication.UnicodeUTF8)) self.simulationFile.setToolTip( QtGui.QApplication.translate( "MainWindow", "File path of the simulation code that will be used in the simulation", None, QtGui.QApplication.UnicodeUTF8)) self.simulationFile.setText( QtGui.QApplication.translate("MainWindow", "None", None, QtGui.QApplication.UnicodeUTF8)) self.tabWidget.setTabText( self.tabWidget.indexOf(self.tab_2), QtGui.QApplication.translate("MainWindow", "Change Inputs", None, QtGui.QApplication.UnicodeUTF8)) self.outputStream.setToolTip( QtGui.QApplication.translate( "MainWindow", "The output stream, showing simualtion data from the BOUT code", None, QtGui.QApplication.UnicodeUTF8)) self.stopSimulation.setToolTip( QtGui.QApplication.translate("MainWindow", "Stop the simulation", None, QtGui.QApplication.UnicodeUTF8)) self.stopSimulation.setText( QtGui.QApplication.translate("MainWindow", "Stop Simulation", None, QtGui.QApplication.UnicodeUTF8)) self.tabWidget.setTabText( self.tabWidget.indexOf(self.tab), QtGui.QApplication.translate("MainWindow", "Output Stream", None, QtGui.QApplication.UnicodeUTF8)) self.textOutput.setToolTip( QtGui.QApplication.translate("MainWindow", "The printed output from commands", None, QtGui.QApplication.UnicodeUTF8)) self.label_64.setText( QtGui.QApplication.translate("MainWindow", "Command:", None, QtGui.QApplication.UnicodeUTF8)) self.dataTable.setToolTip( QtGui.QApplication.translate( "MainWindow", "Table showing the current variables and imported modules", None, QtGui.QApplication.UnicodeUTF8)) self.dataTable.horizontalHeaderItem(0).setText( QtGui.QApplication.translate("MainWindow", "Name", None, QtGui.QApplication.UnicodeUTF8)) self.dataTable.horizontalHeaderItem(1).setText( QtGui.QApplication.translate("MainWindow", "Source", None, QtGui.QApplication.UnicodeUTF8)) self.dataTable.horizontalHeaderItem(2).setText( QtGui.QApplication.translate("MainWindow", "Trace", None, QtGui.QApplication.UnicodeUTF8)) self.dataTable.horizontalHeaderItem(3).setText( QtGui.QApplication.translate("MainWindow", "Comments", None, QtGui.QApplication.UnicodeUTF8)) self.commandButton.setToolTip( QtGui.QApplication.translate("MainWindow", "Run current command", None, QtGui.QApplication.UnicodeUTF8)) self.commandButton.setText( QtGui.QApplication.translate("MainWindow", "Run", None, QtGui.QApplication.UnicodeUTF8)) self.frame.setToolTip( QtGui.QApplication.translate( "MainWindow", "Graphing area, any plots appear here", None, QtGui.QApplication.UnicodeUTF8)) self.commandInput.setToolTip( QtGui.QApplication.translate( "MainWindow", "Enter commands as if into a python command line", None, QtGui.QApplication.UnicodeUTF8)) self.groupBox.setTitle( QtGui.QApplication.translate("MainWindow", "Collection of Variables", None, QtGui.QApplication.UnicodeUTF8)) self.pushButton_7.setToolTip( QtGui.QApplication.translate( "MainWindow", "Imports the data from the current folder to be used for analysis", None, QtGui.QApplication.UnicodeUTF8)) self.pushButton_7.setText( QtGui.QApplication.translate("MainWindow", "Collect Data", None, QtGui.QApplication.UnicodeUTF8)) self.collectedLabel_3.setText( QtGui.QApplication.translate("MainWindow", "Additional Collect Variables :", None, QtGui.QApplication.UnicodeUTF8)) self.extraVarsCombo.setToolTip( QtGui.QApplication.translate( "MainWindow", "choose a non-default variable to collect", None, QtGui.QApplication.UnicodeUTF8)) self.collectExtraVariable.setToolTip( QtGui.QApplication.translate( "MainWindow", "Import data from a non-default variable (add defaults file -> default variables)", None, QtGui.QApplication.UnicodeUTF8)) self.collectExtraVariable.setText( QtGui.QApplication.translate("MainWindow", "Collect Variable", None, QtGui.QApplication.UnicodeUTF8)) self.collectedLabel.setToolTip( QtGui.QApplication.translate( "MainWindow", "The folder path showing the location of the data files", None, QtGui.QApplication.UnicodeUTF8)) self.collectedLabel.setText( QtGui.QApplication.translate("MainWindow", "None", None, QtGui.QApplication.UnicodeUTF8)) self.label_22.setToolTip( QtGui.QApplication.translate("MainWindow", "The current source of data in use", None, QtGui.QApplication.UnicodeUTF8)) self.label_22.setText( QtGui.QApplication.translate("MainWindow", "Collect From :", None, QtGui.QApplication.UnicodeUTF8)) self.groupBox_2.setTitle( QtGui.QApplication.translate("MainWindow", "Plotting", None, QtGui.QApplication.UnicodeUTF8)) self.collectedLabel_2.setText( QtGui.QApplication.translate("MainWindow", "Load a default input selection", None, QtGui.QApplication.UnicodeUTF8)) self.saveDefaultButton.setToolTip( QtGui.QApplication.translate( "MainWindow", "Save current settings so they can be used again", None, QtGui.QApplication.UnicodeUTF8)) self.saveDefaultButton.setText( QtGui.QApplication.translate("MainWindow", "Save", None, QtGui.QApplication.UnicodeUTF8)) self.defaultCombo.setToolTip( QtGui.QApplication.translate("MainWindow", "Select default settings", None, QtGui.QApplication.UnicodeUTF8)) self.defaultCombo.setItemText( 0, QtGui.QApplication.translate("MainWindow", "None", None, QtGui.QApplication.UnicodeUTF8)) self.zall.setToolTip( QtGui.QApplication.translate("MainWindow", "Select all of z", None, QtGui.QApplication.UnicodeUTF8)) self.zall.setText( QtGui.QApplication.translate("MainWindow", "All", None, QtGui.QApplication.UnicodeUTF8)) self.yall.setToolTip( QtGui.QApplication.translate("MainWindow", "Select all of y", None, QtGui.QApplication.UnicodeUTF8)) self.yall.setText( QtGui.QApplication.translate("MainWindow", "All", None, QtGui.QApplication.UnicodeUTF8)) self.xall.setToolTip( QtGui.QApplication.translate("MainWindow", "Select all of x ", None, QtGui.QApplication.UnicodeUTF8)) self.xall.setText( QtGui.QApplication.translate("MainWindow", "All", None, QtGui.QApplication.UnicodeUTF8)) self.deleteButton.setToolTip( QtGui.QApplication.translate( "MainWindow", "Save current settings so they can be used again", None, QtGui.QApplication.UnicodeUTF8)) self.deleteButton.setText( QtGui.QApplication.translate("MainWindow", "Delete", None, QtGui.QApplication.UnicodeUTF8)) self.label_16.setText( QtGui.QApplication.translate("MainWindow", "Input of form: variable(t,x,y,z) :", None, QtGui.QApplication.UnicodeUTF8)) self.variableCombo.setToolTip( QtGui.QApplication.translate("MainWindow", "Choose what variable to plot", None, QtGui.QApplication.UnicodeUTF8)) self.tall.setToolTip( QtGui.QApplication.translate("MainWindow", "Select all of time ", None, QtGui.QApplication.UnicodeUTF8)) self.tall.setText( QtGui.QApplication.translate("MainWindow", "All", None, QtGui.QApplication.UnicodeUTF8)) self.xspin.setToolTip( QtGui.QApplication.translate("MainWindow", "x value", None, QtGui.QApplication.UnicodeUTF8)) self.zspin.setToolTip( QtGui.QApplication.translate("MainWindow", "z value", None, QtGui.QApplication.UnicodeUTF8)) self.yspin.setToolTip( QtGui.QApplication.translate("MainWindow", "y value", None, QtGui.QApplication.UnicodeUTF8)) self.tspin.setToolTip( QtGui.QApplication.translate("MainWindow", "Time value", None, QtGui.QApplication.UnicodeUTF8)) self.createGraph.setToolTip( QtGui.QApplication.translate( "MainWindow", "Display the data selected as a graph", None, QtGui.QApplication.UnicodeUTF8)) self.createGraph.setText( QtGui.QApplication.translate("MainWindow", "Create Graph", None, QtGui.QApplication.UnicodeUTF8)) self.tabWidget.setTabText( self.tabWidget.indexOf(self.tab_3), QtGui.QApplication.translate("MainWindow", "Graphing", None, QtGui.QApplication.UnicodeUTF8)) self.menuFile.setTitle( QtGui.QApplication.translate("MainWindow", "File", None, QtGui.QApplication.UnicodeUTF8)) self.menuHelp.setTitle( QtGui.QApplication.translate("MainWindow", "Help", None, QtGui.QApplication.UnicodeUTF8)) self.menuView.setTitle( QtGui.QApplication.translate("MainWindow", "View", None, QtGui.QApplication.UnicodeUTF8)) self.actionCompare.setText( QtGui.QApplication.translate("MainWindow", "Compare", None, QtGui.QApplication.UnicodeUTF8)) self.actionCompare.setToolTip( QtGui.QApplication.translate( "MainWindow", "Once a file has been initially loaded this can be selected to compare differences between a second file", None, QtGui.QApplication.UnicodeUTF8)) self.actionCompare.setShortcut( QtGui.QApplication.translate("MainWindow", "Ctrl+Alt+C", None, QtGui.QApplication.UnicodeUTF8)) self.actionFileHistory.setText( QtGui.QApplication.translate("MainWindow", "File History", None, QtGui.QApplication.UnicodeUTF8)) self.actionFileHistory.setToolTip( QtGui.QApplication.translate( "MainWindow", "Brings up the automatically created history file which details the files family tree", None, QtGui.QApplication.UnicodeUTF8)) self.actionFileHistory.setShortcut( QtGui.QApplication.translate("MainWindow", "Ctrl+H", None, QtGui.QApplication.UnicodeUTF8)) self.actionExit.setText( QtGui.QApplication.translate("MainWindow", "Exit", None, QtGui.QApplication.UnicodeUTF8)) self.actionExit.setShortcut( QtGui.QApplication.translate("MainWindow", "Ctrl+Q", None, QtGui.QApplication.UnicodeUTF8)) self.actionHelp.setText( QtGui.QApplication.translate("MainWindow", "Help", None, QtGui.QApplication.UnicodeUTF8)) self.actionHelp.setShortcut( QtGui.QApplication.translate("MainWindow", "F11", None, QtGui.QApplication.UnicodeUTF8)) self.actionStop_Simulation.setText( QtGui.QApplication.translate("MainWindow", "Stop Simulation", None, QtGui.QApplication.UnicodeUTF8)) self.actionStop_Simulation.setShortcut( QtGui.QApplication.translate("MainWindow", "Ctrl+C", None, QtGui.QApplication.UnicodeUTF8)) self.actionPositioning.setText( QtGui.QApplication.translate("MainWindow", "Edit Input Positioning", None, QtGui.QApplication.UnicodeUTF8)) self.actionPositioning.setToolTip( QtGui.QApplication.translate( "MainWindow", "Change the positioning of the input boxes", None, QtGui.QApplication.UnicodeUTF8)) self.actionPositioning.setShortcut( QtGui.QApplication.translate("MainWindow", "Ctrl+B", None, QtGui.QApplication.UnicodeUTF8)) self.actionArchive.setText( QtGui.QApplication.translate("MainWindow", "Archive Location", None, QtGui.QApplication.UnicodeUTF8)) self.actionArchive.setToolTip( QtGui.QApplication.translate( "MainWindow", "This allows the selection of folder to use as an archive", None, QtGui.QApplication.UnicodeUTF8)) self.actionArchive.setShortcut( QtGui.QApplication.translate("MainWindow", "Ctrl+O", None, QtGui.QApplication.UnicodeUTF8)) self.actionCreate_Example.setText( QtGui.QApplication.translate("MainWindow", "Create Example", None, QtGui.QApplication.UnicodeUTF8)) self.actionCreate_Example.setToolTip( QtGui.QApplication.translate( "MainWindow", "This creates an example folder in the selected archive", None, QtGui.QApplication.UnicodeUTF8)) self.actionSimulation_Code.setText( QtGui.QApplication.translate("MainWindow", "Simulation Code", None, QtGui.QApplication.UnicodeUTF8)) self.actionSimulation_Code.setToolTip( QtGui.QApplication.translate( "MainWindow", "This allows the code used for simulations to be changed, so different models can be used", None, QtGui.QApplication.UnicodeUTF8)) self.actionSimulation_Code.setShortcut( QtGui.QApplication.translate("MainWindow", "Ctrl+L", None, QtGui.QApplication.UnicodeUTF8)) self.actionDefault_Variables.setText( QtGui.QApplication.translate("MainWindow", "Default Variables", None, QtGui.QApplication.UnicodeUTF8)) self.actionDefault_Variables.setShortcut( QtGui.QApplication.translate("MainWindow", "Ctrl+N", None, QtGui.QApplication.UnicodeUTF8)) self.actionAbout.setText( QtGui.QApplication.translate("MainWindow", "About", None, QtGui.QApplication.UnicodeUTF8))
def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(1465, 869) MainWindow.setCursor(QtCore.Qt.ArrowCursor) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap("BOUTguilogo.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) MainWindow.setWindowIcon(icon) MainWindow.setTabShape(QtGui.QTabWidget.Rounded) self.centralwidget = QtGui.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.gridLayout_2 = QtGui.QGridLayout(self.centralwidget) self.gridLayout_2.setObjectName("gridLayout_2") self.tabWidget = QtGui.QTabWidget(self.centralwidget) self.tabWidget.setToolTip("") self.tabWidget.setTabShape(QtGui.QTabWidget.Rounded) self.tabWidget.setTabsClosable(False) self.tabWidget.setMovable(False) self.tabWidget.setObjectName("tabWidget") self.Load = QtGui.QWidget() self.Load.setEnabled(True) self.Load.setObjectName("Load") self.pushButton = QtGui.QPushButton(self.Load) self.pushButton.setGeometry(QtCore.QRect(1320, 716, 81, 25)) self.pushButton.setObjectName("pushButton") self.tableWidget = QtGui.QTableWidget(self.Load) self.tableWidget.setGeometry(QtCore.QRect(20, 20, 1381, 691)) self.tableWidget.setAlternatingRowColors(True) self.tableWidget.setSelectionMode(QtGui.QAbstractItemView.SingleSelection) self.tableWidget.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) self.tableWidget.setColumnCount(5) self.tableWidget.setObjectName("tableWidget") self.tableWidget.setColumnCount(5) self.tableWidget.setRowCount(0) item = QtGui.QTableWidgetItem() self.tableWidget.setHorizontalHeaderItem(0, item) item = QtGui.QTableWidgetItem() self.tableWidget.setHorizontalHeaderItem(1, item) item = QtGui.QTableWidgetItem() self.tableWidget.setHorizontalHeaderItem(2, item) item = QtGui.QTableWidgetItem() self.tableWidget.setHorizontalHeaderItem(3, item) item = QtGui.QTableWidgetItem() self.tableWidget.setHorizontalHeaderItem(4, item) self.tableWidget.horizontalHeader().setDefaultSectionSize(150) self.tableWidget.horizontalHeader().setSortIndicatorShown(False) self.tableWidget.horizontalHeader().setStretchLastSection(True) self.tableWidget.verticalHeader().setStretchLastSection(False) self.archivePath = QtGui.QLabel(self.Load) self.archivePath.setGeometry(QtCore.QRect(177, 718, 951, 20)) self.archivePath.setObjectName("archivePath") self.label_18 = QtGui.QLabel(self.Load) self.label_18.setGeometry(QtCore.QRect(20, 720, 201, 16)) self.label_18.setObjectName("label_18") self.tabWidget.addTab(self.Load, "") self.tab_2 = QtGui.QWidget() self.tab_2.setObjectName("tab_2") self.checkBox = QtGui.QCheckBox(self.tab_2) self.checkBox.setGeometry(QtCore.QRect(1171, 725, 71, 20)) self.checkBox.setObjectName("checkBox") self.pushButton_3 = QtGui.QPushButton(self.tab_2) self.pushButton_3.setGeometry(QtCore.QRect(1250, 692, 161, 25)) self.pushButton_3.setObjectName("pushButton_3") self.procSpin = QtGui.QSpinBox(self.tab_2) self.procSpin.setGeometry(QtCore.QRect(1060, 693, 53, 22)) self.procSpin.setObjectName("procSpin") self.niceSpin = QtGui.QSpinBox(self.tab_2) self.niceSpin.setGeometry(QtCore.QRect(1060, 723, 53, 22)) self.niceSpin.setMinimum(-99) self.niceSpin.setObjectName("niceSpin") self.groupBox_18 = QtGui.QGroupBox(self.tab_2) self.groupBox_18.setGeometry(QtCore.QRect(913, 617, 501, 71)) self.groupBox_18.setObjectName("groupBox_18") self.plainTextEdit = QtGui.QPlainTextEdit(self.groupBox_18) self.plainTextEdit.setGeometry(QtCore.QRect(4, 14, 491, 51)) self.plainTextEdit.setObjectName("plainTextEdit") self.label_2 = QtGui.QLabel(self.tab_2) self.label_2.setGeometry(QtCore.QRect(959, 725, 101, 16)) self.label_2.setObjectName("label_2") self.label = QtGui.QLabel(self.tab_2) self.label.setGeometry(QtCore.QRect(919, 695, 151, 16)) self.label.setObjectName("label") self.pushButton_2 = QtGui.QPushButton(self.tab_2) self.pushButton_2.setGeometry(QtCore.QRect(1170, 692, 75, 25)) self.pushButton_2.setObjectName("pushButton_2") self.runScanningSimulation = QtGui.QPushButton(self.tab_2) self.runScanningSimulation.setGeometry(QtCore.QRect(1250, 720, 161, 25)) self.runScanningSimulation.setObjectName("runScanningSimulation") self.fileLabel = QtGui.QLabel(self.tab_2) self.fileLabel.setGeometry(QtCore.QRect(90, 723, 771, 16)) self.fileLabel.setObjectName("fileLabel") self.label_15 = QtGui.QLabel(self.tab_2) self.label_15.setGeometry(QtCore.QRect(10, 723, 91, 16)) self.label_15.setObjectName("label_15") self.label_17 = QtGui.QLabel(self.tab_2) self.label_17.setGeometry(QtCore.QRect(10, 708, 201, 16)) self.label_17.setObjectName("label_17") self.simulationFile = QtGui.QLabel(self.tab_2) self.simulationFile.setGeometry(QtCore.QRect(200, 708, 771, 16)) self.simulationFile.setObjectName("simulationFile") self.tabWidget.addTab(self.tab_2, "") self.tab = QtGui.QWidget() self.tab.setObjectName("tab") self.outputStream = QtGui.QTextBrowser(self.tab) self.outputStream.setGeometry(QtCore.QRect(10, 10, 1401, 691)) self.outputStream.setObjectName("outputStream") self.stopSimulation = QtGui.QPushButton(self.tab) self.stopSimulation.setGeometry(QtCore.QRect(10, 710, 1401, 25)) self.stopSimulation.setObjectName("stopSimulation") self.tabWidget.addTab(self.tab, "") self.tab_3 = QtGui.QWidget() self.tab_3.setObjectName("tab_3") self.textOutput = QtGui.QTextEdit(self.tab_3) self.textOutput.setGeometry(QtCore.QRect(22, 430, 661, 261)) self.textOutput.setReadOnly(True) self.textOutput.setObjectName("textOutput") self.label_64 = QtGui.QLabel(self.tab_3) self.label_64.setGeometry(QtCore.QRect(20, 700, 64, 25)) self.label_64.setObjectName("label_64") self.dataTable = QtGui.QTableWidget(self.tab_3) self.dataTable.setGeometry(QtCore.QRect(23, 210, 661, 221)) self.dataTable.setAlternatingRowColors(True) self.dataTable.setSelectionMode(QtGui.QAbstractItemView.MultiSelection) self.dataTable.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) self.dataTable.setShowGrid(False) self.dataTable.setGridStyle(QtCore.Qt.SolidLine) self.dataTable.setObjectName("dataTable") self.dataTable.setColumnCount(4) self.dataTable.setRowCount(0) item = QtGui.QTableWidgetItem() self.dataTable.setHorizontalHeaderItem(0, item) item = QtGui.QTableWidgetItem() self.dataTable.setHorizontalHeaderItem(1, item) item = QtGui.QTableWidgetItem() self.dataTable.setHorizontalHeaderItem(2, item) item = QtGui.QTableWidgetItem() self.dataTable.setHorizontalHeaderItem(3, item) self.dataTable.horizontalHeader().setStretchLastSection(True) self.dataTable.verticalHeader().setDefaultSectionSize(20) self.commandButton = QtGui.QPushButton(self.tab_3) self.commandButton.setGeometry(QtCore.QRect(610, 700, 75, 25)) self.commandButton.setObjectName("commandButton") self.frame = QtGui.QFrame(self.tab_3) self.frame.setGeometry(QtCore.QRect(700, 104, 701, 621)) self.frame.setFrameShape(QtGui.QFrame.StyledPanel) self.frame.setFrameShadow(QtGui.QFrame.Raised) self.frame.setObjectName("frame") self.commandInput = ConsoleWidget(self.tab_3) self.commandInput.setGeometry(QtCore.QRect(89, 702, 511, 21)) self.commandInput.setObjectName("commandInput") self.groupBox = QtGui.QGroupBox(self.tab_3) self.groupBox.setGeometry(QtCore.QRect(23, 4, 661, 201)) self.groupBox.setObjectName("groupBox") self.pushButton_7 = QtGui.QPushButton(self.groupBox) self.pushButton_7.setGeometry(QtCore.QRect(10, 30, 101, 25)) font = QtGui.QFont() font.setWeight(75) font.setBold(True) self.pushButton_7.setFont(font) self.pushButton_7.setObjectName("pushButton_7") self.collectedLabel_3 = QtGui.QLabel(self.groupBox) self.collectedLabel_3.setGeometry(QtCore.QRect(10, 89, 171, 16)) self.collectedLabel_3.setObjectName("collectedLabel_3") self.extraVarsCombo = QtGui.QComboBox(self.groupBox) self.extraVarsCombo.setGeometry(QtCore.QRect(10, 109, 151, 22)) self.extraVarsCombo.setObjectName("extraVarsCombo") self.collectExtraVariable = QtGui.QPushButton(self.groupBox) self.collectExtraVariable.setGeometry(QtCore.QRect(170, 109, 101, 25)) self.collectExtraVariable.setObjectName("collectExtraVariable") self.collectedLabel = QtGui.QLabel(self.groupBox) self.collectedLabel.setGeometry(QtCore.QRect(100, 160, 760, 16)) self.collectedLabel.setObjectName("collectedLabel") self.label_22 = QtGui.QLabel(self.groupBox) self.label_22.setGeometry(QtCore.QRect(10, 160, 150, 16)) self.label_22.setObjectName("label_22") self.groupBox_2 = QtGui.QGroupBox(self.tab_3) self.groupBox_2.setGeometry(QtCore.QRect(700, 4, 701, 91)) self.groupBox_2.setObjectName("groupBox_2") self.collectedLabel_2 = QtGui.QLabel(self.groupBox_2) self.collectedLabel_2.setGeometry(QtCore.QRect(10, 15, 181, 16)) self.collectedLabel_2.setObjectName("collectedLabel_2") self.saveDefaultButton = QtGui.QPushButton(self.groupBox_2) self.saveDefaultButton.setGeometry(QtCore.QRect(10, 60, 81, 25)) self.saveDefaultButton.setObjectName("saveDefaultButton") self.defaultCombo = QtGui.QComboBox(self.groupBox_2) self.defaultCombo.setGeometry(QtCore.QRect(10, 35, 171, 22)) self.defaultCombo.setObjectName("defaultCombo") self.defaultCombo.addItem("") self.zall = QtGui.QCheckBox(self.groupBox_2) self.zall.setGeometry(QtCore.QRect(500, 65, 41, 20)) self.zall.setObjectName("zall") self.yall = QtGui.QCheckBox(self.groupBox_2) self.yall.setGeometry(QtCore.QRect(440, 65, 41, 20)) self.yall.setObjectName("yall") self.xall = QtGui.QCheckBox(self.groupBox_2) self.xall.setGeometry(QtCore.QRect(380, 65, 41, 20)) self.xall.setObjectName("xall") self.deleteButton = QtGui.QPushButton(self.groupBox_2) self.deleteButton.setGeometry(QtCore.QRect(100, 60, 81, 25)) self.deleteButton.setObjectName("deleteButton") self.label_16 = QtGui.QLabel(self.groupBox_2) self.label_16.setGeometry(QtCore.QRect(230, 14, 301, 16)) self.label_16.setObjectName("label_16") self.variableCombo = QtGui.QComboBox(self.groupBox_2) self.variableCombo.setGeometry(QtCore.QRect(230, 35, 81, 22)) self.variableCombo.setObjectName("variableCombo") self.tall = QtGui.QCheckBox(self.groupBox_2) self.tall.setGeometry(QtCore.QRect(320, 65, 41, 20)) self.tall.setObjectName("tall") self.xspin = QtGui.QSpinBox(self.groupBox_2) self.xspin.setGeometry(QtCore.QRect(380, 35, 53, 22)) self.xspin.setMinimum(-10000000) self.xspin.setMaximum(10000000) self.xspin.setObjectName("xspin") self.zspin = QtGui.QSpinBox(self.groupBox_2) self.zspin.setGeometry(QtCore.QRect(500, 35, 53, 22)) self.zspin.setMinimum(-1000000) self.zspin.setMaximum(10000000) self.zspin.setObjectName("zspin") self.yspin = QtGui.QSpinBox(self.groupBox_2) self.yspin.setGeometry(QtCore.QRect(440, 35, 53, 22)) self.yspin.setMinimum(-999900) self.yspin.setMaximum(100000000) self.yspin.setObjectName("yspin") self.tspin = QtGui.QSpinBox(self.groupBox_2) self.tspin.setGeometry(QtCore.QRect(320, 35, 53, 22)) self.tspin.setMinimum(-10000000) self.tspin.setMaximum(10000000) self.tspin.setProperty("value", 0) self.tspin.setObjectName("tspin") self.createGraph = QtGui.QPushButton(self.groupBox_2) self.createGraph.setGeometry(QtCore.QRect(590, 34, 101, 25)) self.createGraph.setObjectName("createGraph") self.tabWidget.addTab(self.tab_3, "") self.gridLayout_2.addWidget(self.tabWidget, 0, 0, 1, 1) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtGui.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 1465, 20)) self.menubar.setObjectName("menubar") self.menuFile = QtGui.QMenu(self.menubar) self.menuFile.setObjectName("menuFile") self.menuHelp = QtGui.QMenu(self.menubar) self.menuHelp.setObjectName("menuHelp") self.menuView = QtGui.QMenu(self.menubar) self.menuView.setObjectName("menuView") MainWindow.setMenuBar(self.menubar) self.statusbar = QtGui.QStatusBar(MainWindow) self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar) self.actionCompare = QtGui.QAction(MainWindow) self.actionCompare.setObjectName("actionCompare") self.actionFileHistory = QtGui.QAction(MainWindow) self.actionFileHistory.setObjectName("actionFileHistory") self.actionExit = QtGui.QAction(MainWindow) self.actionExit.setObjectName("actionExit") self.actionHelp = QtGui.QAction(MainWindow) self.actionHelp.setObjectName("actionHelp") self.actionStop_Simulation = QtGui.QAction(MainWindow) self.actionStop_Simulation.setObjectName("actionStop_Simulation") self.actionPositioning = QtGui.QAction(MainWindow) self.actionPositioning.setObjectName("actionPositioning") self.actionArchive = QtGui.QAction(MainWindow) self.actionArchive.setObjectName("actionArchive") self.actionCreate_Example = QtGui.QAction(MainWindow) self.actionCreate_Example.setObjectName("actionCreate_Example") self.actionSimulation_Code = QtGui.QAction(MainWindow) self.actionSimulation_Code.setObjectName("actionSimulation_Code") self.actionDefault_Variables = QtGui.QAction(MainWindow) self.actionDefault_Variables.setObjectName("actionDefault_Variables") self.actionAbout = QtGui.QAction(MainWindow) self.actionAbout.setObjectName("actionAbout") self.menuFile.addSeparator() self.menuFile.addAction(self.actionArchive) self.menuFile.addAction(self.actionSimulation_Code) self.menuFile.addAction(self.actionDefault_Variables) self.menuFile.addSeparator() self.menuFile.addAction(self.actionFileHistory) self.menuFile.addAction(self.actionCompare) self.menuFile.addSeparator() self.menuFile.addAction(self.actionStop_Simulation) self.menuFile.addSeparator() self.menuFile.addAction(self.actionExit) self.menuHelp.addAction(self.actionAbout) self.menuHelp.addAction(self.actionHelp) self.menuView.addAction(self.actionPositioning) self.menubar.addAction(self.menuFile.menuAction()) self.menubar.addAction(self.menuView.menuAction()) self.menubar.addAction(self.menuHelp.menuAction()) self.retranslateUi(MainWindow) self.tabWidget.setCurrentIndex(0) QtCore.QMetaObject.connectSlotsByName(MainWindow)
class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(1465, 869) MainWindow.setCursor(QtCore.Qt.ArrowCursor) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap("BOUTguilogo.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) MainWindow.setWindowIcon(icon) MainWindow.setTabShape(QtGui.QTabWidget.Rounded) self.centralwidget = QtGui.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.gridLayout_2 = QtGui.QGridLayout(self.centralwidget) self.gridLayout_2.setObjectName("gridLayout_2") self.tabWidget = QtGui.QTabWidget(self.centralwidget) self.tabWidget.setToolTip("") self.tabWidget.setTabShape(QtGui.QTabWidget.Rounded) self.tabWidget.setTabsClosable(False) self.tabWidget.setMovable(False) self.tabWidget.setObjectName("tabWidget") self.Load = QtGui.QWidget() self.Load.setEnabled(True) self.Load.setObjectName("Load") self.pushButton = QtGui.QPushButton(self.Load) self.pushButton.setGeometry(QtCore.QRect(1320, 716, 81, 25)) self.pushButton.setObjectName("pushButton") self.tableWidget = QtGui.QTableWidget(self.Load) self.tableWidget.setGeometry(QtCore.QRect(20, 20, 1381, 691)) self.tableWidget.setAlternatingRowColors(True) self.tableWidget.setSelectionMode(QtGui.QAbstractItemView.SingleSelection) self.tableWidget.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) self.tableWidget.setColumnCount(5) self.tableWidget.setObjectName("tableWidget") self.tableWidget.setColumnCount(5) self.tableWidget.setRowCount(0) item = QtGui.QTableWidgetItem() self.tableWidget.setHorizontalHeaderItem(0, item) item = QtGui.QTableWidgetItem() self.tableWidget.setHorizontalHeaderItem(1, item) item = QtGui.QTableWidgetItem() self.tableWidget.setHorizontalHeaderItem(2, item) item = QtGui.QTableWidgetItem() self.tableWidget.setHorizontalHeaderItem(3, item) item = QtGui.QTableWidgetItem() self.tableWidget.setHorizontalHeaderItem(4, item) self.tableWidget.horizontalHeader().setDefaultSectionSize(150) self.tableWidget.horizontalHeader().setSortIndicatorShown(False) self.tableWidget.horizontalHeader().setStretchLastSection(True) self.tableWidget.verticalHeader().setStretchLastSection(False) self.archivePath = QtGui.QLabel(self.Load) self.archivePath.setGeometry(QtCore.QRect(177, 718, 951, 20)) self.archivePath.setObjectName("archivePath") self.label_18 = QtGui.QLabel(self.Load) self.label_18.setGeometry(QtCore.QRect(20, 720, 201, 16)) self.label_18.setObjectName("label_18") self.tabWidget.addTab(self.Load, "") self.tab_2 = QtGui.QWidget() self.tab_2.setObjectName("tab_2") self.checkBox = QtGui.QCheckBox(self.tab_2) self.checkBox.setGeometry(QtCore.QRect(1171, 725, 71, 20)) self.checkBox.setObjectName("checkBox") self.pushButton_3 = QtGui.QPushButton(self.tab_2) self.pushButton_3.setGeometry(QtCore.QRect(1250, 692, 161, 25)) self.pushButton_3.setObjectName("pushButton_3") self.procSpin = QtGui.QSpinBox(self.tab_2) self.procSpin.setGeometry(QtCore.QRect(1060, 693, 53, 22)) self.procSpin.setObjectName("procSpin") self.niceSpin = QtGui.QSpinBox(self.tab_2) self.niceSpin.setGeometry(QtCore.QRect(1060, 723, 53, 22)) self.niceSpin.setMinimum(-99) self.niceSpin.setObjectName("niceSpin") self.groupBox_18 = QtGui.QGroupBox(self.tab_2) self.groupBox_18.setGeometry(QtCore.QRect(913, 617, 501, 71)) self.groupBox_18.setObjectName("groupBox_18") self.plainTextEdit = QtGui.QPlainTextEdit(self.groupBox_18) self.plainTextEdit.setGeometry(QtCore.QRect(4, 14, 491, 51)) self.plainTextEdit.setObjectName("plainTextEdit") self.label_2 = QtGui.QLabel(self.tab_2) self.label_2.setGeometry(QtCore.QRect(959, 725, 101, 16)) self.label_2.setObjectName("label_2") self.label = QtGui.QLabel(self.tab_2) self.label.setGeometry(QtCore.QRect(919, 695, 151, 16)) self.label.setObjectName("label") self.pushButton_2 = QtGui.QPushButton(self.tab_2) self.pushButton_2.setGeometry(QtCore.QRect(1170, 692, 75, 25)) self.pushButton_2.setObjectName("pushButton_2") self.runScanningSimulation = QtGui.QPushButton(self.tab_2) self.runScanningSimulation.setGeometry(QtCore.QRect(1250, 720, 161, 25)) self.runScanningSimulation.setObjectName("runScanningSimulation") self.fileLabel = QtGui.QLabel(self.tab_2) self.fileLabel.setGeometry(QtCore.QRect(90, 723, 771, 16)) self.fileLabel.setObjectName("fileLabel") self.label_15 = QtGui.QLabel(self.tab_2) self.label_15.setGeometry(QtCore.QRect(10, 723, 91, 16)) self.label_15.setObjectName("label_15") self.label_17 = QtGui.QLabel(self.tab_2) self.label_17.setGeometry(QtCore.QRect(10, 708, 201, 16)) self.label_17.setObjectName("label_17") self.simulationFile = QtGui.QLabel(self.tab_2) self.simulationFile.setGeometry(QtCore.QRect(200, 708, 771, 16)) self.simulationFile.setObjectName("simulationFile") self.tabWidget.addTab(self.tab_2, "") self.tab = QtGui.QWidget() self.tab.setObjectName("tab") self.outputStream = QtGui.QTextBrowser(self.tab) self.outputStream.setGeometry(QtCore.QRect(10, 10, 1401, 691)) self.outputStream.setObjectName("outputStream") self.stopSimulation = QtGui.QPushButton(self.tab) self.stopSimulation.setGeometry(QtCore.QRect(10, 710, 1401, 25)) self.stopSimulation.setObjectName("stopSimulation") self.tabWidget.addTab(self.tab, "") self.tab_3 = QtGui.QWidget() self.tab_3.setObjectName("tab_3") self.textOutput = QtGui.QTextEdit(self.tab_3) self.textOutput.setGeometry(QtCore.QRect(22, 430, 661, 261)) self.textOutput.setReadOnly(True) self.textOutput.setObjectName("textOutput") self.label_64 = QtGui.QLabel(self.tab_3) self.label_64.setGeometry(QtCore.QRect(20, 700, 64, 25)) self.label_64.setObjectName("label_64") self.dataTable = QtGui.QTableWidget(self.tab_3) self.dataTable.setGeometry(QtCore.QRect(23, 210, 661, 221)) self.dataTable.setAlternatingRowColors(True) self.dataTable.setSelectionMode(QtGui.QAbstractItemView.MultiSelection) self.dataTable.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) self.dataTable.setShowGrid(False) self.dataTable.setGridStyle(QtCore.Qt.SolidLine) self.dataTable.setObjectName("dataTable") self.dataTable.setColumnCount(4) self.dataTable.setRowCount(0) item = QtGui.QTableWidgetItem() self.dataTable.setHorizontalHeaderItem(0, item) item = QtGui.QTableWidgetItem() self.dataTable.setHorizontalHeaderItem(1, item) item = QtGui.QTableWidgetItem() self.dataTable.setHorizontalHeaderItem(2, item) item = QtGui.QTableWidgetItem() self.dataTable.setHorizontalHeaderItem(3, item) self.dataTable.horizontalHeader().setStretchLastSection(True) self.dataTable.verticalHeader().setDefaultSectionSize(20) self.commandButton = QtGui.QPushButton(self.tab_3) self.commandButton.setGeometry(QtCore.QRect(610, 700, 75, 25)) self.commandButton.setObjectName("commandButton") self.frame = QtGui.QFrame(self.tab_3) self.frame.setGeometry(QtCore.QRect(700, 104, 701, 621)) self.frame.setFrameShape(QtGui.QFrame.StyledPanel) self.frame.setFrameShadow(QtGui.QFrame.Raised) self.frame.setObjectName("frame") self.commandInput = ConsoleWidget(self.tab_3) self.commandInput.setGeometry(QtCore.QRect(89, 702, 511, 21)) self.commandInput.setObjectName("commandInput") self.groupBox = QtGui.QGroupBox(self.tab_3) self.groupBox.setGeometry(QtCore.QRect(23, 4, 661, 201)) self.groupBox.setObjectName("groupBox") self.pushButton_7 = QtGui.QPushButton(self.groupBox) self.pushButton_7.setGeometry(QtCore.QRect(10, 30, 101, 25)) font = QtGui.QFont() font.setWeight(75) font.setBold(True) self.pushButton_7.setFont(font) self.pushButton_7.setObjectName("pushButton_7") self.collectedLabel_3 = QtGui.QLabel(self.groupBox) self.collectedLabel_3.setGeometry(QtCore.QRect(10, 89, 171, 16)) self.collectedLabel_3.setObjectName("collectedLabel_3") self.extraVarsCombo = QtGui.QComboBox(self.groupBox) self.extraVarsCombo.setGeometry(QtCore.QRect(10, 109, 151, 22)) self.extraVarsCombo.setObjectName("extraVarsCombo") self.collectExtraVariable = QtGui.QPushButton(self.groupBox) self.collectExtraVariable.setGeometry(QtCore.QRect(170, 109, 101, 25)) self.collectExtraVariable.setObjectName("collectExtraVariable") self.collectedLabel = QtGui.QLabel(self.groupBox) self.collectedLabel.setGeometry(QtCore.QRect(100, 160, 760, 16)) self.collectedLabel.setObjectName("collectedLabel") self.label_22 = QtGui.QLabel(self.groupBox) self.label_22.setGeometry(QtCore.QRect(10, 160, 150, 16)) self.label_22.setObjectName("label_22") self.groupBox_2 = QtGui.QGroupBox(self.tab_3) self.groupBox_2.setGeometry(QtCore.QRect(700, 4, 701, 91)) self.groupBox_2.setObjectName("groupBox_2") self.collectedLabel_2 = QtGui.QLabel(self.groupBox_2) self.collectedLabel_2.setGeometry(QtCore.QRect(10, 15, 181, 16)) self.collectedLabel_2.setObjectName("collectedLabel_2") self.saveDefaultButton = QtGui.QPushButton(self.groupBox_2) self.saveDefaultButton.setGeometry(QtCore.QRect(10, 60, 81, 25)) self.saveDefaultButton.setObjectName("saveDefaultButton") self.defaultCombo = QtGui.QComboBox(self.groupBox_2) self.defaultCombo.setGeometry(QtCore.QRect(10, 35, 171, 22)) self.defaultCombo.setObjectName("defaultCombo") self.defaultCombo.addItem("") self.zall = QtGui.QCheckBox(self.groupBox_2) self.zall.setGeometry(QtCore.QRect(500, 65, 41, 20)) self.zall.setObjectName("zall") self.yall = QtGui.QCheckBox(self.groupBox_2) self.yall.setGeometry(QtCore.QRect(440, 65, 41, 20)) self.yall.setObjectName("yall") self.xall = QtGui.QCheckBox(self.groupBox_2) self.xall.setGeometry(QtCore.QRect(380, 65, 41, 20)) self.xall.setObjectName("xall") self.deleteButton = QtGui.QPushButton(self.groupBox_2) self.deleteButton.setGeometry(QtCore.QRect(100, 60, 81, 25)) self.deleteButton.setObjectName("deleteButton") self.label_16 = QtGui.QLabel(self.groupBox_2) self.label_16.setGeometry(QtCore.QRect(230, 14, 301, 16)) self.label_16.setObjectName("label_16") self.variableCombo = QtGui.QComboBox(self.groupBox_2) self.variableCombo.setGeometry(QtCore.QRect(230, 35, 81, 22)) self.variableCombo.setObjectName("variableCombo") self.tall = QtGui.QCheckBox(self.groupBox_2) self.tall.setGeometry(QtCore.QRect(320, 65, 41, 20)) self.tall.setObjectName("tall") self.xspin = QtGui.QSpinBox(self.groupBox_2) self.xspin.setGeometry(QtCore.QRect(380, 35, 53, 22)) self.xspin.setMinimum(-10000000) self.xspin.setMaximum(10000000) self.xspin.setObjectName("xspin") self.zspin = QtGui.QSpinBox(self.groupBox_2) self.zspin.setGeometry(QtCore.QRect(500, 35, 53, 22)) self.zspin.setMinimum(-1000000) self.zspin.setMaximum(10000000) self.zspin.setObjectName("zspin") self.yspin = QtGui.QSpinBox(self.groupBox_2) self.yspin.setGeometry(QtCore.QRect(440, 35, 53, 22)) self.yspin.setMinimum(-999900) self.yspin.setMaximum(100000000) self.yspin.setObjectName("yspin") self.tspin = QtGui.QSpinBox(self.groupBox_2) self.tspin.setGeometry(QtCore.QRect(320, 35, 53, 22)) self.tspin.setMinimum(-10000000) self.tspin.setMaximum(10000000) self.tspin.setProperty("value", 0) self.tspin.setObjectName("tspin") self.createGraph = QtGui.QPushButton(self.groupBox_2) self.createGraph.setGeometry(QtCore.QRect(590, 34, 101, 25)) self.createGraph.setObjectName("createGraph") self.tabWidget.addTab(self.tab_3, "") self.gridLayout_2.addWidget(self.tabWidget, 0, 0, 1, 1) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtGui.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 1465, 20)) self.menubar.setObjectName("menubar") self.menuFile = QtGui.QMenu(self.menubar) self.menuFile.setObjectName("menuFile") self.menuHelp = QtGui.QMenu(self.menubar) self.menuHelp.setObjectName("menuHelp") self.menuView = QtGui.QMenu(self.menubar) self.menuView.setObjectName("menuView") MainWindow.setMenuBar(self.menubar) self.statusbar = QtGui.QStatusBar(MainWindow) self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar) self.actionCompare = QtGui.QAction(MainWindow) self.actionCompare.setObjectName("actionCompare") self.actionFileHistory = QtGui.QAction(MainWindow) self.actionFileHistory.setObjectName("actionFileHistory") self.actionExit = QtGui.QAction(MainWindow) self.actionExit.setObjectName("actionExit") self.actionHelp = QtGui.QAction(MainWindow) self.actionHelp.setObjectName("actionHelp") self.actionStop_Simulation = QtGui.QAction(MainWindow) self.actionStop_Simulation.setObjectName("actionStop_Simulation") self.actionPositioning = QtGui.QAction(MainWindow) self.actionPositioning.setObjectName("actionPositioning") self.actionArchive = QtGui.QAction(MainWindow) self.actionArchive.setObjectName("actionArchive") self.actionCreate_Example = QtGui.QAction(MainWindow) self.actionCreate_Example.setObjectName("actionCreate_Example") self.actionSimulation_Code = QtGui.QAction(MainWindow) self.actionSimulation_Code.setObjectName("actionSimulation_Code") self.actionDefault_Variables = QtGui.QAction(MainWindow) self.actionDefault_Variables.setObjectName("actionDefault_Variables") self.actionAbout = QtGui.QAction(MainWindow) self.actionAbout.setObjectName("actionAbout") self.menuFile.addSeparator() self.menuFile.addAction(self.actionArchive) self.menuFile.addAction(self.actionSimulation_Code) self.menuFile.addAction(self.actionDefault_Variables) self.menuFile.addSeparator() self.menuFile.addAction(self.actionFileHistory) self.menuFile.addAction(self.actionCompare) self.menuFile.addSeparator() self.menuFile.addAction(self.actionStop_Simulation) self.menuFile.addSeparator() self.menuFile.addAction(self.actionExit) self.menuHelp.addAction(self.actionAbout) self.menuHelp.addAction(self.actionHelp) self.menuView.addAction(self.actionPositioning) self.menubar.addAction(self.menuFile.menuAction()) self.menubar.addAction(self.menuView.menuAction()) self.menubar.addAction(self.menuHelp.menuAction()) self.retranslateUi(MainWindow) self.tabWidget.setCurrentIndex(0) QtCore.QMetaObject.connectSlotsByName(MainWindow) def retranslateUi(self, MainWindow): MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", "BOUTgui", None, QtGui.QApplication.UnicodeUTF8)) self.pushButton.setToolTip(QtGui.QApplication.translate("MainWindow", "Loads the selected file for simualtion after editing", None, QtGui.QApplication.UnicodeUTF8)) self.pushButton.setText(QtGui.QApplication.translate("MainWindow", "Load", None, QtGui.QApplication.UnicodeUTF8)) self.tableWidget.horizontalHeaderItem(0).setText(QtGui.QApplication.translate("MainWindow", "File Path", None, QtGui.QApplication.UnicodeUTF8)) self.tableWidget.horizontalHeaderItem(1).setText(QtGui.QApplication.translate("MainWindow", "Date Created", None, QtGui.QApplication.UnicodeUTF8)) self.tableWidget.horizontalHeaderItem(2).setText(QtGui.QApplication.translate("MainWindow", "Date Modified", None, QtGui.QApplication.UnicodeUTF8)) self.tableWidget.horizontalHeaderItem(3).setText(QtGui.QApplication.translate("MainWindow", "No of Processors", None, QtGui.QApplication.UnicodeUTF8)) self.tableWidget.horizontalHeaderItem(4).setText(QtGui.QApplication.translate("MainWindow", "Comments", None, QtGui.QApplication.UnicodeUTF8)) self.archivePath.setToolTip(QtGui.QApplication.translate("MainWindow", "Shows the file path of the current archive", None, QtGui.QApplication.UnicodeUTF8)) self.archivePath.setText(QtGui.QApplication.translate("MainWindow", "None loaded or bad file path, click File -> Archive Location to load", None, QtGui.QApplication.UnicodeUTF8)) self.label_18.setText(QtGui.QApplication.translate("MainWindow", "Current Archive Folder =", None, QtGui.QApplication.UnicodeUTF8)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.Load), QtGui.QApplication.translate("MainWindow", "Load", None, QtGui.QApplication.UnicodeUTF8)) self.checkBox.setToolTip(QtGui.QApplication.translate("MainWindow", "If checked runs the simulations from the previous data", None, QtGui.QApplication.UnicodeUTF8)) self.checkBox.setText(QtGui.QApplication.translate("MainWindow", "Restart", None, QtGui.QApplication.UnicodeUTF8)) self.pushButton_3.setToolTip(QtGui.QApplication.translate("MainWindow", "Run the simulation with all the user settings ", None, QtGui.QApplication.UnicodeUTF8)) self.pushButton_3.setText(QtGui.QApplication.translate("MainWindow", "Run Simulation", None, QtGui.QApplication.UnicodeUTF8)) self.procSpin.setToolTip(QtGui.QApplication.translate("MainWindow", "Change the number of processor to run the simulation on", None, QtGui.QApplication.UnicodeUTF8)) self.niceSpin.setToolTip(QtGui.QApplication.translate("MainWindow", "Set the niceness level of the simulation", None, QtGui.QApplication.UnicodeUTF8)) self.groupBox_18.setTitle(QtGui.QApplication.translate("MainWindow", "Comments", None, QtGui.QApplication.UnicodeUTF8)) self.plainTextEdit.setToolTip(QtGui.QApplication.translate("MainWindow", "Type comments in here that will be saved in the archive", None, QtGui.QApplication.UnicodeUTF8)) self.plainTextEdit.setPlainText(QtGui.QApplication.translate("MainWindow", "Write any useful comments here...", None, QtGui.QApplication.UnicodeUTF8)) self.label_2.setToolTip(QtGui.QApplication.translate("MainWindow", "Set the niceness level of the simulation", None, QtGui.QApplication.UnicodeUTF8)) self.label_2.setText(QtGui.QApplication.translate("MainWindow", "\'Niceness\' level:", None, QtGui.QApplication.UnicodeUTF8)) self.label.setToolTip(QtGui.QApplication.translate("MainWindow", "Change the number of processor to run the simulation on", None, QtGui.QApplication.UnicodeUTF8)) self.label.setText(QtGui.QApplication.translate("MainWindow", "Number of Processors:", None, QtGui.QApplication.UnicodeUTF8)) self.pushButton_2.setToolTip(QtGui.QApplication.translate("MainWindow", "Save changes made to the control file without running anything", None, QtGui.QApplication.UnicodeUTF8)) self.pushButton_2.setText(QtGui.QApplication.translate("MainWindow", "Write to file", None, QtGui.QApplication.UnicodeUTF8)) self.runScanningSimulation.setToolTip(QtGui.QApplication.translate("MainWindow", "Runs a series of simulations given an increment, a starting variable and a final variable", None, QtGui.QApplication.UnicodeUTF8)) self.runScanningSimulation.setText(QtGui.QApplication.translate("MainWindow", "Run Scanning Simulation", None, QtGui.QApplication.UnicodeUTF8)) self.fileLabel.setToolTip(QtGui.QApplication.translate("MainWindow", "Current config filepath", None, QtGui.QApplication.UnicodeUTF8)) self.fileLabel.setText(QtGui.QApplication.translate("MainWindow", "None", None, QtGui.QApplication.UnicodeUTF8)) self.label_15.setText(QtGui.QApplication.translate("MainWindow", "Open File =", None, QtGui.QApplication.UnicodeUTF8)) self.label_17.setText(QtGui.QApplication.translate("MainWindow", "Current Simulation Code File = ", None, QtGui.QApplication.UnicodeUTF8)) self.simulationFile.setToolTip(QtGui.QApplication.translate("MainWindow", "File path of the simulation code that will be used in the simulation", None, QtGui.QApplication.UnicodeUTF8)) self.simulationFile.setText(QtGui.QApplication.translate("MainWindow", "None", None, QtGui.QApplication.UnicodeUTF8)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), QtGui.QApplication.translate("MainWindow", "Change Inputs", None, QtGui.QApplication.UnicodeUTF8)) self.outputStream.setToolTip(QtGui.QApplication.translate("MainWindow", "The output stream, showing simualtion data from the BOUT code", None, QtGui.QApplication.UnicodeUTF8)) self.stopSimulation.setToolTip(QtGui.QApplication.translate("MainWindow", "Stop the simulation", None, QtGui.QApplication.UnicodeUTF8)) self.stopSimulation.setText(QtGui.QApplication.translate("MainWindow", "Stop Simulation", None, QtGui.QApplication.UnicodeUTF8)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), QtGui.QApplication.translate("MainWindow", "Output Stream", None, QtGui.QApplication.UnicodeUTF8)) self.textOutput.setToolTip(QtGui.QApplication.translate("MainWindow", "The printed output from commands", None, QtGui.QApplication.UnicodeUTF8)) self.label_64.setText(QtGui.QApplication.translate("MainWindow", "Command:", None, QtGui.QApplication.UnicodeUTF8)) self.dataTable.setToolTip(QtGui.QApplication.translate("MainWindow", "Table showing the current variables and imported modules", None, QtGui.QApplication.UnicodeUTF8)) self.dataTable.horizontalHeaderItem(0).setText(QtGui.QApplication.translate("MainWindow", "Name", None, QtGui.QApplication.UnicodeUTF8)) self.dataTable.horizontalHeaderItem(1).setText(QtGui.QApplication.translate("MainWindow", "Source", None, QtGui.QApplication.UnicodeUTF8)) self.dataTable.horizontalHeaderItem(2).setText(QtGui.QApplication.translate("MainWindow", "Trace", None, QtGui.QApplication.UnicodeUTF8)) self.dataTable.horizontalHeaderItem(3).setText(QtGui.QApplication.translate("MainWindow", "Comments", None, QtGui.QApplication.UnicodeUTF8)) self.commandButton.setToolTip(QtGui.QApplication.translate("MainWindow", "Run current command", None, QtGui.QApplication.UnicodeUTF8)) self.commandButton.setText(QtGui.QApplication.translate("MainWindow", "Run", None, QtGui.QApplication.UnicodeUTF8)) self.frame.setToolTip(QtGui.QApplication.translate("MainWindow", "Graphing area, any plots appear here", None, QtGui.QApplication.UnicodeUTF8)) self.commandInput.setToolTip(QtGui.QApplication.translate("MainWindow", "Enter commands as if into a python command line", None, QtGui.QApplication.UnicodeUTF8)) self.groupBox.setTitle(QtGui.QApplication.translate("MainWindow", "Collection of Variables", None, QtGui.QApplication.UnicodeUTF8)) self.pushButton_7.setToolTip(QtGui.QApplication.translate("MainWindow", "Imports the data from the current folder to be used for analysis", None, QtGui.QApplication.UnicodeUTF8)) self.pushButton_7.setText(QtGui.QApplication.translate("MainWindow", "Collect Data", None, QtGui.QApplication.UnicodeUTF8)) self.collectedLabel_3.setText(QtGui.QApplication.translate("MainWindow", "Additional Collect Variables :", None, QtGui.QApplication.UnicodeUTF8)) self.extraVarsCombo.setToolTip(QtGui.QApplication.translate("MainWindow", "choose a non-default variable to collect", None, QtGui.QApplication.UnicodeUTF8)) self.collectExtraVariable.setToolTip(QtGui.QApplication.translate("MainWindow", "Import data from a non-default variable (add defaults file -> default variables)", None, QtGui.QApplication.UnicodeUTF8)) self.collectExtraVariable.setText(QtGui.QApplication.translate("MainWindow", "Collect Variable", None, QtGui.QApplication.UnicodeUTF8)) self.collectedLabel.setToolTip(QtGui.QApplication.translate("MainWindow", "The folder path showing the location of the data files", None, QtGui.QApplication.UnicodeUTF8)) self.collectedLabel.setText(QtGui.QApplication.translate("MainWindow", "None", None, QtGui.QApplication.UnicodeUTF8)) self.label_22.setToolTip(QtGui.QApplication.translate("MainWindow", "The current source of data in use", None, QtGui.QApplication.UnicodeUTF8)) self.label_22.setText(QtGui.QApplication.translate("MainWindow", "Collect From :", None, QtGui.QApplication.UnicodeUTF8)) self.groupBox_2.setTitle(QtGui.QApplication.translate("MainWindow", "Plotting", None, QtGui.QApplication.UnicodeUTF8)) self.collectedLabel_2.setText(QtGui.QApplication.translate("MainWindow", "Load a default input selection", None, QtGui.QApplication.UnicodeUTF8)) self.saveDefaultButton.setToolTip(QtGui.QApplication.translate("MainWindow", "Save current settings so they can be used again", None, QtGui.QApplication.UnicodeUTF8)) self.saveDefaultButton.setText(QtGui.QApplication.translate("MainWindow", "Save", None, QtGui.QApplication.UnicodeUTF8)) self.defaultCombo.setToolTip(QtGui.QApplication.translate("MainWindow", "Select default settings", None, QtGui.QApplication.UnicodeUTF8)) self.defaultCombo.setItemText(0, QtGui.QApplication.translate("MainWindow", "None", None, QtGui.QApplication.UnicodeUTF8)) self.zall.setToolTip(QtGui.QApplication.translate("MainWindow", "Select all of z", None, QtGui.QApplication.UnicodeUTF8)) self.zall.setText(QtGui.QApplication.translate("MainWindow", "All", None, QtGui.QApplication.UnicodeUTF8)) self.yall.setToolTip(QtGui.QApplication.translate("MainWindow", "Select all of y", None, QtGui.QApplication.UnicodeUTF8)) self.yall.setText(QtGui.QApplication.translate("MainWindow", "All", None, QtGui.QApplication.UnicodeUTF8)) self.xall.setToolTip(QtGui.QApplication.translate("MainWindow", "Select all of x ", None, QtGui.QApplication.UnicodeUTF8)) self.xall.setText(QtGui.QApplication.translate("MainWindow", "All", None, QtGui.QApplication.UnicodeUTF8)) self.deleteButton.setToolTip(QtGui.QApplication.translate("MainWindow", "Save current settings so they can be used again", None, QtGui.QApplication.UnicodeUTF8)) self.deleteButton.setText(QtGui.QApplication.translate("MainWindow", "Delete", None, QtGui.QApplication.UnicodeUTF8)) self.label_16.setText(QtGui.QApplication.translate("MainWindow", "Input of form: variable(t,x,y,z) :", None, QtGui.QApplication.UnicodeUTF8)) self.variableCombo.setToolTip(QtGui.QApplication.translate("MainWindow", "Choose what variable to plot", None, QtGui.QApplication.UnicodeUTF8)) self.tall.setToolTip(QtGui.QApplication.translate("MainWindow", "Select all of time ", None, QtGui.QApplication.UnicodeUTF8)) self.tall.setText(QtGui.QApplication.translate("MainWindow", "All", None, QtGui.QApplication.UnicodeUTF8)) self.xspin.setToolTip(QtGui.QApplication.translate("MainWindow", "x value", None, QtGui.QApplication.UnicodeUTF8)) self.zspin.setToolTip(QtGui.QApplication.translate("MainWindow", "z value", None, QtGui.QApplication.UnicodeUTF8)) self.yspin.setToolTip(QtGui.QApplication.translate("MainWindow", "y value", None, QtGui.QApplication.UnicodeUTF8)) self.tspin.setToolTip(QtGui.QApplication.translate("MainWindow", "Time value", None, QtGui.QApplication.UnicodeUTF8)) self.createGraph.setToolTip(QtGui.QApplication.translate("MainWindow", "Display the data selected as a graph", None, QtGui.QApplication.UnicodeUTF8)) self.createGraph.setText(QtGui.QApplication.translate("MainWindow", "Create Graph", None, QtGui.QApplication.UnicodeUTF8)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), QtGui.QApplication.translate("MainWindow", "Graphing", None, QtGui.QApplication.UnicodeUTF8)) self.menuFile.setTitle(QtGui.QApplication.translate("MainWindow", "File", None, QtGui.QApplication.UnicodeUTF8)) self.menuHelp.setTitle(QtGui.QApplication.translate("MainWindow", "Help", None, QtGui.QApplication.UnicodeUTF8)) self.menuView.setTitle(QtGui.QApplication.translate("MainWindow", "View", None, QtGui.QApplication.UnicodeUTF8)) self.actionCompare.setText(QtGui.QApplication.translate("MainWindow", "Compare", None, QtGui.QApplication.UnicodeUTF8)) self.actionCompare.setToolTip(QtGui.QApplication.translate("MainWindow", "Once a file has been initially loaded this can be selected to compare differences between a second file", None, QtGui.QApplication.UnicodeUTF8)) self.actionCompare.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+Alt+C", None, QtGui.QApplication.UnicodeUTF8)) self.actionFileHistory.setText(QtGui.QApplication.translate("MainWindow", "File History", None, QtGui.QApplication.UnicodeUTF8)) self.actionFileHistory.setToolTip(QtGui.QApplication.translate("MainWindow", "Brings up the automatically created history file which details the files family tree", None, QtGui.QApplication.UnicodeUTF8)) self.actionFileHistory.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+H", None, QtGui.QApplication.UnicodeUTF8)) self.actionExit.setText(QtGui.QApplication.translate("MainWindow", "Exit", None, QtGui.QApplication.UnicodeUTF8)) self.actionExit.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+Q", None, QtGui.QApplication.UnicodeUTF8)) self.actionHelp.setText(QtGui.QApplication.translate("MainWindow", "Help", None, QtGui.QApplication.UnicodeUTF8)) self.actionHelp.setShortcut(QtGui.QApplication.translate("MainWindow", "F11", None, QtGui.QApplication.UnicodeUTF8)) self.actionStop_Simulation.setText(QtGui.QApplication.translate("MainWindow", "Stop Simulation", None, QtGui.QApplication.UnicodeUTF8)) self.actionStop_Simulation.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+C", None, QtGui.QApplication.UnicodeUTF8)) self.actionPositioning.setText(QtGui.QApplication.translate("MainWindow", "Edit Input Positioning", None, QtGui.QApplication.UnicodeUTF8)) self.actionPositioning.setToolTip(QtGui.QApplication.translate("MainWindow", "Change the positioning of the input boxes", None, QtGui.QApplication.UnicodeUTF8)) self.actionPositioning.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+B", None, QtGui.QApplication.UnicodeUTF8)) self.actionArchive.setText(QtGui.QApplication.translate("MainWindow", "Archive Location", None, QtGui.QApplication.UnicodeUTF8)) self.actionArchive.setToolTip(QtGui.QApplication.translate("MainWindow", "This allows the selection of folder to use as an archive", None, QtGui.QApplication.UnicodeUTF8)) self.actionArchive.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+O", None, QtGui.QApplication.UnicodeUTF8)) self.actionCreate_Example.setText(QtGui.QApplication.translate("MainWindow", "Create Example", None, QtGui.QApplication.UnicodeUTF8)) self.actionCreate_Example.setToolTip(QtGui.QApplication.translate("MainWindow", "This creates an example folder in the selected archive", None, QtGui.QApplication.UnicodeUTF8)) self.actionSimulation_Code.setText(QtGui.QApplication.translate("MainWindow", "Simulation Code", None, QtGui.QApplication.UnicodeUTF8)) self.actionSimulation_Code.setToolTip(QtGui.QApplication.translate("MainWindow", "This allows the code used for simulations to be changed, so different models can be used", None, QtGui.QApplication.UnicodeUTF8)) self.actionSimulation_Code.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+L", None, QtGui.QApplication.UnicodeUTF8)) self.actionDefault_Variables.setText(QtGui.QApplication.translate("MainWindow", "Default Variables", None, QtGui.QApplication.UnicodeUTF8)) self.actionDefault_Variables.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+N", None, QtGui.QApplication.UnicodeUTF8)) self.actionAbout.setText(QtGui.QApplication.translate("MainWindow", "About", None, QtGui.QApplication.UnicodeUTF8))
def _on_key_down(self, event, skip=True): """ Capture the character events, let the parent widget handle them, and put our logic afterward. """ # FIXME: This method needs to be broken down in smaller ones. current_line_number = self.GetCurrentLine() if event.KeyCode in (ord("c"), ord("C")) and event.ControlDown(): # Capture Control-C if self._input_state == "subprocess": if self.debug: print >>sys.__stderr__, "Killing running process" if hasattr(self._running_process, "process"): self._running_process.process.kill() elif self._input_state == "buffering": if self.debug: print >>sys.__stderr__, "Raising KeyboardInterrupt" raise KeyboardInterrupt # XXX: We need to make really sure we # get back to a prompt. elif self._input_state == "subprocess" and ( (event.KeyCode < 256 and not event.ControlDown()) or (event.KeyCode in (ord("d"), ord("D")) and event.ControlDown()) ): # We are running a process, we redirect keys. ConsoleWidget._on_key_down(self, event, skip=skip) char = chr(event.KeyCode) # Deal with some inconsistency in wx keycodes: if char == "\r": char = "\n" elif not event.ShiftDown(): char = char.lower() if event.ControlDown() and event.KeyCode in (ord("d"), ord("D")): char = "\04" self._running_process.process.stdin.write(char) self._running_process.process.stdin.flush() elif event.KeyCode in (ord("("), 57, 53): # Calltips event.Skip() self.do_calltip() elif self.AutoCompActive() and not event.KeyCode == ord("\t"): event.Skip() if event.KeyCode in (wx.WXK_BACK, wx.WXK_DELETE): wx.CallAfter(self._popup_completion, create=True) elif not event.KeyCode in (wx.WXK_UP, wx.WXK_DOWN, wx.WXK_LEFT, wx.WXK_RIGHT, wx.WXK_ESCAPE): wx.CallAfter(self._popup_completion) else: # Up history if event.KeyCode == wx.WXK_UP and ( (current_line_number == self.current_prompt_line and event.Modifiers in (wx.MOD_NONE, wx.MOD_WIN)) or event.ControlDown() ): new_buffer = self.get_history_previous(self.input_buffer) if new_buffer is not None: self.input_buffer = new_buffer if self.GetCurrentLine() > self.current_prompt_line: # Go to first line, for seemless history up. self.GotoPos(self.current_prompt_pos) # Down history elif event.KeyCode == wx.WXK_DOWN and ( (current_line_number == self.LineCount - 1 and event.Modifiers in (wx.MOD_NONE, wx.MOD_WIN)) or event.ControlDown() ): new_buffer = self.get_history_next() if new_buffer is not None: self.input_buffer = new_buffer # Tab-completion elif event.KeyCode == ord("\t"): current_line, current_line_number = self.CurLine if not re.match(r"^\s*$", current_line): self.complete_current_input() if self.AutoCompActive(): wx.CallAfter(self._popup_completion, create=True) else: event.Skip() else: ConsoleWidget._on_key_down(self, event, skip=skip)
class Application(QMainWindow): def __init__(self, filename): super().__init__() self.centralwidget = QWidget() self.setCentralWidget(self.centralwidget) self.resize(1000, 600) # Window layout -------------------------------------------------------- self.tree = QTreeWidget() self.tree.itemClicked.connect(self.onItemClicked) self.push1_0 = QPushButton('Open NWB file') self.push1_0.clicked.connect(self.open_file) self.push2_0 = QPushButton('Export NWB file') self.push2_0.clicked.connect(self.export_file) self.push3_0 = QPushButton('Auto-clear') self.push3_0.setCheckable(True) self.push3_0.setChecked(True) self.push3_0.clicked.connect(self.toggle_auto_clear) self.auto_clear = True self.grid1 = QGridLayout() self.grid1.addWidget(self.push1_0, 0, 0, 1, 6) self.grid1.addWidget(self.push2_0, 1, 0, 1, 6) self.grid1.addWidget(self.push3_0, 2, 0, 1, 6) self.vbox1 = QVBoxLayout() self.vbox1.addWidget(self.tree) self.grid1.addLayout(self.vbox1, 3, 0, 2, 6) self.console = ConsoleWidget(par=self) self.vbox2 = QVBoxLayout() self.vbox2.addWidget(self.console) self.hbox = QHBoxLayout(self.centralwidget) self.hbox.addLayout(self.grid1) #add first tree self.hbox.addLayout(self.vbox2) #add second tree # Open file ------------------------------------------------------------ if not os.path.isfile(filename): self.open_file() else: self.file = filename self.io = NWBHDF5IO(self.file, 'r+') self.nwb = self.io.read() #reads NWB file self.fields = list(self.nwb.fields.keys()) self.init_tree() self.init_console() self.setWindowTitle('NWB explorer - ' + os.path.split(os.path.abspath(self.file))[1]) self.show() def open_file(self): ''' Open NWB file ''' filename, ftype = QFileDialog.getOpenFileName(None, 'Open file', '', "(*.nwb)") if ftype == '(*.nwb)': self.file = filename self.io = NWBHDF5IO(self.file, 'r+') self.nwb = self.io.read() #reads NWB file self.fields = list(self.nwb.fields.keys()) self.fields.sort() #sort fields alphabetically self.setWindowTitle('NWB explorer - ' + os.path.split(os.path.abspath(self.file))[1]) self.cp_objs = {} self.init_tree() self.init_console() def export_file(self): self.find_selected_items() cp_path = r'C:\Users\Luiz\Desktop\file_copy.nwb' nwb_copy(old_file=self.file, new_file=cp_path, cp_objs=self.cp_objs) self.console.clear() self.console.push_vars({'cp_path': cp_path}) self.console._execute("print('File exported: ', cp_path)", False) def find_selected_items(self): """Iterate over all children of the tree and save selected items to dictionary.""" self.cp_objs = {} self.iterator = QTreeWidgetItemIterator(self.tree, QTreeWidgetItemIterator.All) while self.iterator.value(): item = self.iterator.value() if item.checkState( 0) == 2: #full-box checked, add item to dictionary if item.parent() is not None: #2nd level item (at least) if item.parent().text( 0 ) in self.cp_objs: #append if parent already present as key in dictionary if self.cp_objs[item.parent().text( 0)] == True: #remove boolean parent key:value self.cp_objs.pop(item.parent().text(0), None) self.cp_objs[item.parent().text(0)] = [ item.text(0) ] else: self.cp_objs[item.parent().text(0)].append( item.text(0)) else: #add new list with item, if parent not yet a key in dictionary self.cp_objs[item.parent().text(0)] = [item.text(0)] else: #1st level item self.cp_objs[item.text(0)] = True self.iterator += 1 self.console.push_vars({'cp_objs': self.cp_objs}) def toggle_auto_clear(self): ''' Toggle auto-clear console screen function''' if self.auto_clear: self.auto_clear = False else: self.auto_clear = True def init_tree(self): ''' Draw hierarchical tree of fields in NWB file ''' self.tree.clear() for field in self.fields: #NWB file fields parent = QTreeWidgetItem(self.tree) parent.setText(0, field) parent.setFlags(parent.flags() | QtCore.Qt.ItemIsTristate | QtCore.Qt.ItemIsUserCheckable) parent.setCheckState(0, QtCore.Qt.Unchecked) #If parent is a dictionary if type(self.nwb.fields[field]).__name__ == 'LabelledDict': sub_fields = list(self.nwb.fields[field].keys()) for subf in sub_fields: child = QTreeWidgetItem(parent) child.setFlags(child.flags() | QtCore.Qt.ItemIsUserCheckable) child.setText(0, subf) child.setCheckState(0, QtCore.Qt.Unchecked) if subf == 'ecephys': #children of 'ecephys' child.setFlags(child.flags() | QtCore.Qt.ItemIsTristate) for subf2 in list(self.nwb.fields[field] [subf].data_interfaces.keys()): gchild = QTreeWidgetItem(child) gchild.setFlags(gchild.flags() | QtCore.Qt.ItemIsUserCheckable) gchild.setText(0, subf2) gchild.setCheckState(0, QtCore.Qt.Unchecked) #if len(self.nwb.fields[field])==0: # font = QtGui.QFont() # font.setWeight(6) # parent.setFont(0, font) def init_console(self): ''' Initialize commands on console ''' self.console._execute("import nwbext_ecog", True) self.console._execute("from pynwb import NWBHDF5IO", True) self.console._execute("fname = '" + self.file + "'", True) self.console._execute("io = NWBHDF5IO(fname,'r+')", True) self.console._execute("nwb = io.read()", True) self.console.clear() #self.console.execute_command("") def onItemClicked(self, it, col): if self.auto_clear: #clears terminal self.console.clear() if it.parent() is not None: #2nd level groups (at least) field1 = it.parent().text(0) field0 = it.text(0) if it.parent().parent() is not None: #3rd level groups field2 = it.parent().parent().text(0) if field1 == 'ecephys': item = self.nwb.fields[field2][field1].data_interfaces[ field0] else: field2 = None item = self.nwb.fields[field1][field0] else: #1st level groups ('acquisition','electrodes', etc...) field2 = None field1 = None field0 = it.text(0) item = self.nwb.fields[field0] self.console.push_vars({'tree': self.tree}) self.console.push_vars({'item': item}) self.console._execute("print(item)", False)
def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(663, 549) self.centralWidget = QtWidgets.QWidget(MainWindow) self.centralWidget.setObjectName("centralWidget") self.verticalLayout = QtWidgets.QVBoxLayout(self.centralWidget) self.verticalLayout.setContentsMargins(11, 11, 11, 11) self.verticalLayout.setSpacing(6) self.verticalLayout.setObjectName("verticalLayout") self.horizontal_layout = QtWidgets.QHBoxLayout() self.horizontal_layout.setSpacing(6) self.horizontal_layout.setObjectName("horizontal_layout") self.comm_label = QtWidgets.QLabel(self.centralWidget) self.comm_label.setObjectName("comm_label") self.horizontal_layout.addWidget(self.comm_label) self.comport_combobox = QtWidgets.QComboBox(self.centralWidget) self.comport_combobox.setCurrentText("") self.comport_combobox.setObjectName("comport_combobox") self.horizontal_layout.addWidget(self.comport_combobox) self.connect_btn = QtWidgets.QPushButton(self.centralWidget) self.connect_btn.setObjectName("connect_btn") self.horizontal_layout.addWidget(self.connect_btn) spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.horizontal_layout.addItem(spacerItem) self.verticalLayout.addLayout(self.horizontal_layout) self.main_tab_ctrl = QtWidgets.QTabWidget(self.centralWidget) self.main_tab_ctrl.setEnabled(True) self.main_tab_ctrl.setObjectName("main_tab_ctrl") self.status_tab = QtWidgets.QWidget() self.status_tab.setObjectName("status_tab") self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.status_tab) self.verticalLayout_2.setContentsMargins(11, 11, 11, 11) self.verticalLayout_2.setSpacing(6) self.verticalLayout_2.setObjectName("verticalLayout_2") self.gpsstatus_widget = GpsStatusWidget(self.status_tab) self.gpsstatus_widget.setObjectName("gpsstatus_widget") self.verticalLayout_2.addWidget(self.gpsstatus_widget) self.main_tab_ctrl.addTab(self.status_tab, "") self.setup_tab = QtWidgets.QWidget() self.setup_tab.setObjectName("setup_tab") self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.setup_tab) self.verticalLayout_3.setContentsMargins(11, 11, 11, 11) self.verticalLayout_3.setSpacing(6) self.verticalLayout_3.setObjectName("verticalLayout_3") self.gpssetup_widget = GpsSetupWidget(self.setup_tab) self.gpssetup_widget.setObjectName("gpssetup_widget") self.verticalLayout_3.addWidget(self.gpssetup_widget) self.main_tab_ctrl.addTab(self.setup_tab, "") self.console_tab = QtWidgets.QWidget() self.console_tab.setObjectName("console_tab") self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.console_tab) self.verticalLayout_5.setContentsMargins(11, 11, 11, 11) self.verticalLayout_5.setSpacing(6) self.verticalLayout_5.setObjectName("verticalLayout_5") self.console_widget = ConsoleWidget(self.console_tab) self.console_widget.setObjectName("console_widget") self.verticalLayout_5.addWidget(self.console_widget) self.main_tab_ctrl.addTab(self.console_tab, "") self.verticalLayout.addWidget(self.main_tab_ctrl) MainWindow.setCentralWidget(self.centralWidget) self.menu_bar = QtWidgets.QMenuBar(MainWindow) self.menu_bar.setGeometry(QtCore.QRect(0, 0, 663, 21)) self.menu_bar.setObjectName("menu_bar") MainWindow.setMenuBar(self.menu_bar) self.main_tool_bar = QtWidgets.QToolBar(MainWindow) self.main_tool_bar.setObjectName("main_tool_bar") MainWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.main_tool_bar) self.status_bar = QtWidgets.QStatusBar(MainWindow) self.status_bar.setObjectName("status_bar") MainWindow.setStatusBar(self.status_bar) self.retranslateUi(MainWindow) self.main_tab_ctrl.setCurrentIndex(0) QtCore.QMetaObject.connectSlotsByName(MainWindow)
def _on_key_down(self, event, skip=True): """ Capture the character events, let the parent widget handle them, and put our logic afterward. """ # FIXME: This method needs to be broken down in smaller ones. current_line_num = self.GetCurrentLine() key_code = event.GetKeyCode() if key_code in (ord('c'), ord('C')) and event.ControlDown(): # Capture Control-C if self._input_state == 'subprocess': if self.debug: print >> sys.__stderr__, 'Killing running process' if hasattr(self._running_process, 'process'): self._running_process.process.kill() elif self._input_state == 'buffering': if self.debug: print >> sys.__stderr__, 'Raising KeyboardInterrupt' raise KeyboardInterrupt # XXX: We need to make really sure we # get back to a prompt. elif self._input_state == 'subprocess' and ( (key_code < 256 and not event.ControlDown()) or (key_code in (ord('d'), ord('D')) and event.ControlDown())): # We are running a process, we redirect keys. ConsoleWidget._on_key_down(self, event, skip=skip) char = chr(key_code) # Deal with some inconsistency in wx keycodes: if char == '\r': char = '\n' elif not event.ShiftDown(): char = char.lower() if event.ControlDown() and key_code in (ord('d'), ord('D')): char = '\04' self._running_process.process.stdin.write(char) self._running_process.process.stdin.flush() elif key_code in (ord('('), 57, 53): # Calltips event.Skip() self.do_calltip() elif self.AutoCompActive() and not key_code == ord('\t'): event.Skip() if key_code in (wx.WXK_BACK, wx.WXK_DELETE): wx.CallAfter(self._popup_completion, create=True) elif not key_code in (wx.WXK_UP, wx.WXK_DOWN, wx.WXK_LEFT, wx.WXK_RIGHT, wx.WXK_ESCAPE): wx.CallAfter(self._popup_completion) else: # Up history if key_code == wx.WXK_UP and (event.ControlDown() or current_line_num == self.current_prompt_line): new_buffer = self.get_history_previous(self.input_buffer) if new_buffer is not None: self.input_buffer = new_buffer if self.GetCurrentLine() > self.current_prompt_line: # Go to first line, for seemless history up. self.GotoPos(self.current_prompt_pos) # Down history elif key_code == wx.WXK_DOWN and (event.ControlDown() or current_line_num == self.LineCount - 1): new_buffer = self.get_history_next() if new_buffer is not None: self.input_buffer = new_buffer # Tab-completion elif key_code == ord('\t'): current_line, current_line_num = self.CurLine if not re.match(r'^%s\s*$' % self.continuation_prompt(), current_line): self.complete_current_input() if self.AutoCompActive(): wx.CallAfter(self._popup_completion, create=True) else: event.Skip() elif key_code == wx.WXK_BACK: # If characters where erased, check if we have to # remove a line. # XXX: What about DEL? # FIXME: This logics should be in ConsoleWidget, as it is # independant of IPython current_line, _ = self.CurLine current_pos = self.GetCurrentPos() current_line_num = self.LineFromPosition(current_pos) current_col = self.GetColumn(current_pos) len_prompt = len(self.continuation_prompt()) if (current_line.startswith(self.continuation_prompt()) and current_col == len_prompt): new_lines = [] for line_num, line in enumerate( self.input_buffer.split('\n')): if (line_num + self.current_prompt_line == current_line_num): new_lines.append(line[len_prompt:]) else: new_lines.append('\n' + line) # The first character is '\n', due to the above # code: self.input_buffer = ''.join(new_lines)[1:] self.GotoPos(current_pos - 1 - len_prompt) else: ConsoleWidget._on_key_down(self, event, skip=skip) else: ConsoleWidget._on_key_down(self, event, skip=skip)
def continuation_prompt(self, *args, **kwargs): # Avoid multiple inheritence, be explicit about which # parent method class gets called return ConsoleWidget.continuation_prompt(self, *args, **kwargs)
def _get_input_buffer(self): """ Returns the text in current edit buffer. """ return ConsoleWidget._get_input_buffer(self)
def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(1465, 869) MainWindow.setCursor(QtCore.Qt.ArrowCursor) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap("BOUTguilogo.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) MainWindow.setWindowIcon(icon) MainWindow.setTabShape(QtGui.QTabWidget.Rounded) self.centralwidget = QtGui.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.gridLayout_2 = QtGui.QGridLayout(self.centralwidget) self.gridLayout_2.setObjectName("gridLayout_2") self.tabWidget = QtGui.QTabWidget(self.centralwidget) self.tabWidget.setToolTip("") self.tabWidget.setTabShape(QtGui.QTabWidget.Rounded) self.tabWidget.setTabsClosable(False) self.tabWidget.setMovable(False) self.tabWidget.setObjectName("tabWidget") self.Load = QtGui.QWidget() self.Load.setEnabled(True) self.Load.setObjectName("Load") self.pushButton = QtGui.QPushButton(self.Load) self.pushButton.setGeometry(QtCore.QRect(1320, 716, 81, 25)) self.pushButton.setObjectName("pushButton") self.tableWidget = QtGui.QTableWidget(self.Load) self.tableWidget.setGeometry(QtCore.QRect(20, 20, 1381, 691)) self.tableWidget.setAlternatingRowColors(True) self.tableWidget.setSelectionMode( QtGui.QAbstractItemView.SingleSelection) self.tableWidget.setSelectionBehavior( QtGui.QAbstractItemView.SelectRows) self.tableWidget.setColumnCount(5) self.tableWidget.setObjectName("tableWidget") self.tableWidget.setColumnCount(5) self.tableWidget.setRowCount(0) item = QtGui.QTableWidgetItem() self.tableWidget.setHorizontalHeaderItem(0, item) item = QtGui.QTableWidgetItem() self.tableWidget.setHorizontalHeaderItem(1, item) item = QtGui.QTableWidgetItem() self.tableWidget.setHorizontalHeaderItem(2, item) item = QtGui.QTableWidgetItem() self.tableWidget.setHorizontalHeaderItem(3, item) item = QtGui.QTableWidgetItem() self.tableWidget.setHorizontalHeaderItem(4, item) self.tableWidget.horizontalHeader().setDefaultSectionSize(150) self.tableWidget.horizontalHeader().setSortIndicatorShown(False) self.tableWidget.horizontalHeader().setStretchLastSection(True) self.tableWidget.verticalHeader().setStretchLastSection(False) self.archivePath = QtGui.QLabel(self.Load) self.archivePath.setGeometry(QtCore.QRect(177, 718, 951, 20)) self.archivePath.setObjectName("archivePath") self.label_18 = QtGui.QLabel(self.Load) self.label_18.setGeometry(QtCore.QRect(20, 720, 201, 16)) self.label_18.setObjectName("label_18") self.tabWidget.addTab(self.Load, "") self.tab_2 = QtGui.QWidget() self.tab_2.setObjectName("tab_2") self.checkBox = QtGui.QCheckBox(self.tab_2) self.checkBox.setGeometry(QtCore.QRect(1171, 725, 71, 20)) self.checkBox.setObjectName("checkBox") self.pushButton_3 = QtGui.QPushButton(self.tab_2) self.pushButton_3.setGeometry(QtCore.QRect(1250, 692, 161, 25)) self.pushButton_3.setObjectName("pushButton_3") self.procSpin = QtGui.QSpinBox(self.tab_2) self.procSpin.setGeometry(QtCore.QRect(1060, 693, 53, 22)) self.procSpin.setObjectName("procSpin") self.niceSpin = QtGui.QSpinBox(self.tab_2) self.niceSpin.setGeometry(QtCore.QRect(1060, 723, 53, 22)) self.niceSpin.setMinimum(-99) self.niceSpin.setObjectName("niceSpin") self.groupBox_18 = QtGui.QGroupBox(self.tab_2) self.groupBox_18.setGeometry(QtCore.QRect(913, 617, 501, 71)) self.groupBox_18.setObjectName("groupBox_18") self.plainTextEdit = QtGui.QPlainTextEdit(self.groupBox_18) self.plainTextEdit.setGeometry(QtCore.QRect(4, 14, 491, 51)) self.plainTextEdit.setObjectName("plainTextEdit") self.label_2 = QtGui.QLabel(self.tab_2) self.label_2.setGeometry(QtCore.QRect(959, 725, 101, 16)) self.label_2.setObjectName("label_2") self.label = QtGui.QLabel(self.tab_2) self.label.setGeometry(QtCore.QRect(919, 695, 151, 16)) self.label.setObjectName("label") self.pushButton_2 = QtGui.QPushButton(self.tab_2) self.pushButton_2.setGeometry(QtCore.QRect(1170, 692, 75, 25)) self.pushButton_2.setObjectName("pushButton_2") self.runScanningSimulation = QtGui.QPushButton(self.tab_2) self.runScanningSimulation.setGeometry(QtCore.QRect( 1250, 720, 161, 25)) self.runScanningSimulation.setObjectName("runScanningSimulation") self.fileLabel = QtGui.QLabel(self.tab_2) self.fileLabel.setGeometry(QtCore.QRect(90, 723, 771, 16)) self.fileLabel.setObjectName("fileLabel") self.label_15 = QtGui.QLabel(self.tab_2) self.label_15.setGeometry(QtCore.QRect(10, 723, 91, 16)) self.label_15.setObjectName("label_15") self.label_17 = QtGui.QLabel(self.tab_2) self.label_17.setGeometry(QtCore.QRect(10, 708, 201, 16)) self.label_17.setObjectName("label_17") self.simulationFile = QtGui.QLabel(self.tab_2) self.simulationFile.setGeometry(QtCore.QRect(200, 708, 771, 16)) self.simulationFile.setObjectName("simulationFile") self.tabWidget.addTab(self.tab_2, "") self.tab = QtGui.QWidget() self.tab.setObjectName("tab") self.outputStream = QtGui.QTextBrowser(self.tab) self.outputStream.setGeometry(QtCore.QRect(10, 10, 1401, 691)) self.outputStream.setObjectName("outputStream") self.stopSimulation = QtGui.QPushButton(self.tab) self.stopSimulation.setGeometry(QtCore.QRect(10, 710, 1401, 25)) self.stopSimulation.setObjectName("stopSimulation") self.tabWidget.addTab(self.tab, "") self.tab_3 = QtGui.QWidget() self.tab_3.setObjectName("tab_3") self.textOutput = QtGui.QTextEdit(self.tab_3) self.textOutput.setGeometry(QtCore.QRect(22, 430, 661, 261)) self.textOutput.setReadOnly(True) self.textOutput.setObjectName("textOutput") self.label_64 = QtGui.QLabel(self.tab_3) self.label_64.setGeometry(QtCore.QRect(20, 700, 64, 25)) self.label_64.setObjectName("label_64") self.dataTable = QtGui.QTableWidget(self.tab_3) self.dataTable.setGeometry(QtCore.QRect(23, 210, 661, 221)) self.dataTable.setAlternatingRowColors(True) self.dataTable.setSelectionMode(QtGui.QAbstractItemView.MultiSelection) self.dataTable.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) self.dataTable.setShowGrid(False) self.dataTable.setGridStyle(QtCore.Qt.SolidLine) self.dataTable.setObjectName("dataTable") self.dataTable.setColumnCount(4) self.dataTable.setRowCount(0) item = QtGui.QTableWidgetItem() self.dataTable.setHorizontalHeaderItem(0, item) item = QtGui.QTableWidgetItem() self.dataTable.setHorizontalHeaderItem(1, item) item = QtGui.QTableWidgetItem() self.dataTable.setHorizontalHeaderItem(2, item) item = QtGui.QTableWidgetItem() self.dataTable.setHorizontalHeaderItem(3, item) self.dataTable.horizontalHeader().setStretchLastSection(True) self.dataTable.verticalHeader().setDefaultSectionSize(20) self.commandButton = QtGui.QPushButton(self.tab_3) self.commandButton.setGeometry(QtCore.QRect(610, 700, 75, 25)) self.commandButton.setObjectName("commandButton") self.frame = QtGui.QFrame(self.tab_3) self.frame.setGeometry(QtCore.QRect(700, 104, 701, 621)) self.frame.setFrameShape(QtGui.QFrame.StyledPanel) self.frame.setFrameShadow(QtGui.QFrame.Raised) self.frame.setObjectName("frame") self.commandInput = ConsoleWidget(self.tab_3) self.commandInput.setGeometry(QtCore.QRect(89, 702, 511, 21)) self.commandInput.setObjectName("commandInput") self.groupBox = QtGui.QGroupBox(self.tab_3) self.groupBox.setGeometry(QtCore.QRect(23, 4, 661, 201)) self.groupBox.setObjectName("groupBox") self.pushButton_7 = QtGui.QPushButton(self.groupBox) self.pushButton_7.setGeometry(QtCore.QRect(10, 30, 101, 25)) font = QtGui.QFont() font.setWeight(75) font.setBold(True) self.pushButton_7.setFont(font) self.pushButton_7.setObjectName("pushButton_7") self.collectedLabel_3 = QtGui.QLabel(self.groupBox) self.collectedLabel_3.setGeometry(QtCore.QRect(10, 89, 171, 16)) self.collectedLabel_3.setObjectName("collectedLabel_3") self.extraVarsCombo = QtGui.QComboBox(self.groupBox) self.extraVarsCombo.setGeometry(QtCore.QRect(10, 109, 151, 22)) self.extraVarsCombo.setObjectName("extraVarsCombo") self.collectExtraVariable = QtGui.QPushButton(self.groupBox) self.collectExtraVariable.setGeometry(QtCore.QRect(170, 109, 101, 25)) self.collectExtraVariable.setObjectName("collectExtraVariable") self.collectedLabel = QtGui.QLabel(self.groupBox) self.collectedLabel.setGeometry(QtCore.QRect(100, 160, 760, 16)) self.collectedLabel.setObjectName("collectedLabel") self.label_22 = QtGui.QLabel(self.groupBox) self.label_22.setGeometry(QtCore.QRect(10, 160, 150, 16)) self.label_22.setObjectName("label_22") self.groupBox_2 = QtGui.QGroupBox(self.tab_3) self.groupBox_2.setGeometry(QtCore.QRect(700, 4, 701, 91)) self.groupBox_2.setObjectName("groupBox_2") self.collectedLabel_2 = QtGui.QLabel(self.groupBox_2) self.collectedLabel_2.setGeometry(QtCore.QRect(10, 15, 181, 16)) self.collectedLabel_2.setObjectName("collectedLabel_2") self.saveDefaultButton = QtGui.QPushButton(self.groupBox_2) self.saveDefaultButton.setGeometry(QtCore.QRect(10, 60, 81, 25)) self.saveDefaultButton.setObjectName("saveDefaultButton") self.defaultCombo = QtGui.QComboBox(self.groupBox_2) self.defaultCombo.setGeometry(QtCore.QRect(10, 35, 171, 22)) self.defaultCombo.setObjectName("defaultCombo") self.defaultCombo.addItem("") self.zall = QtGui.QCheckBox(self.groupBox_2) self.zall.setGeometry(QtCore.QRect(500, 65, 41, 20)) self.zall.setObjectName("zall") self.yall = QtGui.QCheckBox(self.groupBox_2) self.yall.setGeometry(QtCore.QRect(440, 65, 41, 20)) self.yall.setObjectName("yall") self.xall = QtGui.QCheckBox(self.groupBox_2) self.xall.setGeometry(QtCore.QRect(380, 65, 41, 20)) self.xall.setObjectName("xall") self.deleteButton = QtGui.QPushButton(self.groupBox_2) self.deleteButton.setGeometry(QtCore.QRect(100, 60, 81, 25)) self.deleteButton.setObjectName("deleteButton") self.label_16 = QtGui.QLabel(self.groupBox_2) self.label_16.setGeometry(QtCore.QRect(230, 14, 301, 16)) self.label_16.setObjectName("label_16") self.variableCombo = QtGui.QComboBox(self.groupBox_2) self.variableCombo.setGeometry(QtCore.QRect(230, 35, 81, 22)) self.variableCombo.setObjectName("variableCombo") self.tall = QtGui.QCheckBox(self.groupBox_2) self.tall.setGeometry(QtCore.QRect(320, 65, 41, 20)) self.tall.setObjectName("tall") self.xspin = QtGui.QSpinBox(self.groupBox_2) self.xspin.setGeometry(QtCore.QRect(380, 35, 53, 22)) self.xspin.setMinimum(-10000000) self.xspin.setMaximum(10000000) self.xspin.setObjectName("xspin") self.zspin = QtGui.QSpinBox(self.groupBox_2) self.zspin.setGeometry(QtCore.QRect(500, 35, 53, 22)) self.zspin.setMinimum(-1000000) self.zspin.setMaximum(10000000) self.zspin.setObjectName("zspin") self.yspin = QtGui.QSpinBox(self.groupBox_2) self.yspin.setGeometry(QtCore.QRect(440, 35, 53, 22)) self.yspin.setMinimum(-999900) self.yspin.setMaximum(100000000) self.yspin.setObjectName("yspin") self.tspin = QtGui.QSpinBox(self.groupBox_2) self.tspin.setGeometry(QtCore.QRect(320, 35, 53, 22)) self.tspin.setMinimum(-10000000) self.tspin.setMaximum(10000000) self.tspin.setProperty("value", 0) self.tspin.setObjectName("tspin") self.createGraph = QtGui.QPushButton(self.groupBox_2) self.createGraph.setGeometry(QtCore.QRect(590, 34, 101, 25)) self.createGraph.setObjectName("createGraph") self.tabWidget.addTab(self.tab_3, "") self.gridLayout_2.addWidget(self.tabWidget, 0, 0, 1, 1) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtGui.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 1465, 20)) self.menubar.setObjectName("menubar") self.menuFile = QtGui.QMenu(self.menubar) self.menuFile.setObjectName("menuFile") self.menuHelp = QtGui.QMenu(self.menubar) self.menuHelp.setObjectName("menuHelp") self.menuView = QtGui.QMenu(self.menubar) self.menuView.setObjectName("menuView") MainWindow.setMenuBar(self.menubar) self.statusbar = QtGui.QStatusBar(MainWindow) self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar) self.actionCompare = QtGui.QAction(MainWindow) self.actionCompare.setObjectName("actionCompare") self.actionFileHistory = QtGui.QAction(MainWindow) self.actionFileHistory.setObjectName("actionFileHistory") self.actionExit = QtGui.QAction(MainWindow) self.actionExit.setObjectName("actionExit") self.actionHelp = QtGui.QAction(MainWindow) self.actionHelp.setObjectName("actionHelp") self.actionStop_Simulation = QtGui.QAction(MainWindow) self.actionStop_Simulation.setObjectName("actionStop_Simulation") self.actionPositioning = QtGui.QAction(MainWindow) self.actionPositioning.setObjectName("actionPositioning") self.actionArchive = QtGui.QAction(MainWindow) self.actionArchive.setObjectName("actionArchive") self.actionCreate_Example = QtGui.QAction(MainWindow) self.actionCreate_Example.setObjectName("actionCreate_Example") self.actionSimulation_Code = QtGui.QAction(MainWindow) self.actionSimulation_Code.setObjectName("actionSimulation_Code") self.actionDefault_Variables = QtGui.QAction(MainWindow) self.actionDefault_Variables.setObjectName("actionDefault_Variables") self.actionAbout = QtGui.QAction(MainWindow) self.actionAbout.setObjectName("actionAbout") self.menuFile.addSeparator() self.menuFile.addAction(self.actionArchive) self.menuFile.addAction(self.actionSimulation_Code) self.menuFile.addAction(self.actionDefault_Variables) self.menuFile.addSeparator() self.menuFile.addAction(self.actionFileHistory) self.menuFile.addAction(self.actionCompare) self.menuFile.addSeparator() self.menuFile.addAction(self.actionStop_Simulation) self.menuFile.addSeparator() self.menuFile.addAction(self.actionExit) self.menuHelp.addAction(self.actionAbout) self.menuHelp.addAction(self.actionHelp) self.menuView.addAction(self.actionPositioning) self.menubar.addAction(self.menuFile.menuAction()) self.menubar.addAction(self.menuView.menuAction()) self.menubar.addAction(self.menuHelp.menuAction()) self.retranslateUi(MainWindow) self.tabWidget.setCurrentIndex(0) QtCore.QMetaObject.connectSlotsByName(MainWindow)
def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(803, 659) self.centralwidget = QtGui.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.gridLayout_2 = QtGui.QGridLayout(self.centralwidget) self.gridLayout_2.setObjectName("gridLayout_2") self.tabWidget = QtGui.QTabWidget(self.centralwidget) self.tabWidget.setObjectName("tabWidget") self.sourceTab = QtGui.QWidget() self.sourceTab.setObjectName("sourceTab") self.gridLayout_3 = QtGui.QGridLayout(self.sourceTab) self.gridLayout_3.setObjectName("gridLayout_3") self.gridLayout = QtGui.QGridLayout() self.gridLayout.setObjectName("gridLayout") self.label = QtGui.QLabel(self.sourceTab) self.label.setObjectName("label") self.gridLayout.addWidget(self.label, 0, 0, 1, 1) self.shotInput = QtGui.QLineEdit(self.sourceTab) self.shotInput.setObjectName("shotInput") self.gridLayout.addWidget(self.shotInput, 0, 1, 1, 1) self.readDataButton = QtGui.QPushButton(self.sourceTab) self.readDataButton.setObjectName("readDataButton") self.gridLayout.addWidget(self.readDataButton, 0, 2, 1, 1) self.label_2 = QtGui.QLabel(self.sourceTab) self.label_2.setObjectName("label_2") self.gridLayout.addWidget(self.label_2, 0, 3, 1, 1) self.tracePattern = QtGui.QLineEdit(self.sourceTab) self.tracePattern.setObjectName("tracePattern") self.gridLayout.addWidget(self.tracePattern, 0, 4, 1, 1) self.sourceDescription = QtGui.QCheckBox(self.sourceTab) self.sourceDescription.setObjectName("sourceDescription") self.gridLayout.addWidget(self.sourceDescription, 0, 5, 1, 1) self.gridLayout_3.addLayout(self.gridLayout, 0, 0, 1, 1) self.splitter = QtGui.QSplitter(self.sourceTab) self.splitter.setOrientation(QtCore.Qt.Horizontal) self.splitter.setObjectName("splitter") self.treeView = QtGui.QTreeWidget(self.splitter) self.treeView.setColumnCount(1) self.treeView.setObjectName("treeView") self.treeView.headerItem().setText(0, "Source") self.treeView.header().setVisible(False) self.treeView.header().setDefaultSectionSize(200) self.treeView.header().setStretchLastSection(True) self.sourceTable = QtGui.QTableWidget(self.splitter) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.sourceTable.sizePolicy().hasHeightForWidth()) self.sourceTable.setSizePolicy(sizePolicy) self.sourceTable.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers) self.sourceTable.setAlternatingRowColors(True) self.sourceTable.setSelectionMode(QtGui.QAbstractItemView.MultiSelection) self.sourceTable.setShowGrid(False) self.sourceTable.setColumnCount(1) self.sourceTable.setObjectName("sourceTable") self.sourceTable.setColumnCount(1) self.sourceTable.setRowCount(0) self.sourceTable.horizontalHeader().setVisible(False) self.sourceTable.horizontalHeader().setDefaultSectionSize(200) self.sourceTable.horizontalHeader().setStretchLastSection(False) self.sourceTable.verticalHeader().setVisible(False) self.sourceTable.verticalHeader().setDefaultSectionSize(20) self.gridLayout_3.addWidget(self.splitter, 1, 0, 1, 1) self.tabWidget.addTab(self.sourceTab, "") self.dataTab = QtGui.QWidget() self.dataTab.setObjectName("dataTab") self.gridLayout_5 = QtGui.QGridLayout(self.dataTab) self.gridLayout_5.setObjectName("gridLayout_5") self.splitter_2 = QtGui.QSplitter(self.dataTab) self.splitter_2.setOrientation(QtCore.Qt.Vertical) self.splitter_2.setObjectName("splitter_2") self.dataTable = QtGui.QTableWidget(self.splitter_2) self.dataTable.setAlternatingRowColors(True) self.dataTable.setSelectionMode(QtGui.QAbstractItemView.MultiSelection) self.dataTable.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) self.dataTable.setShowGrid(False) self.dataTable.setGridStyle(QtCore.Qt.SolidLine) self.dataTable.setObjectName("dataTable") self.dataTable.setColumnCount(4) self.dataTable.setRowCount(0) item = QtGui.QTableWidgetItem() self.dataTable.setHorizontalHeaderItem(0, item) item = QtGui.QTableWidgetItem() self.dataTable.setHorizontalHeaderItem(1, item) item = QtGui.QTableWidgetItem() self.dataTable.setHorizontalHeaderItem(2, item) item = QtGui.QTableWidgetItem() self.dataTable.setHorizontalHeaderItem(3, item) self.dataTable.horizontalHeader().setStretchLastSection(True) self.dataTable.verticalHeader().setDefaultSectionSize(20) self.textOutput = QtGui.QTextEdit(self.splitter_2) self.textOutput.setReadOnly(True) self.textOutput.setObjectName("textOutput") self.layoutWidget = QtGui.QWidget(self.splitter_2) self.layoutWidget.setObjectName("layoutWidget") self.gridLayout_4 = QtGui.QGridLayout(self.layoutWidget) self.gridLayout_4.setContentsMargins(0, 0, 0, 0) self.gridLayout_4.setObjectName("gridLayout_4") self.label_3 = QtGui.QLabel(self.layoutWidget) self.label_3.setObjectName("label_3") self.gridLayout_4.addWidget(self.label_3, 0, 0, 1, 1) self.commandInput = ConsoleWidget(self.layoutWidget) self.commandInput.setObjectName("commandInput") self.gridLayout_4.addWidget(self.commandInput, 0, 1, 1, 1) self.commandButton = QtGui.QPushButton(self.layoutWidget) self.commandButton.setObjectName("commandButton") self.gridLayout_4.addWidget(self.commandButton, 0, 2, 1, 1) self.gridLayout_5.addWidget(self.splitter_2, 0, 0, 1, 1) self.tabWidget.addTab(self.dataTab, "") self.plotTab = QtGui.QWidget() self.plotTab.setObjectName("plotTab") self.tabWidget.addTab(self.plotTab, "") self.gridLayout_2.addWidget(self.tabWidget, 0, 0, 1, 1) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtGui.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 803, 19)) self.menubar.setObjectName("menubar") self.menuFile = QtGui.QMenu(self.menubar) self.menuFile.setObjectName("menuFile") self.menuAdd_source = QtGui.QMenu(self.menuFile) self.menuAdd_source.setObjectName("menuAdd_source") self.menuPlot = QtGui.QMenu(self.menubar) self.menuPlot.setObjectName("menuPlot") self.menuCommand = QtGui.QMenu(self.menubar) self.menuCommand.setObjectName("menuCommand") MainWindow.setMenuBar(self.menubar) self.statusbar = QtGui.QStatusBar(MainWindow) self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar) self.actionLoadState = QtGui.QAction(MainWindow) self.actionLoadState.setObjectName("actionLoadState") self.actionSaveState = QtGui.QAction(MainWindow) self.actionSaveState.setObjectName("actionSaveState") self.actionExit = QtGui.QAction(MainWindow) self.actionExit.setObjectName("actionExit") self.actionXPAD_tree = QtGui.QAction(MainWindow) self.actionXPAD_tree.setObjectName("actionXPAD_tree") self.actionNetCDF_file = QtGui.QAction(MainWindow) self.actionNetCDF_file.setObjectName("actionNetCDF_file") self.actionPlot = QtGui.QAction(MainWindow) self.actionPlot.setObjectName("actionPlot") self.actionXYPlot = QtGui.QAction(MainWindow) self.actionXYPlot.setObjectName("actionXYPlot") self.actionBOUT_data = QtGui.QAction(MainWindow) self.actionBOUT_data.setObjectName("actionBOUT_data") self.actionContour = QtGui.QAction(MainWindow) self.actionContour.setObjectName("actionContour") self.actionContour_filled = QtGui.QAction(MainWindow) self.actionContour_filled.setObjectName("actionContour_filled") self.actionWrite_ASCII = QtGui.QAction(MainWindow) self.actionWrite_ASCII.setObjectName("actionWrite_ASCII") self.actionAdd = QtGui.QAction(MainWindow) self.actionAdd.setObjectName("actionAdd") self.actionSubtract = QtGui.QAction(MainWindow) self.actionSubtract.setObjectName("actionSubtract") self.actionMultiply = QtGui.QAction(MainWindow) self.actionMultiply.setObjectName("actionMultiply") self.actionDivide = QtGui.QAction(MainWindow) self.actionDivide.setObjectName("actionDivide") self.actionChop = QtGui.QAction(MainWindow) self.actionChop.setObjectName("actionChop") self.actionIntegrate = QtGui.QAction(MainWindow) self.actionIntegrate.setObjectName("actionIntegrate") self.actionDf_dt = QtGui.QAction(MainWindow) self.actionDf_dt.setObjectName("actionDf_dt") self.actionSmooth = QtGui.QAction(MainWindow) self.actionSmooth.setObjectName("actionSmooth") self.actionLow_pass_filter = QtGui.QAction(MainWindow) self.actionLow_pass_filter.setObjectName("actionLow_pass_filter") self.actionHigh_pass_filter = QtGui.QAction(MainWindow) self.actionHigh_pass_filter.setObjectName("actionHigh_pass_filter") self.actionBand_pass_filter = QtGui.QAction(MainWindow) self.actionBand_pass_filter.setObjectName("actionBand_pass_filter") self.actionFFTP = QtGui.QAction(MainWindow) self.actionFFTP.setObjectName("actionFFTP") self.menuAdd_source.addAction(self.actionNetCDF_file) self.menuAdd_source.addAction(self.actionXPAD_tree) self.menuAdd_source.addAction(self.actionBOUT_data) self.menuFile.addAction(self.menuAdd_source.menuAction()) self.menuFile.addSeparator() self.menuFile.addAction(self.actionLoadState) self.menuFile.addAction(self.actionSaveState) self.menuFile.addSeparator() self.menuFile.addAction(self.actionWrite_ASCII) self.menuFile.addSeparator() self.menuFile.addAction(self.actionExit) self.menuPlot.addAction(self.actionPlot) self.menuPlot.addAction(self.actionXYPlot) self.menuPlot.addAction(self.actionContour) self.menuPlot.addAction(self.actionContour_filled) self.menuCommand.addAction(self.actionChop) self.menuCommand.addSeparator() self.menuCommand.addAction(self.actionIntegrate) self.menuCommand.addAction(self.actionDf_dt) self.menuCommand.addAction(self.actionSmooth) self.menuCommand.addAction(self.actionBand_pass_filter) self.menuCommand.addSeparator() self.menuCommand.addAction(self.actionAdd) self.menuCommand.addAction(self.actionSubtract) self.menuCommand.addAction(self.actionMultiply) self.menuCommand.addAction(self.actionDivide) self.menuCommand.addSeparator() self.menuCommand.addAction(self.actionFFTP) self.menubar.addAction(self.menuFile.menuAction()) self.menubar.addAction(self.menuPlot.menuAction()) self.menubar.addAction(self.menuCommand.menuAction()) self.retranslateUi(MainWindow) self.tabWidget.setCurrentIndex(0) QtCore.QMetaObject.connectSlotsByName(MainWindow)
def _set_input_buffer(self, string): ConsoleWidget._set_input_buffer(self, string) self._colorize_input_buffer()