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
04674644
Commit
04674644
authored
May 14, 2019
by
Martin Drechsler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
small changes towards rolling plots
parent
e0874f10
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
2 deletions
+67
-2
cameraGui.py
cameraGui.py
+3
-2
rolling_plots.py
examples/rolling_plots.py
+64
-0
No files found.
cameraGui.py
View file @
04674644
...
...
@@ -200,14 +200,15 @@ class CameraGuiMainWindow(QMainWindow):
if
self
.
isMeasuring
:
self
.
roiDataReadySignal
.
emit
(
self
.
newData
)
self
.
scanROIdataY
=
np
.
roll
(
self
.
scanROIdataY
,
-
1
)
self
.
timeROIdataY
=
np
.
roll
(
self
.
timeROIdataY
,
-
1
)
self
.
scanROIdataY
[
-
1
]
=
self
.
newData
self
.
scanROIdataY
[
self
.
iROIdata
]
=
self
.
newData
self
.
timeROIdataY
[
-
1
]
=
self
.
newData
self
.
iROIdata
=
np
.
mod
(
self
.
frame_index
+
1
,
len
(
self
.
timeROIdataY
))
self
.
timeCurve
.
setData
(
self
.
timeROIdataY
)
self
.
scanCurve
.
setData
(
self
.
scanROIdataX
,
self
.
scanROIdataY
)
def
repositionRoi
(
self
,
old_size
):
aux_dict
=
{
'1x1'
:
2048
,
'2x2'
:
1024
,
'4x4'
:
512
,
'8x8'
:
256
}
new_size
=
aux_dict
[
...
...
examples/rolling_plots.py
0 → 100644
View file @
04674644
# -*- coding: utf-8 -*-
"""
Various methods of drawing scrolling plots.
"""
import
pyqtgraph
as
pg
from
pyqtgraph.Qt
import
QtCore
,
QtGui
import
numpy
as
np
app
=
QtGui
.
QApplication
([])
win
=
pg
.
GraphicsLayoutWidget
()
win
.
setWindowTitle
(
'pyqtgraph example: Scrolling Plots'
)
# 2) Allow data to accumulate. In these examples, the array doubles in length
# whenever it is full.
win
.
nextRow
()
p3
=
win
.
addPlot
()
p4
=
win
.
addPlot
()
# Use automatic downsampling and clipping to reduce the drawing load
p3
.
setDownsampling
(
mode
=
'peak'
)
p4
.
setDownsampling
(
mode
=
'peak'
)
p3
.
setClipToView
(
True
)
p4
.
setClipToView
(
True
)
p3
.
setRange
(
xRange
=
[
-
100
,
0
])
p3
.
setLimits
(
xMax
=
0
)
curve3
=
p3
.
plot
()
curve4
=
p4
.
plot
()
p4
.
setYRange
(
0
,
10
)
data3
=
np
.
empty
(
100
)
ptr3
=
0
def
update2
():
global
data3
,
ptr3
data3
[
ptr3
]
=
np
.
random
.
rand
()
+
5
ptr3
+=
1
if
ptr3
>=
data3
.
shape
[
0
]:
tmp
=
data3
data3
=
np
.
empty
(
data3
.
shape
[
0
]
*
2
)
data3
[:
tmp
.
shape
[
0
]]
=
tmp
curve3
.
setData
(
data3
[:
ptr3
])
curve3
.
setPos
(
-
ptr3
,
0
)
curve4
.
setData
(
data3
[:
ptr3
])
if
ptr3
==
50
:
p4
.
setRange
(
xRange
=
[
0
,
50
])
if
ptr3
>
50
:
curve4
.
setPos
(
-
ptr3
,
0
)
timer
=
pg
.
QtCore
.
QTimer
()
timer
.
timeout
.
connect
(
update2
)
timer
.
start
(
100
)
win
.
show
()
## Start Qt event loop unless running in interactive mode or using pyside.
if
__name__
==
'__main__'
:
import
sys
if
(
sys
.
flags
.
interactive
!=
1
)
or
not
hasattr
(
QtCore
,
'PYQT_VERSION'
):
QtGui
.
QApplication
.
instance
()
.
exec_
()
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