class PlotSignalWindow(): def __init__(self, width=1000, height=600): # signal self.signal = dict() # setup window self.app = QtGui.QApplication([]) self.win = GraphicsWindow(title="Plot Signal") self.win.resize(width, height) self.win.setWindowTitle('Plot Signal') # enable anti-aliasing setConfigOptions(antialias=True) self.canvas = self.win.addPlot(title="Fast Fourier Transform") # limit plot to 20Hz to 20kHz and clamp magnitude # self.canvas.setXRange(0, 20000) self.canvas.setYRange(0, 100000) def start(self): if (flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'): QtGui.QApplication.instance().exec_() def draw(self, name: str, _x, _y, pen='y'): if name in self.signal: self.signal[name].setData(_x, _y) else: self.signal[name] = self.canvas.plot(pen=pen)
def __init__(self): super(MyWaveformViewer, self).__init__() self.win = GraphicsWindow() self.p1 = self.win.addPlot() self.ptr = 0 self.init_ui() self.init_timer()
def open(self, grid: Tuple[int, int] = (1, 1), *args, **kwargs) -> GraphicsLayout: # self._view = GraphicsLayoutWidget() self._view = GraphicsWindow() self._raw = self._view.centralWidget self._grid = grid self._init_axis(self._grid) self._window_title = Figure.WindowTitle(self._view) return self._raw
def __init__(self, width=1000, height=600): # signal self.signal = dict() # setup window self.app = QtGui.QApplication([]) self.win = GraphicsWindow(title="Plot Signal") self.win.resize(width, height) self.win.setWindowTitle('Plot Signal') # enable anti-aliasing setConfigOptions(antialias=True) self.canvas = self.win.addPlot(title="Fast Fourier Transform") # limit plot to 20Hz to 20kHz and clamp magnitude # self.canvas.setXRange(0, 20000) self.canvas.setYRange(0, 100000)
class MyWaveformViewer(object): def __init__(self): super(MyWaveformViewer, self).__init__() self.win = GraphicsWindow() self.p1 = self.win.addPlot() self.ptr = 0 self.init_ui() self.init_timer() def init_ui(self): self.win.setWindowTitle('Plot Demo') self.win.resize(600, 400) self.win.setBackground(background='k') self.p1.setLabel(axis='left', text='Y') self.p1.setLabel(axis='bottom', text='X') self.p1.addLegend() self.curve1 = self.p1.plot(pen='y', name='yaw') self.curve2 = self.p1.plot(pen='g', name='pitch') def init_timer(self): self.timer = pg.QtCore.QTimer() self.timer.timeout.connect(self.plot_data) self.timer.start(100) def plot_data(self): self.curve1.setData(list(range(11)), [x * x for x in range(11)]) if self.ptr == 0: # self.p1.disableAutoRange('xy') self.p1.enableAutoRange(axis='xy', enable=False, x=1, y=0.5) self.p1.disableAutoRange('xy') self.ptr += 1
class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(800, 801) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.splitter = QtWidgets.QSplitter(self.centralwidget) self.splitter.setGeometry(QtCore.QRect(10, 30, 791, 721)) self.splitter.setOrientation(QtCore.Qt.Vertical) self.splitter.setObjectName("splitter") self.graphicsView_for_video = QtWidgets.QGraphicsView(self.splitter) self.graphicsView_for_video.setObjectName("graphicsView_for_video") self.graphicsView = GraphicsWindow(self.splitter) self.graphicsView.setObjectName("graphicsView") self.horizontalSlider = QtWidgets.QSlider(self.splitter) self.horizontalSlider.setOrientation(QtCore.Qt.Horizontal) self.horizontalSlider.setObjectName("horizontalSlider") MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 21)) self.menubar.setObjectName("menubar") self.menuData_Visualizer = QtWidgets.QMenu(self.menubar) self.menuData_Visualizer.setObjectName("menuData_Visualizer") MainWindow.setMenuBar(self.menubar) self.statusbar = QtWidgets.QStatusBar(MainWindow) self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar) self.actionLoad_Video = QtWidgets.QAction(MainWindow) self.actionLoad_Video.setObjectName("actionLoad_Video") self.actionLoad_data = QtWidgets.QAction(MainWindow) self.actionLoad_data.setObjectName("actionLoad_data") self.menuData_Visualizer.addAction(self.actionLoad_Video) self.menuData_Visualizer.addAction(self.actionLoad_data) self.menubar.addAction(self.menuData_Visualizer.menuAction()) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow) def retranslateUi(self, MainWindow): _translate = QtCore.QCoreApplication.translate MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow")) self.menuData_Visualizer.setTitle(_translate("MainWindow", "File")) self.actionLoad_Video.setText(_translate("MainWindow", "Load Video")) self.actionLoad_data.setText(_translate("MainWindow", "Load data"))
def main_graphics_window(): view: GraphicsView = GraphicsWindow() fig: GraphicsLayout = view.centralWidget axes = fig.addPlot() view.setWindowTitle("view [Test] Window Title") print(axes) QApplication.instance().exec_()
def __init__(self, ix: int, sensor: W1ThermSensor, num_data: int, graphicsWindow: pg.GraphicsWindow, parent): # logger.info("Sensor: %r, %r, %r, %r", ix, sensor, num_data, graphicsWindow) self.parentWidget = parent self.sensor = sensor self.name = sensor.id self.num_data = num_data self.data = np.array([float('inf')] * self.num_data, dtype=np.float) self.timestamps = np.array([float('inf')] * self.num_data, dtype=np.float) initialTime = datetime.now() for i in range(num_data): self.timestamps[-i] = mktime( (initialTime - timedelta(seconds=i * parent.ticking)).timetuple()) # logger.info("temp index: %r, %r", -i, datetime.fromtimestamp(self.timestamps[-i])) graphPen = pg.mkPen(color="r", width=2) axisPen = pg.mkPen(color="w", width=2) self.plotItem = PlotCurveItem(pen=graphPen, width=4, name=self.name) self.xAxis = TimeAxisItem(pen=axisPen, orientation='bottom') self.font = QtGui.QFont("Helvetica", 18, 18) self.xAxis.setStyle(tickTextHeight=30, tickFont=self.font) self.plot = graphicsWindow.addPlot(row=ix, col=0, axisItems={'bottom': self.xAxis}) self.label = self.plot.titleLabel self.label.setAttr("color", "w") self.label.setAttr("bold", True) self.label.setAttr("size", "18pt") self.plot.getAxis("left").setPen(axisPen) self.plot.getAxis("left").setStyle(tickTextHeight=30, tickFont=self.font) self.plot.addItem(self.plotItem) self.plot.setMouseEnabled(x=True, y=False) self.plot.buttonsHidden = True self.plot.enableAutoRange("xy", False) self.plot.setYRange(0, 105, False, False) # logger.info("%r, %r", datetime.fromtimestamp(self.timestamps[-(self.num_data - 105)]), # datetime.fromtimestamp(self.timestamps[-1])) self.plot.setXRange(self.timestamps[-105], self.timestamps[-1]) self.plot.showGrid(True, True, 1) if ix > 0: self.plot.setXLink(parent.sensorsList[ix - 1].plot) self.plot.vb.sigRangeChangedManually.connect(self.viewChanged)
def __init__(self, instrument, parent=None): super(QOscilloscope, self).__init__(parent) self.instrument = instrument self.qinstrument = QTektronix(instrument) self.load_ui() ui = self.ui ui.plot_window = GraphicsWindow(title='Curve') ui.plot_placeholder.layout().addWidget(ui.plot_window) ui.plot_widget = ui.plot_window.addPlot() self.curves = {} for button, channel, data_source in ((ui.CH1, 1, DataSource.CH1), ): curve = ui.plot_widget.plot(pen='y') self.curves[channel] = curve self.curves[data_source] = curve button.toggled.connect(partial(self._on_update_curve, data_source)) self.qinstrument.signals.connect(self._on_instrument_event)
def minimum_main(): # run() # app = QtGui.QApplication([]) # win = QtGui.QMainWindow() # view = GraphicsLayoutWidget() # win.setCentralWidget(view) # win.show() # win.setWindowTitle("win [Test] Window Title") view: GraphicsView = GraphicsWindow() view.setWindowTitle("view [Test] Window Title") fig: GraphicsLayout = view.centralWidget axes = fig.addPlot() n = 300 s1 = pg.ScatterPlotItem(size=10, pen=pg.mkPen(None), brush=pg.mkBrush(255, 255, 255, 120)) pos = np.random.normal(size=(2, n), scale=1e-5) spots = [{ 'pos': pos[:, i], 'data': 1 } for i in range(n)] + [{ 'pos': [0, 0], 'data': 1 }] s1.addPoints(spots) axes.addItem(s1) # p = PlotItem() # p.titleLabel = "title test" # p.addLine([1, 2, 3], [4, 5, 6]) # fig.addItem(p) # fig.addItem(p, row=1, col=1) print("execute...") from PyQt5.QtWidgets import QApplication # , QMainWindow QApplication.instance().exec_()
def minimum_main2(): x2 = np.linspace(-100, 100, 1000) data2 = np.sin(x2) / x2 with pqg.Figure(grid=(1, 2)) as fig: ax = fig.axes() ax.line(x=x2, y=data2 + 1) ax.axis_x().range((-50, 30)) fig.show() view: GraphicsView = GraphicsWindow() view.setWindowTitle("view [Test] Window Title") win: GraphicsLayout = view.centralWidget p9 = win.addPlot(title="Zoom on selected region") p9.plot(data2) p9.setXRange(5, 205, padding=0) print("execute...") from PyQt5.QtWidgets import QApplication # , QMainWindow QApplication.instance().exec_()
def netPopExtend(self): self.nw = GraphicsWindow() self.nw.setWindowTitle(_translate("MainWindow", "SMS", None)) self.nw.setWindowIcon(QtGui.QIcon(icon_path)) # Plot in chunks, adding one new plot curve for every 100 samples self.chunkSize = 10 # Remove chunks after we have 10 self.maxChunks = 20 self.startTime = pyqtgraph.ptime.time() self.nw.nextRow() self.p5 = self.nw.addPlot(colspan=2) self.p5.setLabel('bottom', 'Time', 's') self.p5.setXRange(-10, 0) self.p5.setYRange(0,1000) self.p5.setMouseEnabled(x=False,y=False) self.p5.setMenuEnabled(False) self.p5.showGrid(x=True,y=True,alpha=0.5) self.curves = [[],[]] self.data5 = np.empty((self.chunkSize+1,3)) self.ptr5 = 0 self.ntimer = QtCore.QTimer() self.ntimer.timeout.connect(self.updateNetGraph) self.ntimer.start(500)
def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(1069, 684) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.horizontalLayout = QtWidgets.QHBoxLayout(self.centralwidget) self.horizontalLayout.setObjectName("horizontalLayout") self.tabWidget = QtWidgets.QTabWidget(self.centralwidget) self.tabWidget.setObjectName("tabWidget") self.tab = QtWidgets.QWidget() self.tab.setObjectName("tab") self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.tab) self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.verticalLayout = QtWidgets.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") self.candles_graph = GraphicsWindow() #self.tab) self.candles_graph.setObjectName("candles_graph") self.verticalLayout.addWidget(self.candles_graph) self.gridLayout_2 = QtWidgets.QGridLayout() self.gridLayout_2.setObjectName("gridLayout_2") self.slider_end = QtWidgets.QScrollBar(self.tab) self.slider_end.setEnabled(False) self.slider_end.setOrientation(QtCore.Qt.Horizontal) self.slider_end.setObjectName("slider_end") self.gridLayout_2.addWidget(self.slider_end, 1, 2, 1, 1) self.slider_begin = QtWidgets.QScrollBar(self.tab) self.slider_begin.setEnabled(False) self.slider_begin.setOrientation(QtCore.Qt.Horizontal) self.slider_begin.setObjectName("slider_begin") self.gridLayout_2.addWidget(self.slider_begin, 0, 2, 1, 1) self.label_3 = QtWidgets.QLabel(self.tab) self.label_3.setMaximumSize(QtCore.QSize(40, 70)) self.label_3.setObjectName("label_3") self.gridLayout_2.addWidget(self.label_3, 1, 0, 1, 1) self.label_2 = QtWidgets.QLabel(self.tab) self.label_2.setMaximumSize(QtCore.QSize(40, 70)) self.label_2.setObjectName("label_2") self.gridLayout_2.addWidget(self.label_2, 0, 0, 1, 1) self.range_begin_dt = QtWidgets.QDateTimeEdit(self.tab) self.range_begin_dt.setEnabled(False) self.range_begin_dt.setMaximumSize(QtCore.QSize(140, 200)) self.range_begin_dt.setCurrentSection( QtWidgets.QDateTimeEdit.DaySection) self.range_begin_dt.setTimeSpec(QtCore.Qt.UTC) self.range_begin_dt.setObjectName("range_begin_dt") self.gridLayout_2.addWidget(self.range_begin_dt, 0, 1, 1, 1) self.range_end_dt = QtWidgets.QDateTimeEdit(self.tab) self.range_end_dt.setEnabled(False) self.range_end_dt.setMaximumSize(QtCore.QSize(140, 200)) self.range_end_dt.setCurrentSection(QtWidgets.QDateTimeEdit.DaySection) self.range_end_dt.setTimeSpec(QtCore.Qt.UTC) self.range_end_dt.setObjectName("range_end_dt") self.gridLayout_2.addWidget(self.range_end_dt, 1, 1, 1, 1) self.verticalLayout.addLayout(self.gridLayout_2) self.horizontalLayout_3 = QtWidgets.QHBoxLayout() self.horizontalLayout_3.setObjectName("horizontalLayout_3") self.BTC_graph = GraphicsWindow() #self.tab) self.BTC_graph.setObjectName("BTC_graph") self.horizontalLayout_3.addWidget(self.BTC_graph) self.USD_graph = GraphicsWindow() #self.tab) self.USD_graph.setObjectName("USD_graph") self.horizontalLayout_3.addWidget(self.USD_graph) self.verticalLayout.addLayout(self.horizontalLayout_3) self.horizontalLayout_2.addLayout(self.verticalLayout) self.gridLayout = QtWidgets.QGridLayout() self.gridLayout.setObjectName("gridLayout") self.pair_test = QtWidgets.QComboBox(self.tab) self.pair_test.setMaximumSize(QtCore.QSize(100, 150)) self.pair_test.setObjectName("pair_test") self.gridLayout.addWidget(self.pair_test, 0, 1, 1, 1) self.last_buy_price_test = QtWidgets.QLineEdit(self.tab) self.last_buy_price_test.setMaximumSize(QtCore.QSize(100, 150)) self.last_buy_price_test.setObjectName("last_buy_price_test") self.gridLayout.addWidget(self.last_buy_price_test, 6, 1, 1, 1) self.clear_main_plot_button = QtWidgets.QPushButton(self.tab) self.clear_main_plot_button.setEnabled(False) self.clear_main_plot_button.setMaximumSize(QtCore.QSize(130, 150)) self.clear_main_plot_button.setObjectName("clear_main_plot_button") self.gridLayout.addWidget(self.clear_main_plot_button, 17, 0, 1, 1) self.show_real_button = QtWidgets.QPushButton(self.tab) self.show_real_button.setEnabled(False) self.show_real_button.setMaximumSize(QtCore.QSize(250, 250)) self.show_real_button.setObjectName("show_real_button") self.gridLayout.addWidget(self.show_real_button, 15, 0, 1, 2) self.label_6 = QtWidgets.QLabel(self.tab) self.label_6.setMaximumSize(QtCore.QSize(130, 150)) self.label_6.setObjectName("label_6") self.gridLayout.addWidget(self.label_6, 5, 0, 1, 1) self.label = QtWidgets.QLabel(self.tab) self.label.setMaximumSize(QtCore.QSize(130, 150)) self.label.setObjectName("label") self.gridLayout.addWidget(self.label, 0, 0, 1, 1) self.label_4 = QtWidgets.QLabel(self.tab) self.label_4.setMaximumSize(QtCore.QSize(130, 150)) self.label_4.setObjectName("label_4") self.gridLayout.addWidget(self.label_4, 1, 0, 1, 1) self.label_11 = QtWidgets.QLabel(self.tab) self.label_11.setMaximumSize(QtCore.QSize(130, 150)) self.label_11.setObjectName("label_11") self.gridLayout.addWidget(self.label_11, 14, 0, 1, 1) self.label_5 = QtWidgets.QLabel(self.tab) self.label_5.setMaximumSize(QtCore.QSize(130, 150)) self.label_5.setObjectName("label_5") self.gridLayout.addWidget(self.label_5, 2, 0, 1, 1) self.ts_analysis_button = QtWidgets.QPushButton(self.tab) self.ts_analysis_button.setEnabled(False) self.ts_analysis_button.setMaximumSize(QtCore.QSize(250, 250)) self.ts_analysis_button.setObjectName("ts_analysis_button") self.gridLayout.addWidget(self.ts_analysis_button, 11, 0, 1, 2) self.wallet_parts_test = QtWidgets.QSpinBox(self.tab) self.wallet_parts_test.setMaximumSize(QtCore.QSize(100, 150)) self.wallet_parts_test.setProperty("value", 3) self.wallet_parts_test.setObjectName("wallet_parts_test") self.gridLayout.addWidget(self.wallet_parts_test, 5, 1, 1, 1) self.last_sell_price_test = QtWidgets.QLineEdit(self.tab) self.last_sell_price_test.setMaximumSize(QtCore.QSize(100, 150)) self.last_sell_price_test.setObjectName("last_sell_price_test") self.gridLayout.addWidget(self.last_sell_price_test, 7, 1, 1, 1) self.wallet_BTC_init_test = QtWidgets.QLineEdit(self.tab) self.wallet_BTC_init_test.setMaximumSize(QtCore.QSize(100, 150)) self.wallet_BTC_init_test.setObjectName("wallet_BTC_init_test") self.gridLayout.addWidget(self.wallet_BTC_init_test, 8, 1, 1, 1) self.existing_real_trades = QtWidgets.QComboBox(self.tab) self.existing_real_trades.setEnabled(False) self.existing_real_trades.setMaximumSize(QtCore.QSize(100, 150)) self.existing_real_trades.setEditable(True) self.existing_real_trades.setObjectName("existing_real_trades") self.gridLayout.addWidget(self.existing_real_trades, 14, 1, 1, 1) self.wallet_USD_init_test = QtWidgets.QLineEdit(self.tab) self.wallet_USD_init_test.setMaximumSize(QtCore.QSize(100, 150)) self.wallet_USD_init_test.setObjectName("wallet_USD_init_test") self.gridLayout.addWidget(self.wallet_USD_init_test, 9, 1, 1, 1) self.test_strategy_button = QtWidgets.QPushButton(self.tab) self.test_strategy_button.setEnabled(False) self.test_strategy_button.setMaximumSize(QtCore.QSize(250, 250)) self.test_strategy_button.setObjectName("test_strategy_button") self.gridLayout.addWidget(self.test_strategy_button, 10, 0, 1, 2) self.timeperiod_test = QtWidgets.QSpinBox(self.tab) self.timeperiod_test.setMaximumSize(QtCore.QSize(100, 150)) self.timeperiod_test.setProperty("value", 9) self.timeperiod_test.setObjectName("timeperiod_test") self.gridLayout.addWidget(self.timeperiod_test, 2, 1, 1, 1) self.label_8 = QtWidgets.QLabel(self.tab) self.label_8.setMaximumSize(QtCore.QSize(130, 150)) self.label_8.setObjectName("label_8") self.gridLayout.addWidget(self.label_8, 7, 0, 1, 1) self.label_9 = QtWidgets.QLabel(self.tab) self.label_9.setMaximumSize(QtCore.QSize(130, 150)) self.label_9.setObjectName("label_9") self.gridLayout.addWidget(self.label_9, 8, 0, 1, 1) self.investigate_button = QtWidgets.QPushButton(self.tab) self.investigate_button.setEnabled(False) self.investigate_button.setMaximumSize(QtCore.QSize(100, 150)) self.investigate_button.setObjectName("investigate_button") self.gridLayout.addWidget(self.investigate_button, 17, 1, 1, 1) spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.gridLayout.addItem(spacerItem, 12, 0, 1, 1) self.label_10 = QtWidgets.QLabel(self.tab) self.label_10.setMaximumSize(QtCore.QSize(130, 150)) self.label_10.setObjectName("label_10") self.gridLayout.addWidget(self.label_10, 9, 0, 1, 1) self.timeframe_test = QtWidgets.QComboBox(self.tab) self.timeframe_test.setMaximumSize(QtCore.QSize(100, 150)) self.timeframe_test.setObjectName("timeframe_test") self.gridLayout.addWidget(self.timeframe_test, 1, 1, 1, 1) self.fetch_data_button = QtWidgets.QPushButton(self.tab) self.fetch_data_button.setMaximumSize(QtCore.QSize(250, 250)) self.fetch_data_button.setObjectName("fetch_data_button") self.gridLayout.addWidget(self.fetch_data_button, 3, 0, 1, 2) spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.gridLayout.addItem(spacerItem1, 16, 0, 1, 1) self.get_existing_real_trades_button = QtWidgets.QPushButton(self.tab) self.get_existing_real_trades_button.setEnabled(False) self.get_existing_real_trades_button.setMaximumSize( QtCore.QSize(250, 250)) self.get_existing_real_trades_button.setCheckable(False) self.get_existing_real_trades_button.setObjectName( "get_existing_real_trades_button") self.gridLayout.addWidget(self.get_existing_real_trades_button, 13, 0, 1, 2) self.label_7 = QtWidgets.QLabel(self.tab) self.label_7.setMaximumSize(QtCore.QSize(130, 150)) self.label_7.setObjectName("label_7") self.gridLayout.addWidget(self.label_7, 6, 0, 1, 1) spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.gridLayout.addItem(spacerItem2, 4, 0, 1, 1) self.horizontalLayout_2.addLayout(self.gridLayout) self.tabWidget.addTab(self.tab, "") self.tab_2 = QtWidgets.QWidget() self.tab_2.setObjectName("tab_2") self.horizontalLayout_5 = QtWidgets.QHBoxLayout(self.tab_2) self.horizontalLayout_5.setObjectName("horizontalLayout_5") self.horizontalLayout_4 = QtWidgets.QHBoxLayout() self.horizontalLayout_4.setObjectName("horizontalLayout_4") self.label_info = QtWidgets.QLabel(self.tab_2) self.label_info.setObjectName("label_info") self.horizontalLayout_4.addWidget(self.label_info) self.gridLayout_4 = QtWidgets.QGridLayout() self.gridLayout_4.setObjectName("gridLayout_4") self.forse_commit_sell_buy_status_distace_test = QtWidgets.QLineEdit( self.tab_2) self.forse_commit_sell_buy_status_distace_test.setMinimumSize( QtCore.QSize(70, 0)) self.forse_commit_sell_buy_status_distace_test.setMaximumSize( QtCore.QSize(70, 16777215)) self.forse_commit_sell_buy_status_distace_test.setObjectName( "forse_commit_sell_buy_status_distace_test") self.gridLayout_4.addWidget( self.forse_commit_sell_buy_status_distace_test, 5, 1, 1, 1) self.EP_gradient_threshold_test = QtWidgets.QLineEdit(self.tab_2) self.EP_gradient_threshold_test.setMinimumSize(QtCore.QSize(70, 0)) self.EP_gradient_threshold_test.setMaximumSize( QtCore.QSize(70, 16777215)) self.EP_gradient_threshold_test.setObjectName( "EP_gradient_threshold_test") self.gridLayout_4.addWidget(self.EP_gradient_threshold_test, 1, 1, 1, 1) self.label_17 = QtWidgets.QLabel(self.tab_2) self.label_17.setMaximumSize(QtCore.QSize(300, 16777215)) self.label_17.setObjectName("label_17") self.gridLayout_4.addWidget(self.label_17, 5, 0, 1, 1) self.LPP_count_test = QtWidgets.QLineEdit(self.tab_2) self.LPP_count_test.setMinimumSize(QtCore.QSize(70, 0)) self.LPP_count_test.setMaximumSize(QtCore.QSize(70, 16777215)) self.LPP_count_test.setObjectName("LPP_count_test") self.gridLayout_4.addWidget(self.LPP_count_test, 0, 1, 1, 1) self.buy_threshold_test = QtWidgets.QLineEdit(self.tab_2) self.buy_threshold_test.setMinimumSize(QtCore.QSize(70, 0)) self.buy_threshold_test.setMaximumSize(QtCore.QSize(70, 16777215)) self.buy_threshold_test.setObjectName("buy_threshold_test") self.gridLayout_4.addWidget(self.buy_threshold_test, 3, 1, 1, 1) self.sell_threshold_test = QtWidgets.QLineEdit(self.tab_2) self.sell_threshold_test.setMinimumSize(QtCore.QSize(70, 0)) self.sell_threshold_test.setMaximumSize(QtCore.QSize(70, 16777215)) self.sell_threshold_test.setObjectName("sell_threshold_test") self.gridLayout_4.addWidget(self.sell_threshold_test, 4, 1, 1, 1) self.independent_last_sell_buy_price_checking_test = QtWidgets.QCheckBox( self.tab_2) self.independent_last_sell_buy_price_checking_test.setObjectName( "independent_last_sell_buy_price_checking_test") self.gridLayout_4.addWidget( self.independent_last_sell_buy_price_checking_test, 6, 0, 1, 2) self.LPP_gradients_threshold_test = QtWidgets.QLineEdit(self.tab_2) self.LPP_gradients_threshold_test.setMinimumSize(QtCore.QSize(70, 0)) self.LPP_gradients_threshold_test.setMaximumSize( QtCore.QSize(70, 16777215)) self.LPP_gradients_threshold_test.setObjectName( "LPP_gradients_threshold_test") self.gridLayout_4.addWidget(self.LPP_gradients_threshold_test, 2, 1, 1, 1) self.label_15 = QtWidgets.QLabel(self.tab_2) self.label_15.setMaximumSize(QtCore.QSize(300, 16777215)) self.label_15.setObjectName("label_15") self.gridLayout_4.addWidget(self.label_15, 3, 0, 1, 1) self.label_13 = QtWidgets.QLabel(self.tab_2) self.label_13.setMaximumSize(QtCore.QSize(300, 16777215)) self.label_13.setObjectName("label_13") self.gridLayout_4.addWidget(self.label_13, 1, 0, 1, 1) self.label_12 = QtWidgets.QLabel(self.tab_2) self.label_12.setMaximumSize(QtCore.QSize(300, 16777215)) self.label_12.setObjectName("label_12") self.gridLayout_4.addWidget(self.label_12, 0, 0, 1, 1) self.label_14 = QtWidgets.QLabel(self.tab_2) self.label_14.setMaximumSize(QtCore.QSize(300, 16777215)) self.label_14.setObjectName("label_14") self.gridLayout_4.addWidget(self.label_14, 2, 0, 1, 1) self.draw_candles = QtWidgets.QCheckBox(self.tab_2) self.draw_candles.setEnabled(True) self.draw_candles.setChecked(True) self.draw_candles.setObjectName("draw_candles") self.gridLayout_4.addWidget(self.draw_candles, 7, 0, 1, 2) self.label_16 = QtWidgets.QLabel(self.tab_2) self.label_16.setMaximumSize(QtCore.QSize(300, 16777215)) self.label_16.setObjectName("label_16") self.gridLayout_4.addWidget(self.label_16, 4, 0, 1, 1) self.horizontalLayout_4.addLayout(self.gridLayout_4) self.horizontalLayout_5.addLayout(self.horizontalLayout_4) self.tabWidget.addTab(self.tab_2, "") self.tab_3 = QtWidgets.QWidget() self.tab_3.setObjectName("tab_3") self.horizontalLayout_7 = QtWidgets.QHBoxLayout(self.tab_3) self.horizontalLayout_7.setObjectName("horizontalLayout_7") self.horizontalLayout_6 = QtWidgets.QHBoxLayout() self.horizontalLayout_6.setObjectName("horizontalLayout_6") self.verticalLayout_3 = QtWidgets.QVBoxLayout() self.verticalLayout_3.setObjectName("verticalLayout_3") self.trader_log = QtWidgets.QTextEdit(self.tab_3) self.trader_log.setObjectName("trader_log") self.verticalLayout_3.addWidget(self.trader_log) self.horizontalLayout_6.addLayout(self.verticalLayout_3) self.verticalLayout_2 = QtWidgets.QVBoxLayout() self.verticalLayout_2.setObjectName("verticalLayout_2") self.gridLayout_9 = QtWidgets.QGridLayout() self.gridLayout_9.setObjectName("gridLayout_9") self.trader_status_button = QtWidgets.QPushButton(self.tab_3) self.trader_status_button.setMaximumSize(QtCore.QSize(100, 16777215)) self.trader_status_button.setObjectName("trader_status_button") self.gridLayout_9.addWidget(self.trader_status_button, 2, 2, 1, 1) self.label_20 = QtWidgets.QLabel(self.tab_3) self.label_20.setObjectName("label_20") self.gridLayout_9.addWidget(self.label_20, 0, 0, 1, 1) self.trader_start_button = QtWidgets.QPushButton(self.tab_3) self.trader_start_button.setMaximumSize(QtCore.QSize(100, 16777215)) self.trader_start_button.setObjectName("trader_start_button") self.gridLayout_9.addWidget(self.trader_start_button, 2, 0, 1, 1) self.trader_stop_button = QtWidgets.QPushButton(self.tab_3) self.trader_stop_button.setMaximumSize(QtCore.QSize(100, 16777215)) self.trader_stop_button.setObjectName("trader_stop_button") self.gridLayout_9.addWidget(self.trader_stop_button, 2, 1, 1, 1) self.pair_trader = QtWidgets.QComboBox(self.tab_3) self.pair_trader.setMaximumSize(QtCore.QSize(100, 16777215)) self.pair_trader.setObjectName("pair_trader") self.gridLayout_9.addWidget(self.pair_trader, 1, 0, 1, 1) self.fetch_available_balance_button = QtWidgets.QPushButton(self.tab_3) self.fetch_available_balance_button.setObjectName( "fetch_available_balance_button") self.gridLayout_9.addWidget(self.fetch_available_balance_button, 3, 0, 1, 1) self.trader_status_short_button = QtWidgets.QPushButton(self.tab_3) self.trader_status_short_button.setObjectName( "trader_status_short_button") self.gridLayout_9.addWidget(self.trader_status_short_button, 1, 2, 1, 1) self.verticalLayout_2.addLayout(self.gridLayout_9) spacerItem3 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.verticalLayout_2.addItem(spacerItem3) self.gridLayout_10 = QtWidgets.QGridLayout() self.gridLayout_10.setObjectName("gridLayout_10") self.forse_commit_sell_buy_status_distace_trader = QtWidgets.QLineEdit( self.tab_3) self.forse_commit_sell_buy_status_distace_trader.setMaximumSize( QtCore.QSize(70, 16777215)) self.forse_commit_sell_buy_status_distace_trader.setObjectName( "forse_commit_sell_buy_status_distace_trader") self.gridLayout_10.addWidget( self.forse_commit_sell_buy_status_distace_trader, 11, 1, 1, 1) self.label_30 = QtWidgets.QLabel(self.tab_3) self.label_30.setMaximumSize(QtCore.QSize(300, 16777215)) self.label_30.setObjectName("label_30") self.gridLayout_10.addWidget(self.label_30, 10, 0, 1, 1) self.label_28 = QtWidgets.QLabel(self.tab_3) self.label_28.setMaximumSize(QtCore.QSize(300, 16777215)) self.label_28.setObjectName("label_28") self.gridLayout_10.addWidget(self.label_28, 9, 0, 1, 1) self.label_25 = QtWidgets.QLabel(self.tab_3) self.label_25.setMaximumSize(QtCore.QSize(300, 16777215)) self.label_25.setObjectName("label_25") self.gridLayout_10.addWidget(self.label_25, 5, 0, 1, 1) self.sell_threshold_trader = QtWidgets.QLineEdit(self.tab_3) self.sell_threshold_trader.setMaximumSize(QtCore.QSize(70, 16777215)) self.sell_threshold_trader.setObjectName("sell_threshold_trader") self.gridLayout_10.addWidget(self.sell_threshold_trader, 10, 1, 1, 1) self.label_31 = QtWidgets.QLabel(self.tab_3) self.label_31.setMaximumSize(QtCore.QSize(300, 16777215)) self.label_31.setObjectName("label_31") self.gridLayout_10.addWidget(self.label_31, 11, 0, 1, 1) self.label_29 = QtWidgets.QLabel(self.tab_3) self.label_29.setMaximumSize(QtCore.QSize(300, 16777215)) self.label_29.setObjectName("label_29") self.gridLayout_10.addWidget(self.label_29, 8, 0, 1, 1) self.LPP_gradients_threshold_trader = QtWidgets.QLineEdit(self.tab_3) self.LPP_gradients_threshold_trader.setMaximumSize( QtCore.QSize(70, 16777215)) self.LPP_gradients_threshold_trader.setObjectName( "LPP_gradients_threshold_trader") self.gridLayout_10.addWidget(self.LPP_gradients_threshold_trader, 8, 1, 1, 1) self.timeperiod_trader = QtWidgets.QLineEdit(self.tab_3) self.timeperiod_trader.setMaximumSize(QtCore.QSize(70, 16777215)) self.timeperiod_trader.setObjectName("timeperiod_trader") self.gridLayout_10.addWidget(self.timeperiod_trader, 2, 1, 1, 1) self.independent_last_sell_buy_price_checking_trader = QtWidgets.QCheckBox( self.tab_3) self.independent_last_sell_buy_price_checking_trader.setObjectName( "independent_last_sell_buy_price_checking_trader") self.gridLayout_10.addWidget( self.independent_last_sell_buy_price_checking_trader, 12, 0, 1, 2) self.label_24 = QtWidgets.QLabel(self.tab_3) self.label_24.setMaximumSize(QtCore.QSize(300, 16777215)) self.label_24.setObjectName("label_24") self.gridLayout_10.addWidget(self.label_24, 4, 0, 1, 1) self.LPP_count_trader = QtWidgets.QLineEdit(self.tab_3) self.LPP_count_trader.setMaximumSize(QtCore.QSize(70, 16777215)) self.LPP_count_trader.setObjectName("LPP_count_trader") self.gridLayout_10.addWidget(self.LPP_count_trader, 6, 1, 1, 1) self.buy_threshold_trader = QtWidgets.QLineEdit(self.tab_3) self.buy_threshold_trader.setMaximumSize(QtCore.QSize(70, 16777215)) self.buy_threshold_trader.setObjectName("buy_threshold_trader") self.gridLayout_10.addWidget(self.buy_threshold_trader, 9, 1, 1, 1) self.last_sell_price_trader = QtWidgets.QLineEdit(self.tab_3) self.last_sell_price_trader.setMaximumSize(QtCore.QSize(70, 16777215)) self.last_sell_price_trader.setObjectName("last_sell_price_trader") self.gridLayout_10.addWidget(self.last_sell_price_trader, 5, 1, 1, 1) self.label_26 = QtWidgets.QLabel(self.tab_3) self.label_26.setMaximumSize(QtCore.QSize(300, 16777215)) self.label_26.setObjectName("label_26") self.gridLayout_10.addWidget(self.label_26, 6, 0, 1, 1) self.label_22 = QtWidgets.QLabel(self.tab_3) self.label_22.setMaximumSize(QtCore.QSize(300, 16777215)) self.label_22.setObjectName("label_22") self.gridLayout_10.addWidget(self.label_22, 2, 0, 1, 1) self.last_buy_price_trader = QtWidgets.QLineEdit(self.tab_3) self.last_buy_price_trader.setMaximumSize(QtCore.QSize(70, 16777215)) self.last_buy_price_trader.setObjectName("last_buy_price_trader") self.gridLayout_10.addWidget(self.last_buy_price_trader, 4, 1, 1, 1) self.EP_gradient_threshold_trader = QtWidgets.QLineEdit(self.tab_3) self.EP_gradient_threshold_trader.setMaximumSize( QtCore.QSize(70, 16777215)) self.EP_gradient_threshold_trader.setObjectName( "EP_gradient_threshold_trader") self.gridLayout_10.addWidget(self.EP_gradient_threshold_trader, 7, 1, 1, 1) self.label_23 = QtWidgets.QLabel(self.tab_3) self.label_23.setMaximumSize(QtCore.QSize(300, 16777215)) self.label_23.setObjectName("label_23") self.gridLayout_10.addWidget(self.label_23, 3, 0, 1, 1) self.label_21 = QtWidgets.QLabel(self.tab_3) self.label_21.setObjectName("label_21") self.gridLayout_10.addWidget(self.label_21, 0, 0, 1, 2) self.wallet_parts_trader = QtWidgets.QLineEdit(self.tab_3) self.wallet_parts_trader.setMaximumSize(QtCore.QSize(70, 16777215)) self.wallet_parts_trader.setObjectName("wallet_parts_trader") self.gridLayout_10.addWidget(self.wallet_parts_trader, 3, 1, 1, 1) self.label_27 = QtWidgets.QLabel(self.tab_3) self.label_27.setMaximumSize(QtCore.QSize(300, 16777215)) self.label_27.setObjectName("label_27") self.gridLayout_10.addWidget(self.label_27, 7, 0, 1, 1) self.timeframe_trader = QtWidgets.QComboBox(self.tab_3) self.timeframe_trader.setMaximumSize(QtCore.QSize(100, 16777215)) self.timeframe_trader.setObjectName("timeframe_trader") self.gridLayout_10.addWidget(self.timeframe_trader, 1, 1, 1, 1) self.label_18 = QtWidgets.QLabel(self.tab_3) self.label_18.setObjectName("label_18") self.gridLayout_10.addWidget(self.label_18, 1, 0, 1, 1) self.verticalLayout_2.addLayout(self.gridLayout_10) self.horizontalLayout_6.addLayout(self.verticalLayout_2) self.horizontalLayout_7.addLayout(self.horizontalLayout_6) self.tabWidget.addTab(self.tab_3, "") self.tab_4 = QtWidgets.QWidget() self.tab_4.setObjectName("tab_4") self.horizontalLayout_9 = QtWidgets.QHBoxLayout(self.tab_4) self.horizontalLayout_9.setObjectName("horizontalLayout_9") self.horizontalLayout_8 = QtWidgets.QHBoxLayout() self.horizontalLayout_8.setObjectName("horizontalLayout_8") self.verticalLayout_4 = QtWidgets.QVBoxLayout() self.verticalLayout_4.setObjectName("verticalLayout_4") self.collector_log = QtWidgets.QTextEdit(self.tab_4) self.collector_log.setObjectName("collector_log") self.verticalLayout_4.addWidget(self.collector_log) self.horizontalLayout_8.addLayout(self.verticalLayout_4) self.verticalLayout_5 = QtWidgets.QVBoxLayout() self.verticalLayout_5.setObjectName("verticalLayout_5") self.gridLayout_11 = QtWidgets.QGridLayout() self.gridLayout_11.setObjectName("gridLayout_11") self.collector_stop_button = QtWidgets.QPushButton(self.tab_4) self.collector_stop_button.setMaximumSize(QtCore.QSize(100, 16777215)) self.collector_stop_button.setObjectName("collector_stop_button") self.gridLayout_11.addWidget(self.collector_stop_button, 1, 1, 1, 1) self.collector_pair_timeframe = QtWidgets.QLineEdit(self.tab_4) self.collector_pair_timeframe.setMaximumSize( QtCore.QSize(100, 16777215)) self.collector_pair_timeframe.setObjectName("collector_pair_timeframe") self.gridLayout_11.addWidget(self.collector_pair_timeframe, 4, 1, 1, 1) self.label_32 = QtWidgets.QLabel(self.tab_4) self.label_32.setObjectName("label_32") self.gridLayout_11.addWidget(self.label_32, 4, 0, 1, 1) self.pair_remove_from_collect_button = QtWidgets.QPushButton( self.tab_4) self.pair_remove_from_collect_button.setObjectName( "pair_remove_from_collect_button") self.gridLayout_11.addWidget(self.pair_remove_from_collect_button, 5, 1, 1, 1) self.candles_clear_button = QtWidgets.QPushButton(self.tab_4) self.candles_clear_button.setObjectName("candles_clear_button") self.gridLayout_11.addWidget(self.candles_clear_button, 7, 0, 1, 1) self.label_33 = QtWidgets.QLabel(self.tab_4) self.label_33.setObjectName("label_33") self.gridLayout_11.addWidget(self.label_33, 6, 0, 1, 1) self.candles_clear_all_button = QtWidgets.QPushButton(self.tab_4) self.candles_clear_all_button.setObjectName("candles_clear_all_button") self.gridLayout_11.addWidget(self.candles_clear_all_button, 7, 1, 1, 1) self.pair_add_to_collect_button = QtWidgets.QPushButton(self.tab_4) self.pair_add_to_collect_button.setObjectName( "pair_add_to_collect_button") self.gridLayout_11.addWidget(self.pair_add_to_collect_button, 5, 0, 1, 1) self.pair_get_all_button = QtWidgets.QPushButton(self.tab_4) self.pair_get_all_button.setObjectName("pair_get_all_button") self.gridLayout_11.addWidget(self.pair_get_all_button, 5, 2, 1, 1) self.label_19 = QtWidgets.QLabel(self.tab_4) self.label_19.setObjectName("label_19") self.gridLayout_11.addWidget(self.label_19, 0, 0, 1, 1) self.collector_start_button = QtWidgets.QPushButton(self.tab_4) self.collector_start_button.setMaximumSize(QtCore.QSize(100, 16777215)) self.collector_start_button.setObjectName("collector_start_button") self.gridLayout_11.addWidget(self.collector_start_button, 1, 0, 1, 1) self.collector_status_button = QtWidgets.QPushButton(self.tab_4) self.collector_status_button.setMaximumSize(QtCore.QSize( 100, 16777215)) self.collector_status_button.setObjectName("collector_status_button") self.gridLayout_11.addWidget(self.collector_status_button, 1, 2, 1, 1) self.candles_info_button = QtWidgets.QPushButton(self.tab_4) self.candles_info_button.setObjectName("candles_info_button") self.gridLayout_11.addWidget(self.candles_info_button, 7, 2, 1, 1) self.trades_history_tree = QtWidgets.QTreeWidget(self.tab_4) self.trades_history_tree.setAlternatingRowColors(True) self.trades_history_tree.setSelectionMode( QtWidgets.QAbstractItemView.MultiSelection) self.trades_history_tree.setHorizontalScrollMode( QtWidgets.QAbstractItemView.ScrollPerItem) self.trades_history_tree.setColumnCount(0) self.trades_history_tree.setObjectName("trades_history_tree") self.gridLayout_11.addWidget(self.trades_history_tree, 3, 0, 1, 3) self.label_34 = QtWidgets.QLabel(self.tab_4) self.label_34.setObjectName("label_34") self.gridLayout_11.addWidget(self.label_34, 2, 0, 1, 1) self.verticalLayout_5.addLayout(self.gridLayout_11) self.horizontalLayout_8.addLayout(self.verticalLayout_5) self.horizontalLayout_9.addLayout(self.horizontalLayout_8) self.tabWidget.addTab(self.tab_4, "") self.horizontalLayout.addWidget(self.tabWidget) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 1069, 22)) self.menubar.setObjectName("menubar") MainWindow.setMenuBar(self.menubar) self.statusbar = QtWidgets.QStatusBar(MainWindow) self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar) self.retranslateUi(MainWindow) self.tabWidget.setCurrentIndex(0) QtCore.QMetaObject.connectSlotsByName(MainWindow)
class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(1069, 684) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.horizontalLayout = QtWidgets.QHBoxLayout(self.centralwidget) self.horizontalLayout.setObjectName("horizontalLayout") self.tabWidget = QtWidgets.QTabWidget(self.centralwidget) self.tabWidget.setObjectName("tabWidget") self.tab = QtWidgets.QWidget() self.tab.setObjectName("tab") self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.tab) self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.verticalLayout = QtWidgets.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") self.candles_graph = GraphicsWindow() #self.tab) self.candles_graph.setObjectName("candles_graph") self.verticalLayout.addWidget(self.candles_graph) self.gridLayout_2 = QtWidgets.QGridLayout() self.gridLayout_2.setObjectName("gridLayout_2") self.slider_end = QtWidgets.QScrollBar(self.tab) self.slider_end.setEnabled(False) self.slider_end.setOrientation(QtCore.Qt.Horizontal) self.slider_end.setObjectName("slider_end") self.gridLayout_2.addWidget(self.slider_end, 1, 2, 1, 1) self.slider_begin = QtWidgets.QScrollBar(self.tab) self.slider_begin.setEnabled(False) self.slider_begin.setOrientation(QtCore.Qt.Horizontal) self.slider_begin.setObjectName("slider_begin") self.gridLayout_2.addWidget(self.slider_begin, 0, 2, 1, 1) self.label_3 = QtWidgets.QLabel(self.tab) self.label_3.setMaximumSize(QtCore.QSize(40, 70)) self.label_3.setObjectName("label_3") self.gridLayout_2.addWidget(self.label_3, 1, 0, 1, 1) self.label_2 = QtWidgets.QLabel(self.tab) self.label_2.setMaximumSize(QtCore.QSize(40, 70)) self.label_2.setObjectName("label_2") self.gridLayout_2.addWidget(self.label_2, 0, 0, 1, 1) self.range_begin_dt = QtWidgets.QDateTimeEdit(self.tab) self.range_begin_dt.setEnabled(False) self.range_begin_dt.setMaximumSize(QtCore.QSize(140, 200)) self.range_begin_dt.setCurrentSection( QtWidgets.QDateTimeEdit.DaySection) self.range_begin_dt.setTimeSpec(QtCore.Qt.UTC) self.range_begin_dt.setObjectName("range_begin_dt") self.gridLayout_2.addWidget(self.range_begin_dt, 0, 1, 1, 1) self.range_end_dt = QtWidgets.QDateTimeEdit(self.tab) self.range_end_dt.setEnabled(False) self.range_end_dt.setMaximumSize(QtCore.QSize(140, 200)) self.range_end_dt.setCurrentSection(QtWidgets.QDateTimeEdit.DaySection) self.range_end_dt.setTimeSpec(QtCore.Qt.UTC) self.range_end_dt.setObjectName("range_end_dt") self.gridLayout_2.addWidget(self.range_end_dt, 1, 1, 1, 1) self.verticalLayout.addLayout(self.gridLayout_2) self.horizontalLayout_3 = QtWidgets.QHBoxLayout() self.horizontalLayout_3.setObjectName("horizontalLayout_3") self.BTC_graph = GraphicsWindow() #self.tab) self.BTC_graph.setObjectName("BTC_graph") self.horizontalLayout_3.addWidget(self.BTC_graph) self.USD_graph = GraphicsWindow() #self.tab) self.USD_graph.setObjectName("USD_graph") self.horizontalLayout_3.addWidget(self.USD_graph) self.verticalLayout.addLayout(self.horizontalLayout_3) self.horizontalLayout_2.addLayout(self.verticalLayout) self.gridLayout = QtWidgets.QGridLayout() self.gridLayout.setObjectName("gridLayout") self.pair_test = QtWidgets.QComboBox(self.tab) self.pair_test.setMaximumSize(QtCore.QSize(100, 150)) self.pair_test.setObjectName("pair_test") self.gridLayout.addWidget(self.pair_test, 0, 1, 1, 1) self.last_buy_price_test = QtWidgets.QLineEdit(self.tab) self.last_buy_price_test.setMaximumSize(QtCore.QSize(100, 150)) self.last_buy_price_test.setObjectName("last_buy_price_test") self.gridLayout.addWidget(self.last_buy_price_test, 6, 1, 1, 1) self.clear_main_plot_button = QtWidgets.QPushButton(self.tab) self.clear_main_plot_button.setEnabled(False) self.clear_main_plot_button.setMaximumSize(QtCore.QSize(130, 150)) self.clear_main_plot_button.setObjectName("clear_main_plot_button") self.gridLayout.addWidget(self.clear_main_plot_button, 17, 0, 1, 1) self.show_real_button = QtWidgets.QPushButton(self.tab) self.show_real_button.setEnabled(False) self.show_real_button.setMaximumSize(QtCore.QSize(250, 250)) self.show_real_button.setObjectName("show_real_button") self.gridLayout.addWidget(self.show_real_button, 15, 0, 1, 2) self.label_6 = QtWidgets.QLabel(self.tab) self.label_6.setMaximumSize(QtCore.QSize(130, 150)) self.label_6.setObjectName("label_6") self.gridLayout.addWidget(self.label_6, 5, 0, 1, 1) self.label = QtWidgets.QLabel(self.tab) self.label.setMaximumSize(QtCore.QSize(130, 150)) self.label.setObjectName("label") self.gridLayout.addWidget(self.label, 0, 0, 1, 1) self.label_4 = QtWidgets.QLabel(self.tab) self.label_4.setMaximumSize(QtCore.QSize(130, 150)) self.label_4.setObjectName("label_4") self.gridLayout.addWidget(self.label_4, 1, 0, 1, 1) self.label_11 = QtWidgets.QLabel(self.tab) self.label_11.setMaximumSize(QtCore.QSize(130, 150)) self.label_11.setObjectName("label_11") self.gridLayout.addWidget(self.label_11, 14, 0, 1, 1) self.label_5 = QtWidgets.QLabel(self.tab) self.label_5.setMaximumSize(QtCore.QSize(130, 150)) self.label_5.setObjectName("label_5") self.gridLayout.addWidget(self.label_5, 2, 0, 1, 1) self.ts_analysis_button = QtWidgets.QPushButton(self.tab) self.ts_analysis_button.setEnabled(False) self.ts_analysis_button.setMaximumSize(QtCore.QSize(250, 250)) self.ts_analysis_button.setObjectName("ts_analysis_button") self.gridLayout.addWidget(self.ts_analysis_button, 11, 0, 1, 2) self.wallet_parts_test = QtWidgets.QSpinBox(self.tab) self.wallet_parts_test.setMaximumSize(QtCore.QSize(100, 150)) self.wallet_parts_test.setProperty("value", 3) self.wallet_parts_test.setObjectName("wallet_parts_test") self.gridLayout.addWidget(self.wallet_parts_test, 5, 1, 1, 1) self.last_sell_price_test = QtWidgets.QLineEdit(self.tab) self.last_sell_price_test.setMaximumSize(QtCore.QSize(100, 150)) self.last_sell_price_test.setObjectName("last_sell_price_test") self.gridLayout.addWidget(self.last_sell_price_test, 7, 1, 1, 1) self.wallet_BTC_init_test = QtWidgets.QLineEdit(self.tab) self.wallet_BTC_init_test.setMaximumSize(QtCore.QSize(100, 150)) self.wallet_BTC_init_test.setObjectName("wallet_BTC_init_test") self.gridLayout.addWidget(self.wallet_BTC_init_test, 8, 1, 1, 1) self.existing_real_trades = QtWidgets.QComboBox(self.tab) self.existing_real_trades.setEnabled(False) self.existing_real_trades.setMaximumSize(QtCore.QSize(100, 150)) self.existing_real_trades.setEditable(True) self.existing_real_trades.setObjectName("existing_real_trades") self.gridLayout.addWidget(self.existing_real_trades, 14, 1, 1, 1) self.wallet_USD_init_test = QtWidgets.QLineEdit(self.tab) self.wallet_USD_init_test.setMaximumSize(QtCore.QSize(100, 150)) self.wallet_USD_init_test.setObjectName("wallet_USD_init_test") self.gridLayout.addWidget(self.wallet_USD_init_test, 9, 1, 1, 1) self.test_strategy_button = QtWidgets.QPushButton(self.tab) self.test_strategy_button.setEnabled(False) self.test_strategy_button.setMaximumSize(QtCore.QSize(250, 250)) self.test_strategy_button.setObjectName("test_strategy_button") self.gridLayout.addWidget(self.test_strategy_button, 10, 0, 1, 2) self.timeperiod_test = QtWidgets.QSpinBox(self.tab) self.timeperiod_test.setMaximumSize(QtCore.QSize(100, 150)) self.timeperiod_test.setProperty("value", 9) self.timeperiod_test.setObjectName("timeperiod_test") self.gridLayout.addWidget(self.timeperiod_test, 2, 1, 1, 1) self.label_8 = QtWidgets.QLabel(self.tab) self.label_8.setMaximumSize(QtCore.QSize(130, 150)) self.label_8.setObjectName("label_8") self.gridLayout.addWidget(self.label_8, 7, 0, 1, 1) self.label_9 = QtWidgets.QLabel(self.tab) self.label_9.setMaximumSize(QtCore.QSize(130, 150)) self.label_9.setObjectName("label_9") self.gridLayout.addWidget(self.label_9, 8, 0, 1, 1) self.investigate_button = QtWidgets.QPushButton(self.tab) self.investigate_button.setEnabled(False) self.investigate_button.setMaximumSize(QtCore.QSize(100, 150)) self.investigate_button.setObjectName("investigate_button") self.gridLayout.addWidget(self.investigate_button, 17, 1, 1, 1) spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.gridLayout.addItem(spacerItem, 12, 0, 1, 1) self.label_10 = QtWidgets.QLabel(self.tab) self.label_10.setMaximumSize(QtCore.QSize(130, 150)) self.label_10.setObjectName("label_10") self.gridLayout.addWidget(self.label_10, 9, 0, 1, 1) self.timeframe_test = QtWidgets.QComboBox(self.tab) self.timeframe_test.setMaximumSize(QtCore.QSize(100, 150)) self.timeframe_test.setObjectName("timeframe_test") self.gridLayout.addWidget(self.timeframe_test, 1, 1, 1, 1) self.fetch_data_button = QtWidgets.QPushButton(self.tab) self.fetch_data_button.setMaximumSize(QtCore.QSize(250, 250)) self.fetch_data_button.setObjectName("fetch_data_button") self.gridLayout.addWidget(self.fetch_data_button, 3, 0, 1, 2) spacerItem1 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.gridLayout.addItem(spacerItem1, 16, 0, 1, 1) self.get_existing_real_trades_button = QtWidgets.QPushButton(self.tab) self.get_existing_real_trades_button.setEnabled(False) self.get_existing_real_trades_button.setMaximumSize( QtCore.QSize(250, 250)) self.get_existing_real_trades_button.setCheckable(False) self.get_existing_real_trades_button.setObjectName( "get_existing_real_trades_button") self.gridLayout.addWidget(self.get_existing_real_trades_button, 13, 0, 1, 2) self.label_7 = QtWidgets.QLabel(self.tab) self.label_7.setMaximumSize(QtCore.QSize(130, 150)) self.label_7.setObjectName("label_7") self.gridLayout.addWidget(self.label_7, 6, 0, 1, 1) spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.gridLayout.addItem(spacerItem2, 4, 0, 1, 1) self.horizontalLayout_2.addLayout(self.gridLayout) self.tabWidget.addTab(self.tab, "") self.tab_2 = QtWidgets.QWidget() self.tab_2.setObjectName("tab_2") self.horizontalLayout_5 = QtWidgets.QHBoxLayout(self.tab_2) self.horizontalLayout_5.setObjectName("horizontalLayout_5") self.horizontalLayout_4 = QtWidgets.QHBoxLayout() self.horizontalLayout_4.setObjectName("horizontalLayout_4") self.label_info = QtWidgets.QLabel(self.tab_2) self.label_info.setObjectName("label_info") self.horizontalLayout_4.addWidget(self.label_info) self.gridLayout_4 = QtWidgets.QGridLayout() self.gridLayout_4.setObjectName("gridLayout_4") self.forse_commit_sell_buy_status_distace_test = QtWidgets.QLineEdit( self.tab_2) self.forse_commit_sell_buy_status_distace_test.setMinimumSize( QtCore.QSize(70, 0)) self.forse_commit_sell_buy_status_distace_test.setMaximumSize( QtCore.QSize(70, 16777215)) self.forse_commit_sell_buy_status_distace_test.setObjectName( "forse_commit_sell_buy_status_distace_test") self.gridLayout_4.addWidget( self.forse_commit_sell_buy_status_distace_test, 5, 1, 1, 1) self.EP_gradient_threshold_test = QtWidgets.QLineEdit(self.tab_2) self.EP_gradient_threshold_test.setMinimumSize(QtCore.QSize(70, 0)) self.EP_gradient_threshold_test.setMaximumSize( QtCore.QSize(70, 16777215)) self.EP_gradient_threshold_test.setObjectName( "EP_gradient_threshold_test") self.gridLayout_4.addWidget(self.EP_gradient_threshold_test, 1, 1, 1, 1) self.label_17 = QtWidgets.QLabel(self.tab_2) self.label_17.setMaximumSize(QtCore.QSize(300, 16777215)) self.label_17.setObjectName("label_17") self.gridLayout_4.addWidget(self.label_17, 5, 0, 1, 1) self.LPP_count_test = QtWidgets.QLineEdit(self.tab_2) self.LPP_count_test.setMinimumSize(QtCore.QSize(70, 0)) self.LPP_count_test.setMaximumSize(QtCore.QSize(70, 16777215)) self.LPP_count_test.setObjectName("LPP_count_test") self.gridLayout_4.addWidget(self.LPP_count_test, 0, 1, 1, 1) self.buy_threshold_test = QtWidgets.QLineEdit(self.tab_2) self.buy_threshold_test.setMinimumSize(QtCore.QSize(70, 0)) self.buy_threshold_test.setMaximumSize(QtCore.QSize(70, 16777215)) self.buy_threshold_test.setObjectName("buy_threshold_test") self.gridLayout_4.addWidget(self.buy_threshold_test, 3, 1, 1, 1) self.sell_threshold_test = QtWidgets.QLineEdit(self.tab_2) self.sell_threshold_test.setMinimumSize(QtCore.QSize(70, 0)) self.sell_threshold_test.setMaximumSize(QtCore.QSize(70, 16777215)) self.sell_threshold_test.setObjectName("sell_threshold_test") self.gridLayout_4.addWidget(self.sell_threshold_test, 4, 1, 1, 1) self.independent_last_sell_buy_price_checking_test = QtWidgets.QCheckBox( self.tab_2) self.independent_last_sell_buy_price_checking_test.setObjectName( "independent_last_sell_buy_price_checking_test") self.gridLayout_4.addWidget( self.independent_last_sell_buy_price_checking_test, 6, 0, 1, 2) self.LPP_gradients_threshold_test = QtWidgets.QLineEdit(self.tab_2) self.LPP_gradients_threshold_test.setMinimumSize(QtCore.QSize(70, 0)) self.LPP_gradients_threshold_test.setMaximumSize( QtCore.QSize(70, 16777215)) self.LPP_gradients_threshold_test.setObjectName( "LPP_gradients_threshold_test") self.gridLayout_4.addWidget(self.LPP_gradients_threshold_test, 2, 1, 1, 1) self.label_15 = QtWidgets.QLabel(self.tab_2) self.label_15.setMaximumSize(QtCore.QSize(300, 16777215)) self.label_15.setObjectName("label_15") self.gridLayout_4.addWidget(self.label_15, 3, 0, 1, 1) self.label_13 = QtWidgets.QLabel(self.tab_2) self.label_13.setMaximumSize(QtCore.QSize(300, 16777215)) self.label_13.setObjectName("label_13") self.gridLayout_4.addWidget(self.label_13, 1, 0, 1, 1) self.label_12 = QtWidgets.QLabel(self.tab_2) self.label_12.setMaximumSize(QtCore.QSize(300, 16777215)) self.label_12.setObjectName("label_12") self.gridLayout_4.addWidget(self.label_12, 0, 0, 1, 1) self.label_14 = QtWidgets.QLabel(self.tab_2) self.label_14.setMaximumSize(QtCore.QSize(300, 16777215)) self.label_14.setObjectName("label_14") self.gridLayout_4.addWidget(self.label_14, 2, 0, 1, 1) self.draw_candles = QtWidgets.QCheckBox(self.tab_2) self.draw_candles.setEnabled(True) self.draw_candles.setChecked(True) self.draw_candles.setObjectName("draw_candles") self.gridLayout_4.addWidget(self.draw_candles, 7, 0, 1, 2) self.label_16 = QtWidgets.QLabel(self.tab_2) self.label_16.setMaximumSize(QtCore.QSize(300, 16777215)) self.label_16.setObjectName("label_16") self.gridLayout_4.addWidget(self.label_16, 4, 0, 1, 1) self.horizontalLayout_4.addLayout(self.gridLayout_4) self.horizontalLayout_5.addLayout(self.horizontalLayout_4) self.tabWidget.addTab(self.tab_2, "") self.tab_3 = QtWidgets.QWidget() self.tab_3.setObjectName("tab_3") self.horizontalLayout_7 = QtWidgets.QHBoxLayout(self.tab_3) self.horizontalLayout_7.setObjectName("horizontalLayout_7") self.horizontalLayout_6 = QtWidgets.QHBoxLayout() self.horizontalLayout_6.setObjectName("horizontalLayout_6") self.verticalLayout_3 = QtWidgets.QVBoxLayout() self.verticalLayout_3.setObjectName("verticalLayout_3") self.trader_log = QtWidgets.QTextEdit(self.tab_3) self.trader_log.setObjectName("trader_log") self.verticalLayout_3.addWidget(self.trader_log) self.horizontalLayout_6.addLayout(self.verticalLayout_3) self.verticalLayout_2 = QtWidgets.QVBoxLayout() self.verticalLayout_2.setObjectName("verticalLayout_2") self.gridLayout_9 = QtWidgets.QGridLayout() self.gridLayout_9.setObjectName("gridLayout_9") self.trader_status_button = QtWidgets.QPushButton(self.tab_3) self.trader_status_button.setMaximumSize(QtCore.QSize(100, 16777215)) self.trader_status_button.setObjectName("trader_status_button") self.gridLayout_9.addWidget(self.trader_status_button, 2, 2, 1, 1) self.label_20 = QtWidgets.QLabel(self.tab_3) self.label_20.setObjectName("label_20") self.gridLayout_9.addWidget(self.label_20, 0, 0, 1, 1) self.trader_start_button = QtWidgets.QPushButton(self.tab_3) self.trader_start_button.setMaximumSize(QtCore.QSize(100, 16777215)) self.trader_start_button.setObjectName("trader_start_button") self.gridLayout_9.addWidget(self.trader_start_button, 2, 0, 1, 1) self.trader_stop_button = QtWidgets.QPushButton(self.tab_3) self.trader_stop_button.setMaximumSize(QtCore.QSize(100, 16777215)) self.trader_stop_button.setObjectName("trader_stop_button") self.gridLayout_9.addWidget(self.trader_stop_button, 2, 1, 1, 1) self.pair_trader = QtWidgets.QComboBox(self.tab_3) self.pair_trader.setMaximumSize(QtCore.QSize(100, 16777215)) self.pair_trader.setObjectName("pair_trader") self.gridLayout_9.addWidget(self.pair_trader, 1, 0, 1, 1) self.fetch_available_balance_button = QtWidgets.QPushButton(self.tab_3) self.fetch_available_balance_button.setObjectName( "fetch_available_balance_button") self.gridLayout_9.addWidget(self.fetch_available_balance_button, 3, 0, 1, 1) self.trader_status_short_button = QtWidgets.QPushButton(self.tab_3) self.trader_status_short_button.setObjectName( "trader_status_short_button") self.gridLayout_9.addWidget(self.trader_status_short_button, 1, 2, 1, 1) self.verticalLayout_2.addLayout(self.gridLayout_9) spacerItem3 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.verticalLayout_2.addItem(spacerItem3) self.gridLayout_10 = QtWidgets.QGridLayout() self.gridLayout_10.setObjectName("gridLayout_10") self.forse_commit_sell_buy_status_distace_trader = QtWidgets.QLineEdit( self.tab_3) self.forse_commit_sell_buy_status_distace_trader.setMaximumSize( QtCore.QSize(70, 16777215)) self.forse_commit_sell_buy_status_distace_trader.setObjectName( "forse_commit_sell_buy_status_distace_trader") self.gridLayout_10.addWidget( self.forse_commit_sell_buy_status_distace_trader, 11, 1, 1, 1) self.label_30 = QtWidgets.QLabel(self.tab_3) self.label_30.setMaximumSize(QtCore.QSize(300, 16777215)) self.label_30.setObjectName("label_30") self.gridLayout_10.addWidget(self.label_30, 10, 0, 1, 1) self.label_28 = QtWidgets.QLabel(self.tab_3) self.label_28.setMaximumSize(QtCore.QSize(300, 16777215)) self.label_28.setObjectName("label_28") self.gridLayout_10.addWidget(self.label_28, 9, 0, 1, 1) self.label_25 = QtWidgets.QLabel(self.tab_3) self.label_25.setMaximumSize(QtCore.QSize(300, 16777215)) self.label_25.setObjectName("label_25") self.gridLayout_10.addWidget(self.label_25, 5, 0, 1, 1) self.sell_threshold_trader = QtWidgets.QLineEdit(self.tab_3) self.sell_threshold_trader.setMaximumSize(QtCore.QSize(70, 16777215)) self.sell_threshold_trader.setObjectName("sell_threshold_trader") self.gridLayout_10.addWidget(self.sell_threshold_trader, 10, 1, 1, 1) self.label_31 = QtWidgets.QLabel(self.tab_3) self.label_31.setMaximumSize(QtCore.QSize(300, 16777215)) self.label_31.setObjectName("label_31") self.gridLayout_10.addWidget(self.label_31, 11, 0, 1, 1) self.label_29 = QtWidgets.QLabel(self.tab_3) self.label_29.setMaximumSize(QtCore.QSize(300, 16777215)) self.label_29.setObjectName("label_29") self.gridLayout_10.addWidget(self.label_29, 8, 0, 1, 1) self.LPP_gradients_threshold_trader = QtWidgets.QLineEdit(self.tab_3) self.LPP_gradients_threshold_trader.setMaximumSize( QtCore.QSize(70, 16777215)) self.LPP_gradients_threshold_trader.setObjectName( "LPP_gradients_threshold_trader") self.gridLayout_10.addWidget(self.LPP_gradients_threshold_trader, 8, 1, 1, 1) self.timeperiod_trader = QtWidgets.QLineEdit(self.tab_3) self.timeperiod_trader.setMaximumSize(QtCore.QSize(70, 16777215)) self.timeperiod_trader.setObjectName("timeperiod_trader") self.gridLayout_10.addWidget(self.timeperiod_trader, 2, 1, 1, 1) self.independent_last_sell_buy_price_checking_trader = QtWidgets.QCheckBox( self.tab_3) self.independent_last_sell_buy_price_checking_trader.setObjectName( "independent_last_sell_buy_price_checking_trader") self.gridLayout_10.addWidget( self.independent_last_sell_buy_price_checking_trader, 12, 0, 1, 2) self.label_24 = QtWidgets.QLabel(self.tab_3) self.label_24.setMaximumSize(QtCore.QSize(300, 16777215)) self.label_24.setObjectName("label_24") self.gridLayout_10.addWidget(self.label_24, 4, 0, 1, 1) self.LPP_count_trader = QtWidgets.QLineEdit(self.tab_3) self.LPP_count_trader.setMaximumSize(QtCore.QSize(70, 16777215)) self.LPP_count_trader.setObjectName("LPP_count_trader") self.gridLayout_10.addWidget(self.LPP_count_trader, 6, 1, 1, 1) self.buy_threshold_trader = QtWidgets.QLineEdit(self.tab_3) self.buy_threshold_trader.setMaximumSize(QtCore.QSize(70, 16777215)) self.buy_threshold_trader.setObjectName("buy_threshold_trader") self.gridLayout_10.addWidget(self.buy_threshold_trader, 9, 1, 1, 1) self.last_sell_price_trader = QtWidgets.QLineEdit(self.tab_3) self.last_sell_price_trader.setMaximumSize(QtCore.QSize(70, 16777215)) self.last_sell_price_trader.setObjectName("last_sell_price_trader") self.gridLayout_10.addWidget(self.last_sell_price_trader, 5, 1, 1, 1) self.label_26 = QtWidgets.QLabel(self.tab_3) self.label_26.setMaximumSize(QtCore.QSize(300, 16777215)) self.label_26.setObjectName("label_26") self.gridLayout_10.addWidget(self.label_26, 6, 0, 1, 1) self.label_22 = QtWidgets.QLabel(self.tab_3) self.label_22.setMaximumSize(QtCore.QSize(300, 16777215)) self.label_22.setObjectName("label_22") self.gridLayout_10.addWidget(self.label_22, 2, 0, 1, 1) self.last_buy_price_trader = QtWidgets.QLineEdit(self.tab_3) self.last_buy_price_trader.setMaximumSize(QtCore.QSize(70, 16777215)) self.last_buy_price_trader.setObjectName("last_buy_price_trader") self.gridLayout_10.addWidget(self.last_buy_price_trader, 4, 1, 1, 1) self.EP_gradient_threshold_trader = QtWidgets.QLineEdit(self.tab_3) self.EP_gradient_threshold_trader.setMaximumSize( QtCore.QSize(70, 16777215)) self.EP_gradient_threshold_trader.setObjectName( "EP_gradient_threshold_trader") self.gridLayout_10.addWidget(self.EP_gradient_threshold_trader, 7, 1, 1, 1) self.label_23 = QtWidgets.QLabel(self.tab_3) self.label_23.setMaximumSize(QtCore.QSize(300, 16777215)) self.label_23.setObjectName("label_23") self.gridLayout_10.addWidget(self.label_23, 3, 0, 1, 1) self.label_21 = QtWidgets.QLabel(self.tab_3) self.label_21.setObjectName("label_21") self.gridLayout_10.addWidget(self.label_21, 0, 0, 1, 2) self.wallet_parts_trader = QtWidgets.QLineEdit(self.tab_3) self.wallet_parts_trader.setMaximumSize(QtCore.QSize(70, 16777215)) self.wallet_parts_trader.setObjectName("wallet_parts_trader") self.gridLayout_10.addWidget(self.wallet_parts_trader, 3, 1, 1, 1) self.label_27 = QtWidgets.QLabel(self.tab_3) self.label_27.setMaximumSize(QtCore.QSize(300, 16777215)) self.label_27.setObjectName("label_27") self.gridLayout_10.addWidget(self.label_27, 7, 0, 1, 1) self.timeframe_trader = QtWidgets.QComboBox(self.tab_3) self.timeframe_trader.setMaximumSize(QtCore.QSize(100, 16777215)) self.timeframe_trader.setObjectName("timeframe_trader") self.gridLayout_10.addWidget(self.timeframe_trader, 1, 1, 1, 1) self.label_18 = QtWidgets.QLabel(self.tab_3) self.label_18.setObjectName("label_18") self.gridLayout_10.addWidget(self.label_18, 1, 0, 1, 1) self.verticalLayout_2.addLayout(self.gridLayout_10) self.horizontalLayout_6.addLayout(self.verticalLayout_2) self.horizontalLayout_7.addLayout(self.horizontalLayout_6) self.tabWidget.addTab(self.tab_3, "") self.tab_4 = QtWidgets.QWidget() self.tab_4.setObjectName("tab_4") self.horizontalLayout_9 = QtWidgets.QHBoxLayout(self.tab_4) self.horizontalLayout_9.setObjectName("horizontalLayout_9") self.horizontalLayout_8 = QtWidgets.QHBoxLayout() self.horizontalLayout_8.setObjectName("horizontalLayout_8") self.verticalLayout_4 = QtWidgets.QVBoxLayout() self.verticalLayout_4.setObjectName("verticalLayout_4") self.collector_log = QtWidgets.QTextEdit(self.tab_4) self.collector_log.setObjectName("collector_log") self.verticalLayout_4.addWidget(self.collector_log) self.horizontalLayout_8.addLayout(self.verticalLayout_4) self.verticalLayout_5 = QtWidgets.QVBoxLayout() self.verticalLayout_5.setObjectName("verticalLayout_5") self.gridLayout_11 = QtWidgets.QGridLayout() self.gridLayout_11.setObjectName("gridLayout_11") self.collector_stop_button = QtWidgets.QPushButton(self.tab_4) self.collector_stop_button.setMaximumSize(QtCore.QSize(100, 16777215)) self.collector_stop_button.setObjectName("collector_stop_button") self.gridLayout_11.addWidget(self.collector_stop_button, 1, 1, 1, 1) self.collector_pair_timeframe = QtWidgets.QLineEdit(self.tab_4) self.collector_pair_timeframe.setMaximumSize( QtCore.QSize(100, 16777215)) self.collector_pair_timeframe.setObjectName("collector_pair_timeframe") self.gridLayout_11.addWidget(self.collector_pair_timeframe, 4, 1, 1, 1) self.label_32 = QtWidgets.QLabel(self.tab_4) self.label_32.setObjectName("label_32") self.gridLayout_11.addWidget(self.label_32, 4, 0, 1, 1) self.pair_remove_from_collect_button = QtWidgets.QPushButton( self.tab_4) self.pair_remove_from_collect_button.setObjectName( "pair_remove_from_collect_button") self.gridLayout_11.addWidget(self.pair_remove_from_collect_button, 5, 1, 1, 1) self.candles_clear_button = QtWidgets.QPushButton(self.tab_4) self.candles_clear_button.setObjectName("candles_clear_button") self.gridLayout_11.addWidget(self.candles_clear_button, 7, 0, 1, 1) self.label_33 = QtWidgets.QLabel(self.tab_4) self.label_33.setObjectName("label_33") self.gridLayout_11.addWidget(self.label_33, 6, 0, 1, 1) self.candles_clear_all_button = QtWidgets.QPushButton(self.tab_4) self.candles_clear_all_button.setObjectName("candles_clear_all_button") self.gridLayout_11.addWidget(self.candles_clear_all_button, 7, 1, 1, 1) self.pair_add_to_collect_button = QtWidgets.QPushButton(self.tab_4) self.pair_add_to_collect_button.setObjectName( "pair_add_to_collect_button") self.gridLayout_11.addWidget(self.pair_add_to_collect_button, 5, 0, 1, 1) self.pair_get_all_button = QtWidgets.QPushButton(self.tab_4) self.pair_get_all_button.setObjectName("pair_get_all_button") self.gridLayout_11.addWidget(self.pair_get_all_button, 5, 2, 1, 1) self.label_19 = QtWidgets.QLabel(self.tab_4) self.label_19.setObjectName("label_19") self.gridLayout_11.addWidget(self.label_19, 0, 0, 1, 1) self.collector_start_button = QtWidgets.QPushButton(self.tab_4) self.collector_start_button.setMaximumSize(QtCore.QSize(100, 16777215)) self.collector_start_button.setObjectName("collector_start_button") self.gridLayout_11.addWidget(self.collector_start_button, 1, 0, 1, 1) self.collector_status_button = QtWidgets.QPushButton(self.tab_4) self.collector_status_button.setMaximumSize(QtCore.QSize( 100, 16777215)) self.collector_status_button.setObjectName("collector_status_button") self.gridLayout_11.addWidget(self.collector_status_button, 1, 2, 1, 1) self.candles_info_button = QtWidgets.QPushButton(self.tab_4) self.candles_info_button.setObjectName("candles_info_button") self.gridLayout_11.addWidget(self.candles_info_button, 7, 2, 1, 1) self.trades_history_tree = QtWidgets.QTreeWidget(self.tab_4) self.trades_history_tree.setAlternatingRowColors(True) self.trades_history_tree.setSelectionMode( QtWidgets.QAbstractItemView.MultiSelection) self.trades_history_tree.setHorizontalScrollMode( QtWidgets.QAbstractItemView.ScrollPerItem) self.trades_history_tree.setColumnCount(0) self.trades_history_tree.setObjectName("trades_history_tree") self.gridLayout_11.addWidget(self.trades_history_tree, 3, 0, 1, 3) self.label_34 = QtWidgets.QLabel(self.tab_4) self.label_34.setObjectName("label_34") self.gridLayout_11.addWidget(self.label_34, 2, 0, 1, 1) self.verticalLayout_5.addLayout(self.gridLayout_11) self.horizontalLayout_8.addLayout(self.verticalLayout_5) self.horizontalLayout_9.addLayout(self.horizontalLayout_8) self.tabWidget.addTab(self.tab_4, "") self.horizontalLayout.addWidget(self.tabWidget) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 1069, 22)) self.menubar.setObjectName("menubar") MainWindow.setMenuBar(self.menubar) self.statusbar = QtWidgets.QStatusBar(MainWindow) self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar) self.retranslateUi(MainWindow) self.tabWidget.setCurrentIndex(0) QtCore.QMetaObject.connectSlotsByName(MainWindow) def retranslateUi(self, MainWindow): _translate = QtCore.QCoreApplication.translate MainWindow.setWindowTitle(_translate("MainWindow", "Crypto Trader")) self.label_3.setText(_translate("MainWindow", "End:")) self.label_2.setText(_translate("MainWindow", "Begin:")) self.range_begin_dt.setDisplayFormat( _translate("MainWindow", "dd/M/yy HH:mm")) self.range_end_dt.setDisplayFormat( _translate("MainWindow", "dd/M/yy HH:mm")) self.clear_main_plot_button.setText(_translate("MainWindow", "Clear")) self.show_real_button.setText(_translate("MainWindow", "Show real")) self.label_6.setText(_translate("MainWindow", "Wallet parts:")) self.label.setText(_translate("MainWindow", "Pair:")) self.label_4.setText(_translate("MainWindow", "Timeframe:")) self.label_11.setText(_translate("MainWindow", "Trades (start date):")) self.label_5.setText(_translate("MainWindow", "Timeperiod:")) self.ts_analysis_button.setText( _translate("MainWindow", "Statistical analysis")) self.wallet_BTC_init_test.setText(_translate("MainWindow", "0.0")) self.wallet_USD_init_test.setText(_translate("MainWindow", "200.0")) self.test_strategy_button.setText( _translate("MainWindow", "Test strategy")) self.label_8.setText(_translate("MainWindow", "Last SELL price:")) self.label_9.setText(_translate("MainWindow", "BTC wallet balance:")) self.investigate_button.setText(_translate("MainWindow", "Auto test")) self.label_10.setText(_translate("MainWindow", "USD wallet balance:")) self.fetch_data_button.setText( _translate("MainWindow", "Update init data")) self.get_existing_real_trades_button.setText( _translate("MainWindow", "Fetch real trades data")) self.label_7.setText(_translate("MainWindow", "Last BUY price:")) self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _translate("MainWindow", "Strategy test")) self.label_info.setText(_translate("MainWindow", "INFO PIC")) self.forse_commit_sell_buy_status_distace_test.setText( _translate("MainWindow", "#60*24*2")) self.EP_gradient_threshold_test.setText(_translate("MainWindow", "0")) self.label_17.setText( _translate( "MainWindow", "Force Order Interval (FOI). \n" "Force commit \'sell<->buy\' order distace (minutes): \n" "(# - Ignore)")) self.LPP_count_test.setText(_translate("MainWindow", "1")) self.buy_threshold_test.setText(_translate("MainWindow", "1.5")) self.sell_threshold_test.setText(_translate("MainWindow", "1.5")) self.independent_last_sell_buy_price_checking_test.setText( _translate("MainWindow", "Independent last sell/buy price checking")) self.LPP_gradients_threshold_test.setText(_translate( "MainWindow", "0")) self.label_15.setText( _translate("MainWindow", "(MSP) Min BUY profit per order besides fee (%):")) self.label_13.setText( _translate("MainWindow", "EP gradient threshold:")) self.label_12.setText(_translate("MainWindow", "Count of LPP:")) self.label_14.setText( _translate("MainWindow", "LPP gradients threshold:")) self.draw_candles.setText(_translate("MainWindow", "Draw candles")) self.label_16.setText( _translate("MainWindow", "(MBP) Min SELL profit per order besides fee (%):")) self.tabWidget.setTabText( self.tabWidget.indexOf(self.tab_2), _translate("MainWindow", "Strategy test - settings")) self.trader_status_button.setText(_translate("MainWindow", "Full log")) self.label_20.setText(_translate("MainWindow", "Trader:")) self.trader_start_button.setText(_translate("MainWindow", "Start")) self.trader_stop_button.setText(_translate("MainWindow", "Stop")) self.fetch_available_balance_button.setText( _translate("MainWindow", "Get Balance")) self.trader_status_short_button.setText( _translate("MainWindow", "Summary")) self.forse_commit_sell_buy_status_distace_trader.setText( _translate("MainWindow", "#60*24*2")) self.label_30.setText( _translate("MainWindow", "(MSP) Min SELL profit per order besides fee (%):")) self.label_28.setText( _translate("MainWindow", "(MSP) Min BUY profit per order besides fee (%):")) self.label_25.setText(_translate("MainWindow", "Last SELL price:")) self.sell_threshold_trader.setText(_translate("MainWindow", "1.5")) self.label_31.setText( _translate( "MainWindow", "Force Order Interval (FOI). \n" "Force commit \'sell<->buy\' order distace (minutes): \n" "(# - Ignore)")) self.label_29.setText( _translate("MainWindow", "LPP gradients threshold:")) self.LPP_gradients_threshold_trader.setText( _translate("MainWindow", "0")) self.timeperiod_trader.setText(_translate("MainWindow", "9")) self.independent_last_sell_buy_price_checking_trader.setText( _translate("MainWindow", "Independent last sell/buy price checking")) self.label_24.setText(_translate("MainWindow", "Last BUY price:")) self.LPP_count_trader.setText(_translate("MainWindow", "1")) self.buy_threshold_trader.setText(_translate("MainWindow", "1.5")) self.last_sell_price_trader.setText(_translate("MainWindow", "inherit")) self.label_26.setText(_translate("MainWindow", "Count of LPP:")) self.label_22.setText(_translate("MainWindow", "Timeperiod:")) self.last_buy_price_trader.setText(_translate("MainWindow", "inherit")) self.EP_gradient_threshold_trader.setText(_translate( "MainWindow", "0")) self.label_23.setText(_translate("MainWindow", "Wallet parts:")) self.label_21.setText( _translate("MainWindow", "Trader settings (for start):")) self.wallet_parts_trader.setText(_translate("MainWindow", "2")) self.label_27.setText( _translate("MainWindow", "EP gradient threshold:")) self.label_18.setText(_translate("MainWindow", "Timeframe:")) self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), _translate("MainWindow", "Backend - Trader")) self.collector_stop_button.setText(_translate("MainWindow", "Stop")) self.collector_pair_timeframe.setPlaceholderText( _translate("MainWindow", "XMRUSD::1m")) self.label_32.setText(_translate("MainWindow", "Pair:")) self.pair_remove_from_collect_button.setText( _translate("MainWindow", "Remove from collect")) self.candles_clear_button.setText(_translate("MainWindow", "Clear")) self.label_33.setText(_translate("MainWindow", "Candles:")) self.candles_clear_all_button.setText( _translate("MainWindow", "Clear ALL")) self.pair_add_to_collect_button.setText( _translate("MainWindow", "Add to collect")) self.pair_get_all_button.setText(_translate("MainWindow", "Get ALL")) self.label_19.setText(_translate("MainWindow", "Collector:")) self.collector_start_button.setText(_translate("MainWindow", "Start")) self.collector_status_button.setText(_translate( "MainWindow", "Status")) self.candles_info_button.setText(_translate("MainWindow", "Info")) self.label_34.setText(_translate("MainWindow", "Trades history:")) self.tabWidget.setTabText( self.tabWidget.indexOf(self.tab_4), _translate("MainWindow", "Backend - Collector"))
class Ui_Dialog(object): def setupUi(self, Dialog): Dialog.setObjectName(_fromUtf8("Dialog")) Dialog.resize(731, 593) self.StartButton = QtGui.QPushButton(Dialog) self.StartButton.setGeometry(QtCore.QRect(20, 30, 93, 28)) self.StartButton.setObjectName(_fromUtf8("StartButton")) self.StopButton = QtGui.QPushButton(Dialog) self.StopButton.setGeometry(QtCore.QRect(140, 30, 93, 28)) self.StopButton.setObjectName(_fromUtf8("StopButton")) self.groupBox = QtGui.QGroupBox(Dialog) self.groupBox.setGeometry(QtCore.QRect(20, 110, 211, 61)) self.groupBox.setObjectName(_fromUtf8("groupBox")) self.DisInWaveradioButton = QtGui.QRadioButton(self.groupBox) self.DisInWaveradioButton.setGeometry(QtCore.QRect(10, 30, 115, 19)) self.DisInWaveradioButton.setChecked(True) self.DisInWaveradioButton.setObjectName( _fromUtf8("DisInWaveradioButton")) self.DisInValueradioButton = QtGui.QRadioButton(self.groupBox) self.DisInValueradioButton.setGeometry(QtCore.QRect(90, 30, 115, 19)) self.DisInValueradioButton.setObjectName( _fromUtf8("DisInValueradioButton")) self.DTRcheckBox = QtGui.QCheckBox(Dialog) self.DTRcheckBox.setGeometry(QtCore.QRect(150, 530, 51, 19)) self.DTRcheckBox.setObjectName(_fromUtf8("DTRcheckBox")) self.RTScheckBox = QtGui.QCheckBox(Dialog) self.RTScheckBox.setGeometry(QtCore.QRect(40, 530, 51, 19)) self.RTScheckBox.setObjectName(_fromUtf8("RTScheckBox")) self.TransmittextEdit = QtGui.QTextEdit(Dialog) self.TransmittextEdit.setGeometry(QtCore.QRect(260, 430, 451, 81)) self.TransmittextEdit.setObjectName(_fromUtf8("TransmittextEdit")) self.ClearReceiveBufpushButton = QtGui.QPushButton(Dialog) self.ClearReceiveBufpushButton.setGeometry( QtCore.QRect(290, 380, 93, 28)) self.ClearReceiveBufpushButton.setObjectName( _fromUtf8("ClearReceiveBufpushButton")) self.SaveReceiveBufpushButton = QtGui.QPushButton(Dialog) self.SaveReceiveBufpushButton.setGeometry( QtCore.QRect(420, 380, 93, 28)) self.SaveReceiveBufpushButton.setObjectName( _fromUtf8("SaveReceiveBufpushButton")) self.ClearTransmitBufpushButton = QtGui.QPushButton(Dialog) self.ClearTransmitBufpushButton.setGeometry( QtCore.QRect(290, 520, 93, 28)) self.ClearTransmitBufpushButton.setObjectName( _fromUtf8("ClearTransmitBufpushButton")) self.SendTransmitBufpushButton = QtGui.QPushButton(Dialog) self.SendTransmitBufpushButton.setGeometry( QtCore.QRect(420, 520, 93, 28)) self.SendTransmitBufpushButton.setObjectName( _fromUtf8("SendTransmitBufpushButton")) self.groupBox_2 = QtGui.QGroupBox(Dialog) self.groupBox_2.setGeometry(QtCore.QRect(530, 380, 161, 31)) self.groupBox_2.setTitle(_fromUtf8("")) self.groupBox_2.setObjectName(_fromUtf8("groupBox_2")) self.ReceiveDisInHEXradioButton = QtGui.QRadioButton(self.groupBox_2) self.ReceiveDisInHEXradioButton.setGeometry( QtCore.QRect(20, 10, 51, 19)) self.ReceiveDisInHEXradioButton.setChecked(False) self.ReceiveDisInHEXradioButton.setObjectName( _fromUtf8("ReceiveDisInHEXradioButton")) self.ReceiveDisInCHARradioButton = QtGui.QRadioButton(self.groupBox_2) self.ReceiveDisInCHARradioButton.setGeometry( QtCore.QRect(100, 10, 61, 19)) self.ReceiveDisInCHARradioButton.setChecked(True) self.ReceiveDisInCHARradioButton.setObjectName( _fromUtf8("ReceiveDisInCHARradioButton")) self.groupBox_3 = QtGui.QGroupBox(Dialog) self.groupBox_3.setGeometry(QtCore.QRect(540, 520, 161, 31)) self.groupBox_3.setTitle(_fromUtf8("")) self.groupBox_3.setObjectName(_fromUtf8("groupBox_3")) self.TransmitDisInHEXradioButtonradioButton = QtGui.QRadioButton( self.groupBox_3) self.TransmitDisInHEXradioButtonradioButton.setGeometry( QtCore.QRect(20, 10, 51, 19)) self.TransmitDisInHEXradioButtonradioButton.setObjectName( _fromUtf8("TransmitDisInHEXradioButtonradioButton")) self.TransmitDisInCHARradioButtonradioButton = QtGui.QRadioButton( self.groupBox_3) self.TransmitDisInCHARradioButtonradioButton.setGeometry( QtCore.QRect(100, 10, 61, 19)) self.TransmitDisInCHARradioButtonradioButton.setChecked(True) self.TransmitDisInCHARradioButtonradioButton.setObjectName( _fromUtf8("TransmitDisInCHARradioButtonradioButton")) self.stackedWidget = QtGui.QStackedWidget(Dialog) self.stackedWidget.setGeometry(QtCore.QRect(260, 20, 451, 361)) self.stackedWidget.setObjectName(_fromUtf8("stackedWidget")) self.page = QtGui.QWidget() self.page.setObjectName(_fromUtf8("page")) self.ReceiveBuftextBrowser = QtGui.QTextBrowser(self.page) self.ReceiveBuftextBrowser.setGeometry(QtCore.QRect(0, 20, 451, 331)) self.ReceiveBuftextBrowser.setObjectName( _fromUtf8("ReceiveBuftextBrowser")) self.ReceiveZoneLabel = QtGui.QLabel(self.page) self.ReceiveZoneLabel.setGeometry(QtCore.QRect(0, 0, 81, 16)) self.ReceiveZoneLabel.setObjectName(_fromUtf8("ReceiveZoneLabel")) self.stackedWidget.addWidget(self.page) self.page_2 = QtGui.QWidget() self.page_2.setObjectName(_fromUtf8("page_2")) self.layoutWidget = QtGui.QWidget(self.page_2) self.layoutWidget.setGeometry(QtCore.QRect(0, 0, 451, 351)) self.layoutWidget.setObjectName(_fromUtf8("layoutWidget")) self.verticalLayout_3 = QtGui.QVBoxLayout(self.layoutWidget) self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3")) self.label = QtGui.QLabel(self.layoutWidget) self.label.setObjectName(_fromUtf8("label")) self.verticalLayout_3.addWidget(self.label) self.WavegraphicsView = GraphicsWindow() self.WavegraphicsView.setObjectName(_fromUtf8("WavegraphicsView")) self.verticalLayout_3.addWidget(self.WavegraphicsView) self.stackedWidget.addWidget(self.page_2) self.layoutWidget1 = QtGui.QWidget(Dialog) self.layoutWidget1.setGeometry(QtCore.QRect(21, 201, 71, 301)) self.layoutWidget1.setObjectName(_fromUtf8("layoutWidget1")) self.verticalLayout = QtGui.QVBoxLayout(self.layoutWidget1) self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.OnOfflabel = QtGui.QLabel(self.layoutWidget1) self.OnOfflabel.setObjectName(_fromUtf8("OnOfflabel")) self.verticalLayout.addWidget(self.OnOfflabel) self.SerialPortlabel = QtGui.QLabel(self.layoutWidget1) self.SerialPortlabel.setObjectName(_fromUtf8("SerialPortlabel")) self.verticalLayout.addWidget(self.SerialPortlabel) self.Baudratelabel = QtGui.QLabel(self.layoutWidget1) self.Baudratelabel.setObjectName(_fromUtf8("Baudratelabel")) self.verticalLayout.addWidget(self.Baudratelabel) self.Databitslabel = QtGui.QLabel(self.layoutWidget1) self.Databitslabel.setObjectName(_fromUtf8("Databitslabel")) self.verticalLayout.addWidget(self.Databitslabel) self.Stopbitslabel = QtGui.QLabel(self.layoutWidget1) self.Stopbitslabel.setObjectName(_fromUtf8("Stopbitslabel")) self.verticalLayout.addWidget(self.Stopbitslabel) self.Paritybitlabel = QtGui.QLabel(self.layoutWidget1) self.Paritybitlabel.setObjectName(_fromUtf8("Paritybitlabel")) self.verticalLayout.addWidget(self.Paritybitlabel) self.TransmitzoneLabel = QtGui.QLabel(Dialog) self.TransmitzoneLabel.setGeometry(QtCore.QRect(260, 410, 72, 15)) self.TransmitzoneLabel.setObjectName(_fromUtf8("TransmitzoneLabel")) self.layoutWidget2 = QtGui.QWidget(Dialog) self.layoutWidget2.setGeometry(QtCore.QRect(100, 180, 121, 331)) self.layoutWidget2.setObjectName(_fromUtf8("layoutWidget2")) self.gridLayout = QtGui.QGridLayout(self.layoutWidget2) self.gridLayout.setObjectName(_fromUtf8("gridLayout")) self.BaudratecomboBox = QtGui.QComboBox(self.layoutWidget2) self.BaudratecomboBox.setObjectName(_fromUtf8("BaudratecomboBox")) self.BaudratecomboBox.addItem(_fromUtf8("")) self.BaudratecomboBox.addItem(_fromUtf8("")) self.BaudratecomboBox.addItem(_fromUtf8("")) self.BaudratecomboBox.addItem(_fromUtf8("")) self.gridLayout.addWidget(self.BaudratecomboBox, 2, 0, 1, 1) self.DatabitscomboBox = QtGui.QComboBox(self.layoutWidget2) self.DatabitscomboBox.setObjectName(_fromUtf8("DatabitscomboBox")) self.DatabitscomboBox.addItem(_fromUtf8("")) self.DatabitscomboBox.addItem(_fromUtf8("")) self.DatabitscomboBox.addItem(_fromUtf8("")) self.DatabitscomboBox.addItem(_fromUtf8("")) self.gridLayout.addWidget(self.DatabitscomboBox, 3, 0, 1, 1) self.ParitybitcomboBox = QtGui.QComboBox(self.layoutWidget2) self.ParitybitcomboBox.setObjectName(_fromUtf8("ParitybitcomboBox")) self.ParitybitcomboBox.addItem(_fromUtf8("")) self.ParitybitcomboBox.addItem(_fromUtf8("")) self.ParitybitcomboBox.addItem(_fromUtf8("")) self.ParitybitcomboBox.addItem(_fromUtf8("")) self.ParitybitcomboBox.addItem(_fromUtf8("")) self.gridLayout.addWidget(self.ParitybitcomboBox, 5, 0, 1, 1) self.OnOffButton = QtGui.QPushButton(self.layoutWidget2) self.OnOffButton.setObjectName(_fromUtf8("OnOffButton")) self.gridLayout.addWidget(self.OnOffButton, 0, 0, 1, 1) self.SerialPortcomboBox = CustomComboBox(self.layoutWidget2) self.SerialPortcomboBox.setObjectName(_fromUtf8("SerialPortcomboBox")) self.gridLayout.addWidget(self.SerialPortcomboBox, 1, 0, 1, 1) self.StopbitscomboBox = QtGui.QComboBox(self.layoutWidget2) self.StopbitscomboBox.setObjectName(_fromUtf8("StopbitscomboBox")) self.StopbitscomboBox.addItem(_fromUtf8("")) self.StopbitscomboBox.addItem(_fromUtf8("")) self.StopbitscomboBox.addItem(_fromUtf8("")) self.gridLayout.addWidget(self.StopbitscomboBox, 4, 0, 1, 1) self.PlayButton = QtGui.QPushButton(Dialog) self.PlayButton.setGeometry(QtCore.QRect(78, 70, 93, 28)) self.PlayButton.setObjectName(_fromUtf8("PlayButton")) self.retranslateUi(Dialog) self.stackedWidget.setCurrentIndex(1) QtCore.QMetaObject.connectSlotsByName(Dialog) def retranslateUi(self, Dialog): Dialog.setWindowTitle(_translate("Dialog", "Dialog", None)) self.StartButton.setText(_translate("Dialog", "Start", None)) self.StopButton.setText(_translate("Dialog", "Stop", None)) self.groupBox.setTitle(_translate("Dialog", "数据显示方式", None)) self.DisInWaveradioButton.setText(_translate("Dialog", "wave", None)) self.DisInValueradioButton.setText(_translate("Dialog", "value", None)) self.DTRcheckBox.setText(_translate("Dialog", "DTR", None)) self.RTScheckBox.setText(_translate("Dialog", "RTS", None)) self.ClearReceiveBufpushButton.setText(_translate( "Dialog", "清除", None)) self.SaveReceiveBufpushButton.setText(_translate("Dialog", "保存", None)) self.ClearTransmitBufpushButton.setText( _translate("Dialog", "清除", None)) self.SendTransmitBufpushButton.setText(_translate( "Dialog", "发送", None)) self.ReceiveDisInHEXradioButton.setText( _translate("Dialog", "HEX", None)) self.ReceiveDisInCHARradioButton.setText( _translate("Dialog", "CHAR", None)) self.TransmitDisInHEXradioButtonradioButton.setText( _translate("Dialog", "HEX", None)) self.TransmitDisInCHARradioButtonradioButton.setText( _translate("Dialog", "CHAR", None)) self.ReceiveZoneLabel.setText(_translate("Dialog", "接收数据值", None)) self.label.setText(_translate("Dialog", "接收数据波形", None)) self.OnOfflabel.setText(_translate("Dialog", "开/关", None)) self.SerialPortlabel.setText(_translate("Dialog", "串口号", None)) self.Baudratelabel.setText(_translate("Dialog", "波特率", None)) self.Databitslabel.setText(_translate("Dialog", "数据位", None)) self.Stopbitslabel.setText(_translate("Dialog", "停止位", None)) self.Paritybitlabel.setText(_translate("Dialog", "校验位", None)) self.TransmitzoneLabel.setText(_translate("Dialog", "发送区", None)) self.BaudratecomboBox.setItemText(0, _translate("Dialog", "115200", None)) self.BaudratecomboBox.setItemText(1, _translate("Dialog", "57600", None)) self.BaudratecomboBox.setItemText(2, _translate("Dialog", "19200", None)) self.BaudratecomboBox.setItemText(3, _translate("Dialog", "9600", None)) self.DatabitscomboBox.setItemText(0, _translate("Dialog", "8", None)) self.DatabitscomboBox.setItemText(1, _translate("Dialog", "7", None)) self.DatabitscomboBox.setItemText(2, _translate("Dialog", "6", None)) self.DatabitscomboBox.setItemText(3, _translate("Dialog", "5", None)) self.ParitybitcomboBox.setItemText(0, _translate("Dialog", "None", None)) self.ParitybitcomboBox.setItemText(1, _translate("Dialog", "Even", None)) self.ParitybitcomboBox.setItemText(2, _translate("Dialog", "Odd", None)) self.ParitybitcomboBox.setItemText(3, _translate("Dialog", "Mark", None)) self.ParitybitcomboBox.setItemText(4, _translate("Dialog", "Space", None)) self.OnOffButton.setText(_translate("Dialog", "Open", None)) self.StopbitscomboBox.setItemText(0, _translate("Dialog", "1", None)) self.StopbitscomboBox.setItemText(1, _translate("Dialog", "1.5", None)) self.StopbitscomboBox.setItemText(2, _translate("Dialog", "2", None)) self.PlayButton.setText(_translate("Dialog", "Play", None))
def setupUi(self, Dialog): Dialog.setObjectName(_fromUtf8("Dialog")) Dialog.resize(731, 593) self.StartButton = QtGui.QPushButton(Dialog) self.StartButton.setGeometry(QtCore.QRect(20, 30, 93, 28)) self.StartButton.setObjectName(_fromUtf8("StartButton")) self.StopButton = QtGui.QPushButton(Dialog) self.StopButton.setGeometry(QtCore.QRect(140, 30, 93, 28)) self.StopButton.setObjectName(_fromUtf8("StopButton")) self.groupBox = QtGui.QGroupBox(Dialog) self.groupBox.setGeometry(QtCore.QRect(20, 110, 211, 61)) self.groupBox.setObjectName(_fromUtf8("groupBox")) self.DisInWaveradioButton = QtGui.QRadioButton(self.groupBox) self.DisInWaveradioButton.setGeometry(QtCore.QRect(10, 30, 115, 19)) self.DisInWaveradioButton.setChecked(True) self.DisInWaveradioButton.setObjectName( _fromUtf8("DisInWaveradioButton")) self.DisInValueradioButton = QtGui.QRadioButton(self.groupBox) self.DisInValueradioButton.setGeometry(QtCore.QRect(90, 30, 115, 19)) self.DisInValueradioButton.setObjectName( _fromUtf8("DisInValueradioButton")) self.DTRcheckBox = QtGui.QCheckBox(Dialog) self.DTRcheckBox.setGeometry(QtCore.QRect(150, 530, 51, 19)) self.DTRcheckBox.setObjectName(_fromUtf8("DTRcheckBox")) self.RTScheckBox = QtGui.QCheckBox(Dialog) self.RTScheckBox.setGeometry(QtCore.QRect(40, 530, 51, 19)) self.RTScheckBox.setObjectName(_fromUtf8("RTScheckBox")) self.TransmittextEdit = QtGui.QTextEdit(Dialog) self.TransmittextEdit.setGeometry(QtCore.QRect(260, 430, 451, 81)) self.TransmittextEdit.setObjectName(_fromUtf8("TransmittextEdit")) self.ClearReceiveBufpushButton = QtGui.QPushButton(Dialog) self.ClearReceiveBufpushButton.setGeometry( QtCore.QRect(290, 380, 93, 28)) self.ClearReceiveBufpushButton.setObjectName( _fromUtf8("ClearReceiveBufpushButton")) self.SaveReceiveBufpushButton = QtGui.QPushButton(Dialog) self.SaveReceiveBufpushButton.setGeometry( QtCore.QRect(420, 380, 93, 28)) self.SaveReceiveBufpushButton.setObjectName( _fromUtf8("SaveReceiveBufpushButton")) self.ClearTransmitBufpushButton = QtGui.QPushButton(Dialog) self.ClearTransmitBufpushButton.setGeometry( QtCore.QRect(290, 520, 93, 28)) self.ClearTransmitBufpushButton.setObjectName( _fromUtf8("ClearTransmitBufpushButton")) self.SendTransmitBufpushButton = QtGui.QPushButton(Dialog) self.SendTransmitBufpushButton.setGeometry( QtCore.QRect(420, 520, 93, 28)) self.SendTransmitBufpushButton.setObjectName( _fromUtf8("SendTransmitBufpushButton")) self.groupBox_2 = QtGui.QGroupBox(Dialog) self.groupBox_2.setGeometry(QtCore.QRect(530, 380, 161, 31)) self.groupBox_2.setTitle(_fromUtf8("")) self.groupBox_2.setObjectName(_fromUtf8("groupBox_2")) self.ReceiveDisInHEXradioButton = QtGui.QRadioButton(self.groupBox_2) self.ReceiveDisInHEXradioButton.setGeometry( QtCore.QRect(20, 10, 51, 19)) self.ReceiveDisInHEXradioButton.setChecked(False) self.ReceiveDisInHEXradioButton.setObjectName( _fromUtf8("ReceiveDisInHEXradioButton")) self.ReceiveDisInCHARradioButton = QtGui.QRadioButton(self.groupBox_2) self.ReceiveDisInCHARradioButton.setGeometry( QtCore.QRect(100, 10, 61, 19)) self.ReceiveDisInCHARradioButton.setChecked(True) self.ReceiveDisInCHARradioButton.setObjectName( _fromUtf8("ReceiveDisInCHARradioButton")) self.groupBox_3 = QtGui.QGroupBox(Dialog) self.groupBox_3.setGeometry(QtCore.QRect(540, 520, 161, 31)) self.groupBox_3.setTitle(_fromUtf8("")) self.groupBox_3.setObjectName(_fromUtf8("groupBox_3")) self.TransmitDisInHEXradioButtonradioButton = QtGui.QRadioButton( self.groupBox_3) self.TransmitDisInHEXradioButtonradioButton.setGeometry( QtCore.QRect(20, 10, 51, 19)) self.TransmitDisInHEXradioButtonradioButton.setObjectName( _fromUtf8("TransmitDisInHEXradioButtonradioButton")) self.TransmitDisInCHARradioButtonradioButton = QtGui.QRadioButton( self.groupBox_3) self.TransmitDisInCHARradioButtonradioButton.setGeometry( QtCore.QRect(100, 10, 61, 19)) self.TransmitDisInCHARradioButtonradioButton.setChecked(True) self.TransmitDisInCHARradioButtonradioButton.setObjectName( _fromUtf8("TransmitDisInCHARradioButtonradioButton")) self.stackedWidget = QtGui.QStackedWidget(Dialog) self.stackedWidget.setGeometry(QtCore.QRect(260, 20, 451, 361)) self.stackedWidget.setObjectName(_fromUtf8("stackedWidget")) self.page = QtGui.QWidget() self.page.setObjectName(_fromUtf8("page")) self.ReceiveBuftextBrowser = QtGui.QTextBrowser(self.page) self.ReceiveBuftextBrowser.setGeometry(QtCore.QRect(0, 20, 451, 331)) self.ReceiveBuftextBrowser.setObjectName( _fromUtf8("ReceiveBuftextBrowser")) self.ReceiveZoneLabel = QtGui.QLabel(self.page) self.ReceiveZoneLabel.setGeometry(QtCore.QRect(0, 0, 81, 16)) self.ReceiveZoneLabel.setObjectName(_fromUtf8("ReceiveZoneLabel")) self.stackedWidget.addWidget(self.page) self.page_2 = QtGui.QWidget() self.page_2.setObjectName(_fromUtf8("page_2")) self.layoutWidget = QtGui.QWidget(self.page_2) self.layoutWidget.setGeometry(QtCore.QRect(0, 0, 451, 351)) self.layoutWidget.setObjectName(_fromUtf8("layoutWidget")) self.verticalLayout_3 = QtGui.QVBoxLayout(self.layoutWidget) self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3")) self.label = QtGui.QLabel(self.layoutWidget) self.label.setObjectName(_fromUtf8("label")) self.verticalLayout_3.addWidget(self.label) self.WavegraphicsView = GraphicsWindow() self.WavegraphicsView.setObjectName(_fromUtf8("WavegraphicsView")) self.verticalLayout_3.addWidget(self.WavegraphicsView) self.stackedWidget.addWidget(self.page_2) self.layoutWidget1 = QtGui.QWidget(Dialog) self.layoutWidget1.setGeometry(QtCore.QRect(21, 201, 71, 301)) self.layoutWidget1.setObjectName(_fromUtf8("layoutWidget1")) self.verticalLayout = QtGui.QVBoxLayout(self.layoutWidget1) self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.OnOfflabel = QtGui.QLabel(self.layoutWidget1) self.OnOfflabel.setObjectName(_fromUtf8("OnOfflabel")) self.verticalLayout.addWidget(self.OnOfflabel) self.SerialPortlabel = QtGui.QLabel(self.layoutWidget1) self.SerialPortlabel.setObjectName(_fromUtf8("SerialPortlabel")) self.verticalLayout.addWidget(self.SerialPortlabel) self.Baudratelabel = QtGui.QLabel(self.layoutWidget1) self.Baudratelabel.setObjectName(_fromUtf8("Baudratelabel")) self.verticalLayout.addWidget(self.Baudratelabel) self.Databitslabel = QtGui.QLabel(self.layoutWidget1) self.Databitslabel.setObjectName(_fromUtf8("Databitslabel")) self.verticalLayout.addWidget(self.Databitslabel) self.Stopbitslabel = QtGui.QLabel(self.layoutWidget1) self.Stopbitslabel.setObjectName(_fromUtf8("Stopbitslabel")) self.verticalLayout.addWidget(self.Stopbitslabel) self.Paritybitlabel = QtGui.QLabel(self.layoutWidget1) self.Paritybitlabel.setObjectName(_fromUtf8("Paritybitlabel")) self.verticalLayout.addWidget(self.Paritybitlabel) self.TransmitzoneLabel = QtGui.QLabel(Dialog) self.TransmitzoneLabel.setGeometry(QtCore.QRect(260, 410, 72, 15)) self.TransmitzoneLabel.setObjectName(_fromUtf8("TransmitzoneLabel")) self.layoutWidget2 = QtGui.QWidget(Dialog) self.layoutWidget2.setGeometry(QtCore.QRect(100, 180, 121, 331)) self.layoutWidget2.setObjectName(_fromUtf8("layoutWidget2")) self.gridLayout = QtGui.QGridLayout(self.layoutWidget2) self.gridLayout.setObjectName(_fromUtf8("gridLayout")) self.BaudratecomboBox = QtGui.QComboBox(self.layoutWidget2) self.BaudratecomboBox.setObjectName(_fromUtf8("BaudratecomboBox")) self.BaudratecomboBox.addItem(_fromUtf8("")) self.BaudratecomboBox.addItem(_fromUtf8("")) self.BaudratecomboBox.addItem(_fromUtf8("")) self.BaudratecomboBox.addItem(_fromUtf8("")) self.gridLayout.addWidget(self.BaudratecomboBox, 2, 0, 1, 1) self.DatabitscomboBox = QtGui.QComboBox(self.layoutWidget2) self.DatabitscomboBox.setObjectName(_fromUtf8("DatabitscomboBox")) self.DatabitscomboBox.addItem(_fromUtf8("")) self.DatabitscomboBox.addItem(_fromUtf8("")) self.DatabitscomboBox.addItem(_fromUtf8("")) self.DatabitscomboBox.addItem(_fromUtf8("")) self.gridLayout.addWidget(self.DatabitscomboBox, 3, 0, 1, 1) self.ParitybitcomboBox = QtGui.QComboBox(self.layoutWidget2) self.ParitybitcomboBox.setObjectName(_fromUtf8("ParitybitcomboBox")) self.ParitybitcomboBox.addItem(_fromUtf8("")) self.ParitybitcomboBox.addItem(_fromUtf8("")) self.ParitybitcomboBox.addItem(_fromUtf8("")) self.ParitybitcomboBox.addItem(_fromUtf8("")) self.ParitybitcomboBox.addItem(_fromUtf8("")) self.gridLayout.addWidget(self.ParitybitcomboBox, 5, 0, 1, 1) self.OnOffButton = QtGui.QPushButton(self.layoutWidget2) self.OnOffButton.setObjectName(_fromUtf8("OnOffButton")) self.gridLayout.addWidget(self.OnOffButton, 0, 0, 1, 1) self.SerialPortcomboBox = CustomComboBox(self.layoutWidget2) self.SerialPortcomboBox.setObjectName(_fromUtf8("SerialPortcomboBox")) self.gridLayout.addWidget(self.SerialPortcomboBox, 1, 0, 1, 1) self.StopbitscomboBox = QtGui.QComboBox(self.layoutWidget2) self.StopbitscomboBox.setObjectName(_fromUtf8("StopbitscomboBox")) self.StopbitscomboBox.addItem(_fromUtf8("")) self.StopbitscomboBox.addItem(_fromUtf8("")) self.StopbitscomboBox.addItem(_fromUtf8("")) self.gridLayout.addWidget(self.StopbitscomboBox, 4, 0, 1, 1) self.PlayButton = QtGui.QPushButton(Dialog) self.PlayButton.setGeometry(QtCore.QRect(78, 70, 93, 28)) self.PlayButton.setObjectName(_fromUtf8("PlayButton")) self.retranslateUi(Dialog) self.stackedWidget.setCurrentIndex(1) QtCore.QMetaObject.connectSlotsByName(Dialog)
class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName(_fromUtf8("MainWindow")) MainWindow.resize(856, 406) self.centralwidget = QtGui.QWidget(MainWindow) self.centralwidget.setObjectName(_fromUtf8("centralwidget")) self.widget = QtGui.QWidget(self.centralwidget) self.widget.setGeometry(QtCore.QRect(60, 100, 750, 166)) self.widget.setObjectName(_fromUtf8("widget")) self.verticalLayout = QtGui.QVBoxLayout(self.widget) self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.horizontalLayout_2 = QtGui.QHBoxLayout() self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2")) self.label = QtGui.QLabel(self.widget) self.label.setObjectName(_fromUtf8("label")) self.horizontalLayout_2.addWidget(self.label) self.cpuUsage = QtGui.QProgressBar(self.widget) self.cpuUsage.setProperty("value", 30) self.cpuUsage.setObjectName(_fromUtf8("cpuUsage")) self.horizontalLayout_2.addWidget(self.cpuUsage) self.verticalLayout.addLayout(self.horizontalLayout_2) self.horizontalLayout_3 = QtGui.QHBoxLayout() self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3")) self.label_3 = QtGui.QLabel(self.widget) self.label_3.setObjectName(_fromUtf8("label_3")) self.horizontalLayout_3.addWidget(self.label_3) self.memUsage = QtGui.QProgressBar(self.widget) self.memUsage.setProperty("value", 24) self.memUsage.setObjectName(_fromUtf8("memUsage")) self.horizontalLayout_3.addWidget(self.memUsage) self.verticalLayout.addLayout(self.horizontalLayout_3) self.horizontalLayout_4 = QtGui.QHBoxLayout() self.horizontalLayout_4.setObjectName(_fromUtf8("horizontalLayout_4")) self.label_2 = QtGui.QLabel(self.widget) self.label_2.setObjectName(_fromUtf8("label_2")) self.label_2.setFixedWidth(166) self.horizontalLayout_4.addWidget(self.label_2) self.diskUsage = QtGui.QLabel(self.widget) self.diskUsage.setObjectName(_fromUtf8("diskUsage")) self.horizontalLayout_4.addWidget(self.diskUsage) self.verticalLayout.addLayout(self.horizontalLayout_4) self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) self.label_4 = QtGui.QLabel(self.widget) self.label_4.setObjectName(_fromUtf8("label_4")) self.label_4.setFixedWidth(166) self.horizontalLayout.addWidget(self.label_4) self.netUsage = QtGui.QLabel(self.widget) self.netUsage.setObjectName(_fromUtf8("netUsage")) self.horizontalLayout.addWidget(self.netUsage) self.netDetailButton = QtGui.QPushButton(self.centralwidget) self.netDetailButton.setGeometry(QtCore.QRect(725, 222.5, 60, 27)) self.netDetailButton.setObjectName(_fromUtf8("netDetailButton")) self.verticalLayout.addLayout(self.horizontalLayout) self.detailButton = QtGui.QPushButton(self.centralwidget) self.detailButton.setGeometry(QtCore.QRect(635, 300, 150, 46)) self.detailButton.setObjectName(_fromUtf8("detailButton")) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtGui.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 796, 38)) self.menubar.setObjectName(_fromUtf8("menubar")) MainWindow.setMenuBar(self.menubar) self.statusbar = QtGui.QStatusBar(MainWindow) self.statusbar.setObjectName(_fromUtf8("statusbar")) MainWindow.setStatusBar(self.statusbar) # update usage self.ctimer = QtCore.QTimer() QtCore.QObject.connect(self.ctimer, QtCore.SIGNAL("timeout()"), self.updateUsage) self.ntimer = None # detail window extend self.w = None self.detailButton.clicked.connect(self.popExtend) # network detail window extend self.nw = None self.netDetailButton.clicked.connect(self.netPopExtend) global popMsg popMsg = Windows10_notification() self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow) # set up initial value of every usage self.memUsage.setValue(memUsage()) self.cpuUsage.setValue(cpuUsage()) self.diskUsage.setText("Read: 0.0 bytes/s | Write: 0.0 bytes/s") self.netUsage.setText("Sent: 0.0 bytes/s | Recv: 0.0 bytes/s") def retranslateUi(self, MainWindow): MainWindow.setWindowTitle(_translate("MainWindow", "SMS", None)) MainWindow.setWindowIcon(QtGui.QIcon(icon_path)) self.label.setText(_translate("MainWindow", "CPU usage: ", None)) self.label_3.setText(_translate("MainWindow", "Memory usage: ", None)) self.label_2.setText(_translate("MainWindow", "Disk usage: ", None)) self.label_4.setText(_translate("MainWindow", "Network usage:", None)) self.netUsage.setText(_translate("MainWindow", "TextLabel", None)) self.netDetailButton.setText(_translate("MainWindow",">>>",None)) self.detailButton.setText(_translate("MainWindow", "Detail >>>", None)) # start ctimer self.ctimer.start(500) def updateUsage(self): global networkUsageList global diskUsageList global warnCountList global popMsg ## check overusing processes for pid in pu.pids(): try: p = getProcess(pid) if warnCountList[pid][0] == 0 and getCPUusage(p) > 50 and pid != 0: warnCountList[pid][0] = 20 popMsg.show("CPU usage warning",p.name()+" spends a lot of cpu resource") elif getCPUusage(p) > 50: warnCountList[pid][0] -= 1 if warnCountList[pid][1] == 0 and getMemUsage(p) > 1024 * 1024 * 1024 and pid != 4: warnCountList[pid][1] = 20 popMsg.show("Memory usage warning",p.name()+" spends a lot of memory resource") elif getMemUsage(p) > 1024 * 1024 * 1024: warnCountList[pid][1] -= 1 except KeyError: warnCountList[pid] = [0, 0] except pu.NoSuchProcess: continue self.memUsage.setValue(memUsage()) self.cpuUsage.setValue(cpuUsage()) diskUsageList = diskIOcountEachProcess() readTotal = 0 writeTotal = 0 for diskUsage in diskUsageList: readTotal += diskUsageList[diskUsage][0] writeTotal += diskUsageList[diskUsage][1] self.diskUsage.setText( "Read: "+humanize(readTotal)+"/s"+" | Write: "+humanize(writeTotal)+"/s" ) networkUsageList = networkUsageEachDevice() sentTotal = 0 recvTotal = 0 for networkUsage in networkUsageList: sentTotal += networkUsage[1] recvTotal += networkUsage[2] self.netUsage.setText("Sent: "+humanize(sentTotal*2)+"/s | Recv: "+humanize(recvTotal*2)+"/s") def popExtend(self): self.w = DetailWindow() self.w.show() def netPopExtend(self): self.nw = GraphicsWindow() self.nw.setWindowTitle(_translate("MainWindow", "SMS", None)) self.nw.setWindowIcon(QtGui.QIcon(icon_path)) # Plot in chunks, adding one new plot curve for every 100 samples self.chunkSize = 10 # Remove chunks after we have 10 self.maxChunks = 20 self.startTime = pyqtgraph.ptime.time() self.nw.nextRow() self.p5 = self.nw.addPlot(colspan=2) self.p5.setLabel('bottom', 'Time', 's') self.p5.setXRange(-10, 0) self.p5.setYRange(0,1000) self.p5.setMouseEnabled(x=False,y=False) self.p5.setMenuEnabled(False) self.p5.showGrid(x=True,y=True,alpha=0.5) self.curves = [[],[]] self.data5 = np.empty((self.chunkSize+1,3)) self.ptr5 = 0 self.ntimer = QtCore.QTimer() self.ntimer.timeout.connect(self.updateNetGraph) self.ntimer.start(500) def updateNetGraph(self): now = pyqtgraph.ptime.time() global networkUsageList netUsage = networkUsageList for c in self.curves[0]: c.setPos(-(now-self.startTime), 0) for c in self.curves[1]: c.setPos(-(now-self.startTime), 0) i = self.ptr5 % self.chunkSize if i == 0: curve1 = self.p5.plot(pen=(0,2)) self.curves[0].append(curve1) curve2 = self.p5.plot(pen=(1,2)) self.curves[1].append(curve2) last = self.data5[-1] self.data5 = np.empty((self.chunkSize+1,3)) self.data5[0] = last while len(self.curves[0]) > self.maxChunks: c = self.curves[0].pop(0) self.p5.removeItem(c) d = self.curves[0].pop(0) self.p5.removeItem(d) else: curve1 = self.curves[0][-1] curve2 = self.curves[1][-1] self.data5[i+1,0] = now - self.startTime sentTotal = 0 recvTotal = 0 for networkUsage in networkUsageList: sentTotal += networkUsage[1] recvTotal += networkUsage[2] self.data5[i+1,1] = sentTotal*2/1024 self.data5[i+1,2] = recvTotal*2/1024 curve1.setData(x=self.data5[:i+2, 0], y=self.data5[:i+2, 1]) curve2.setData(x=self.data5[:i+2, 0], y=self.data5[:i+2, 2]) self.ptr5 += 1
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Apr 27 07:00:22 2020 @author: inox """ from pyaudio import paInt16, PyAudio from struct import unpack from pyqtgraph import GraphicsWindow, setConfigOptions, LegendItem, QtCore, QtGui from numpy import fft, arange, split, argmax, floor from scipy.signal import find_peaks as fpeaks #Inicialización de ventana gráfica con los cuadros de visualización y el dicionario de trazas a graficar win = GraphicsWindow(title="Analizador de Espectro") win.setWindowTitle("Analizador de Espectro") setConfigOptions(antialias=True, background='k') scope = win.addPlot(title="Waveform", row=1, col=1) span = win.addPlot(title="FFT", row=2, col=1) traces = dict() legend = LegendItem() #Actualización (o inicialización) de las trazas de los cuadros de visualización def set_plotdata(name, data_x, data_y): if name in traces: traces[name].setData(data_x, data_y) else: if name == 'waveform': traces[name] = scope.plot(pen='w', width=4) scope.setYRange(-2**(bits - 1), 2**(bits - 1), padding=0)
class Figure(FigureBase): class WindowTitle(PropertyBase[str]): def __init__(self, window: QMainWindow, *args, **kwargs): self._window: QMainWindow = window super(Figure.WindowTitle, self).__init__(*args, **kwargs) def _get(self, **kwargs) -> str: return self._window.windowTitle() def _set(self, value: str, **kwargs) -> None: self._window.setWindowTitle(value) def __init__(self, grid: Optional[Tuple[int, int]] = None, *args, **kwargs): # self._app: QApplication = QApplication([]) # app = self._app self._view: Optional[GraphicsView] = None self._raw: Optional[GraphicsLayout] = None self._grid: Optional[Tuple[int, int]] = grid self._axes: Dict[Tuple[Tuple[int, int], Tuple[int, int]], Axes] = {} self._window_title: Optional[Figure.WindowTitle] = None super(Figure, self).__init__(*args, **kwargs) # region Special Method def __enter__(self) -> _figure: if self._grid is None: self._grid = (1, 1) # if self._grid[0] <= 0 or self._grid[1] <= 0: # raise InvalidGridError self.open(self._grid, *self._init_args, **self._init_kwargs) return self def __exit__(self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]) -> None: self.close() # endregion # region FigureBase Method def open(self, grid: Tuple[int, int] = (1, 1), *args, **kwargs) -> GraphicsLayout: # self._view = GraphicsLayoutWidget() self._view = GraphicsWindow() self._raw = self._view.centralWidget self._grid = grid self._init_axis(self._grid) self._window_title = Figure.WindowTitle(self._view) return self._raw def close(self) -> None: self._view.close() # self._app.closeAllWindows() self._view = None self._grid = (0, 0) self._axes = {} self._window_title = None def window_title(self, value: Optional[str]) -> Optional[str]: return None if self._window_title is None else self._window_title( value) def axes( self, location: Tuple[int, int] = (0, 0), span: Tuple[int, int] = (1, 1) ) -> Axes: if not (location, span) in self._axes: self._add_axes(location, span) return self._axes[(location, span)] def save_as_png(self, directory_path: str, file_name: str) -> None: QApplication.processEvents() exporter = FixedImageExporter(self._view.sceneObj) # exporter.parameters()["width"] = 1280 # exporter.parameters()["height"] = 960 exporter.export(create_full_path(directory_path, file_name, "png")) def show(self) -> None: if self._view is None: raise CannotShowFigureError # win = QMainWindow() # win.setCentralWidget(self._view) # win.show() # win.setWindowTitle(self._window_title) # self._app.exec_() QApplication.instance().exec_() # endregion # region GraphBase Method def clear(self) -> None: for a in self._axes.values(): a.remove_from_figure() self._init_axis(self._grid) # endregion # region Private Method def _add_axes(self, location: Tuple[int, int], span: Tuple[int, int]) -> None: view = self._raw.addLayout(row=location[0], col=location[1], rowspan=span[0], colspan=span[1]) self._axes[(location, span)] = Axes(view, self._raw) def _init_axis(self, grid: Tuple[int, int]) -> None: for row in range(grid[0]): for column in range(grid[1]): self._add_axes(location=(row, column), span=(1, 1))