Loading openflexure_microscope/api/templates/index_v1.html +1 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ </p> <p> <button type="button" onclick="setStagePositionsFromInput();">GO</button> <button type="button" onclick="getStagePositions();">Update</button> <button type="button" onclick="api.getState(updateStateValues);">Update</button> </p> <p> Loading openflexure_microscope/api/v1/blueprints/stage.py +4 −2 Original line number Diff line number Diff line Loading @@ -67,7 +67,7 @@ class PositionAPI(MicroscopeView): position = [0, 0, 0] # Handle absolute positioning (calculate a relative move from current position and target) if payload.param('absolute') is True: if (payload.param('absolute') is True) and (self.microscope.stage): # Only if stage exists target_position = axes_to_array(payload.json, ['x', 'y', 'z']) logging.debug("TARGET: {}".format(target_position)) position = [target_position[i] - self.microscope.stage.position[i] for i in range(3)] Loading @@ -79,6 +79,8 @@ class PositionAPI(MicroscopeView): logging.debug(position) # Move if stage exists if self.microscope.stage: self.microscope.stage.move_rel(position) out = filter_dict(self.microscope.state, ('stage', 'position')) Loading openflexure_microscope/microscope.py +10 −2 Original line number Diff line number Diff line Loading @@ -138,7 +138,11 @@ class Microscope(object): } # Add stage position if self.stage: # If stage exists, populate with real values position = self.stage.position else: # Else, zero position = [0, 0, 0] state['stage']['position'] = { 'x': position[0], 'y': position[1], Loading @@ -158,7 +162,11 @@ class Microscope(object): self._config.update(self.camera.config) # If attached to a stage if self.stage: backlash = self.stage.backlash.tolist() else: backlash = [0, 0, 0] self._config['backlash'] = { 'x': backlash[0], 'y': backlash[1], Loading Loading
openflexure_microscope/api/templates/index_v1.html +1 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ </p> <p> <button type="button" onclick="setStagePositionsFromInput();">GO</button> <button type="button" onclick="getStagePositions();">Update</button> <button type="button" onclick="api.getState(updateStateValues);">Update</button> </p> <p> Loading
openflexure_microscope/api/v1/blueprints/stage.py +4 −2 Original line number Diff line number Diff line Loading @@ -67,7 +67,7 @@ class PositionAPI(MicroscopeView): position = [0, 0, 0] # Handle absolute positioning (calculate a relative move from current position and target) if payload.param('absolute') is True: if (payload.param('absolute') is True) and (self.microscope.stage): # Only if stage exists target_position = axes_to_array(payload.json, ['x', 'y', 'z']) logging.debug("TARGET: {}".format(target_position)) position = [target_position[i] - self.microscope.stage.position[i] for i in range(3)] Loading @@ -79,6 +79,8 @@ class PositionAPI(MicroscopeView): logging.debug(position) # Move if stage exists if self.microscope.stage: self.microscope.stage.move_rel(position) out = filter_dict(self.microscope.state, ('stage', 'position')) Loading
openflexure_microscope/microscope.py +10 −2 Original line number Diff line number Diff line Loading @@ -138,7 +138,11 @@ class Microscope(object): } # Add stage position if self.stage: # If stage exists, populate with real values position = self.stage.position else: # Else, zero position = [0, 0, 0] state['stage']['position'] = { 'x': position[0], 'y': position[1], Loading @@ -158,7 +162,11 @@ class Microscope(object): self._config.update(self.camera.config) # If attached to a stage if self.stage: backlash = self.stage.backlash.tolist() else: backlash = [0, 0, 0] self._config['backlash'] = { 'x': backlash[0], 'y': backlash[1], Loading