diff --git a/CU/Catch.py b/CU/Catch.py index a8b1920..4044997 100644 --- a/CU/Catch.py +++ b/CU/Catch.py @@ -31,8 +31,8 @@ class Catch: if self.catch_status == CatchStatus.CDrop: self.robotClient.sendIOControl(self.robotClient.con_ios[0],0) self.robotClient.sendIOControl(self.robotClient.con_ios[1],1) - if Constant.Debug or self.robotClient.check_outputQ(self.robotClient.con_ios[1]) and not self.robotClient.check_outputQ(self.robotClient.con_ios[0]): - self.catch_status = CatchStatus.COk + # if Constant.Debug or self.robotClient.check_outputQ(self.robotClient.con_ios[1]) and not self.robotClient.check_outputQ(self.robotClient.con_ios[0]): + self.catch_status = CatchStatus.COk if self.catch_status == CatchStatus.CShake: if not self.shake_continue.Q(True, 1500): shakeQ = self.shakePulse.Q(True, 50, 50) diff --git a/CU/Feeding.py b/CU/Feeding.py index 1eec0bf..a558f2a 100644 --- a/CU/Feeding.py +++ b/CU/Feeding.py @@ -73,14 +73,14 @@ class FeedLine: - def get_current_feed_position(self): - pos = self.feeding_to_end[self.feeding2end_pos_index-1] + def get_current_feed_position(self,is_reverse): + pos = self.feeding_to_end[ (self.feeding2end_pos_index+1)%len(self.feeding_to_end) if is_reverse else self.feeding2end_pos_index-1] return pos - def get_current_take_position(self): - pos = self.start_to_take[self.start2take_pos_index-1] + def get_current_take_position(self,is_reverse): + pos = self.start_to_take[ (self.start2take_pos_index+1)%len(self.start_to_take) if is_reverse else self.start2take_pos_index-1] return pos - def get_current_start_position(self): - pos = self.origin_to_start[self.origin2start_pos_index-1] + def get_current_start_position(self,is_reverse): + pos = self.origin_to_start[(self.origin2start_pos_index+1)%len(self.origin_to_start) if is_reverse else self.origin2start_pos_index-1] return pos def get_next_feed_position(self,reverse:bool=False): @@ -282,7 +282,7 @@ class Feeding(QObject): elif self.feedStatus == FeedStatus.FMid: log.log_message(logging.INFO, Constant.str_feed_mid) - feed_pos = self.get_current_position() + feed_pos = self.get_current_position(self.is_reverse) if feed_pos.get_position().compare(real_position): self.next_position(self.is_reverse) @@ -717,13 +717,13 @@ class Feeding(QObject): else: self.sendTargPosition(real_position=feed_pos.get_position(),speed=self.robotClient.debug_speed) - def get_current_position(self): + def get_current_position(self,is_reverse=False): if self.feed_Mid_Status == FeedMidStatus.FMid_Start: - return self.feedConfig.feedLine.get_current_start_position() + return self.feedConfig.feedLine.get_current_start_position(self.is_reverse) elif self.feed_Mid_Status == FeedMidStatus.FMid_Take: - return self.feedConfig.feedLine.get_current_take_position() + return self.feedConfig.feedLine.get_current_take_position(self.is_reverse) elif self.feed_Mid_Status == FeedMidStatus.FMid_Feed: - return self.feedConfig.feedLine.get_current_feed_position() + return self.feedConfig.feedLine.get_current_feed_position(self.is_reverse) def next_position(self,reverse=False): if self.feed_Mid_Status == FeedMidStatus.FMid_Start: self.next_start(reverse)