Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dsview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Raptor Engineering Public Development
dsview
Commits
ba34aeb9
Commit
ba34aeb9
authored
Jan 14, 2020
by
DreamSourceLab
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix vertical scale issue after stop capturing @dso mode
parent
c2384277
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
21 deletions
+38
-21
DSView/pv/sigsession.cpp
DSView/pv/sigsession.cpp
+29
-0
DSView/pv/sigsession.h
DSView/pv/sigsession.h
+5
-0
DSView/pv/toolbars/samplingbar.cpp
DSView/pv/toolbars/samplingbar.cpp
+1
-13
DSView/pv/view/dsosignal.cpp
DSView/pv/view/dsosignal.cpp
+3
-7
DSView/pv/view/dsosignal.h
DSView/pv/view/dsosignal.h
+0
-1
No files found.
DSView/pv/sigsession.cpp
View file @
ba34aeb9
...
...
@@ -116,6 +116,7 @@ SigSession::SigSession(DeviceManager &device_manager) :
_math_trace
=
NULL
;
_saving
=
false
;
_dso_feed
=
false
;
_stop_scale
=
1
;
// Create snapshots & data containers
_cur_logic_snapshot
.
reset
(
new
data
::
LogicSnapshot
());
...
...
@@ -351,6 +352,7 @@ void SigSession::capture_init()
set_cur_snap_samplerate
(
_dev_inst
->
get_sample_rate
());
set_cur_samplelimits
(
_dev_inst
->
get_sample_limit
());
set_stop_scale
(
1
);
_data_updated
=
false
;
_trigger_flag
=
false
;
_trigger_ch
=
0
;
...
...
@@ -1781,4 +1783,31 @@ void SigSession::set_saving(bool saving)
_saving
=
saving
;
}
void
SigSession
::
exit_capture
()
{
set_repeating
(
false
);
bool
wait_upload
=
false
;
if
(
get_run_mode
()
!=
SigSession
::
Repetitive
)
{
GVariant
*
gvar
=
_dev_inst
->
get_config
(
NULL
,
NULL
,
SR_CONF_WAIT_UPLOAD
);
if
(
gvar
!=
NULL
)
{
wait_upload
=
g_variant_get_boolean
(
gvar
);
g_variant_unref
(
gvar
);
}
}
if
(
!
wait_upload
)
{
stop_capture
();
capture_state_changed
(
SigSession
::
Stopped
);
}
}
float
SigSession
::
stop_scale
()
const
{
return
_stop_scale
;
}
void
SigSession
::
set_stop_scale
(
float
scale
)
{
_stop_scale
=
scale
;
}
}
// namespace pv
DSView/pv/sigsession.h
View file @
ba34aeb9
...
...
@@ -256,6 +256,10 @@ public:
uint64_t
get_save_end
()
const
;
bool
get_saving
()
const
;
void
set_saving
(
bool
saving
);
void
set_stop_scale
(
float
scale
);
float
stop_scale
()
const
;
void
exit_capture
();
private:
void
set_capture_state
(
capture_state
state
);
...
...
@@ -367,6 +371,7 @@ private:
bool
_saving
;
bool
_dso_feed
;
float
_stop_scale
;
signals:
void
capture_state_changed
(
int
state
);
...
...
DSView/pv/toolbars/samplingbar.cpp
View file @
ba34aeb9
...
...
@@ -822,19 +822,7 @@ void SamplingBar::commit_settings()
void
SamplingBar
::
on_run_stop
()
{
if
(
get_sampling
()
||
_session
.
isRepeating
())
{
_session
.
set_repeating
(
false
);
bool
wait_upload
=
false
;
if
(
_session
.
get_run_mode
()
!=
SigSession
::
Repetitive
)
{
GVariant
*
gvar
=
get_selected_device
()
->
get_config
(
NULL
,
NULL
,
SR_CONF_WAIT_UPLOAD
);
if
(
gvar
!=
NULL
)
{
wait_upload
=
g_variant_get_boolean
(
gvar
);
g_variant_unref
(
gvar
);
}
}
if
(
!
wait_upload
)
{
_session
.
stop_capture
();
_session
.
capture_state_changed
(
SigSession
::
Stopped
);
}
_session
.
exit_capture
();
}
else
{
enable_run_stop
(
false
);
enable_instant
(
false
);
...
...
DSView/pv/view/dsosignal.cpp
View file @
ba34aeb9
...
...
@@ -62,7 +62,6 @@ 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
),
...
...
@@ -121,7 +120,7 @@ boost::shared_ptr<pv::data::Dso> DsoSignal::dso_data() const
void
DsoSignal
::
set_scale
(
int
height
)
{
_scale
=
height
/
(
_ref_max
-
_ref_min
)
*
_
stop_scale
;
_scale
=
height
/
(
_ref_max
-
_ref_min
)
*
_
view
->
session
().
stop_scale
()
;
}
float
DsoSignal
::
get_scale
()
...
...
@@ -218,7 +217,7 @@ bool DsoSignal::go_vDialPre(bool manul)
_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
)
{
_
stop_scale
*=
pre_vdiv
/
_vDial
->
get_value
(
);
_
view
->
session
().
set_stop_scale
(
_view
->
session
().
stop_scale
()
*
(
pre_vdiv
/
_vDial
->
get_value
())
);
set_scale
(
get_view_rect
().
height
());
}
_dev_inst
->
set_config
(
_probe
,
NULL
,
SR_CONF_PROBE_OFFSET
,
...
...
@@ -248,7 +247,7 @@ bool DsoSignal::go_vDialNext(bool manul)
_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
)
{
_
stop_scale
*=
pre_vdiv
/
_vDial
->
get_value
(
);
_
view
->
session
().
set_stop_scale
(
_view
->
session
().
stop_scale
()
*
(
pre_vdiv
/
_vDial
->
get_value
())
);
set_scale
(
get_view_rect
().
height
());
}
_dev_inst
->
set_config
(
_probe
,
NULL
,
SR_CONF_PROBE_OFFSET
,
...
...
@@ -839,9 +838,6 @@ 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
();
const
int
width
=
right
-
left
;
...
...
DSView/pv/view/dsosignal.h
View file @
ba34aeb9
...
...
@@ -232,7 +232,6 @@ private:
private:
boost
::
shared_ptr
<
pv
::
data
::
Dso
>
_data
;
float
_scale
;
float
_stop_scale
;
bool
_en_lock
;
bool
_show
;
...
...
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