Commit 39d8e84bc5a29e7b82df1661af548ee643e455c7
Committed by
David Graeff
1 parent
3802257a
glscope: allow to toggle cursor visibility
Showing
3 changed files
with
5 additions
and
1 deletions
openhantek/src/dsowidget.cpp
| @@ -115,6 +115,7 @@ DsoWidget::DsoWidget(DsoSettings *settings, DataAnalyzer *dataAnalyzer, QWidget | @@ -115,6 +115,7 @@ DsoWidget::DsoWidget(DsoSettings *settings, DataAnalyzer *dataAnalyzer, QWidget | ||
| 115 | this->markerSlider->setStep(marker, 0.2); | 115 | this->markerSlider->setStep(marker, 0.2); |
| 116 | this->markerSlider->setValue(marker, this->settings->scope.horizontal.marker[marker]); | 116 | this->markerSlider->setValue(marker, this->settings->scope.horizontal.marker[marker]); |
| 117 | this->markerSlider->setVisible(marker, true); | 117 | this->markerSlider->setVisible(marker, true); |
| 118 | + this->settings->scope.horizontal.marker_visible[marker] = true; | ||
| 118 | } | 119 | } |
| 119 | 120 | ||
| 120 | // The table for the settings | 121 | // The table for the settings |
openhantek/src/glscope.cpp
| @@ -156,6 +156,8 @@ void GlScope::paintGL() { | @@ -156,6 +156,8 @@ void GlScope::paintGL() { | ||
| 156 | this->qglColor(this->settings->view.color.screen.markers); | 156 | this->qglColor(this->settings->view.color.screen.markers); |
| 157 | 157 | ||
| 158 | for(int marker = 0; marker < MARKER_COUNT; ++marker) { | 158 | for(int marker = 0; marker < MARKER_COUNT; ++marker) { |
| 159 | + if (!this->settings->scope.horizontal.marker_visible[marker]) | ||
| 160 | + continue; | ||
| 159 | if(this->vaMarker[marker].size() != 4) { | 161 | if(this->vaMarker[marker].size() != 4) { |
| 160 | this->vaMarker[marker].resize(2 * 2); | 162 | this->vaMarker[marker].resize(2 * 2); |
| 161 | this->vaMarker[marker][1] = -DIVS_VOLTAGE; | 163 | this->vaMarker[marker][1] = -DIVS_VOLTAGE; |
openhantek/src/settings.h
| @@ -91,7 +91,8 @@ struct DsoSettingsOptions { | @@ -91,7 +91,8 @@ struct DsoSettingsOptions { | ||
| 91 | struct DsoSettingsScopeHorizontal { | 91 | struct DsoSettingsScopeHorizontal { |
| 92 | Dso::GraphFormat format; ///< Graph drawing mode of the scope | 92 | Dso::GraphFormat format; ///< Graph drawing mode of the scope |
| 93 | double frequencybase; ///< Frequencybase in Hz/div | 93 | double frequencybase; ///< Frequencybase in Hz/div |
| 94 | - double marker[2]; ///< Marker positions in div | 94 | + double marker[MARKER_COUNT]; ///< Marker positions in div |
| 95 | + bool marker_visible[MARKER_COUNT]; | ||
| 95 | double timebase; ///< Timebase in s/div | 96 | double timebase; ///< Timebase in s/div |
| 96 | unsigned int recordLength; ///< Sample count | 97 | unsigned int recordLength; ///< Sample count |
| 97 | double samplerate; ///< The samplerate of the oscilloscope in S | 98 | double samplerate; ///< The samplerate of the oscilloscope in S |