Skip to content

Commit

Permalink
Log only set position
Browse files Browse the repository at this point in the history
  • Loading branch information
ivalaginja committed May 24, 2024
1 parent 73aa5b2 commit c60f305
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,13 @@ def set_current_position(self, position):
self.min_position_config, self.unit, self.max_position_config, self.unit)

# Update the current position data stream.
self.log.info("Setting new position: %f %s", position, self.unit)
self.get_current_position()

def get_current_position(self):
current_position = self.lib.CC_GetPosition(self.serial_number)
real_unit = c_double()
self.lib.CC_GetRealValueFromDeviceUnit(self.serial_number, current_position, byref(real_unit), 0)
self.log.debug("Current position: %f %s", real_unit.value, self.unit)
self.current_position.submit_data(np.array([real_unit.value], dtype='float64'))

def wait_for_completion(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def set_current_position(self, position):
The unit is given in real-life units (mm if translation, deg if rotation).
"""
if self.min_position_config <= position <= self.max_position_config:
self.log.info("Setting new position: %f %s", position, self.unit)
self.testbed.simulator.move_stage(stage_id=self.id,
old_position=self.get_current_position(),
new_position=position)
Expand All @@ -89,7 +90,6 @@ def set_current_position(self, position):

def get_current_position(self):
position = self.current_position.get()[0]
self.log.debug("Current position: %f %s", position, self.unit)
return position

def resolve_position(self, position):
Expand Down

0 comments on commit c60f305

Please sign in to comment.