Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Spencer Du
control software
Commits
d68ff943
Commit
d68ff943
authored
Oct 21, 2019
by
Spencer Du
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
98b4c49e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
15 additions
and
17 deletions
+15
-17
GUI.py
GUI.py
+2
-2
__pycache__/laser2.cpython-37.pyc
__pycache__/laser2.cpython-37.pyc
+0
-0
__pycache__/laserEmbedded.cpython-37.pyc
__pycache__/laserEmbedded.cpython-37.pyc
+0
-0
__pycache__/mqtt2.cpython-37.pyc
__pycache__/mqtt2.cpython-37.pyc
+0
-0
laser2.py
laser2.py
+12
-12
laserEmbedded.py
laserEmbedded.py
+0
-2
mqtt2.py
mqtt2.py
+1
-1
No files found.
GUI.py
View file @
d68ff943
...
...
@@ -65,7 +65,7 @@ class MainWindow(QtWidgets.QMainWindow):
client
.
run
()
client
.
loop_start
()
print
(
"Connected to broker"
)
print
(
"
\n
"
+
"Connected to broker"
)
time
.
sleep
(
1
)
print
(
"Subscribing to topic"
,
"microscope/light_sheet_microscope/UI/add device"
)
client
.
subscribe
(
"microscope/light_sheet_microscope/UI/add device"
)
...
...
@@ -82,7 +82,7 @@ class MainWindow(QtWidgets.QMainWindow):
client
.
run
()
client
.
loop_start
()
print
(
"Connected to broker"
)
print
(
"
\n
"
+
"Connected to broker"
)
time
.
sleep
(
1
)
print
(
"Subscribing to topic"
,
"microscope/light_sheet_microscope/UI/laser"
)
client
.
subscribe
(
"microscope/light_sheet_microscope/UI/laser"
)
...
...
__pycache__/laser2.cpython-37.pyc
View file @
d68ff943
No preview for this file type
__pycache__/laserEmbedded.cpython-37.pyc
View file @
d68ff943
No preview for this file type
__pycache__/mqtt2.cpython-37.pyc
View file @
d68ff943
No preview for this file type
laser2.py
View file @
d68ff943
...
...
@@ -330,7 +330,7 @@ class Ui_Laser(object):
client
=
device
()
client
.
run
()
client
.
loop_start
()
print
(
"Connected to broker"
)
print
(
"
\n
"
+
"Connected to broker"
)
time
.
sleep
(
1
)
print
(
"Subscribing to topic"
,
"microscope/light_sheet_microscope/UI/laser/445nm"
)
client
.
subscribe
(
"microscope/light_sheet_microscope/UI/laser/445nm"
)
...
...
@@ -360,7 +360,7 @@ class Ui_Laser(object):
client
.
run
()
client
.
loop_start
()
print
(
"Connected to broker"
)
print
(
"
\n
"
+
"Connected to broker"
)
time
.
sleep
(
1
)
print
(
"Subscribing to topic"
,
"microscope/light_sheet_microscope/UI/laser/445nm"
)
client
.
subscribe
(
"microscope/light_sheet_microscope/UI/laser/445nm"
)
...
...
@@ -392,7 +392,7 @@ class Ui_Laser(object):
client
.
run
()
client
.
loop_start
()
print
(
"Connected to broker"
)
print
(
"
\n
"
+
"Connected to broker"
)
time
.
sleep
(
1
)
print
(
"Subscribing to topic"
,
"microscope/light_sheet_microscope/UI/laser/488nm"
)
client
.
subscribe
(
"microscope/light_sheet_microscope/UI/laser/488nm"
)
...
...
@@ -422,7 +422,7 @@ class Ui_Laser(object):
client
.
run
()
client
.
loop_start
()
print
(
"Connected to broker"
)
print
(
"
\n
"
+
"Connected to broker"
)
time
.
sleep
(
1
)
print
(
"Subscribing to topic"
,
"microscope/light_sheet_microscope/UI/laser/488nm"
)
client
.
subscribe
(
"microscope/light_sheet_microscope/UI/laser/488nm"
)
...
...
@@ -455,7 +455,7 @@ class Ui_Laser(object):
client
.
run
()
client
.
loop_start
()
print
(
"Connected to broker"
)
print
(
"
\n
"
+
"Connected to broker"
)
time
.
sleep
(
1
)
print
(
"Subscribing to topic"
,
"microscope/light_sheet_microscope/UI/laser/515nm"
)
client
.
subscribe
(
"microscope/light_sheet_microscope/UI/laser/515nm"
)
...
...
@@ -485,7 +485,7 @@ class Ui_Laser(object):
client
.
run
()
client
.
loop_start
()
print
(
"Connected to broker"
)
print
(
"
\n
"
+
"Connected to broker"
)
time
.
sleep
(
1
)
print
(
"Subscribing to topic"
,
"microscope/light_sheet_microscope/UI/laser/515nm"
)
client
.
subscribe
(
"microscope/light_sheet_microscope/UI/laser/515nm"
)
...
...
@@ -517,7 +517,7 @@ class Ui_Laser(object):
client
.
run
()
client
.
loop_start
()
print
(
"Connected to broker"
)
print
(
"
\n
"
+
"Connected to broker"
)
time
.
sleep
(
1
)
print
(
"Subscribing to topic"
,
"microscope/light_sheet_microscope/UI/laser/561nm"
)
client
.
subscribe
(
"microscope/light_sheet_microscope/UI/laser/561nm"
)
...
...
@@ -547,7 +547,7 @@ class Ui_Laser(object):
client
.
run
()
client
.
loop_start
()
print
(
"Connected to broker"
)
print
(
"
\n
"
+
"Connected to broker"
)
time
.
sleep
(
1
)
print
(
"Subscribing to topic"
,
"microscope/light_sheet_microscope/UI/laser/561nm"
)
client
.
subscribe
(
"microscope/light_sheet_microscope/UI/laser/561nm"
)
...
...
@@ -579,7 +579,7 @@ class Ui_Laser(object):
client
.
run
()
client
.
loop_start
()
print
(
"Connected to broker"
)
print
(
"
\n
"
+
"Connected to broker"
)
time
.
sleep
(
1
)
print
(
"Subscribing to topic"
,
"microscope/light_sheet_microscope/UI/laser/594nm"
)
client
.
subscribe
(
"microscope/light_sheet_microscope/UI/laser/594nm"
)
...
...
@@ -609,7 +609,7 @@ class Ui_Laser(object):
client
.
run
()
client
.
loop_start
()
print
(
"Connected to broker"
)
print
(
"
\n
"
+
"Connected to broker"
)
time
.
sleep
(
1
)
print
(
"Subscribing to topic"
,
"microscope/light_sheet_microscope/UI/laser/594nm"
)
client
.
subscribe
(
"microscope/light_sheet_microscope/UI/laser/594nm"
)
...
...
@@ -641,7 +641,7 @@ class Ui_Laser(object):
client
.
run
()
client
.
loop_start
()
print
(
"Connected to broker"
)
print
(
"
\n
"
+
"Connected to broker"
)
time
.
sleep
(
1
)
print
(
"Subscribing to topic"
,
"microscope/light_sheet_microscope/UI/laser/638nm"
)
client
.
subscribe
(
"microscope/light_sheet_microscope/UI/laser/638nm"
)
...
...
@@ -671,7 +671,7 @@ class Ui_Laser(object):
client
.
run
()
client
.
loop_start
()
print
(
"Connected to broker"
)
print
(
"
\n
"
+
"Connected to broker"
)
time
.
sleep
(
1
)
print
(
"Subscribing to topic"
,
"microscope/light_sheet_microscope/UI/laser/638nm"
)
client
.
subscribe
(
"microscope/light_sheet_microscope/UI/laser/638nm"
)
...
...
laserEmbedded.py
View file @
d68ff943
import
random
import
asyncio
from
actorio
import
Actor
,
Message
,
DataMessage
,
ask
,
EndMainLoop
,
Reference
import
configparser
as
configparser
import
os
from
mqtt2
import
*
class
Laser
(
Actor
):
...
...
mqtt2.py
View file @
d68ff943
...
...
@@ -8,7 +8,7 @@ class embedded(mqtt.Client):
def
on_message
(
self
,
mqtt
,
userdata
,
message
):
m_decode
=
str
(
message
.
payload
.
decode
(
"utf-8"
))
print
(
"message recieved= "
+
m_decode
)
print
(
"
\n
"
+
"message recieved= "
+
m_decode
)
# print("File which you want to import(with .py extension)")
print
(
"message topic="
,
message
.
topic
)
print
(
"message qos="
,
message
.
qos
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment