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
0b9fe223
Commit
0b9fe223
authored
7 years ago
by
DreamSourceLab
Browse files
Options
Download
Email Patches
Plain Diff
fix save/export issue when sample depth greater than 4G, or part of channels enabled
parent
7dc86814
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
17 deletions
+22
-17
DSView/pv/data/logicsnapshot.cpp
DSView/pv/data/logicsnapshot.cpp
+10
-8
DSView/pv/dialogs/storeprogress.cpp
DSView/pv/dialogs/storeprogress.cpp
+3
-4
libsigrok4DSL/output/csv.c
libsigrok4DSL/output/csv.c
+4
-2
libsigrok4DSL/output/gnuplot.c
libsigrok4DSL/output/gnuplot.c
+3
-2
libsigrok4DSL/output/vcd.c
libsigrok4DSL/output/vcd.c
+2
-1
No files found.
DSView/pv/data/logicsnapshot.cpp
View file @
0b9fe223
...
...
@@ -220,12 +220,15 @@ void LogicSnapshot::append_cross_payload(
if
(
_sample_count
>=
_total_sample_count
)
return
;
_src_ptr
=
logic
.
data
;
uint64_t
len
=
logic
.
length
;
uint64_t
samples
=
ceil
(
logic
.
length
*
8.0
/
_channel_num
);
if
(
_sample_count
+
samples
<
_total_sample_count
)
if
(
_sample_count
+
samples
<
_total_sample_count
)
{
_sample_count
+=
samples
;
else
}
else
{
len
=
ceil
((
_total_sample_count
-
_sample_count
)
*
_channel_num
/
8.0
);
_sample_count
=
_total_sample_count
;
}
while
(
_sample_count
>
_block_num
*
LeafBlockSamples
)
{
uint8_t
index0
=
_block_num
/
RootScale
;
...
...
@@ -244,9 +247,6 @@ void LogicSnapshot::append_cross_payload(
_block_num
++
;
}
_src_ptr
=
logic
.
data
;
uint64_t
len
=
logic
.
length
;
// bit align
while
(((
_ch_fraction
!=
0
)
||
(
_byte_fraction
!=
0
))
&&
(
len
!=
0
))
{
uint8_t
*
dp_tmp
=
(
uint8_t
*
)
_dest_ptr
;
...
...
@@ -378,10 +378,12 @@ void LogicSnapshot::append_split_payload(
if
(
_sample_cnt
[
order
]
>=
_total_sample_count
)
return
;
if
(
_sample_cnt
[
order
]
+
samples
<
_total_sample_count
)
if
(
_sample_cnt
[
order
]
+
samples
<
_total_sample_count
)
{
_sample_cnt
[
order
]
+=
samples
;
else
}
else
{
samples
=
_total_sample_count
-
_sample_cnt
[
order
];
_sample_cnt
[
order
]
=
_total_sample_count
;
}
while
(
_sample_cnt
[
order
]
>
_block_cnt
[
order
]
*
LeafBlockSamples
)
{
uint8_t
index0
=
_block_cnt
[
order
]
/
RootScale
;
...
...
This diff is collapsed.
Click to expand it.
DSView/pv/dialogs/storeprogress.cpp
View file @
0b9fe223
...
...
@@ -37,7 +37,7 @@ StoreProgress::StoreProgress(SigSession &session, QWidget *parent) :
_info
.
setText
(
"..."
);
_progress
.
setValue
(
0
);
_progress
.
setMaximum
(
0
);
_progress
.
setMaximum
(
10
0
);
QVBoxLayout
*
add_layout
=
new
QVBoxLayout
(
this
);
add_layout
->
addWidget
(
&
_info
,
0
,
Qt
::
AlignCenter
);
...
...
@@ -114,9 +114,8 @@ void StoreProgress::on_progress_updated()
{
const
std
::
pair
<
uint64_t
,
uint64_t
>
p
=
_store_session
.
progress
();
assert
(
p
.
first
<=
p
.
second
);
_progress
.
setValue
(
p
.
first
);
_progress
.
setMaximum
(
p
.
second
);
int
percent
=
p
.
first
*
1.0
/
p
.
second
*
100
;
_progress
.
setValue
(
percent
);
const
QString
err
=
_store_session
.
error
();
if
(
!
err
.
isEmpty
())
{
...
...
This diff is collapsed.
Click to expand it.
libsigrok4DSL/output/csv.c
View file @
0b9fe223
...
...
@@ -93,7 +93,8 @@ static int init(struct sr_output *o, GHashTable *options)
if
(
!
ch
->
enabled
)
continue
;
ctx
->
channel_index
[
i
]
=
ch
->
index
;
ctx
->
mask
|=
(
1
<<
ch
->
index
);
//ctx->mask |= (1 << ch->index);
ctx
->
mask
|=
(
1
<<
i
);
ctx
->
channel_vdiv
[
i
]
=
ch
->
vdiv
*
ch
->
vfactor
>=
500
?
ch
->
vdiv
*
ch
->
vfactor
/
100
.
0
f
:
ch
->
vdiv
*
ch
->
vfactor
*
10
.
0
f
;
ctx
->
channel_vpos
[
i
]
=
ch
->
vdiv
*
ch
->
vfactor
>=
500
?
ch
->
vpos
/
1000
:
ch
->
vpos
;
i
++
;
...
...
@@ -217,7 +218,8 @@ static int receive(const struct sr_output *o, const struct sr_datafeed_packet *p
continue
;
g_string_append_printf
(
*
out
,
"%0.10g"
,
(
ctx
->
index
-
1
)
*
1
.
0
/
ctx
->
samplerate
);
for
(
j
=
0
;
j
<
ctx
->
num_enabled_channels
;
j
++
)
{
idx
=
ctx
->
channel_index
[
j
];
//idx = ctx->channel_index[j];
idx
=
j
;
p
=
logic
->
data
+
i
+
idx
/
8
;
c
=
*
p
&
(
1
<<
(
idx
%
8
));
g_string_append_c
(
*
out
,
ctx
->
separator
);
...
...
This diff is collapsed.
Click to expand it.
libsigrok4DSL/output/gnuplot.c
View file @
0b9fe223
...
...
@@ -191,11 +191,12 @@ static int receive(const struct sr_output *o, const struct sr_datafeed_packet *p
memcpy
(
ctx
->
prevsample
,
sample
,
logic
->
unitsize
);
/* The first column is a counter (needed for gnuplot). */
g_string_append_printf
(
*
out
,
"%"
PRIu64
"
\t
"
,
ctx
->
samplecount
);
g_string_append_printf
(
*
out
,
"%"
PRIu64
"
\t
"
,
ctx
->
samplecount
-
1
);
/* The next columns are the values of all channels. */
for
(
p
=
0
;
p
<
ctx
->
num_enabled_channels
;
p
++
)
{
idx
=
ctx
->
channel_index
[
p
];
//idx = ctx->channel_index[p];
idx
=
p
;
curbit
=
(
sample
[
idx
/
8
]
&
((
uint8_t
)
(
1
<<
(
idx
%
8
))))
>>
(
idx
%
8
);
g_string_append_printf
(
*
out
,
"%d "
,
curbit
);
}
...
...
This diff is collapsed.
Click to expand it.
libsigrok4DSL/output/vcd.c
View file @
0b9fe223
...
...
@@ -201,7 +201,8 @@ static int receive(const struct sr_output *o, const struct sr_datafeed_packet *p
timestamp_written
=
FALSE
;
for
(
p
=
0
;
p
<
ctx
->
num_enabled_channels
;
p
++
)
{
index
=
ctx
->
channel_index
[
p
];
//index = ctx->channel_index[p];
index
=
p
;
curbit
=
((
unsigned
)
sample
[
index
/
8
]
>>
(
index
%
8
))
&
1
;
...
...
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