Commit 926ac526f557ad1126fb0de54c2eded59af1a180
1 parent
66350331
Small bugfix and documentation update
Showing
26 changed files
with
276 additions
and
220 deletions
openhantek/ChangeLog
| @@ -23,4 +23,8 @@ | @@ -23,4 +23,8 @@ | ||
| 23 | * DsoControl class could control non-Hantek DSOs too | 23 | * DsoControl class could control non-Hantek DSOs too |
| 24 | * Added reference level and minimum magnitude for spectrum analysis to settings | 24 | * Added reference level and minimum magnitude for spectrum analysis to settings |
| 25 | * Made lower timebases available | 25 | * Made lower timebases available |
| 26 | -* Spectrum and math graphs can be shown without enabling the voltage graph too | ||
| 27 | \ No newline at end of file | 26 | \ No newline at end of file |
| 27 | +* Spectrum and math graphs can be shown without enabling the voltage graph too | ||
| 28 | + | ||
| 29 | +2010-08-06 Oliver Haag <oliver.haag@gmail.com> | ||
| 30 | +* Bugfix: Mode shown below scope instead of coupling for the math channel | ||
| 31 | +* Documentation updated | ||
| 28 | \ No newline at end of file | 32 | \ No newline at end of file |
openhantek/mainpage.dox
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | \mainpage OpenHantek Developer Documentation | 3 | \mainpage OpenHantek Developer Documentation |
| 4 | 4 | ||
| 5 | \section sec_introduction Introduction | 5 | \section sec_introduction Introduction |
| 6 | -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. | 6 | +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. |
| 7 | 7 | ||
| 8 | \section sec_compiling Compiling from source | 8 | \section sec_compiling Compiling from source |
| 9 | \subsection ssec_dependencies Dependencies | 9 | \subsection ssec_dependencies Dependencies |
openhantek/src/colorbox.h
| @@ -51,7 +51,7 @@ class ColorBox : public QPushButton { | @@ -51,7 +51,7 @@ class ColorBox : public QPushButton { | ||
| 51 | QColor color; | 51 | QColor color; |
| 52 | 52 | ||
| 53 | signals: | 53 | signals: |
| 54 | - void colorChanged(QColor color); | 54 | + void colorChanged(QColor color); ///< The color has been changed |
| 55 | }; | 55 | }; |
| 56 | 56 | ||
| 57 | 57 |
openhantek/src/configdialog.h
| @@ -41,9 +41,9 @@ | @@ -41,9 +41,9 @@ | ||
| 41 | #define CONFIG_FILE "HKEY_CURRENT_USER\\Software\\paranoiacs.net\\OpenHantek" | 41 | #define CONFIG_FILE "HKEY_CURRENT_USER\\Software\\paranoiacs.net\\OpenHantek" |
| 42 | #endif*/ | 42 | #endif*/ |
| 43 | 43 | ||
| 44 | -#define CONFIG_LIST_WIDTH 128 | ||
| 45 | -#define CONFIG_LIST_ITEMHEIGHT 80 | ||
| 46 | -#define CONFIG_LIST_ICONSIZE 48 | 44 | +#define CONFIG_LIST_WIDTH 128 ///< The width of the page selection widget |
| 45 | +#define CONFIG_LIST_ITEMHEIGHT 80 ///< The height of one item in the page selection widget | ||
| 46 | +#define CONFIG_LIST_ICONSIZE 48 ///< The icon size in the page selection widget | ||
| 47 | 47 | ||
| 48 | 48 | ||
| 49 | class DsoConfigAnalysisPage; | 49 | class DsoConfigAnalysisPage; |
openhantek/src/constants.h
| @@ -45,16 +45,6 @@ namespace Dso { | @@ -45,16 +45,6 @@ namespace Dso { | ||
| 45 | }; | 45 | }; |
| 46 | 46 | ||
| 47 | ////////////////////////////////////////////////////////////////////////////// | 47 | ////////////////////////////////////////////////////////////////////////////// |
| 48 | - /// \enum ChannelType constants.h | ||
| 49 | - /// \brief All channels that can be displayed. | ||
| 50 | - /// \todo Get rid of this enum, get the channel count from the oscilloscope | ||
| 51 | - /*enum ChannelType { | ||
| 52 | - CHANNELTYPE_CH, ///< First real channel | ||
| 53 | - CHANNELTYPE_MATH = PHYS_CHANNEL_COUNT, ///< The math channel | ||
| 54 | - CHANNEL_COUNT ///< The total number of channels | ||
| 55 | - };*/ | ||
| 56 | - | ||
| 57 | - ////////////////////////////////////////////////////////////////////////////// | ||
| 58 | /// \enum GraphFormat constants.h | 48 | /// \enum GraphFormat constants.h |
| 59 | /// \brief The possible viewing formats for the graphs on the scope. | 49 | /// \brief The possible viewing formats for the graphs on the scope. |
| 60 | enum GraphFormat { | 50 | enum GraphFormat { |
openhantek/src/dataanalyzer.cpp
| @@ -40,7 +40,7 @@ | @@ -40,7 +40,7 @@ | ||
| 40 | //////////////////////////////////////////////////////////////////////////////// | 40 | //////////////////////////////////////////////////////////////////////////////// |
| 41 | // class HorizontalDock | 41 | // class HorizontalDock |
| 42 | /// \brief Initializes the buffers and other variables. | 42 | /// \brief Initializes the buffers and other variables. |
| 43 | -/// \param settings The target settings object. | 43 | +/// \param settings The settings that should be used. |
| 44 | /// \param parent The parent widget. | 44 | /// \param parent The parent widget. |
| 45 | DataAnalyzer::DataAnalyzer(DsoSettings *settings, QObject *parent) : QThread(parent) { | 45 | DataAnalyzer::DataAnalyzer(DsoSettings *settings, QObject *parent) : QThread(parent) { |
| 46 | this->settings = settings; | 46 | this->settings = settings; |
| @@ -359,6 +359,11 @@ void DataAnalyzer::run() { | @@ -359,6 +359,11 @@ void DataAnalyzer::run() { | ||
| 359 | this->analyzedDataMutex->unlock(); | 359 | this->analyzedDataMutex->unlock(); |
| 360 | } | 360 | } |
| 361 | 361 | ||
| 362 | +/// \brief Starts the analyzing of new input data. | ||
| 363 | +/// \param data The data arrays with the input data. | ||
| 364 | +/// \param size The sizes of the data arrays. | ||
| 365 | +/// \param samplerate The samplerate for all input data. | ||
| 366 | +/// \param mutex The mutex for all input data. | ||
| 362 | void DataAnalyzer::analyze(const QList<double *> *data, const QList<unsigned int> *size, double samplerate, QMutex *mutex) { | 367 | void DataAnalyzer::analyze(const QList<double *> *data, const QList<unsigned int> *size, double samplerate, QMutex *mutex) { |
| 363 | // Previous analysis still running, drop the new data | 368 | // Previous analysis still running, drop the new data |
| 364 | if(this->isRunning()) | 369 | if(this->isRunning()) |
openhantek/src/dataanalyzer.h
| @@ -43,31 +43,33 @@ class QMutex; | @@ -43,31 +43,33 @@ class QMutex; | ||
| 43 | /// \struct SampleValues dataanalyzer.h | 43 | /// \struct SampleValues dataanalyzer.h |
| 44 | /// \brief Struct for a array of sample values. | 44 | /// \brief Struct for a array of sample values. |
| 45 | struct SampleValues { | 45 | struct SampleValues { |
| 46 | - double *sample; | ||
| 47 | - unsigned int count; | ||
| 48 | - double interval; | 46 | + double *sample; ///< Pointer to the array holding the sampling data |
| 47 | + unsigned int count; ///< Number of sample values | ||
| 48 | + double interval; ///< The interval between two sample values | ||
| 49 | }; | 49 | }; |
| 50 | 50 | ||
| 51 | //////////////////////////////////////////////////////////////////////////////// | 51 | //////////////////////////////////////////////////////////////////////////////// |
| 52 | /// \struct SampleData dataanalyzer.h | 52 | /// \struct SampleData dataanalyzer.h |
| 53 | /// \brief Struct for the sample value arrays. | 53 | /// \brief Struct for the sample value arrays. |
| 54 | struct SampleData { | 54 | struct SampleData { |
| 55 | - SampleValues voltage, spectrum; | 55 | + SampleValues voltage; ///< The time-domain voltage levels (V) |
| 56 | + SampleValues spectrum; ///< The frequency-domain power levels (dB) | ||
| 56 | }; | 57 | }; |
| 57 | 58 | ||
| 58 | //////////////////////////////////////////////////////////////////////////////// | 59 | //////////////////////////////////////////////////////////////////////////////// |
| 59 | /// \struct AnalyzedData dataanalyzer.h | 60 | /// \struct AnalyzedData dataanalyzer.h |
| 60 | /// \brief Struct for the analyzed data. | 61 | /// \brief Struct for the analyzed data. |
| 61 | struct AnalyzedData { | 62 | struct AnalyzedData { |
| 62 | - SampleData samples; | ||
| 63 | - double frequency, amplitude; | 63 | + SampleData samples; ///< Voltage and spectrum values |
| 64 | + double frequency; ///< The frequency of the signal | ||
| 65 | + double amplitude; ///< The amplitude of the signal | ||
| 64 | }; | 66 | }; |
| 65 | 67 | ||
| 66 | //////////////////////////////////////////////////////////////////////////////// | 68 | //////////////////////////////////////////////////////////////////////////////// |
| 67 | /// \class DataAnalyzer dataanalyzer.h | 69 | /// \class DataAnalyzer dataanalyzer.h |
| 68 | /// \brief Analyzes the data from the dso. | 70 | /// \brief Analyzes the data from the dso. |
| 69 | -/// Converts the levels into volts, calculates the spectrum and saves offsets | ||
| 70 | -/// and the time-/frequencysteps between two values. | 71 | +/// Calculates the spectrum and various data about the signal and saves the |
| 72 | +/// time-/frequencysteps between two values. | ||
| 71 | class DataAnalyzer : public QThread { | 73 | class DataAnalyzer : public QThread { |
| 72 | Q_OBJECT | 74 | Q_OBJECT |
| 73 | 75 | ||
| @@ -80,21 +82,20 @@ class DataAnalyzer : public QThread { | @@ -80,21 +82,20 @@ class DataAnalyzer : public QThread { | ||
| 80 | 82 | ||
| 81 | protected: | 83 | protected: |
| 82 | void run(); | 84 | void run(); |
| 83 | - | ||
| 84 | - private: | ||
| 85 | - DsoSettings *settings; | ||
| 86 | 85 | ||
| 87 | - QList<AnalyzedData *> analyzedData; | ||
| 88 | - QMutex *analyzedDataMutex; | 86 | + DsoSettings *settings; ///< The settings provided by the parent class |
| 87 | + | ||
| 88 | + QList<AnalyzedData *> analyzedData; ///< The analyzed data for each channel | ||
| 89 | + QMutex *analyzedDataMutex; ///< A mutex for the analyzed data of all channels | ||
| 89 | 90 | ||
| 90 | - unsigned int lastBufferSize; | ||
| 91 | - Dso::WindowFunction lastWindow; | ||
| 92 | - double *window; | 91 | + unsigned int lastBufferSize; ///< The buffer size of the previously analyzed data |
| 92 | + Dso::WindowFunction lastWindow; ///< The previously used dft window function | ||
| 93 | + double *window; ///< The array for the dft window factors | ||
| 93 | 94 | ||
| 94 | - QList<double *> waitingData; | ||
| 95 | - QList<unsigned int> waitingDataSize; | ||
| 96 | - double waitingDataSamplerate; | ||
| 97 | - QMutex *waitingDataMutex; | 95 | + QList<double *> waitingData; ///< Pointer to input data from device |
| 96 | + QList<unsigned int> waitingDataSize; ///< Number of input data samples | ||
| 97 | + double waitingDataSamplerate; ///< The samplerate of the input data | ||
| 98 | + QMutex *waitingDataMutex; ///< A mutex for the input data | ||
| 98 | 99 | ||
| 99 | public slots: | 100 | public slots: |
| 100 | void analyze(const QList<double *> *data, const QList<unsigned int> *size, double samplerate, QMutex *mutex); | 101 | void analyze(const QList<double *> *data, const QList<unsigned int> *size, double samplerate, QMutex *mutex); |
openhantek/src/dockwindows.cpp
| @@ -174,6 +174,7 @@ void HorizontalDock::formatSelected(int index) { | @@ -174,6 +174,7 @@ void HorizontalDock::formatSelected(int index) { | ||
| 174 | // class TriggerDock | 174 | // class TriggerDock |
| 175 | /// \brief Initializes the trigger settings docking window. | 175 | /// \brief Initializes the trigger settings docking window. |
| 176 | /// \param settings The target settings object. | 176 | /// \param settings The target settings object. |
| 177 | +/// \param specialTriggers The names of the special trigger sources. | ||
| 177 | /// \param parent The parent widget. | 178 | /// \param parent The parent widget. |
| 178 | /// \param flags Flags for the window manager. | 179 | /// \param flags Flags for the window manager. |
| 179 | TriggerDock::TriggerDock(DsoSettings *settings, const QStringList *specialTriggers, QWidget *parent, Qt::WindowFlags flags) : QDockWidget(tr("Trigger"), parent, flags) { | 180 | TriggerDock::TriggerDock(DsoSettings *settings, const QStringList *specialTriggers, QWidget *parent, Qt::WindowFlags flags) : QDockWidget(tr("Trigger"), parent, flags) { |
openhantek/src/dockwindows.h
| @@ -58,15 +58,22 @@ class HorizontalDock : public QDockWidget { | @@ -58,15 +58,22 @@ class HorizontalDock : public QDockWidget { | ||
| 58 | protected: | 58 | protected: |
| 59 | void closeEvent(QCloseEvent *event); | 59 | void closeEvent(QCloseEvent *event); |
| 60 | 60 | ||
| 61 | - QGridLayout *dockLayout; | ||
| 62 | - QWidget *dockWidget; | ||
| 63 | - QLabel *timebaseLabel, *frequencybaseLabel, *formatLabel; | ||
| 64 | - QComboBox *timebaseComboBox, *frequencybaseComboBox, *formatComboBox; | ||
| 65 | - | ||
| 66 | - DsoSettings *settings; | ||
| 67 | - | ||
| 68 | - QList<double> frequencybaseSteps, timebaseSteps; | ||
| 69 | - QStringList frequencybaseStrings, timebaseStrings, formatStrings; | 61 | + QGridLayout *dockLayout; ///< The main layout for the dock window |
| 62 | + QWidget *dockWidget; ///< The main widget for the dock window | ||
| 63 | + QLabel *timebaseLabel; ///< The label for the timebase combobox | ||
| 64 | + QLabel *frequencybaseLabel; ///< The label for the frequencybase combobox | ||
| 65 | + QLabel *formatLabel; ///< The label for the format combobox | ||
| 66 | + QComboBox *timebaseComboBox; ///< Selects the timebase for voltage graphs | ||
| 67 | + QComboBox *frequencybaseComboBox; ///< Selects the frequencybase for spectrum graphs | ||
| 68 | + QComboBox *formatComboBox; ///< Selects the way the sampled data is interpreted and shown | ||
| 69 | + | ||
| 70 | + DsoSettings *settings; ///< The settings provided by the parent class | ||
| 71 | + | ||
| 72 | + QList<double> frequencybaseSteps; ///< The selectable steps for the frequencybase | ||
| 73 | + QList<double> timebaseSteps; ///< The selectable steps for the timebase | ||
| 74 | + QStringList frequencybaseStrings; ///< String representations for the frequencybase steps | ||
| 75 | + QStringList timebaseStrings; ///< String representations for the timebase steps | ||
| 76 | + QStringList formatStrings; ///< Strings for the formats | ||
| 70 | 77 | ||
| 71 | protected slots: | 78 | protected slots: |
| 72 | void frequencybaseSelected(int index); | 79 | void frequencybaseSelected(int index); |
| @@ -74,9 +81,9 @@ class HorizontalDock : public QDockWidget { | @@ -74,9 +81,9 @@ class HorizontalDock : public QDockWidget { | ||
| 74 | void formatSelected(int index); | 81 | void formatSelected(int index); |
| 75 | 82 | ||
| 76 | signals: | 83 | signals: |
| 77 | - void frequencybaseChanged(double frequencybase); | ||
| 78 | - void timebaseChanged(double timebase); | ||
| 79 | - void formatChanged(Dso::GraphFormat format); | 84 | + void frequencybaseChanged(double frequencybase); ///< The frequencybase has been changed |
| 85 | + void timebaseChanged(double timebase); ///< The timebase has been changed | ||
| 86 | + void formatChanged(Dso::GraphFormat format); ///< The viewing format has been changed | ||
| 80 | }; | 87 | }; |
| 81 | 88 | ||
| 82 | 89 | ||
| @@ -98,14 +105,21 @@ class TriggerDock : public QDockWidget { | @@ -98,14 +105,21 @@ class TriggerDock : public QDockWidget { | ||
| 98 | protected: | 105 | protected: |
| 99 | void closeEvent(QCloseEvent *event); | 106 | void closeEvent(QCloseEvent *event); |
| 100 | 107 | ||
| 101 | - QGridLayout *dockLayout; | ||
| 102 | - QWidget *dockWidget; | ||
| 103 | - QLabel *modeLabel, *sweepLabel, *sourceLabel, *slopeLabel; | ||
| 104 | - QComboBox *modeComboBox, *sweepComboBox, *sourceComboBox, *slopeComboBox; | 108 | + QGridLayout *dockLayout; ///< The main layout for the dock window |
| 109 | + QWidget *dockWidget; ///< The main widget for the dock window | ||
| 110 | + QLabel *modeLabel; ///< The label for the trigger mode combobox | ||
| 111 | + QLabel *sourceLabel; ///< The label for the trigger source combobox | ||
| 112 | + QLabel *slopeLabel; ///< The label for the trigger slope combobox | ||
| 113 | + QComboBox *modeComboBox; ///< Select the triggering mode | ||
| 114 | + QComboBox *sourceComboBox; ///< Select the source for triggering | ||
| 115 | + QComboBox *slopeComboBox; ///< Select the slope that causes triggering | ||
| 105 | 116 | ||
| 106 | - DsoSettings *settings; | 117 | + DsoSettings *settings; ///< The settings provided by the parent class |
| 107 | 118 | ||
| 108 | - QStringList modeStrings, sourceStandardStrings, sourceSpecialStrings, slopeStrings; | 119 | + QStringList modeStrings; ///< Strings for the trigger modes |
| 120 | + QStringList sourceStandardStrings; ///< Strings for the standard trigger sources | ||
| 121 | + QStringList sourceSpecialStrings; ///< Strings for the special trigger sources | ||
| 122 | + QStringList slopeStrings; ///< Strings for the trigger slopes | ||
| 109 | 123 | ||
| 110 | protected slots: | 124 | protected slots: |
| 111 | void modeSelected(int index); | 125 | void modeSelected(int index); |
| @@ -113,9 +127,9 @@ class TriggerDock : public QDockWidget { | @@ -113,9 +127,9 @@ class TriggerDock : public QDockWidget { | ||
| 113 | void sourceSelected(int index); | 127 | void sourceSelected(int index); |
| 114 | 128 | ||
| 115 | signals: | 129 | signals: |
| 116 | - void modeChanged(Dso::TriggerMode); | ||
| 117 | - void sourceChanged(bool special, unsigned int id); | ||
| 118 | - void slopeChanged(Dso::Slope); | 130 | + void modeChanged(Dso::TriggerMode); ///< The trigger mode has been changed |
| 131 | + void sourceChanged(bool special, unsigned int id); ///< The trigger source has been changed | ||
| 132 | + void slopeChanged(Dso::Slope); ///< The trigger slope has been changed | ||
| 119 | }; | 133 | }; |
| 120 | 134 | ||
| 121 | 135 | ||
| @@ -139,17 +153,18 @@ class VoltageDock : public QDockWidget { | @@ -139,17 +153,18 @@ class VoltageDock : public QDockWidget { | ||
| 139 | protected: | 153 | protected: |
| 140 | void closeEvent(QCloseEvent *event); | 154 | void closeEvent(QCloseEvent *event); |
| 141 | 155 | ||
| 142 | - QGridLayout *dockLayout; | ||
| 143 | - QWidget *dockWidget; | ||
| 144 | - QList<QCheckBox *> usedCheckBox; | ||
| 145 | - QList<QComboBox *> gainComboBox, miscComboBox; | 156 | + QGridLayout *dockLayout; ///< The main layout for the dock window |
| 157 | + QWidget *dockWidget; ///< The main widget for the dock window | ||
| 158 | + QList<QCheckBox *> usedCheckBox; ///< Enable/disable a specific channel | ||
| 159 | + QList<QComboBox *> gainComboBox; ///< Select the vertical gain for the channels | ||
| 160 | + QList<QComboBox *> miscComboBox; ///< Select coupling for real and mode for math channels | ||
| 146 | 161 | ||
| 147 | - DsoSettings *settings; | 162 | + DsoSettings *settings; ///< The settings provided by the parent class |
| 148 | 163 | ||
| 149 | - QStringList couplingStrings; | ||
| 150 | - QStringList modeStrings; | ||
| 151 | - QList<double> gainSteps; | ||
| 152 | - QStringList gainStrings; | 164 | + QStringList couplingStrings; ///< The strings for the couplings |
| 165 | + QStringList modeStrings; ///< The strings for the math mode | ||
| 166 | + QList<double> gainSteps; ///< The selectable gain steps | ||
| 167 | + QStringList gainStrings; ///< String representations for the gain steps | ||
| 153 | 168 | ||
| 154 | protected slots: | 169 | protected slots: |
| 155 | void gainSelected(int index); | 170 | void gainSelected(int index); |
| @@ -157,10 +172,10 @@ class VoltageDock : public QDockWidget { | @@ -157,10 +172,10 @@ class VoltageDock : public QDockWidget { | ||
| 157 | void usedSwitched(bool checked); | 172 | void usedSwitched(bool checked); |
| 158 | 173 | ||
| 159 | signals: | 174 | signals: |
| 160 | - void couplingChanged(unsigned int channel, Dso::Coupling coupling); | ||
| 161 | - void gainChanged(unsigned int channel, double gain); | ||
| 162 | - void modeChanged(Dso::MathMode mode); | ||
| 163 | - void usedChanged(unsigned int channel, bool used); | 175 | + void couplingChanged(unsigned int channel, Dso::Coupling coupling); ///< A coupling has been selected |
| 176 | + void gainChanged(unsigned int channel, double gain); ///< A gain has been selected | ||
| 177 | + void modeChanged(Dso::MathMode mode); ///< The mode for the math channels has been changed | ||
| 178 | + void usedChanged(unsigned int channel, bool used); ///< A channel has been enabled/disabled | ||
| 164 | }; | 179 | }; |
| 165 | 180 | ||
| 166 | 181 | ||
| @@ -182,23 +197,23 @@ class SpectrumDock : public QDockWidget { | @@ -182,23 +197,23 @@ class SpectrumDock : public QDockWidget { | ||
| 182 | protected: | 197 | protected: |
| 183 | void closeEvent(QCloseEvent *event); | 198 | void closeEvent(QCloseEvent *event); |
| 184 | 199 | ||
| 185 | - QGridLayout *dockLayout; | ||
| 186 | - QWidget *dockWidget; | ||
| 187 | - QList<QCheckBox *> usedCheckBox; | ||
| 188 | - QList<QComboBox *> magnitudeComboBox; | 200 | + QGridLayout *dockLayout; ///< The main layout for the dock window |
| 201 | + QWidget *dockWidget; ///< The main widget for the dock window | ||
| 202 | + QList<QCheckBox *> usedCheckBox; ///< Enable/disable spectrum for a channel | ||
| 203 | + QList<QComboBox *> magnitudeComboBox; ///< Select the vertical magnitude for the spectrums | ||
| 189 | 204 | ||
| 190 | - DsoSettings *settings; | 205 | + DsoSettings *settings; ///< The settings provided by the parent class |
| 191 | 206 | ||
| 192 | - QList<double> magnitudeSteps; | ||
| 193 | - QStringList magnitudeStrings; | 207 | + QList<double> magnitudeSteps; ///< The selectable magnitude steps |
| 208 | + QStringList magnitudeStrings; ///< String representations for the magnitude steps | ||
| 194 | 209 | ||
| 195 | public slots: | 210 | public slots: |
| 196 | void magnitudeSelected(int index); | 211 | void magnitudeSelected(int index); |
| 197 | void usedSwitched(bool checked); | 212 | void usedSwitched(bool checked); |
| 198 | 213 | ||
| 199 | signals: | 214 | signals: |
| 200 | - void magnitudeChanged(unsigned int channel, double magnitude); | ||
| 201 | - void usedChanged(unsigned int channel, bool used); | 215 | + void magnitudeChanged(unsigned int channel, double magnitude); ///< A magnitude has been selected |
| 216 | + void usedChanged(unsigned int channel, bool used); ///< A spectrum has been enabled/disabled | ||
| 202 | }; | 217 | }; |
| 203 | 218 | ||
| 204 | 219 |
openhantek/src/dsocontrol.h
| @@ -49,7 +49,7 @@ class DsoControl : public QThread { | @@ -49,7 +49,7 @@ class DsoControl : public QThread { | ||
| 49 | virtual void startSampling(); | 49 | virtual void startSampling(); |
| 50 | virtual void stopSampling(); | 50 | virtual void stopSampling(); |
| 51 | 51 | ||
| 52 | - virtual unsigned int getChannelCount() = 0; | 52 | + virtual unsigned int getChannelCount() = 0; ///< Get the number of channels for this oscilloscope |
| 53 | 53 | ||
| 54 | const QStringList *getSpecialTriggerSources(); | 54 | const QStringList *getSpecialTriggerSources(); |
| 55 | 55 | ||
| @@ -60,28 +60,28 @@ class DsoControl : public QThread { | @@ -60,28 +60,28 @@ class DsoControl : public QThread { | ||
| 60 | QStringList specialTriggerSources; ///< Names of the special trigger sources | 60 | QStringList specialTriggerSources; ///< Names of the special trigger sources |
| 61 | 61 | ||
| 62 | signals: | 62 | signals: |
| 63 | - void deviceConnected(); | ||
| 64 | - void deviceDisconnected(); | ||
| 65 | - void statusMessage(const QString &message, int timeout); | ||
| 66 | - void samplesAvailable(const QList<double *> *data, const QList<unsigned int> *size, double samplerate, QMutex *mutex); | 63 | + void deviceConnected(); ///< The oscilloscope device has been disconnected |
| 64 | + void deviceDisconnected(); ///< The oscilloscope device has been connected | ||
| 65 | + void statusMessage(const QString &message, int timeout); ///< Status message about the oscilloscope | ||
| 66 | + void samplesAvailable(const QList<double *> *data, const QList<unsigned int> *size, double samplerate, QMutex *mutex); ///< New sample data is available | ||
| 67 | 67 | ||
| 68 | public slots: | 68 | public slots: |
| 69 | virtual void connectDevice(); | 69 | virtual void connectDevice(); |
| 70 | virtual void disconnectDevice(); | 70 | virtual void disconnectDevice(); |
| 71 | 71 | ||
| 72 | - virtual unsigned long int setSamplerate(unsigned long int samplerate) = 0; | ||
| 73 | - virtual double setBufferSize(unsigned int size) = 0; | 72 | + virtual unsigned long int setSamplerate(unsigned long int samplerate) = 0; ///< Set the samplerate that should be met |
| 73 | + virtual double setBufferSize(unsigned int size) = 0; ///< Set the needed buffer size | ||
| 74 | 74 | ||
| 75 | - virtual int setTriggerMode(Dso::TriggerMode mode) = 0; | ||
| 76 | - virtual int setTriggerSource(bool special, unsigned int id) = 0; | ||
| 77 | - virtual double setTriggerLevel(unsigned int channel, double level) = 0; | ||
| 78 | - virtual int setTriggerSlope(Dso::Slope slope) = 0; | ||
| 79 | - virtual double setTriggerPosition(double position) = 0; | 75 | + virtual int setTriggerMode(Dso::TriggerMode mode) = 0; ///< Set the trigger mode |
| 76 | + virtual int setTriggerSource(bool special, unsigned int id) = 0; ///< Set the trigger source | ||
| 77 | + virtual double setTriggerLevel(unsigned int channel, double level) = 0; ///< Set the trigger level for a channel | ||
| 78 | + virtual int setTriggerSlope(Dso::Slope slope) = 0; ///< Set the slope that causes triggering | ||
| 79 | + virtual double setTriggerPosition(double position) = 0; ///< Set the pretrigger position (0.0 = left, 1.0 = right side) | ||
| 80 | 80 | ||
| 81 | - virtual int setChannelUsed(unsigned int channel, bool used) = 0; | ||
| 82 | - virtual int setCoupling(unsigned int channel, Dso::Coupling coupling) = 0; | ||
| 83 | - virtual double setGain(unsigned int channel, double gain) = 0; | ||
| 84 | - virtual double setOffset(unsigned int channel, double offset) = 0; | 81 | + virtual int setChannelUsed(unsigned int channel, bool used) = 0; ///< Enable/disable a channel |
| 82 | + virtual int setCoupling(unsigned int channel, Dso::Coupling coupling) = 0; ///< Set the coupling for a channel | ||
| 83 | + virtual double setGain(unsigned int channel, double gain) = 0; ///< Set the gain for a channel | ||
| 84 | + virtual double setOffset(unsigned int channel, double offset) = 0; ///< Set the graph offset of a channel | ||
| 85 | }; | 85 | }; |
| 86 | 86 | ||
| 87 | 87 |
openhantek/src/dsowidget.cpp
| @@ -42,6 +42,7 @@ | @@ -42,6 +42,7 @@ | ||
| 42 | // class DsoWidget | 42 | // class DsoWidget |
| 43 | /// \brief Initializes the components of the oszilloscope-screen. | 43 | /// \brief Initializes the components of the oszilloscope-screen. |
| 44 | /// \param settings The settings object containing the oscilloscope settings. | 44 | /// \param settings The settings object containing the oscilloscope settings. |
| 45 | +/// \param dataAnalyzer The data analyzer that should be used as data source. | ||
| 45 | /// \param parent The parent widget. | 46 | /// \param parent The parent widget. |
| 46 | /// \param flags Flags for the window manager. | 47 | /// \param flags Flags for the window manager. |
| 47 | DsoWidget::DsoWidget(DsoSettings *settings, DataAnalyzer *dataAnalyzer, QWidget *parent, Qt::WindowFlags flags) : QWidget(parent, flags) { | 48 | 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 | @@ -167,8 +168,8 @@ DsoWidget::DsoWidget(DsoSettings *settings, DataAnalyzer *dataAnalyzer, QWidget | ||
| 167 | tablePalette.setColor(QPalette::WindowText, this->settings->view.color.screen.voltage[channel]); | 168 | tablePalette.setColor(QPalette::WindowText, this->settings->view.color.screen.voltage[channel]); |
| 168 | this->measurementNameLabel.append(new QLabel(this->settings->scope.voltage[channel].name)); | 169 | this->measurementNameLabel.append(new QLabel(this->settings->scope.voltage[channel].name)); |
| 169 | this->measurementNameLabel[channel]->setPalette(tablePalette); | 170 | this->measurementNameLabel[channel]->setPalette(tablePalette); |
| 170 | - this->measurementCouplingLabel.append(new QLabel()); | ||
| 171 | - this->measurementCouplingLabel[channel]->setPalette(tablePalette); | 171 | + this->measurementMiscLabel.append(new QLabel()); |
| 172 | + this->measurementMiscLabel[channel]->setPalette(tablePalette); | ||
| 172 | this->measurementGainLabel.append(new QLabel()); | 173 | this->measurementGainLabel.append(new QLabel()); |
| 173 | this->measurementGainLabel[channel]->setAlignment(Qt::AlignRight); | 174 | this->measurementGainLabel[channel]->setAlignment(Qt::AlignRight); |
| 174 | this->measurementGainLabel[channel]->setPalette(tablePalette); | 175 | this->measurementGainLabel[channel]->setPalette(tablePalette); |
| @@ -184,12 +185,15 @@ DsoWidget::DsoWidget(DsoSettings *settings, DataAnalyzer *dataAnalyzer, QWidget | @@ -184,12 +185,15 @@ DsoWidget::DsoWidget(DsoSettings *settings, DataAnalyzer *dataAnalyzer, QWidget | ||
| 184 | this->measurementFrequencyLabel[channel]->setPalette(palette); | 185 | this->measurementFrequencyLabel[channel]->setPalette(palette); |
| 185 | this->setMeasurementVisible(channel, this->settings->scope.voltage[channel].used); | 186 | this->setMeasurementVisible(channel, this->settings->scope.voltage[channel].used); |
| 186 | this->measurementLayout->addWidget(this->measurementNameLabel[channel], channel, 0); | 187 | this->measurementLayout->addWidget(this->measurementNameLabel[channel], channel, 0); |
| 187 | - this->measurementLayout->addWidget(this->measurementCouplingLabel[channel], channel, 1); | 188 | + this->measurementLayout->addWidget(this->measurementMiscLabel[channel], channel, 1); |
| 188 | this->measurementLayout->addWidget(this->measurementGainLabel[channel], channel, 2); | 189 | this->measurementLayout->addWidget(this->measurementGainLabel[channel], channel, 2); |
| 189 | this->measurementLayout->addWidget(this->measurementMagnitudeLabel[channel], channel, 3); | 190 | this->measurementLayout->addWidget(this->measurementMagnitudeLabel[channel], channel, 3); |
| 190 | this->measurementLayout->addWidget(this->measurementAmplitudeLabel[channel], channel, 4); | 191 | this->measurementLayout->addWidget(this->measurementAmplitudeLabel[channel], channel, 4); |
| 191 | this->measurementLayout->addWidget(this->measurementFrequencyLabel[channel], channel, 5); | 192 | this->measurementLayout->addWidget(this->measurementFrequencyLabel[channel], channel, 5); |
| 192 | - this->updateVoltageCoupling(channel); | 193 | + if((unsigned int) channel < this->settings->scope.physicalChannels) |
| 194 | + this->updateVoltageCoupling(channel); | ||
| 195 | + else | ||
| 196 | + this->updateMathMode(); | ||
| 193 | this->updateVoltageDetails(channel); | 197 | this->updateVoltageDetails(channel); |
| 194 | this->updateSpectrumDetails(channel); | 198 | this->updateSpectrumDetails(channel); |
| 195 | } | 199 | } |
| @@ -256,7 +260,7 @@ void DsoWidget::adaptTriggerLevelSlider(unsigned int channel) { | @@ -256,7 +260,7 @@ void DsoWidget::adaptTriggerLevelSlider(unsigned int channel) { | ||
| 256 | /// \brief Show/Hide a line of the measurement table. | 260 | /// \brief Show/Hide a line of the measurement table. |
| 257 | void DsoWidget::setMeasurementVisible(unsigned int channel, bool visible) { | 261 | void DsoWidget::setMeasurementVisible(unsigned int channel, bool visible) { |
| 258 | this->measurementNameLabel[channel]->setVisible(visible); | 262 | this->measurementNameLabel[channel]->setVisible(visible); |
| 259 | - this->measurementCouplingLabel[channel]->setVisible(visible); | 263 | + this->measurementMiscLabel[channel]->setVisible(visible); |
| 260 | this->measurementGainLabel[channel]->setVisible(visible); | 264 | this->measurementGainLabel[channel]->setVisible(visible); |
| 261 | this->measurementMagnitudeLabel[channel]->setVisible(visible); | 265 | this->measurementMagnitudeLabel[channel]->setVisible(visible); |
| 262 | this->measurementAmplitudeLabel[channel]->setVisible(visible); | 266 | this->measurementAmplitudeLabel[channel]->setVisible(visible); |
| @@ -371,8 +375,6 @@ void DsoWidget::updateTriggerSlope() { | @@ -371,8 +375,6 @@ void DsoWidget::updateTriggerSlope() { | ||
| 371 | } | 375 | } |
| 372 | 376 | ||
| 373 | /// \brief Handles sourceChanged signal from the trigger dock. | 377 | /// \brief Handles sourceChanged signal from the trigger dock. |
| 374 | -/// \param special true for a special channel (EXT, ...) as trigger source. | ||
| 375 | -/// \param id The number of the channel, that should be used as trigger. | ||
| 376 | void DsoWidget::updateTriggerSource() { | 378 | void DsoWidget::updateTriggerSource() { |
| 377 | // Change the colors of the trigger sliders | 379 | // Change the colors of the trigger sliders |
| 378 | if(this->settings->scope.trigger.special || this->settings->scope.trigger.source >= this->settings->scope.physicalChannels) | 380 | if(this->settings->scope.trigger.special || this->settings->scope.trigger.source >= this->settings->scope.physicalChannels) |
| @@ -386,7 +388,7 @@ void DsoWidget::updateTriggerSource() { | @@ -386,7 +388,7 @@ void DsoWidget::updateTriggerSource() { | ||
| 386 | this->updateTriggerDetails(); | 388 | this->updateTriggerDetails(); |
| 387 | } | 389 | } |
| 388 | 390 | ||
| 389 | -/// \brief Handles couplingChanged signal from the vertical dock. | 391 | +/// \brief Handles couplingChanged signal from the voltage dock. |
| 390 | /// \param channel The channel whose coupling was changed. | 392 | /// \param channel The channel whose coupling was changed. |
| 391 | void DsoWidget::updateVoltageCoupling(unsigned int channel) { | 393 | void DsoWidget::updateVoltageCoupling(unsigned int channel) { |
| 392 | if(channel >= (unsigned int) this->settings->scope.voltage.count()) | 394 | if(channel >= (unsigned int) this->settings->scope.voltage.count()) |
| @@ -395,19 +397,36 @@ void DsoWidget::updateVoltageCoupling(unsigned int channel) { | @@ -395,19 +397,36 @@ void DsoWidget::updateVoltageCoupling(unsigned int channel) { | ||
| 395 | if(this->settings->scope.voltage[channel].used || this->settings->scope.spectrum[channel].used) { | 397 | if(this->settings->scope.voltage[channel].used || this->settings->scope.spectrum[channel].used) { |
| 396 | switch(this->settings->scope.voltage[channel].misc) { | 398 | switch(this->settings->scope.voltage[channel].misc) { |
| 397 | case Dso::COUPLING_AC: | 399 | case Dso::COUPLING_AC: |
| 398 | - this->measurementCouplingLabel[channel]->setText(tr("AC")); | 400 | + this->measurementMiscLabel[channel]->setText(tr("AC")); |
| 399 | break; | 401 | break; |
| 400 | case Dso::COUPLING_DC: | 402 | case Dso::COUPLING_DC: |
| 401 | - this->measurementCouplingLabel[channel]->setText(tr("DC")); | 403 | + this->measurementMiscLabel[channel]->setText(tr("DC")); |
| 402 | break; | 404 | break; |
| 403 | case Dso::COUPLING_GND: | 405 | case Dso::COUPLING_GND: |
| 404 | - this->measurementCouplingLabel[channel]->setText(tr("GND")); | 406 | + this->measurementMiscLabel[channel]->setText(tr("GND")); |
| 405 | break; | 407 | break; |
| 406 | } | 408 | } |
| 407 | } | 409 | } |
| 408 | } | 410 | } |
| 409 | 411 | ||
| 410 | -/// \brief Handles gainChanged signal from the vertical dock. | 412 | +/// \brief Handles modeChanged signal from the voltage dock. |
| 413 | +void DsoWidget::updateMathMode() { | ||
| 414 | + if(this->settings->scope.voltage[this->settings->scope.physicalChannels].used || this->settings->scope.spectrum[this->settings->scope.physicalChannels].used) { | ||
| 415 | + switch(this->settings->scope.voltage[this->settings->scope.physicalChannels].misc) { | ||
| 416 | + case Dso::MATHMODE_1ADD2: | ||
| 417 | + this->measurementMiscLabel[this->settings->scope.physicalChannels]->setText(tr("CH1 + CH2")); | ||
| 418 | + break; | ||
| 419 | + case Dso::MATHMODE_1SUB2: | ||
| 420 | + this->measurementMiscLabel[this->settings->scope.physicalChannels]->setText(tr("CH1 - CH2")); | ||
| 421 | + break; | ||
| 422 | + case Dso::MATHMODE_2SUB1: | ||
| 423 | + this->measurementMiscLabel[this->settings->scope.physicalChannels]->setText(tr("CH2 - CH1")); | ||
| 424 | + break; | ||
| 425 | + } | ||
| 426 | + } | ||
| 427 | +} | ||
| 428 | + | ||
| 429 | +/// \brief Handles gainChanged signal from the voltage dock. | ||
| 411 | /// \param channel The channel whose gain was changed. | 430 | /// \param channel The channel whose gain was changed. |
| 412 | void DsoWidget::updateVoltageGain(unsigned int channel) { | 431 | void DsoWidget::updateVoltageGain(unsigned int channel) { |
| 413 | if(channel >= (unsigned int) this->settings->scope.voltage.count()) | 432 | if(channel >= (unsigned int) this->settings->scope.voltage.count()) |
| @@ -419,7 +438,7 @@ void DsoWidget::updateVoltageGain(unsigned int channel) { | @@ -419,7 +438,7 @@ void DsoWidget::updateVoltageGain(unsigned int channel) { | ||
| 419 | this->updateVoltageDetails(channel); | 438 | this->updateVoltageDetails(channel); |
| 420 | } | 439 | } |
| 421 | 440 | ||
| 422 | -/// \brief Handles usedChanged signal from the vertical dock. | 441 | +/// \brief Handles usedChanged signal from the voltage dock. |
| 423 | /// \param channel The channel whose used-state was changed. | 442 | /// \param channel The channel whose used-state was changed. |
| 424 | /// \param used The new used-state for the channel. | 443 | /// \param used The new used-state for the channel. |
| 425 | void DsoWidget::updateVoltageUsed(unsigned int channel, bool used) { | 444 | void DsoWidget::updateVoltageUsed(unsigned int channel, bool used) { |
| @@ -434,7 +453,6 @@ void DsoWidget::updateVoltageUsed(unsigned int channel, bool used) { | @@ -434,7 +453,6 @@ void DsoWidget::updateVoltageUsed(unsigned int channel, bool used) { | ||
| 434 | } | 453 | } |
| 435 | 454 | ||
| 436 | /// \brief Change the buffer size. | 455 | /// \brief Change the buffer size. |
| 437 | -/// \param size The size of the buffer. | ||
| 438 | void DsoWidget::updateBufferSize() { | 456 | void DsoWidget::updateBufferSize() { |
| 439 | this->settingsBufferLabel->setText(tr("%1 S").arg(this->settings->scope.horizontal.samples)); | 457 | this->settingsBufferLabel->setText(tr("%1 S").arg(this->settings->scope.horizontal.samples)); |
| 440 | } | 458 | } |
| @@ -531,7 +549,7 @@ void DsoWidget::updateTriggerPosition(int index, double value) { | @@ -531,7 +549,7 @@ void DsoWidget::updateTriggerPosition(int index, double value) { | ||
| 531 | } | 549 | } |
| 532 | 550 | ||
| 533 | /// \brief Handles valueChanged signal from the trigger level slider. | 551 | /// \brief Handles valueChanged signal from the trigger level slider. |
| 534 | -/// \param index The index of the slider. | 552 | +/// \param channel The index of the slider. |
| 535 | /// \param value The new trigger level. | 553 | /// \param value The new trigger level. |
| 536 | void DsoWidget::updateTriggerLevel(int channel, double value) { | 554 | void DsoWidget::updateTriggerLevel(int channel, double value) { |
| 537 | this->settings->scope.voltage[channel].trigger = value; | 555 | this->settings->scope.voltage[channel].trigger = value; |
openhantek/src/dsowidget.h
| @@ -58,32 +58,40 @@ class DsoWidget : public QWidget { | @@ -58,32 +58,40 @@ class DsoWidget : public QWidget { | ||
| 58 | void updateTriggerDetails(); | 58 | void updateTriggerDetails(); |
| 59 | void updateVoltageDetails(unsigned int channel); | 59 | void updateVoltageDetails(unsigned int channel); |
| 60 | 60 | ||
| 61 | - QGridLayout *mainLayout; | ||
| 62 | - GlGenerator *generator; | ||
| 63 | - GlScope *mainScope, *zoomScope; | ||
| 64 | - LevelSlider *offsetSlider; | ||
| 65 | - LevelSlider *triggerPositionSlider, *triggerLevelSlider; | ||
| 66 | - LevelSlider *markerSlider; | 61 | + QGridLayout *mainLayout; ///< The main layout for this widget |
| 62 | + GlGenerator *generator; ///< The generator for the OpenGL vertex arrays | ||
| 63 | + GlScope *mainScope; ///< The main scope screen | ||
| 64 | + GlScope *zoomScope; ///< The optional magnified scope screen | ||
| 65 | + LevelSlider *offsetSlider; ///< The sliders for the graph offsets | ||
| 66 | + LevelSlider *triggerPositionSlider; ///< The slider for the pretrigger | ||
| 67 | + LevelSlider *triggerLevelSlider; ///< The sliders for the trigger level | ||
| 68 | + LevelSlider *markerSlider; ///< The sliders for the markers | ||
| 67 | 69 | ||
| 68 | - QHBoxLayout *settingsLayout; | ||
| 69 | - QLabel *settingsTriggerLabel; | ||
| 70 | - QLabel *settingsBufferLabel, *settingsRateLabel; | ||
| 71 | - QLabel *settingsTimebaseLabel, *settingsFrequencybaseLabel; | 70 | + QHBoxLayout *settingsLayout; ///< The table for the settings info |
| 71 | + QLabel *settingsTriggerLabel; ///< The trigger details | ||
| 72 | + QLabel *settingsBufferLabel; ///< The buffer size | ||
| 73 | + QLabel *settingsRateLabel; ///< The samplerate | ||
| 74 | + QLabel *settingsTimebaseLabel; ///< The timebase of the main scope | ||
| 75 | + QLabel *settingsFrequencybaseLabel; ///< The frequencybase of the main scope | ||
| 72 | 76 | ||
| 73 | - QHBoxLayout *markerLayout; | ||
| 74 | - QLabel *markerInfoLabel; | ||
| 75 | - QLabel *markerTimeLabel, *markerFrequencyLabel; | ||
| 76 | - QLabel *markerTimebaseLabel, *markerFrequencybaseLabel; | 77 | + QHBoxLayout *markerLayout; ///< The table for the marker details |
| 78 | + QLabel *markerInfoLabel; ///< The info about the zoom factor | ||
| 79 | + QLabel *markerTimeLabel; ///< The time period between the markers | ||
| 80 | + QLabel *markerFrequencyLabel; ///< The frequency for the time period | ||
| 81 | + QLabel *markerTimebaseLabel; ///< The timebase for the zoomed scope | ||
| 82 | + QLabel *markerFrequencybaseLabel; ///< The frequencybase for the zoomed scope | ||
| 77 | 83 | ||
| 78 | - QGridLayout *measurementLayout; | ||
| 79 | - QList<QLabel *> measurementNameLabel; | ||
| 80 | - QList<QLabel *> measurementGainLabel, measurementMagnitudeLabel; | ||
| 81 | - QList<QLabel *> measurementCouplingLabel; | ||
| 82 | - QList<QLabel *> measurementAmplitudeLabel, measurementFrequencyLabel; | 84 | + QGridLayout *measurementLayout; ///< The table for the signal details |
| 85 | + QList<QLabel *> measurementNameLabel; ///< The name of the channel | ||
| 86 | + QList<QLabel *> measurementGainLabel; ///< The gain for the voltage (V/div) | ||
| 87 | + QList<QLabel *> measurementMagnitudeLabel; ///< The magnitude for the spectrum (dB/div) | ||
| 88 | + QList<QLabel *> measurementMiscLabel; ///< Coupling or math mode | ||
| 89 | + QList<QLabel *> measurementAmplitudeLabel; ///< Amplitude of the signal (V) | ||
| 90 | + QList<QLabel *> measurementFrequencyLabel; ///< Frequency of the signal (Hz) | ||
| 83 | 91 | ||
| 84 | - DsoSettings *settings; | 92 | + DsoSettings *settings; ///< The settings provided by the main window |
| 85 | 93 | ||
| 86 | - DataAnalyzer *dataAnalyzer; | 94 | + DataAnalyzer *dataAnalyzer; ///< The data source provided by the main window |
| 87 | 95 | ||
| 88 | public slots: | 96 | public slots: |
| 89 | // Horizontal axis | 97 | // Horizontal axis |
| @@ -103,6 +111,7 @@ class DsoWidget : public QWidget { | @@ -103,6 +111,7 @@ class DsoWidget : public QWidget { | ||
| 103 | 111 | ||
| 104 | // Vertical axis | 112 | // Vertical axis |
| 105 | void updateVoltageCoupling(unsigned int channel); | 113 | void updateVoltageCoupling(unsigned int channel); |
| 114 | + void updateMathMode(); | ||
| 106 | void updateVoltageGain(unsigned int channel); | 115 | void updateVoltageGain(unsigned int channel); |
| 107 | void updateVoltageUsed(unsigned int channel, bool used); | 116 | void updateVoltageUsed(unsigned int channel, bool used); |
| 108 | 117 | ||
| @@ -128,10 +137,10 @@ class DsoWidget : public QWidget { | @@ -128,10 +137,10 @@ class DsoWidget : public QWidget { | ||
| 128 | 137 | ||
| 129 | signals: | 138 | signals: |
| 130 | // Sliders | 139 | // Sliders |
| 131 | - void offsetChanged(unsigned int channel, double value); | ||
| 132 | - void triggerPositionChanged(double value); | ||
| 133 | - void triggerLevelChanged(unsigned int channel, double value); | ||
| 134 | - void markerChanged(unsigned int marker, double value); | 140 | + void offsetChanged(unsigned int channel, double value); ///< A graph offset has been changed |
| 141 | + void triggerPositionChanged(double value); ///< The pretrigger has been changed | ||
| 142 | + void triggerLevelChanged(unsigned int channel, double value); ///< A trigger level has been changed | ||
| 143 | + void markerChanged(unsigned int marker, double value); ///< A marker position has been changed | ||
| 135 | }; | 144 | }; |
| 136 | 145 | ||
| 137 | 146 |
openhantek/src/glgenerator.cpp
| @@ -55,7 +55,7 @@ unsigned long int GlArray::getSize() { | @@ -55,7 +55,7 @@ unsigned long int GlArray::getSize() { | ||
| 55 | /// \brief Set the size of the array. | 55 | /// \brief Set the size of the array. |
| 56 | /// Previous array contents are lost. | 56 | /// Previous array contents are lost. |
| 57 | /// \param size New number of array elements. | 57 | /// \param size New number of array elements. |
| 58 | -void GlArray::setSize(unsigned long size) { | 58 | +void GlArray::setSize(unsigned long int size) { |
| 59 | if(this->size == size) | 59 | if(this->size == size) |
| 60 | return; | 60 | return; |
| 61 | 61 |
openhantek/src/glgenerator.h
| @@ -58,10 +58,10 @@ class GlArray { | @@ -58,10 +58,10 @@ class GlArray { | ||
| 58 | unsigned long int getSize(); | 58 | unsigned long int getSize(); |
| 59 | void setSize(unsigned long int size); | 59 | void setSize(unsigned long int size); |
| 60 | 60 | ||
| 61 | - GLfloat *data; | 61 | + GLfloat *data; ///< Pointer to the array |
| 62 | 62 | ||
| 63 | protected: | 63 | protected: |
| 64 | - unsigned long int size; | 64 | + unsigned long int size; ///< The array size (Number of GLfloat values) |
| 65 | }; | 65 | }; |
| 66 | 66 | ||
| 67 | //////////////////////////////////////////////////////////////////////////////// | 67 | //////////////////////////////////////////////////////////////////////////////// |
| @@ -94,7 +94,7 @@ class GlGenerator : public QObject { | @@ -94,7 +94,7 @@ class GlGenerator : public QObject { | ||
| 94 | void generateGraphs(); | 94 | void generateGraphs(); |
| 95 | 95 | ||
| 96 | signals: | 96 | signals: |
| 97 | - void graphsGenerated(); | 97 | + void graphsGenerated(); ///< The graphs are ready to be drawn |
| 98 | }; | 98 | }; |
| 99 | 99 | ||
| 100 | 100 |
openhantek/src/glscope.cpp
| @@ -39,6 +39,7 @@ | @@ -39,6 +39,7 @@ | ||
| 39 | //////////////////////////////////////////////////////////////////////////////// | 39 | //////////////////////////////////////////////////////////////////////////////// |
| 40 | // class GlScope | 40 | // class GlScope |
| 41 | /// \brief Initializes the scope widget. | 41 | /// \brief Initializes the scope widget. |
| 42 | +/// \param settings The settings that should be used. | ||
| 42 | /// \param parent The parent widget. | 43 | /// \param parent The parent widget. |
| 43 | GlScope::GlScope(DsoSettings *settings, QWidget *parent) : QGLWidget(parent) { | 44 | GlScope::GlScope(DsoSettings *settings, QWidget *parent) : QGLWidget(parent) { |
| 44 | this->settings = settings; | 45 | this->settings = settings; |
openhantek/src/hantek/control.cpp
| @@ -454,7 +454,7 @@ namespace Hantek { | @@ -454,7 +454,7 @@ namespace Hantek { | ||
| 454 | 454 | ||
| 455 | /// \brief Enables/disables filtering of the given channel. | 455 | /// \brief Enables/disables filtering of the given channel. |
| 456 | /// \param channel The channel that should be set. | 456 | /// \param channel The channel that should be set. |
| 457 | - /// \param filtered true if the channel should be filtered. | 457 | + /// \param used true if the channel should be sampled. |
| 458 | /// \return 0 on success, -1 on invalid channel. | 458 | /// \return 0 on success, -1 on invalid channel. |
| 459 | int Control::setChannelUsed(unsigned int channel, bool used) { | 459 | int Control::setChannelUsed(unsigned int channel, bool used) { |
| 460 | if(channel >= HANTEK_CHANNELS) | 460 | if(channel >= HANTEK_CHANNELS) |
| @@ -495,6 +495,7 @@ namespace Hantek { | @@ -495,6 +495,7 @@ namespace Hantek { | ||
| 495 | } | 495 | } |
| 496 | 496 | ||
| 497 | /// \brief Sets the gain for the given channel. | 497 | /// \brief Sets the gain for the given channel. |
| 498 | + /// \param channel The channel that should be set. | ||
| 498 | /// \param gain The gain that should be met (V/div). | 499 | /// \param gain The gain that should be met (V/div). |
| 499 | /// \return The gain that has been set, -1.0 on invalid channel. | 500 | /// \return The gain that has been set, -1.0 on invalid channel. |
| 500 | double Control::setGain(unsigned int channel, double gain) { | 501 | double Control::setGain(unsigned int channel, double gain) { |
| @@ -636,7 +637,7 @@ namespace Hantek { | @@ -636,7 +637,7 @@ namespace Hantek { | ||
| 636 | } | 637 | } |
| 637 | 638 | ||
| 638 | /// \brief Set the trigger position. | 639 | /// \brief Set the trigger position. |
| 639 | - /// \param level The new trigger position (0.0 - 1.0). | 640 | + /// \param position The new trigger position (0.0 - 1.0). |
| 640 | /// \return The trigger position that has been set. | 641 | /// \return The trigger position that has been set. |
| 641 | double Control::setTriggerPosition(double position) { | 642 | double Control::setTriggerPosition(double position) { |
| 642 | // Calculate the position value (Varying start point, measured in samples) | 643 | // Calculate the position value (Varying start point, measured in samples) |
openhantek/src/hantek/control.h
| @@ -54,7 +54,7 @@ namespace Hantek { | @@ -54,7 +54,7 @@ namespace Hantek { | ||
| 54 | 54 | ||
| 55 | ////////////////////////////////////////////////////////////////////////////// | 55 | ////////////////////////////////////////////////////////////////////////////// |
| 56 | /// \class Control hantek/control.h | 56 | /// \class Control hantek/control.h |
| 57 | - /// \brief The DsoControl abstraction layer for Hantek USB DSOs. | 57 | + /// \brief The DsoControl abstraction layer for %Hantek USB DSOs. |
| 58 | class Control : public DsoControl { | 58 | class Control : public DsoControl { |
| 59 | Q_OBJECT | 59 | Q_OBJECT |
| 60 | 60 | ||
| @@ -71,7 +71,7 @@ namespace Hantek { | @@ -71,7 +71,7 @@ namespace Hantek { | ||
| 71 | int getCaptureState(); | 71 | int getCaptureState(); |
| 72 | int getSamples(); | 72 | int getSamples(); |
| 73 | 73 | ||
| 74 | - Device *device; | 74 | + Device *device; ///< The USB device for the oscilloscope |
| 75 | 75 | ||
| 76 | Helper::DataArray<unsigned char> *command[COMMAND_COUNT]; ///< Pointers to commands, ready to be transmitted | 76 | Helper::DataArray<unsigned char> *command[COMMAND_COUNT]; ///< Pointers to commands, ready to be transmitted |
| 77 | bool commandPending[COMMAND_COUNT]; ///< true, when the command should be executed | 77 | bool commandPending[COMMAND_COUNT]; ///< true, when the command should be executed |
| @@ -83,16 +83,16 @@ namespace Hantek { | @@ -83,16 +83,16 @@ namespace Hantek { | ||
| 83 | unsigned short channelLevels[HANTEK_CHANNELS][GAIN_COUNT][OFFSET_COUNT]; | 83 | unsigned short channelLevels[HANTEK_CHANNELS][GAIN_COUNT][OFFSET_COUNT]; |
| 84 | 84 | ||
| 85 | // Various cached settings | 85 | // Various cached settings |
| 86 | - Samplerate samplerate; | ||
| 87 | - Gain gain[HANTEK_CHANNELS]; | ||
| 88 | - double offset[HANTEK_CHANNELS]; | ||
| 89 | - double offsetReal[HANTEK_CHANNELS]; | ||
| 90 | - double triggerLevel[HANTEK_CHANNELS]; | ||
| 91 | - unsigned int bufferSize; | ||
| 92 | - unsigned int triggerPoint; | ||
| 93 | - Dso::TriggerMode triggerMode; | ||
| 94 | - bool triggerSpecial; | ||
| 95 | - unsigned int triggerSource; | 86 | + Samplerate samplerate; ///< The samplerate id |
| 87 | + Gain gain[HANTEK_CHANNELS]; ///< The gain id | ||
| 88 | + double offset[HANTEK_CHANNELS]; ///< The current screen offset for each channel | ||
| 89 | + double offsetReal[HANTEK_CHANNELS]; ///< The real offset for each channel (Due to quantization) | ||
| 90 | + double triggerLevel[HANTEK_CHANNELS]; ///< The trigger level for each channel in V | ||
| 91 | + unsigned int bufferSize; ///< The buffer size in samples | ||
| 92 | + unsigned int triggerPoint; ///< The trigger point value | ||
| 93 | + Dso::TriggerMode triggerMode; ///< The trigger mode | ||
| 94 | + bool triggerSpecial; ///< true, if the trigger source is special | ||
| 95 | + unsigned int triggerSource; ///< The trigger source | ||
| 96 | 96 | ||
| 97 | QList<double *> samples; ///< Sample data arrays | 97 | QList<double *> samples; ///< Sample data arrays |
| 98 | QList<unsigned int> samplesSize; ///< Number of samples data array | 98 | QList<unsigned int> samplesSize; ///< Number of samples data array |
openhantek/src/hantek/device.h
| @@ -84,7 +84,7 @@ namespace Hantek { | @@ -84,7 +84,7 @@ namespace Hantek { | ||
| 84 | QStringList modelStrings; ///< The name as QString for each #Model | 84 | QStringList modelStrings; ///< The name as QString for each #Model |
| 85 | 85 | ||
| 86 | // Command buffers | 86 | // Command buffers |
| 87 | - ControlBeginCommand *beginCommandControl; | 87 | + ControlBeginCommand *beginCommandControl; ///< Buffer for the CONTROL_BEGINCOMMAND control command |
| 88 | 88 | ||
| 89 | // Libusb specific variables | 89 | // Libusb specific variables |
| 90 | #if LIBUSB_VERSION != 0 | 90 | #if LIBUSB_VERSION != 0 |
| @@ -99,8 +99,8 @@ namespace Hantek { | @@ -99,8 +99,8 @@ namespace Hantek { | ||
| 99 | int inPacketLength; ///< Packet length for the IN endpoint | 99 | int inPacketLength; ///< Packet length for the IN endpoint |
| 100 | 100 | ||
| 101 | signals: | 101 | signals: |
| 102 | - void connected(); | ||
| 103 | - void disconnected(); | 102 | + void connected(); ///< The device has been connected and initialized |
| 103 | + void disconnected(); ///< The device has been disconnected | ||
| 104 | 104 | ||
| 105 | public slots: | 105 | public slots: |
| 106 | 106 |
openhantek/src/hantek/types.cpp
| @@ -101,17 +101,21 @@ namespace Hantek { | @@ -101,17 +101,21 @@ namespace Hantek { | ||
| 101 | } | 101 | } |
| 102 | 102 | ||
| 103 | /// \brief Sets the data bytes to the specified values. | 103 | /// \brief Sets the data bytes to the specified values. |
| 104 | - /// \param tsr1Byte The Tsr1 value. | ||
| 105 | - /// \param tsr2Byte The Tsr2 value. | ||
| 106 | - /// \param timebase The new timebase value. | ||
| 107 | - /// \param triggerPosition The new horizontal trigger position. | ||
| 108 | - 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<unsigned char>(12) { | 104 | + /// \param samplerate The samplerate value. |
| 105 | + /// \param triggerPosition The trigger position value. | ||
| 106 | + /// \param triggerSource The trigger source id (Tsr1). | ||
| 107 | + /// \param sampleSize The buffer size id (Tsr1). | ||
| 108 | + /// \param samplerateFast The samplerateFast value (Tsr1). | ||
| 109 | + /// \param usedChannel The enabled channels (Tsr2). | ||
| 110 | + /// \param fastRate The fastRate state (Tsr2). | ||
| 111 | + /// \param triggerSlope The triggerSlope value (Tsr2). | ||
| 112 | + 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<unsigned char>(12) { | ||
| 109 | this->init(); | 113 | this->init(); |
| 110 | 114 | ||
| 111 | this->setTriggerSource(triggerSource); | 115 | this->setTriggerSource(triggerSource); |
| 112 | this->setSampleSize(sampleSize); | 116 | this->setSampleSize(sampleSize); |
| 113 | - this->setSamplerateFast(timebaseFast); | ||
| 114 | - this->setUsedChannel(selectedChannel); | 117 | + this->setSamplerateFast(samplerateFast); |
| 118 | + this->setUsedChannel(usedChannel); | ||
| 115 | this->setFastRate(fastRate); | 119 | this->setFastRate(fastRate); |
| 116 | this->setTriggerSlope(triggerSlope); | 120 | this->setTriggerSlope(triggerSlope); |
| 117 | this->setSamplerate(samplerate); | 121 | this->setSamplerate(samplerate); |
| @@ -154,16 +158,16 @@ namespace Hantek { | @@ -154,16 +158,16 @@ namespace Hantek { | ||
| 154 | ((Tsr1Bits *) &(this->array[2]))->samplerateFast = value; | 158 | ((Tsr1Bits *) &(this->array[2]))->samplerateFast = value; |
| 155 | } | 159 | } |
| 156 | 160 | ||
| 157 | - /// \brief Get the selectedChannel value in Tsr2Bits. | ||
| 158 | - /// \return The selectedChannel value. | 161 | + /// \brief Get the usedChannel value in Tsr2Bits. |
| 162 | + /// \return The usedChannel value. | ||
| 159 | unsigned char CommandSetTriggerAndSamplerate::getUsedChannel() { | 163 | unsigned char CommandSetTriggerAndSamplerate::getUsedChannel() { |
| 160 | - return ((Tsr2Bits *) &(this->array[3]))->selectedChannel; | 164 | + return ((Tsr2Bits *) &(this->array[3]))->usedChannel; |
| 161 | } | 165 | } |
| 162 | 166 | ||
| 163 | - /// \brief Set the selectedChannel in Tsr2Bits to the given value. | ||
| 164 | - /// \param value The new selectedChannel value. | 167 | + /// \brief Set the usedChannel in Tsr2Bits to the given value. |
| 168 | + /// \param value The new usedChannel value. | ||
| 165 | void CommandSetTriggerAndSamplerate::setUsedChannel(unsigned char value) { | 169 | void CommandSetTriggerAndSamplerate::setUsedChannel(unsigned char value) { |
| 166 | - ((Tsr2Bits *) &(this->array[3]))->selectedChannel = value; | 170 | + ((Tsr2Bits *) &(this->array[3]))->usedChannel = value; |
| 167 | } | 171 | } |
| 168 | 172 | ||
| 169 | /// \brief Get the fastRate state in Tsr2Bits. | 173 | /// \brief Get the fastRate state in Tsr2Bits. |
| @@ -197,7 +201,7 @@ namespace Hantek { | @@ -197,7 +201,7 @@ namespace Hantek { | ||
| 197 | } | 201 | } |
| 198 | 202 | ||
| 199 | /// \brief Set the Samplerate to the given value. | 203 | /// \brief Set the Samplerate to the given value. |
| 200 | - /// \param timebase The new samplerate value. | 204 | + /// \param samplerate The new samplerate value. |
| 201 | void CommandSetTriggerAndSamplerate::setSamplerate(unsigned short int samplerate) { | 205 | void CommandSetTriggerAndSamplerate::setSamplerate(unsigned short int samplerate) { |
| 202 | this->array[4] = (unsigned char) samplerate; | 206 | this->array[4] = (unsigned char) samplerate; |
| 203 | this->array[5] = (unsigned char) (samplerate >> 8); | 207 | this->array[5] = (unsigned char) (samplerate >> 8); |
| @@ -325,7 +329,7 @@ namespace Hantek { | @@ -325,7 +329,7 @@ namespace Hantek { | ||
| 325 | void CommandSetGain::init() { | 329 | void CommandSetGain::init() { |
| 326 | this->array[0] = COMMAND_SETGAIN; | 330 | this->array[0] = COMMAND_SETGAIN; |
| 327 | this->array[1] = 0x0f; | 331 | this->array[1] = 0x0f; |
| 328 | - ((GainBits *) &(this->array[2]))->constant = 3; | 332 | + ((GainBits *) &(this->array[2]))->reserved = 3; |
| 329 | } | 333 | } |
| 330 | 334 | ||
| 331 | 335 | ||
| @@ -421,7 +425,7 @@ namespace Hantek { | @@ -421,7 +425,7 @@ namespace Hantek { | ||
| 421 | /// \brief Sets the offsets to the given values. | 425 | /// \brief Sets the offsets to the given values. |
| 422 | /// \param channel1 The offset for channel 1. | 426 | /// \param channel1 The offset for channel 1. |
| 423 | /// \param channel2 The offset for channel 2. | 427 | /// \param channel2 The offset for channel 2. |
| 424 | - /// \param ext The offset for ext. trigger. | 428 | + /// \param trigger The offset for ext. trigger. |
| 425 | ControlSetOffset::ControlSetOffset(unsigned short int channel1, unsigned short int channel2, unsigned short int trigger) : Helper::DataArray<unsigned char>(17) { | 429 | ControlSetOffset::ControlSetOffset(unsigned short int channel1, unsigned short int channel2, unsigned short int trigger) : Helper::DataArray<unsigned char>(17) { |
| 426 | this->setChannel(0, channel1); | 430 | this->setChannel(0, channel1); |
| 427 | this->setChannel(1, channel2); | 431 | this->setChannel(1, channel2); |
| @@ -538,7 +542,7 @@ namespace Hantek { | @@ -538,7 +542,7 @@ namespace Hantek { | ||
| 538 | 542 | ||
| 539 | /// \brief Set the coupling relay for the given channel. | 543 | /// \brief Set the coupling relay for the given channel. |
| 540 | /// \param channel The channel that should be set. | 544 | /// \param channel The channel that should be set. |
| 541 | - /// \param below true, if the coupling of the channel should be DC. | 545 | + /// \param dc true, if the coupling of the channel should be DC. |
| 542 | void ControlSetRelays::setCoupling(unsigned int channel, bool dc) { | 546 | void ControlSetRelays::setCoupling(unsigned int channel, bool dc) { |
| 543 | if(channel == 0) | 547 | if(channel == 0) |
| 544 | this->array[3] = dc ? 0xfd : 0x02; | 548 | this->array[3] = dc ? 0xfd : 0x02; |
| @@ -553,7 +557,7 @@ namespace Hantek { | @@ -553,7 +557,7 @@ namespace Hantek { | ||
| 553 | } | 557 | } |
| 554 | 558 | ||
| 555 | /// \brief Set the external trigger relay. | 559 | /// \brief Set the external trigger relay. |
| 556 | - /// \param below true, if the trigger should be external (EXT-Connector). | 560 | + /// \param ext true, if the trigger should be external (EXT-Connector). |
| 557 | void ControlSetRelays::setTrigger(bool ext) { | 561 | void ControlSetRelays::setTrigger(bool ext) { |
| 558 | this->array[7] = ext ? 0xfe : 0x01; | 562 | this->array[7] = ext ? 0xfe : 0x01; |
| 559 | } | 563 | } |
openhantek/src/hantek/types.h
| @@ -44,7 +44,7 @@ | @@ -44,7 +44,7 @@ | ||
| 44 | 44 | ||
| 45 | //////////////////////////////////////////////////////////////////////////////// | 45 | //////////////////////////////////////////////////////////////////////////////// |
| 46 | /// \namespace Hantek hantek/types.h | 46 | /// \namespace Hantek hantek/types.h |
| 47 | -/// \brief All Hantek DSO device specific things. | 47 | +/// \brief All %Hantek DSO device specific things. |
| 48 | namespace Hantek { | 48 | namespace Hantek { |
| 49 | ////////////////////////////////////////////////////////////////////////////// | 49 | ////////////////////////////////////////////////////////////////////////////// |
| 50 | /// \enum CommandCode hantek/types.h | 50 | /// \enum CommandCode hantek/types.h |
| @@ -401,8 +401,8 @@ namespace Hantek { | @@ -401,8 +401,8 @@ namespace Hantek { | ||
| 401 | /// \enum LevelOffset hantek/types.h | 401 | /// \enum LevelOffset hantek/types.h |
| 402 | /// \brief The array indicies for the CalibrationData. | 402 | /// \brief The array indicies for the CalibrationData. |
| 403 | enum LevelOffset { | 403 | enum LevelOffset { |
| 404 | - OFFSET_START, | ||
| 405 | - OFFSET_END, | 404 | + OFFSET_START, ///< The channel level at the bottom of the scope |
| 405 | + OFFSET_END, ///< The channel level at the top of the scope | ||
| 406 | OFFSET_COUNT | 406 | OFFSET_COUNT |
| 407 | }; | 407 | }; |
| 408 | 408 | ||
| @@ -410,70 +410,70 @@ namespace Hantek { | @@ -410,70 +410,70 @@ namespace Hantek { | ||
| 410 | /// \struct FilterBits hantek/types.h | 410 | /// \struct FilterBits hantek/types.h |
| 411 | /// \brief The bits for COMMAND_SETFILTER. | 411 | /// \brief The bits for COMMAND_SETFILTER. |
| 412 | struct FilterBits { | 412 | struct FilterBits { |
| 413 | - unsigned char channel1:1; | ||
| 414 | - unsigned char channel2:1; | ||
| 415 | - unsigned char trigger:1; | ||
| 416 | - unsigned char reserved:5; | 413 | + unsigned char channel1:1; ///< Set to true when channel 1 isn't used |
| 414 | + unsigned char channel2:1; ///< Set to true when channel 2 isn't used | ||
| 415 | + unsigned char trigger:1; ///< Set to true when trigger isn't used | ||
| 416 | + unsigned char reserved:5; ///< Unused bits | ||
| 417 | }; | 417 | }; |
| 418 | 418 | ||
| 419 | ////////////////////////////////////////////////////////////////////////////// | 419 | ////////////////////////////////////////////////////////////////////////////// |
| 420 | /// \union FilterByte hantek/types.h | 420 | /// \union FilterByte hantek/types.h |
| 421 | /// \brief Allows to read the FilterBits as unsigned char. | 421 | /// \brief Allows to read the FilterBits as unsigned char. |
| 422 | union FilterByte { | 422 | union FilterByte { |
| 423 | - FilterBits bits; | ||
| 424 | - unsigned char byte; | 423 | + FilterBits bits; ///< Bitfield representation |
| 424 | + unsigned char byte; ///< Full byte as unsigned char | ||
| 425 | }; | 425 | }; |
| 426 | 426 | ||
| 427 | ////////////////////////////////////////////////////////////////////////////// | 427 | ////////////////////////////////////////////////////////////////////////////// |
| 428 | /// \struct GainBits hantek/types.h | 428 | /// \struct GainBits hantek/types.h |
| 429 | - /// \brief The gain bits for COMMAND_SETVOLTAGEANDCOUPLING. | 429 | + /// \brief The gain bits for COMMAND_SETGAIN. |
| 430 | struct GainBits { | 430 | struct GainBits { |
| 431 | - unsigned char channel1:2; | ||
| 432 | - unsigned char channel2:2; | ||
| 433 | - unsigned char constant:4; | 431 | + unsigned char channel1:2; ///< Gain for CH1, 0 = 1e* V, 1 = 2e*, 2 = 5e* |
| 432 | + unsigned char channel2:2; ///< Gain for CH1, 0 = 1e* V, 1 = 2e*, 2 = 5e* | ||
| 433 | + unsigned char reserved:4; ///< Unused bits | ||
| 434 | }; | 434 | }; |
| 435 | 435 | ||
| 436 | ////////////////////////////////////////////////////////////////////////////// | 436 | ////////////////////////////////////////////////////////////////////////////// |
| 437 | /// \union GainByte hantek/types.h | 437 | /// \union GainByte hantek/types.h |
| 438 | /// \brief Allows to read the GainBits as unsigned char. | 438 | /// \brief Allows to read the GainBits as unsigned char. |
| 439 | union GainByte { | 439 | union GainByte { |
| 440 | - GainBits bits; | ||
| 441 | - unsigned char byte; | 440 | + GainBits bits; ///< Bitfield representation |
| 441 | + unsigned char byte; ///< Full byte as unsigned char | ||
| 442 | }; | 442 | }; |
| 443 | 443 | ||
| 444 | ////////////////////////////////////////////////////////////////////////////// | 444 | ////////////////////////////////////////////////////////////////////////////// |
| 445 | /// \struct Tsr1Bits hantek/types.h | 445 | /// \struct Tsr1Bits hantek/types.h |
| 446 | /// \brief Trigger and samplerate bits (Byte 1). | 446 | /// \brief Trigger and samplerate bits (Byte 1). |
| 447 | struct Tsr1Bits { | 447 | struct Tsr1Bits { |
| 448 | - unsigned char triggerSource:2; | ||
| 449 | - unsigned char sampleSize:3; | ||
| 450 | - unsigned char samplerateFast:3; | 448 | + unsigned char triggerSource:2; ///< The trigger source, see Hantek::TriggerSource |
| 449 | + unsigned char sampleSize:3; ///< Buffer size, 1 = 10240 S, 2 = 32768 S | ||
| 450 | + unsigned char samplerateFast:3; ///< samplerate id for fast sampling rates | ||
| 451 | }; | 451 | }; |
| 452 | 452 | ||
| 453 | ////////////////////////////////////////////////////////////////////////////// | 453 | ////////////////////////////////////////////////////////////////////////////// |
| 454 | /// \union Tsr1Byte hantek/types.h | 454 | /// \union Tsr1Byte hantek/types.h |
| 455 | /// \brief Allows to read the Tsr1Bits as unsigned char. | 455 | /// \brief Allows to read the Tsr1Bits as unsigned char. |
| 456 | union Tsr1Byte { | 456 | union Tsr1Byte { |
| 457 | - Tsr1Bits bits; | ||
| 458 | - unsigned char byte; | 457 | + Tsr1Bits bits; ///< Bitfield representation. |
| 458 | + unsigned char byte; ///< Full byte as unsigned char. | ||
| 459 | }; | 459 | }; |
| 460 | 460 | ||
| 461 | ////////////////////////////////////////////////////////////////////////////// | 461 | ////////////////////////////////////////////////////////////////////////////// |
| 462 | /// \struct Tsr2Bits hantek/types.h | 462 | /// \struct Tsr2Bits hantek/types.h |
| 463 | /// \brief Trigger and samplerate bits (Byte 2). | 463 | /// \brief Trigger and samplerate bits (Byte 2). |
| 464 | struct Tsr2Bits { | 464 | struct Tsr2Bits { |
| 465 | - unsigned char selectedChannel:2; | ||
| 466 | - unsigned char fastRate:1; | ||
| 467 | - unsigned char triggerSlope:1; | ||
| 468 | - unsigned char reserved:4; | 465 | + unsigned char usedChannel:2; ///< Used channels, see Hantek::UsedChannels |
| 466 | + unsigned char fastRate:1; ///< true, if one channels uses all buffers | ||
| 467 | + unsigned char triggerSlope:1; ///< The trigger slope, see Dso::Slope | ||
| 468 | + unsigned char reserved:4; ///< Unused bits | ||
| 469 | }; | 469 | }; |
| 470 | 470 | ||
| 471 | ////////////////////////////////////////////////////////////////////////////// | 471 | ////////////////////////////////////////////////////////////////////////////// |
| 472 | /// \union Tsr2Byte hantek/types.h | 472 | /// \union Tsr2Byte hantek/types.h |
| 473 | /// \brief Allows to read the Tsr2Bits as unsigned char. | 473 | /// \brief Allows to read the Tsr2Bits as unsigned char. |
| 474 | union Tsr2Byte { | 474 | union Tsr2Byte { |
| 475 | - Tsr2Bits bits; | ||
| 476 | - unsigned char byte; | 475 | + Tsr2Bits bits; ///< Bitfield representation |
| 476 | + unsigned char byte; ///< Full byte as unsigned char | ||
| 477 | }; | 477 | }; |
| 478 | 478 | ||
| 479 | ////////////////////////////////////////////////////////////////////////////// | 479 | ////////////////////////////////////////////////////////////////////////////// |
| @@ -499,7 +499,7 @@ namespace Hantek { | @@ -499,7 +499,7 @@ namespace Hantek { | ||
| 499 | class CommandSetTriggerAndSamplerate : public Helper::DataArray<unsigned char> { | 499 | class CommandSetTriggerAndSamplerate : public Helper::DataArray<unsigned char> { |
| 500 | public: | 500 | public: |
| 501 | CommandSetTriggerAndSamplerate(); | 501 | CommandSetTriggerAndSamplerate(); |
| 502 | - 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); | 502 | + 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); |
| 503 | 503 | ||
| 504 | unsigned char getTriggerSource(); | 504 | unsigned char getTriggerSource(); |
| 505 | void setTriggerSource(unsigned char value); | 505 | void setTriggerSource(unsigned char value); |
openhantek/src/helper.h
| @@ -57,8 +57,8 @@ namespace Helper { | @@ -57,8 +57,8 @@ namespace Helper { | ||
| 57 | unsigned int getSize() const; | 57 | unsigned int getSize() const; |
| 58 | 58 | ||
| 59 | protected: | 59 | protected: |
| 60 | - T *array; | ||
| 61 | - unsigned int size; | 60 | + T *array; ///< Pointer to the array holding the data |
| 61 | + unsigned int size; ///< Size of the array (Number of variables of type T) | ||
| 62 | }; | 62 | }; |
| 63 | 63 | ||
| 64 | /// \brief Initializes the data array. | 64 | /// \brief Initializes the data array. |
openhantek/src/levelslider.cpp
| @@ -218,6 +218,8 @@ double LevelSlider::maximum(int index) const { | @@ -218,6 +218,8 @@ double LevelSlider::maximum(int index) const { | ||
| 218 | } | 218 | } |
| 219 | 219 | ||
| 220 | /// \brief Set the maximal value of the sliders. | 220 | /// \brief Set the maximal value of the sliders. |
| 221 | +/// \param index The index of the slider whose limits should be set. | ||
| 222 | +/// \param minimum The value a slider has at the bottommost/leftmost position. | ||
| 221 | /// \param maximum The value a slider has at the topmost/rightmost position. | 223 | /// \param maximum The value a slider has at the topmost/rightmost position. |
| 222 | /// \return -1 on error, fixValue result on success. | 224 | /// \return -1 on error, fixValue result on success. |
| 223 | int LevelSlider::setLimits(int index, double minimum, double maximum) { | 225 | int LevelSlider::setLimits(int index, double minimum, double maximum) { |
| @@ -235,6 +237,7 @@ int LevelSlider::setLimits(int index, double minimum, double maximum) { | @@ -235,6 +237,7 @@ int LevelSlider::setLimits(int index, double minimum, double maximum) { | ||
| 235 | } | 237 | } |
| 236 | 238 | ||
| 237 | /// \brief Return the step width of the sliders. | 239 | /// \brief Return the step width of the sliders. |
| 240 | +/// \param index The index of the slider whose step width should be returned. | ||
| 238 | /// \return The distance between the selectable slider positions. | 241 | /// \return The distance between the selectable slider positions. |
| 239 | double LevelSlider::step(int index) const { | 242 | double LevelSlider::step(int index) const { |
| 240 | if(index < 0 || index >= this->slider.count()) | 243 | if(index < 0 || index >= this->slider.count()) |
| @@ -244,7 +247,8 @@ double LevelSlider::step(int index) const { | @@ -244,7 +247,8 @@ double LevelSlider::step(int index) const { | ||
| 244 | } | 247 | } |
| 245 | 248 | ||
| 246 | /// \brief Set the step width of the sliders. | 249 | /// \brief Set the step width of the sliders. |
| 247 | -/// \param maximum The distance between the selectable slider positions. | 250 | +/// \param index The index of the slider whose step width should be set. |
| 251 | +/// \param step The distance between the selectable slider positions. | ||
| 248 | /// \return The new step width. | 252 | /// \return The new step width. |
| 249 | double LevelSlider::setStep(int index, double step) { | 253 | double LevelSlider::setStep(int index, double step) { |
| 250 | if(index < 0 || index >= this->slider.count()) | 254 | if(index < 0 || index >= this->slider.count()) |
openhantek/src/levelslider.h
| @@ -37,16 +37,17 @@ class QColor; | @@ -37,16 +37,17 @@ class QColor; | ||
| 37 | /// \struct LevelSliderParameters levelslider.h | 37 | /// \struct LevelSliderParameters levelslider.h |
| 38 | /// \brief Contains the color, text and value of one slider. | 38 | /// \brief Contains the color, text and value of one slider. |
| 39 | struct LevelSliderParameters { | 39 | struct LevelSliderParameters { |
| 40 | - QColor color; | ||
| 41 | - QString text; | ||
| 42 | - bool visible; | 40 | + QColor color; ///< The color of the slider and font |
| 41 | + QString text; ///< The text beside the slider, a empty string disables text | ||
| 42 | + bool visible; ///< Visibility of the slider | ||
| 43 | 43 | ||
| 44 | - double minimum, maximum; | ||
| 45 | - double step; | ||
| 46 | - double value; | 44 | + double minimum; ///< Minimum (left/top) value for the slider |
| 45 | + double maximum; ///< Maximum (right/bottom) value for the slider | ||
| 46 | + double step; ///< The distance between selectable slider positions | ||
| 47 | + double value; ///< The current value of the slider | ||
| 47 | 48 | ||
| 48 | // Needed for moving and drawing | 49 | // Needed for moving and drawing |
| 49 | - QRect rect; | 50 | + QRect rect; ///< The area where the slider is drawn |
| 50 | }; | 51 | }; |
| 51 | 52 | ||
| 52 | //////////////////////////////////////////////////////////////////////////////// | 53 | //////////////////////////////////////////////////////////////////////////////// |
| @@ -101,15 +102,16 @@ class LevelSlider : public QWidget { | @@ -101,15 +102,16 @@ class LevelSlider : public QWidget { | ||
| 101 | int calculateWidth(); | 102 | int calculateWidth(); |
| 102 | int fixValue(int index); | 103 | int fixValue(int index); |
| 103 | 104 | ||
| 104 | - QList<LevelSliderParameters *> slider; | ||
| 105 | - int pressedSlider; | ||
| 106 | - int sliderWidth; | 105 | + QList<LevelSliderParameters *> slider; ///< The parameters for each slider |
| 106 | + int pressedSlider; ///< The currently pressed (moved) slider | ||
| 107 | + int sliderWidth; ///< The slider width (dimension orthogonal to the sliding direction) | ||
| 107 | 108 | ||
| 108 | - Qt::ArrowType _direction; | ||
| 109 | - int _preMargin, _postMargin; | 109 | + Qt::ArrowType _direction; ///< The direction the sliders point to |
| 110 | + int _preMargin; ///< The margin before the minimum slider position | ||
| 111 | + int _postMargin; ///< The margin after the maximum slider position | ||
| 110 | 112 | ||
| 111 | signals: | 113 | signals: |
| 112 | - void valueChanged(int index, double value); | 114 | + void valueChanged(int index, double value); ///< The value of a slider has changed |
| 113 | }; | 115 | }; |
| 114 | 116 | ||
| 115 | 117 |
openhantek/src/openhantek.cpp
| @@ -115,6 +115,7 @@ OpenHantekMainWindow::OpenHantekMainWindow(QWidget *parent, Qt::WindowFlags flag | @@ -115,6 +115,7 @@ OpenHantekMainWindow::OpenHantekMainWindow(QWidget *parent, Qt::WindowFlags flag | ||
| 115 | connect(this->voltageDock, SIGNAL(usedChanged(unsigned int, bool)), this->dsoWidget, SLOT(updateVoltageUsed(unsigned int, bool))); | 115 | connect(this->voltageDock, SIGNAL(usedChanged(unsigned int, bool)), this->dsoWidget, SLOT(updateVoltageUsed(unsigned int, bool))); |
| 116 | connect(this->voltageDock, SIGNAL(couplingChanged(unsigned int, Dso::Coupling)), this->dsoControl, SLOT(setCoupling(unsigned int, Dso::Coupling))); | 116 | connect(this->voltageDock, SIGNAL(couplingChanged(unsigned int, Dso::Coupling)), this->dsoControl, SLOT(setCoupling(unsigned int, Dso::Coupling))); |
| 117 | connect(this->voltageDock, SIGNAL(couplingChanged(unsigned int, Dso::Coupling)), this->dsoWidget, SLOT(updateVoltageCoupling(unsigned int))); | 117 | connect(this->voltageDock, SIGNAL(couplingChanged(unsigned int, Dso::Coupling)), this->dsoWidget, SLOT(updateVoltageCoupling(unsigned int))); |
| 118 | + connect(this->voltageDock, SIGNAL(modeChanged(Dso::MathMode)), this->dsoWidget, SLOT(updateMathMode())); | ||
| 118 | connect(this->voltageDock, SIGNAL(gainChanged(unsigned int, double)), this, SLOT(updateVoltageGain(unsigned int))); | 119 | connect(this->voltageDock, SIGNAL(gainChanged(unsigned int, double)), this, SLOT(updateVoltageGain(unsigned int))); |
| 119 | connect(this->voltageDock, SIGNAL(gainChanged(unsigned int, double)), this->dsoWidget, SLOT(updateVoltageGain(unsigned int))); | 120 | connect(this->voltageDock, SIGNAL(gainChanged(unsigned int, double)), this->dsoWidget, SLOT(updateVoltageGain(unsigned int))); |
| 120 | connect(this->dsoWidget, SIGNAL(offsetChanged(unsigned int, double)), this, SLOT(updateOffset(unsigned int))); | 121 | connect(this->dsoWidget, SIGNAL(offsetChanged(unsigned int, double)), this, SLOT(updateOffset(unsigned int))); |
openhantek/src/openhantek.h
| @@ -133,7 +133,7 @@ class OpenHantekMainWindow : public QMainWindow { | @@ -133,7 +133,7 @@ class OpenHantekMainWindow : public QMainWindow { | ||
| 133 | void updateVoltageGain(unsigned int channel); | 133 | void updateVoltageGain(unsigned int channel); |
| 134 | 134 | ||
| 135 | signals: | 135 | signals: |
| 136 | - void settingsChanged(); | 136 | + void settingsChanged(); ///< The settings have changed (Option dialog, loading...) |
| 137 | }; | 137 | }; |
| 138 | 138 | ||
| 139 | 139 |
openhantek/src/settings.h
| @@ -104,7 +104,7 @@ struct DsoSettingsScope { | @@ -104,7 +104,7 @@ struct DsoSettingsScope { | ||
| 104 | }; | 104 | }; |
| 105 | 105 | ||
| 106 | //////////////////////////////////////////////////////////////////////////////// | 106 | //////////////////////////////////////////////////////////////////////////////// |
| 107 | -/// \struct DsoColorValues settings.h | 107 | +/// \struct DsoSettingsColorValues settings.h |
| 108 | /// \brief Holds the color values for the oscilloscope screen. | 108 | /// \brief Holds the color values for the oscilloscope screen. |
| 109 | struct DsoSettingsColorValues { | 109 | struct DsoSettingsColorValues { |
| 110 | QColor axes; ///< X- and Y-axis and subdiv lines on them | 110 | QColor axes; ///< X- and Y-axis and subdiv lines on them |