moons-motor 0.0.7__py3-none-any.whl → 0.0.8__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- moons_motor/motor.py +11 -0
- moons_motor/simulate.py +4 -1
- {moons_motor-0.0.7.dist-info → moons_motor-0.0.8.dist-info}/METADATA +1 -1
- moons_motor-0.0.8.dist-info/RECORD +11 -0
- {moons_motor-0.0.7.dist-info → moons_motor-0.0.8.dist-info}/WHEEL +1 -1
- moons_motor-0.0.7.dist-info/RECORD +0 -11
- {moons_motor-0.0.7.dist-info → moons_motor-0.0.8.dist-info}/LICENSE +0 -0
- {moons_motor-0.0.7.dist-info → moons_motor-0.0.8.dist-info}/top_level.txt +0 -0
moons_motor/motor.py
CHANGED
@@ -7,6 +7,7 @@ from rich.console import Console
|
|
7
7
|
from rich.panel import Panel
|
8
8
|
import queue
|
9
9
|
from moons_motor.subject import Subject
|
10
|
+
import time
|
10
11
|
|
11
12
|
|
12
13
|
class StepperModules:
|
@@ -199,6 +200,7 @@ class MoonsStepper(Subject):
|
|
199
200
|
else:
|
200
201
|
self.usedSendQueue.put(self.temp_cmd)
|
201
202
|
if self.ser is not None or not self.only_simulate:
|
203
|
+
self.temp_cmd += "\r"
|
202
204
|
self.ser.write(self.temp_cmd.encode("ascii"))
|
203
205
|
if self.is_log_message:
|
204
206
|
print(
|
@@ -225,7 +227,9 @@ class MoonsStepper(Subject):
|
|
225
227
|
|
226
228
|
def start_jog(self, motor_address="", speed=0.15, direction="CW"):
|
227
229
|
self.send(self.addressed_cmd(motor_address, "JS{}".format(speed)))
|
230
|
+
time.sleep(0.01)
|
228
231
|
self.send(self.addressed_cmd(motor_address, "CJ"))
|
232
|
+
# self.send(self.addressed_cmd(motor_address, "CS{}".format(speed)))
|
229
233
|
|
230
234
|
def change_jog_speed(self, motor_address="", speed=0.15):
|
231
235
|
self.send(self.addressed_cmd(motor_address, "CS{}".format(speed)))
|
@@ -253,11 +257,18 @@ class MoonsStepper(Subject):
|
|
253
257
|
|
254
258
|
def calibrate(self, motor_address="", speed=0.3, onStart=None, onComplete=None):
|
255
259
|
self.send(self.addressed_cmd(motor_address, "VE{}".format(speed)))
|
260
|
+
# time.sleep(0.01)
|
256
261
|
self.send(self.addressed_cmd(motor_address, "DI10"))
|
262
|
+
# time.sleep(0.01)
|
257
263
|
self.send(self.addressed_cmd(motor_address, "SH3F"))
|
264
|
+
# time.sleep(0.01)
|
258
265
|
self.send(self.addressed_cmd(motor_address, "EP0"))
|
266
|
+
# time.sleep(0.01)
|
259
267
|
self.send(self.addressed_cmd(motor_address, "SP0"))
|
260
268
|
|
269
|
+
def alarm_reset(self, motor_address=""):
|
270
|
+
self.send(self.addressed_cmd(motor_address, "AR"))
|
271
|
+
|
261
272
|
# speed slow= 0.25, medium=1, fast=5
|
262
273
|
def set_transmit_delay(self, motor_address="", delay=15):
|
263
274
|
self.send(self.addressed_cmd(motor_address, "TD{}".format(delay)))
|
moons_motor/simulate.py
CHANGED
@@ -10,15 +10,18 @@ class MoonsStepperSimulate(Observer):
|
|
10
10
|
moons_motor: MoonsStepper,
|
11
11
|
universe: int = 0,
|
12
12
|
server_address: str = "http://localhost:3001",
|
13
|
+
log_message: bool = True,
|
13
14
|
):
|
14
15
|
self.server_address = server_address
|
15
16
|
self.universe = universe
|
16
17
|
self.moons_motor = moons_motor
|
17
18
|
self.io = socketio.SimpleClient()
|
18
19
|
self.connected = False
|
19
|
-
self.
|
20
|
+
self.log_message = True
|
20
21
|
|
21
22
|
def update(self, event):
|
23
|
+
if self.log_message == False:
|
24
|
+
return
|
22
25
|
print(f"Simulate send: {event}")
|
23
26
|
self.emit("motor", event)
|
24
27
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: moons_motor
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.8
|
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
|
@@ -0,0 +1,11 @@
|
|
1
|
+
moons_motor/__init__.py,sha256=qOpsRwizV-DpKSvNzyvj8ju3cs6vwgIICur1Oe6sxOA,27
|
2
|
+
moons_motor/motor.py,sha256=KM2DIHB3RRx21pMPp7q6q1XNFDfSoiNV8Lk0jaqYyD4,13221
|
3
|
+
moons_motor/observer.py,sha256=PXzuPYKRb2HpjArJcD8HakYIPfFGAs1uBDIL8PSizgA,124
|
4
|
+
moons_motor/simulate.py,sha256=J0y1fZhoOim9i-BAkprxnPern1SAdkDfKPqT2MWyDwU,2561
|
5
|
+
moons_motor/status.py,sha256=jXQZFZTt9ugHktkWKLII8MpEQQaeO-UjlwTrrP4LJNE,2872
|
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,,
|
@@ -1,11 +0,0 @@
|
|
1
|
-
moons_motor/__init__.py,sha256=qOpsRwizV-DpKSvNzyvj8ju3cs6vwgIICur1Oe6sxOA,27
|
2
|
-
moons_motor/motor.py,sha256=uUEl_IUPG-9OjAjW8bRWtuYt-06XU77wIYRsw3nG5MM,12845
|
3
|
-
moons_motor/observer.py,sha256=PXzuPYKRb2HpjArJcD8HakYIPfFGAs1uBDIL8PSizgA,124
|
4
|
-
moons_motor/simulate.py,sha256=9CwL7fHpLdr1z6nDPJMvB8XgBRFFeSyy60CoTIsUETo,2470
|
5
|
-
moons_motor/status.py,sha256=jXQZFZTt9ugHktkWKLII8MpEQQaeO-UjlwTrrP4LJNE,2872
|
6
|
-
moons_motor/subject.py,sha256=L_GS6fvJTeX7X23o3T92oiZ4rtLVKA2OEd9GpHn_Dz4,445
|
7
|
-
moons_motor-0.0.7.dist-info/LICENSE,sha256=nsYjO800SjIjI85y2kVHR5mC3tca2vs4kK_BhNe89bM,1074
|
8
|
-
moons_motor-0.0.7.dist-info/METADATA,sha256=S7rAvlY3eVETaNyCSuivnLKEEA_Hk0RvTaidZEREOKI,1267
|
9
|
-
moons_motor-0.0.7.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
10
|
-
moons_motor-0.0.7.dist-info/top_level.txt,sha256=0dE-CR5_NYBw34jHIDGQNWpMllzO6mtUIuKyRv_rJLg,12
|
11
|
-
moons_motor-0.0.7.dist-info/RECORD,,
|
File without changes
|
File without changes
|