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
149c417c
Commit
149c417c
authored
Feb 07, 2019
by
Martin Drechsler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added the coherent wavemeter dock
parent
265ebad7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
160 additions
and
17 deletions
+160
-17
myGUI.py
myGUI.py
+23
-13
myWidgets.py
myWidgets.py
+75
-4
digital.cpython-36.pyc
props/__pycache__/digital.cpython-36.pyc
+0
-0
propsbase.cpython-36.pyc
props/__pycache__/propsbase.cpython-36.pyc
+0
-0
wav_coherent.py
wav_coherent.py
+62
-0
No files found.
myGUI.py
View file @
149c417c
...
...
@@ -10,7 +10,7 @@ import sys
from
pyqtgraph.Qt
import
QtGui
from
myWidgets
import
anal_control_signal
,
digital_control_signal
,
activation_button
,
burleighWM
from
myWidgets
import
anal_control_signal
,
digital_control_signal
,
activation_button
,
burleighWM
,
coherentWM
from
PyQt5.QtWidgets
import
QMainWindow
from
pyqtgraph
import
dockarea
import
pyqtgraph
as
pg
...
...
@@ -49,6 +49,8 @@ class GuiMainWindow(QMainWindow):
self
.
layoutPI
=
pg
.
LayoutWidget
()
self
.
layoutIMG
=
pg
.
LayoutWidget
()
self
.
layoutWM
=
pg
.
LayoutWidget
()
self
.
layoutWM_coherent
=
pg
.
LayoutWidget
()
self
.
layout397_scan
=
pg
.
LayoutWidget
()
self
.
layout866_scan
=
pg
.
LayoutWidget
()
self
.
layout423_scan
=
pg
.
LayoutWidget
()
...
...
@@ -62,6 +64,8 @@ class GuiMainWindow(QMainWindow):
self
.
d866
=
dockarea
.
Dock
(
"Dock866"
,
size
=
(
self
.
s1
,
self
.
s2
))
self
.
dPI
=
dockarea
.
Dock
(
"DockPI"
,
size
=
(
self
.
s1
,
self
.
s2
))
self
.
dWM
=
dockarea
.
Dock
(
"DockWM"
,
size
=
(
self
.
s1
,
self
.
s2
))
self
.
dWM_coherent
=
dockarea
.
Dock
(
"DockWM_coherent"
,
size
=
(
self
.
s1
,
self
.
s2
))
self
.
d397_scan
=
dockarea
.
Dock
(
"Dock 397 scan"
,
size
=
(
self
.
s1
,
self
.
s2
))
self
.
d866_scan
=
dockarea
.
Dock
(
"Dock 866 scan"
,
size
=
(
self
.
s1
,
self
.
s2
))
self
.
d423_scan
=
dockarea
.
Dock
(
"Dock 423 scan"
,
size
=
(
self
.
s1
,
self
.
s2
))
...
...
@@ -70,28 +74,34 @@ class GuiMainWindow(QMainWindow):
self
.
dactivate
.
hideTitleBar
()
# Here I add the docks
#
self.area.addDock( self.dtrap_electrodes)
#
self.area.addDock(self.d397, 'bottom', self.dtrap_electrodes)
#
self.area.addDock(self.d866, 'bottom', self.d397)
self
.
area
.
addDock
(
self
.
dtrap_electrodes
)
self
.
area
.
addDock
(
self
.
d397
,
'bottom'
,
self
.
dtrap_electrodes
)
self
.
area
.
addDock
(
self
.
d866
,
'bottom'
,
self
.
d397
)
self
.
area
.
addDock
(
self
.
dWM
)
self
.
area
.
addDock
(
self
.
dWM_coherent
)
self
.
area
.
addDock
(
self
.
dPI
,
'bottom'
,
self
.
dWM
)
#
self.area.addDock(self.d397_scan, 'right', self.d397)
self
.
area
.
addDock
(
self
.
d397_scan
,
'right'
,
self
.
d397
)
self
.
area
.
addDock
(
self
.
d423_scan
,
'right'
,
self
.
dPI
)
#
self.area.addDock(self.d866_scan, 'right', self.d866)
self
.
area
.
addDock
(
self
.
d866_scan
,
'right'
,
self
.
d866
)
#self.area.addDock(self.dactivate, 'right', self.dtrap_electrodes)
#self.area.moveDock(self.dWM, 'above', self.dtrap_electrodes)
self
.
area
.
moveDock
(
self
.
dWM
,
'above'
,
self
.
dtrap_electrodes
)
self
.
area
.
moveDock
(
self
.
dWM_coherent
,
'above'
,
self
.
dWM
)
self
.
area
.
moveDock
(
self
.
dPI
,
'above'
,
self
.
d423_scan
)
# Here I add the layouts to the corresponding dock
#
self.d397.addWidget(self.layout397)
#
self.d866.addWidget(self.layout866)
self
.
d397
.
addWidget
(
self
.
layout397
)
self
.
d866
.
addWidget
(
self
.
layout866
)
self
.
dPI
.
addWidget
(
self
.
layoutPI
)
self
.
dWM
.
addWidget
(
self
.
layoutWM
)
#self.d397_scan.addWidget(self.layout397_scan)
#self.d866_scan.addWidget(self.layout866_scan)
self
.
dWM_coherent
.
addWidget
(
self
.
layoutWM_coherent
)
self
.
d397_scan
.
addWidget
(
self
.
layout397_scan
)
self
.
d866_scan
.
addWidget
(
self
.
layout866_scan
)
self
.
d423_scan
.
addWidget
(
self
.
layout423_scan
)
#
self.dtrap_electrodes.addWidget(self.layout_trap_electrodes)
self
.
dtrap_electrodes
.
addWidget
(
self
.
layout_trap_electrodes
)
#self.dactivate.addWidget(self.layout_activate)
...
...
@@ -208,7 +218,7 @@ class GuiMainWindow(QMainWindow):
# read wavemeter
self
.
wavemeter
=
burleighWM
(
self
.
layoutWM
,
self
.
dWM
)
self
.
wm_coherent
=
coherentWM
(
self
.
layoutWM_coherent
,
self
.
dWM_coherent
)
###############################################################################
...
...
myWidgets.py
View file @
149c417c
...
...
@@ -9,12 +9,13 @@ import pyqtgraph as pg
from
ADoutputs
import
daq_AO
,
daq_DO
from
pyqtgraph.Qt
import
QtGui
,
QtCore
from
PyQt5.QtCore
import
QTimer
from
PyQt5.QtWidgets
import
(
QPushButton
,
QWidget
,
QVBoxLayout
,
QLCDNumber
,
QProgressBar
,
QLabel
,
QCheckBox
)
from
PyQt5.QtWidgets
import
(
QPushButton
,
QWidget
,
QVBoxLayout
,
QLCDNumber
,
QProgressBar
,
QLabel
,
QCheckBox
,
QComboBox
)
import
telnetlib
import
os
import
os
,
serial
from
messages
import
show_warning
import
scanFunctions
import
wav_coherent
#An example of a class
class
anal_control_signal
(
QWidget
):
...
...
@@ -260,8 +261,78 @@ class burleighWM(QWidget):
self
.
layoutWM
.
addWidget
(
lcd
)
self
.
dockWM
.
addWidget
(
self
.
layoutWM
)
class
coherentWM
(
QWidget
):
def
__init__
(
self
,
layout
,
dock
):
super
()
.
__init__
()
self
.
dockWM
=
dock
self
.
layoutWM
=
layout
wavemeter_ok
=
False
try
:
wavCoh
=
serial
.
Serial
(
'COM11'
,
timeout
=
1
,
rtscts
=
True
)
wavCoh
.
close
()
wavemeter_ok
=
True
except
:
show_warning
(
'Coherent wavemeter not connected'
)
if
wavemeter_ok
:
lcd
=
QLCDNumber
()
lcd
.
setDigitCount
(
10
)
lcd
.
display
(
"00000000 0"
)
wav_coherent
.
set_unit
(
wavCoh
,
b
'F'
)
def
update_label
():
value
=
wav_coherent
.
read_measurement
(
wavCoh
)
unit
=
wav_coherent
.
check_unit
(
wavCoh
)
try
:
lcd
.
display
(
value
+
' '
+
unit
)
except
:
lcd
.
display
(
"error000 0"
)
self
.
layoutWM
.
timer
=
QTimer
()
self
.
layoutWM
.
timer
.
timeout
.
connect
(
update_label
)
self
.
layoutWM
.
timer
.
start
(
500
)
# every 10,000 milliseconds
self
.
layoutWM
.
setGeometry
(
300
,
300
,
250
,
150
)
combo
=
QComboBox
()
combo
.
addItem
(
"Frequency"
)
combo
.
addItem
(
"Wavelength Vac"
)
combo
.
addItem
(
"Wavelength Air"
)
def
comboActivated
(
text
):
if
text
==
"Frequency"
:
unit
=
b
'F'
if
text
==
"Wavelength Vac"
:
unit
=
b
'V'
if
text
==
"Wavelength Air"
:
unit
=
b
'A'
with
wavCoh
as
w
:
wav_coherent
.
set_unit
(
w
,
unit
)
combo
.
activated
[
str
]
.
connect
(
comboActivated
)
self
.
layoutWM
.
addWidget
(
lcd
,
0
,
0
)
self
.
layoutWM
.
addWidget
(
combo
,
1
,
0
)
self
.
dockWM
.
addWidget
(
self
.
layoutWM
)
\ No newline at end of file
props/__pycache__/digital.cpython-36.pyc
deleted
100644 → 0
View file @
265ebad7
File deleted
props/__pycache__/propsbase.cpython-36.pyc
deleted
100644 → 0
View file @
265ebad7
File deleted
wav_coherent.py
0 → 100644
View file @
149c417c
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 6 13:07:39 2019
@author: Usuario
"""
#import serial
#import time
#
#wavCoh=serial.Serial('COM10', timeout=1, rtscts=True)
#wavCoh.close()
#%%
def
read_measurement
(
wm
):
with
wm
as
w
:
w
.
write
(
b
'VAL?
\n
'
)
#time.sleep(0.2)
a
=
w
.
readline
()
.
decode
(
"utf-8"
)
return
a
[
12
:
20
]
def
set_unit
(
wm
,
unit
):
"""
unit can be:
A: wl in air
V: wl in vacuum
F: frequency
W: wavenumber
"""
with
wm
as
w
:
string_to_write
=
b
'UNI '
+
unit
+
b
'
\n
'
w
.
write
(
string_to_write
)
def
check_unit
(
wm
):
with
wm
as
w
:
w
.
write
(
b
'UNI?
\n
'
)
#time.sleep(0.2)
unit
=
w
.
readline
()
.
decode
(
"utf-8"
)
if
unit
[
5
:
6
]
==
'V'
:
return
'U'
return
unit
[
5
:
6
]
#%%
if
__name__
==
'__main__'
:
import
serial
import
time
wavCoh
=
serial
.
Serial
(
'COM11'
,
timeout
=
1
,
rtscts
=
True
)
wavCoh
.
close
()
set_unit
(
wavCoh
,
b
'V'
)
print
(
read_measurement
(
wavCoh
))
read_measurement
(
wavCoh
)
print
(
a
[
12
:
20
])
check_unit
(
wavCoh
)
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