update 投料逻辑完善

This commit is contained in:
FrankCV2048
2024-10-28 22:45:01 +08:00
parent 5d6588d1c2
commit 5500ac7f71
5 changed files with 277 additions and 290 deletions

View File

@ -27,30 +27,29 @@ class FeedStatus(IntEnum):
FFinished = 12
class FeedLine:
def __init__(self,id,name,safe_position:Real_Position,photo_position:Real_Position,mid_position:Real_Position,broken1_position:Real_Position,broken2_position:Real_Position,drop_bag_position:Real_Position,zip_bag_position:Real_Position,feed_position:Real_Position):
def __init__(self,id,name,safe_position:Real_Position,broken1_position:Real_Position,broken2_position:Real_Position,shake_position:Real_Position,drop_bag_position:Real_Position):
self.safe_position = safe_position
self.photo_position = photo_position
self.feed_position = feed_position
self.mid_position = mid_position
self.broken1_position = broken1_position
self.broken2_position = broken2_position
self.shake_position = shake_position
self.drop_bag_position = drop_bag_position
self.zip_bag_position = zip_bag_position
self.take_position = None
self.name = name
self.id=id
class FeedingConfig:
def __init__(self, num:int, feedLine:FeedLine):
def __init__(self, num:int, feedLine:FeedLine,photo_locs):
self.num = num
self.feedLine = feedLine
self.photo_locs = photo_locs
def get_line_info(self):
pass
class Feeding():
class Feeding:
def __init__(self,robotClient:RobotClient,detection:Detection):
self.feedConfig = None
self.feedStatus = FeedStatus.FNone
@ -107,6 +106,7 @@ class Feeding():
if self.feedConfig.feedLine.safe_position.compare(real_position):
self.feedStatus = FeedStatus.FPhoto
self.sendTargPosition(self.feedConfig.feedLine.photo_position)
#判断是哪一个问题
elif self.feedStatus == FeedStatus.FPhoto:
log.log_message(logging.INFO, Constant.str_feed_photo)
@ -139,75 +139,57 @@ class Feeding():
elif self.feedStatus == FeedStatus.FTake:
log.log_message(logging.INFO, Constant.str_feed_take)
if self.feedConfig.feedLine.take_position != None and self.feedConfig.feedLine.take_position.compare(real_position):
self.feedStatus = FeedStatus.FSafeF
# 打开吸嘴并返回 #TODO
time.sleep(2)
self.feedStatus = FeedStatus.FSafeF
log.log_message(logging.INFO, Constant.str_feed_take_success)
self.sendTargPosition(self.feedConfig.feedLine.mid_position)
pass #打开吸嘴并返回
self.sendTargPosition(self.feedConfig.feedLine.safe_position)
pass
elif self.feedStatus == FeedStatus.FSafeF:
log.log_message(logging.INFO, Constant.str_feed_mid)
if self.feedConfig.feedLine.mid_position.compare(real_position):
self.feedStatus = FeedStatus.FFeedP
self.sendTargPosition(self.feedConfig.feedLine.feed_position)
pass #吸嘴开始
elif self.feedStatus==FeedStatus.FFeedP:
log.log_message(logging.INFO, Constant.str_feed_feed)
if self.feedConfig.feedLine.feed_position.compare(real_position):
if self.feedConfig.feedLine.safe_position.compare(real_position):
self.feedStatus = FeedStatus.FBroken
self.sendTargPosition(self.feedConfig.feedLine.broken1_position)
pass #破袋
pass #吸嘴开始
# elif self.feedStatus==FeedStatus.FFeedP:
# log.log_message(logging.INFO, Constant.str_feed_feed)
# if self.feedConfig.feedLine.feed_position.compare(real_position):
# self.feedStatus = FeedStatus.FBroken
# self.sendTargPosition(self.feedConfig.feedLine.broken1_position)
# pass #破袋
elif self.feedStatus==FeedStatus.FBroken:
log.log_message(logging.INFO, Constant.str_feed_broken)
if self.feedConfig.feedLine.broken1_position.compare(real_position):
self.sendTargPosition(self.feedConfig.feedLine.broken2_position)
if self.feedConfig.feedLine.broken2_position.compare(real_position):
current_position = Real_Position().init_position(0,0,0,0,0,0)
current_position.X = self.robotClient.status_model.axis_0
current_position.Y = self.robotClient.status_model.axis_1
current_position.Z = self.robotClient.status_model.axis_2
current_position.U = self.robotClient.status_model.axis_3
current_position.V = self.robotClient.status_model.axis_4
current_position.W = self.robotClient.status_model.axis_5
for i in range(8):
if (i % 2 == 0) ^ (i >= 3): ## 过一半取消
c1 = current_position.U - 5
self.sendTargPosition(c1, MoveType.AXIS, speed=Constant.shake_speed)
else:
c1 = current_position.U + 5
self.sendTargPosition(c1, MoveType.AXIS, speed=Constant.shake_speed)
if True: # 延迟判断如果最后点位延迟1s则认为阶段完成
self.sendTargPosition(self.feedConfig.feedLine.shake_position)
if self.feedConfig.feedLine.shake_position.compare(real_position): # 延迟判断如果最后点位延迟1s则认为阶段完成
# TODO 震动方案
time.sleep(2)
self.feedStatus = FeedStatus.FDropBag
self.sendTargPosition(self.feedConfig.feedLine.safe_position)
elif self.feedStatus == FeedStatus.FDropBag:
log.log_message(logging.INFO, Constant.str_feed_drop)
if self.feedConfig.feedLine.safe_position.compare(real_position):
if self.feedConfig.num - 1 != 0:
self.sendTargPosition(self.feedConfig.feedLine.drop_bag_position)
else:
self.sendTargPosition(self.feedConfig.feedLine.zip_bag_position)
self.sendTargPosition(self.feedConfig.feedLine.drop_bag_position)
pass
if self.feedConfig.feedLine.drop_bag_position.compare(real_position):
# TODO 松开吸嘴
time.sleep(2)
self.feedConfig.num = self.feedConfig.num - 1
log.log_message(logging.INFO, f'{Constant.str_feed_feed_num}{self.feedConfig.num}')
self.feedStatus = FeedStatus.FSafeP
self.sendTargPosition(self.feedConfig.feedLine.safe_position)
if self.feedConfig.feedLine.zip_bag_position.compare(real_position):
log.log_message(logging.INFO, Constant.str_feed_zip_bag)
# TODO 松开吸嘴 是否需要判断放没放开不
self.feedStatus = FeedStatus.FNone
self.sendTargPosition(self.feedConfig.feedLine.safe_position)
self.init_detection_image()
log.log_message(logging.INFO, Constant.str_feed_finish)
pass
if self.feedConfig.num == 0: # 投料次数为0直接返回
log.log_message(logging.INFO, Constant.str_feed_finish)
self.feedStatus = FeedStatus.FNone
self.sendTargPosition(self.feedConfig.feedLine.safe_position)
self.init_detection_image()
else:
self.feedStatus = FeedStatus.FSafeP
self.sendTargPosition(self.feedConfig.feedLine.safe_position)

View File

