Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Raptor Engineering Public Development
dsview
Commits
84a7e6a3
Commit
84a7e6a3
authored
5 years ago
by
DreamSourceLab
Browse files
Options
Download
Email Patches
Plain Diff
Fix vertical scale issue after stop capture @ dso mode
parent
13ace4b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
DSView/pv/view/dsosignal.cpp
DSView/pv/view/dsosignal.cpp
+12
-5
No files found.
DSView/pv/view/dsosignal.cpp
View file @
84a7e6a3
...
...
@@ -62,6 +62,7 @@ DsoSignal::DsoSignal(boost::shared_ptr<pv::device::DevInst> dev_inst,
Signal
(
dev_inst
,
probe
),
_data
(
data
),
_scale
(
0
),
_stop_scale
(
1
),
_en_lock
(
false
),
_show
(
true
),
_vDialActive
(
false
),
...
...
@@ -120,7 +121,7 @@ boost::shared_ptr<pv::data::Dso> DsoSignal::dso_data() const
void
DsoSignal
::
set_scale
(
int
height
)
{
_scale
=
height
/
(
_ref_max
-
_ref_min
);
_scale
=
height
/
(
_ref_max
-
_ref_min
)
*
_stop_scale
;
}
float
DsoSignal
::
get_scale
()
...
...
@@ -216,8 +217,10 @@ bool DsoSignal::go_vDialPre(bool manul)
_vDial
->
set_sel
(
_vDial
->
get_sel
()
-
1
);
_dev_inst
->
set_config
(
_probe
,
NULL
,
SR_CONF_PROBE_VDIV
,
g_variant_new_uint64
(
_vDial
->
get_value
()));
if
(
_view
->
session
().
get_capture_state
()
==
SigSession
::
Stopped
)
_scale
*=
pre_vdiv
/
_vDial
->
get_value
();
if
(
_view
->
session
().
get_capture_state
()
==
SigSession
::
Stopped
)
{
_stop_scale
*=
pre_vdiv
/
_vDial
->
get_value
();
set_scale
(
get_view_rect
().
height
());
}
_dev_inst
->
set_config
(
_probe
,
NULL
,
SR_CONF_PROBE_OFFSET
,
g_variant_new_uint16
(
_zero_offset
));
...
...
@@ -244,8 +247,10 @@ bool DsoSignal::go_vDialNext(bool manul)
_vDial
->
set_sel
(
_vDial
->
get_sel
()
+
1
);
_dev_inst
->
set_config
(
_probe
,
NULL
,
SR_CONF_PROBE_VDIV
,
g_variant_new_uint64
(
_vDial
->
get_value
()));
if
(
_view
->
session
().
get_capture_state
()
==
SigSession
::
Stopped
)
_scale
*=
pre_vdiv
/
_vDial
->
get_value
();
if
(
_view
->
session
().
get_capture_state
()
==
SigSession
::
Stopped
)
{
_stop_scale
*=
pre_vdiv
/
_vDial
->
get_value
();
set_scale
(
get_view_rect
().
height
());
}
_dev_inst
->
set_config
(
_probe
,
NULL
,
SR_CONF_PROBE_OFFSET
,
g_variant_new_uint16
(
_zero_offset
));
...
...
@@ -782,6 +787,8 @@ void DsoSignal::paint_mid(QPainter &p, int left, int right, QColor fore, QColor
assert
(
_view
);
assert
(
right
>=
left
);
if
(
_view
->
session
().
get_capture_state
()
==
SigSession
::
Running
)
_stop_scale
=
1
;
if
(
enabled
())
{
const
int
index
=
get_index
();
...
...
This diff is collapsed.
Click to expand it.
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