X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fview%2Fanalogsignal.cpp;h=31c482d6143ef545bc22315b2d16e5612c778918;hb=5ed05b699e5367bae21828f533e3d169b9bab348;hp=8f6027b7a52f990135fc54cbe0881b93fc4d1c0a;hpb=430b94aaa74cbbbf805803a013b77a4d1e18daaf;p=pulseview.git diff --git a/pv/view/analogsignal.cpp b/pv/view/analogsignal.cpp index 8f6027b..31c482d 100644 --- a/pv/view/analogsignal.cpp +++ b/pv/view/analogsignal.cpp @@ -608,13 +608,17 @@ void AnalogSignal::perform_autoranging(bool keep_divs, bool force_update) // If there is still no positive div when we need it, add one // (this can happen when pos_vdivs==neg_vdivs==0) - if ((max > 0) && (pos_vdivs_ == 0)) + if ((max > 0) && (pos_vdivs_ == 0)) { pos_vdivs_ = 1; + owner_->extents_changed(false, true); + } // If there is still no negative div when we need it, add one // (this can happen when pos_vdivs was 0 or 1 when trying to split) - if ((min < 0) && (neg_vdivs_ == 0)) + if ((min < 0) && (neg_vdivs_ == 0)) { neg_vdivs_ = 1; + owner_->extents_changed(false, true); + } double min_value_per_div; if ((pos_vdivs_ > 0) && (neg_vdivs_ > 0)) @@ -722,12 +726,6 @@ void AnalogSignal::populate_popup_form(QWidget *parent, QFormLayout *form) void AnalogSignal::on_samples_added() { perform_autoranging(false, false); - - if (owner_) { - // Call order is important, otherwise the lazy event handler won't work - owner_->extents_changed(false, true); - owner_->row_item_appearance_changed(false, true); - } } void AnalogSignal::on_pos_vdivs_changed(int vdivs) @@ -737,6 +735,13 @@ void AnalogSignal::on_pos_vdivs_changed(int vdivs) pos_vdivs_ = vdivs; + // There has to be at least one div, positive or negative + if ((neg_vdivs_ == 0) && (pos_vdivs_ == 0)) { + pos_vdivs_ = 1; + if (pvdiv_sb_) + pvdiv_sb_->setValue(pos_vdivs_); + } + if (autoranging_) { perform_autoranging(true, true); @@ -761,6 +766,13 @@ void AnalogSignal::on_neg_vdivs_changed(int vdivs) neg_vdivs_ = vdivs; + // There has to be at least one div, positive or negative + if ((neg_vdivs_ == 0) && (pos_vdivs_ == 0)) { + pos_vdivs_ = 1; + if (pvdiv_sb_) + pvdiv_sb_->setValue(pos_vdivs_); + } + if (autoranging_) { perform_autoranging(true, true);