@ -6,18 +6,6 @@ safeposition_z = 737.267822
safeposition_u = -2.196312
safeposition_v = -4.094595
safeposition_w = -5.294128
photoposition_x = 534.907898
photoposition_y = 5.525342
photoposition_z = 737.267822
photoposition_u = -2.196312
photoposition_v = -4.094595
photoposition_w = -5.294128
midposition_x = 638.432
midposition_y = 16.854
midposition_z = 406.721
midposition_u = -3.256
midposition_v = 7.334
midposition_w = -4.307
brokenposition1_x = 357.269
brokenposition1_y = 478.874
brokenposition1_z = 209.979
@ -30,24 +18,20 @@ brokenposition2_z = 209.979
brokenposition2_u = -3.100
brokenposition2_v = -3.198
brokenposition2_w = 49.945
shakeposition_x = 357.269
shakeposition_y = 478.874
shakeposition_z = 209.979
shakeposition_u = -3.100
shakeposition_v = -3.198
shakeposition_w = 49.945
dropBagposition_x = 357.269
dropBagposition_y = 478.874
dropBagposition_z = 209.979
dropBagposition_u = -3.100
dropBagposition_v = -3.198
dropBagposition_w = 49.945
zipBagposition_x = 357.269
zipBagposition_y = 478.874
zipBagposition_z = 209.979
zipBagposition_u = -3.100
zipBagposition_v = -3.198
zipBagposition_w = 49.945
feedposition_x = 315.549
feedposition_y = 427.090
feedposition_z = 209.985
feedposition_u = -2.793
feedposition_v = -1.829
feedposition_w = 50.000
dropDelay_time = 3
shakeDelay_time = 6
[FeedLine2]

View File

