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
01b1ca55
Commit
01b1ca55
authored
Jul 27, 2018
by
Martin Drechsler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial loading from config.ini file implemented.
parent
8861f4dc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
17 deletions
+35
-17
myGUI.py
myGUI.py
+15
-11
myToolbar.py
myToolbar.py
+16
-0
myWidgets.py
myWidgets.py
+4
-6
No files found.
myGUI.py
View file @
01b1ca55
...
...
@@ -16,18 +16,21 @@ from pyqtgraph import dockarea
import
pyqtgraph
as
pg
from
PyQt5.QtCore
import
QTimer
from
PyQt5.QtWidgets
import
QLCDNumber
import
myToolbar
###############################################################################
#This creates the window for the gui
app
=
QtGui
.
QApplication
([])
win
=
QtGui
.
QMainWindow
()
win
.
setWindowTitle
(
'My GUI'
)
win
.
setWindowIcon
(
QtGui
.
QIcon
(
'snuffles.png'
))
app_icon
=
QtGui
.
QIcon
()
app_icon
.
addFile
(
'snuffles.png'
)
app
.
setWindowIcon
(
app_icon
)
...
...
@@ -110,7 +113,14 @@ shutter866 = digital_control_signal('shutter866', 2)
shutter423
=
digital_control_signal
(
'shutter423'
,
1
)
shutterLED
=
digital_control_signal
(
'shutterLED'
,
3
)
#############Toolbar and initial loading of config ############################
myToolbar
.
first_load
(
anal_control_signal
.
_registry
)
myToolbar
.
incorporate_toolbar
(
win
,
anal_control_signal
.
_registry
)
###############################################################################
#activate button
actB
=
activation_button
()
layout_activate
.
addWidget
(
actB
.
button
)
###############################################################################
#Adding the controls:
...
...
@@ -179,16 +189,10 @@ try:
except
:
pass
###########################################################
###########################################################
####################
#read wavemeter
wavemeter
=
burleighWM
(
layoutWM
,
dWM
)
###############################################################################
myToolbar
.
incorporate_toolbar
(
win
,
anal_control_signal
.
_registry
)
###############################################################################
#activate button
actB
=
activation_button
()
layout_activate
.
addWidget
(
actB
.
button
)
###############################################################################
...
...
myToolbar.py
View file @
01b1ca55
...
...
@@ -33,6 +33,22 @@ def load(aos):
spinb
.
setValue
(
float
(
spin
)
)
settings
.
endGroup
()
def
first_load
(
aos
):
try
:
settings
=
QSettings
(
'C:
\\
Users
\\
Usuario
\\
Documents
\\
control_app
\\
config.ini'
,
QSettings
.
IniFormat
)
except
:
print
(
'Warning: no config.ini file in control_app folder. Pleace, be kindful and create one'
)
return
settings
.
beginGroup
(
'Ventana'
)
for
ao
in
aos
:
spin_boxes
=
ao
.
spin_boxes
for
text
,
spinb
in
spin_boxes
:
spin
=
settings
.
value
(
str
(
ao
.
name
)
+
'_'
+
text
)
spinb
.
setValue
(
float
(
spin
)
)
settings
.
endGroup
()
def
save_as
(
aos
,
window
):
name
=
QFileDialog
.
getSaveFileName
(
window
,
'Save File'
)
...
...
myWidgets.py
View file @
01b1ca55
...
...
@@ -26,6 +26,7 @@ class anal_control_signal(QWidget):
self
.
ch
=
channel
self
.
initial_value
=
0
self
.
max
=
out_maximum
self
.
min
=
out_minimum
self
.
step
=
out_step
...
...
@@ -62,14 +63,12 @@ class anal_control_signal(QWidget):
def
sb_analog_change
(
self
):
self
.
AO
.
set_out
(
self
.
sb
.
val
)
#self.AO.set_out(self.sb.val)
print
(
self
.
sb
.
val
)
def
set_name
(
self
,
name
):
self
.
name
=
name
def
set_initial_value
(
self
,
value
):
self
.
initial_value
=
value
def
set_siPrefix
(
self
,
value
):
...
...
@@ -79,7 +78,6 @@ class anal_control_signal(QWidget):
self
.
sufix
=
value
def
scanEvent
(
self
):
if
abs
(
abs
(
self
.
scan_step
)
-
abs
(
float
(
self
.
scan_sb_start
.
val
)))
<
1e-6
or
abs
(
abs
(
self
.
scan_step
)
-
abs
(
float
(
self
.
scan_sb_stop
.
val
)))
<
1e-6
:
self
.
scan_direction
=
(
-
1
)
*
self
.
scan_direction
...
...
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