OpenHantek
ppresult.h
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 
22  double frequency = 0.0;
23  // Calculate peak-to-peak voltage
24  double computeAmplitude() const;
25 };
26 
27 typedef std::vector<QVector3D> ChannelGraph;
28 typedef std::vector<ChannelGraph> ChannelsGraphs;
29 
31 class PPresult {
32  public:
33  PPresult(unsigned int channelCount);
34 
37  const DataChannel *data(ChannelID channel) const;
40  DataChannel *modifyData(ChannelID channel);
42  unsigned int sampleCount() const;
43  unsigned int channelCount() const;
44 
45  bool softwareTriggerTriggered = false;
46 
47  ChannelsGraphs vaChannelSpectrum;
48  ChannelsGraphs vaChannelVoltage;
49  private:
50  std::vector<DataChannel> analyzedData;
51 };
DataChannel * modifyData(ChannelID channel)
Returns the analyzed data. The data structure can be modifed.
Definition: ppresult.cpp:15
double interval
The interval between two sample values.
Definition: ppresult.h:14
std::vector< double > sample
Vector holding the sampling data.
Definition: ppresult.h:13
SampleValues spectrum
The frequency-domain power levels (dB)
Definition: ppresult.h:20
SampleValues voltage
The time-domain voltage levels (V)
Definition: ppresult.h:19
Struct for a array of sample values.
Definition: ppresult.h:12
Struct for the analyzed data.
Definition: ppresult.h:18
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:22
Post processing results.
Definition: ppresult.h:31