diff --git a/COM/COM_Robot.py b/COM/COM_Robot.py index 6d38f5f..a1baca7 100644 --- a/COM/COM_Robot.py +++ b/COM/COM_Robot.py @@ -70,7 +70,7 @@ class RobotClient(TCPClient): self.status_model.toolCoord=int(data_address_array[16]) self.status_model.input_n = int(data_address_array[19]) self.status_model.output_n = int(data_address_array[20]) - self.status_model.output_n = int(data_address_array[21]) + self.status_model.curSpeed_n = int(data_address_array[21]) except: log.log_message(logging.ERROR,Constant.str_tcp_robot_data_error) return True diff --git a/CU/Feeding.py b/CU/Feeding.py index a8fccd4..2c4ea43 100644 --- a/CU/Feeding.py +++ b/CU/Feeding.py @@ -208,9 +208,9 @@ class Feeding : self.sendTargPosition(self.feedConfig.feedLine.drop_bag_position) pass if self.feedConfig.feedLine.drop_bag_position.compare(real_position): - self.sendIOControl(self.robotClient.con_ios[0],0) - self.sendIOControl(self.robotClient.con_ios[1],0) - self.sendIOControl(self.robotClient.con_ios[2],0) + self.sendIOControl(self.robotClient.con_ios[0], 0) + self.sendIOControl(self.robotClient.con_ios[1], 0) + self.sendIOControl(self.robotClient.con_ios[2], 0) # TODO 检测是否断 不然报警 time.sleep(2) self.feedConfig.num = self.feedConfig.num - 1 diff --git a/Constant.py b/Constant.py index 1e61ea7..07a9df7 100644 --- a/Constant.py +++ b/Constant.py @@ -57,6 +57,7 @@ str_sys_feedNum_add = '增加投料次数' str_sys_log_feedNum ='记录袋数失败' str_sys_emergencyStop = '按下急停' str_sys_set_error = '保存设置失败' +str_sys_log_IO_error = 'IO更新失败' str_tcp_robot_connect_fail = '连接失败' str_tcp_robot_connect_success = '连接成功' str_tcp_robot_data_error = '数据解析错误' diff --git a/MainWin.ui b/MainWin.ui index e574e96..3e5ca48 100644 --- a/MainWin.ui +++ b/MainWin.ui @@ -1684,12 +1684,660 @@ font: 700 9pt "Microsoft YaHei UI"; + + font: 700 16pt "Microsoft YaHei UI"; + QFrame::Shape::StyledPanel QFrame::Shadow::Raised + + + 40 + + + + + color: rgb(255, 255, 255); + + + Y1 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + background-color: rgb(0, 170, 0); + + + + + + + color: rgb(255, 255, 255); + + + 2 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + background-color: rgb(0, 170, 0); + + + + + + + color: rgb(255, 255, 255); + + + 3 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + background-color: rgb(0, 170, 0); + + + + + + + color: rgb(255, 255, 255); + + + 4 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + background-color: rgb(0, 170, 0); + + + + + + + color: rgb(255, 255, 255); + + + 5 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + background-color: rgb(0, 170, 0); + + + + + + + color: rgb(255, 255, 255); + + + 6 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + background-color: rgb(0, 170, 0); + + + + + + + color: rgb(255, 255, 255); + + + 7 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + background-color: rgb(0, 170, 0); + + + + + + + color: rgb(255, 255, 255); + + + 8 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + background-color: rgb(0, 170, 0); + + + + + + + color: rgb(255, 255, 255); + + + 9 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + background-color: rgb(0, 170, 0); + + + + + + + color: rgb(255, 255, 255); + + + 10 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + background-color: rgb(0, 170, 0); + + + + + + + color: rgb(255, 255, 255); + + + 11 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + background-color: rgb(0, 170, 0); + + + + + + + color: rgb(255, 255, 255); + + + 12 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + background-color: rgb(0, 170, 0); + + + + + + + color: rgb(255, 255, 255); + + + 13 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + background-color: rgb(0, 170, 0); + + + + + + + color: rgb(255, 255, 255); + + + 14 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + background-color: rgb(0, 170, 0); + + + + + + + color: rgb(255, 255, 255); + + + 15 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + background-color: rgb(0, 170, 0); + + + + + + + color: rgb(255, 255, 255); + + + 16 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + background-color: rgb(0, 170, 0); + + + + + + + color: rgb(255, 255, 255); + + + 17 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + background-color: rgb(0, 170, 0); + + + + + + + color: rgb(255, 255, 255); + + + 18 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + background-color: rgb(0, 170, 0); + + + + + + + color: rgb(255, 255, 255); + + + 19 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + background-color: rgb(0, 170, 0); + + + + + + + color: rgb(255, 255, 255); + + + 20 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + background-color: rgb(0, 170, 0); + + + + + + + color: rgb(255, 255, 255); + + + 21 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + background-color: rgb(0, 170, 0); + + + + + + + color: rgb(255, 255, 255); + + + 22 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + background-color: rgb(0, 170, 0); + + + + + + + color: rgb(255, 255, 255); + + + 23 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + background-color: rgb(0, 170, 0); + + + + + + + color: rgb(255, 255, 255); + + + 24 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + background-color: rgb(0, 170, 0); + + + + + + + color: rgb(255, 255, 255); + + + 25 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + background-color: rgb(0, 170, 0); + + + + + + + color: rgb(255, 255, 255); + + + 26 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + background-color: rgb(0, 170, 0); + + + + + + + color: rgb(255, 255, 255); + + + 27 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + background-color: rgb(0, 170, 0); + + + + + + + color: rgb(255, 255, 255); + + + 28 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + background-color: rgb(0, 170, 0); + + + + + + + color: rgb(255, 255, 255); + + + 29 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + background-color: rgb(0, 170, 0); + + + + + + + color: rgb(255, 255, 255); + + + 30 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + background-color: rgb(0, 170, 0); + + + + + + + color: rgb(255, 255, 255); + + + 31 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + background-color: rgb(0, 170, 0); + + + + + + + color: rgb(255, 255, 255); + + + 32 + + + Qt::AlignmentFlag::AlignCenter + + + + + + + background-color: rgb(0, 170, 0); + + + + @@ -4811,6 +5459,14 @@ font: 36pt "Microsoft YaHei UI"; + + + ToggleSwitch + QWidget +
toggleswitch.h
+ 1 +
+
diff --git a/Model/RobotModel.py b/Model/RobotModel.py index d5969fb..129d5e4 100644 --- a/Model/RobotModel.py +++ b/Model/RobotModel.py @@ -28,7 +28,7 @@ class DataAddress: self.curMode = 0 self.boardIONum = '' self.input_n = '' - self.output_n = '' + self.output_n = 0 self.axisNum = '6' self.axis_n = '' self.world_0 = 0 @@ -55,7 +55,7 @@ class DataAddress: self.isMoving = False self.M_n = '' self.RemoteCmdLen = 0 - self.toolCoord='' + self.toolCoord=0 #return def setPosition(self,w0,w1,w2,w3,w4,w5,a0,a1,a2,a3,a4,a5): @@ -76,6 +76,10 @@ class DataAddress: real_position = Real_Position().init_position(self.world_0,self.world_1,self.world_2,self.world_3,self.world_4,self.world_5) return real_position + def get_IO_bits(self): + io_bits_str = format(self.output_n, '032b')[::-1] + io_bits_arry = [bit == '1' for bit in io_bits_str] + return io_bits_arry def setAngle(self,a0,a1,a2,a3,a4,a5): pass diff --git a/MvSDKLog/CamCtrl_00.log b/MvSDKLog/CamCtrl_00.log index c252cc2..3f2b8a6 100644 --- a/MvSDKLog/CamCtrl_00.log +++ b/MvSDKLog/CamCtrl_00.log @@ -5883,3 +5883,33 @@ Warning 2024-10-28 22:24:11:0688 DevID:Virtual USB3 Vision Source-Line:MvCamer Warning 2024-10-28 22:24:11:0688 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0996) ProcessName:python.exe(18992) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_VERSION] failed, Ret[0x80000001] Warning 2024-10-28 22:24:11:0688 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1000) ProcessName:python.exe(18992) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MANUFACTURER] failed, Ret[0x80000001] Warning 2024-10-28 22:24:11:0688 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1004) ProcessName:python.exe(18992) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_USER_DEFINED_NAME] failed, Ret[0x80000001] +Error 2024-10-30 22:27:20:0901 DevID: Source-Line:MvCameraControl.dll(OtherLoadLibrary.cpp-L0709) ProcessName:python.exe(10604) Description:[LoadSRAllFunctions]hSRModule is NULL, Ret[0x8000000c] +Warning 2024-10-30 22:27:20:0919 DevID: Source-Line:MvCameraControl.dll(GenTLLoadLibraryEx.cpp-L0345) ProcessName:python.exe(10604) Description:[LoadCtiLibInter]MV_GCSetConfigIntValue is NULL, CTI path[D:\environment\envs\UICreater\lib\site-packages\MvProducerVIR.dll] +Warning 2024-10-30 22:27:20:0919 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0992) ProcessName:python.exe(10604) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MODEL] failed, Ret[0x80000001] +Warning 2024-10-30 22:27:20:0919 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0996) ProcessName:python.exe(10604) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_VERSION] failed, Ret[0x80000001] +Warning 2024-10-30 22:27:20:0919 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1000) ProcessName:python.exe(10604) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MANUFACTURER] failed, Ret[0x80000001] +Warning 2024-10-30 22:27:20:0919 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1004) ProcessName:python.exe(10604) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_USER_DEFINED_NAME] failed, Ret[0x80000001] +Warning 2024-10-30 22:27:20:0919 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0992) ProcessName:python.exe(10604) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MODEL] failed, Ret[0x80000001] +Warning 2024-10-30 22:27:20:0919 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0996) ProcessName:python.exe(10604) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_VERSION] failed, Ret[0x80000001] +Warning 2024-10-30 22:27:20:0919 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1000) ProcessName:python.exe(10604) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MANUFACTURER] failed, Ret[0x80000001] +Warning 2024-10-30 22:27:20:0919 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1004) ProcessName:python.exe(10604) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_USER_DEFINED_NAME] failed, Ret[0x80000001] +Error 2024-10-30 22:39:06:0479 DevID: Source-Line:MvCameraControl.dll(OtherLoadLibrary.cpp-L0709) ProcessName:python.exe(26424) Description:[LoadSRAllFunctions]hSRModule is NULL, Ret[0x8000000c] +Warning 2024-10-30 22:39:06:0484 DevID: Source-Line:MvCameraControl.dll(GenTLLoadLibraryEx.cpp-L0345) ProcessName:python.exe(26424) Description:[LoadCtiLibInter]MV_GCSetConfigIntValue is NULL, CTI path[D:\environment\envs\UICreater\lib\site-packages\MvProducerVIR.dll] +Warning 2024-10-30 22:39:06:0487 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0992) ProcessName:python.exe(26424) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MODEL] failed, Ret[0x80000001] +Warning 2024-10-30 22:39:06:0487 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0996) ProcessName:python.exe(26424) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_VERSION] failed, Ret[0x80000001] +Warning 2024-10-30 22:39:06:0487 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1000) ProcessName:python.exe(26424) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MANUFACTURER] failed, Ret[0x80000001] +Warning 2024-10-30 22:39:06:0487 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1004) ProcessName:python.exe(26424) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_USER_DEFINED_NAME] failed, Ret[0x80000001] +Warning 2024-10-30 22:39:06:0487 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0992) ProcessName:python.exe(26424) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MODEL] failed, Ret[0x80000001] +Warning 2024-10-30 22:39:06:0487 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0996) ProcessName:python.exe(26424) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_VERSION] failed, Ret[0x80000001] +Warning 2024-10-30 22:39:06:0487 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1000) ProcessName:python.exe(26424) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MANUFACTURER] failed, Ret[0x80000001] +Warning 2024-10-30 22:39:06:0487 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1004) ProcessName:python.exe(26424) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_USER_DEFINED_NAME] failed, Ret[0x80000001] +Error 2024-10-30 22:41:48:0478 DevID: Source-Line:MvCameraControl.dll(OtherLoadLibrary.cpp-L0709) ProcessName:python.exe(16272) Description:[LoadSRAllFunctions]hSRModule is NULL, Ret[0x8000000c] +Warning 2024-10-30 22:41:48:0481 DevID: Source-Line:MvCameraControl.dll(GenTLLoadLibraryEx.cpp-L0345) ProcessName:python.exe(16272) Description:[LoadCtiLibInter]MV_GCSetConfigIntValue is NULL, CTI path[D:\environment\envs\UICreater\lib\site-packages\MvProducerVIR.dll] +Warning 2024-10-30 22:41:48:0483 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0992) ProcessName:python.exe(16272) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MODEL] failed, Ret[0x80000001] +Warning 2024-10-30 22:41:48:0483 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0996) ProcessName:python.exe(16272) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_VERSION] failed, Ret[0x80000001] +Warning 2024-10-30 22:41:48:0483 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1000) ProcessName:python.exe(16272) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MANUFACTURER] failed, Ret[0x80000001] +Warning 2024-10-30 22:41:48:0483 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1004) ProcessName:python.exe(16272) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_USER_DEFINED_NAME] failed, Ret[0x80000001] +Warning 2024-10-30 22:41:48:0483 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0992) ProcessName:python.exe(16272) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MODEL] failed, Ret[0x80000001] +Warning 2024-10-30 22:41:48:0483 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0996) ProcessName:python.exe(16272) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_VERSION] failed, Ret[0x80000001] +Warning 2024-10-30 22:41:48:0483 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1000) ProcessName:python.exe(16272) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MANUFACTURER] failed, Ret[0x80000001] +Warning 2024-10-30 22:41:48:0483 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1004) ProcessName:python.exe(16272) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_USER_DEFINED_NAME] failed, Ret[0x80000001] diff --git a/main.py b/main.py index 50fdc20..ce1b68e 100644 --- a/main.py +++ b/main.py @@ -44,13 +44,81 @@ class MainWindow(QMainWindow, Ui_MainWindow): self.init_Run() self.init_robot_info() self.init_FeedLine() - + self.init_IOPanel() self.start_Runing() # self.init_log() + def init_IOPanel(self): + self.dirt_io_points = {} + self.dirt_io_points.setdefault('y1', self.widget_y1) + self.dirt_io_points.setdefault('y2', self.widget_y2) + self.dirt_io_points.setdefault('y3', self.widget_y3) + self.dirt_io_points.setdefault('y4', self.widget_y4) + self.dirt_io_points.setdefault('y5', self.widget_y5) + self.dirt_io_points.setdefault('y6', self.widget_y6) + self.dirt_io_points.setdefault('y7', self.widget_y7) + self.dirt_io_points.setdefault('y8', self.widget_y8) + self.dirt_io_points.setdefault('y9', self.widget_y9) + self.dirt_io_points.setdefault('y10', self.widget_y10) + self.dirt_io_points.setdefault('y11', self.widget_y11) + self.dirt_io_points.setdefault('y12', self.widget_y12) + self.dirt_io_points.setdefault('y13', self.widget_y13) + self.dirt_io_points.setdefault('y14', self.widget_y14) + self.dirt_io_points.setdefault('y15', self.widget_y15) + self.dirt_io_points.setdefault('y16', self.widget_y16) + self.dirt_io_points.setdefault('y17', self.widget_y17) + self.dirt_io_points.setdefault('y18', self.widget_y18) + self.dirt_io_points.setdefault('y19', self.widget_y19) + self.dirt_io_points.setdefault('y20', self.widget_y20) + self.dirt_io_points.setdefault('y21', self.widget_y21) + self.dirt_io_points.setdefault('y22', self.widget_y22) + self.dirt_io_points.setdefault('y23', self.widget_y23) + self.dirt_io_points.setdefault('y24', self.widget_y24) + self.dirt_io_points.setdefault('y25', self.widget_y25) + self.dirt_io_points.setdefault('y26', self.widget_y26) + self.dirt_io_points.setdefault('y27', self.widget_y27) + self.dirt_io_points.setdefault('y28', self.widget_y28) + self.dirt_io_points.setdefault('y29', self.widget_y29) + self.dirt_io_points.setdefault('y30', self.widget_y30) + self.dirt_io_points.setdefault('y31', self.widget_y31) + self.dirt_io_points.setdefault('y32', self.widget_y32) + self.widget_y1.animation.finished.connect(lambda _, index=0: self.send_IO_Point_OpenOrClose(index)) + self.widget_y2.animation.finished.connect(lambda _, index=1: self.send_IO_Point_OpenOrClose(index)) + self.widget_y3.animation.finished.connect(lambda _, index=2: self.send_IO_Point_OpenOrClose(index)) + self.widget_y4.animation.finished.connect(lambda _, index=3: self.send_IO_Point_OpenOrClose(index)) + self.widget_y5.animation.finished.connect(lambda _, index=4: self.send_IO_Point_OpenOrClose(index)) + self.widget_y6.animation.finished.connect(lambda _, index=5: self.send_IO_Point_OpenOrClose(index)) + self.widget_y7.animation.finished.connect(lambda _, index=6: self.send_IO_Point_OpenOrClose(index)) + self.widget_y8.animation.finished.connect(lambda _, index=7: self.send_IO_Point_OpenOrClose(index)) + self.widget_y9.animation.finished.connect(lambda _, index=8: self.send_IO_Point_OpenOrClose(index)) + self.widget_y10.animation.finished.connect(lambda _, index=9: self.send_IO_Point_OpenOrClose(index)) + self.widget_y11.animation.finished.connect(lambda _, index=10: self.send_IO_Point_OpenOrClose(index)) + self.widget_y12.animation.finished.connect(lambda _, index=11: self.send_IO_Point_OpenOrClose(index)) + self.widget_y13.animation.finished.connect(lambda _, index=12: self.send_IO_Point_OpenOrClose(index)) + self.widget_y14.animation.finished.connect(lambda _, index=13: self.send_IO_Point_OpenOrClose(index)) + self.widget_y15.animation.finished.connect(lambda _, index=14: self.send_IO_Point_OpenOrClose(index)) + self.widget_y16.animation.finished.connect(lambda _, index=15: self.send_IO_Point_OpenOrClose(index)) + self.widget_y17.animation.finished.connect(lambda _, index=16: self.send_IO_Point_OpenOrClose(index)) + self.widget_y18.animation.finished.connect(lambda _, index=17: self.send_IO_Point_OpenOrClose(index)) + self.widget_y19.animation.finished.connect(lambda _, index=18: self.send_IO_Point_OpenOrClose(index)) + self.widget_y20.animation.finished.connect(lambda _, index=19: self.send_IO_Point_OpenOrClose(index)) + self.widget_y21.animation.finished.connect(lambda _, index=21: self.send_IO_Point_OpenOrClose(index)) + self.widget_y22.animation.finished.connect(lambda _, index=22: self.send_IO_Point_OpenOrClose(index)) + self.widget_y23.animation.finished.connect(lambda _, index=23: self.send_IO_Point_OpenOrClose(index)) + self.widget_y24.animation.finished.connect(lambda _, index=24: self.send_IO_Point_OpenOrClose(index)) + self.widget_y25.animation.finished.connect(lambda _, index=25: self.send_IO_Point_OpenOrClose(index)) + self.widget_y26.animation.finished.connect(lambda _, index=26: self.send_IO_Point_OpenOrClose(index)) + self.widget_y27.animation.finished.connect(lambda _, index=27: self.send_IO_Point_OpenOrClose(index)) + self.widget_y28.animation.finished.connect(lambda _, index=28: self.send_IO_Point_OpenOrClose(index)) + self.widget_y29.animation.finished.connect(lambda _, index=29: self.send_IO_Point_OpenOrClose(index)) + self.widget_y30.animation.finished.connect(lambda _, index=30: self.send_IO_Point_OpenOrClose(index)) + self.widget_y31.animation.finished.connect(lambda _, index=31: self.send_IO_Point_OpenOrClose(index)) + self.widget_y32.animation.finished.connect(lambda _, index=32: self.send_IO_Point_OpenOrClose(index)) + + def init_qss(self): self.active_status_Qss = """ @@ -908,7 +976,20 @@ class MainWindow(QMainWindow, Ui_MainWindow): self.updateUI_label_detection() self.updateUI_label_status() self.updateUI_frame_sign(self.feeding.feedStatus) + self.updateUI_IOPanel() + def updateUI_IOPanel(self): + try: + io_bits = self.robotClient.status_model.get_IO_bits() + for index, bit in enumerate(io_bits): + toggle = self.dirt_io_points[f'y{index+1}'] + if toggle.is_on == bit: + continue + else: + toggle.toggle() + except: + log.log_message(logging.ERROR, Constant.str_sys_log_IO_error) + pass def updateUI_label_detection(self): backgroud_img = Util.util_pic.cv2_to_qpixmap(self.feeding.detection_image) backgroud_img = backgroud_img.scaled(self.label_showDetection.size().width(),self.label_showDetection.size().height(), Qt.AspectRatioMode.IgnoreAspectRatio,Qt.TransformationMode.SmoothTransformation) @@ -1340,6 +1421,12 @@ class MainWindow(QMainWindow, Ui_MainWindow): else: self.frame_2.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed) + def send_IO_Point_OpenOrClose(self,index): + toggel = self.sender() + if toggel.is_on: + self.feeding.sendIOControl(index, 1) + else: + self.feeding.sendIOControl(index, 0) if __name__ == "__main__": app = QApplication(sys.argv) diff --git a/toggleswitch.py b/toggleswitch.py index c91ddfe..bd115b1 100644 --- a/toggleswitch.py +++ b/toggleswitch.py @@ -1,4 +1,4 @@ -from PySide6.QtWidgets import QApplication, QWidget, QLabel, QPushButton +from PySide6.QtWidgets import QApplication, QWidget, QLabel from PySide6.QtCore import QPropertyAnimation, QRect, QSize @@ -47,5 +47,32 @@ class ToggleSwitch(QWidget): self.animation.start() +class MainWindow(QWidget): + def __init__(self): + super().__init__() + self.setWindowTitle("Toggle Switch Example") + self.setFixedSize(200, 100) + + # 创建滑动开关按钮 + self.toggle = ToggleSwitch(self) + self.toggle.move(70, 35) # 将开关放置在窗口中间 + + # 创建状态标签 + self.label = QLabel("Switch is OFF", self) + self.label.move(70, 70) + + # 连接滑动开关的状态切换 + self.toggle.animation.finished.connect(self.update_label) + + def update_label(self): + # 更新标签显示的开关状态 + if self.toggle.is_on: + self.label.setText("Switch is ON") + else: + self.label.setText("Switch is OFF") +app = QApplication([]) +window = MainWindow() +window.show() +app.exec() diff --git a/ui_MainWin.py b/ui_MainWin.py index d85bb41..12cc98f 100644 --- a/ui_MainWin.py +++ b/ui_MainWin.py @@ -20,6 +20,8 @@ from PySide6.QtWidgets import (QApplication, QComboBox, QFrame, QGridLayout, QLineEdit, QMainWindow, QPushButton, QSizePolicy, QSlider, QStackedWidget, QTabWidget, QTableWidget, QTableWidgetItem, QTextEdit, QVBoxLayout, QWidget) + +from toggleswitch import ToggleSwitch import MainRecources_rc class Ui_MainWindow(object): @@ -374,6 +376,30 @@ class Ui_MainWindow(object): self.verticalLayout_4.addWidget(self.pushButton_leftmenu_produce) + self.pushButton_leftmenu_IO = QPushButton(self.frame_10) + self.pushButton_leftmenu_IO.setObjectName(u"pushButton_leftmenu_IO") + sizePolicy5.setHeightForWidth(self.pushButton_leftmenu_IO.sizePolicy().hasHeightForWidth()) + self.pushButton_leftmenu_IO.setSizePolicy(sizePolicy5) + self.pushButton_leftmenu_IO.setStyleSheet(u"\n" +"\n" +" QPushButton {\n" +" \n" +" background-color: rgb(16, 31, 63);\n" +" color: rgb(255, 255, 255);\n" +"\n" +" }\n" +" QPushButton:hover {\n" +" border-image: url(:/main/Image/backgroud_leftMenu_btn_child.jpg);\n" +"\n" +" }\n" +"*:pressed\n" +"{\n" +"border-image: url(:/main/Image/backgroud_leftMenu_btn_child.jpg);\n" +"}\n" +"") + + self.verticalLayout_4.addWidget(self.pushButton_leftmenu_IO) + self.pushButton_leftmenu_position = QPushButton(self.frame_10) self.pushButton_leftmenu_position.setObjectName(u"pushButton_leftmenu_position") sizePolicy5.setHeightForWidth(self.pushButton_leftmenu_position.sizePolicy().hasHeightForWidth()) @@ -984,6 +1010,440 @@ class Ui_MainWindow(object): self.verticalLayout_7.setStretch(0, 1) self.stackedWidget_view.addWidget(self.page_3) + self.page_7 = QWidget() + self.page_7.setObjectName(u"page_7") + self.horizontalLayout_19 = QHBoxLayout(self.page_7) + self.horizontalLayout_19.setSpacing(0) + self.horizontalLayout_19.setObjectName(u"horizontalLayout_19") + self.horizontalLayout_19.setContentsMargins(0, 0, 0, 0) + self.frame_11 = QFrame(self.page_7) + self.frame_11.setObjectName(u"frame_11") + self.frame_11.setStyleSheet(u"font: 700 16pt \"Microsoft YaHei UI\";") + self.frame_11.setFrameShape(QFrame.Shape.StyledPanel) + self.frame_11.setFrameShadow(QFrame.Shadow.Raised) + self.gridLayout_8 = QGridLayout(self.frame_11) + self.gridLayout_8.setObjectName(u"gridLayout_8") + self.gridLayout_8.setVerticalSpacing(40) + self.label_5 = QLabel(self.frame_11) + self.label_5.setObjectName(u"label_5") + self.label_5.setStyleSheet(u"color: rgb(255, 255, 255);") + self.label_5.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_8.addWidget(self.label_5, 0, 0, 1, 1) + + self.widget_y1 = ToggleSwitch(self.frame_11) + self.widget_y1.setObjectName(u"widget_y1") + self.widget_y1.setStyleSheet(u"background-color: rgb(0, 170, 0);") + + self.gridLayout_8.addWidget(self.widget_y1, 0, 1, 1, 1) + + self.label_57 = QLabel(self.frame_11) + self.label_57.setObjectName(u"label_57") + self.label_57.setStyleSheet(u"color: rgb(255, 255, 255);") + self.label_57.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_8.addWidget(self.label_57, 0, 2, 1, 1) + + self.widget_y2 = ToggleSwitch(self.frame_11) + self.widget_y2.setObjectName(u"widget_y2") + self.widget_y2.setStyleSheet(u"background-color: rgb(0, 170, 0);") + + self.gridLayout_8.addWidget(self.widget_y2, 0, 3, 1, 1) + + self.label_58 = QLabel(self.frame_11) + self.label_58.setObjectName(u"label_58") + self.label_58.setStyleSheet(u"color: rgb(255, 255, 255);") + self.label_58.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_8.addWidget(self.label_58, 0, 4, 1, 1) + + self.widget_y3 = ToggleSwitch(self.frame_11) + self.widget_y3.setObjectName(u"widget_y3") + self.widget_y3.setStyleSheet(u"background-color: rgb(0, 170, 0);") + + self.gridLayout_8.addWidget(self.widget_y3, 0, 5, 1, 1) + + self.label_59 = QLabel(self.frame_11) + self.label_59.setObjectName(u"label_59") + self.label_59.setStyleSheet(u"color: rgb(255, 255, 255);") + self.label_59.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_8.addWidget(self.label_59, 0, 6, 1, 1) + + self.widget_y4 = ToggleSwitch(self.frame_11) + self.widget_y4.setObjectName(u"widget_y4") + self.widget_y4.setStyleSheet(u"background-color: rgb(0, 170, 0);") + + self.gridLayout_8.addWidget(self.widget_y4, 0, 7, 1, 1) + + self.label_7 = QLabel(self.frame_11) + self.label_7.setObjectName(u"label_7") + self.label_7.setStyleSheet(u"color: rgb(255, 255, 255);") + self.label_7.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_8.addWidget(self.label_7, 1, 0, 1, 1) + + self.widget_y5 = ToggleSwitch(self.frame_11) + self.widget_y5.setObjectName(u"widget_y5") + self.widget_y5.setStyleSheet(u"background-color: rgb(0, 170, 0);") + + self.gridLayout_8.addWidget(self.widget_y5, 1, 1, 1, 1) + + self.label_61 = QLabel(self.frame_11) + self.label_61.setObjectName(u"label_61") + self.label_61.setStyleSheet(u"color: rgb(255, 255, 255);") + self.label_61.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_8.addWidget(self.label_61, 1, 2, 1, 1) + + self.widget_y6 = ToggleSwitch(self.frame_11) + self.widget_y6.setObjectName(u"widget_y6") + self.widget_y6.setStyleSheet(u"background-color: rgb(0, 170, 0);") + + self.gridLayout_8.addWidget(self.widget_y6, 1, 3, 1, 1) + + self.label_62 = QLabel(self.frame_11) + self.label_62.setObjectName(u"label_62") + self.label_62.setStyleSheet(u"color: rgb(255, 255, 255);") + self.label_62.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_8.addWidget(self.label_62, 1, 4, 1, 1) + + self.widget_y7 = ToggleSwitch(self.frame_11) + self.widget_y7.setObjectName(u"widget_y7") + self.widget_y7.setStyleSheet(u"background-color: rgb(0, 170, 0);") + + self.gridLayout_8.addWidget(self.widget_y7, 1, 5, 1, 1) + + self.label_60 = QLabel(self.frame_11) + self.label_60.setObjectName(u"label_60") + self.label_60.setStyleSheet(u"color: rgb(255, 255, 255);") + self.label_60.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_8.addWidget(self.label_60, 1, 6, 1, 1) + + self.widget_y8 = ToggleSwitch(self.frame_11) + self.widget_y8.setObjectName(u"widget_y8") + self.widget_y8.setStyleSheet(u"background-color: rgb(0, 170, 0);") + + self.gridLayout_8.addWidget(self.widget_y8, 1, 7, 1, 1) + + self.label_55 = QLabel(self.frame_11) + self.label_55.setObjectName(u"label_55") + self.label_55.setStyleSheet(u"color: rgb(255, 255, 255);") + self.label_55.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_8.addWidget(self.label_55, 2, 0, 1, 1) + + self.widget_y9 = ToggleSwitch(self.frame_11) + self.widget_y9.setObjectName(u"widget_y9") + self.widget_y9.setStyleSheet(u"background-color: rgb(0, 170, 0);") + + self.gridLayout_8.addWidget(self.widget_y9, 2, 1, 1, 1) + + self.label_65 = QLabel(self.frame_11) + self.label_65.setObjectName(u"label_65") + self.label_65.setStyleSheet(u"color: rgb(255, 255, 255);") + self.label_65.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_8.addWidget(self.label_65, 2, 2, 1, 1) + + self.widget_y10 = ToggleSwitch(self.frame_11) + self.widget_y10.setObjectName(u"widget_y10") + self.widget_y10.setStyleSheet(u"background-color: rgb(0, 170, 0);") + + self.gridLayout_8.addWidget(self.widget_y10, 2, 3, 1, 1) + + self.label_64 = QLabel(self.frame_11) + self.label_64.setObjectName(u"label_64") + self.label_64.setStyleSheet(u"color: rgb(255, 255, 255);") + self.label_64.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_8.addWidget(self.label_64, 2, 4, 1, 1) + + self.widget_y11 = ToggleSwitch(self.frame_11) + self.widget_y11.setObjectName(u"widget_y11") + self.widget_y11.setStyleSheet(u"background-color: rgb(0, 170, 0);") + + self.gridLayout_8.addWidget(self.widget_y11, 2, 5, 1, 1) + + self.label_63 = QLabel(self.frame_11) + self.label_63.setObjectName(u"label_63") + self.label_63.setStyleSheet(u"color: rgb(255, 255, 255);") + self.label_63.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_8.addWidget(self.label_63, 2, 6, 1, 1) + + self.widget_y12 = ToggleSwitch(self.frame_11) + self.widget_y12.setObjectName(u"widget_y12") + self.widget_y12.setStyleSheet(u"background-color: rgb(0, 170, 0);") + + self.gridLayout_8.addWidget(self.widget_y12, 2, 7, 1, 1) + + self.label_56 = QLabel(self.frame_11) + self.label_56.setObjectName(u"label_56") + self.label_56.setStyleSheet(u"color: rgb(255, 255, 255);") + self.label_56.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_8.addWidget(self.label_56, 3, 0, 1, 1) + + self.widget_y13 = ToggleSwitch(self.frame_11) + self.widget_y13.setObjectName(u"widget_y13") + self.widget_y13.setStyleSheet(u"background-color: rgb(0, 170, 0);") + + self.gridLayout_8.addWidget(self.widget_y13, 3, 1, 1, 1) + + self.label_68 = QLabel(self.frame_11) + self.label_68.setObjectName(u"label_68") + self.label_68.setStyleSheet(u"color: rgb(255, 255, 255);") + self.label_68.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_8.addWidget(self.label_68, 3, 2, 1, 1) + + self.widget_y14 = ToggleSwitch(self.frame_11) + self.widget_y14.setObjectName(u"widget_y14") + self.widget_y14.setStyleSheet(u"background-color: rgb(0, 170, 0);") + + self.gridLayout_8.addWidget(self.widget_y14, 3, 3, 1, 1) + + self.label_67 = QLabel(self.frame_11) + self.label_67.setObjectName(u"label_67") + self.label_67.setStyleSheet(u"color: rgb(255, 255, 255);") + self.label_67.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_8.addWidget(self.label_67, 3, 4, 1, 1) + + self.widget_y15 = ToggleSwitch(self.frame_11) + self.widget_y15.setObjectName(u"widget_y15") + self.widget_y15.setStyleSheet(u"background-color: rgb(0, 170, 0);") + + self.gridLayout_8.addWidget(self.widget_y15, 3, 5, 1, 1) + + self.label_66 = QLabel(self.frame_11) + self.label_66.setObjectName(u"label_66") + self.label_66.setStyleSheet(u"color: rgb(255, 255, 255);") + self.label_66.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_8.addWidget(self.label_66, 3, 6, 1, 1) + + self.widget_y16 = ToggleSwitch(self.frame_11) + self.widget_y16.setObjectName(u"widget_y16") + self.widget_y16.setStyleSheet(u"background-color: rgb(0, 170, 0);") + + self.gridLayout_8.addWidget(self.widget_y16, 3, 7, 1, 1) + + self.label_69 = QLabel(self.frame_11) + self.label_69.setObjectName(u"label_69") + self.label_69.setStyleSheet(u"color: rgb(255, 255, 255);") + self.label_69.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_8.addWidget(self.label_69, 4, 0, 1, 1) + + self.widget_y17 = ToggleSwitch(self.frame_11) + self.widget_y17.setObjectName(u"widget_y17") + self.widget_y17.setStyleSheet(u"background-color: rgb(0, 170, 0);") + + self.gridLayout_8.addWidget(self.widget_y17, 4, 1, 1, 1) + + self.label_81 = QLabel(self.frame_11) + self.label_81.setObjectName(u"label_81") + self.label_81.setStyleSheet(u"color: rgb(255, 255, 255);") + self.label_81.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_8.addWidget(self.label_81, 4, 2, 1, 1) + + self.widget_y18 = ToggleSwitch(self.frame_11) + self.widget_y18.setObjectName(u"widget_y18") + self.widget_y18.setStyleSheet(u"background-color: rgb(0, 170, 0);") + + self.gridLayout_8.addWidget(self.widget_y18, 4, 3, 1, 1) + + self.label_82 = QLabel(self.frame_11) + self.label_82.setObjectName(u"label_82") + self.label_82.setStyleSheet(u"color: rgb(255, 255, 255);") + self.label_82.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_8.addWidget(self.label_82, 4, 4, 1, 1) + + self.widget_y19 = ToggleSwitch(self.frame_11) + self.widget_y19.setObjectName(u"widget_y19") + self.widget_y19.setStyleSheet(u"background-color: rgb(0, 170, 0);") + + self.gridLayout_8.addWidget(self.widget_y19, 4, 5, 1, 1) + + self.label_78 = QLabel(self.frame_11) + self.label_78.setObjectName(u"label_78") + self.label_78.setStyleSheet(u"color: rgb(255, 255, 255);") + self.label_78.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_8.addWidget(self.label_78, 4, 6, 1, 1) + + self.widget_y20 = ToggleSwitch(self.frame_11) + self.widget_y20.setObjectName(u"widget_y20") + self.widget_y20.setStyleSheet(u"background-color: rgb(0, 170, 0);") + + self.gridLayout_8.addWidget(self.widget_y20, 4, 7, 1, 1) + + self.label_72 = QLabel(self.frame_11) + self.label_72.setObjectName(u"label_72") + self.label_72.setStyleSheet(u"color: rgb(255, 255, 255);") + self.label_72.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_8.addWidget(self.label_72, 5, 0, 1, 1) + + self.widget_y21 = ToggleSwitch(self.frame_11) + self.widget_y21.setObjectName(u"widget_y21") + self.widget_y21.setStyleSheet(u"background-color: rgb(0, 170, 0);") + + self.gridLayout_8.addWidget(self.widget_y21, 5, 1, 1, 1) + + self.label_84 = QLabel(self.frame_11) + self.label_84.setObjectName(u"label_84") + self.label_84.setStyleSheet(u"color: rgb(255, 255, 255);") + self.label_84.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_8.addWidget(self.label_84, 5, 2, 1, 1) + + self.widget_y22 = ToggleSwitch(self.frame_11) + self.widget_y22.setObjectName(u"widget_y22") + self.widget_y22.setStyleSheet(u"background-color: rgb(0, 170, 0);") + + self.gridLayout_8.addWidget(self.widget_y22, 5, 3, 1, 1) + + self.label_77 = QLabel(self.frame_11) + self.label_77.setObjectName(u"label_77") + self.label_77.setStyleSheet(u"color: rgb(255, 255, 255);") + self.label_77.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_8.addWidget(self.label_77, 5, 4, 1, 1) + + self.widget_y23 = ToggleSwitch(self.frame_11) + self.widget_y23.setObjectName(u"widget_y23") + self.widget_y23.setStyleSheet(u"background-color: rgb(0, 170, 0);") + + self.gridLayout_8.addWidget(self.widget_y23, 5, 5, 1, 1) + + self.label_71 = QLabel(self.frame_11) + self.label_71.setObjectName(u"label_71") + self.label_71.setStyleSheet(u"color: rgb(255, 255, 255);") + self.label_71.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_8.addWidget(self.label_71, 5, 6, 1, 1) + + self.widget_y24 = ToggleSwitch(self.frame_11) + self.widget_y24.setObjectName(u"widget_y24") + self.widget_y24.setStyleSheet(u"background-color: rgb(0, 170, 0);") + + self.gridLayout_8.addWidget(self.widget_y24, 5, 7, 1, 1) + + self.label_70 = QLabel(self.frame_11) + self.label_70.setObjectName(u"label_70") + self.label_70.setStyleSheet(u"color: rgb(255, 255, 255);") + self.label_70.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_8.addWidget(self.label_70, 6, 0, 1, 1) + + self.widget_y25 = ToggleSwitch(self.frame_11) + self.widget_y25.setObjectName(u"widget_y25") + self.widget_y25.setStyleSheet(u"background-color: rgb(0, 170, 0);") + + self.gridLayout_8.addWidget(self.widget_y25, 6, 1, 1, 1) + + self.label_80 = QLabel(self.frame_11) + self.label_80.setObjectName(u"label_80") + self.label_80.setStyleSheet(u"color: rgb(255, 255, 255);") + self.label_80.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_8.addWidget(self.label_80, 6, 2, 1, 1) + + self.widget_y26 = ToggleSwitch(self.frame_11) + self.widget_y26.setObjectName(u"widget_y26") + self.widget_y26.setStyleSheet(u"background-color: rgb(0, 170, 0);") + + self.gridLayout_8.addWidget(self.widget_y26, 6, 3, 1, 1) + + self.label_74 = QLabel(self.frame_11) + self.label_74.setObjectName(u"label_74") + self.label_74.setStyleSheet(u"color: rgb(255, 255, 255);") + self.label_74.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_8.addWidget(self.label_74, 6, 4, 1, 1) + + self.widget_y27 = ToggleSwitch(self.frame_11) + self.widget_y27.setObjectName(u"widget_y27") + self.widget_y27.setStyleSheet(u"background-color: rgb(0, 170, 0);") + + self.gridLayout_8.addWidget(self.widget_y27, 6, 5, 1, 1) + + self.label_73 = QLabel(self.frame_11) + self.label_73.setObjectName(u"label_73") + self.label_73.setStyleSheet(u"color: rgb(255, 255, 255);") + self.label_73.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_8.addWidget(self.label_73, 6, 6, 1, 1) + + self.widget_y28 = ToggleSwitch(self.frame_11) + self.widget_y28.setObjectName(u"widget_y28") + self.widget_y28.setStyleSheet(u"background-color: rgb(0, 170, 0);") + + self.gridLayout_8.addWidget(self.widget_y28, 6, 7, 1, 1) + + self.label_75 = QLabel(self.frame_11) + self.label_75.setObjectName(u"label_75") + self.label_75.setStyleSheet(u"color: rgb(255, 255, 255);") + self.label_75.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_8.addWidget(self.label_75, 7, 0, 1, 1) + + self.widget_y29 = ToggleSwitch(self.frame_11) + self.widget_y29.setObjectName(u"widget_y29") + self.widget_y29.setStyleSheet(u"background-color: rgb(0, 170, 0);") + + self.gridLayout_8.addWidget(self.widget_y29, 7, 1, 1, 1) + + self.label_76 = QLabel(self.frame_11) + self.label_76.setObjectName(u"label_76") + self.label_76.setStyleSheet(u"color: rgb(255, 255, 255);") + self.label_76.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_8.addWidget(self.label_76, 7, 2, 1, 1) + + self.widget_y30 = ToggleSwitch(self.frame_11) + self.widget_y30.setObjectName(u"widget_y30") + self.widget_y30.setStyleSheet(u"background-color: rgb(0, 170, 0);") + + self.gridLayout_8.addWidget(self.widget_y30, 7, 3, 1, 1) + + self.label_83 = QLabel(self.frame_11) + self.label_83.setObjectName(u"label_83") + self.label_83.setStyleSheet(u"color: rgb(255, 255, 255);") + self.label_83.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_8.addWidget(self.label_83, 7, 4, 1, 1) + + self.widget_y31 = ToggleSwitch(self.frame_11) + self.widget_y31.setObjectName(u"widget_y31") + self.widget_y31.setStyleSheet(u"background-color: rgb(0, 170, 0);") + + self.gridLayout_8.addWidget(self.widget_y31, 7, 5, 1, 1) + + self.label_79 = QLabel(self.frame_11) + self.label_79.setObjectName(u"label_79") + self.label_79.setStyleSheet(u"color: rgb(255, 255, 255);") + self.label_79.setAlignment(Qt.AlignmentFlag.AlignCenter) + + self.gridLayout_8.addWidget(self.label_79, 7, 6, 1, 1) + + self.widget_y32 = ToggleSwitch(self.frame_11) + self.widget_y32.setObjectName(u"widget_y32") + self.widget_y32.setStyleSheet(u"background-color: rgb(0, 170, 0);") + + self.gridLayout_8.addWidget(self.widget_y32, 7, 7, 1, 1) + + + self.horizontalLayout_19.addWidget(self.frame_11) + + self.stackedWidget_view.addWidget(self.page_7) self.page_4 = QWidget() self.page_4.setObjectName(u"page_4") self.verticalLayout_15 = QVBoxLayout(self.page_4) @@ -3045,7 +3505,7 @@ class Ui_MainWindow(object): self.retranslateUi(MainWindow) - self.stackedWidget_view.setCurrentIndex(2) + self.stackedWidget_view.setCurrentIndex(1) self.tabWidget.setCurrentIndex(1) self.stackedWidget_num.setCurrentIndex(0) @@ -3065,6 +3525,7 @@ class Ui_MainWindow(object): self.pushButton_exit.setText(QCoreApplication.translate("MainWindow", u"\u9000\u51fa", None)) self.pushButton_sysseting.setText(QCoreApplication.translate("MainWindow", u"\u7cfb\u7edf\u8bbe\u7f6e", None)) self.pushButton_leftmenu_produce.setText(QCoreApplication.translate("MainWindow", u"\u751f\u4ea7\u754c\u9762", None)) + self.pushButton_leftmenu_IO.setText(QCoreApplication.translate("MainWindow", u"IO\u9762\u677f", None)) self.pushButton_leftmenu_position.setText(QCoreApplication.translate("MainWindow", u"\u4f4d\u7f6e\u8bbe\u5b9a", None)) self.pushButton_leftmenu_baseSeting.setText(QCoreApplication.translate("MainWindow", u"\u57fa\u7840\u8bbe\u7f6e", None)) self.pushButton_leftmenu_posDebug.setText(QCoreApplication.translate("MainWindow", u"\u70b9\u4f4d\u8c03\u8bd5", None)) @@ -3093,6 +3554,38 @@ class Ui_MainWindow(object): self.label_status_model_2.setText(QCoreApplication.translate("MainWindow", u"1", None)) self.label_12.setText(QCoreApplication.translate("MainWindow", u"\u62a5\u8b66\u4ee3\u7801\uff1a", None)) self.label_status_model_3.setText(QCoreApplication.translate("MainWindow", u"200", None)) + self.label_5.setText(QCoreApplication.translate("MainWindow", u"Y1", None)) + self.label_57.setText(QCoreApplication.translate("MainWindow", u"2", None)) + self.label_58.setText(QCoreApplication.translate("MainWindow", u"3", None)) + self.label_59.setText(QCoreApplication.translate("MainWindow", u"4", None)) + self.label_7.setText(QCoreApplication.translate("MainWindow", u"5", None)) + self.label_61.setText(QCoreApplication.translate("MainWindow", u"6", None)) + self.label_62.setText(QCoreApplication.translate("MainWindow", u"7", None)) + self.label_60.setText(QCoreApplication.translate("MainWindow", u"8", None)) + self.label_55.setText(QCoreApplication.translate("MainWindow", u"9", None)) + self.label_65.setText(QCoreApplication.translate("MainWindow", u"10", None)) + self.label_64.setText(QCoreApplication.translate("MainWindow", u"11", None)) + self.label_63.setText(QCoreApplication.translate("MainWindow", u"12", None)) + self.label_56.setText(QCoreApplication.translate("MainWindow", u"13", None)) + self.label_68.setText(QCoreApplication.translate("MainWindow", u"14", None)) + self.label_67.setText(QCoreApplication.translate("MainWindow", u"15", None)) + self.label_66.setText(QCoreApplication.translate("MainWindow", u"16", None)) + self.label_69.setText(QCoreApplication.translate("MainWindow", u"17", None)) + self.label_81.setText(QCoreApplication.translate("MainWindow", u"18", None)) + self.label_82.setText(QCoreApplication.translate("MainWindow", u"19", None)) + self.label_78.setText(QCoreApplication.translate("MainWindow", u"20", None)) + self.label_72.setText(QCoreApplication.translate("MainWindow", u"21", None)) + self.label_84.setText(QCoreApplication.translate("MainWindow", u"22", None)) + self.label_77.setText(QCoreApplication.translate("MainWindow", u"23", None)) + self.label_71.setText(QCoreApplication.translate("MainWindow", u"24", None)) + self.label_70.setText(QCoreApplication.translate("MainWindow", u"25", None)) + self.label_80.setText(QCoreApplication.translate("MainWindow", u"26", None)) + self.label_74.setText(QCoreApplication.translate("MainWindow", u"27", None)) + self.label_73.setText(QCoreApplication.translate("MainWindow", u"28", None)) + self.label_75.setText(QCoreApplication.translate("MainWindow", u"29", None)) + self.label_76.setText(QCoreApplication.translate("MainWindow", u"30", None)) + self.label_83.setText(QCoreApplication.translate("MainWindow", u"31", None)) + self.label_79.setText(QCoreApplication.translate("MainWindow", u"32", None)) self.pushButton_tableFeedSet_save.setText(QCoreApplication.translate("MainWindow", u"\u4fdd\u5b58", None)) self.pushButton_tableFeedSet_addRow.setText(QCoreApplication.translate("MainWindow", u"\u65b0\u589e\u7ebf", None)) self.pushButton_tableFeedSet_deleRow.setText(QCoreApplication.translate("MainWindow", u"\u5220\u9664\u7ebf", None))