diff options
Diffstat (limited to 'widgets/fastgraph.cpp')
| -rw-r--r-- | widgets/fastgraph.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/widgets/fastgraph.cpp b/widgets/fastgraph.cpp index 9efe5fc6..c9eddd01 100644 --- a/widgets/fastgraph.cpp +++ b/widgets/fastgraph.cpp @@ -6,6 +6,7 @@ #include <QKeyEvent> #include "fastplot.h" #include "SettingsGroup.hpp" +#include "PerformanceTrace.hpp" #include "ui_fastgraph.h" #include "moc_fastgraph.cpp" @@ -20,6 +21,7 @@ FastGraph::FastGraph(QSettings * settings, QWidget *parent) : m_ave {40}, ui {new Ui::FastGraph} { + PerformanceTrace::Phase construction {"fastgraph.construct"}; ui->setupUi(this); setWindowTitle (QApplication::applicationName () + " - " + tr ("Fast Graph")); installEventFilter(parent); //Installing the filter @@ -98,7 +100,11 @@ void FastGraph::on_pbAutoLevel_clicked() for(int i=0; i<=fast_jh; i++) { sum += fast_green[i]; } - m_ave=sum/fast_jh; + if (fast_jh == 0) { + m_ave=0.0; + } else { + m_ave=sum/fast_jh; + } ui->gainSlider->setValue(127-int(2.2*m_ave)); ui->zeroSlider->setValue(int(m_ave)+20); ui->greenZeroSlider->setValue(160-int(3.3*m_ave)); |
