OpenHantek
ppresult.h
Go to the documentation of this file.
1 // SPDX-License-Identifier: GPL-2.0+
2 
3 #pragma once
4 
5 #include <QVector3D>
6 #include <QReadWriteLock>
7 
8 #include <vector>
9 #include "hantekprotocol/types.h"
10 
12 struct SampleValues {
13  std::vector<double> sample;
14  double interval = 0.0;
15 };
16 
18 struct DataChannel {
21  bool valid = true;
22  double vpp = 0.0;
23  double rms = 0.0;
24  double dc = 0.0;
25  double ac = 0.0;
26  double dB = 0.0;
27  double frequency = 0.0;
28  double pulseWidth1 = 0.0;
29  double pulseWidth2 = 0.0;
30 };
31 
32 typedef std::vector<QVector3D> ChannelGraph;
33 typedef std::vector<ChannelGraph> ChannelsGraphs;
34 
36 class PPresult {
37  public:
38  explicit PPresult(unsigned int channelCount);
39 
42  const DataChannel *data(ChannelID channel) const;
47  unsigned int sampleCount() const;
48  unsigned int channelCount() const;
49 
53  unsigned triggeredPosition = 0;
54  double pulseWidth1 = 0.0;
55  double pulseWidth2 = 0.0;
56 
60 
61  private:
62  std::vector<DataChannel> analyzedData;
63 };
DataChannel * modifyData(ChannelID channel)
Returns the analyzed data. The data structure can be modifed.
Definition: ppresult.cpp:15
double pulseWidth2
The width of the following pulse.
Definition: ppresult.h:29
double interval
The interval between two sample values.
Definition: ppresult.h:14
bool valid
Not clipped, distorted, dropouts etc.
Definition: ppresult.h:21
double pulseWidth1
The width of the triggered pulse.
Definition: ppresult.h:28
std::vector< double > sample
Vector holding the sampling data.
Definition: ppresult.h:13
unsigned triggeredPosition
skip samples at start of channel to get triggered trace on screen
Definition: ppresult.h:53
double pulseWidth1
The width of the triggered pulse.
Definition: ppresult.h:54
unsigned int channelCount() const
Definition: ppresult.cpp:19
double pulseWidth2
The width of the following pulse.
Definition: ppresult.h:55
SampleValues spectrum
The frequency-domain power levels (dB)
Definition: ppresult.h:20
ChannelsGraphs vaChannelVoltage
Definition: ppresult.h:58
double dc
The DC bias of the signal.
Definition: ppresult.h:24
double dB
The AC rms value as dB (dBV or other depending on config)
Definition: ppresult.h:26
double vpp
The peak-to-peak voltage of the displayed part of trace.
Definition: ppresult.h:22
SampleValues voltage
The time-domain voltage levels (V)
Definition: ppresult.h:19
std::vector< QVector3D > ChannelGraph
Definition: ppresult.h:32
double ac
The AC rms value of the signal.
Definition: ppresult.h:25
PPresult(unsigned int channelCount)
Definition: ppresult.cpp:7
Struct for a array of sample values.
Definition: ppresult.h:12
double rms
The DC + AC rms value of the signal = sqrt( dc * dc + acc * ac )
Definition: ppresult.h:23
ChannelsGraphs vaChannelHistogram
Definition: ppresult.h:59
std::vector< ChannelGraph > ChannelsGraphs
Definition: ppresult.h:33
unsigned ChannelID
Definition: types.h:6
bool softwareTriggerTriggered
sw trigger status
Definition: ppresult.h:51
Struct for the analyzed data.
Definition: ppresult.h:18
std::vector< DataChannel > analyzedData
The analyzed data for each channel.
Definition: ppresult.h:62
unsigned int sampleCount() const
Definition: ppresult.cpp:17
const DataChannel * data(ChannelID channel) const
Returns the analyzed data.
Definition: ppresult.cpp:9
double frequency
The frequency of the signal.
Definition: ppresult.h:27
ChannelsGraphs vaChannelSpectrum
Definition: ppresult.h:57
Post processing results.
Definition: ppresult.h:36