OpenHantek
controlspecification.h
1 // SPDX-License-Identifier: GPL-2.0+
2 
3 #pragma once
4 
5 #include "enums.h"
6 #include "hantekprotocol/definitions.h"
7 #include "hantekprotocol/types.h"
8 #include "hantekprotocol/bulkcode.h"
9 #include <QList>
10 
11 namespace Dso {
12 
13 using namespace Hantek;
14 
17  double base;
18  double max;
19  unsigned int maxDownsampler;
20  std::vector<unsigned> recordLengths;
21 };
22 
25  ControlSamplerateLimits single = {50e6, 50e6, 0, std::vector<unsigned>()};
26  ControlSamplerateLimits multi = {100e6, 100e6, 0, std::vector<unsigned>()};
27 };
28 
31  unsigned char gainIndex;
33  double gainSteps;
34 };
35 
37  unsigned char id;
38  double samplerate;
39 };
40 
42  std::string name;
43  int hardwareID;
44 };
45 
48  ControlSpecification(unsigned channels);
49  const ChannelID channels;
50 
51  // Interface
52  BulkCode cmdSetChannels = BulkCode::INVALID;
53  BulkCode cmdSetSamplerate = BulkCode::INVALID;
54  BulkCode cmdSetRecordLength = BulkCode::INVALID;
55  BulkCode cmdSetTrigger = BulkCode::INVALID;
56  BulkCode cmdSetPretrigger = BulkCode::INVALID;
57  BulkCode cmdForceTrigger = BulkCode::FORCETRIGGER;
58  BulkCode cmdCaptureStart = BulkCode::STARTSAMPLING;
59  BulkCode cmdTriggerEnabled = BulkCode::ENABLETRIGGER;
60  BulkCode cmdGetData = BulkCode::GETDATA;
61  BulkCode cmdGetCaptureState = BulkCode::GETCAPTURESTATE;
62  BulkCode cmdSetGain = BulkCode::SETGAIN;
63 
64  // Limits
66  std::vector<RecordLengthID> bufferDividers;
67  unsigned char sampleSize;
68 
70  std::vector<FixedSampleRate> fixedSampleRates;
71 
72  // Calibration
73 
75  typedef std::vector<unsigned short> VoltageLimit;
76  std::vector<VoltageLimit> voltageLimit; // Per channel
77 
79  std::vector<ControlSpecificationGainLevel> gain;
80 
81  // Features
82  std::vector<SpecialTriggerChannel> specialTriggerChannels;
83  std::vector<Coupling> couplings = {Dso::Coupling::DC, Dso::Coupling::AC};
84  std::vector<TriggerMode> triggerModes = {TriggerMode::HARDWARE_SOFTWARE, TriggerMode::WAIT_FORCE,
85  TriggerMode::SINGLE};
86  bool isFixedSamplerateDevice = false;
87  bool isSoftwareTriggerDevice = false;
88  bool useControlNoBulk = false;
89  bool supportsCaptureState = true;
90  bool supportsOffset = true;
91  bool supportsCouplingRelays = true;
92  int fixedUSBinLength = 0;
93 };
94 }
std::vector< unsigned > recordLengths
Available record lengths, UINT_MAX means rolling.
Definition: controlspecification.h:20
unsigned char sampleSize
Number of bits per sample.
Definition: controlspecification.h:67
Definition: controlspecification.h:41
std::vector< ControlSpecificationGainLevel > gain
Gain levels.
Definition: controlspecification.h:79
Stores the samplerate limits for calculations.
Definition: controlspecification.h:16
Definition: controlsettings.h:8
double gainSteps
Available voltage steps in V/screenheight.
Definition: controlspecification.h:33
Definition: controlspecification.h:36
unsigned int maxDownsampler
The maximum downsampling ratio.
Definition: controlspecification.h:19
Stores the specifications of the currently connected device.
Definition: controlspecification.h:47
std::vector< RecordLengthID > bufferDividers
Samplerate dividers for record lengths.
Definition: controlspecification.h:66
std::vector< unsigned short > VoltageLimit
The sample values at the top of the screen.
Definition: controlspecification.h:75
std::vector< FixedSampleRate > fixedSampleRates
For devices that support only fixed sample rates (isFixedSamplerateDevice=true)
Definition: controlspecification.h:70
double base
The base for sample rate calculations.
Definition: controlspecification.h:17
ControlSpecificationSamplerate samplerate
The samplerate specifications.
Definition: controlspecification.h:65
Stores the samplerate limits.
Definition: controlspecification.h:24
double max
The maximum sample rate.
Definition: controlspecification.h:18
unsigned char gainIndex
The index of the selected gain on the hardware.
Definition: controlspecification.h:31
Definition: TriggerDock.h:15
Definition: controlspecification.h:29