UC2-REST 0.2.0.36__tar.gz → 0.2.0.37__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/PKG-INFO +1 -1
  2. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/UC2_REST.egg-info/PKG-INFO +1 -1
  3. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/uc2rest/__version__.py +1 -1
  4. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/uc2rest/motor.py +30 -3
  5. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/LICENSE +0 -0
  6. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/README.md +0 -0
  7. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/UC2_REST.egg-info/SOURCES.txt +0 -0
  8. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/UC2_REST.egg-info/dependency_links.txt +0 -0
  9. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/UC2_REST.egg-info/not-zip-safe +0 -0
  10. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/UC2_REST.egg-info/requires.txt +0 -0
  11. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/UC2_REST.egg-info/top_level.txt +0 -0
  12. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/setup.cfg +0 -0
  13. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/setup.py +0 -0
  14. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/uc2rest/MockSerial.py +0 -0
  15. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/uc2rest/UC2Client.py +0 -0
  16. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/uc2rest/__init__.py +0 -0
  17. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/uc2rest/analog.py +0 -0
  18. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/uc2rest/camera.py +0 -0
  19. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/uc2rest/camera_trigger.py +0 -0
  20. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/uc2rest/can.py +0 -0
  21. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/uc2rest/canota.py +0 -0
  22. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/uc2rest/cmdrecorder.py +0 -0
  23. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/uc2rest/digitalin.py +0 -0
  24. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/uc2rest/digitalout.py +0 -0
  25. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/uc2rest/fan.py +0 -0
  26. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/uc2rest/galvo.py +0 -0
  27. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/uc2rest/gripper.py +0 -0
  28. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/uc2rest/home.py +0 -0
  29. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/uc2rest/laser.py +0 -0
  30. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/uc2rest/lcddisplay.py +0 -0
  31. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/uc2rest/ledmatrix.py +0 -0
  32. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/uc2rest/logger.py +0 -0
  33. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/uc2rest/message.py +0 -0
  34. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/uc2rest/modules.py +0 -0
  35. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/uc2rest/motor_config.py +0 -0
  36. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/uc2rest/mserial.py +0 -0
  37. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/uc2rest/objective.py +0 -0
  38. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/uc2rest/pid.py +0 -0
  39. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/uc2rest/rotator.py +0 -0
  40. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/uc2rest/slm.py +0 -0
  41. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/uc2rest/state.py +0 -0
  42. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/uc2rest/temperature.py +0 -0
  43. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/uc2rest/utils.py +0 -0
  44. {uc2_rest-0.2.0.36 → uc2_rest-0.2.0.37}/uc2rest/wifi.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: UC2-REST
3
- Version: 0.2.0.36
3
+ Version: 0.2.0.37
4
4
  Summary: This pacage will help you to drive the ESP32-driven microscopy control modules from UC2
5
5
  Home-page: https://github.com/openUC2/UC2-REST
6
6
  Author: Benedict Diederich
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: UC2-REST
3
- Version: 0.2.0.36
3
+ Version: 0.2.0.37
4
4
  Summary: This pacage will help you to drive the ESP32-driven microscopy control modules from UC2
5
5
  Home-page: https://github.com/openUC2/UC2-REST
6
6
  Author: Benedict Diederich
@@ -6,7 +6,7 @@ __version__.py
6
6
 
7
7
  __title__ = 'UC2-REST'
8
8
  __description__ = 'This pacage will help you to drive the ESP32-driven microscopy control modules from UC2'
9
- __version__ = "0.2.0.36"
9
+ __version__ = "v0.2.0.37"
10
10
  __author__ = 'Benedict Diederich'
11
11
  __author_email__ = 'benedictdied@gmail.com'
12
12
  __license__ = 'GPL v3'
@@ -91,12 +91,19 @@ class Motor(object):
91
91
  nSteppers = len(data["steppers"])
92
92
  stepSizes = np.array((self.stepSizeA, self.stepSizeX, self.stepSizeY, self.stepSizeZ))
93
93
  for iMotor in range(nSteppers):
94
- stepperID = data["steppers"][iMotor]["stepperid"]
94
+ stepper = data["steppers"][iMotor]
95
+ # Intermediate status frames during a move carry only
96
+ # {stepperid, isDone} with no "position" key — skip them instead
97
+ # of raising KeyError 'position' (which previously aborted the
98
+ # whole callback and left currentPosition stale).
99
+ if "position" not in stepper:
100
+ continue
101
+ stepperID = stepper["stepperid"]
95
102
  # Hardware returns raw steps in firmware frame; convert to physical units
96
103
  # in user frame: phys = hw_steps * stepSize * direction. The direction sign
97
104
  # hides any wiring polarity flip from the caller.
98
105
  self.currentPosition[stepperID] = (
99
- data["steppers"][iMotor]["position"]
106
+ stepper["position"]
100
107
  * stepSizes[stepperID]
101
108
  * self.direction[stepperID]
102
109
  )
@@ -333,6 +340,26 @@ class Motor(object):
333
340
  self.stepSizeA = stepSize
334
341
  self.backlash[axisIdx] = backlash
335
342
 
343
+ def set_backlash(self, axis, backlash):
344
+ """Set the per-axis backlash (in hardware steps) used as a reversal overshoot.
345
+
346
+ ``axis`` may be a name (\"X\"/\"Y\"/\"Z\"/\"A\") or a hardware index (0-3).
347
+ The value is stored in :attr:`backlash` and consumed by
348
+ :meth:`move_stepper`, which adds ``direction * backlash`` extra steps
349
+ whenever the axis changes direction, taking up the mechanical slack so the
350
+ stage still reaches the commanded target. Pass ``0`` to disable
351
+ compensation for that axis. Typically fed from a camera-based backlash
352
+ measurement (microns) after converting to steps with the axis step size.
353
+ """
354
+ idx = self.xyztTo1230(axis) if isinstance(axis, str) else int(axis)
355
+ self.backlash[idx] = backlash
356
+ return float(self.backlash[idx])
357
+
358
+ def get_backlash(self, axis):
359
+ """Return the per-axis backlash (in hardware steps)."""
360
+ idx = self.xyztTo1230(axis) if isinstance(axis, str) else int(axis)
361
+ return float(self.backlash[idx])
362
+
336
363
  def xyztTo1230(self, axis):
337
364
  axis = axis.upper()
338
365
  if axis == "X":
@@ -705,7 +732,7 @@ class Motor(object):
705
732
  motorProp["acceleration"] = int(acceleration[iMotor])
706
733
  else:
707
734
  motorProp["accel"] = self.DEFAULT_ACCELERATION
708
- motorProp["acceleleration"] = self.DEFAULT_ACCELERATION
735
+ motorProp["acceleration"] = self.DEFAULT_ACCELERATION
709
736
  motorPropList.append(motorProp)
710
737
  if len(motorPropList)==0:
711
738
  return "{'return':-1}"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes