update 更新界面图标,增加余料显示,增加日志图标
This commit is contained in:
@ -110,7 +110,7 @@ class Feeding():
|
||||
elif self.feedStatus == FeedStatus.FPhoto:
|
||||
log.log_message(logging.INFO, Constant.str_feed_photo)
|
||||
if self.feedConfig.feedLine.photo_position.compare(real_position):
|
||||
code, img, xyz, uvw = self.detection.get_position() #检测结果
|
||||
code, img, xyz, uvw, mng = self.detection.get_position() #检测结果
|
||||
log.log_message(logging.INFO, Constant.str_feed_takePhoto)
|
||||
self.detection_image = img
|
||||
if xyz!=None:
|
||||
@ -125,8 +125,7 @@ class Feeding():
|
||||
self.robotClient.status_model.world_5)
|
||||
|
||||
# 黄老师给我的xyz和法向量
|
||||
|
||||
target_position, noraml_base = getPosition(*xyz, *uvw,rotation)
|
||||
target_position, noraml_base = getPosition(*xyz, *uvw,rotation,*mng)
|
||||
log.log_message(logging.INFO, Constant.str_feed_covert_success)
|
||||
self.feedConfig.feedLine.take_position = Real_Position().init_position(*target_position[:3],*noraml_base)
|
||||
self.feedStatus = FeedStatus.FTake
|
||||
|
||||
1
Image/log.svg
Normal file
1
Image/log.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1729780516602" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5417" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M960 512c0-59.5-40.9-109.7-96.1-124v68.6c-9.4-5.5-20.4-8.6-32-8.6-35.3 0-64.1 28.7-64.1 64s28.7 64 64.1 64c11.7 0 22.6-3.1 32-8.6V636c-10.2 2.6-21 4.1-32 4.1-70.7 0-128.1-57.4-128.1-128s57.5-128 128.1-128c11.1 0 21.8 1.4 32 4V192c0-52.9-41.8-96-93.1-96H221.2c-51.3 0-93.1 43.1-93.1 96v159.5h128.1v64H128.1V352H64v64h64.1v191.5h128.1v64H127.1V608H64v64h64.1v160c0 52.9 41.8 96 93.1 96h549.6c51.3 0 93.1-43.1 93.1-96V635.9C919.1 621.7 960 571.5 960 512zM320.3 288h384.4v64H320.3v-64z m0 192h318.4v64H320.3v-64z m384.4 256H320.3v-64h384.4v64z m164.4-276z m4.9 3.9l-0.1-0.1s0.1 0 0.1 0.1zM869.1 564z m4.9-3.9l-0.1 0.1s0.1 0 0.1-0.1z m21.9-45.2c0-1 0.1-1.9 0.1-2.9s0-2-0.1-2.9c0 1 0.1 1.9 0.1 2.9s-0.1 2-0.1 2.9z m-17.7 41.2l0.3-0.3-0.3 0.3z m1.6-1.7l0.1-0.1-0.1 0.1z m2.3-2.8c0.2-0.2 0.3-0.4 0.5-0.6-0.2 0.2-0.3 0.4-0.5 0.6z m1.5-1.9c0.2-0.2 0.4-0.5 0.5-0.7-0.2 0.2-0.3 0.4-0.5 0.7z m2-2.9c0.2-0.3 0.4-0.6 0.6-1-0.2 0.4-0.4 0.7-0.6 1z m1.3-2.2c0.3-0.4 0.5-0.9 0.8-1.4-0.2 0.5-0.5 1-0.8 1.4z m1.7-2.9c0.2-0.5 0.5-0.9 0.7-1.4-0.2 0.5-0.5 0.9-0.7 1.4z m1.2-2.5c0.3-0.6 0.6-1.3 0.9-1.9-0.3 0.7-0.6 1.3-0.9 1.9z m1.3-2.9c0.2-0.6 0.5-1.2 0.7-1.8-0.2 0.6-0.4 1.2-0.7 1.8z m1.1-2.8c0.3-0.8 0.5-1.6 0.8-2.4-0.3 0.9-0.5 1.7-0.8 2.4z m1-2.9c0.2-0.7 0.4-1.5 0.6-2.2-0.2 0.8-0.4 1.5-0.6 2.2z m0.8-3c0.2-0.9 0.4-1.8 0.6-2.6-0.2 0.8-0.4 1.7-0.6 2.6z m0.7-2.9c0.2-0.8 0.3-1.7 0.5-2.5-0.2 0.8-0.4 1.6-0.5 2.5z m0.5-3.3c0.1-0.9 0.3-1.9 0.4-2.8-0.1 0.9-0.2 1.8-0.4 2.8z m0.4-3c0.1-0.9 0.2-1.9 0.2-2.8 0 1-0.1 1.9-0.2 2.8z m-17.4-50.5l0.3 0.3-0.3-0.3z m1.6 1.7l0.1 0.1-0.1-0.1z m2.3 2.8c0.2 0.2 0.3 0.4 0.5 0.6-0.2-0.2-0.3-0.4-0.5-0.6z m1.5 1.9c0.2 0.2 0.4 0.5 0.5 0.7-0.2-0.2-0.3-0.4-0.5-0.7z m2 2.9c0.2 0.3 0.4 0.7 0.6 1-0.2-0.4-0.4-0.7-0.6-1z m1.3 2.2c0.3 0.4 0.5 0.9 0.8 1.4-0.2-0.5-0.5-1-0.8-1.4z m1.7 2.9c0.2 0.5 0.5 0.9 0.7 1.4-0.2-0.5-0.5-0.9-0.7-1.4z m1.2 2.5c0.3 0.6 0.6 1.3 0.9 1.9-0.3-0.7-0.6-1.3-0.9-1.9z m1.3 2.9c0.2 0.6 0.5 1.2 0.7 1.8-0.2-0.6-0.4-1.2-0.7-1.8z m1.1 2.8c0.3 0.8 0.5 1.6 0.8 2.4-0.3-0.9-0.5-1.7-0.8-2.4z m1 2.9c0.2 0.7 0.4 1.5 0.6 2.2-0.2-0.8-0.4-1.5-0.6-2.2z m0.8 3c0.2 0.9 0.4 1.8 0.6 2.6-0.2-0.8-0.4-1.7-0.6-2.6z m0.7 2.9c0.2 0.8 0.3 1.7 0.5 2.5-0.2-0.8-0.4-1.6-0.5-2.5z m0.5 3.3c0.1 0.9 0.3 1.9 0.4 2.8-0.1-0.9-0.2-1.8-0.4-2.8z m0.4 3c0.1 0.9 0.2 1.9 0.2 2.8 0-1-0.1-1.9-0.2-2.8z" fill="#ffffff" p-id="5418"></path></svg>
|
||||
|
After Width: | Height: | Size: 2.6 KiB |
1
Image/waring.svg
Normal file
1
Image/waring.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1729780484640" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4318" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M768 512v320c0 11.733333-9.6 21.333333-21.333333 21.333333H277.333333c-11.733333 0-21.333333-9.6-21.333333-21.333333V512c0-141.226667 114.773333-256 256-256s256 114.773333 256 256zM917.333333 938.666667H106.666667a21.333333 21.333333 0 1 1 0-42.666667h810.666666a21.333333 21.333333 0 1 1 0 42.666667zM512 213.333333a21.333333 21.333333 0 0 1-21.333333-21.333333V106.666667a21.333333 21.333333 0 1 1 42.666666 0v85.333333a21.333333 21.333333 0 0 1-21.333333 21.333333zM192 533.333333H106.666667a21.333333 21.333333 0 1 1 0-42.666666h85.333333a21.333333 21.333333 0 1 1 0 42.666666zM917.333333 533.333333h-85.333333a21.333333 21.333333 0 1 1 0-42.666666h85.333333a21.333333 21.333333 0 1 1 0 42.666666zM747.093333 298.24a21.312 21.312 0 0 1-15.082666-36.416l51.648-51.648a21.312 21.312 0 1 1 30.165333 30.165333l-51.648 51.648a21.248 21.248 0 0 1-15.082667 6.250667zM276.906667 298.24c-5.461333 0-10.922667-2.090667-15.104-6.250667l-51.626667-51.648a21.333333 21.333333 0 0 1 30.186667-30.165333l51.626666 51.648a21.333333 21.333333 0 0 1-15.082666 36.416z" p-id="4319" fill="#ffffff"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
@ -1,5 +1,7 @@
|
||||
<RCC>
|
||||
<qresource prefix="main">
|
||||
<file>Image/log.svg</file>
|
||||
<file>Image/waring.svg</file>
|
||||
<file>Image/backgroud_head_btn.jpg</file>
|
||||
<file>Image/wait.png</file>
|
||||
<file>Image/1.png</file>
|
||||
|
||||
25
MainWin.ui
25
MainWin.ui
@ -1271,8 +1271,14 @@ border-image: None;</string>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">border:None;
|
||||
background-color: rgb(13, 17, 40);
|
||||
<string notr="true">
|
||||
|
||||
QTabBar::tab {
|
||||
background: #191E36;
|
||||
padding: 10px;
|
||||
border:None;
|
||||
color:#ffffff
|
||||
}
|
||||
</string>
|
||||
</property>
|
||||
<property name="tabShape">
|
||||
@ -1295,7 +1301,8 @@ background-color: rgb(13, 17, 40);
|
||||
</property>
|
||||
<widget class="QWidget" name="tab">
|
||||
<attribute name="icon">
|
||||
<iconset theme="QIcon::ThemeIcon::FormatJustifyCenter"/>
|
||||
<iconset resource="MainRecources.qrc">
|
||||
<normaloff>:/main/Image/log.svg</normaloff>:/main/Image/log.svg</iconset>
|
||||
</attribute>
|
||||
<attribute name="title">
|
||||
<string>日志</string>
|
||||
@ -1323,7 +1330,8 @@ background-color: rgb(13, 17, 40);
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_2">
|
||||
<attribute name="icon">
|
||||
<iconset theme="QIcon::ThemeIcon::AudioCard"/>
|
||||
<iconset resource="MainRecources.qrc">
|
||||
<normaloff>:/main/Image/waring.svg</normaloff>:/main/Image/waring.svg</iconset>
|
||||
</attribute>
|
||||
<attribute name="title">
|
||||
<string>报警</string>
|
||||
@ -1345,7 +1353,12 @@ background-color: rgb(13, 17, 40);
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QTextEdit" name="textEdit_log_error"/>
|
||||
<widget class="QTextEdit" name="textEdit_log_error">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">
|
||||
color: rgb(255, 0, 0);</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
@ -4589,7 +4602,7 @@ QSlider::sub-page:horizontal
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_7">
|
||||
<widget class="QLabel" name="label_remain_num">
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: rgb(255, 255, 255);</string>
|
||||
</property>
|
||||
|
||||
@ -5392,3 +5392,33 @@ Warning 2024-10-23 23:01:10:0614 DevID:Virtual USB3 Vision Source-Line:MvCamer
|
||||
Warning 2024-10-23 23:01:10:0614 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0996) ProcessName:python.exe(16200) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_VERSION] failed, Ret[0x80000001]
|
||||
Warning 2024-10-23 23:01:10:0614 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1000) ProcessName:python.exe(16200) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MANUFACTURER] failed, Ret[0x80000001]
|
||||
Warning 2024-10-23 23:01:10:0614 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1004) ProcessName:python.exe(16200) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_USER_DEFINED_NAME] failed, Ret[0x80000001]
|
||||
Error 2024-10-24 21:56:18:0181 DevID: Source-Line:MvCameraControl.dll(OtherLoadLibrary.cpp-L0709) ProcessName:python.exe(13356) Description:[LoadSRAllFunctions]hSRModule is NULL, Ret[0x8000000c]
|
||||
Warning 2024-10-24 21:56:18:0189 DevID: Source-Line:MvCameraControl.dll(GenTLLoadLibraryEx.cpp-L0345) ProcessName:python.exe(13356) Description:[LoadCtiLibInter]MV_GCSetConfigIntValue is NULL, CTI path[D:\environment\envs\UICreater\lib\site-packages\MvProducerVIR.dll]
|
||||
Warning 2024-10-24 21:56:18:0195 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0992) ProcessName:python.exe(13356) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MODEL] failed, Ret[0x80000001]
|
||||
Warning 2024-10-24 21:56:18:0195 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0996) ProcessName:python.exe(13356) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_VERSION] failed, Ret[0x80000001]
|
||||
Warning 2024-10-24 21:56:18:0195 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1000) ProcessName:python.exe(13356) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MANUFACTURER] failed, Ret[0x80000001]
|
||||
Warning 2024-10-24 21:56:18:0195 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1004) ProcessName:python.exe(13356) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_USER_DEFINED_NAME] failed, Ret[0x80000001]
|
||||
Warning 2024-10-24 21:56:18:0195 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0992) ProcessName:python.exe(13356) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MODEL] failed, Ret[0x80000001]
|
||||
Warning 2024-10-24 21:56:18:0195 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0996) ProcessName:python.exe(13356) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_VERSION] failed, Ret[0x80000001]
|
||||
Warning 2024-10-24 21:56:18:0195 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1000) ProcessName:python.exe(13356) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MANUFACTURER] failed, Ret[0x80000001]
|
||||
Warning 2024-10-24 21:56:18:0195 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1004) ProcessName:python.exe(13356) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_USER_DEFINED_NAME] failed, Ret[0x80000001]
|
||||
Error 2024-10-24 21:58:15:0065 DevID: Source-Line:MvCameraControl.dll(OtherLoadLibrary.cpp-L0709) ProcessName:python.exe(12040) Description:[LoadSRAllFunctions]hSRModule is NULL, Ret[0x8000000c]
|
||||
Warning 2024-10-24 21:58:15:0066 DevID: Source-Line:MvCameraControl.dll(GenTLLoadLibraryEx.cpp-L0345) ProcessName:python.exe(12040) Description:[LoadCtiLibInter]MV_GCSetConfigIntValue is NULL, CTI path[D:\environment\envs\UICreater\lib\site-packages\MvProducerVIR.dll]
|
||||
Warning 2024-10-24 21:58:15:0069 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0992) ProcessName:python.exe(12040) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MODEL] failed, Ret[0x80000001]
|
||||
Warning 2024-10-24 21:58:15:0069 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0996) ProcessName:python.exe(12040) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_VERSION] failed, Ret[0x80000001]
|
||||
Warning 2024-10-24 21:58:15:0069 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1000) ProcessName:python.exe(12040) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MANUFACTURER] failed, Ret[0x80000001]
|
||||
Warning 2024-10-24 21:58:15:0069 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1004) ProcessName:python.exe(12040) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_USER_DEFINED_NAME] failed, Ret[0x80000001]
|
||||
Warning 2024-10-24 21:58:15:0069 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0992) ProcessName:python.exe(12040) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MODEL] failed, Ret[0x80000001]
|
||||
Warning 2024-10-24 21:58:15:0069 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0996) ProcessName:python.exe(12040) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_VERSION] failed, Ret[0x80000001]
|
||||
Warning 2024-10-24 21:58:15:0069 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1000) ProcessName:python.exe(12040) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MANUFACTURER] failed, Ret[0x80000001]
|
||||
Warning 2024-10-24 21:58:15:0069 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1004) ProcessName:python.exe(12040) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_USER_DEFINED_NAME] failed, Ret[0x80000001]
|
||||
Error 2024-10-24 22:02:02:0205 DevID: Source-Line:MvCameraControl.dll(OtherLoadLibrary.cpp-L0709) ProcessName:python.exe(15216) Description:[LoadSRAllFunctions]hSRModule is NULL, Ret[0x8000000c]
|
||||
Warning 2024-10-24 22:02:02:0207 DevID: Source-Line:MvCameraControl.dll(GenTLLoadLibraryEx.cpp-L0345) ProcessName:python.exe(15216) Description:[LoadCtiLibInter]MV_GCSetConfigIntValue is NULL, CTI path[D:\environment\envs\UICreater\lib\site-packages\MvProducerVIR.dll]
|
||||
Warning 2024-10-24 22:02:02:0209 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0992) ProcessName:python.exe(15216) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MODEL] failed, Ret[0x80000001]
|
||||
Warning 2024-10-24 22:02:02:0209 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0996) ProcessName:python.exe(15216) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_VERSION] failed, Ret[0x80000001]
|
||||
Warning 2024-10-24 22:02:02:0209 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1000) ProcessName:python.exe(15216) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MANUFACTURER] failed, Ret[0x80000001]
|
||||
Warning 2024-10-24 22:02:02:0209 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1004) ProcessName:python.exe(15216) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_USER_DEFINED_NAME] failed, Ret[0x80000001]
|
||||
Warning 2024-10-24 22:02:02:0209 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0992) ProcessName:python.exe(15216) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MODEL] failed, Ret[0x80000001]
|
||||
Warning 2024-10-24 22:02:02:0209 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0996) ProcessName:python.exe(15216) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_VERSION] failed, Ret[0x80000001]
|
||||
Warning 2024-10-24 22:02:02:0209 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1000) ProcessName:python.exe(15216) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MANUFACTURER] failed, Ret[0x80000001]
|
||||
Warning 2024-10-24 22:02:02:0209 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1004) ProcessName:python.exe(15216) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_USER_DEFINED_NAME] failed, Ret[0x80000001]
|
||||
|
||||
142
Util/util_time.py
Normal file
142
Util/util_time.py
Normal file
@ -0,0 +1,142 @@
|
||||
import time
|
||||
|
||||
class MyTimer:
|
||||
|
||||
@staticmethod
|
||||
def gMyGetTickCount():
|
||||
ts = time.time()
|
||||
return int(ts * 1000) # Convert to milliseconds
|
||||
|
||||
# CTon class equivalent in Python
|
||||
class CTon:
|
||||
def __init__(self):
|
||||
self.m_unET = 0
|
||||
self.m_bLastI = False
|
||||
self.m_bIn = False
|
||||
self.m_bPause = False
|
||||
self.m_bOver = True
|
||||
self.m_unPT = 0
|
||||
self.m_unStartTime = 0
|
||||
self.m_unPauseET = 0
|
||||
|
||||
def GetET(self):
|
||||
if self.m_bIn:
|
||||
nET = self.m_unPT + (self.m_unStartTime - MyTimer.gMyGetTickCount())
|
||||
return max(nET, 0)
|
||||
else:
|
||||
return 0
|
||||
|
||||
def SetReset(self):
|
||||
self.m_bIn = False
|
||||
self.m_bLastI = False
|
||||
self.m_bPause = False
|
||||
|
||||
def SetPause(self, value):
|
||||
if self.m_bIn:
|
||||
self.m_bPause = value
|
||||
if self.m_bPause:
|
||||
self.m_unPauseET = MyTimer.gMyGetTickCount() - self.m_unStartTime
|
||||
|
||||
def SetOver(self, value):
|
||||
self.m_bOver = value
|
||||
|
||||
def GetStartTime(self):
|
||||
return self.m_unStartTime
|
||||
|
||||
def Q(self, value_i, value_pt):
|
||||
self.m_bIn = value_i
|
||||
self.m_unPT = value_pt
|
||||
un_tick = MyTimer.gMyGetTickCount()
|
||||
|
||||
if self.m_bOver and self.m_bIn:
|
||||
self.m_unStartTime = un_tick - self.m_unPT
|
||||
self.m_bOver = False
|
||||
|
||||
if self.m_bPause and self.m_bIn:
|
||||
self.m_unStartTime = un_tick - self.m_unPauseET
|
||||
|
||||
if self.m_bIn != self.m_bLastI:
|
||||
self.m_bLastI = self.m_bIn
|
||||
if self.m_bIn:
|
||||
self.m_unStartTime = un_tick
|
||||
self.m_bPause = False
|
||||
|
||||
return self.m_bIn and (un_tick >= (self.m_unStartTime + self.m_unPT))
|
||||
|
||||
# CClockPulse class equivalent in Python
|
||||
class CClockPulse:
|
||||
def __init__(self):
|
||||
self.m_bFirstOut = True
|
||||
self.m_bTonAOut = False
|
||||
self.m_bTonBOut = False
|
||||
self.m_cTonA = CTon()
|
||||
self.m_cTonB = CTon()
|
||||
|
||||
def Q(self, value_i, run_time, stop_time):
|
||||
if self.m_bFirstOut:
|
||||
self.m_bTonAOut = self.m_cTonA.Q(not self.m_bTonBOut and value_i, run_time)
|
||||
self.m_bTonBOut = self.m_cTonB.Q(self.m_bTonAOut and value_i, stop_time)
|
||||
return not self.m_bTonAOut and value_i
|
||||
else:
|
||||
self.m_bTonAOut = self.m_cTonA.Q(not self.m_bTonBOut and value_i, stop_time)
|
||||
self.m_bTonBOut = self.m_cTonB.Q(self.m_bTonAOut and value_i, run_time)
|
||||
return self.m_bTonAOut and value_i
|
||||
|
||||
# CDelayOut class equivalent in Python
|
||||
class CDelayOut:
|
||||
def __init__(self):
|
||||
self.m_cOutTon = CTon()
|
||||
self.m_cmWaitTon = CTon()
|
||||
|
||||
def Reset(self):
|
||||
self.m_cOutTon.SetReset()
|
||||
self.m_cmWaitTon.SetReset()
|
||||
|
||||
def Q(self, value_i, wait_time, out_time):
|
||||
if self.m_cmWaitTon.Q(value_i, wait_time):
|
||||
if self.m_cOutTon.Q(True, out_time):
|
||||
self.m_cOutTon.SetReset()
|
||||
self.m_cmWaitTon.SetReset()
|
||||
value_i = False
|
||||
return False
|
||||
return True
|
||||
return False
|
||||
|
||||
# CRisOrFall class equivalent in Python
|
||||
class CRisOrFall:
|
||||
def __init__(self):
|
||||
self.m_bTemp = False
|
||||
|
||||
def Q(self, value_i, ris_or_fall):
|
||||
result = False
|
||||
if value_i != self.m_bTemp:
|
||||
if ris_or_fall and value_i: # Rising edge
|
||||
result = True
|
||||
if not ris_or_fall and not value_i: # Falling edge
|
||||
result = True
|
||||
self.m_bTemp = value_i
|
||||
return result
|
||||
|
||||
# CTof class equivalent in Python
|
||||
class CTof:
|
||||
def __init__(self):
|
||||
self.m_cDelayTon = CTon()
|
||||
self.m_bValue = False
|
||||
self.m_cRis = CRisOrFall()
|
||||
|
||||
def SetReset(self):
|
||||
self.m_bValue = False
|
||||
self.m_cDelayTon.SetReset()
|
||||
|
||||
def Q(self, value_i, delay_time):
|
||||
if self.m_cRis.Q(value_i, False):
|
||||
self.m_cDelayTon.SetReset()
|
||||
self.m_bValue = True
|
||||
if self.m_cDelayTon.Q(self.m_bValue, delay_time):
|
||||
self.m_bValue = False
|
||||
self.m_cDelayTon.SetReset()
|
||||
return value_i or self.m_bValue
|
||||
|
||||
# Utility function
|
||||
def gGetNowTime():
|
||||
return int(time.time())
|
||||
40
main.py
40
main.py
@ -8,7 +8,7 @@ from multiprocessing import Process
|
||||
from PyQt5.uic.properties import QtWidgets
|
||||
from PySide6 import QtCore
|
||||
from PySide6.QtCore import QThread, Signal, Slot, QObject, QEvent
|
||||
from PySide6.QtGui import QIntValidator, QStandardItemModel, QStandardItem, Qt, QMovie
|
||||
from PySide6.QtGui import QIntValidator, QStandardItemModel, QStandardItem, Qt, QMovie, QIcon
|
||||
from PySide6.QtWidgets import QApplication, QMainWindow, QPushButton, QLabel, QHeaderView, QTableWidget, \
|
||||
QTableWidgetItem, QWidget, QHBoxLayout, QAbstractItemView, QMessageBox, QSizePolicy
|
||||
from datetime import datetime
|
||||
@ -30,6 +30,7 @@ from Model.Position import Real_Position, Detection_Position
|
||||
from threading import Thread
|
||||
from CU.Command import Status
|
||||
from Util.util_log import log
|
||||
from Vision.detect_person import DetectionPerson
|
||||
from ui_MainWin import Ui_MainWindow
|
||||
|
||||
|
||||
@ -43,6 +44,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
self.init_Run()
|
||||
self.init_robot_info()
|
||||
self.init_FeedLine()
|
||||
|
||||
self.start_Runing()
|
||||
# self.init_log()
|
||||
|
||||
@ -192,6 +194,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
self.feedLine_dict = {}
|
||||
self.command_quene = Queue()
|
||||
self.main_threading = None
|
||||
self.detection_person = DetectionPerson()
|
||||
|
||||
self.configReader.read(Constant.set_ini)
|
||||
ip = self.configReader.get('Robot_Feed', 'IPAddress')
|
||||
@ -709,11 +712,16 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
|
||||
def send_pauseFeed_button_click(self):
|
||||
if self.pushButton_pauseFeed.text() == '暂停':
|
||||
|
||||
icon9 = QIcon(QIcon.fromTheme(QIcon.ThemeIcon.SystemReboot))
|
||||
self.pushButton_pauseFeed.setIcon(icon9)
|
||||
self.pushButton_pauseFeed.setText('继续')
|
||||
log.log_message(logging.INFO, Constant.str_feed_pause)
|
||||
self.send_pause_command(True)
|
||||
self.feeding.pause = True
|
||||
else:
|
||||
icon9 = QIcon(QIcon.fromTheme(QIcon.ThemeIcon.MediaPlaybackPause))
|
||||
self.pushButton_pauseFeed.setIcon(icon9)
|
||||
self.pushButton_pauseFeed.setText('暂停')
|
||||
self.send_pause_command(False)
|
||||
log.log_message(logging.INFO, Constant.str_feed_continue)
|
||||
@ -806,6 +814,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
if self.feeding.feedStatus != FeedStatus.FNone:
|
||||
self.horizontalSlider_feedingNum.setValue(
|
||||
self.horizontalSlider_feedingNum.maximum() - self.feeding.feedConfig.num)
|
||||
self.label_remain_num.setText(str(self.feeding.feedConfig.num))
|
||||
else:
|
||||
self.set_run_status_button(False)
|
||||
if self.feeding.feedStatus == FeedStatus.FNone:
|
||||
@ -813,11 +822,12 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
else:
|
||||
self.stackedWidget_num.setCurrentIndex(1)
|
||||
|
||||
# if self.feeding.feedConfig.num==2:
|
||||
# self.feeding.pause=True
|
||||
# self.send_pause_command(True)
|
||||
# self.show_messagebox_of_person()
|
||||
# log.log_message(logging.ERROR, '人员进入安全区')
|
||||
has_person,_ = self.detection_person.get_person(None)
|
||||
if has_person:
|
||||
self.feeding.pause=True
|
||||
self.send_pause_command(True)
|
||||
self.show_messagebox_of_person()
|
||||
log.log_message(logging.ERROR, '人员进入安全区')
|
||||
self.label_date.setText(datetime.now().strftime("%Y-%m-%d"))
|
||||
self.label_time.setText(datetime.now().strftime("%H:%M:%S"))
|
||||
|
||||
@ -952,14 +962,16 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
||||
|
||||
def set_run_status_button(self, isRuning: bool):
|
||||
self.pushButton_pauseFeed.setText("暂停")
|
||||
if isRuning:
|
||||
self.pushButton_pauseFeed.show()
|
||||
self.pushButton_stopFeed.show()
|
||||
self.pushButton_startFeed.hide()
|
||||
else:
|
||||
self.pushButton_pauseFeed.hide()
|
||||
self.pushButton_stopFeed.hide()
|
||||
self.pushButton_startFeed.show()
|
||||
|
||||
|
||||
# if isRuning:
|
||||
# self.pushButton_pauseFeed.show()
|
||||
# self.pushButton_stopFeed.show()
|
||||
# self.pushButton_startFeed.hide()
|
||||
# else:
|
||||
# self.pushButton_pauseFeed.hide()
|
||||
# self.pushButton_stopFeed.hide()
|
||||
# self.pushButton_startFeed.show()
|
||||
|
||||
def send_clear_auto_command(self):
|
||||
clear_command = CMDInstructRequest()
|
||||
|
||||
@ -2935,11 +2935,11 @@ class Ui_MainWindow(object):
|
||||
|
||||
self.horizontalLayout_12.addWidget(self.label_6)
|
||||
|
||||
self.label_7 = QLabel(self.frame_24)
|
||||
self.label_7.setObjectName(u"label_7")
|
||||
self.label_7.setStyleSheet(u"color: rgb(255, 255, 255);")
|
||||
self.label_remain_num = QLabel(self.frame_24)
|
||||
self.label_remain_num.setObjectName(u"label_remain_num")
|
||||
self.label_remain_num.setStyleSheet(u"color: rgb(255, 255, 255);")
|
||||
|
||||
self.horizontalLayout_12.addWidget(self.label_7)
|
||||
self.horizontalLayout_12.addWidget(self.label_remain_num)
|
||||
|
||||
self.horizontalLayout_12.setStretch(0, 1)
|
||||
self.horizontalLayout_12.setStretch(1, 5)
|
||||
@ -3127,6 +3127,6 @@ class Ui_MainWindow(object):
|
||||
self.label_4.setText(QCoreApplication.translate("MainWindow", u"\u76ee\u6807\u888b\u6570\uff1a", None))
|
||||
self.label_maxNum.setText(QCoreApplication.translate("MainWindow", u"10", None))
|
||||
self.label_6.setText(QCoreApplication.translate("MainWindow", u"\u5269\u4f59\u888b\u6570\uff1a", None))
|
||||
self.label_7.setText(QCoreApplication.translate("MainWindow", u"1", None))
|
||||
self.label_remain_num.setText(QCoreApplication.translate("MainWindow", u"1", None))
|
||||
# retranslateUi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user