Commit 490026e98804e77103bbc0a79d90fd695156fc08
Committed by
David Gräff
1 parent
b1572fd9
Hantek source: Split files further
Showing
5 changed files
with
109 additions
and
80 deletions
openhantek/src/hantek/controlindexes.h
0 → 100644
| 1 | +// SPDX-License-Identifier: GPL-2.0+ | |
| 2 | + | |
| 3 | +#pragma once | |
| 4 | + | |
| 5 | +namespace Hantek { | |
| 6 | + | |
| 7 | +////////////////////////////////////////////////////////////////////////////// | |
| 8 | +/// \enum ControlIndex | |
| 9 | +/// \brief The array indices for the waiting control commands. | |
| 10 | +enum ControlIndex { | |
| 11 | + // CONTROLINDEX_VALUE, | |
| 12 | + // CONTROLINDEX_GETSPEED, | |
| 13 | + // CONTROLINDEX_BEGINCOMMAND, | |
| 14 | + CONTROLINDEX_SETOFFSET, | |
| 15 | + CONTROLINDEX_SETRELAYS, | |
| 16 | + CONTROLINDEX_SETVOLTDIV_CH1, | |
| 17 | + CONTROLINDEX_SETVOLTDIV_CH2, | |
| 18 | + CONTROLINDEX_SETTIMEDIV, | |
| 19 | + CONTROLINDEX_ACQUIIRE_HARD_DATA, | |
| 20 | + CONTROLINDEX_COUNT | |
| 21 | +}; | |
| 22 | + | |
| 23 | +} | ... | ... |
openhantek/src/hantek/controlsettings.h
0 → 100644
| 1 | +#pragma once | |
| 2 | + | |
| 3 | +#include "definitions.h" | |
| 4 | + | |
| 5 | +namespace Hantek { | |
| 6 | + | |
| 7 | +class ControlSamplerateLimits; | |
| 8 | + | |
| 9 | +////////////////////////////////////////////////////////////////////////////// | |
| 10 | +/// \struct ControlSettingsSamplerateTarget hantek/control.h | |
| 11 | +/// \brief Stores the target samplerate settings of the device. | |
| 12 | +struct ControlSettingsSamplerateTarget { | |
| 13 | + double samplerate; ///< The target samplerate set via setSamplerate | |
| 14 | + double duration; ///< The target record time set via setRecordTime | |
| 15 | + bool samplerateSet; ///< true means samplerate was set last, false duration | |
| 16 | +}; | |
| 17 | + | |
| 18 | +////////////////////////////////////////////////////////////////////////////// | |
| 19 | +/// \struct ControlSettingsSamplerate hantek/control.h | |
| 20 | +/// \brief Stores the current samplerate settings of the device. | |
| 21 | +struct ControlSettingsSamplerate { | |
| 22 | + ControlSettingsSamplerateTarget target; ///< The target samplerate values | |
| 23 | + ControlSamplerateLimits *limits; ///< The samplerate limits | |
| 24 | + unsigned int downsampler; ///< The variable downsampling factor | |
| 25 | + double current; ///< The current samplerate | |
| 26 | +}; | |
| 27 | + | |
| 28 | +////////////////////////////////////////////////////////////////////////////// | |
| 29 | +/// \struct ControlSettingsTrigger hantek/control.h | |
| 30 | +/// \brief Stores the current trigger settings of the device. | |
| 31 | +struct ControlSettingsTrigger { | |
| 32 | + double level[HANTEK_CHANNELS]; ///< The trigger level for each channel in V | |
| 33 | + double position; ///< The current pretrigger position | |
| 34 | + unsigned int point; ///< The trigger position in Hantek coding | |
| 35 | + Dso::TriggerMode mode; ///< The trigger mode | |
| 36 | + Dso::Slope slope; ///< The trigger slope | |
| 37 | + bool special; ///< true, if the trigger source is special | |
| 38 | + unsigned int source; ///< The trigger source | |
| 39 | +}; | |
| 40 | + | |
| 41 | +////////////////////////////////////////////////////////////////////////////// | |
| 42 | +/// \struct ControlSettingsVoltage hantek/control.h | |
| 43 | +/// \brief Stores the current amplification settings of the device. | |
| 44 | +struct ControlSettingsVoltage { | |
| 45 | + double offset; ///< The screen offset for each channel | |
| 46 | + double offsetReal; ///< The real offset for each channel (Due to quantization) | |
| 47 | + unsigned gain; ///< The gain id | |
| 48 | + bool used; ///< true, if the channel is used | |
| 49 | +}; | |
| 50 | + | |
| 51 | +////////////////////////////////////////////////////////////////////////////// | |
| 52 | +/// \struct ControlSettings hantek/control.h | |
| 53 | +/// \brief Stores the current settings of the device. | |
| 54 | +struct ControlSettings { | |
| 55 | + ControlSettingsSamplerate samplerate; ///< The samplerate settings | |
| 56 | + ControlSettingsVoltage voltage[HANTEK_CHANNELS]; ///< The amplification settings | |
| 57 | + ControlSettingsTrigger trigger; ///< The trigger settings | |
| 58 | + unsigned int recordLengthId; ///< The id in the record length array | |
| 59 | + unsigned short int usedChannels; ///< Number of activated channels | |
| 60 | +}; | |
| 61 | + | |
| 62 | +} | |
| 63 | + | ... | ... |
openhantek/src/hantek/stateStructs.h renamed to openhantek/src/hantek/controlspecification.h
| ... | ... | @@ -8,33 +8,6 @@ |
| 8 | 8 | namespace Hantek { |
| 9 | 9 | |
| 10 | 10 | ////////////////////////////////////////////////////////////////////////////// |
| 11 | -/// \enum ControlIndex hantek/control.h | |
| 12 | -/// \brief The array indices for the waiting control commands. | |
| 13 | -enum ControlIndex { | |
| 14 | - // CONTROLINDEX_VALUE, | |
| 15 | - // CONTROLINDEX_GETSPEED, | |
| 16 | - // CONTROLINDEX_BEGINCOMMAND, | |
| 17 | - CONTROLINDEX_SETOFFSET, | |
| 18 | - CONTROLINDEX_SETRELAYS, | |
| 19 | - CONTROLINDEX_SETVOLTDIV_CH1, | |
| 20 | - CONTROLINDEX_SETVOLTDIV_CH2, | |
| 21 | - CONTROLINDEX_SETTIMEDIV, | |
| 22 | - CONTROLINDEX_ACQUIIRE_HARD_DATA, | |
| 23 | - CONTROLINDEX_COUNT | |
| 24 | -}; | |
| 25 | - | |
| 26 | -////////////////////////////////////////////////////////////////////////////// | |
| 27 | -/// \enum RollState hantek/types.h | |
| 28 | -/// \brief The states of the roll cycle (Since capture state isn't valid). | |
| 29 | -enum RollState { | |
| 30 | - ROLL_STARTSAMPLING = 0, ///< Start sampling | |
| 31 | - ROLL_ENABLETRIGGER = 1, ///< Enable triggering | |
| 32 | - ROLL_FORCETRIGGER = 2, ///< Force triggering | |
| 33 | - ROLL_GETDATA = 3, ///< Request sample data | |
| 34 | - ROLL_COUNT | |
| 35 | -}; | |
| 36 | - | |
| 37 | -////////////////////////////////////////////////////////////////////////////// | |
| 38 | 11 | /// \struct ControlSpecificationCommandsBulk hantek/control.h |
| 39 | 12 | /// \brief Stores the bulk command codes used for this device. |
| 40 | 13 | struct ControlSpecificationCommandsBulk { |
| ... | ... | @@ -123,56 +96,5 @@ struct ControlSpecification { |
| 123 | 96 | bool supportsCouplingRelays = true; |
| 124 | 97 | }; |
| 125 | 98 | |
| 126 | -////////////////////////////////////////////////////////////////////////////// | |
| 127 | -/// \struct ControlSettingsSamplerateTarget hantek/control.h | |
| 128 | -/// \brief Stores the target samplerate settings of the device. | |
| 129 | -struct ControlSettingsSamplerateTarget { | |
| 130 | - double samplerate; ///< The target samplerate set via setSamplerate | |
| 131 | - double duration; ///< The target record time set via setRecordTime | |
| 132 | - bool samplerateSet; ///< true means samplerate was set last, false duration | |
| 133 | -}; | |
| 134 | - | |
| 135 | -////////////////////////////////////////////////////////////////////////////// | |
| 136 | -/// \struct ControlSettingsSamplerate hantek/control.h | |
| 137 | -/// \brief Stores the current samplerate settings of the device. | |
| 138 | -struct ControlSettingsSamplerate { | |
| 139 | - ControlSettingsSamplerateTarget target; ///< The target samplerate values | |
| 140 | - ControlSamplerateLimits *limits; ///< The samplerate limits | |
| 141 | - unsigned int downsampler; ///< The variable downsampling factor | |
| 142 | - double current; ///< The current samplerate | |
| 143 | -}; | |
| 144 | - | |
| 145 | -////////////////////////////////////////////////////////////////////////////// | |
| 146 | -/// \struct ControlSettingsTrigger hantek/control.h | |
| 147 | -/// \brief Stores the current trigger settings of the device. | |
| 148 | -struct ControlSettingsTrigger { | |
| 149 | - double level[HANTEK_CHANNELS]; ///< The trigger level for each channel in V | |
| 150 | - double position; ///< The current pretrigger position | |
| 151 | - unsigned int point; ///< The trigger position in Hantek coding | |
| 152 | - Dso::TriggerMode mode; ///< The trigger mode | |
| 153 | - Dso::Slope slope; ///< The trigger slope | |
| 154 | - bool special; ///< true, if the trigger source is special | |
| 155 | - unsigned int source; ///< The trigger source | |
| 156 | -}; | |
| 157 | - | |
| 158 | -////////////////////////////////////////////////////////////////////////////// | |
| 159 | -/// \struct ControlSettingsVoltage hantek/control.h | |
| 160 | -/// \brief Stores the current amplification settings of the device. | |
| 161 | -struct ControlSettingsVoltage { | |
| 162 | - unsigned gain; ///< The gain id | |
| 163 | - double offset; ///< The screen offset for each channel | |
| 164 | - double offsetReal; ///< The real offset for each channel (Due to quantization) | |
| 165 | - bool used; ///< true, if the channel is used | |
| 166 | -}; | |
| 167 | - | |
| 168 | -////////////////////////////////////////////////////////////////////////////// | |
| 169 | -/// \struct ControlSettings hantek/control.h | |
| 170 | -/// \brief Stores the current settings of the device. | |
| 171 | -struct ControlSettings { | |
| 172 | - ControlSettingsSamplerate samplerate; ///< The samplerate settings | |
| 173 | - ControlSettingsVoltage voltage[HANTEK_CHANNELS]; ///< The amplification settings | |
| 174 | - ControlSettingsTrigger trigger; ///< The trigger settings | |
| 175 | - unsigned int recordLengthId; ///< The id in the record length array | |
| 176 | - unsigned short int usedChannels; ///< Number of activated channels | |
| 177 | -}; | |
| 178 | 99 | } |
| 100 | + | ... | ... |
openhantek/src/hantek/hantekdsocontrol.h
| ... | ... | @@ -5,7 +5,10 @@ |
| 5 | 5 | #include "bulkStructs.h" |
| 6 | 6 | #include "controlStructs.h" |
| 7 | 7 | #include "dsosamples.h" |
| 8 | -#include "stateStructs.h" | |
| 8 | +#include "states.h" | |
| 9 | +#include "controlspecification.h" | |
| 10 | +#include "controlsettings.h" | |
| 11 | +#include "controlindexes.h" | |
| 9 | 12 | #include "utils/dataarray.h" |
| 10 | 13 | #include "utils/printutils.h" |
| 11 | 14 | ... | ... |
openhantek/src/hantek/states.h
0 → 100644
| 1 | +// SPDX-License-Identifier: GPL-2.0+ | |
| 2 | + | |
| 3 | +#pragma once | |
| 4 | + | |
| 5 | +namespace Hantek { | |
| 6 | + | |
| 7 | +////////////////////////////////////////////////////////////////////////////// | |
| 8 | +/// \enum RollState | |
| 9 | +/// \brief The states of the roll cycle (Since capture state isn't valid). | |
| 10 | +enum RollState { | |
| 11 | + ROLL_STARTSAMPLING = 0, ///< Start sampling | |
| 12 | + ROLL_ENABLETRIGGER = 1, ///< Enable triggering | |
| 13 | + ROLL_FORCETRIGGER = 2, ///< Force triggering | |
| 14 | + ROLL_GETDATA = 3, ///< Request sample data | |
| 15 | + ROLL_COUNT | |
| 16 | +}; | |
| 17 | + | |
| 18 | +} | ... | ... |