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
25631830
Commit
25631830
authored
Apr 20, 2019
by
Martin Drechsler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some indenation fixing
parent
8ba0a33b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
26 deletions
+25
-26
cameraGui.py
cameraGui.py
+25
-26
No files found.
cameraGui.py
View file @
25631830
...
...
@@ -19,8 +19,7 @@ import numpy as np
class
GuiMainWindow
(
QMainWindow
):
def
__init__
(
self
):
def
__init__
(
self
):
super
()
.
__init__
()
...
...
@@ -31,7 +30,7 @@ class GuiMainWindow(QMainWindow):
self
.
initUI
()
def
initUI
(
self
):
def
initUI
(
self
):
self
.
win
=
QtGui
.
QMainWindow
()
self
.
win
.
setWindowTitle
(
'Toy GUI'
)
...
...
@@ -91,24 +90,24 @@ class GuiMainWindow(QMainWindow):
def
make_connections
(
self
,
backend
):
##backend connections
backend
.
imageReadySignal
.
connect
(
self
.
updateImage
)
def
make_connections
(
self
,
backend
):
##backend connections
backend
.
imageReadySignal
.
connect
(
self
.
updateImage
)
##internal connections
self
.
frames_checker_timer
.
timeout
.
connect
(
self
.
frame_counter
)
self
.
cameraButton
.
clicked
.
connect
(
lambda
x
=
backend
.
isCameraAcquiring
:
self
.
camera_button_pressed
(
x
))
##internal connections
self
.
frames_checker_timer
.
timeout
.
connect
(
self
.
frame_counter
)
self
.
cameraButton
.
clicked
.
connect
(
lambda
x
=
backend
.
isCameraAcquiring
:
self
.
camera_button_pressed
(
x
))
def
camera_button_pressed
(
self
,
isCameraAcquiring
):
def
camera_button_pressed
(
self
,
isCameraAcquiring
):
if
isCameraAcquiring
:
self
.
frames_checker_timer
.
stop
()
else
:
self
.
frame_index
=
0
self
.
previous_frame_index
=
0
self
.
frames_checker_timer
.
start
(
1000
)
if
isCameraAcquiring
:
self
.
frames_checker_timer
.
stop
()
else
:
self
.
frame_index
=
0
self
.
previous_frame_index
=
0
self
.
frames_checker_timer
.
start
(
1000
)
def
_initialize_image
(
self
):
def
_initialize_image
(
self
):
## lock the aspect ratio so pixels are always square
self
.
view
.
setAspectLocked
(
True
)
self
.
view
.
addItem
(
self
.
img
)
...
...
@@ -117,7 +116,7 @@ class GuiMainWindow(QMainWindow):
self
.
previous_frame_index
=
0
self
.
frames_checker_timer
.
start
(
1000
)
def
updateRois
(
self
):
def
updateRois
(
self
):
for
roi
in
self
.
rois
:
...
...
@@ -129,8 +128,8 @@ class GuiMainWindow(QMainWindow):
self
.
curve
.
setData
(
self
.
ROIdata
)
@
QtCore
.
pyqtSlot
(
np
.
ndarray
,
int
)
def
updateImage
(
self
,
image
,
acq_index
):
@
QtCore
.
pyqtSlot
(
np
.
ndarray
,
int
)
def
updateImage
(
self
,
image
,
acq_index
):
if
self
.
frame_index
is
not
0
and
not
self
.
frame_index
==
acq_index
:
print
(
'Dephasing in camera gui has occured: while frame index is
%
i, the acq index is
%
i'
%
(
self
.
frame_index
,
acq_index
))
...
...
@@ -142,14 +141,14 @@ class GuiMainWindow(QMainWindow):
def
frame_counter
(
self
):
self
.
counter
=
self
.
counter
+
1
self
.
label
.
setText
(
'Frames in last second: '
+
str
(
self
.
frame_index
-
self
.
previous_frame_index
)
+
' '
+
'Seconds since start: '
+
str
(
self
.
counter
))
self
.
previous_frame_index
=
self
.
frame_index
def
frame_counter
(
self
):
self
.
counter
=
self
.
counter
+
1
self
.
label
.
setText
(
'Frames in last second: '
+
str
(
self
.
frame_index
-
self
.
previous_frame_index
)
+
' '
+
'Seconds since start: '
+
str
(
self
.
counter
))
self
.
previous_frame_index
=
self
.
frame_index
def
__del__
(
self
):
print
(
'chau gui'
)
def
__del__
(
self
):
print
(
'chau gui'
)
###############################################################################
...
...
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