35#ifndef FunctionGeneratorState_h
36#define FunctionGeneratorState_h
47 size_t n = generator->GetChannelCount();
48 m_channelActive = std::make_unique<std::atomic<bool>[] >(n);
49 m_channelAmplitude = std::make_unique<std::atomic<float>[] >(n);
50 m_channelOffset= std::make_unique<std::atomic<float>[] >(n);
51 m_channelFrequency = std::make_unique<std::atomic<float>[] >(n);
52 m_channelShape = std::make_unique<std::atomic<FunctionGenerator::WaveShape>[] >(n);
53 m_channelOutputImpedance = std::make_unique<std::atomic<FunctionGenerator::OutputImpedance>[] >(n);
54 m_channelShapes = std::make_unique<std::vector<FunctionGenerator::WaveShape>[] >(n);
55 m_channelShapeIndexes = std::make_unique<std::map<FunctionGenerator::WaveShape,int>[] >(n);
56 m_channelShapeNames = std::make_unique<std::vector<std::string>[] >(n);
58 m_needsUpdate = std::make_unique<std::atomic<bool>[] >(n);
60 for(
size_t i=0; i<n; i++)
62 m_channelActive[i] =
false;
63 m_channelAmplitude[i] = 0;
64 m_channelOffset[i] = 0;
65 m_channelFrequency[i] = 0;
66 m_channelShape[i] = FunctionGenerator::WaveShape::SHAPE_SINE;
67 m_channelOutputImpedance[i] = FunctionGenerator::OutputImpedance::IMPEDANCE_HIGH_Z;
69 m_channelShapes[i] = generator->GetAvailableWaveformShapes(i);
70 for(
size_t j=0; j<m_channelShapes[i].size(); j++)
72 m_channelShapeNames[i].push_back(generator->GetNameOfShape(m_channelShapes[i][j]));
73 m_channelShapeIndexes[i][m_channelShapes[i][j]] = j;
76 m_needsUpdate[i] =
true;
80 std::unique_ptr<std::atomic<bool>[]> m_channelActive;
81 std::unique_ptr<std::atomic<float>[]> m_channelAmplitude;
82 std::unique_ptr<std::atomic<float>[]> m_channelOffset;
83 std::unique_ptr<std::atomic<float>[]> m_channelFrequency;
84 std::unique_ptr<std::atomic<FunctionGenerator::WaveShape>[]> m_channelShape;
85 std::unique_ptr<std::atomic<FunctionGenerator::OutputImpedance>[]> m_channelOutputImpedance;
86 std::unique_ptr<std::vector<FunctionGenerator::WaveShape>[]> m_channelShapes;
87 std::unique_ptr<std::map<FunctionGenerator::WaveShape,int>[]> m_channelShapeIndexes;
88 std::unique_ptr<std::vector<std::string>[]> m_channelShapeNames;
90 std::unique_ptr<std::atomic<bool>[]> m_needsUpdate;
Current status of a Function Generator.
Definition: FunctionGeneratorState.h:42