@ -5793,3 +5793,93 @@ Warning 2024-10-27 22:59:38:0151 DevID:Virtual USB3 Vision Source-Line:MvCamer
Warning 2024-10-27 22:59:38:0151 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0996) ProcessName:python.exe(26204) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_VERSION] failed, Ret[0x80000001]
Warning 2024-10-27 22:59:38:0151 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1000) ProcessName:python.exe(26204) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MANUFACTURER] failed, Ret[0x80000001]
Warning 2024-10-27 22:59:38:0151 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1004) ProcessName:python.exe(26204) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_USER_DEFINED_NAME] failed, Ret[0x80000001]
Error 2024-10-28 21:57:22:0667 DevID: Source-Line:MvCameraControl.dll(OtherLoadLibrary.cpp-L0709) ProcessName:python.exe(19976) Description:[LoadSRAllFunctions]hSRModule is NULL, Ret[0x8000000c]
Warning 2024-10-28 21:57:22:0678 DevID: Source-Line:MvCameraControl.dll(GenTLLoadLibraryEx.cpp-L0345) ProcessName:python.exe(19976) Description:[LoadCtiLibInter]MV_GCSetConfigIntValue is NULL, CTI path[D:\environment\envs\UICreater\lib\site-packages\MvProducerVIR.dll]
Warning 2024-10-28 21:57:22:0685 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0992) ProcessName:python.exe(19976) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MODEL] failed, Ret[0x80000001]
Warning 2024-10-28 21:57:22:0685 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0996) ProcessName:python.exe(19976) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_VERSION] failed, Ret[0x80000001]
Warning 2024-10-28 21:57:22:0685 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1000) ProcessName:python.exe(19976) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MANUFACTURER] failed, Ret[0x80000001]
Warning 2024-10-28 21:57:22:0685 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1004) ProcessName:python.exe(19976) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_USER_DEFINED_NAME] failed, Ret[0x80000001]
Warning 2024-10-28 21:57:22:0685 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0992) ProcessName:python.exe(19976) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MODEL] failed, Ret[0x80000001]
Warning 2024-10-28 21:57:22:0685 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0996) ProcessName:python.exe(19976) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_VERSION] failed, Ret[0x80000001]
Warning 2024-10-28 21:57:22:0685 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1000) ProcessName:python.exe(19976) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MANUFACTURER] failed, Ret[0x80000001]
Warning 2024-10-28 21:57:22:0685 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1004) ProcessName:python.exe(19976) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_USER_DEFINED_NAME] failed, Ret[0x80000001]
Error 2024-10-28 21:58:41:0982 DevID: Source-Line:MvCameraControl.dll(OtherLoadLibrary.cpp-L0709) ProcessName:python.exe(19704) Description:[LoadSRAllFunctions]hSRModule is NULL, Ret[0x8000000c]
Warning 2024-10-28 21:58:41:0986 DevID: Source-Line:MvCameraControl.dll(GenTLLoadLibraryEx.cpp-L0345) ProcessName:python.exe(19704) Description:[LoadCtiLibInter]MV_GCSetConfigIntValue is NULL, CTI path[D:\environment\envs\UICreater\lib\site-packages\MvProducerVIR.dll]
Warning 2024-10-28 21:58:41:0986 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0992) ProcessName:python.exe(19704) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MODEL] failed, Ret[0x80000001]
Warning 2024-10-28 21:58:41:0986 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0996) ProcessName:python.exe(19704) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_VERSION] failed, Ret[0x80000001]
Warning 2024-10-28 21:58:41:0986 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1000) ProcessName:python.exe(19704) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MANUFACTURER] failed, Ret[0x80000001]
Warning 2024-10-28 21:58:41:0986 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1004) ProcessName:python.exe(19704) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_USER_DEFINED_NAME] failed, Ret[0x80000001]
Warning 2024-10-28 21:58:41:0986 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0992) ProcessName:python.exe(19704) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MODEL] failed, Ret[0x80000001]
Warning 2024-10-28 21:58:41:0986 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0996) ProcessName:python.exe(19704) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_VERSION] failed, Ret[0x80000001]
Warning 2024-10-28 21:58:41:0986 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1000) ProcessName:python.exe(19704) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MANUFACTURER] failed, Ret[0x80000001]
Warning 2024-10-28 21:58:41:0986 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1004) ProcessName:python.exe(19704) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_USER_DEFINED_NAME] failed, Ret[0x80000001]
Error 2024-10-28 21:59:45:0877 DevID: Source-Line:MvCameraControl.dll(OtherLoadLibrary.cpp-L0709) ProcessName:python.exe(26956) Description:[LoadSRAllFunctions]hSRModule is NULL, Ret[0x8000000c]
Warning 2024-10-28 21:59:45:0880 DevID: Source-Line:MvCameraControl.dll(GenTLLoadLibraryEx.cpp-L0345) ProcessName:python.exe(26956) Description:[LoadCtiLibInter]MV_GCSetConfigIntValue is NULL, CTI path[D:\environment\envs\UICreater\lib\site-packages\MvProducerVIR.dll]
Warning 2024-10-28 21:59:45:0883 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0992) ProcessName:python.exe(26956) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MODEL] failed, Ret[0x80000001]
Warning 2024-10-28 21:59:45:0883 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0996) ProcessName:python.exe(26956) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_VERSION] failed, Ret[0x80000001]
Warning 2024-10-28 21:59:45:0883 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1000) ProcessName:python.exe(26956) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MANUFACTURER] failed, Ret[0x80000001]
Warning 2024-10-28 21:59:45:0883 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1004) ProcessName:python.exe(26956) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_USER_DEFINED_NAME] failed, Ret[0x80000001]
Warning 2024-10-28 21:59:45:0883 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0992) ProcessName:python.exe(26956) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MODEL] failed, Ret[0x80000001]
Warning 2024-10-28 21:59:45:0883 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0996) ProcessName:python.exe(26956) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_VERSION] failed, Ret[0x80000001]
Warning 2024-10-28 21:59:45:0883 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1000) ProcessName:python.exe(26956) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MANUFACTURER] failed, Ret[0x80000001]
Warning 2024-10-28 21:59:45:0883 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1004) ProcessName:python.exe(26956) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_USER_DEFINED_NAME] failed, Ret[0x80000001]
Error 2024-10-28 22:01:27:0553 DevID: Source-Line:MvCameraControl.dll(OtherLoadLibrary.cpp-L0709) ProcessName:python.exe(20304) Description:[LoadSRAllFunctions]hSRModule is NULL, Ret[0x8000000c]
Warning 2024-10-28 22:01:27:0555 DevID: Source-Line:MvCameraControl.dll(GenTLLoadLibraryEx.cpp-L0345) ProcessName:python.exe(20304) Description:[LoadCtiLibInter]MV_GCSetConfigIntValue is NULL, CTI path[D:\environment\envs\UICreater\lib\site-packages\MvProducerVIR.dll]
Warning 2024-10-28 22:01:27:0557 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0992) ProcessName:python.exe(20304) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MODEL] failed, Ret[0x80000001]
Warning 2024-10-28 22:01:27:0557 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0996) ProcessName:python.exe(20304) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_VERSION] failed, Ret[0x80000001]
Warning 2024-10-28 22:01:27:0557 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1000) ProcessName:python.exe(20304) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MANUFACTURER] failed, Ret[0x80000001]
Warning 2024-10-28 22:01:27:0557 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1004) ProcessName:python.exe(20304) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_USER_DEFINED_NAME] failed, Ret[0x80000001]
Warning 2024-10-28 22:01:27:0557 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0992) ProcessName:python.exe(20304) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MODEL] failed, Ret[0x80000001]
Warning 2024-10-28 22:01:27:0557 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0996) ProcessName:python.exe(20304) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_VERSION] failed, Ret[0x80000001]
Warning 2024-10-28 22:01:27:0557 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1000) ProcessName:python.exe(20304) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MANUFACTURER] failed, Ret[0x80000001]
Warning 2024-10-28 22:01:27:0557 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1004) ProcessName:python.exe(20304) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_USER_DEFINED_NAME] failed, Ret[0x80000001]
Error 2024-10-28 22:09:24:0081 DevID: Source-Line:MvCameraControl.dll(OtherLoadLibrary.cpp-L0709) ProcessName:python.exe(23824) Description:[LoadSRAllFunctions]hSRModule is NULL, Ret[0x8000000c]
Warning 2024-10-28 22:09:24:0083 DevID: Source-Line:MvCameraControl.dll(GenTLLoadLibraryEx.cpp-L0345) ProcessName:python.exe(23824) Description:[LoadCtiLibInter]MV_GCSetConfigIntValue is NULL, CTI path[D:\environment\envs\UICreater\lib\site-packages\MvProducerVIR.dll]
Warning 2024-10-28 22:09:24:0084 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0992) ProcessName:python.exe(23824) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MODEL] failed, Ret[0x80000001]
Warning 2024-10-28 22:09:24:0084 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0996) ProcessName:python.exe(23824) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_VERSION] failed, Ret[0x80000001]
Warning 2024-10-28 22:09:24:0084 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1000) ProcessName:python.exe(23824) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MANUFACTURER] failed, Ret[0x80000001]
Warning 2024-10-28 22:09:24:0084 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1004) ProcessName:python.exe(23824) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_USER_DEFINED_NAME] failed, Ret[0x80000001]
Warning 2024-10-28 22:09:24:0084 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0992) ProcessName:python.exe(23824) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MODEL] failed, Ret[0x80000001]
Warning 2024-10-28 22:09:24:0084 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0996) ProcessName:python.exe(23824) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_VERSION] failed, Ret[0x80000001]
Warning 2024-10-28 22:09:24:0084 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1000) ProcessName:python.exe(23824) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MANUFACTURER] failed, Ret[0x80000001]
Warning 2024-10-28 22:09:24:0084 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1004) ProcessName:python.exe(23824) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_USER_DEFINED_NAME] failed, Ret[0x80000001]
Error 2024-10-28 22:16:20:0575 DevID: Source-Line:MvCameraControl.dll(OtherLoadLibrary.cpp-L0709) ProcessName:python.exe(25296) Description:[LoadSRAllFunctions]hSRModule is NULL, Ret[0x8000000c]
Warning 2024-10-28 22:16:20:0579 DevID: Source-Line:MvCameraControl.dll(GenTLLoadLibraryEx.cpp-L0345) ProcessName:python.exe(25296) Description:[LoadCtiLibInter]MV_GCSetConfigIntValue is NULL, CTI path[D:\environment\envs\UICreater\lib\site-packages\MvProducerVIR.dll]
Warning 2024-10-28 22:16:20:0580 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0992) ProcessName:python.exe(25296) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MODEL] failed, Ret[0x80000001]
Warning 2024-10-28 22:16:20:0580 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0996) ProcessName:python.exe(25296) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_VERSION] failed, Ret[0x80000001]
Warning 2024-10-28 22:16:20:0580 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1000) ProcessName:python.exe(25296) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MANUFACTURER] failed, Ret[0x80000001]
Warning 2024-10-28 22:16:20:0580 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1004) ProcessName:python.exe(25296) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_USER_DEFINED_NAME] failed, Ret[0x80000001]
Warning 2024-10-28 22:16:20:0580 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0992) ProcessName:python.exe(25296) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MODEL] failed, Ret[0x80000001]
Warning 2024-10-28 22:16:20:0580 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0996) ProcessName:python.exe(25296) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_VERSION] failed, Ret[0x80000001]
Warning 2024-10-28 22:16:20:0580 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1000) ProcessName:python.exe(25296) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MANUFACTURER] failed, Ret[0x80000001]
Warning 2024-10-28 22:16:20:0580 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1004) ProcessName:python.exe(25296) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_USER_DEFINED_NAME] failed, Ret[0x80000001]
Error 2024-10-28 22:21:14:0838 DevID: Source-Line:MvCameraControl.dll(OtherLoadLibrary.cpp-L0709) ProcessName:python.exe(27364) Description:[LoadSRAllFunctions]hSRModule is NULL, Ret[0x8000000c]
Warning 2024-10-28 22:21:14:0840 DevID: Source-Line:MvCameraControl.dll(GenTLLoadLibraryEx.cpp-L0345) ProcessName:python.exe(27364) Description:[LoadCtiLibInter]MV_GCSetConfigIntValue is NULL, CTI path[D:\environment\envs\UICreater\lib\site-packages\MvProducerVIR.dll]
Warning 2024-10-28 22:21:14:0843 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0992) ProcessName:python.exe(27364) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MODEL] failed, Ret[0x80000001]
Warning 2024-10-28 22:21:14:0843 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0996) ProcessName:python.exe(27364) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_VERSION] failed, Ret[0x80000001]
Warning 2024-10-28 22:21:14:0843 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1000) ProcessName:python.exe(27364) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MANUFACTURER] failed, Ret[0x80000001]
Warning 2024-10-28 22:21:14:0843 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1004) ProcessName:python.exe(27364) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_USER_DEFINED_NAME] failed, Ret[0x80000001]
Warning 2024-10-28 22:21:14:0843 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0992) ProcessName:python.exe(27364) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MODEL] failed, Ret[0x80000001]
Warning 2024-10-28 22:21:14:0843 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0996) ProcessName:python.exe(27364) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_VERSION] failed, Ret[0x80000001]
Warning 2024-10-28 22:21:14:0843 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1000) ProcessName:python.exe(27364) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MANUFACTURER] failed, Ret[0x80000001]
Warning 2024-10-28 22:21:14:0843 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1004) ProcessName:python.exe(27364) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_USER_DEFINED_NAME] failed, Ret[0x80000001]
Error 2024-10-28 22:22:24:0794 DevID: Source-Line:MvCameraControl.dll(OtherLoadLibrary.cpp-L0709) ProcessName:python.exe(19800) Description:[LoadSRAllFunctions]hSRModule is NULL, Ret[0x8000000c]
Warning 2024-10-28 22:22:24:0796 DevID: Source-Line:MvCameraControl.dll(GenTLLoadLibraryEx.cpp-L0345) ProcessName:python.exe(19800) Description:[LoadCtiLibInter]MV_GCSetConfigIntValue is NULL, CTI path[D:\environment\envs\UICreater\lib\site-packages\MvProducerVIR.dll]
Warning 2024-10-28 22:22:24:0798 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0992) ProcessName:python.exe(19800) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MODEL] failed, Ret[0x80000001]
Warning 2024-10-28 22:22:24:0798 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0996) ProcessName:python.exe(19800) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_VERSION] failed, Ret[0x80000001]
Warning 2024-10-28 22:22:24:0798 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1000) ProcessName:python.exe(19800) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MANUFACTURER] failed, Ret[0x80000001]
Warning 2024-10-28 22:22:24:0798 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1004) ProcessName:python.exe(19800) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_USER_DEFINED_NAME] failed, Ret[0x80000001]
Warning 2024-10-28 22:22:24:0798 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0992) ProcessName:python.exe(19800) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MODEL] failed, Ret[0x80000001]
Warning 2024-10-28 22:22:24:0798 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0996) ProcessName:python.exe(19800) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_VERSION] failed, Ret[0x80000001]
Warning 2024-10-28 22:22:24:0798 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1000) ProcessName:python.exe(19800) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MANUFACTURER] failed, Ret[0x80000001]
Warning 2024-10-28 22:22:24:0798 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1004) ProcessName:python.exe(19800) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_USER_DEFINED_NAME] failed, Ret[0x80000001]
Error 2024-10-28 22:24:11:0681 DevID: Source-Line:MvCameraControl.dll(OtherLoadLibrary.cpp-L0709) ProcessName:python.exe(18992) Description:[LoadSRAllFunctions]hSRModule is NULL, Ret[0x8000000c]
Warning 2024-10-28 22:24:11:0684 DevID: Source-Line:MvCameraControl.dll(GenTLLoadLibraryEx.cpp-L0345) ProcessName:python.exe(18992) Description:[LoadCtiLibInter]MV_GCSetConfigIntValue is NULL, CTI path[D:\environment\envs\UICreater\lib\site-packages\MvProducerVIR.dll]
Warning 2024-10-28 22:24:11:0688 DevID:Virtual GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0992) ProcessName:python.exe(18992) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MODEL] failed, Ret[0x80000001]
Warning 2024-10-28 22:24:11:0688 DevID:Virtual GigE 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 GigE 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 GigE Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L1004) ProcessName:python.exe(18992) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_USER_DEFINED_NAME] failed, Ret[0x80000001]
Warning 2024-10-28 22:24:11:0688 DevID:Virtual USB3 Vision Source-Line:MvCameraControl.dll(GenTLManager.cpp-L0992) ProcessName:python.exe(18992) Description:[GetInterfaceInfos]TLGetInterfaceInfo[INTERFACE_INFO_MODEL] failed, Ret[0x80000001]
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]

