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
886b847c
Commit
886b847c
authored
7 years ago
by
DreamSourceLab
Browse files
Options
Download
Email Patches
Plain Diff
Warnings fix
parent
83d77b03
Changes
97
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
58 additions
and
52 deletions
+58
-52
.gitignore
.gitignore
+1
-0
DSView/CMakeLists.txt
DSView/CMakeLists.txt
+5
-6
DSView/DSView.desktop
DSView/DSView.desktop
+9
-0
DSView/main.cpp
DSView/main.cpp
+1
-1
DSView/pv/data/analogsnapshot.cpp
DSView/pv/data/analogsnapshot.cpp
+1
-1
DSView/pv/data/decode/annotation.cpp
DSView/pv/data/decode/annotation.cpp
+1
-1
DSView/pv/data/decode/decoder.cpp
DSView/pv/data/decode/decoder.cpp
+1
-1
DSView/pv/data/decode/row.cpp
DSView/pv/data/decode/row.cpp
+1
-1
DSView/pv/data/decodermodel.cpp
DSView/pv/data/decodermodel.cpp
+1
-1
DSView/pv/data/decoderstack.cpp
DSView/pv/data/decoderstack.cpp
+0
-12
DSView/pv/data/decoderstack.h
DSView/pv/data/decoderstack.h
+1
-3
DSView/pv/data/logicsnapshot.cpp
DSView/pv/data/logicsnapshot.cpp
+21
-14
DSView/pv/data/mathstack.cpp
DSView/pv/data/mathstack.cpp
+5
-4
DSView/pv/data/mathstack.h
DSView/pv/data/mathstack.h
+1
-1
DSView/pv/device/devinst.cpp
DSView/pv/device/devinst.cpp
+1
-1
DSView/pv/device/devinst.h
DSView/pv/device/devinst.h
+1
-1
DSView/pv/device/file.cpp
DSView/pv/device/file.cpp
+4
-2
DSView/pv/device/inputfile.cpp
DSView/pv/device/inputfile.cpp
+1
-0
DSView/pv/dialogs/fftoptions.cpp
DSView/pv/dialogs/fftoptions.cpp
+1
-1
DSView/pv/dialogs/interval.cpp
DSView/pv/dialogs/interval.cpp
+1
-1
No files found.
.gitignore
View file @
886b847c
...
...
@@ -36,6 +36,7 @@ DSView/ui_*.h
DSView/DSView
DSView/install_manifest.txt
DSView/qrc_DSView.cpp
DSView/qrc_style.cpp
moc_*.cpp
moc_*.cpp_parameters
...
...
This diff is collapsed.
Click to expand it.
DSView/CMakeLists.txt
View file @
886b847c
...
...
@@ -34,7 +34,7 @@ project(DSView)
option
(
DISABLE_WERROR
"Build without -Werror"
TRUE
)
option
(
ENABLE_SIGNALS
"Build with UNIX signals"
TRUE
)
option
(
ENABLE_DECODE
"Build with libsigrokdecode"
TRUE
)
option
(
ENABLE_DECODE
"Build with libsigrokdecode
4DSL
"
TRUE
)
option
(
ENABLE_COTIRE
"Enable cotire"
FALSE
)
option
(
ENABLE_TESTS
"Enable unit tests"
FALSE
)
option
(
STATIC_PKGDEPS_LIBS
"Statically link to (pkg-config) libraries"
FALSE
)
...
...
@@ -65,7 +65,7 @@ list(APPEND PKGDEPS
"libzip >= 0.10"
)
if
(
ENABLE_DECODE
)
list
(
APPEND PKGDEPS
"libsigrokdecode>=0.
3
.0"
)
list
(
APPEND PKGDEPS
"libsigrokdecode
4DSL
>=0.
4
.0"
)
endif
()
find_package
(
PkgConfig
)
...
...
@@ -148,7 +148,7 @@ set(DSView_SOURCES
pv/view/header.cpp
pv/view/cursor.cpp
pv/view/analogsignal.cpp
pv/prop/binding/
binding_
deviceoptions.cpp
pv/prop/binding/deviceoptions.cpp
pv/toolbars/trigbar.cpp
pv/toolbars/filebar.cpp
pv/dock/protocoldock.cpp
...
...
@@ -267,10 +267,10 @@ set(DSView_FORMS
)
set
(
DSView_RESOURCES
DSView.qrc
DSView.qrc
darkstyle/style.qrc
)
if
(
ENABLE_DECODE
)
list
(
APPEND DSView_SOURCES
pv/dock/protocoldock.cpp
...
...
@@ -399,7 +399,6 @@ set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_RPATH "/usr/local/lib")
# Install the executable.
install
(
TARGETS
${
PROJECT_NAME
}
DESTINATION bin/
)
install
(
DIRECTORY res DESTINATION share/
${
PROJECT_NAME
}
)
install
(
DIRECTORY ../libsigrokdecode4DSL/decoders DESTINATION share/
${
PROJECT_NAME
}
)
install
(
FILES icons/logo.png DESTINATION share/
${
PROJECT_NAME
}
RENAME logo.png
)
install
(
FILES DreamSourceLab.rules DESTINATION /etc/udev/rules.d/
)
install
(
FILES DSView.desktop DESTINATION /usr/share/applications/
)
...
...
This diff is collapsed.
Click to expand it.
DSView/DSView.desktop
0 → 100644
View file @
886b847c
[Desktop Entry]
Version=0.96
Exec=/usr/local/bin/DSView
Name=DSView
Comment=GUI Program for DreamSourceLab USB-based Instruments
Icon=/usr/local/share/DSView/logo.png
Type=Application
Terminal=false
Categories=Development
This diff is collapsed.
Click to expand it.
DSView/main.cpp
View file @
886b847c
...
...
@@ -22,7 +22,7 @@
#ifdef ENABLE_DECODE
#include <libsigrokdecode/libsigrokdecode.h>
/* First, so we avoid a _POSIX_C_SOURCE warning. */
#include <libsigrokdecode
4DSL
/libsigrokdecode.h>
/* First, so we avoid a _POSIX_C_SOURCE warning. */
#endif
#include <stdint.h>
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/data/analogsnapshot.cpp
View file @
886b847c
...
...
@@ -338,7 +338,7 @@ void AnalogSnapshot::append_payload_to_envelope_levels()
int
AnalogSnapshot
::
get_ch_order
(
int
sig_index
)
{
int
order
=
0
;
u
int
16_t
order
=
0
;
for
(
auto
&
iter
:
_ch_index
)
{
if
(
iter
==
sig_index
)
break
;
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/data/decode/annotation.cpp
View file @
886b847c
...
...
@@ -20,7 +20,7 @@
*/
extern
"C"
{
#include <libsigrokdecode/libsigrokdecode.h>
#include <libsigrokdecode
4DSL
/libsigrokdecode.h>
}
#include <vector>
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/data/decode/decoder.cpp
View file @
886b847c
...
...
@@ -20,7 +20,7 @@
*/
#include <libsigrok4DSL/libsigrok.h>
#include <libsigrokdecode/libsigrokdecode.h>
#include <libsigrokdecode
4DSL
/libsigrokdecode.h>
#include "decoder.h"
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/data/decode/row.cpp
View file @
886b847c
...
...
@@ -20,7 +20,7 @@
#include "row.h"
#include <libsigrokdecode/libsigrokdecode.h>
#include <libsigrokdecode
4DSL
/libsigrokdecode.h>
namespace
pv
{
namespace
data
{
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/data/decodermodel.cpp
View file @
886b847c
...
...
@@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <libsigrokdecode/libsigrokdecode.h>
#include <libsigrokdecode
4DSL
/libsigrokdecode.h>
#include <boost/foreach.hpp>
#include <boost/thread/thread.hpp>
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/data/decoderstack.cpp
View file @
886b847c
...
...
@@ -457,18 +457,6 @@ uint64_t DecoderStack::get_max_sample_count() const
return
max_sample_count
;
}
boost
::
optional
<
uint64_t
>
DecoderStack
::
wait_for_data
()
const
{
//unique_lock<mutex> input_lock(_input_mutex);
while
(
!
boost
::
this_thread
::
interruption_requested
()
&&
!
_frame_complete
&&
(
uint64_t
)
_samples_decoded
>=
_sample_count
)
//_input_cond.wait(input_lock);
return
boost
::
make_optional
(
!
boost
::
this_thread
::
interruption_requested
()
&&
((
uint64_t
)
_samples_decoded
<
_sample_count
||
!
_frame_complete
),
_sample_count
);
}
void
DecoderStack
::
decode_data
(
const
uint64_t
decode_start
,
const
uint64_t
decode_end
,
srd_session
*
const
session
)
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/data/decoderstack.h
View file @
886b847c
...
...
@@ -21,7 +21,7 @@
#ifndef DSVIEW_PV_DATA_DECODERSTACK_H
#define DSVIEW_PV_DATA_DECODERSTACK_H
#include <libsigrokdecode/libsigrokdecode.h>
#include <libsigrokdecode
4DSL
/libsigrokdecode.h>
#include <list>
...
...
@@ -145,8 +145,6 @@ public:
int64_t
get_mark_index
()
const
;
private:
boost
::
optional
<
uint64_t
>
wait_for_data
()
const
;
void
decode_data
(
const
uint64_t
decode_start
,
const
uint64_t
decode_end
,
srd_session
*
const
session
);
void
decode_proc
();
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/data/logicsnapshot.cpp
View file @
886b847c
...
...
@@ -165,7 +165,7 @@ void LogicSnapshot::first_payload(const sr_datafeed_logic &logic, uint64_t total
sr_channel
*
const
probe
=
(
sr_channel
*
)
l
->
data
;
if
(
probe
->
type
==
SR_CHANNEL_LOGIC
&&
probe
->
enabled
)
{
std
::
vector
<
struct
RootNode
>
root_vector
;
for
(
int
j
=
0
;
j
<
rootnode_size
;
j
++
)
{
for
(
u
int
64_t
j
=
0
;
j
<
rootnode_size
;
j
++
)
{
struct
RootNode
rn
;
rn
.
tog
=
0
;
rn
.
value
=
0
;
...
...
@@ -250,11 +250,16 @@ void LogicSnapshot::append_cross_payload(
// bit align
while
(((
_ch_fraction
!=
0
)
||
(
_byte_fraction
!=
0
))
&&
(
len
!=
0
))
{
uint8_t
*
dp_tmp
=
(
uint8_t
*
)
_dest_ptr
;
uint8_t
*
sp_tmp
=
(
uint8_t
*
)
_src_ptr
;
do
{
*
(
uint8_t
*
)
_dest_ptr
++
=
*
(
uint8_t
*
)
_src_ptr
++
;
//*(uint8_t *)_dest_ptr++ = *(uint8_t *)_src_ptr++;
*
dp_tmp
++
=
*
sp_tmp
++
;
_byte_fraction
=
(
_byte_fraction
+
1
)
%
ScaleSize
;
len
--
;
}
while
((
_byte_fraction
!=
0
)
&&
(
len
!=
0
));
_dest_ptr
=
dp_tmp
;
_src_ptr
=
sp_tmp
;
if
(
_byte_fraction
==
0
)
{
const
uint64_t
index0
=
_ring_sample_count
/
RootNodeSamples
;
const
uint64_t
index1
=
(
_ring_sample_count
>>
LeafBlockPower
)
%
RootScale
;
...
...
@@ -283,7 +288,7 @@ void LogicSnapshot::append_cross_payload(
uint64_t
pre_index0
=
_ring_sample_count
/
RootNodeSamples
;
uint64_t
pre_index1
=
(
_ring_sample_count
>>
LeafBlockPower
)
%
RootScale
;
uint64_t
pre_offset
=
(
_ring_sample_count
%
LeafBlockSamples
)
/
Scale
;
uint64_t
*
src_ptr
;
uint64_t
*
src_ptr
=
NULL
;
uint64_t
*
dest_ptr
;
int
order
=
0
;
const
uint64_t
align_size
=
len
/
ScaleSize
/
_channel_num
;
...
...
@@ -345,15 +350,20 @@ void LogicSnapshot::append_cross_payload(
uint64_t
offset
=
(
_ring_sample_count
%
LeafBlockSamples
)
/
8
;
_dest_ptr
=
(
uint8_t
*
)
_ch_data
[
_ch_fraction
][
index0
].
lbp
[
index1
]
+
offset
;
uint8_t
*
dp_tmp
=
(
uint8_t
*
)
_dest_ptr
;
uint8_t
*
sp_tmp
=
(
uint8_t
*
)
_src_ptr
;
while
(
len
--
!=
0
)
{
*
(
uint8_t
*
)
_dest_ptr
++
=
*
(
uint8_t
*
)
_src_ptr
++
;
//*(uint8_t *)_dest_ptr++ = *(uint8_t *)_src_ptr++;
*
dp_tmp
++
=
*
sp_tmp
++
;
if
(
++
_byte_fraction
==
ScaleSize
)
{
_ch_fraction
=
(
_ch_fraction
+
1
)
%
_channel_num
;
_byte_fraction
=
0
;
_dest_ptr
=
(
uint8_t
*
)
_ch_data
[
_ch_fraction
][
index0
].
lbp
[
index1
]
+
offset
;
//_dest_ptr = (uint8_t *)_ch_data[_ch_fraction][index0].lbp[index1] + offset;
dp_tmp
=
(
uint8_t
*
)
_ch_data
[
_ch_fraction
][
index0
].
lbp
[
index1
]
+
offset
;
}
}
_dest_ptr
=
(
uint8_t
*
)
_dest_ptr
+
_byte_fraction
;
//_dest_ptr = (uint8_t *)_dest_ptr + _byte_fraction;
_dest_ptr
=
dp_tmp
+
_byte_fraction
;
}
}
...
...
@@ -363,7 +373,7 @@ void LogicSnapshot::append_split_payload(
assert
(
logic
.
format
==
LA_SPLIT_DATA
);
uint64_t
samples
=
logic
.
length
*
8
;
int
order
=
logic
.
order
;
u
int
16_t
order
=
logic
.
order
;
assert
(
order
<
_ch_data
.
size
());
if
(
_sample_cnt
[
order
]
>=
_total_sample_count
)
...
...
@@ -459,9 +469,7 @@ const uint8_t *LogicSnapshot::get_samples(uint64_t start_sample, uint64_t &end_s
int
sig_index
)
{
//assert(data);
assert
(
start_sample
>=
0
);
assert
(
start_sample
<
get_sample_count
());
assert
(
end_sample
>=
0
);
assert
(
end_sample
<
get_sample_count
());
assert
(
start_sample
<=
end_sample
);
...
...
@@ -530,9 +538,9 @@ bool LogicSnapshot::get_display_edges(std::vector<std::pair<bool, bool> > &edges
bool
has_edge
=
get_nxt_edge
(
index
,
last_sample
,
end
,
0
,
sig_index
);
// calc the edge position
int
gap
=
(
index
/
min_length
)
-
pixels_offset
;
int
64_t
gap
=
(
index
/
min_length
)
-
pixels_offset
;
index
=
max
((
uint64_t
)
ceil
((
floor
(
index
/
min_length
)
+
1
)
*
min_length
),
index
+
1
);
while
(
gap
>
edges
.
size
()
&&
edges
.
size
()
<
width
)
while
(
gap
>
(
int64_t
)
edges
.
size
()
&&
edges
.
size
()
<
width
)
edges
.
push_back
(
pair
<
bool
,
bool
>
(
false
,
last_sample
));
if
(
index
>
end
)
...
...
@@ -576,7 +584,7 @@ bool LogicSnapshot::get_nxt_edge(
bool
edge_hit
=
false
;
// linear search for the next transition on the root level
for
(
int64_t
i
=
root_index
;
!
edge_hit
&&
(
index
<=
end
)
&&
i
<
_ch_data
[
order
].
size
();
i
++
)
{
for
(
int64_t
i
=
root_index
;
!
edge_hit
&&
(
index
<=
end
)
&&
i
<
(
int64_t
)
_ch_data
[
order
].
size
();
i
++
)
{
uint64_t
cur_mask
=
(
~
0ULL
<<
root_pos
);
do
{
uint64_t
cur_tog
=
_ch_data
[
order
][
i
].
tog
&
cur_mask
;
...
...
@@ -739,7 +747,6 @@ bool LogicSnapshot::block_pre_edge(uint64_t *lbp, uint64_t &index, bool last_sam
unsigned
int
level
=
min_level
;
bool
fast_forward
=
true
;
bool
within_block
=
true
;
const
uint64_t
last
=
last_sample
?
~
0ULL
:
0
;
uint64_t
block_start
=
index
&
~
LeafMask
;
...
...
@@ -1067,7 +1074,7 @@ uint8_t *LogicSnapshot::get_block_buf(int block_index, int sig_index, bool &samp
int
LogicSnapshot
::
get_ch_order
(
int
sig_index
)
{
int
order
=
0
;
u
int
16_t
order
=
0
;
for
(
auto
&
iter
:
_ch_index
)
{
if
(
iter
==
sig_index
)
break
;
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/data/mathstack.cpp
View file @
886b847c
...
...
@@ -157,12 +157,13 @@ const std::vector<double> MathStack::get_fft_spectrum() const
return
empty
;
}
const
double
MathStack
::
get_fft_spectrum
(
uint64_t
index
)
const
double
MathStack
::
get_fft_spectrum
(
uint64_t
index
)
{
double
ret
=
-
1
;
if
(
_math_state
==
Stopped
&&
index
<
_power_spectrum
.
size
())
ret
urn
_power_spectrum
[
index
];
else
return
-
1
;
ret
=
_power_spectrum
[
index
];
return
ret
;
}
void
MathStack
::
calc_fft
()
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/data/mathstack.h
View file @
886b847c
...
...
@@ -86,7 +86,7 @@ public:
void
set_sample_interval
(
int
interval
);
const
std
::
vector
<
double
>
get_fft_spectrum
()
const
;
const
double
get_fft_spectrum
(
uint64_t
index
)
const
;
double
get_fft_spectrum
(
uint64_t
index
);
void
calc_fft
();
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/device/devinst.cpp
View file @
886b847c
...
...
@@ -83,7 +83,7 @@ GVariant* DevInst::get_config(const sr_channel *ch, const sr_channel_group *grou
return
data
;
}
bool
DevInst
::
set_config
(
const
sr_channel
*
ch
,
const
sr_channel_group
*
group
,
int
key
,
GVariant
*
data
)
bool
DevInst
::
set_config
(
sr_channel
*
ch
,
sr_channel_group
*
group
,
int
key
,
GVariant
*
data
)
{
assert
(
_owner
);
sr_dev_inst
*
const
sdi
=
dev_inst
();
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/device/devinst.h
View file @
886b847c
...
...
@@ -63,7 +63,7 @@ public:
GVariant
*
get_config
(
const
sr_channel
*
ch
,
const
sr_channel_group
*
group
,
int
key
);
bool
set_config
(
const
sr_channel
*
ch
,
const
sr_channel_group
*
group
,
int
key
,
GVariant
*
data
);
bool
set_config
(
sr_channel
*
ch
,
sr_channel_group
*
group
,
int
key
,
GVariant
*
data
);
GVariant
*
list_config
(
const
sr_channel_group
*
group
,
int
key
);
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/device/file.cpp
View file @
886b847c
...
...
@@ -78,10 +78,12 @@ QJsonArray File::get_decoders()
QJsonArray
dec_array
;
QJsonParseError
error
;
if
(
archive
=
zip_open
(
_path
.
toLocal8Bit
().
data
(),
0
,
&
ret
))
{
archive
=
zip_open
(
_path
.
toLocal8Bit
().
data
(),
0
,
&
ret
);
if
(
archive
)
{
/* read "decoders" */
if
(
zip_stat
(
archive
,
"decoders"
,
0
,
&
zs
)
!=
-
1
)
{
if
(
dec_file
=
(
char
*
)
g_try_malloc
(
zs
.
size
))
{
dec_file
=
(
char
*
)
g_try_malloc
(
zs
.
size
);
if
(
dec_file
)
{
zf
=
zip_fopen_index
(
archive
,
zs
.
index
,
0
);
zip_fread
(
zf
,
dec_file
,
zs
.
size
);
zip_fclose
(
zf
);
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/device/inputfile.cpp
View file @
886b847c
...
...
@@ -48,6 +48,7 @@ sr_dev_inst* InputFile::dev_inst() const
void
InputFile
::
use
(
SigSession
*
owner
)
throw
(
QString
)
{
(
void
)
owner
;
assert
(
!
_input
);
// only *.dsl file is valid
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/dialogs/fftoptions.cpp
View file @
886b847c
...
...
@@ -224,7 +224,7 @@ void FftOptions::accept()
mathTrace
->
get_math_stack
()
->
set_sample_num
(
_len_combobox
->
currentData
().
toULongLong
());
mathTrace
->
get_math_stack
()
->
set_sample_interval
(
_interval_combobox
->
currentData
().
toInt
());
mathTrace
->
get_math_stack
()
->
set_windows_index
(
_window_combobox
->
currentData
().
toInt
());
mathTrace
->
set_view_mode
(
_view_combobox
->
currentData
().
toInt
());
mathTrace
->
set_view_mode
(
_view_combobox
->
currentData
().
to
U
Int
());
//mathTrace->init_zoom();
mathTrace
->
set_dbv_range
(
_dbv_combobox
->
currentData
().
toInt
());
mathTrace
->
set_enable
(
_en_checkbox
->
isChecked
());
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/dialogs/interval.cpp
View file @
886b847c
...
...
@@ -27,8 +27,8 @@ namespace pv {
namespace
dialogs
{
Interval
::
Interval
(
SigSession
&
session
,
QWidget
*
parent
)
:
_session
(
session
),
DSDialog
(
parent
),
_session
(
session
),
_button_box
(
QDialogButtonBox
::
Ok
,
Qt
::
Horizontal
,
this
)
{
...
...
This diff is collapsed.
Click to expand it.
Prev
1
2
3
4
5
Next
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