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
f9f0507a
Commit
f9f0507a
authored
5 years ago
by
DreamSourceLab
Browse files
Options
Download
Email Patches
Plain Diff
improve synchronism between between data acquisition and wave display
parent
85c2ef62
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
27 additions
and
12 deletions
+27
-12
.gitignore
.gitignore
+2
-0
DSView/pv/data/dsosnapshot.cpp
DSView/pv/data/dsosnapshot.cpp
+1
-0
DSView/pv/data/mathstack.cpp
DSView/pv/data/mathstack.cpp
+5
-0
DSView/pv/data/signaldata.h
DSView/pv/data/signaldata.h
+3
-0
DSView/pv/sigsession.cpp
DSView/pv/sigsession.cpp
+10
-7
DSView/pv/sigsession.h
DSView/pv/sigsession.h
+3
-3
DSView/pv/view/viewport.cpp
DSView/pv/view/viewport.cpp
+3
-2
No files found.
.gitignore
View file @
f9f0507a
...
...
@@ -39,6 +39,8 @@ DSView/DSView
DSView/install_manifest.txt
DSView/qrc_DSView.cpp
DSView/qrc_style.cpp
DSView/qrc_breeze.cpp
DSView/qrc_language.cpp
moc_*.cpp
moc_*.cpp_parameters
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/data/dsosnapshot.cpp
View file @
f9f0507a
...
...
@@ -195,6 +195,7 @@ void DsoSnapshot::enable_envelope(bool enable)
const
uint8_t
*
DsoSnapshot
::
get_samples
(
int64_t
start_sample
,
int64_t
end_sample
,
uint16_t
index
)
const
{
boost
::
lock_guard
<
boost
::
recursive_mutex
>
lock
(
_mutex
);
(
void
)
end_sample
;
assert
(
start_sample
>=
0
);
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/data/mathstack.cpp
View file @
f9f0507a
...
...
@@ -109,10 +109,13 @@ void MathStack::free_envelop()
void
MathStack
::
clear
()
{
boost
::
lock_guard
<
boost
::
recursive_mutex
>
lock
(
_mutex
);
}
void
MathStack
::
init
()
{
boost
::
lock_guard
<
boost
::
recursive_mutex
>
lock
(
_mutex
);
_sample_num
=
0
;
_envelope_done
=
false
;
}
...
...
@@ -312,6 +315,8 @@ void MathStack::get_math_envelope_section(EnvelopeSection &s,
void
MathStack
::
calc_math
()
{
boost
::
lock_guard
<
boost
::
recursive_mutex
>
lock
(
_mutex
);
_math_state
=
Running
;
const
boost
::
shared_ptr
<
pv
::
data
::
Dso
>
data
=
_dsoSig1
->
dso_data
();
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/data/signaldata.h
View file @
f9f0507a
...
...
@@ -25,6 +25,7 @@
#define DSVIEW_PV_DATA_SIGNALDATA_H
#include <stdint.h>
#include <boost/thread.hpp>
namespace
pv
{
namespace
data
{
...
...
@@ -43,6 +44,8 @@ public:
virtual
void
init
()
=
0
;
protected:
mutable
boost
::
recursive_mutex
_mutex
;
double
_samplerate
;
};
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/sigsession.cpp
View file @
f9f0507a
...
...
@@ -105,7 +105,7 @@ SigSession::SigSession(DeviceManager &device_manager) :
_hot_detach
=
false
;
_group_cnt
=
0
;
register_hotplug_callback
();
_
view
_timer
.
stop
();
_
feed
_timer
.
stop
();
_noData_cnt
=
0
;
_data_lock
=
false
;
_data_updated
=
false
;
...
...
@@ -129,7 +129,7 @@ SigSession::SigSession(DeviceManager &device_manager) :
_group_data
.
reset
(
new
data
::
Group
());
_group_cnt
=
0
;
connect
(
&
_
view
_timer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
check_update
()));
connect
(
&
_
feed
_timer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
data_unlock
()));
}
SigSession
::~
SigSession
()
...
...
@@ -354,9 +354,10 @@ void SigSession::capture_init()
_trigger_flag
=
false
;
_hw_replied
=
false
;
if
(
_dev_inst
->
dev_inst
()
->
mode
!=
LOGIC
)
_
view
_timer
.
start
(
ViewTime
);
_
feed
_timer
.
start
(
FeedInterval
);
else
_view_timer
.
stop
();
_feed_timer
.
stop
();
_noData_cnt
=
0
;
data_unlock
();
...
...
@@ -587,7 +588,9 @@ void SigSession::sample_thread_proc(boost::shared_ptr<device::DevInst> dev_inst,
void
SigSession
::
check_update
()
{
data_unlock
();
boost
::
lock_guard
<
boost
::
mutex
>
lock
(
_data_mutex
);
//data_unlock(); unlock after wave rendering
if
(
_capture_state
!=
Running
)
return
;
...
...
@@ -597,7 +600,7 @@ void SigSession::check_update()
_noData_cnt
=
0
;
data_auto_unlock
();
}
else
{
if
(
++
_noData_cnt
>=
(
WaitShowTime
/
ViewTime
))
if
(
++
_noData_cnt
>=
(
WaitShowTime
/
FeedInterval
))
nodata_timeout
();
}
}
...
...
@@ -1070,7 +1073,7 @@ void SigSession::feed_in_dso(const sr_datafeed_dso &dso)
_trigger_flag
=
dso
.
trig_flag
;
receive_data
(
dso
.
num_samples
);
//data_updated();
if
(
!
_instant
)
data_lock
();
_data_updated
=
true
;
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/sigsession.h
View file @
f9f0507a
...
...
@@ -102,7 +102,7 @@ private:
static
const
int
RepeatHoldDiv
=
20
;
public:
static
const
int
ViewTime
=
50
;
static
const
int
FeedInterval
=
50
;
static
const
int
WaitShowTime
=
500
;
public:
...
...
@@ -337,7 +337,7 @@ private:
bool
_hot_attach
;
bool
_hot_detach
;
QTimer
_
view
_timer
;
QTimer
_
feed
_timer
;
int
_noData_cnt
;
bool
_data_lock
;
bool
_data_updated
;
...
...
@@ -413,6 +413,7 @@ public slots:
void
reload
();
void
refresh
(
int
holdtime
);
void
stop_capture
();
void
check_update
();
// repeat
void
set_repeating
(
bool
repeat
);
void
set_map_zoom
(
int
index
);
...
...
@@ -422,7 +423,6 @@ public slots:
private
slots
:
void
data_lock
();
void
data_unlock
();
void
check_update
();
void
nodata_timeout
();
void
repeat_update
();
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/view/viewport.cpp
View file @
f9f0507a
...
...
@@ -141,6 +141,7 @@ void Viewport::paintEvent(QPaintEvent *event)
QPainter
p
(
this
);
style
()
->
drawPrimitive
(
QStyle
::
PE_Widget
,
&
o
,
&
p
,
this
);
_view
.
session
().
check_update
();
QColor
fore
(
QWidget
::
palette
().
color
(
QWidget
::
foregroundRole
()));
QColor
back
(
QWidget
::
palette
().
color
(
QWidget
::
backgroundRole
()));
fore
.
setAlpha
(
View
::
ForeAlpha
);
...
...
@@ -328,7 +329,7 @@ void Viewport::paintSignals(QPainter &p, QColor fore, QColor back)
}
else
if
(
_waiting_trig
>
0
)
{
type_str
=
"Waiting Trig"
;
for
(
int
i
=
1
;
i
<
_waiting_trig
;
i
++
)
if
(
i
%
(
WaitLoopTime
/
SigSession
::
ViewTime
)
==
0
)
if
(
i
%
(
WaitLoopTime
/
SigSession
::
FeedInterval
)
==
0
)
type_str
+=
"."
;
}
else
{
type_str
=
"Trig'd"
;
...
...
@@ -1613,7 +1614,7 @@ void Viewport::set_need_update(bool update)
void
Viewport
::
show_wait_trigger
()
{
_waiting_trig
%=
(
WaitLoopTime
/
SigSession
::
ViewTime
)
*
4
;
_waiting_trig
%=
(
WaitLoopTime
/
SigSession
::
FeedInterval
)
*
4
;
_waiting_trig
++
;
update
();
}
...
...
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