ngscopeclient 0.1-dev+51fbda87c
FunctionGeneratorDialog.h
Go to the documentation of this file.
1/***********************************************************************************************************************
2* *
3* ngscopeclient *
4* *
5* Copyright (c) 2012-2024 Andrew D. Zonenberg and contributors *
6* All rights reserved. *
7* *
8* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
9* following conditions are met: *
10* *
11* * Redistributions of source code must retain the above copyright notice, this list of conditions, and the *
12* following disclaimer. *
13* *
14* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the *
15* following disclaimer in the documentation and/or other materials provided with the distribution. *
16* *
17* * Neither the name of the author nor the names of any contributors may be used to endorse or promote products *
18* derived from this software without specific prior written permission. *
19* *
20* THIS SOFTWARE IS PROVIDED BY THE AUTHORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
21* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL *
22* THE AUTHORS BE HELD LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
23* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR *
24* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
25* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
26* POSSIBILITY OF SUCH DAMAGE. *
27* *
28***********************************************************************************************************************/
29
35#ifndef FunctionGeneratorDialog_h
36#define FunctionGeneratorDialog_h
37
38#include "Dialog.h"
39#include "RollingBuffer.h"
40#include "Session.h"
41
43{
44public:
45 bool m_outputEnabled;
46
47 std::string m_amplitude;
48 float m_committedAmplitude;
49
50 std::string m_offset;
51 float m_committedOffset;
52
53 std::string m_dutyCycle;
54 float m_committedDutyCycle;
55
56 std::string m_frequency;
57 float m_committedFrequency;
58
59 std::string m_riseTime;
60 float m_committedRiseTime;
61
62 std::string m_fallTime;
63 float m_committedFallTime;
64
65 int m_impedanceIndex;
66
67 int m_shapeIndex;
68 std::vector<FunctionGenerator::WaveShape> m_waveShapes;
69 std::vector<std::string> m_waveShapeNames;
70};
71
73{
74public:
75 FunctionGeneratorDialog(std::shared_ptr<SCPIFunctionGenerator> gen, std::shared_ptr<FunctionGeneratorState> sessionState, Session* session);
77
78 virtual bool DoRender();
79
80 std::shared_ptr<SCPIFunctionGenerator> GetGenerator()
81 { return m_generator; }
82
83protected:
84 void DoChannel(size_t i);
85
88
90 std::shared_ptr<SCPIFunctionGenerator> m_generator;
91
93 std::shared_ptr<FunctionGeneratorState> m_state;
94
96 std::vector<FunctionGeneratorChannelUIState> m_uiState;
97
99 std::vector<FunctionGenerator::OutputImpedance> m_impedances;
100
102 std::vector<std::string> m_impedanceNames;
103
104};
105
106
107
108#endif
Declaration of Dialog.
Declaration of RollingBuffer.
Declaration of Session.
Generic dialog box or other popup window.
Definition: Dialog.h:44
Definition: FunctionGeneratorDialog.h:43
Definition: FunctionGeneratorDialog.h:73
std::vector< FunctionGeneratorChannelUIState > m_uiState
UI state for each channel.
Definition: FunctionGeneratorDialog.h:96
std::vector< std::string > m_impedanceNames
Human readable description of each element in m_impedances.
Definition: FunctionGeneratorDialog.h:102
void DoChannel(size_t i)
Run the UI for a single channel.
Definition: FunctionGeneratorDialog.cpp:161
std::vector< FunctionGenerator::OutputImpedance > m_impedances
Output impedances.
Definition: FunctionGeneratorDialog.h:99
Session * m_session
Session handle so we can remove the PSU when closed.
Definition: FunctionGeneratorDialog.h:87
std::shared_ptr< SCPIFunctionGenerator > m_generator
The generator we're controlling.
Definition: FunctionGeneratorDialog.h:90
std::shared_ptr< FunctionGeneratorState > m_state
Current channel stats, live updated.
Definition: FunctionGeneratorDialog.h:93
A Session stores all of the instrument configuration and other state the user has open.
Definition: Session.h:95