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
bb08d99b
Commit
bb08d99b
authored
1 year ago
by
Guenter Quast
Browse files
Options
Downloads
Patches
Plain Diff
mcpha.py: show only interesting range if thresholds selected
parent
7b7460d3
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mcpha.py
+26
-8
26 additions, 8 deletions
mcpha.py
with
26 additions
and
8 deletions
mcpha.py
+
26
−
8
View file @
bb08d99b
...
...
@@ -364,12 +364,12 @@ class HstDisplay(QWidget, Ui_HstDisplay):
self
.
mcpha
=
mcpha
self
.
log
=
log
self
.
number
=
number
self
.
min
=
0
self
.
max
=
4095
self
.
sum
=
0
self
.
time
=
np
.
uint64
([
75e8
,
0
])
self
.
factor
=
1
self
.
bins
=
4096
self
.
min
=
0
self
.
max
=
self
.
bins
-
1
self
.
buffer
=
np
.
zeros
(
self
.
bins
,
np
.
uint32
)
if
number
==
0
:
self
.
color
=
"
#FFAA00
"
...
...
@@ -394,12 +394,13 @@ class HstDisplay(QWidget, Ui_HstDisplay):
# !gq end
x
=
np
.
arange
(
self
.
bins
)
(
self
.
curve
,)
=
self
.
ax
.
plot
(
x
,
self
.
buffer
,
drawstyle
=
"
steps-mid
"
,
color
=
self
.
color
)
self
.
roi
=
[
0
,
4095
]
self
.
roi
=
[
0
,
self
.
max
]
self
.
line
=
[
None
,
None
]
self
.
active
=
[
False
,
False
]
self
.
releaser
=
[
None
,
None
]
self
.
line
[
0
]
=
self
.
ax
.
axvline
(
0
,
picker
=
True
,
pickradius
=
5
)
self
.
line
[
1
]
=
self
.
ax
.
axvline
(
4095
,
picker
=
True
,
pickradius
=
5
)
# marker lines for roi
self
.
line
[
0
]
=
self
.
ax
.
axvline
(
self
.
min
,
picker
=
True
,
pickradius
=
5
)
self
.
line
[
1
]
=
self
.
ax
.
axvline
(
self
.
max
,
picker
=
True
,
pickradius
=
5
)
# create navigation toolbar
self
.
toolbar
=
NavigationToolbar
(
self
.
canvas
,
None
,
False
)
self
.
toolbar
.
layout
().
setSpacing
(
6
)
...
...
@@ -467,6 +468,7 @@ class HstDisplay(QWidget, Ui_HstDisplay):
self
.
mcpha
.
set_pha_delay
(
self
.
number
,
100
)
self
.
mcpha
.
set_pha_thresholds
(
self
.
number
,
self
.
min
,
self
.
max
)
self
.
mcpha
.
set_timer
(
self
.
number
,
value
)
#
self
.
resume
()
def
pause
(
self
):
...
...
@@ -528,10 +530,15 @@ class HstDisplay(QWidget, Ui_HstDisplay):
else
:
self
.
ax
.
set_ylim
(
auto
=
True
)
self
.
ax
.
set_yscale
(
"
linear
"
)
size
=
self
.
bins
//
self
.
factor
self
.
ax
.
set_xlim
(
-
0.05
*
size
,
size
*
1.05
)
# !gq size = self.bins // self.factor
# self.ax.set_xlim(-0.05 * size, size * 1.05)
mn
=
self
.
min
//
self
.
factor
mx
=
self
.
max
//
self
.
factor
xsize
=
mx
-
mn
self
.
ax
.
set_xlim
(
mn
-
0.03
*
xsize
,
mx
*
1.03
)
self
.
ax
.
relim
()
self
.
ax
.
autoscale_view
(
scalex
=
True
,
scaley
=
True
)
#
self
.
canvas
.
draw
()
def
set_bins
(
self
,
value
):
...
...
@@ -543,6 +550,9 @@ class HstDisplay(QWidget, Ui_HstDisplay):
self
.
curve
.
set_xdata
(
x
)
self
.
curve
.
set_ydata
(
y
)
self
.
set_scale
(
self
.
logCheck
.
isChecked
())
# gq update roi
self
.
roi
[
0
]
=
self
.
min
self
.
roi
[
1
]
=
self
.
max
self
.
update_roi
()
def
set_thresholds
(
self
,
checked
):
...
...
@@ -553,7 +563,15 @@ class HstDisplay(QWidget, Ui_HstDisplay):
self
.
max
=
self
.
maxValue
.
value
()
else
:
self
.
min
=
0
self
.
max
=
4095
self
.
max
=
self
.
bins
-
1
mn
=
self
.
min
//
self
.
factor
mx
=
self
.
max
//
self
.
factor
xsize
=
mx
-
mn
self
.
ax
.
set_xlim
(
mn
-
0.025
*
xsize
,
mx
*
1.025
)
# !gq update roi
self
.
roi
[
0
]
=
self
.
min
self
.
roi
[
1
]
=
self
.
max
self
.
update_roi
()
def
set_time
(
self
,
value
):
value
=
value
//
125000
...
...
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