Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
labcode
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CST
labcode
Commits
7936f21a
Commit
7936f21a
authored
2 months ago
by
Alexandros Asonitis
Browse files
Options
Downloads
Patches
Plain Diff
Long tasks crsuh the software
parent
3ead7308
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
hp4194/cv_qt_inteface.py
+14
-5
14 additions, 5 deletions
hp4194/cv_qt_inteface.py
with
14 additions
and
5 deletions
hp4194/cv_qt_inteface.py
+
14
−
5
View file @
7936f21a
...
...
@@ -8,6 +8,7 @@ from matplotlib.backends.backend_qtagg import FigureCanvasQTAgg
from
matplotlib.figure
import
Figure
import
random
from
PyQt6.QtGui
import
QAction
import
time
class
MplCanvas
(
FigureCanvasQTAgg
):
def
__init__
(
self
,
parent
=
None
,
width
=
5
,
height
=
4
,
dpi
=
100
):
...
...
@@ -199,12 +200,12 @@ class MainWinow(QMainWindow):
for
j
in
range
(
3
):
self
.
sc
.
axes
[
i
,
j
].
plot
(
self
.
xdata
,
random
.
sample
(
range
(
50
),
20
))
toolbar
=
QToolBar
(
"
Toolbar
"
)
self
.
addToolBar
(
toolbar
)
self
.
toolbar
=
QToolBar
(
"
Toolbar
"
)
self
.
addToolBar
(
self
.
toolbar
)
button_action
=
QAction
(
"
start measurement
"
,
self
)
button_action
.
triggered
.
connect
(
self
.
toolbar_button_clicked
)
toolbar
.
addAction
(
button_action
)
self
.
toolbar
.
addAction
(
button_action
)
self
.
app_grid
.
addWidget
(
self
.
sc
,
0
,
1
,
3
,
1
)
...
...
@@ -213,6 +214,9 @@ class MainWinow(QMainWindow):
self
.
showMaximized
()
def
toolbar_button_clicked
(
self
):
self
.
widget
.
setEnabled
(
False
)
self
.
toolbar
.
setEnabled
(
False
)
self
.
xdata
=
list
(
range
(
20
))
for
i
in
range
(
2
):
...
...
@@ -221,7 +225,12 @@ class MainWinow(QMainWindow):
self
.
sc
.
axes
[
i
,
j
].
plot
(
self
.
xdata
,
random
.
sample
(
range
(
50
),
20
))
# Trigger the canvas to update and redraw.
self
.
sc
.
draw
()
self
.
sc
.
draw_idle
()
print
(
"
finished
"
)
#self.widget.setEnabled(True)
#self.toolbar.setEnabled(True)
app
=
QApplication
(
sys
.
argv
)
w
=
MainWinow
()
...
...
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