View File

@ -52,79 +52,5 @@ remain_count = 1
[Camera_Feed]
ipaddress = 127.0.0.1
[FeedLine1]
name = 反应釜1
safeposition_x = 534.907898
safeposition_y = 5.525342
safeposition_z = 737.267822
safeposition_u = -2.196312
safeposition_v = -4.094595
safeposition_w = -5.294128
photoposition_x = 534.907898
photoposition_y = 5.525342
photoposition_z = 737.267822
photoposition_u = -2.196312
photoposition_v = -4.094595
photoposition_w = -5.294128
midposition_x = 638.432
midposition_y = 16.854
midposition_z = 406.721
midposition_u = -3.256
midposition_v = 7.334
midposition_w = -4.307
brokenposition1_x = 357.269
brokenposition1_y = 478.874
brokenposition1_z = 209.979
brokenposition1_u = -3.100
brokenposition1_v = -3.198
brokenposition1_w = 49.945
brokenposition2_x = 357.269
brokenposition2_y = 478.874
brokenposition2_z = 209.979
brokenposition2_u = -3.100
brokenposition2_v = -3.198
brokenposition2_w = 49.945
dropbagposition_x = 357.269
dropbagposition_y = 478.874
dropbagposition_z = 209.979
dropbagposition_u = -3.100
dropbagposition_v = -3.198
dropbagposition_w = 49.945
zipbagposition_x = 357.269
zipbagposition_y = 478.874
zipbagposition_z = 209.979
zipbagposition_u = -3.100
zipbagposition_v = -3.198
zipbagposition_w = 49.945
feedposition_x = 315.549
feedposition_y = 427.090
feedposition_z = 209.985
feedposition_u = -2.793
feedposition_v = -1.829
feedposition_w = 50.000
dropdelay_time = 3
shakedelay_time = 6
[FeedLine2]
name = 反应釜2
safeposition_x = 0.0
safeposition_y = 0.0
safeposition_z = 0.0
safeposition_u = 0.0
safeposition_v = 0.0
safeposition_w = 0.0
photoposition_x = 0.0
photoposition_y = 0.0
photoposition_z = 0.0
photoposition_u = 0.0
photoposition_v = 0.0
photoposition_w = 0.0
feedposition_x = 0.0
feedposition_y = 0.0
feedposition_z = 0.0
feedposition_u = 0.0
feedposition_v = 0.0
feedposition_w = 0.0
dropdelay_time = 3
shakedelay_time = 6

285
main.py
View File

