Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
redpitaya-MCPHA
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Günter Quast
redpitaya-MCPHA
Commits
aee174a7
Commit
aee174a7
authored
9 months ago
by
Guenter Quast
Browse files
Options
Downloads
Patches
Plain Diff
added initial verson of a mimoCoRB client (not working yet ...)
parent
d50ef540
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
redPoscdaq.py
+24
-10
24 additions, 10 deletions
redPoscdaq.py
with
24 additions
and
10 deletions
redPoscdaq.py
+
24
−
10
View file @
aee174a7
...
...
@@ -95,7 +95,7 @@ class rpControl(QMainWindow, Ui_MCPHA):
"""
Args:
interactive: if True run in interactive mode, else run as mimoCoRB client
callback: function receiving recorded waveforms
"""
super
(
rpControl
,
self
).
__init__
()
self
.
callback_function
=
callback
...
...
@@ -175,7 +175,7 @@ class rpControl(QMainWindow, Ui_MCPHA):
help
=
'
trigger channel
'
)
parser
.
add_argument
(
'
--trigger_mode
'
,
type
=
str
,
choices
=
{
'
norm
'
,
'
auto
'
},
default
=
'
norm
'
,
help
=
'
trigger mode
'
)
parser
.
add_argument
(
'
-s
'
,
'
--sample_size
'
,
type
=
int
,
default
=
4096
,
parser
.
add_argument
(
'
-s
'
,
'
--sample_size
'
,
type
=
int
,
default
=
2048
,
help
=
'
size of waveform sample
'
)
parser
.
add_argument
(
'
-p
'
,
'
--pretrigger_fraction
'
,
type
=
float
,
default
=
0.05
,
help
=
'
pretrigger fraction
'
)
...
...
@@ -643,13 +643,6 @@ class OscDAQ(QWidget, Ui_OscDisplay):
self
.
ax
.
set_xlabel
(
"
sample number
"
+
self
.
xunit
)
self
.
canvas
.
draw
()
def
yield_data
(
self
):
"""
for mimoCoRB interface:
data as a numpy array of shape (n_channels, n_samples_per_channel)
"""
yield
(
self
.
data
,
None
)
def
update_osci_display
(
self
):
self
.
curve1
.
set_ydata
(
self
.
buffer
[
0
::
2
])
self
.
curve2
.
set_ydata
(
self
.
buffer
[
1
::
2
])
...
...
@@ -851,7 +844,27 @@ class redP_consumer():
status_txt
=
"
active: {:.1f}s trigger rate: {:.2f} Hz, data rate: {:.4g} MB/s
"
.
format
(
T_active
,
r
,
r
*
l_tot
*
4e-6
)
print
(
status_txt
,
end
=
'
\r
'
)
from
mimocorb.buffer_control
import
rbPut
class
redP_mimocorb
():
def
__init__
(
self
,
source_list
=
None
,
sink_list
=
None
,
observe_list
=
None
,
config_dict
=
None
,
**
rb_info
):
# initialize mimoCoRB interface
self
.
action
=
rbPut
(
config_dict
=
config_dict
,
sink_list
=
sink_list
,
**
rb_info
)
self
.
number_of_channels
=
len
(
self
.
action
.
sink
.
dtype
)
self
.
events_required
=
1000
if
"
eventcount
"
not
in
config_dict
else
config_dict
[
"
eventcount
"
]
self
.
event_count
=
0
self
.
active
=
True
def
data_sink
(
self
,
data
):
"""
function called by redPoscdaq
this simple version calculates statistics only
"""
while
(
self
.
events_required
==
0
or
self
.
event_count
<
self
.
events_required
)
and
self
.
active
:
# deliver pulse data and no metadata
active
=
self
.
action
(
data
/
5000.
,
None
)
self
.
event_count
+=
1
def
run_rpControl
(
callback
=
None
):
# start redPidaya GUI under Qt5
app
=
QApplication
(
sys
.
argv
)
...
...
@@ -866,4 +879,5 @@ if __name__ == '__main__': # --------------------------------------------
# run_rpControl()
sink
=
redP_consumer
()
print
(
sys
.
argv
)
run_rpControl
(
callback
=
sink
.
data_sink
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment