diff --git a/python_gui/gui/__pycache__/main_ui.cpython-37.pyc b/python_gui/gui/__pycache__/main_ui.cpython-37.pyc index 76b07cb..1ba9a35 100644 Binary files a/python_gui/gui/__pycache__/main_ui.cpython-37.pyc and b/python_gui/gui/__pycache__/main_ui.cpython-37.pyc differ diff --git a/python_gui/gui/__pycache__/sharedcomponets.cpython-37.pyc b/python_gui/gui/__pycache__/sharedcomponets.cpython-37.pyc new file mode 100644 index 0000000..58c2361 Binary files /dev/null and b/python_gui/gui/__pycache__/sharedcomponets.cpython-37.pyc differ diff --git a/python_gui/gui/main.py b/python_gui/gui/main.py index 9c6a04f..f41e04b 100644 --- a/python_gui/gui/main.py +++ b/python_gui/gui/main.py @@ -6,16 +6,13 @@ import threading #引入并行 import numpy as np import pyqtgraph as pg import re - -RED_COLOR = (255, 92, 92) -GREEN_COLOR = (57, 217, 138) -BLUE_COLOR = (91, 141, 236) -ORANGE_COLOR = (253, 172, 66) -YELLOW_COLOR = (255,255,51) -PURPLE_COLOR = (75,0,130) -MAROON_COLOR = (222,184,135) +from sharedcomponets import GUIToolKit class MyWindow(QMainWindow, Ui_MainWindow): + signalColors = [GUIToolKit.RED_COLOR, GUIToolKit.BLUE_COLOR, GUIToolKit.PURPLE_COLOR, GUIToolKit.YELLOW_COLOR, + GUIToolKit.MAROON_COLOR, GUIToolKit.ORANGE_COLOR, GUIToolKit.GREEN_COLOR] + signalIcons = ['reddot', 'bluedot', 'purpledot', 'yellowdot', 'maroondot', 'orangedot', 'greendot'] + def __init__(self, parent=None): super(MyWindow, self).__init__(parent) self.setupUi(self) @@ -29,7 +26,6 @@ class MyWindow(QMainWindow, Ui_MainWindow): # 设置信号与槽 def CreateSignalSlot(self): - self.wifi_recv_open_pushButton.clicked.connect(self.wifi_recv_open_pushButton_clicked) self.velocity_horizontalSlider.valueChanged.connect(self.velocity_horizontalSlider_valueChanged) self.wifi_config_pushButton.clicked.connect(self.wifi_config_pushButton_clicked) @@ -54,16 +50,14 @@ class MyWindow(QMainWindow, Ui_MainWindow): # 绘图对象 self.plotWidget = pg.PlotWidget() self.plotWidget.showGrid(x=True, y=True, alpha=0.5) + self.controlPlotWidget = ControlPlotPanel(controllerPlotWidget=self) # 图表可视化数组 - signalColors = [RED_COLOR, BLUE_COLOR, PURPLE_COLOR, YELLOW_COLOR, - MAROON_COLOR, ORANGE_COLOR, GREEN_COLOR] - signalIcons = ['reddot', 'bluedot', 'purpledot', 'yellowdot', 'maroondot', 'orangedot', 'greendot'] self.numberOfSamples = 300 self.signalDataArrays = [] self.signalPlots = [] self.signalPlotFlags = [] self.timeArray = np.arange(-self.numberOfSamples, 0, 1) - for (sig, sigColor, tooltip) in zip(self.re_item, signalColors, self.re_item): + for (sig, sigColor, checkBox,tooltip) in zip(self.re_item, self.signalColors, self.controlPlotWidget.signalCheckBox,self.re_item): # define signal plot data array self.signalDataArrays.append(np.zeros(self.numberOfSamples)) # configure signal plot parameters @@ -76,7 +70,7 @@ class MyWindow(QMainWindow, Ui_MainWindow): self.signalPlotFlags.append(True) self.gridLayout.addWidget(self.plotWidget) - + self.tool_layout.addWidget(self.controlPlotWidget) # 滑条绑定 def velocity_horizontalSlider_valueChanged(self): self.target_velocity = self.velocity_horizontalSlider.value() @@ -85,32 +79,27 @@ class MyWindow(QMainWindow, Ui_MainWindow): print(str(self.target_velocity)) def wifi_config_pushButton_clicked(self): try: - print(self.wifi_IP_lineEdit.text(),type(self.wifi_IP_lineEdit.text())) - self.udp.udpClientSocket.bind((self.wifi_IP_lineEdit.text(), 2333)) - # 第一次接受数据,用于判断项目数, - recv_data = self.udp.udpClientSocket.recv(1024) - recv_data = recv_data.decode('utf-8') - recv_data = recv_data[:-1] - recv_data = recv_data.split(',') - """处理接受的信息""" - for i, data in enumerate(recv_data): - self.re_item.append(''.join(re.split(r'[^A-Za-z]', data))) - print(self.re_item) - # 图表初始化 + self.re_item = ['k','g','l','t'] self.plot_init() - t1 = threading.Thread(target=self.udp_recv) - t1.start() - self.wifi_recv_open_pushButton.setEnabled(True) - except: + # print(self.wifi_IP_lineEdit.text(),type(self.wifi_IP_lineEdit.text())) + # self.udp.udpClientSocket.bind((self.wifi_IP_lineEdit.text(), 2333)) + # # 第一次接受数据,用于判断项目数, + # recv_data = self.udp.udpClientSocket.recv(1024) + # recv_data = recv_data.decode('utf-8') + # recv_data = recv_data[:-1] + # recv_data = recv_data.split(',') + # """处理接受的信息""" + # for i, data in enumerate(recv_data): + # self.re_item.append(''.join(re.split(r'[^A-Za-z]', data))) + # print(self.re_item) + # # 图表初始化 + # self.plot_init() + # t1 = threading.Thread(target=self.udp_recv) + # t1.start() + # self.wifi_recv_open_pushButton.setEnabled(True) + except Exception as e: + print(e) QMessageBox.critical(self, "错误", '该请求的地址无效') - def wifi_recv_open_pushButton_clicked(self): - if self.wifi_recv_flag == 0: - # 打开wifi接收 - self.wifi_recv_flag = 1 - self.wifi_recv_open_pushButton.setText('关闭') - else: - self.wifi_recv_flag = 0 - self.wifi_recv_open_pushButton.setText('打开') def udp_recv(self): while self.close_flag: recv_data = self.udp.udpClientSocket.recv(1024) @@ -136,6 +125,53 @@ class MyWindow(QMainWindow, Ui_MainWindow): def closeEvent(self, a0: QtGui.QCloseEvent) -> None: self.close_flag = 0 + + +class ControlPlotPanel(QtWidgets.QWidget): + + def __init__(self, parent=None, controllerPlotWidget=None): + '''Constructor for ToolsWidget''' + super().__init__(parent) + self.controlledPlot = controllerPlotWidget + + self.horizontalLayout1 = QtWidgets.QHBoxLayout() + self.horizontalLayout1.setObjectName('horizontalLayout') + self.setLayout(self.horizontalLayout1) + + self.startStopButton = QtWidgets.QPushButton(self) + self.startStopButton.setText('Start') + self.startStopButton.setObjectName('Start') + self.startStopButton.clicked.connect(self.wifi_recv_open_pushButton_clicked) + self.startStopButton.setIcon(GUIToolKit.getIconByName('start')) + self.horizontalLayout1.addWidget(self.startStopButton) + + self.zoomAllButton = QtWidgets.QPushButton(self) + self.zoomAllButton.setObjectName('zoomAllButton') + self.zoomAllButton.setText('View all') + self.zoomAllButton.setIcon(GUIToolKit.getIconByName('zoomall')) + self.zoomAllButton.clicked.connect(self.zoomAllPlot) + self.horizontalLayout1.addWidget(self.zoomAllButton) + + self.signalCheckBox = [] + for i in range(len(self.controlledPlot.re_item)): + checkBox = QtWidgets.QCheckBox(self) + checkBox.setObjectName('signalCheckBox' + str(i)) + checkBox.setToolTip(self.controlledPlot.re_item[i]) + checkBox.setText(self.controlledPlot.re_item[i]) + checkBox.setIcon(GUIToolKit.getIconByName(self.controlledPlot.signalIcons[i])) + checkBox.setChecked(True) + self.signalCheckBox.append(checkBox) + self.horizontalLayout1.addWidget(checkBox) + def zoomAllPlot(self): + self.controlledPlot.plotWidget.enableAutoRange() + def wifi_recv_open_pushButton_clicked(self): + if self.controlledPlot.wifi_recv_flag == 0: + # 打开wifi接收 + self.controlledPlot.wifi_recv_flag = 1 + self.startStopButton.setText('Stop') + else: + self.controlledPlot.wifi_recv_flag = 0 + self.startStopButton.setText('Start') if __name__ == '__main__': app = QApplication(sys.argv) myWin = MyWindow() diff --git a/python_gui/gui/main_ui.py b/python_gui/gui/main_ui.py index 7a06b4c..f46ab51 100644 --- a/python_gui/gui/main_ui.py +++ b/python_gui/gui/main_ui.py @@ -14,11 +14,11 @@ from PyQt5 import QtCore, QtGui, QtWidgets class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") - MainWindow.resize(800, 749) + MainWindow.resize(1187, 707) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.groupBox = QtWidgets.QGroupBox(self.centralwidget) - self.groupBox.setGeometry(QtCore.QRect(20, 420, 241, 61)) + self.groupBox.setGeometry(QtCore.QRect(20, 460, 241, 61)) self.groupBox.setObjectName("groupBox") self.horizontalLayoutWidget = QtWidgets.QWidget(self.groupBox) self.horizontalLayoutWidget.setGeometry(QtCore.QRect(10, 20, 221, 31)) @@ -34,7 +34,7 @@ class Ui_MainWindow(object): self.wifi_config_pushButton.setObjectName("wifi_config_pushButton") self.horizontalLayout.addWidget(self.wifi_config_pushButton) self.horizontalLayoutWidget_2 = QtWidgets.QWidget(self.centralwidget) - self.horizontalLayoutWidget_2.setGeometry(QtCore.QRect(570, 440, 104, 31)) + self.horizontalLayoutWidget_2.setGeometry(QtCore.QRect(590, 480, 104, 31)) self.horizontalLayoutWidget_2.setObjectName("horizontalLayoutWidget_2") self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget_2) self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0) @@ -46,7 +46,7 @@ class Ui_MainWindow(object): self.velocity_lineEdit.setObjectName("velocity_lineEdit") self.horizontalLayout_2.addWidget(self.velocity_lineEdit) self.velocity_horizontalSlider = QtWidgets.QSlider(self.centralwidget) - self.velocity_horizontalSlider.setGeometry(QtCore.QRect(410, 420, 261, 22)) + self.velocity_horizontalSlider.setGeometry(QtCore.QRect(430, 460, 261, 22)) self.velocity_horizontalSlider.setMinimum(-150) self.velocity_horizontalSlider.setMaximum(150) self.velocity_horizontalSlider.setOrientation(QtCore.Qt.Horizontal) @@ -54,7 +54,7 @@ class Ui_MainWindow(object): self.velocity_horizontalSlider.setTickInterval(10) self.velocity_horizontalSlider.setObjectName("velocity_horizontalSlider") self.horizontalLayoutWidget_3 = QtWidgets.QWidget(self.centralwidget) - self.horizontalLayoutWidget_3.setGeometry(QtCore.QRect(400, 440, 134, 31)) + self.horizontalLayoutWidget_3.setGeometry(QtCore.QRect(420, 480, 134, 31)) self.horizontalLayoutWidget_3.setObjectName("horizontalLayoutWidget_3") self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget_3) self.horizontalLayout_3.setContentsMargins(0, 0, 0, 0) @@ -66,21 +66,23 @@ class Ui_MainWindow(object): self.angle_lineEdit.setObjectName("angle_lineEdit") self.horizontalLayout_3.addWidget(self.angle_lineEdit) self.groupBox_2 = QtWidgets.QGroupBox(self.centralwidget) - self.groupBox_2.setGeometry(QtCore.QRect(190, 0, 601, 391)) + self.groupBox_2.setGeometry(QtCore.QRect(370, 10, 811, 431)) self.groupBox_2.setObjectName("groupBox_2") self.gridLayoutWidget = QtWidgets.QWidget(self.groupBox_2) - self.gridLayoutWidget.setGeometry(QtCore.QRect(10, 20, 581, 361)) + self.gridLayoutWidget.setGeometry(QtCore.QRect(10, 20, 791, 361)) self.gridLayoutWidget.setObjectName("gridLayoutWidget") self.gridLayout = QtWidgets.QGridLayout(self.gridLayoutWidget) self.gridLayout.setContentsMargins(0, 0, 0, 0) self.gridLayout.setObjectName("gridLayout") - self.wifi_recv_open_pushButton = QtWidgets.QPushButton(self.centralwidget) - self.wifi_recv_open_pushButton.setEnabled(False) - self.wifi_recv_open_pushButton.setGeometry(QtCore.QRect(190, 390, 93, 28)) - self.wifi_recv_open_pushButton.setObjectName("wifi_recv_open_pushButton") + self.horizontalLayoutWidget_4 = QtWidgets.QWidget(self.groupBox_2) + self.horizontalLayoutWidget_4.setGeometry(QtCore.QRect(10, 370, 791, 51)) + self.horizontalLayoutWidget_4.setObjectName("horizontalLayoutWidget_4") + self.tool_layout = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget_4) + self.tool_layout.setContentsMargins(0, 0, 0, 0) + self.tool_layout.setObjectName("tool_layout") MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(MainWindow) - self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 26)) + self.menubar.setGeometry(QtCore.QRect(0, 0, 1187, 26)) self.menubar.setObjectName("menubar") MainWindow.setMenuBar(self.menubar) self.statusbar = QtWidgets.QStatusBar(MainWindow) @@ -101,4 +103,3 @@ class Ui_MainWindow(object): self.label_2.setText(_translate("MainWindow", "目标角度:")) self.angle_lineEdit.setText(_translate("MainWindow", "149")) self.groupBox_2.setTitle(_translate("MainWindow", "GroupBox")) - self.wifi_recv_open_pushButton.setText(_translate("MainWindow", "打开")) diff --git a/python_gui/gui/main_ui.ui b/python_gui/gui/main_ui.ui index d93d702..5a2a6c2 100644 --- a/python_gui/gui/main_ui.ui +++ b/python_gui/gui/main_ui.ui @@ -6,8 +6,8 @@ 0 0 - 800 - 749 + 1187 + 707 @@ -18,7 +18,7 @@ 20 - 420 + 460 241 61 @@ -59,8 +59,8 @@ - 570 - 440 + 590 + 480 104 31 @@ -85,8 +85,8 @@ - 410 - 420 + 430 + 460 261 22 @@ -110,8 +110,8 @@ - 400 - 440 + 420 + 480 134 31 @@ -136,10 +136,10 @@ - 190 - 0 - 601 - 391 + 370 + 10 + 811 + 431 @@ -150,28 +150,23 @@ 10 20 - 581 + 791 361 - - - - false - - - - 190 - 390 - 93 - 28 - - - - 打开 - + + + + 10 + 370 + 791 + 51 + + + + @@ -179,7 +174,7 @@ 0 0 - 800 + 1187 26 diff --git a/python_gui/gui/resources/add.png b/python_gui/gui/resources/add.png new file mode 100644 index 0000000..7038ea7 Binary files /dev/null and b/python_gui/gui/resources/add.png differ diff --git a/python_gui/gui/resources/add_motor.png b/python_gui/gui/resources/add_motor.png new file mode 100644 index 0000000..abcd9f1 Binary files /dev/null and b/python_gui/gui/resources/add_motor.png differ diff --git a/python_gui/gui/resources/add_motor.psd b/python_gui/gui/resources/add_motor.psd new file mode 100644 index 0000000..710bc29 Binary files /dev/null and b/python_gui/gui/resources/add_motor.psd differ diff --git a/python_gui/gui/resources/alert.png b/python_gui/gui/resources/alert.png new file mode 100644 index 0000000..3e73cac Binary files /dev/null and b/python_gui/gui/resources/alert.png differ diff --git a/python_gui/gui/resources/ard.png b/python_gui/gui/resources/ard.png new file mode 100644 index 0000000..76fb459 Binary files /dev/null and b/python_gui/gui/resources/ard.png differ diff --git a/python_gui/gui/resources/backward.png b/python_gui/gui/resources/backward.png new file mode 100644 index 0000000..dedbb6f Binary files /dev/null and b/python_gui/gui/resources/backward.png differ diff --git a/python_gui/gui/resources/bluedot.png b/python_gui/gui/resources/bluedot.png new file mode 100644 index 0000000..8ef6a0e Binary files /dev/null and b/python_gui/gui/resources/bluedot.png differ diff --git a/python_gui/gui/resources/configure.png b/python_gui/gui/resources/configure.png new file mode 100644 index 0000000..da2e43e Binary files /dev/null and b/python_gui/gui/resources/configure.png differ diff --git a/python_gui/gui/resources/connect.png b/python_gui/gui/resources/connect.png new file mode 100644 index 0000000..e09f443 Binary files /dev/null and b/python_gui/gui/resources/connect.png differ diff --git a/python_gui/gui/resources/consoletool.png b/python_gui/gui/resources/consoletool.png new file mode 100644 index 0000000..6e01693 Binary files /dev/null and b/python_gui/gui/resources/consoletool.png differ diff --git a/python_gui/gui/resources/continue.png b/python_gui/gui/resources/continue.png new file mode 100644 index 0000000..fd93351 Binary files /dev/null and b/python_gui/gui/resources/continue.png differ diff --git a/python_gui/gui/resources/customcommands.png b/python_gui/gui/resources/customcommands.png new file mode 100644 index 0000000..1bb8fb0 Binary files /dev/null and b/python_gui/gui/resources/customcommands.png differ diff --git a/python_gui/gui/resources/delete.png b/python_gui/gui/resources/delete.png new file mode 100644 index 0000000..3812bf0 Binary files /dev/null and b/python_gui/gui/resources/delete.png differ diff --git a/python_gui/gui/resources/disconnect.png b/python_gui/gui/resources/disconnect.png new file mode 100644 index 0000000..ba22f19 Binary files /dev/null and b/python_gui/gui/resources/disconnect.png differ diff --git a/python_gui/gui/resources/edit.png b/python_gui/gui/resources/edit.png new file mode 100644 index 0000000..21e2557 Binary files /dev/null and b/python_gui/gui/resources/edit.png differ diff --git a/python_gui/gui/resources/fastbackward.png b/python_gui/gui/resources/fastbackward.png new file mode 100644 index 0000000..aa5ec43 Binary files /dev/null and b/python_gui/gui/resources/fastbackward.png differ diff --git a/python_gui/gui/resources/fastfordward.png b/python_gui/gui/resources/fastfordward.png new file mode 100644 index 0000000..b4df987 Binary files /dev/null and b/python_gui/gui/resources/fastfordward.png differ diff --git a/python_gui/gui/resources/fordward.png b/python_gui/gui/resources/fordward.png new file mode 100644 index 0000000..9519656 Binary files /dev/null and b/python_gui/gui/resources/fordward.png differ diff --git a/python_gui/gui/resources/form.png b/python_gui/gui/resources/form.png new file mode 100644 index 0000000..7347e48 Binary files /dev/null and b/python_gui/gui/resources/form.png differ diff --git a/python_gui/gui/resources/gear.png b/python_gui/gui/resources/gear.png new file mode 100644 index 0000000..d7ab21f Binary files /dev/null and b/python_gui/gui/resources/gear.png differ diff --git a/python_gui/gui/resources/gen.png b/python_gui/gui/resources/gen.png new file mode 100644 index 0000000..eab9676 Binary files /dev/null and b/python_gui/gui/resources/gen.png differ diff --git a/python_gui/gui/resources/generalsettings.png b/python_gui/gui/resources/generalsettings.png new file mode 100644 index 0000000..3c1e92c Binary files /dev/null and b/python_gui/gui/resources/generalsettings.png differ diff --git a/python_gui/gui/resources/greendot.png b/python_gui/gui/resources/greendot.png new file mode 100644 index 0000000..36a4f2e Binary files /dev/null and b/python_gui/gui/resources/greendot.png differ diff --git a/python_gui/gui/resources/home.png b/python_gui/gui/resources/home.png new file mode 100644 index 0000000..df519da Binary files /dev/null and b/python_gui/gui/resources/home.png differ diff --git a/python_gui/gui/resources/list.png b/python_gui/gui/resources/list.png new file mode 100644 index 0000000..c6a49b5 Binary files /dev/null and b/python_gui/gui/resources/list.png differ diff --git a/python_gui/gui/resources/loop.png b/python_gui/gui/resources/loop.png new file mode 100644 index 0000000..665c8b6 Binary files /dev/null and b/python_gui/gui/resources/loop.png differ diff --git a/python_gui/gui/resources/maroondot.png b/python_gui/gui/resources/maroondot.png new file mode 100644 index 0000000..4b3fd5d Binary files /dev/null and b/python_gui/gui/resources/maroondot.png differ diff --git a/python_gui/gui/resources/motor.png b/python_gui/gui/resources/motor.png new file mode 100644 index 0000000..16bbf5c Binary files /dev/null and b/python_gui/gui/resources/motor.png differ diff --git a/python_gui/gui/resources/motor.psd b/python_gui/gui/resources/motor.psd new file mode 100644 index 0000000..83c67a7 Binary files /dev/null and b/python_gui/gui/resources/motor.psd differ diff --git a/python_gui/gui/resources/motor1.png b/python_gui/gui/resources/motor1.png new file mode 100644 index 0000000..a97587d Binary files /dev/null and b/python_gui/gui/resources/motor1.png differ diff --git a/python_gui/gui/resources/open.png b/python_gui/gui/resources/open.png new file mode 100644 index 0000000..9c1a1cb Binary files /dev/null and b/python_gui/gui/resources/open.png differ diff --git a/python_gui/gui/resources/orangedot.png b/python_gui/gui/resources/orangedot.png new file mode 100644 index 0000000..6c0fc5c Binary files /dev/null and b/python_gui/gui/resources/orangedot.png differ diff --git a/python_gui/gui/resources/pause.png b/python_gui/gui/resources/pause.png new file mode 100644 index 0000000..c5c0f1a Binary files /dev/null and b/python_gui/gui/resources/pause.png differ diff --git a/python_gui/gui/resources/pid.png b/python_gui/gui/resources/pid.png new file mode 100644 index 0000000..2f4130c Binary files /dev/null and b/python_gui/gui/resources/pid.png differ diff --git a/python_gui/gui/resources/pidconfig.png b/python_gui/gui/resources/pidconfig.png new file mode 100644 index 0000000..8dbcac0 Binary files /dev/null and b/python_gui/gui/resources/pidconfig.png differ diff --git a/python_gui/gui/resources/pull.png b/python_gui/gui/resources/pull.png new file mode 100644 index 0000000..9232799 Binary files /dev/null and b/python_gui/gui/resources/pull.png differ diff --git a/python_gui/gui/resources/purpledot.png b/python_gui/gui/resources/purpledot.png new file mode 100644 index 0000000..8ff40fd Binary files /dev/null and b/python_gui/gui/resources/purpledot.png differ diff --git a/python_gui/gui/resources/push.png b/python_gui/gui/resources/push.png new file mode 100644 index 0000000..c91bcb1 Binary files /dev/null and b/python_gui/gui/resources/push.png differ diff --git a/python_gui/gui/resources/reddot.png b/python_gui/gui/resources/reddot.png new file mode 100644 index 0000000..aeaa338 Binary files /dev/null and b/python_gui/gui/resources/reddot.png differ diff --git a/python_gui/gui/resources/res.png b/python_gui/gui/resources/res.png new file mode 100644 index 0000000..cc01c54 Binary files /dev/null and b/python_gui/gui/resources/res.png differ diff --git a/python_gui/gui/resources/save.png b/python_gui/gui/resources/save.png new file mode 100644 index 0000000..f637c76 Binary files /dev/null and b/python_gui/gui/resources/save.png differ diff --git a/python_gui/gui/resources/send.png b/python_gui/gui/resources/send.png new file mode 100644 index 0000000..b15e21d Binary files /dev/null and b/python_gui/gui/resources/send.png differ diff --git a/python_gui/gui/resources/sensor.png b/python_gui/gui/resources/sensor.png new file mode 100644 index 0000000..30d33a4 Binary files /dev/null and b/python_gui/gui/resources/sensor.png differ diff --git a/python_gui/gui/resources/start.png b/python_gui/gui/resources/start.png new file mode 100644 index 0000000..91f057b Binary files /dev/null and b/python_gui/gui/resources/start.png differ diff --git a/python_gui/gui/resources/statistics.png b/python_gui/gui/resources/statistics.png new file mode 100644 index 0000000..a1ae710 Binary files /dev/null and b/python_gui/gui/resources/statistics.png differ diff --git a/python_gui/gui/resources/stop.png b/python_gui/gui/resources/stop.png new file mode 100644 index 0000000..a5ccebf Binary files /dev/null and b/python_gui/gui/resources/stop.png differ diff --git a/python_gui/gui/resources/stopjogging.png b/python_gui/gui/resources/stopjogging.png new file mode 100644 index 0000000..faa8b72 Binary files /dev/null and b/python_gui/gui/resources/stopjogging.png differ diff --git a/python_gui/gui/resources/studioicon.icns b/python_gui/gui/resources/studioicon.icns new file mode 100644 index 0000000..1e3ee0e Binary files /dev/null and b/python_gui/gui/resources/studioicon.icns differ diff --git a/python_gui/gui/resources/tree copy.png b/python_gui/gui/resources/tree copy.png new file mode 100644 index 0000000..e683632 Binary files /dev/null and b/python_gui/gui/resources/tree copy.png differ diff --git a/python_gui/gui/resources/tree.png b/python_gui/gui/resources/tree.png new file mode 100644 index 0000000..a8437a9 Binary files /dev/null and b/python_gui/gui/resources/tree.png differ diff --git a/python_gui/gui/resources/yellowdot.png b/python_gui/gui/resources/yellowdot.png new file mode 100644 index 0000000..a2ab7f5 Binary files /dev/null and b/python_gui/gui/resources/yellowdot.png differ diff --git a/python_gui/gui/resources/zoomall.png b/python_gui/gui/resources/zoomall.png new file mode 100644 index 0000000..f289a18 Binary files /dev/null and b/python_gui/gui/resources/zoomall.png differ diff --git a/python_gui/gui/sharedcomponets.py b/python_gui/gui/sharedcomponets.py new file mode 100644 index 0000000..76b52f2 --- /dev/null +++ b/python_gui/gui/sharedcomponets.py @@ -0,0 +1,74 @@ +import os + +from PyQt5 import QtGui, QtWidgets, QtCore + +class GUIToolKit(object): + ''' This class is used to provide icons for the rest of the application + hiding the location of the resources + ''' + RED_COLOR = (255, 92, 92) + GREEN_COLOR = (57, 217, 138) + BLUE_COLOR = (91, 141, 236) + ORANGE_COLOR = (253, 172, 66) + YELLOW_COLOR = (255,255,51) + PURPLE_COLOR = (75,0,130) + MAROON_COLOR = (222,184,135) + + @staticmethod + def getIconByName(icoName): + + file_index = { + 'add': 'add.png', + 'add_motor': 'add_motor.png', + 'tree': 'tree.png', + 'gen': 'gen.png', + 'home': 'home.png', + 'form': 'form.png', + 'edit': 'edit.png', + 'delete': 'delete.png', + 'statistics': 'statistics.png', + 'reddot': 'reddot.png', + 'orangedot': 'orangedot.png', + 'greendot': 'greendot.png', + 'bluedot': 'bluedot.png', + 'purpledot': 'purpledot.png', + 'yellowdot': 'yellowdot.png', + 'maroondot': 'maroondot.png', + 'send': 'send.png', + 'zoomall': 'zoomall.png', + 'connect': 'connect.png', + 'continue': 'continue.png', + 'alert': 'alert.png', + 'gear': 'gear.png', + 'generalsettings': 'generalsettings.png', + 'open': 'open.png', + 'loop': 'loop.png', + 'save': 'save.png', + 'stop': 'stop.png', + 'restart': 'continue.png', + 'res': 'res.png', + 'sensor': 'sensor.png', + 'start': 'start.png', + 'motor': 'motor.png', + 'pause': 'pause.png', + 'pull': 'pull.png', + 'push': 'push.png', + 'list': 'list.png', + 'disconnect': 'disconnect.png', + 'configure': 'configure.png', + 'pidconfig': 'pidconfig.png', + 'consoletool': 'consoletool.png', + 'fordward': 'fordward.png', + 'fastbackward': 'fastbackward.png', + 'backward': 'backward.png', + 'stopjogging': 'stopjogging.png', + 'fastfordward': 'fastfordward.png', + 'customcommands':'customcommands.png' + } + currentDir = os.path.dirname(__file__) + icon_path = os.path.join(currentDir, './resources', file_index[icoName]) + print(icon_path) + icon = QtGui.QIcon() + icon.addPixmap(QtGui.QPixmap(icon_path), QtGui.QIcon.Normal, + QtGui.QIcon.Off) + return icon \ No newline at end of file