Skip to content

Commit a7a5cb2

Browse files
authored
Merge pull request #107 from openUC2/mergemaster
Mergemaster
2 parents 8fee524 + 605940b commit a7a5cb2

4 files changed

Lines changed: 6 additions & 292 deletions

File tree

uc2rest/UC2Client.py

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from .mserial import Serial
99
from .mserial import SerialManagerWrapper
1010
from .galvo import Galvo
11-
from .config import config
1211
from .ledmatrix import LedMatrix
1312
from .motor import Motor
1413
from .gripper import Gripper
@@ -39,11 +38,11 @@ class UC2Client(object):
3938

4039
is_wifi = False
4140
is_serial = False
41+
BAUDRATE = 115200
4242

43-
# BAUDRATE = 500000
44-
BAUDRATE = 500000
45-
46-
def __init__(self, host=None, port=31950, serialport=None, identity="UC2_Feather", baudrate=BAUDRATE, NLeds=64, SerialManager=None, DEBUG=False, logger=None, skipFirmwareCheck=False):
43+
def __init__(self, host=None, port=31950, serialport=None, identity="UC2_Feather", baudrate=BAUDRATE,
44+
NLeds=64, SerialManager=None, DEBUG=False, logger=None, skipFirmwareCheck=False,
45+
isPyScript=False):
4746
'''
4847
This client connects to the UC2-REST microcontroller that can be found here
4948
https://github.com/openUC2/UC2-REST
@@ -61,7 +60,7 @@ def __init__(self, host=None, port=31950, serialport=None, identity="UC2_Feather
6160
self.logger = logger
6261

6362
# perhaps we are in the browser?
64-
self.isPyScript = False
63+
self.isPyScript = isPyScript
6564

6665
# initialize communication channel (# connect to wifi or usb)
6766
if serialport is not None:
@@ -89,18 +88,9 @@ def __init__(self, host=None, port=31950, serialport=None, identity="UC2_Feather
8988

9089
# import libraries depending on API version
9190
self.logger.debug("Using API version 2")
92-
93-
#FIXME
94-
#self.set_state(debug=False)
95-
91+
9692
# initialize state
9793
self.state = State(self)
98-
if not self.isPyScript:
99-
state = self.state.get_state()
100-
101-
# initialize config
102-
if not self.isPyScript:
103-
self.config = config(self)
10494

10595
# initialize cmdRecorder
10696
self.cmdRecorder = cmdRecorder(self)
@@ -149,13 +139,6 @@ def __init__(self, host=None, port=31950, serialport=None, identity="UC2_Feather
149139

150140
# initialize messaging
151141
self.message = Message(self)
152-
153-
# initialize config
154-
if False: # not self.isPyScript:
155-
self.config = config(self)
156-
try: self.pinConfig = self.config.loadConfigDevice()
157-
except: self.pinConfig = None
158-
159142

160143
# initialize module controller
161144
self.modules = Modules(parent=self)

uc2rest/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
from .config import *
21
from .UC2Client import *

uc2rest/config.py

Lines changed: 0 additions & 164 deletions
This file was deleted.

uc2rest/config_.py

Lines changed: 0 additions & 104 deletions
This file was deleted.

0 commit comments

Comments
 (0)