Skip to content
Snippets Groups Projects
Commit a198a018 authored by antcsny's avatar antcsny
Browse files

WIP Trace stop during execution

Adding a new state to read_done to stop the kuka trace if collector is done
parent 48911891
No related merge requests found
...@@ -273,7 +273,7 @@ class KUKA_DataReader: ...@@ -273,7 +273,7 @@ class KUKA_DataReader:
# Flag indicating the state of the collection # Flag indicating the state of the collection
self._read_done = False self._read_done = False
while not self._read_done: while self._read_done != 1 :
# Getting our sample # Getting our sample
data, self._data_available, self._read_done = self.read(now, load) data, self._data_available, self._read_done = self.read(now, load)
...@@ -309,7 +309,9 @@ class KUKA_DataReader: ...@@ -309,7 +309,9 @@ class KUKA_DataReader:
sleep(self.rate/2) sleep(self.rate/2)
else: else:
# Sleeping to wait for the next data to be sampled # Sleeping to wait for the next data to be sampled, stop de trace if robot movement done
if self._read_done == 2:
self.trace.Trace_Stop()
sleep(self.rate/2) sleep(self.rate/2)
# Creating a data frame # Creating a data frame
...@@ -397,7 +399,6 @@ class KUKA_DataReader: ...@@ -397,7 +399,6 @@ class KUKA_DataReader:
trace_sampling = int(trace_config.split("_")[0]) trace_sampling = int(trace_config.split("_")[0])
## ---- Run for a single speed ---- ## ## ---- Run for a single speed ---- ##
if type(speed) == str or type(speed) == int: if type(speed) == str or type(speed) == int:
# Sync with other robots # Sync with other robots
...@@ -429,7 +430,6 @@ class KUKA_DataReader: ...@@ -429,7 +430,6 @@ class KUKA_DataReader:
# Returning the two collected DataFrames # Returning the two collected DataFrames
return data_vars, data_trace return data_vars, data_trace
## -------------------------------- ## ## -------------------------------- ##
## ---- Run for multiple speeds ---- ## ## ---- Run for multiple speeds ---- ##
......
...@@ -205,8 +205,11 @@ DEF COMMUNICATION_ROUTINE () ...@@ -205,8 +205,11 @@ DEF COMMUNICATION_ROUTINE ()
__TAB_1[35] = 1 ; __PYTHON_DATA_AVAILABLE = TRUE __TAB_1[35] = 1 ; __PYTHON_DATA_AVAILABLE = TRUE
ENDIF ENDIF
IF (NOT ColRUN) AND (SAMPLE_NUMBER == SAMPLE_READ) THEN IF (NOT ColRUN) AND THEN
__TAB_1[36] = 1 ; __READ_DONE IF SAMPLE_NUMBER == SAMPLE_READ THEN
__TAB_1[36] = 1 ; __READ_DONE
ELSE
__TAB_1[36] = 2 ; TRACE_STOP
ELSE ELSE
__TAB_1[36] = 0 __TAB_1[36] = 0
ENDIF ENDIF
......
...@@ -13,6 +13,7 @@ class Measure_robot (CollectionGraphWindow): ...@@ -13,6 +13,7 @@ class Measure_robot (CollectionGraphWindow):
# Flag used to close the window when done # Flag used to close the window when done
collecting_data_done = False collecting_data_done = False
storing_data_done = False
# Collected data # Collected data
data = None data = None
...@@ -130,9 +131,11 @@ class Measure_robot (CollectionGraphWindow): ...@@ -130,9 +131,11 @@ class Measure_robot (CollectionGraphWindow):
if self.collecting_data_done : if self.collecting_data_done :
self.collecting_data_done = False self.collecting_data_done = False
self._status.update("Collection Done !",text_color="#0c2") self._status.update("Collection Done",text_color="#00f")
elif self.storing_data_done :
self.storing_data_done = False
self._status.update("Successfully stored data", text_color='#0c2')
else: else:
self.redraw() self.redraw()
return True return True
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment