forked from Ivasoft/DSView
fix save/export issue when sample depth greater than 4G, or part of channels enabled
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -37,7 +37,7 @@ StoreProgress::StoreProgress(SigSession &session, QWidget *parent) :
|
||||
|
||||
_info.setText("...");
|
||||
_progress.setValue(0);
|
||||
_progress.setMaximum(0);
|
||||
_progress.setMaximum(100);
|
||||
|
||||
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()) {
|
||||
|
||||
Reference in New Issue
Block a user