moons-motor 0.0.8__py3-none-any.whl → 0.0.9__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.
moons_motor/motor.py CHANGED
@@ -147,25 +147,28 @@ class MoonsStepper(Subject):
147
147
  ports = list(list_ports.comports())
148
148
  for p in ports:
149
149
  m = re.match(
150
- r"USB\s*VID:PID=(\w+):(\w+)\s*SER=([A-Za-z0-9]+)", p.usb_info()
150
+ r"USB\s*VID:PID=(\w+):(\w+)\s*SER=([A-Za-z0-9]*)", p.usb_info()
151
151
  )
152
+ print(m, p.usb_info())
152
153
  if (
153
154
  m
154
155
  and m.group(1) == self.VID
155
156
  and m.group(2) == self.PID
156
- and m.group(3) == self.SERIAL_NUM
157
+ # and m.group(3) == self.SERIAL_NUM
157
158
  ):
158
- print(
159
- f"Device: {p.description} | VID: {m.group(1)} | PID: {m.group(2)} | SER: {m.group(3)} connected"
160
- )
161
-
162
- self.device = p.description
163
-
164
- attempt_connect(p.device, baudrate)
165
- if callback:
166
- callback(self.device, self.Opened)
159
+ print("find vid pid match")
160
+ if m.group(3) == self.SERIAL_NUM or self.SERIAL_NUM == "":
161
+ print(
162
+ f"Device: {p.description} | VID: {m.group(1)} | PID: {m.group(2)} | SER: {m.group(3)} connected"
163
+ )
164
+
165
+ self.device = p.description
166
+
167
+ attempt_connect(p.device, baudrate)
168
+ if callback:
169
+ callback(self.device, self.Opened)
170
+ break
167
171
  break
168
- break
169
172
 
170
173
  if self.only_simulate:
171
174
  self.device = "Simulate"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: moons_motor
3
- Version: 0.0.8
3
+ Version: 0.0.9
4
4
  Summary: This is a python library for controlling the Moons' motor through the serial port.
5
5
  Author-email: miroc <mike8503111@gmail.com>
6
6
  Project-URL: Repository, https://github.com/miroc99/moons_motor.git
@@ -22,15 +22,20 @@ Requires-Dist: requests
22
22
  This is a python library for control moons motor through serial port.
23
23
 
24
24
  ## Compatibility
25
+
25
26
  Now only support Windows.
26
27
 
27
28
  ## Installing
29
+
28
30
  Install through `pip`
31
+
29
32
  ```bash
30
33
  python -m pip install moons_motor
31
34
 
32
35
  ```
36
+
33
37
  ## Usage
38
+
34
39
  ```python
35
40
  from motor import MoonsStepper, StepperModules
36
41
  import simulate
@@ -46,7 +51,9 @@ sleep(5)
46
51
  motor.stop_jog()
47
52
 
48
53
  ```
54
+
49
55
  ## Tested Motor
56
+
50
57
  1. STM17S-3RN
51
58
 
52
59
  ## Reference
@@ -1,11 +1,11 @@
1
1
  moons_motor/__init__.py,sha256=qOpsRwizV-DpKSvNzyvj8ju3cs6vwgIICur1Oe6sxOA,27
2
- moons_motor/motor.py,sha256=KM2DIHB3RRx21pMPp7q6q1XNFDfSoiNV8Lk0jaqYyD4,13221
2
+ moons_motor/motor.py,sha256=ruvSUhKlVk6v8Jxl7lDZ4tu4t953_jr6OWjgenIms0E,13416
3
3
  moons_motor/observer.py,sha256=PXzuPYKRb2HpjArJcD8HakYIPfFGAs1uBDIL8PSizgA,124
4
4
  moons_motor/simulate.py,sha256=J0y1fZhoOim9i-BAkprxnPern1SAdkDfKPqT2MWyDwU,2561
5
5
  moons_motor/status.py,sha256=jXQZFZTt9ugHktkWKLII8MpEQQaeO-UjlwTrrP4LJNE,2872
6
6
  moons_motor/subject.py,sha256=L_GS6fvJTeX7X23o3T92oiZ4rtLVKA2OEd9GpHn_Dz4,445
7
- moons_motor-0.0.8.dist-info/LICENSE,sha256=nsYjO800SjIjI85y2kVHR5mC3tca2vs4kK_BhNe89bM,1074
8
- moons_motor-0.0.8.dist-info/METADATA,sha256=qbzG4yrvxm5yjawnb_4zGG2f7hPhQtQJSyYSDNQ3Sgk,1267
9
- moons_motor-0.0.8.dist-info/WHEEL,sha256=UvcQYKBHoFqaQd6LKyqHw9fxEolWLQnlzP0h_LgJAfI,91
10
- moons_motor-0.0.8.dist-info/top_level.txt,sha256=0dE-CR5_NYBw34jHIDGQNWpMllzO6mtUIuKyRv_rJLg,12
11
- moons_motor-0.0.8.dist-info/RECORD,,
7
+ moons_motor-0.0.9.dist-info/LICENSE,sha256=nsYjO800SjIjI85y2kVHR5mC3tca2vs4kK_BhNe89bM,1074
8
+ moons_motor-0.0.9.dist-info/METADATA,sha256=Y1-ZVPTG9hPVDJqpQGv8pnTXBAZ0M9Ix0wenTL2vnrE,1281
9
+ moons_motor-0.0.9.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
10
+ moons_motor-0.0.9.dist-info/top_level.txt,sha256=0dE-CR5_NYBw34jHIDGQNWpMllzO6mtUIuKyRv_rJLg,12
11
+ moons_motor-0.0.9.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (74.0.0)
2
+ Generator: setuptools (75.2.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5