@ -202,11 +202,24 @@ class MainWindow(QMainWindow, Ui_MainWindow):
ip = self.configReader.get('Robot_Feed', 'IPAddress')
port = int(self.configReader.get('Robot_Feed', 'Port'))
photo_locs = [(int(self.configReader.get('Robot_Feed', 'photo_x1')),
int(self.configReader.get('Robot_Feed', 'photo_y1')), int(self.configReader.get('Robot_Feed', 'photo_z1'))),
int(self.configReader.get('Robot_Feed', 'photo_y1')), int(self.configReader.get('Robot_Feed', 'photo_z1')),
int(self.configReader.get('Robot_Feed', 'photo_u1')),int(self.configReader.get('Robot_Feed', 'photo_v1')),int(self.configReader.get('Robot_Feed', 'photo_w1'))),
(int(self.configReader.get('Robot_Feed', 'photo_x2')),
int(self.configReader.get('Robot_Feed', 'photo_y2')), int(self.configReader.get('Robot_Feed', 'photo_z2'))),
int(self.configReader.get('Robot_Feed', 'photo_y2')), int(self.configReader.get('Robot_Feed', 'photo_z2')),
int(self.configReader.get('Robot_Feed', 'photo_u2')),int(self.configReader.get('Robot_Feed', 'photo_v2')),int(self.configReader.get('Robot_Feed', 'photo_w2'))
),
(int(self.configReader.get('Robot_Feed', 'photo_x3')),
int(self.configReader.get('Robot_Feed', 'photo_y3')),int(self.configReader.get('Robot_Feed', 'photo_z3')))
int(self.configReader.get('Robot_Feed', 'photo_y3')),int(self.configReader.get('Robot_Feed', 'photo_z3')),
int(self.configReader.get('Robot_Feed', 'photo_u3')),int(self.configReader.get('Robot_Feed', 'photo_v3')),int(self.configReader.get('Robot_Feed', 'photo_w3'))
),
(int(self.configReader.get('Robot_Feed', 'photo_x4')),
int(self.configReader.get('Robot_Feed', 'photo_y4')),int(self.configReader.get('Robot_Feed', 'photo_z4')),
int(self.configReader.get('Robot_Feed', 'photo_u4')),int(self.configReader.get('Robot_Feed', 'photo_v4')),int(self.configReader.get('Robot_Feed', 'photo_w4'))
),
(int(self.configReader.get('Robot_Feed', 'photo_x5')),
int(self.configReader.get('Robot_Feed', 'photo_y5')),int(self.configReader.get('Robot_Feed', 'photo_z5')),
int(self.configReader.get('Robot_Feed', 'photo_u5')),int(self.configReader.get('Robot_Feed', 'photo_v5')),int(self.configReader.get('Robot_Feed', 'photo_w5'))
)
]
#TODO
#dropDelay_time = int(self.configReader.get('Robot_Feed', 'dropDelay_time'))
@ -229,7 +242,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
rows = len(self.feedLine_dict.keys()) + 1
self.tableWidget_feedSeting.setRowCount(rows)
self.tableWidget_feedSeting.setColumnCount(20+4*6)
self.tableWidget_feedSeting.setColumnCount(20+2*6)
# 设置第一重表头的合并 (三列一组)
self.tableWidget_feedSeting_addtional_col_num = 2
@ -238,8 +251,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
self.tableWidget_feedSeting.setSpan(0, 12 + self.tableWidget_feedSeting_addtional_col_num, 1, 6) # 合并后3列
self.tableWidget_feedSeting.setSpan(0, 18 + self.tableWidget_feedSeting_addtional_col_num, 1, 6) # 合并后3列
self.tableWidget_feedSeting.setSpan(0, 24 + self.tableWidget_feedSeting_addtional_col_num, 1, 6) # 合并后3列
self.tableWidget_feedSeting.setSpan(0, 30 + self.tableWidget_feedSeting_addtional_col_num, 1, 6)
self.tableWidget_feedSeting.setSpan(0, 36 + self.tableWidget_feedSeting_addtional_col_num, 1, 6)
self.tableWidget_feedSeting.itemChanged.connect(self.send_tabelFeedSet_itemChanged)
@ -252,23 +264,6 @@ class MainWindow(QMainWindow, Ui_MainWindow):
# 将布局设置到 QWidget 容器中
widget_safe.setLayout(layout_safe)
btn_photo = QPushButton("获取拍照位置")
widget_photo = QWidget()
layout_photo = QHBoxLayout()
layout_photo.addWidget(btn_photo)
# 调整布局的间距,使之更紧凑
layout_photo.setContentsMargins(0, 0, 0, 0)
# 将布局设置到 QWidget 容器中
widget_photo.setLayout(layout_photo)
btn_feed = QPushButton("获取投料位置")
widget_feed = QWidget()
layout_feed = QHBoxLayout()
layout_feed.addWidget(btn_feed)
# 调整布局的间距,使之更紧凑
layout_feed.setContentsMargins(0, 0, 0, 0)
# 将布局设置到 QWidget 容器中
widget_feed.setLayout(layout_feed)
btn_bk1 = QPushButton("获取破袋位置1")
widget_bk1 = QWidget()
@ -288,6 +283,13 @@ class MainWindow(QMainWindow, Ui_MainWindow):
# 将布局设置到 QWidget 容器中
widget_bk2.setLayout(layout_bk2)
btn_shake = QPushButton("获取摇晃位置")
widget_shake = QWidget()
layout_shake = QHBoxLayout()
layout_shake.addWidget(btn_shake)
layout_shake.setContentsMargins(0, 0, 0, 0)
widget_shake.setLayout(layout_shake)
btn_dropbag = QPushButton("获取丢袋位置")
widget_dropbag = QWidget()
@ -297,44 +299,32 @@ class MainWindow(QMainWindow, Ui_MainWindow):
layout_dropbag.setContentsMargins(0, 0, 0, 0)
# 将布局设置到 QWidget 容器中
widget_dropbag.setLayout(layout_dropbag)
btn_zipbag = QPushButton("获取压袋位置")
btn_zipbag = QPushButton("获取压袋位置")
widget_zipbag = QWidget()
layout_zipbag = QHBoxLayout()
layout_zipbag.addWidget(btn_zipbag)
# 调整布局的间距,使之更紧凑
layout_zipbag.setContentsMargins(0, 0, 0, 0)
# 将布局
widget_zipbag.setLayout(layout_zipbag)
btn_safe.clicked.connect(self.send_get_safe_position_button_click)
btn_photo.clicked.connect(self.send_get_photo_position_button_click)
btn_feed.clicked.connect(self.send_get_feed_position_button_click)
btn_bk1.clicked.connect(self.send_get_broken1_position_button_click)
btn_bk2.clicked.connect(self.send_get_broken2_position_button_click)
btn_shake.clicked.connect(self.send_get_shake_position_button_click)
btn_dropbag.clicked.connect(self.send_get_dropbag_position_button_click)
btn_zipbag.clicked.connect(self.send_get_zipbag_position_button_click)
# 添加第一重表头项
self.tableWidget_feedSeting.setCellWidget(0, 0 + self.tableWidget_feedSeting_addtional_col_num, widget_safe)
self.tableWidget_feedSeting.setCellWidget(0, 6 + self.tableWidget_feedSeting_addtional_col_num, widget_photo)
self.tableWidget_feedSeting.setCellWidget(0, 12 + self.tableWidget_feedSeting_addtional_col_num,
widget_feed) # 设置在合并的第2组
self.tableWidget_feedSeting.setCellWidget(0, 6 + self.tableWidget_feedSeting_addtional_col_num, widget_bk1)
self.tableWidget_feedSeting.setCellWidget(0, 12 + self.tableWidget_feedSeting_addtional_col_num, widget_bk2)
self.tableWidget_feedSeting.setCellWidget(0, 18 + self.tableWidget_feedSeting_addtional_col_num, widget_shake)
self.tableWidget_feedSeting.setCellWidget(0, 24 + self.tableWidget_feedSeting_addtional_col_num, widget_dropbag)
self.tableWidget_feedSeting.setCellWidget(0, 18 + self.tableWidget_feedSeting_addtional_col_num, widget_bk1)
self.tableWidget_feedSeting.setCellWidget(0, 24 + self.tableWidget_feedSeting_addtional_col_num, widget_bk2)
self.tableWidget_feedSeting.setCellWidget(0, 30 + self.tableWidget_feedSeting_addtional_col_num, widget_dropbag)
self.tableWidget_feedSeting.setCellWidget(0, 36 + self.tableWidget_feedSeting_addtional_col_num, widget_zipbag)
self.tableWidget_feedSeting.setSelectionBehavior(QTableWidget.SelectRows)
self.tableWidget_feedSeting.setAutoScroll(True)
# 添加第二重表头
self.tableWidget_feedSeting.setHorizontalHeaderLabels(
['header', '线名', 'X1', 'Y1', 'Z1', 'U1', 'V1', 'W1', 'X2', 'Y2', 'Z2', 'U2', 'V2', 'W2', 'X3', 'Y3', 'Z3',
'U3', 'V3', 'W3', 'X4', 'Y4', 'Z4', 'U4', 'V4', 'W4', 'X5', 'Y5', 'Z5', 'U5', 'V5', 'W5', 'X6', 'Y6', 'Z6', 'U6', 'V6', 'W6','X7', 'Y7', 'Z7', 'U7', 'V7', 'W7'])
'U3', 'V3', 'W3', 'X4', 'Y4', 'Z4', 'U4', 'V4', 'W4', 'X5', 'Y5', 'Z5', 'U5', 'V5', 'W5'])
self.tableWidget_feedSeting.hideColumn(0)
# 填充数据行
@ -342,12 +332,10 @@ class MainWindow(QMainWindow, Ui_MainWindow):
self.tableWidget_feedSeting.setItem(row + 1, 0, QTableWidgetItem(feed_line_key))
self.tableWidget_feedSeting.setItem(row + 1, 1, QTableWidgetItem(feed_line.name))
self.set_position_to_tabel(row + 1, 0, feed_line.safe_position)
self.set_position_to_tabel(row + 1, 1, feed_line.photo_position)
self.set_position_to_tabel(row + 1, 2, feed_line.feed_position)
self.set_position_to_tabel(row + 1, 3, feed_line.broken1_position)
self.set_position_to_tabel(row + 1, 4, feed_line.broken2_position)
self.set_position_to_tabel(row + 1, 5, feed_line.drop_bag_position)
self.set_position_to_tabel(row + 1, 6, feed_line.zip_bag_position)
self.set_position_to_tabel(row + 1, 1, feed_line.broken1_position)
self.set_position_to_tabel(row + 1, 2, feed_line.broken2_position)
self.set_position_to_tabel(row + 1, 3, feed_line.broken2_position)
self.set_position_to_tabel(row + 1, 4, feed_line.drop_bag_position)
# 禁用自动表头
@ -362,13 +350,11 @@ class MainWindow(QMainWindow, Ui_MainWindow):
for i in range(int(line_count)):
line_str = f'FeedLine{i + 1}'
safe_position = Real_Position()
photo_position = Real_Position()
mid_position = Real_Position()
broken_position1 = Real_Position()
broken_position2 = Real_Position()
feed_position = Real_Position()
shake_position = Real_Position()
dropBag_position = Real_Position()
zipBag_poistion = Real_Position()
safe_position.X = float(self.configReader.get(line_str, 'SafePosition_x', fallback=0))
@ -378,26 +364,13 @@ class MainWindow(QMainWindow, Ui_MainWindow):
safe_position.V = float(self.configReader.get(line_str, 'SafePosition_v', fallback=0))
safe_position.W = float(self.configReader.get(line_str, 'SafePosition_w', fallback=0))
photo_position.X = float(self.configReader.get(line_str, 'PhotoPosition_x', fallback=0))
photo_position.Y = float(self.configReader.get(line_str, 'PhotoPosition_y', fallback=0))
photo_position.Z = float(self.configReader.get(line_str, 'PhotoPosition_z', fallback=0))
photo_position.U = float(self.configReader.get(line_str, 'PhotoPosition_u', fallback=0))
photo_position.V = float(self.configReader.get(line_str, 'PhotoPosition_v', fallback=0))
photo_position.W = float(self.configReader.get(line_str, 'PhotoPosition_w', fallback=0))
mid_position.X = float(self.configReader.get(line_str, 'MidPosition_x', fallback=0))
mid_position.Y = float(self.configReader.get(line_str, 'MidPosition_y', fallback=0))
mid_position.Z = float(self.configReader.get(line_str, 'MidPosition_z', fallback=0))
mid_position.U = float(self.configReader.get(line_str, 'MidPosition_u', fallback=0))
mid_position.V = float(self.configReader.get(line_str, 'MidPosition_v', fallback=0))
mid_position.W = float(self.configReader.get(line_str, 'MidPosition_w', fallback=0))
broken_position1.X = float(self.configReader.get(line_str, 'BrokenPosition_x', fallback=0))
broken_position1.Y = float(self.configReader.get(line_str, 'BrokenPosition_y', fallback=0))
broken_position1.Z = float(self.configReader.get(line_str, 'BrokenPosition_z', fallback=0))
broken_position1.U = float(self.configReader.get(line_str, 'BrokenPosition_u', fallback=0))
broken_position1.V = float(self.configReader.get(line_str, 'BrokenPosition_v', fallback=0))
broken_position1.W = float(self.configReader.get(line_str, 'BrokenPosition_w', fallback=0))
broken_position2.X = float(self.configReader.get(line_str, 'BrokenPosition2_x', fallback=0))
broken_position2.Y = float(self.configReader.get(line_str, 'BrokenPosition2_y', fallback=0))
broken_position2.Z = float(self.configReader.get(line_str, 'BrokenPosition2_z', fallback=0))
@ -405,33 +378,23 @@ class MainWindow(QMainWindow, Ui_MainWindow):
broken_position2.V = float(self.configReader.get(line_str, 'BrokenPosition2_v', fallback=0))
broken_position2.W = float(self.configReader.get(line_str, 'BrokenPosition2_w', fallback=0))
shake_position.X = float(self.configReader.get(line_str, 'ShakePosition_x', fallback=0))
shake_position.Y = float(self.configReader.get(line_str, 'ShakePosition_y', fallback=0))
shake_position.Z = float(self.configReader.get(line_str, 'ShakePosition_z', fallback=0))
shake_position.U = float(self.configReader.get(line_str, 'ShakePosition_u', fallback=0))
shake_position.V = float(self.configReader.get(line_str, 'ShakePosition_v', fallback=0))
shake_position.W = float(self.configReader.get(line_str, 'ShakePosition_w', fallback=0))
dropBag_position.X = float(self.configReader.get(line_str, 'DropBagPosition_x', fallback=0))
dropBag_position.Y = float(self.configReader.get(line_str, 'DropBagPosition_y', fallback=0))
dropBag_position.Z = float(self.configReader.get(line_str, 'DropBagPosition_z', fallback=0))
dropBag_position.U = float(self.configReader.get(line_str, 'DropBagPosition_u', fallback=0))
dropBag_position.V = float(self.configReader.get(line_str, 'DropBagPosition_v', fallback=0))
dropBag_position.W = float(self.configReader.get(line_str, 'DropBagPosition_w', fallback=0))
zipBag_poistion.X = float(self.configReader.get(line_str, 'ZipBagPosition_x', fallback=0))
zipBag_poistion.Y = float(self.configReader.get(line_str, 'ZipBagPosition_y', fallback=0))
zipBag_poistion.Z = float(self.configReader.get(line_str, 'ZipBagPosition_z', fallback=0))
zipBag_poistion.U = float(self.configReader.get(line_str, 'ZipBagPosition_u', fallback=0))
zipBag_poistion.V = float(self.configReader.get(line_str, 'ZipBagPosition_v', fallback=0))
zipBag_poistion.W = float(self.configReader.get(line_str, 'ZipBagPosition_w', fallback=0))
feed_position.X = float(self.configReader.get(line_str, 'FeedPosition_x', fallback=0))
feed_position.Y = float(self.configReader.get(line_str, 'FeedPosition_y', fallback=0))
feed_position.Z = float(self.configReader.get(line_str, 'FeedPosition_z', fallback=0))
feed_position.U = float(self.configReader.get(line_str, 'FeedPosition_u', fallback=0))
feed_position.V = float(self.configReader.get(line_str, 'FeedPosition_v', fallback=0))
feed_position.W = float(self.configReader.get(line_str, 'FeedPosition_w', fallback=0))
name = self.configReader.get(line_str, 'Name', fallback='未命名')
self.feedLine_dict[f'{Constant.feedLine_set_section}{i + 1}'] = FeedLine(i+1,name, safe_position,
photo_position, mid_position,
broken_position1,broken_position2,dropBag_position,zipBag_poistion,feed_position)
broken_position1,broken_position2,shake_position ,dropBag_position)
self.init_seting_frame()
self.updateUI_Select_Line()
pass
@ -548,7 +511,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
num = self.horizontalSlider_feedingNum.maximum()
line_head = self.comboBox_lineIndex.currentData()
self.command_quene.put(FeedCommand(FeedingConfig(num, self.feedLine_dict[line_head])))
self.command_quene.put(FeedCommand(FeedingConfig(num, self.feedLine_dict[line_head], self.feeding.robotClient.photo_locs[:])))
self.stackedWidget_num.setCurrentIndex(1)
self.set_run_status_button(True)
log.log_message(logging.INFO, f'{self.feedLine_dict[line_head].name}:{Constant.str_feed_start}')
@ -681,21 +644,6 @@ class MainWindow(QMainWindow, Ui_MainWindow):
real_position.U, real_position.V, real_position.W)
self.set_position_to_tabel(row_i, 0, real_position)
def send_get_photo_position_button_click(self):
real_position = self.robotClient.status_model.getRealPosition()
row_i = self.tableWidget_feedSeting.currentRow()
head = self.tableWidget_feedSeting.item(row_i, 0).text()
self.feedLine_dict[head].photo_position.init_position(real_position.X, real_position.Y, real_position.Z,
real_position.U, real_position.V, real_position.W)
self.set_position_to_tabel(row_i, 1, real_position)
def send_get_feed_position_button_click(self):
real_position = self.robotClient.status_model.getRealPosition()
row_i = self.tableWidget_feedSeting.currentRow()
head = self.tableWidget_feedSeting.item(row_i, 0).text()
self.feedLine_dict[head].feed_position.init_position(real_position.X, real_position.Y, real_position.Z,
real_position.U, real_position.V, real_position.W)
self.set_position_to_tabel(row_i, 2, real_position)
def send_get_broken1_position_button_click(self):
real_position = self.robotClient.status_model.getRealPosition()
@ -703,7 +651,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
head = self.tableWidget_feedSeting.item(row_i, 0).text()
self.feedLine_dict[head].broken1_position.init_position(real_position.X, real_position.Y, real_position.Z,
real_position.U, real_position.V, real_position.W)
self.set_position_to_tabel(row_i, 3, real_position)
self.set_position_to_tabel(row_i, 1, real_position)
def send_get_broken2_position_button_click(self):
real_position = self.robotClient.status_model.getRealPosition()
@ -711,7 +659,15 @@ class MainWindow(QMainWindow, Ui_MainWindow):
head = self.tableWidget_feedSeting.item(row_i, 0).text()
self.feedLine_dict[head].broken2_position.init_position(real_position.X, real_position.Y, real_position.Z,
real_position.U, real_position.V, real_position.W)
self.set_position_to_tabel(row_i, 4, real_position)
self.set_position_to_tabel(row_i, 2, real_position)
def send_get_shake_position_button_click(self):
real_position = self.robotClient.status_model.getRealPosition()
row_i = self.tableWidget_feedSeting.currentRow()
head = self.tableWidget_feedSeting.item(row_i, 0).text()
self.feedLine_dict[head].shake_position.init_position(real_position.X, real_position.Y, real_position.Z,
real_position.U, real_position.V, real_position.W)
self.set_position_to_tabel(row_i, 3, real_position)
def send_get_dropbag_position_button_click(self):
real_position = self.robotClient.status_model.getRealPosition()
@ -719,7 +675,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
head = self.tableWidget_feedSeting.item(row_i, 0).text()
self.feedLine_dict[head].drop_bag_position.init_position(real_position.X, real_position.Y, real_position.Z,
real_position.U, real_position.V, real_position.W)
self.set_position_to_tabel(row_i, 5, real_position)
self.set_position_to_tabel(row_i, 4, real_position)
def send_get_zipbag_position_button_click(self):
real_position = self.robotClient.status_model.getRealPosition()
@ -735,16 +691,21 @@ class MainWindow(QMainWindow, Ui_MainWindow):
row_position = self.tableWidget_feedSeting.rowCount() # 当前行数
self.tableWidget_feedSeting.insertRow(row_position)
safe_position = Real_Position()
photo_position = Real_Position()
feed_position = Real_Position()
self.feedLine_dict[head] = FeedLine('新建', safe_position, photo_position, feed_position)
break_1_position = Real_Position()
break_2_position = Real_Position()
shake_position = Real_Position()
drop_bag_position = Real_Position()
self.feedLine_dict[head] = FeedLine('新建', safe_position, break_1_position, break_2_position,shake_position,drop_bag_position)
self.tableWidget_feedSeting.setItem(self.tableWidget_feedSeting.rowCount() - 1, 0,
QTableWidgetItem(head))
self.tableWidget_feedSeting.setItem(self.tableWidget_feedSeting.rowCount() - 1, 1,
QTableWidgetItem('新建'))
self.set_position_to_tabel(self.tableWidget_feedSeting.rowCount() - 1, 0, safe_position)
self.set_position_to_tabel(self.tableWidget_feedSeting.rowCount() - 1, 1, photo_position)
self.set_position_to_tabel(self.tableWidget_feedSeting.rowCount() - 1, 2, feed_position)
self.set_position_to_tabel(self.tableWidget_feedSeting.rowCount() - 1, 1, break_1_position)
self.set_position_to_tabel(self.tableWidget_feedSeting.rowCount() - 1, 2, break_2_position)
self.set_position_to_tabel(self.tableWidget_feedSeting.rowCount() - 1, 3, shake_position)
self.set_position_to_tabel(self.tableWidget_feedSeting.rowCount() - 1, 4, drop_bag_position)
break
def send_tabelFeedSet_delRow(self):
@ -824,30 +785,56 @@ class MainWindow(QMainWindow, Ui_MainWindow):
self.feedLine_dict[head].safe_position.W = float(value)
# elif column == 7:
elif column == (6 + self.tableWidget_feedSeting_addtional_col_num):
self.feedLine_dict[head].photo_position.X = float(value)
self.feedLine_dict[head].broken1_position.X = float(value)
elif column == (7 + self.tableWidget_feedSeting_addtional_col_num):
self.feedLine_dict[head].photo_position.Y = float(value)
self.feedLine_dict[head].broken1_position.Y = float(value)
elif column == (8 + self.tableWidget_feedSeting_addtional_col_num):
self.feedLine_dict[head].photo_position.Z = float(value)
self.feedLine_dict[head].broken1_position.Z = float(value)
elif column == (9 + self.tableWidget_feedSeting_addtional_col_num):
self.feedLine_dict[head].photo_position.U = float(value)
self.feedLine_dict[head].broken1_position.U = float(value)
elif column == (10 + self.tableWidget_feedSeting_addtional_col_num):
self.feedLine_dict[head].photo_position.V = float(value)
self.feedLine_dict[head].broken1_position.V = float(value)
elif column == (11 + self.tableWidget_feedSeting_addtional_col_num):
self.feedLine_dict[head].photo_position.W = float(value)
self.feedLine_dict[head].broken1_position.W = float(value)
elif column == (12 + self.tableWidget_feedSeting_addtional_col_num):
self.feedLine_dict[head].feed_position.X = float(value)
self.feedLine_dict[head].broken2_position.X = float(value)
elif column == (13 + self.tableWidget_feedSeting_addtional_col_num):
self.feedLine_dict[head].feed_position.Y = float(value)
self.feedLine_dict[head].broken2_position.Y = float(value)
elif column == (14 + self.tableWidget_feedSeting_addtional_col_num):
self.feedLine_dict[head].feed_position.Z = float(value)
self.feedLine_dict[head].broken2_position.Z = float(value)
elif column == (15 + self.tableWidget_feedSeting_addtional_col_num):
self.feedLine_dict[head].feed_position.U = float(value)
self.feedLine_dict[head].broken2_position.U = float(value)
elif column == (16 + self.tableWidget_feedSeting_addtional_col_num):
self.feedLine_dict[head].feed_position.V = float(value)
self.feedLine_dict[head].broken2_position.V = float(value)
elif column == (17 + self.tableWidget_feedSeting_addtional_col_num):
self.feedLine_dict[head].feed_position.W = float(value)
self.feedLine_dict[head].broken2_position.W = float(value)
elif column == (18 + self.tableWidget_feedSeting_addtional_col_num):
self.feedLine_dict[head].shake_position.X = float(value)
elif column == (19 + self.tableWidget_feedSeting_addtional_col_num):
self.feedLine_dict[head].shake_position.Y = float(value)
elif column == (20 + self.tableWidget_feedSeting_addtional_col_num):
self.feedLine_dict[head].shake_position.Z = float(value)
elif column == (21 + self.tableWidget_feedSeting_addtional_col_num):
self.feedLine_dict[head].shake_position.U = float(value)
elif column == (22 + self.tableWidget_feedSeting_addtional_col_num):
self.feedLine_dict[head].shake_position.V = float(value)
elif column == (23 + self.tableWidget_feedSeting_addtional_col_num):
self.feedLine_dict[head].shake_position.W = float(value)
elif column == (24 + self.tableWidget_feedSeting_addtional_col_num):
self.feedLine_dict[head].drop_bag_position.X = float(value)
elif column == (25 + self.tableWidget_feedSeting_addtional_col_num):
self.feedLine_dict[head].drop_bag_position.Y = float(value)
elif column == (26 + self.tableWidget_feedSeting_addtional_col_num):
self.feedLine_dict[head].drop_bag_position.Z = float(value)
elif column == (27 + self.tableWidget_feedSeting_addtional_col_num):
self.feedLine_dict[head].drop_bag_position.U = float(value)
elif column == (28 + self.tableWidget_feedSeting_addtional_col_num):
self.feedLine_dict[head].drop_bag_position.V = float(value)
elif column == (29 + self.tableWidget_feedSeting_addtional_col_num):
self.feedLine_dict[head].drop_bag_position.W = float(value)
def run(self):
while True:
@ -1139,34 +1126,52 @@ class MainWindow(QMainWindow, Ui_MainWindow):
### 设置界面
def get_p1_button_click(self):
realPosition = self.robotClient.status_model.getRealPosition()
self.lineEdit_x1.setText(realPosition.X)
self.lineEdit_y1.setText(realPosition.Y)
self.lineEdit_z1.setText(realPosition.Z)
realPosition = self.robotClient.status_model.getRealPosition()
self.lineEdit_x1.setText(str(realPosition.X))
self.lineEdit_y1.setText(str(realPosition.Y))
self.lineEdit_z1.setText(str(realPosition.Z)+"1")
self.lineEdit_u1.setText(str(realPosition.U))
self.lineEdit_v1.setText(str(realPosition.V))
self.lineEdit_w1.setText(str(realPosition.W))
def get_p2_button_click(self):
realPosition = self.robotClient.status_model.getRealPosition()
self.lineEdit_x2.setText(realPosition.X)
self.lineEdit_y2.setText(realPosition.Y)
self.lineEdit_z2.setText(realPosition.Z)
realPosition = self.robotClient.status_model.getRealPosition()
self.lineEdit_x2.setText(str(realPosition.X))
self.lineEdit_y2.setText(str(realPosition.Y))
self.lineEdit_z2.setText(str(realPosition.Z)+"2")
self.lineEdit_u2.setText(str(realPosition.U))
self.lineEdit_v2.setText(str(realPosition.V))
self.lineEdit_w2.setText(str(realPosition.W))
def get_p3_button_click(self):
realPosition = self.robotClient.status_model.getRealPosition()
self.lineEdit_x3.setText(realPosition.X)
self.lineEdit_y3.setText(realPosition.Y)
self.lineEdit_z3.setText(realPosition.Z)
realPosition = self.robotClient.status_model.getRealPosition()
self.lineEdit_x3.setText(str(realPosition.X))
self.lineEdit_y3.setText(str(realPosition.Y))
self.lineEdit_z3.setText(str(realPosition.Z)+"3")
self.lineEdit_u3.setText(str(realPosition.U))
self.lineEdit_v3.setText(str(realPosition.V))
self.lineEdit_w3.setText(str(realPosition.W))
def get_p4_button_click(self):
realPosition = self.robotClient.status_model.getRealPosition()
self.lineEdit_x4.setText(realPosition.X)
self.lineEdit_y4.setText(realPosition.Y)
self.lineEdit_z4.setText(realPosition.Z)
realPosition = self.robotClient.status_model.getRealPosition()
self.lineEdit_x4.setText(str(realPosition.X))
self.lineEdit_y4.setText(str(realPosition.Y))
self.lineEdit_z4.setText(str(realPosition.Z)+"4")
self.lineEdit_u4.setText(str(realPosition.U))
self.lineEdit_v4.setText(str(realPosition.V))
self.lineEdit_w4.setText(str(realPosition.W))
def get_p5_button_click(self):
realPosition = self.robotClient.status_model.getRealPosition()
self.lineEdit_x5.setText(realPosition.X)
self.lineEdit_y5.setText(realPosition.Y)
self.lineEdit_z5.setText(realPosition.Z)
self.lineEdit_x5.setText(str(realPosition.X))
self.lineEdit_y5.setText(str(realPosition.Y))
self.lineEdit_z5.setText(str(realPosition.Z)+"5")
self.lineEdit_u5.setText(str(realPosition.U))
self.lineEdit_v5.setText(str(realPosition.V))
self.lineEdit_w5.setText(str(realPosition.W))
def set_p1_button_click(self):
try: