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
ad864252
Commit
ad864252
authored
May 23, 2019
by
Martin Drechsler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some log test and backend
parent
5af0befe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
22 deletions
+28
-22
main.py
main.py
+17
-13
zylaCameraWorker.py
zylaCameraWorker.py
+11
-9
No files found.
main.py
View file @
ad864252
...
...
@@ -12,22 +12,26 @@ from controlGui import ControlGui
import
logging
from
logging.handlers
import
SocketHandler
from
lantz.core.log
import
DEBUG
,
log_to_socket
,
log_to_screen
if
__name__
==
"__main__"
:
log
=
logging
.
getLogger
(
'Main logger'
)
gui_log
=
log
.
getChild
(
"GUI logger"
)
worker_log
=
log
.
getChild
(
"Worker logger"
)
acq_log
=
log
.
getChild
(
"Acquisition logger"
)
log
.
setLevel
(
1
)
# to send all records to cutelog
socket_handler
=
SocketHandler
(
'127.0.0.1'
,
19996
)
# default listening address
log
.
addHandler
(
socket_handler
)
log
.
info
(
'Hello world!'
)
gui_log
.
info
(
'hello'
)
worker_log
.
info
(
'hello'
)
acq_log
.
info
(
'hello'
)
# log = logging.getLogger('Main logger')
# gui_log = log.getChild("GUI logger")
# worker_log = log.getChild("Worker logger")
# acq_log = log.getChild("Acquisition logger")
# log.setLevel(1) # to send all records to cutelog
# socket_handler = SocketHandler('127.0.0.1', 19996) # default listening address
# log.addHandler(socket_handler)
# log.info('Hello world!')
# gui_log.info('hello')
# worker_log.info('hello')
# acq_log.info('hello')
log_to_screen
(
DEBUG
)
import
sys
app
=
QtGui
.
QApplication
([])
...
...
zylaCameraWorker.py
View file @
ad864252
...
...
@@ -16,9 +16,9 @@ from MCDAQcontrolsignals import anal_control_signal
from
resources.messages
import
show_warning
from
resources.scanFunctions
import
create_measurement_array
,
yield_array
from
resources.storage
import
Storage
from
lantz.qt.app
import
Backend
class
CameraWorker
(
QtCore
.
QObject
):
class
CameraWorker
(
Backend
):
imageReadySignal
=
QtCore
.
pyqtSignal
(
np
.
ndarray
,
int
)
measurementStartingSignal
=
QtCore
.
pyqtSignal
()
measurementEndingSignal
=
QtCore
.
pyqtSignal
()
...
...
@@ -31,11 +31,13 @@ class CameraWorker(QtCore.QObject):
self
.
cam
.
SensorCooling
.
setValue
(
True
)
print
(
"camera worker initialized"
)
self
.
storage
=
Storage
()
self
.
storage
TxtTxt
=
Storage
()
self
.
ao_to_scan
=
None
self
.
scan_array_gen
=
None
self
.
_lock
=
threading
.
Lock
()
self
.
measure_params
=
dict
()
self
.
log_debug
(
'hola'
)
self
.
log_info
(
'hola'
)
def
make_connections
(
self
,
frontend
):
# frontend connections
...
...
@@ -140,9 +142,9 @@ class CameraWorker(QtCore.QObject):
self
.
scan_array_gen
=
yield_array
(
create_measurement_array
(
start
,
end
,
step_num
))
self
.
ao_to_scan
.
go_softly_to_value
(
start
)
self
.
storage
.
set_directory
(
measure_params
[
'directory'
])
self
.
storage
.
create_data_file
(
'Time'
,
measure_params
[
'signal_to_scan'
],
'Roi data'
)
self
.
storage
.
append_metadata_to_current_file
(
self
.
cam
.
GetMetaData
(),
self
.
measure_params
)
self
.
storage
Txt
.
set_directory
(
measure_params
[
'directory'
])
self
.
storage
Txt
.
create_data_file
(
'Time'
,
measure_params
[
'signal_to_scan'
],
'Roi data'
)
self
.
storage
Txt
.
append_metadata_to_current_file
(
self
.
cam
.
GetMetaData
(),
self
.
measure_params
)
self
.
cam
.
TriggerMode
.
setString
(
'Software'
)
...
...
@@ -185,7 +187,7 @@ class CameraWorker(QtCore.QObject):
@
QtCore
.
pyqtSlot
(
float
)
def
save_data_from_scan_step
(
self
,
roiData
):
row
=
[
time
.
time
(),
self
.
ao_to_scan
.
AO
.
current_value
,
roiData
]
self
.
storage
.
append_data_to_current_file
(
row
)
self
.
storage
Txt
.
append_data_to_current_file
(
row
)
self
.
simple_scan_measurement_step
()
...
...
@@ -196,8 +198,8 @@ class CameraWorker(QtCore.QObject):
@
QtCore
.
pyqtSlot
(
str
)
def
permanent_save_measurement
(
self
,
comment
=
''
):
self
.
storage
.
append_metadata_to_current_file
(
self
.
storage
Txt
.
append_metadata_to_current_file
(
{
'Final comment'
:
comment
}
)
self
.
storage
.
permanent_save_current_data
()
self
.
storage
Txt
.
permanent_save_current_data
()
\ No newline at end of file
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