diff --git a/DSView/pv/data/decoderstack.cpp b/DSView/pv/data/decoderstack.cpp index f6a816fac73356d1fcfa3b2ab41d9a8e288b198d..8e6a80396d4a116b8af186334db84f998e6dff8a 100644 --- a/DSView/pv/data/decoderstack.cpp +++ b/DSView/pv/data/decoderstack.cpp @@ -50,7 +50,7 @@ const int64_t DecoderStack::DecodeChunkLength = 4 * 1024; //const int64_t DecoderStack::DecodeChunkLength = 1024 * 1024; const unsigned int DecoderStack::DecodeNotifyPeriod = 1024; -mutex DecoderStack::_global_decode_mutex; +boost::mutex DecoderStack::_global_decode_mutex; DecoderStack::DecoderStack(pv::SigSession &session, const srd_decoder *const dec) : @@ -179,7 +179,7 @@ void DecoderStack::build_row() int64_t DecoderStack::samples_decoded() const { - lock_guard decode_lock(_output_mutex); + boost::lock_guard decode_lock(_output_mutex); return _samples_decoded; } @@ -289,7 +289,7 @@ bool DecoderStack::has_annotations(const Row &row) const uint64_t DecoderStack::list_annotation_size() const { - lock_guard lock(_output_mutex); + boost::lock_guard lock(_output_mutex); uint64_t max_annotation_size = 0; for (map::const_iterator i = _rows.begin(); i != _rows.end(); i++) { @@ -555,7 +555,7 @@ void DecoderStack::decode_data( } { - lock_guard lock(_output_mutex); + boost::lock_guard lock(_output_mutex); _samples_decoded = i - decode_start + 1; } @@ -572,7 +572,7 @@ void DecoderStack::decode_data( void DecoderStack::decode_proc() { - lock_guard decode_lock(_global_decode_mutex); + boost::lock_guard decode_lock(_global_decode_mutex); optional sample_count; srd_session *session; @@ -693,7 +693,7 @@ void DecoderStack::annotation_callback(srd_proto_data *pdata, void *decoder) } // Add the annotation - lock_guard lock(d->_output_mutex); + boost::lock_guard lock(d->_output_mutex); if (!(*row_iter).second.push_annotation(a)) d->_no_memory = true; } diff --git a/DSView/pv/data/logicsnapshot.cpp b/DSView/pv/data/logicsnapshot.cpp index 54448bc71da92f25aaeb2af273692819fd5945fb..d0cfec73390aee333b6f91a68a9cd40431b7d7b7 100644 --- a/DSView/pv/data/logicsnapshot.cpp +++ b/DSView/pv/data/logicsnapshot.cpp @@ -495,18 +495,22 @@ bool LogicSnapshot::get_sample(uint64_t index, int sig_index) int order = get_ch_order(sig_index); assert(order != -1); assert(_ch_data[order].size() != 0); - assert(index < get_sample_count()); + //assert(index < get_sample_count()); - uint64_t index_mask = 1ULL << (index & LevelMask[0]); - uint64_t root_index = index >> (LeafBlockPower + RootScalePower); - uint8_t root_pos = (index & RootMask) >> LeafBlockPower; - uint64_t root_pos_mask = 1ULL << root_pos; + if (index < get_sample_count()) { + uint64_t index_mask = 1ULL << (index & LevelMask[0]); + uint64_t root_index = index >> (LeafBlockPower + RootScalePower); + uint8_t root_pos = (index & RootMask) >> LeafBlockPower; + uint64_t root_pos_mask = 1ULL << root_pos; - if ((_ch_data[order][root_index].tog & root_pos_mask) == 0) { - return (_ch_data[order][root_index].value & root_pos_mask) != 0; + if ((_ch_data[order][root_index].tog & root_pos_mask) == 0) { + return (_ch_data[order][root_index].value & root_pos_mask) != 0; + } else { + uint64_t *lbp = (uint64_t *)_ch_data[order][root_index].lbp[root_pos]; + return *(lbp + ((index & LeafMask) >> ScalePower)) & index_mask; + } } else { - uint64_t *lbp = (uint64_t *)_ch_data[order][root_index].lbp[root_pos]; - return *(lbp + ((index & LeafMask) >> ScalePower)) & index_mask; + return false; } } diff --git a/DSView/pv/dialogs/about.cpp b/DSView/pv/dialogs/about.cpp index 85254ea3db8baec282f89d52be4956447c7d9ab8..bff14abbc0a5c7e7c0e9fee89bd24d6283b1b018 100644 --- a/DSView/pv/dialogs/about.cpp +++ b/DSView/pv/dialogs/about.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include "about.h" @@ -68,7 +69,9 @@ About::About(QWidget *parent) : QString filename = dir.absolutePath() + "/NEWS"; QFile news(filename); if (news.open(QIODevice::ReadOnly)) { + QTextCodec *code=QTextCodec::codecForName("UTF-8"); QTextStream stream(&news); + stream.setCodec(code); QString line; while (!stream.atEnd()){ line = stream.readLine(); diff --git a/DSView/pv/dialogs/search.cpp b/DSView/pv/dialogs/search.cpp index c1797197004ef61500e12e1d79a171a36c1ed8a0..8f8763ce3cdadab6c3dd24d660af22e3a88a84f3 100644 --- a/DSView/pv/dialogs/search.cpp +++ b/DSView/pv/dialogs/search.cpp @@ -56,8 +56,8 @@ Search::Search(QWidget *parent, SigSession &session, std::map boost::shared_ptr logic_sig; if (logic_sig = boost::dynamic_pointer_cast(sig)) { QLineEdit *search_lineEdit = new QLineEdit(this); - if (pattern.find(index) != pattern.end()) - search_lineEdit->setText(pattern[index]); + if (pattern.find(logic_sig->get_index()) != pattern.end()) + search_lineEdit->setText(pattern[logic_sig->get_index()]); else search_lineEdit->setText("X"); search_lineEdit->setValidator(value_validator); @@ -116,7 +116,7 @@ std::map Search::get_pattern() assert(sig); boost::shared_ptr logic_sig; if (logic_sig = boost::dynamic_pointer_cast(sig)) { - pattern[index] = _search_lineEdit_vec[index]->text(); + pattern[logic_sig->get_index()] = _search_lineEdit_vec[index]->text(); index++; } } diff --git a/DSView/pv/dock/triggerdock.cpp b/DSView/pv/dock/triggerdock.cpp index ee5ed628f6ea56fb61ddeaa9cfa94b8372cab20d..0e643669bc3b316f75f9ea781fd087e2966287e3 100644 --- a/DSView/pv/dock/triggerdock.cpp +++ b/DSView/pv/dock/triggerdock.cpp @@ -254,7 +254,7 @@ TriggerDock::TriggerDock(QWidget *parent, SigSession &session) : gLayout->addWidget(adv_radioButton, 1, 0); gLayout->addWidget(position_label, 2, 0); gLayout->addWidget(position_spinBox, 2, 1); - gLayout->addWidget(new QLabel(_widget), 2, 2); + gLayout->addWidget(new QLabel(tr("%"), _widget), 2, 2); gLayout->addWidget(position_slider, 3, 0, 1, 3); gLayout->addWidget(stages_label, 4, 0); gLayout->addWidget(stages_comboBox, 4, 1); diff --git a/DSView/pv/view/decodetrace.cpp b/DSView/pv/view/decodetrace.cpp index 34a7ae322403aed0d86cb286bf79c6d3787e9418..28f812ebd5ff464ed78505bc5edee9ecfc2fe7fb 100644 --- a/DSView/pv/view/decodetrace.cpp +++ b/DSView/pv/view/decodetrace.cpp @@ -301,7 +301,8 @@ void DecodeTrace::paint_mid(QPainter &p, int left, int right) const uint64_t max_annotation = _decoder_stack->get_max_annotation(row); const double max_annWidth = max_annotation / samples_per_pixel; - if ((max_annWidth > 10 && min_annWidth > 1) || + if ((max_annWidth > 100) || + (max_annWidth > 10 && min_annWidth > 1) || (max_annWidth == 0 && samples_per_pixel < 10)) { vector annotations; _decoder_stack->get_annotation_subset(annotations, row, diff --git a/DSView/pv/view/ruler.cpp b/DSView/pv/view/ruler.cpp index 797eb1414e2f61837de6b0fac5a29c90a9ddf407..9b06de28377055be9eba9430e97fd57bd45e38a0 100644 --- a/DSView/pv/view/ruler.cpp +++ b/DSView/pv/view/ruler.cpp @@ -297,6 +297,10 @@ void Ruler::mouseReleaseEvent(QMouseEvent *event) _curs_moved = false; _view.cursor_moved(); } + + if (_hitCursor && !_grabbed_marker) { + _hitCursor = false; + } } if (event->button() & Qt::RightButton) { diff --git a/DSView/pv/view/view.cpp b/DSView/pv/view/view.cpp index 0b85f2f8faeb75c6cc27f7714992cb6505bed945..6c9428238066f4c2050981812994b3f734037eaa 100644 --- a/DSView/pv/view/view.cpp +++ b/DSView/pv/view/view.cpp @@ -578,7 +578,7 @@ void View::update_scroll() } else { horizontalScrollBar()->setRange(0, MaxScrollValue); horizontalScrollBar()->setSliderPosition( - _offset * MaxScrollValue / length); + _offset * 1.0 / length * MaxScrollValue); } _updating_scroll = false; @@ -824,7 +824,7 @@ void View::h_scroll_value_changed(int value) int64_t length = 0; int64_t offset = 0; get_scroll_layout(length, offset); - _offset = floor(length * value / MaxScrollValue); + _offset = floor(value * 1.0 / MaxScrollValue * length); } _offset = max(min(_offset, get_max_offset()), get_min_offset()); diff --git a/libsigrok4DSL/hardware/DSL/dscope.c b/libsigrok4DSL/hardware/DSL/dscope.c index b37804f7cc0862e904bd455678dbf5a5f5b74331..3202de5b3c4562ce937c7b1f34ce59c847b1cdec 100644 --- a/libsigrok4DSL/hardware/DSL/dscope.c +++ b/libsigrok4DSL/hardware/DSL/dscope.c @@ -24,8 +24,6 @@ #include "dsl.h" #include "command.h" -#undef min -#define min(a,b) ((a)<(b)?(a):(b)) static struct sr_dev_mode mode_list[] = { {"OSC", DSO}, diff --git a/libsigrok4DSL/hardware/DSL/dslogic.c b/libsigrok4DSL/hardware/DSL/dslogic.c index 634ed53339789fb3672add6acbf7e16a69b07cdd..7d75df8a53fad24ff5b2a2cc76137e1308b00e0e 100755 --- a/libsigrok4DSL/hardware/DSL/dslogic.c +++ b/libsigrok4DSL/hardware/DSL/dslogic.c @@ -24,14 +24,6 @@ #include "dsl.h" #include "command.h" -#undef min -#define min(a,b) ((a)<(b)?(a):(b)) -#undef max -#define max(a,b) ((a)>(b)?(a):(b)) - -static const unsigned int single_buffer_time = 20; -static const unsigned int total_buffer_time = 100; -static const unsigned int instant_buffer_size = 1024 * 1024; static struct sr_dev_mode mode_list[] = { {"LA", LOGIC},