projects
/
pulseview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
67b0df2
)
AnalogSignal: Split up divs during autoranging if needed
author
Soeren Apel
<soeren@apelpie.net>
Mon, 13 Feb 2017 23:12:54 +0000
(
00:12
+0100)
committer
Uwe Hermann
<uwe@hermann-uwe.de>
Wed, 15 Feb 2017 11:12:52 +0000
(12:12 +0100)
pv/view/analogsignal.cpp
patch
|
blob
|
history
diff --git
a/pv/view/analogsignal.cpp
b/pv/view/analogsignal.cpp
index d9ac2f60afcf853d1b225a18c139854ec94ed824..2715a386bdf83a37d64e194063b86b23e8c552d8 100644
(file)
--- a/
pv/view/analogsignal.cpp
+++ b/
pv/view/analogsignal.cpp
@@
-389,6
+389,12
@@
void AnalogSignal::perform_autoranging(bool force_update)
neg_vdivs_ = 0;
}
+ // Split up the divs if there are negative values but no negative divs
+ if ((min < 0) && (neg_vdivs_ == 0)) {
+ neg_vdivs_ = pos_vdivs_ / 2;
+ pos_vdivs_ -= neg_vdivs_;
+ }
+
double min_value_per_div;
if ((pos_vdivs_ > 0) && (neg_vdivs_ > 0))
min_value_per_div = std::max(max / pos_vdivs_, -min / neg_vdivs_);