diff --git a/openhantek/ChangeLog b/openhantek/ChangeLog index 1f1333f..795e9ee 100644 --- a/openhantek/ChangeLog +++ b/openhantek/ChangeLog @@ -23,4 +23,8 @@ * DsoControl class could control non-Hantek DSOs too * Added reference level and minimum magnitude for spectrum analysis to settings * Made lower timebases available -* Spectrum and math graphs can be shown without enabling the voltage graph too \ No newline at end of file +* Spectrum and math graphs can be shown without enabling the voltage graph too + +2010-08-06 Oliver Haag +* Bugfix: Mode shown below scope instead of coupling for the math channel +* Documentation updated \ No newline at end of file diff --git a/openhantek/mainpage.dox b/openhantek/mainpage.dox index 9cee388..dfcbdcf 100644 --- a/openhantek/mainpage.dox +++ b/openhantek/mainpage.dox @@ -3,7 +3,7 @@ \mainpage OpenHantek Developer Documentation \section sec_introduction Introduction -OpenHantek is a free software for Hantek (Voltcraft/Darkwire/Protek/Acetech) USB DSOs based on HantekDSO. The UI is written in C++/Qt 4 and uses OpenGL to draw the graphs. +OpenHantek is a free software for %Hantek (Voltcraft/Darkwire/Protek/Acetech) USB DSOs based on HantekDSO. The UI is written in C++/Qt 4 and uses OpenGL to draw the graphs. \section sec_compiling Compiling from source \subsection ssec_dependencies Dependencies diff --git a/openhantek/src/colorbox.h b/openhantek/src/colorbox.h index 789f711..66808d4 100644 --- a/openhantek/src/colorbox.h +++ b/openhantek/src/colorbox.h @@ -51,7 +51,7 @@ class ColorBox : public QPushButton { QColor color; signals: - void colorChanged(QColor color); + void colorChanged(QColor color); ///< The color has been changed }; diff --git a/openhantek/src/configdialog.h b/openhantek/src/configdialog.h index bd05ef6..beede76 100644 --- a/openhantek/src/configdialog.h +++ b/openhantek/src/configdialog.h @@ -41,9 +41,9 @@ #define CONFIG_FILE "HKEY_CURRENT_USER\\Software\\paranoiacs.net\\OpenHantek" #endif*/ -#define CONFIG_LIST_WIDTH 128 -#define CONFIG_LIST_ITEMHEIGHT 80 -#define CONFIG_LIST_ICONSIZE 48 +#define CONFIG_LIST_WIDTH 128 ///< The width of the page selection widget +#define CONFIG_LIST_ITEMHEIGHT 80 ///< The height of one item in the page selection widget +#define CONFIG_LIST_ICONSIZE 48 ///< The icon size in the page selection widget class DsoConfigAnalysisPage; diff --git a/openhantek/src/constants.h b/openhantek/src/constants.h index 4d1cef8..8482931 100644 --- a/openhantek/src/constants.h +++ b/openhantek/src/constants.h @@ -45,16 +45,6 @@ namespace Dso { }; ////////////////////////////////////////////////////////////////////////////// - /// \enum ChannelType constants.h - /// \brief All channels that can be displayed. - /// \todo Get rid of this enum, get the channel count from the oscilloscope - /*enum ChannelType { - CHANNELTYPE_CH, ///< First real channel - CHANNELTYPE_MATH = PHYS_CHANNEL_COUNT, ///< The math channel - CHANNEL_COUNT ///< The total number of channels - };*/ - - ////////////////////////////////////////////////////////////////////////////// /// \enum GraphFormat constants.h /// \brief The possible viewing formats for the graphs on the scope. enum GraphFormat { diff --git a/openhantek/src/dataanalyzer.cpp b/openhantek/src/dataanalyzer.cpp index 3966789..5723f11 100644 --- a/openhantek/src/dataanalyzer.cpp +++ b/openhantek/src/dataanalyzer.cpp @@ -40,7 +40,7 @@ //////////////////////////////////////////////////////////////////////////////// // class HorizontalDock /// \brief Initializes the buffers and other variables. -/// \param settings The target settings object. +/// \param settings The settings that should be used. /// \param parent The parent widget. DataAnalyzer::DataAnalyzer(DsoSettings *settings, QObject *parent) : QThread(parent) { this->settings = settings; @@ -359,6 +359,11 @@ void DataAnalyzer::run() { this->analyzedDataMutex->unlock(); } +/// \brief Starts the analyzing of new input data. +/// \param data The data arrays with the input data. +/// \param size The sizes of the data arrays. +/// \param samplerate The samplerate for all input data. +/// \param mutex The mutex for all input data. void DataAnalyzer::analyze(const QList *data, const QList *size, double samplerate, QMutex *mutex) { // Previous analysis still running, drop the new data if(this->isRunning()) diff --git a/openhantek/src/dataanalyzer.h b/openhantek/src/dataanalyzer.h index cb69d06..a55507c 100644 --- a/openhantek/src/dataanalyzer.h +++ b/openhantek/src/dataanalyzer.h @@ -43,31 +43,33 @@ class QMutex; /// \struct SampleValues dataanalyzer.h /// \brief Struct for a array of sample values. struct SampleValues { - double *sample; - unsigned int count; - double interval; + double *sample; ///< Pointer to the array holding the sampling data + unsigned int count; ///< Number of sample values + double interval; ///< The interval between two sample values }; //////////////////////////////////////////////////////////////////////////////// /// \struct SampleData dataanalyzer.h /// \brief Struct for the sample value arrays. struct SampleData { - SampleValues voltage, spectrum; + SampleValues voltage; ///< The time-domain voltage levels (V) + SampleValues spectrum; ///< The frequency-domain power levels (dB) }; //////////////////////////////////////////////////////////////////////////////// /// \struct AnalyzedData dataanalyzer.h /// \brief Struct for the analyzed data. struct AnalyzedData { - SampleData samples; - double frequency, amplitude; + SampleData samples; ///< Voltage and spectrum values + double frequency; ///< The frequency of the signal + double amplitude; ///< The amplitude of the signal }; //////////////////////////////////////////////////////////////////////////////// /// \class DataAnalyzer dataanalyzer.h /// \brief Analyzes the data from the dso. -/// Converts the levels into volts, calculates the spectrum and saves offsets -/// and the time-/frequencysteps between two values. +/// Calculates the spectrum and various data about the signal and saves the +/// time-/frequencysteps between two values. class DataAnalyzer : public QThread { Q_OBJECT @@ -80,21 +82,20 @@ class DataAnalyzer : public QThread { protected: void run(); - - private: - DsoSettings *settings; - QList analyzedData; - QMutex *analyzedDataMutex; + DsoSettings *settings; ///< The settings provided by the parent class + + QList analyzedData; ///< The analyzed data for each channel + QMutex *analyzedDataMutex; ///< A mutex for the analyzed data of all channels - unsigned int lastBufferSize; - Dso::WindowFunction lastWindow; - double *window; + unsigned int lastBufferSize; ///< The buffer size of the previously analyzed data + Dso::WindowFunction lastWindow; ///< The previously used dft window function + double *window; ///< The array for the dft window factors - QList waitingData; - QList waitingDataSize; - double waitingDataSamplerate; - QMutex *waitingDataMutex; + QList waitingData; ///< Pointer to input data from device + QList waitingDataSize; ///< Number of input data samples + double waitingDataSamplerate; ///< The samplerate of the input data + QMutex *waitingDataMutex; ///< A mutex for the input data public slots: void analyze(const QList *data, const QList *size, double samplerate, QMutex *mutex); diff --git a/openhantek/src/dockwindows.cpp b/openhantek/src/dockwindows.cpp index d3c08f5..4b962fe 100644 --- a/openhantek/src/dockwindows.cpp +++ b/openhantek/src/dockwindows.cpp @@ -174,6 +174,7 @@ void HorizontalDock::formatSelected(int index) { // class TriggerDock /// \brief Initializes the trigger settings docking window. /// \param settings The target settings object. +/// \param specialTriggers The names of the special trigger sources. /// \param parent The parent widget. /// \param flags Flags for the window manager. TriggerDock::TriggerDock(DsoSettings *settings, const QStringList *specialTriggers, QWidget *parent, Qt::WindowFlags flags) : QDockWidget(tr("Trigger"), parent, flags) { diff --git a/openhantek/src/dockwindows.h b/openhantek/src/dockwindows.h index 8714d36..9387249 100644 --- a/openhantek/src/dockwindows.h +++ b/openhantek/src/dockwindows.h @@ -58,15 +58,22 @@ class HorizontalDock : public QDockWidget { protected: void closeEvent(QCloseEvent *event); - QGridLayout *dockLayout; - QWidget *dockWidget; - QLabel *timebaseLabel, *frequencybaseLabel, *formatLabel; - QComboBox *timebaseComboBox, *frequencybaseComboBox, *formatComboBox; - - DsoSettings *settings; - - QList frequencybaseSteps, timebaseSteps; - QStringList frequencybaseStrings, timebaseStrings, formatStrings; + QGridLayout *dockLayout; ///< The main layout for the dock window + QWidget *dockWidget; ///< The main widget for the dock window + QLabel *timebaseLabel; ///< The label for the timebase combobox + QLabel *frequencybaseLabel; ///< The label for the frequencybase combobox + QLabel *formatLabel; ///< The label for the format combobox + QComboBox *timebaseComboBox; ///< Selects the timebase for voltage graphs + QComboBox *frequencybaseComboBox; ///< Selects the frequencybase for spectrum graphs + QComboBox *formatComboBox; ///< Selects the way the sampled data is interpreted and shown + + DsoSettings *settings; ///< The settings provided by the parent class + + QList frequencybaseSteps; ///< The selectable steps for the frequencybase + QList timebaseSteps; ///< The selectable steps for the timebase + QStringList frequencybaseStrings; ///< String representations for the frequencybase steps + QStringList timebaseStrings; ///< String representations for the timebase steps + QStringList formatStrings; ///< Strings for the formats protected slots: void frequencybaseSelected(int index); @@ -74,9 +81,9 @@ class HorizontalDock : public QDockWidget { void formatSelected(int index); signals: - void frequencybaseChanged(double frequencybase); - void timebaseChanged(double timebase); - void formatChanged(Dso::GraphFormat format); + void frequencybaseChanged(double frequencybase); ///< The frequencybase has been changed + void timebaseChanged(double timebase); ///< The timebase has been changed + void formatChanged(Dso::GraphFormat format); ///< The viewing format has been changed }; @@ -98,14 +105,21 @@ class TriggerDock : public QDockWidget { protected: void closeEvent(QCloseEvent *event); - QGridLayout *dockLayout; - QWidget *dockWidget; - QLabel *modeLabel, *sweepLabel, *sourceLabel, *slopeLabel; - QComboBox *modeComboBox, *sweepComboBox, *sourceComboBox, *slopeComboBox; + QGridLayout *dockLayout; ///< The main layout for the dock window + QWidget *dockWidget; ///< The main widget for the dock window + QLabel *modeLabel; ///< The label for the trigger mode combobox + QLabel *sourceLabel; ///< The label for the trigger source combobox + QLabel *slopeLabel; ///< The label for the trigger slope combobox + QComboBox *modeComboBox; ///< Select the triggering mode + QComboBox *sourceComboBox; ///< Select the source for triggering + QComboBox *slopeComboBox; ///< Select the slope that causes triggering - DsoSettings *settings; + DsoSettings *settings; ///< The settings provided by the parent class - QStringList modeStrings, sourceStandardStrings, sourceSpecialStrings, slopeStrings; + QStringList modeStrings; ///< Strings for the trigger modes + QStringList sourceStandardStrings; ///< Strings for the standard trigger sources + QStringList sourceSpecialStrings; ///< Strings for the special trigger sources + QStringList slopeStrings; ///< Strings for the trigger slopes protected slots: void modeSelected(int index); @@ -113,9 +127,9 @@ class TriggerDock : public QDockWidget { void sourceSelected(int index); signals: - void modeChanged(Dso::TriggerMode); - void sourceChanged(bool special, unsigned int id); - void slopeChanged(Dso::Slope); + void modeChanged(Dso::TriggerMode); ///< The trigger mode has been changed + void sourceChanged(bool special, unsigned int id); ///< The trigger source has been changed + void slopeChanged(Dso::Slope); ///< The trigger slope has been changed }; @@ -139,17 +153,18 @@ class VoltageDock : public QDockWidget { protected: void closeEvent(QCloseEvent *event); - QGridLayout *dockLayout; - QWidget *dockWidget; - QList usedCheckBox; - QList gainComboBox, miscComboBox; + QGridLayout *dockLayout; ///< The main layout for the dock window + QWidget *dockWidget; ///< The main widget for the dock window + QList usedCheckBox; ///< Enable/disable a specific channel + QList gainComboBox; ///< Select the vertical gain for the channels + QList miscComboBox; ///< Select coupling for real and mode for math channels - DsoSettings *settings; + DsoSettings *settings; ///< The settings provided by the parent class - QStringList couplingStrings; - QStringList modeStrings; - QList gainSteps; - QStringList gainStrings; + QStringList couplingStrings; ///< The strings for the couplings + QStringList modeStrings; ///< The strings for the math mode + QList gainSteps; ///< The selectable gain steps + QStringList gainStrings; ///< String representations for the gain steps protected slots: void gainSelected(int index); @@ -157,10 +172,10 @@ class VoltageDock : public QDockWidget { void usedSwitched(bool checked); signals: - void couplingChanged(unsigned int channel, Dso::Coupling coupling); - void gainChanged(unsigned int channel, double gain); - void modeChanged(Dso::MathMode mode); - void usedChanged(unsigned int channel, bool used); + void couplingChanged(unsigned int channel, Dso::Coupling coupling); ///< A coupling has been selected + void gainChanged(unsigned int channel, double gain); ///< A gain has been selected + void modeChanged(Dso::MathMode mode); ///< The mode for the math channels has been changed + void usedChanged(unsigned int channel, bool used); ///< A channel has been enabled/disabled }; @@ -182,23 +197,23 @@ class SpectrumDock : public QDockWidget { protected: void closeEvent(QCloseEvent *event); - QGridLayout *dockLayout; - QWidget *dockWidget; - QList usedCheckBox; - QList magnitudeComboBox; + QGridLayout *dockLayout; ///< The main layout for the dock window + QWidget *dockWidget; ///< The main widget for the dock window + QList usedCheckBox; ///< Enable/disable spectrum for a channel + QList magnitudeComboBox; ///< Select the vertical magnitude for the spectrums - DsoSettings *settings; + DsoSettings *settings; ///< The settings provided by the parent class - QList magnitudeSteps; - QStringList magnitudeStrings; + QList magnitudeSteps; ///< The selectable magnitude steps + QStringList magnitudeStrings; ///< String representations for the magnitude steps public slots: void magnitudeSelected(int index); void usedSwitched(bool checked); signals: - void magnitudeChanged(unsigned int channel, double magnitude); - void usedChanged(unsigned int channel, bool used); + void magnitudeChanged(unsigned int channel, double magnitude); ///< A magnitude has been selected + void usedChanged(unsigned int channel, bool used); ///< A spectrum has been enabled/disabled }; diff --git a/openhantek/src/dsocontrol.h b/openhantek/src/dsocontrol.h index 86c111a..32436b7 100644 --- a/openhantek/src/dsocontrol.h +++ b/openhantek/src/dsocontrol.h @@ -49,7 +49,7 @@ class DsoControl : public QThread { virtual void startSampling(); virtual void stopSampling(); - virtual unsigned int getChannelCount() = 0; + virtual unsigned int getChannelCount() = 0; ///< Get the number of channels for this oscilloscope const QStringList *getSpecialTriggerSources(); @@ -60,28 +60,28 @@ class DsoControl : public QThread { QStringList specialTriggerSources; ///< Names of the special trigger sources signals: - void deviceConnected(); - void deviceDisconnected(); - void statusMessage(const QString &message, int timeout); - void samplesAvailable(const QList *data, const QList *size, double samplerate, QMutex *mutex); + void deviceConnected(); ///< The oscilloscope device has been disconnected + void deviceDisconnected(); ///< The oscilloscope device has been connected + void statusMessage(const QString &message, int timeout); ///< Status message about the oscilloscope + void samplesAvailable(const QList *data, const QList *size, double samplerate, QMutex *mutex); ///< New sample data is available public slots: virtual void connectDevice(); virtual void disconnectDevice(); - virtual unsigned long int setSamplerate(unsigned long int samplerate) = 0; - virtual double setBufferSize(unsigned int size) = 0; + virtual unsigned long int setSamplerate(unsigned long int samplerate) = 0; ///< Set the samplerate that should be met + virtual double setBufferSize(unsigned int size) = 0; ///< Set the needed buffer size - virtual int setTriggerMode(Dso::TriggerMode mode) = 0; - virtual int setTriggerSource(bool special, unsigned int id) = 0; - virtual double setTriggerLevel(unsigned int channel, double level) = 0; - virtual int setTriggerSlope(Dso::Slope slope) = 0; - virtual double setTriggerPosition(double position) = 0; + virtual int setTriggerMode(Dso::TriggerMode mode) = 0; ///< Set the trigger mode + virtual int setTriggerSource(bool special, unsigned int id) = 0; ///< Set the trigger source + virtual double setTriggerLevel(unsigned int channel, double level) = 0; ///< Set the trigger level for a channel + virtual int setTriggerSlope(Dso::Slope slope) = 0; ///< Set the slope that causes triggering + virtual double setTriggerPosition(double position) = 0; ///< Set the pretrigger position (0.0 = left, 1.0 = right side) - virtual int setChannelUsed(unsigned int channel, bool used) = 0; - virtual int setCoupling(unsigned int channel, Dso::Coupling coupling) = 0; - virtual double setGain(unsigned int channel, double gain) = 0; - virtual double setOffset(unsigned int channel, double offset) = 0; + virtual int setChannelUsed(unsigned int channel, bool used) = 0; ///< Enable/disable a channel + virtual int setCoupling(unsigned int channel, Dso::Coupling coupling) = 0; ///< Set the coupling for a channel + virtual double setGain(unsigned int channel, double gain) = 0; ///< Set the gain for a channel + virtual double setOffset(unsigned int channel, double offset) = 0; ///< Set the graph offset of a channel }; diff --git a/openhantek/src/dsowidget.cpp b/openhantek/src/dsowidget.cpp index 5f66a6e..52ab8ea 100644 --- a/openhantek/src/dsowidget.cpp +++ b/openhantek/src/dsowidget.cpp @@ -42,6 +42,7 @@ // class DsoWidget /// \brief Initializes the components of the oszilloscope-screen. /// \param settings The settings object containing the oscilloscope settings. +/// \param dataAnalyzer The data analyzer that should be used as data source. /// \param parent The parent widget. /// \param flags Flags for the window manager. DsoWidget::DsoWidget(DsoSettings *settings, DataAnalyzer *dataAnalyzer, QWidget *parent, Qt::WindowFlags flags) : QWidget(parent, flags) { @@ -167,8 +168,8 @@ DsoWidget::DsoWidget(DsoSettings *settings, DataAnalyzer *dataAnalyzer, QWidget tablePalette.setColor(QPalette::WindowText, this->settings->view.color.screen.voltage[channel]); this->measurementNameLabel.append(new QLabel(this->settings->scope.voltage[channel].name)); this->measurementNameLabel[channel]->setPalette(tablePalette); - this->measurementCouplingLabel.append(new QLabel()); - this->measurementCouplingLabel[channel]->setPalette(tablePalette); + this->measurementMiscLabel.append(new QLabel()); + this->measurementMiscLabel[channel]->setPalette(tablePalette); this->measurementGainLabel.append(new QLabel()); this->measurementGainLabel[channel]->setAlignment(Qt::AlignRight); this->measurementGainLabel[channel]->setPalette(tablePalette); @@ -184,12 +185,15 @@ DsoWidget::DsoWidget(DsoSettings *settings, DataAnalyzer *dataAnalyzer, QWidget this->measurementFrequencyLabel[channel]->setPalette(palette); this->setMeasurementVisible(channel, this->settings->scope.voltage[channel].used); this->measurementLayout->addWidget(this->measurementNameLabel[channel], channel, 0); - this->measurementLayout->addWidget(this->measurementCouplingLabel[channel], channel, 1); + this->measurementLayout->addWidget(this->measurementMiscLabel[channel], channel, 1); this->measurementLayout->addWidget(this->measurementGainLabel[channel], channel, 2); this->measurementLayout->addWidget(this->measurementMagnitudeLabel[channel], channel, 3); this->measurementLayout->addWidget(this->measurementAmplitudeLabel[channel], channel, 4); this->measurementLayout->addWidget(this->measurementFrequencyLabel[channel], channel, 5); - this->updateVoltageCoupling(channel); + if((unsigned int) channel < this->settings->scope.physicalChannels) + this->updateVoltageCoupling(channel); + else + this->updateMathMode(); this->updateVoltageDetails(channel); this->updateSpectrumDetails(channel); } @@ -256,7 +260,7 @@ void DsoWidget::adaptTriggerLevelSlider(unsigned int channel) { /// \brief Show/Hide a line of the measurement table. void DsoWidget::setMeasurementVisible(unsigned int channel, bool visible) { this->measurementNameLabel[channel]->setVisible(visible); - this->measurementCouplingLabel[channel]->setVisible(visible); + this->measurementMiscLabel[channel]->setVisible(visible); this->measurementGainLabel[channel]->setVisible(visible); this->measurementMagnitudeLabel[channel]->setVisible(visible); this->measurementAmplitudeLabel[channel]->setVisible(visible); @@ -371,8 +375,6 @@ void DsoWidget::updateTriggerSlope() { } /// \brief Handles sourceChanged signal from the trigger dock. -/// \param special true for a special channel (EXT, ...) as trigger source. -/// \param id The number of the channel, that should be used as trigger. void DsoWidget::updateTriggerSource() { // Change the colors of the trigger sliders if(this->settings->scope.trigger.special || this->settings->scope.trigger.source >= this->settings->scope.physicalChannels) @@ -386,7 +388,7 @@ void DsoWidget::updateTriggerSource() { this->updateTriggerDetails(); } -/// \brief Handles couplingChanged signal from the vertical dock. +/// \brief Handles couplingChanged signal from the voltage dock. /// \param channel The channel whose coupling was changed. void DsoWidget::updateVoltageCoupling(unsigned int channel) { if(channel >= (unsigned int) this->settings->scope.voltage.count()) @@ -395,19 +397,36 @@ void DsoWidget::updateVoltageCoupling(unsigned int channel) { if(this->settings->scope.voltage[channel].used || this->settings->scope.spectrum[channel].used) { switch(this->settings->scope.voltage[channel].misc) { case Dso::COUPLING_AC: - this->measurementCouplingLabel[channel]->setText(tr("AC")); + this->measurementMiscLabel[channel]->setText(tr("AC")); break; case Dso::COUPLING_DC: - this->measurementCouplingLabel[channel]->setText(tr("DC")); + this->measurementMiscLabel[channel]->setText(tr("DC")); break; case Dso::COUPLING_GND: - this->measurementCouplingLabel[channel]->setText(tr("GND")); + this->measurementMiscLabel[channel]->setText(tr("GND")); break; } } } -/// \brief Handles gainChanged signal from the vertical dock. +/// \brief Handles modeChanged signal from the voltage dock. +void DsoWidget::updateMathMode() { + if(this->settings->scope.voltage[this->settings->scope.physicalChannels].used || this->settings->scope.spectrum[this->settings->scope.physicalChannels].used) { + switch(this->settings->scope.voltage[this->settings->scope.physicalChannels].misc) { + case Dso::MATHMODE_1ADD2: + this->measurementMiscLabel[this->settings->scope.physicalChannels]->setText(tr("CH1 + CH2")); + break; + case Dso::MATHMODE_1SUB2: + this->measurementMiscLabel[this->settings->scope.physicalChannels]->setText(tr("CH1 - CH2")); + break; + case Dso::MATHMODE_2SUB1: + this->measurementMiscLabel[this->settings->scope.physicalChannels]->setText(tr("CH2 - CH1")); + break; + } + } +} + +/// \brief Handles gainChanged signal from the voltage dock. /// \param channel The channel whose gain was changed. void DsoWidget::updateVoltageGain(unsigned int channel) { if(channel >= (unsigned int) this->settings->scope.voltage.count()) @@ -419,7 +438,7 @@ void DsoWidget::updateVoltageGain(unsigned int channel) { this->updateVoltageDetails(channel); } -/// \brief Handles usedChanged signal from the vertical dock. +/// \brief Handles usedChanged signal from the voltage dock. /// \param channel The channel whose used-state was changed. /// \param used The new used-state for the channel. void DsoWidget::updateVoltageUsed(unsigned int channel, bool used) { @@ -434,7 +453,6 @@ void DsoWidget::updateVoltageUsed(unsigned int channel, bool used) { } /// \brief Change the buffer size. -/// \param size The size of the buffer. void DsoWidget::updateBufferSize() { this->settingsBufferLabel->setText(tr("%1 S").arg(this->settings->scope.horizontal.samples)); } @@ -531,7 +549,7 @@ void DsoWidget::updateTriggerPosition(int index, double value) { } /// \brief Handles valueChanged signal from the trigger level slider. -/// \param index The index of the slider. +/// \param channel The index of the slider. /// \param value The new trigger level. void DsoWidget::updateTriggerLevel(int channel, double value) { this->settings->scope.voltage[channel].trigger = value; diff --git a/openhantek/src/dsowidget.h b/openhantek/src/dsowidget.h index 316dc17..da6881a 100644 --- a/openhantek/src/dsowidget.h +++ b/openhantek/src/dsowidget.h @@ -58,32 +58,40 @@ class DsoWidget : public QWidget { void updateTriggerDetails(); void updateVoltageDetails(unsigned int channel); - QGridLayout *mainLayout; - GlGenerator *generator; - GlScope *mainScope, *zoomScope; - LevelSlider *offsetSlider; - LevelSlider *triggerPositionSlider, *triggerLevelSlider; - LevelSlider *markerSlider; + QGridLayout *mainLayout; ///< The main layout for this widget + GlGenerator *generator; ///< The generator for the OpenGL vertex arrays + GlScope *mainScope; ///< The main scope screen + GlScope *zoomScope; ///< The optional magnified scope screen + LevelSlider *offsetSlider; ///< The sliders for the graph offsets + LevelSlider *triggerPositionSlider; ///< The slider for the pretrigger + LevelSlider *triggerLevelSlider; ///< The sliders for the trigger level + LevelSlider *markerSlider; ///< The sliders for the markers - QHBoxLayout *settingsLayout; - QLabel *settingsTriggerLabel; - QLabel *settingsBufferLabel, *settingsRateLabel; - QLabel *settingsTimebaseLabel, *settingsFrequencybaseLabel; + QHBoxLayout *settingsLayout; ///< The table for the settings info + QLabel *settingsTriggerLabel; ///< The trigger details + QLabel *settingsBufferLabel; ///< The buffer size + QLabel *settingsRateLabel; ///< The samplerate + QLabel *settingsTimebaseLabel; ///< The timebase of the main scope + QLabel *settingsFrequencybaseLabel; ///< The frequencybase of the main scope - QHBoxLayout *markerLayout; - QLabel *markerInfoLabel; - QLabel *markerTimeLabel, *markerFrequencyLabel; - QLabel *markerTimebaseLabel, *markerFrequencybaseLabel; + QHBoxLayout *markerLayout; ///< The table for the marker details + QLabel *markerInfoLabel; ///< The info about the zoom factor + QLabel *markerTimeLabel; ///< The time period between the markers + QLabel *markerFrequencyLabel; ///< The frequency for the time period + QLabel *markerTimebaseLabel; ///< The timebase for the zoomed scope + QLabel *markerFrequencybaseLabel; ///< The frequencybase for the zoomed scope - QGridLayout *measurementLayout; - QList measurementNameLabel; - QList measurementGainLabel, measurementMagnitudeLabel; - QList measurementCouplingLabel; - QList measurementAmplitudeLabel, measurementFrequencyLabel; + QGridLayout *measurementLayout; ///< The table for the signal details + QList measurementNameLabel; ///< The name of the channel + QList measurementGainLabel; ///< The gain for the voltage (V/div) + QList measurementMagnitudeLabel; ///< The magnitude for the spectrum (dB/div) + QList measurementMiscLabel; ///< Coupling or math mode + QList measurementAmplitudeLabel; ///< Amplitude of the signal (V) + QList measurementFrequencyLabel; ///< Frequency of the signal (Hz) - DsoSettings *settings; + DsoSettings *settings; ///< The settings provided by the main window - DataAnalyzer *dataAnalyzer; + DataAnalyzer *dataAnalyzer; ///< The data source provided by the main window public slots: // Horizontal axis @@ -103,6 +111,7 @@ class DsoWidget : public QWidget { // Vertical axis void updateVoltageCoupling(unsigned int channel); + void updateMathMode(); void updateVoltageGain(unsigned int channel); void updateVoltageUsed(unsigned int channel, bool used); @@ -128,10 +137,10 @@ class DsoWidget : public QWidget { signals: // Sliders - void offsetChanged(unsigned int channel, double value); - void triggerPositionChanged(double value); - void triggerLevelChanged(unsigned int channel, double value); - void markerChanged(unsigned int marker, double value); + void offsetChanged(unsigned int channel, double value); ///< A graph offset has been changed + void triggerPositionChanged(double value); ///< The pretrigger has been changed + void triggerLevelChanged(unsigned int channel, double value); ///< A trigger level has been changed + void markerChanged(unsigned int marker, double value); ///< A marker position has been changed }; diff --git a/openhantek/src/glgenerator.cpp b/openhantek/src/glgenerator.cpp index 44172b7..737f37b 100644 --- a/openhantek/src/glgenerator.cpp +++ b/openhantek/src/glgenerator.cpp @@ -55,7 +55,7 @@ unsigned long int GlArray::getSize() { /// \brief Set the size of the array. /// Previous array contents are lost. /// \param size New number of array elements. -void GlArray::setSize(unsigned long size) { +void GlArray::setSize(unsigned long int size) { if(this->size == size) return; diff --git a/openhantek/src/glgenerator.h b/openhantek/src/glgenerator.h index d13be3f..aa037c0 100644 --- a/openhantek/src/glgenerator.h +++ b/openhantek/src/glgenerator.h @@ -58,10 +58,10 @@ class GlArray { unsigned long int getSize(); void setSize(unsigned long int size); - GLfloat *data; + GLfloat *data; ///< Pointer to the array protected: - unsigned long int size; + unsigned long int size; ///< The array size (Number of GLfloat values) }; //////////////////////////////////////////////////////////////////////////////// @@ -94,7 +94,7 @@ class GlGenerator : public QObject { void generateGraphs(); signals: - void graphsGenerated(); + void graphsGenerated(); ///< The graphs are ready to be drawn }; diff --git a/openhantek/src/glscope.cpp b/openhantek/src/glscope.cpp index bef52fe..5f12855 100644 --- a/openhantek/src/glscope.cpp +++ b/openhantek/src/glscope.cpp @@ -39,6 +39,7 @@ //////////////////////////////////////////////////////////////////////////////// // class GlScope /// \brief Initializes the scope widget. +/// \param settings The settings that should be used. /// \param parent The parent widget. GlScope::GlScope(DsoSettings *settings, QWidget *parent) : QGLWidget(parent) { this->settings = settings; diff --git a/openhantek/src/hantek/control.cpp b/openhantek/src/hantek/control.cpp index 04526e4..a4ea4e8 100644 --- a/openhantek/src/hantek/control.cpp +++ b/openhantek/src/hantek/control.cpp @@ -454,7 +454,7 @@ namespace Hantek { /// \brief Enables/disables filtering of the given channel. /// \param channel The channel that should be set. - /// \param filtered true if the channel should be filtered. + /// \param used true if the channel should be sampled. /// \return 0 on success, -1 on invalid channel. int Control::setChannelUsed(unsigned int channel, bool used) { if(channel >= HANTEK_CHANNELS) @@ -495,6 +495,7 @@ namespace Hantek { } /// \brief Sets the gain for the given channel. + /// \param channel The channel that should be set. /// \param gain The gain that should be met (V/div). /// \return The gain that has been set, -1.0 on invalid channel. double Control::setGain(unsigned int channel, double gain) { @@ -636,7 +637,7 @@ namespace Hantek { } /// \brief Set the trigger position. - /// \param level The new trigger position (0.0 - 1.0). + /// \param position The new trigger position (0.0 - 1.0). /// \return The trigger position that has been set. double Control::setTriggerPosition(double position) { // Calculate the position value (Varying start point, measured in samples) diff --git a/openhantek/src/hantek/control.h b/openhantek/src/hantek/control.h index 72ce155..038dd28 100644 --- a/openhantek/src/hantek/control.h +++ b/openhantek/src/hantek/control.h @@ -54,7 +54,7 @@ namespace Hantek { ////////////////////////////////////////////////////////////////////////////// /// \class Control hantek/control.h - /// \brief The DsoControl abstraction layer for Hantek USB DSOs. + /// \brief The DsoControl abstraction layer for %Hantek USB DSOs. class Control : public DsoControl { Q_OBJECT @@ -71,7 +71,7 @@ namespace Hantek { int getCaptureState(); int getSamples(); - Device *device; + Device *device; ///< The USB device for the oscilloscope Helper::DataArray *command[COMMAND_COUNT]; ///< Pointers to commands, ready to be transmitted bool commandPending[COMMAND_COUNT]; ///< true, when the command should be executed @@ -83,16 +83,16 @@ namespace Hantek { unsigned short channelLevels[HANTEK_CHANNELS][GAIN_COUNT][OFFSET_COUNT]; // Various cached settings - Samplerate samplerate; - Gain gain[HANTEK_CHANNELS]; - double offset[HANTEK_CHANNELS]; - double offsetReal[HANTEK_CHANNELS]; - double triggerLevel[HANTEK_CHANNELS]; - unsigned int bufferSize; - unsigned int triggerPoint; - Dso::TriggerMode triggerMode; - bool triggerSpecial; - unsigned int triggerSource; + Samplerate samplerate; ///< The samplerate id + Gain gain[HANTEK_CHANNELS]; ///< The gain id + double offset[HANTEK_CHANNELS]; ///< The current screen offset for each channel + double offsetReal[HANTEK_CHANNELS]; ///< The real offset for each channel (Due to quantization) + double triggerLevel[HANTEK_CHANNELS]; ///< The trigger level for each channel in V + unsigned int bufferSize; ///< The buffer size in samples + unsigned int triggerPoint; ///< The trigger point value + Dso::TriggerMode triggerMode; ///< The trigger mode + bool triggerSpecial; ///< true, if the trigger source is special + unsigned int triggerSource; ///< The trigger source QList samples; ///< Sample data arrays QList samplesSize; ///< Number of samples data array diff --git a/openhantek/src/hantek/device.h b/openhantek/src/hantek/device.h index fd74a29..75181cd 100644 --- a/openhantek/src/hantek/device.h +++ b/openhantek/src/hantek/device.h @@ -84,7 +84,7 @@ namespace Hantek { QStringList modelStrings; ///< The name as QString for each #Model // Command buffers - ControlBeginCommand *beginCommandControl; + ControlBeginCommand *beginCommandControl; ///< Buffer for the CONTROL_BEGINCOMMAND control command // Libusb specific variables #if LIBUSB_VERSION != 0 @@ -99,8 +99,8 @@ namespace Hantek { int inPacketLength; ///< Packet length for the IN endpoint signals: - void connected(); - void disconnected(); + void connected(); ///< The device has been connected and initialized + void disconnected(); ///< The device has been disconnected public slots: diff --git a/openhantek/src/hantek/types.cpp b/openhantek/src/hantek/types.cpp index 4c87612..f2dbac5 100644 --- a/openhantek/src/hantek/types.cpp +++ b/openhantek/src/hantek/types.cpp @@ -101,17 +101,21 @@ namespace Hantek { } /// \brief Sets the data bytes to the specified values. - /// \param tsr1Byte The Tsr1 value. - /// \param tsr2Byte The Tsr2 value. - /// \param timebase The new timebase value. - /// \param triggerPosition The new horizontal trigger position. - CommandSetTriggerAndSamplerate::CommandSetTriggerAndSamplerate(unsigned short int samplerate, unsigned long int triggerPosition, unsigned char triggerSource, unsigned char sampleSize, unsigned char timebaseFast, unsigned char selectedChannel, bool fastRate, unsigned char triggerSlope) : Helper::DataArray(12) { + /// \param samplerate The samplerate value. + /// \param triggerPosition The trigger position value. + /// \param triggerSource The trigger source id (Tsr1). + /// \param sampleSize The buffer size id (Tsr1). + /// \param samplerateFast The samplerateFast value (Tsr1). + /// \param usedChannel The enabled channels (Tsr2). + /// \param fastRate The fastRate state (Tsr2). + /// \param triggerSlope The triggerSlope value (Tsr2). + CommandSetTriggerAndSamplerate::CommandSetTriggerAndSamplerate(unsigned short int samplerate, unsigned long int triggerPosition, unsigned char triggerSource, unsigned char sampleSize, unsigned char samplerateFast, unsigned char usedChannel, bool fastRate, unsigned char triggerSlope) : Helper::DataArray(12) { this->init(); this->setTriggerSource(triggerSource); this->setSampleSize(sampleSize); - this->setSamplerateFast(timebaseFast); - this->setUsedChannel(selectedChannel); + this->setSamplerateFast(samplerateFast); + this->setUsedChannel(usedChannel); this->setFastRate(fastRate); this->setTriggerSlope(triggerSlope); this->setSamplerate(samplerate); @@ -154,16 +158,16 @@ namespace Hantek { ((Tsr1Bits *) &(this->array[2]))->samplerateFast = value; } - /// \brief Get the selectedChannel value in Tsr2Bits. - /// \return The selectedChannel value. + /// \brief Get the usedChannel value in Tsr2Bits. + /// \return The usedChannel value. unsigned char CommandSetTriggerAndSamplerate::getUsedChannel() { - return ((Tsr2Bits *) &(this->array[3]))->selectedChannel; + return ((Tsr2Bits *) &(this->array[3]))->usedChannel; } - /// \brief Set the selectedChannel in Tsr2Bits to the given value. - /// \param value The new selectedChannel value. + /// \brief Set the usedChannel in Tsr2Bits to the given value. + /// \param value The new usedChannel value. void CommandSetTriggerAndSamplerate::setUsedChannel(unsigned char value) { - ((Tsr2Bits *) &(this->array[3]))->selectedChannel = value; + ((Tsr2Bits *) &(this->array[3]))->usedChannel = value; } /// \brief Get the fastRate state in Tsr2Bits. @@ -197,7 +201,7 @@ namespace Hantek { } /// \brief Set the Samplerate to the given value. - /// \param timebase The new samplerate value. + /// \param samplerate The new samplerate value. void CommandSetTriggerAndSamplerate::setSamplerate(unsigned short int samplerate) { this->array[4] = (unsigned char) samplerate; this->array[5] = (unsigned char) (samplerate >> 8); @@ -325,7 +329,7 @@ namespace Hantek { void CommandSetGain::init() { this->array[0] = COMMAND_SETGAIN; this->array[1] = 0x0f; - ((GainBits *) &(this->array[2]))->constant = 3; + ((GainBits *) &(this->array[2]))->reserved = 3; } @@ -421,7 +425,7 @@ namespace Hantek { /// \brief Sets the offsets to the given values. /// \param channel1 The offset for channel 1. /// \param channel2 The offset for channel 2. - /// \param ext The offset for ext. trigger. + /// \param trigger The offset for ext. trigger. ControlSetOffset::ControlSetOffset(unsigned short int channel1, unsigned short int channel2, unsigned short int trigger) : Helper::DataArray(17) { this->setChannel(0, channel1); this->setChannel(1, channel2); @@ -538,7 +542,7 @@ namespace Hantek { /// \brief Set the coupling relay for the given channel. /// \param channel The channel that should be set. - /// \param below true, if the coupling of the channel should be DC. + /// \param dc true, if the coupling of the channel should be DC. void ControlSetRelays::setCoupling(unsigned int channel, bool dc) { if(channel == 0) this->array[3] = dc ? 0xfd : 0x02; @@ -553,7 +557,7 @@ namespace Hantek { } /// \brief Set the external trigger relay. - /// \param below true, if the trigger should be external (EXT-Connector). + /// \param ext true, if the trigger should be external (EXT-Connector). void ControlSetRelays::setTrigger(bool ext) { this->array[7] = ext ? 0xfe : 0x01; } diff --git a/openhantek/src/hantek/types.h b/openhantek/src/hantek/types.h index cecb572..decac24 100644 --- a/openhantek/src/hantek/types.h +++ b/openhantek/src/hantek/types.h @@ -44,7 +44,7 @@ //////////////////////////////////////////////////////////////////////////////// /// \namespace Hantek hantek/types.h -/// \brief All Hantek DSO device specific things. +/// \brief All %Hantek DSO device specific things. namespace Hantek { ////////////////////////////////////////////////////////////////////////////// /// \enum CommandCode hantek/types.h @@ -401,8 +401,8 @@ namespace Hantek { /// \enum LevelOffset hantek/types.h /// \brief The array indicies for the CalibrationData. enum LevelOffset { - OFFSET_START, - OFFSET_END, + OFFSET_START, ///< The channel level at the bottom of the scope + OFFSET_END, ///< The channel level at the top of the scope OFFSET_COUNT }; @@ -410,70 +410,70 @@ namespace Hantek { /// \struct FilterBits hantek/types.h /// \brief The bits for COMMAND_SETFILTER. struct FilterBits { - unsigned char channel1:1; - unsigned char channel2:1; - unsigned char trigger:1; - unsigned char reserved:5; + unsigned char channel1:1; ///< Set to true when channel 1 isn't used + unsigned char channel2:1; ///< Set to true when channel 2 isn't used + unsigned char trigger:1; ///< Set to true when trigger isn't used + unsigned char reserved:5; ///< Unused bits }; ////////////////////////////////////////////////////////////////////////////// /// \union FilterByte hantek/types.h /// \brief Allows to read the FilterBits as unsigned char. union FilterByte { - FilterBits bits; - unsigned char byte; + FilterBits bits; ///< Bitfield representation + unsigned char byte; ///< Full byte as unsigned char }; ////////////////////////////////////////////////////////////////////////////// /// \struct GainBits hantek/types.h - /// \brief The gain bits for COMMAND_SETVOLTAGEANDCOUPLING. + /// \brief The gain bits for COMMAND_SETGAIN. struct GainBits { - unsigned char channel1:2; - unsigned char channel2:2; - unsigned char constant:4; + unsigned char channel1:2; ///< Gain for CH1, 0 = 1e* V, 1 = 2e*, 2 = 5e* + unsigned char channel2:2; ///< Gain for CH1, 0 = 1e* V, 1 = 2e*, 2 = 5e* + unsigned char reserved:4; ///< Unused bits }; ////////////////////////////////////////////////////////////////////////////// /// \union GainByte hantek/types.h /// \brief Allows to read the GainBits as unsigned char. union GainByte { - GainBits bits; - unsigned char byte; + GainBits bits; ///< Bitfield representation + unsigned char byte; ///< Full byte as unsigned char }; ////////////////////////////////////////////////////////////////////////////// /// \struct Tsr1Bits hantek/types.h /// \brief Trigger and samplerate bits (Byte 1). struct Tsr1Bits { - unsigned char triggerSource:2; - unsigned char sampleSize:3; - unsigned char samplerateFast:3; + unsigned char triggerSource:2; ///< The trigger source, see Hantek::TriggerSource + unsigned char sampleSize:3; ///< Buffer size, 1 = 10240 S, 2 = 32768 S + unsigned char samplerateFast:3; ///< samplerate id for fast sampling rates }; ////////////////////////////////////////////////////////////////////////////// /// \union Tsr1Byte hantek/types.h /// \brief Allows to read the Tsr1Bits as unsigned char. union Tsr1Byte { - Tsr1Bits bits; - unsigned char byte; + Tsr1Bits bits; ///< Bitfield representation. + unsigned char byte; ///< Full byte as unsigned char. }; ////////////////////////////////////////////////////////////////////////////// /// \struct Tsr2Bits hantek/types.h /// \brief Trigger and samplerate bits (Byte 2). struct Tsr2Bits { - unsigned char selectedChannel:2; - unsigned char fastRate:1; - unsigned char triggerSlope:1; - unsigned char reserved:4; + unsigned char usedChannel:2; ///< Used channels, see Hantek::UsedChannels + unsigned char fastRate:1; ///< true, if one channels uses all buffers + unsigned char triggerSlope:1; ///< The trigger slope, see Dso::Slope + unsigned char reserved:4; ///< Unused bits }; ////////////////////////////////////////////////////////////////////////////// /// \union Tsr2Byte hantek/types.h /// \brief Allows to read the Tsr2Bits as unsigned char. union Tsr2Byte { - Tsr2Bits bits; - unsigned char byte; + Tsr2Bits bits; ///< Bitfield representation + unsigned char byte; ///< Full byte as unsigned char }; ////////////////////////////////////////////////////////////////////////////// @@ -499,7 +499,7 @@ namespace Hantek { class CommandSetTriggerAndSamplerate : public Helper::DataArray { public: CommandSetTriggerAndSamplerate(); - CommandSetTriggerAndSamplerate(unsigned short int samplerate, unsigned long int triggerPosition, unsigned char triggerSource = 0, unsigned char sampleSize = 0, unsigned char timebaseFast = 0, unsigned char selectedChannel = 0, bool fastRate = false, unsigned char triggerSlope = 0); + CommandSetTriggerAndSamplerate(unsigned short int samplerate, unsigned long int triggerPosition, unsigned char triggerSource = 0, unsigned char sampleSize = 0, unsigned char timebaseFast = 0, unsigned char usedChannel = 0, bool fastRate = false, unsigned char triggerSlope = 0); unsigned char getTriggerSource(); void setTriggerSource(unsigned char value); diff --git a/openhantek/src/helper.h b/openhantek/src/helper.h index 22f1566..a97b219 100644 --- a/openhantek/src/helper.h +++ b/openhantek/src/helper.h @@ -57,8 +57,8 @@ namespace Helper { unsigned int getSize() const; protected: - T *array; - unsigned int size; + T *array; ///< Pointer to the array holding the data + unsigned int size; ///< Size of the array (Number of variables of type T) }; /// \brief Initializes the data array. diff --git a/openhantek/src/levelslider.cpp b/openhantek/src/levelslider.cpp index 99a2113..6aa8b30 100644 --- a/openhantek/src/levelslider.cpp +++ b/openhantek/src/levelslider.cpp @@ -218,6 +218,8 @@ double LevelSlider::maximum(int index) const { } /// \brief Set the maximal value of the sliders. +/// \param index The index of the slider whose limits should be set. +/// \param minimum The value a slider has at the bottommost/leftmost position. /// \param maximum The value a slider has at the topmost/rightmost position. /// \return -1 on error, fixValue result on success. int LevelSlider::setLimits(int index, double minimum, double maximum) { @@ -235,6 +237,7 @@ int LevelSlider::setLimits(int index, double minimum, double maximum) { } /// \brief Return the step width of the sliders. +/// \param index The index of the slider whose step width should be returned. /// \return The distance between the selectable slider positions. double LevelSlider::step(int index) const { if(index < 0 || index >= this->slider.count()) @@ -244,7 +247,8 @@ double LevelSlider::step(int index) const { } /// \brief Set the step width of the sliders. -/// \param maximum The distance between the selectable slider positions. +/// \param index The index of the slider whose step width should be set. +/// \param step The distance between the selectable slider positions. /// \return The new step width. double LevelSlider::setStep(int index, double step) { if(index < 0 || index >= this->slider.count()) diff --git a/openhantek/src/levelslider.h b/openhantek/src/levelslider.h index 4a122c9..6ca8a4c 100644 --- a/openhantek/src/levelslider.h +++ b/openhantek/src/levelslider.h @@ -37,16 +37,17 @@ class QColor; /// \struct LevelSliderParameters levelslider.h /// \brief Contains the color, text and value of one slider. struct LevelSliderParameters { - QColor color; - QString text; - bool visible; + QColor color; ///< The color of the slider and font + QString text; ///< The text beside the slider, a empty string disables text + bool visible; ///< Visibility of the slider - double minimum, maximum; - double step; - double value; + double minimum; ///< Minimum (left/top) value for the slider + double maximum; ///< Maximum (right/bottom) value for the slider + double step; ///< The distance between selectable slider positions + double value; ///< The current value of the slider // Needed for moving and drawing - QRect rect; + QRect rect; ///< The area where the slider is drawn }; //////////////////////////////////////////////////////////////////////////////// @@ -101,15 +102,16 @@ class LevelSlider : public QWidget { int calculateWidth(); int fixValue(int index); - QList slider; - int pressedSlider; - int sliderWidth; + QList slider; ///< The parameters for each slider + int pressedSlider; ///< The currently pressed (moved) slider + int sliderWidth; ///< The slider width (dimension orthogonal to the sliding direction) - Qt::ArrowType _direction; - int _preMargin, _postMargin; + Qt::ArrowType _direction; ///< The direction the sliders point to + int _preMargin; ///< The margin before the minimum slider position + int _postMargin; ///< The margin after the maximum slider position signals: - void valueChanged(int index, double value); + void valueChanged(int index, double value); ///< The value of a slider has changed }; diff --git a/openhantek/src/openhantek.cpp b/openhantek/src/openhantek.cpp index b9a2951..d90a1ac 100644 --- a/openhantek/src/openhantek.cpp +++ b/openhantek/src/openhantek.cpp @@ -115,6 +115,7 @@ OpenHantekMainWindow::OpenHantekMainWindow(QWidget *parent, Qt::WindowFlags flag connect(this->voltageDock, SIGNAL(usedChanged(unsigned int, bool)), this->dsoWidget, SLOT(updateVoltageUsed(unsigned int, bool))); connect(this->voltageDock, SIGNAL(couplingChanged(unsigned int, Dso::Coupling)), this->dsoControl, SLOT(setCoupling(unsigned int, Dso::Coupling))); connect(this->voltageDock, SIGNAL(couplingChanged(unsigned int, Dso::Coupling)), this->dsoWidget, SLOT(updateVoltageCoupling(unsigned int))); + connect(this->voltageDock, SIGNAL(modeChanged(Dso::MathMode)), this->dsoWidget, SLOT(updateMathMode())); connect(this->voltageDock, SIGNAL(gainChanged(unsigned int, double)), this, SLOT(updateVoltageGain(unsigned int))); connect(this->voltageDock, SIGNAL(gainChanged(unsigned int, double)), this->dsoWidget, SLOT(updateVoltageGain(unsigned int))); connect(this->dsoWidget, SIGNAL(offsetChanged(unsigned int, double)), this, SLOT(updateOffset(unsigned int))); diff --git a/openhantek/src/openhantek.h b/openhantek/src/openhantek.h index 4ddca1e..57dd0fc 100644 --- a/openhantek/src/openhantek.h +++ b/openhantek/src/openhantek.h @@ -133,7 +133,7 @@ class OpenHantekMainWindow : public QMainWindow { void updateVoltageGain(unsigned int channel); signals: - void settingsChanged(); + void settingsChanged(); ///< The settings have changed (Option dialog, loading...) }; diff --git a/openhantek/src/settings.h b/openhantek/src/settings.h index a7a8659..558ff29 100644 --- a/openhantek/src/settings.h +++ b/openhantek/src/settings.h @@ -104,7 +104,7 @@ struct DsoSettingsScope { }; //////////////////////////////////////////////////////////////////////////////// -/// \struct DsoColorValues settings.h +/// \struct DsoSettingsColorValues settings.h /// \brief Holds the color values for the oscilloscope screen. struct DsoSettingsColorValues { QColor axes; ///< X- and Y-axis and subdiv lines on them