Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
total_control_app
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Martin Drechsler
total_control_app
Commits
5a2ae12c
Commit
5a2ae12c
authored
May 17, 2019
by
Martin Drechsler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
checkboxes and scan spinboxes now saved and loaded
parent
ec809ed4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
14 deletions
+44
-14
MCDAQcontrolsignals.py
MCDAQcontrolsignals.py
+9
-4
main.py
main.py
+6
-6
myToolbar.py
resources/myToolbar.py
+29
-4
No files found.
MCDAQcontrolsignals.py
View file @
5a2ae12c
...
...
@@ -116,6 +116,7 @@ class digital_control_signal(QtCore.QObject):
self
.
ch
=
channel
self
.
initial_value
=
0
self
.
DO
=
daq_DO
(
self
.
ch
)
self
.
inverse
=
inverse
def
make_connections
(
self
,
frontend
):
...
...
@@ -126,8 +127,12 @@ class digital_control_signal(QtCore.QObject):
@
QtCore
.
pyqtSlot
(
int
)
def
when_change_digital
(
self
,
state
):
if
state
==
QtCore
.
Qt
.
Checked
:
self
.
DO
.
set_out
(
True
)
if
self
.
inverse
:
self
.
DO
.
set_out
(
True
)
else
:
self
.
DO
.
set_out
(
False
)
else
:
self
.
DO
.
set_out
(
False
)
\ No newline at end of file
if
self
.
inverse
:
self
.
DO
.
set_out
(
False
)
else
:
self
.
DO
.
set_out
(
True
)
\ No newline at end of file
main.py
View file @
5a2ae12c
from
PyQt5
import
QtGui
,
QtCore
from
drivers.andorzyla
import
AndorZyla
#
from drivers.dummyAndor import AndorZyla
#
from drivers.andorzyla import AndorZyla
from
drivers.dummyAndor
import
AndorZyla
from
cameraGui
import
CameraGuiMainWindow
from
zylaCameraWorker
import
CameraWorker
...
...
@@ -33,10 +33,10 @@ if __name__ == "__main__":
trapExYb
=
anal_control_signal
(
'compExYb'
,
channel
=
6
,
ao_type
=
'electrode'
)
shutter866
=
digital_control_signal
(
'shutter866'
,
channel
=
2
,
inverse
=
Tru
e
)
shutter397
=
digital_control_signal
(
'shutter397'
,
channel
=
0
,
inverse
=
Tru
e
)
shutter423
=
digital_control_signal
(
'shutter423'
,
channel
=
1
,
inverse
=
Tru
e
)
shutter866WM
=
digital_control_signal
(
'shutter866WM'
,
channel
=
3
,
inverse
=
Tru
e
)
shutter866
=
digital_control_signal
(
'shutter866'
,
channel
=
2
,
inverse
=
Fals
e
)
shutter397
=
digital_control_signal
(
'shutter397'
,
channel
=
0
,
inverse
=
Fals
e
)
shutter423
=
digital_control_signal
(
'shutter423'
,
channel
=
1
,
inverse
=
Fals
e
)
shutter866WM
=
digital_control_signal
(
'shutter866WM'
,
channel
=
3
,
inverse
=
Fals
e
)
controlGui
=
ControlGui
()
mcDAQthread
=
QtCore
.
QThread
()
...
...
resources/myToolbar.py
View file @
5a2ae12c
...
...
@@ -7,10 +7,9 @@ Created on Thu Jul 5 12:17:30 2018
from
PyQt5.QtCore
import
QSettings
from
PyQt5
import
QtGui
from
PyQt5.QtWidgets
import
QAction
,
QFileDialog
,
QInputDialog
,
QWidget
from
PyQt5.QtWidgets
import
QAction
,
QFileDialog
,
QWidget
from
threading
import
Thread
from
subclasses.controllayouts
import
LaserControlLayout
from
subclasses.controllayouts
import
LaserControlLayout
,
LaserScanLayout
#%%
class
myToolbarMenu
(
QWidget
):
...
...
@@ -23,14 +22,29 @@ class myToolbarMenu(QWidget):
self
.
MainGuiWindow
=
win
self
.
sbsDicc
=
dict
()
self
.
cbsDicc
=
dict
()
self
.
incorporate_toolbar
(
self
.
MainGuiWindow
)
self
.
fillSpinBoxesDict
()
self
.
fillCheckBoxesDict
()
def
fillSpinBoxesDict
(
self
):
for
l
in
LaserControlLayout
.
_registry
:
for
sb_name
in
l
.
spinboxes
:
self
.
sbsDicc
[
sb_name
]
=
l
.
spinboxes
[
sb_name
]
for
l
in
LaserScanLayout
.
_registry
:
for
sb_name
in
l
.
spinboxes
:
self
.
sbsDicc
[
'_'
.
join
([
l
.
name
,
sb_name
])]
=
l
.
spinboxes
[
sb_name
]
def
fillCheckBoxesDict
(
self
):
for
l
in
LaserControlLayout
.
_registry
:
for
cb_name
in
l
.
checkboxes
:
self
.
cbsDicc
[
cb_name
]
=
l
.
checkboxes
[
cb_name
]
def
createElectrodesDict
(
self
):
d
=
dict
()
...
...
@@ -83,6 +97,9 @@ class myToolbarMenu(QWidget):
for
text
,
spinb
in
self
.
sbsDicc
.
items
():
settings
.
setValue
(
text
,
spinb
.
value
())
for
text
,
checkb
in
self
.
cbsDicc
.
items
():
settings
.
setValue
(
text
,
checkb
.
isChecked
())
settings
.
endGroup
()
...
...
@@ -98,6 +115,14 @@ class myToolbarMenu(QWidget):
spinb
.
setValue
(
float
(
spinbox_saved_value
)
)
except
TypeError
:
spinb
.
setValue
(
float
(
spinb
.
value
())
)
for
text
,
checkb
in
self
.
cbsDicc
.
items
():
checkbox_saved_value
=
settings
.
value
(
text
)
if
checkbox_saved_value
in
[
'true'
,
'True'
,
True
]:
checkb
.
setChecked
(
True
)
else
:
checkb
.
setChecked
(
False
)
settings
.
endGroup
()
def
save_as
(
self
,
window
):
...
...
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