PySigmaKoki 2.1.7__py3-none-any.whl → 2.1.8__py3-none-any.whl

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PySigmaKoki
3
- Version: 2.1.7
3
+ Version: 2.1.8
4
4
  Summary: Python Interface for Instruments by Sigma Koki
5
5
  Author-email: Akira Okumura <oxon@mac.com>
6
6
  License: BSD License
@@ -0,0 +1,5 @@
1
+ sigma_koki.py,sha256=be_BC6AE8jCVeUU5o-VH9mV6S771BBKeuhBHFjPiwsQ,11691
2
+ pysigmakoki-2.1.8.dist-info/METADATA,sha256=6U9Au55zTn230LzdLgRccxX4BZtmAq9E8Em4ls5d6BA,958
3
+ pysigmakoki-2.1.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
4
+ pysigmakoki-2.1.8.dist-info/top_level.txt,sha256=Zbq-FJdx-r0smE3UcnxNBcJ2wVwCX8pGfow0rejSOWk,11
5
+ pysigmakoki-2.1.8.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.8.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
sigma_koki.py CHANGED
@@ -110,9 +110,18 @@ class BaseStageController(object):
110
110
  else:
111
111
  return
112
112
 
113
- def move(self, stage1, stage2):
113
+ def move(self, stage1_pulses, stage2_pulses):
114
+ self.move_relative(stage1_pulses, stage2_pulses)
115
+
116
+ def move_relative(self, stage1_pulses, stage2_pulses):
117
+ self.move_common(stage1_pulses, stage2_pulses, True)
118
+
119
+ def move_absolute(self, stage1_pulses, stage2_pulses):
120
+ self.move_common(stage1_pulses, stage2_pulses, False)
121
+
122
+ def move_common(self, stage1_pulses, stage2_pulses, relative:bool = True):
114
123
  """
115
- Moves the stages with the specified values. Since GSC-02 is a half-step
124
+ Moves the stages by the specified values. Since GSC-02 is a half-step
116
125
  stepping driver, 1 pulse corresponds to "half-step movement" in the
117
126
  stage catalogues.
118
127
  """
@@ -121,22 +130,26 @@ class BaseStageController(object):
121
130
  elif self.__product == 'SHOT-702':
122
131
  limit = 268435455
123
132
 
124
- if not (-limit <= stage1 <= limit):
133
+ if not (-limit <= stage1_pulses <= limit):
125
134
  raise ValueError('stage1 must be between -%d and %d.' % (limit, limit))
126
135
 
127
- if not (-limit <= stage2 <= limit):
136
+ if not (-limit <= stage2_pulses <= limit):
128
137
  raise ValueError('stage2 must be between -%d and %d.' % (limit, limit))
129
138
 
130
- command = 'M:W'
131
- if stage1 >= 0:
132
- command += '+P%d' % stage1
139
+ if relative
140
+ command = 'M:W' # relative
141
+ else:
142
+ command = 'A:W' # absolute
143
+
144
+ if stage1_pulses >= 0:
145
+ command += '+P%d' % stage1_pulses
133
146
  else:
134
- command += '-P%d' % -stage1
147
+ command += '-P%d' % -stage1_pulses
135
148
 
136
- if stage2 >= 0:
137
- command += '+P%d' % stage2
149
+ if stage2_pulses >= 0:
150
+ command += '+P%d' % stage2_pulses
138
151
  else:
139
- command += '-P%d' % -stage2
152
+ command += '-P%d' % -stage2_pulses
140
153
 
141
154
  self.write(command)
142
155
  self.go()
@@ -325,4 +338,3 @@ class SHOT702(BaseStageController):
325
338
  self.write('D:WS%dF%dR%dS%dF%dR%d' % (minSpeed1, maxSpeed1, accelerationTime1, minSpeed2, maxSpeed2, accelerationTime2))
326
339
 
327
340
  # Some query commands, ?:P, ?:S, ?:D, and ?:B, are not implemented yet
328
-
@@ -1,5 +0,0 @@
1
- sigma_koki.py,sha256=FW8QZzhgdjCyM8HXrJrPrRKcUR2Y049Rg19cJkHh9FY,11159
2
- pysigmakoki-2.1.7.dist-info/METADATA,sha256=iGpkSvgLLkjI-2O55oRSAXjlKHYOJODFhOihxU0rwrQ,958
3
- pysigmakoki-2.1.7.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
4
- pysigmakoki-2.1.7.dist-info/top_level.txt,sha256=Zbq-FJdx-r0smE3UcnxNBcJ2wVwCX8pGfow0rejSOWk,11
5
- pysigmakoki-2.1.7.dist-info/RECORD,,