ngscopeclient 0.1-dev+51fbda87c
ConfigWarningList.h
Go to the documentation of this file.
1/***********************************************************************************************************************
2* *
3* libscopehal *
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
36#ifndef ConfigWarningList_h
37#define ConfigWarningList_h
38
39class Instrument;
41
50{
51public:
52
54 std::string m_object;
55
57 std::string m_messageText;
58
60 std::string m_existingValue;
61
63 std::string m_proposedValue;
64
65 ConfigWarningMessage(const std::string& o, const std::string& m, const std::string& e, const std::string& p)
66 : m_object(o)
67 , m_messageText(m)
70 {}
71};
72
78{
79public:
80
82 std::vector<ConfigWarningMessage> m_messages;
83};
84
90{
91public:
92
94 std::map<Instrument*, WarningList> m_warnings;
95
97 bool empty() const
98 { return m_warnings.empty(); }
99
101 void clear()
102 { m_warnings.clear(); }
103};
104
105#endif
All warnings generated by a configuration we're in the process of loading.
Definition: ConfigWarningList.h:90
std::map< Instrument *, WarningList > m_warnings
Map from instrument to list of warnings produced by that driver.
Definition: ConfigWarningList.h:94
void clear()
Resets to the empty state.
Definition: ConfigWarningList.h:101
bool empty() const
Returns true if we have no warnings, false if at least one warning.
Definition: ConfigWarningList.h:97
A warning message displayed by a driver during loading of a session.
Definition: ConfigWarningList.h:50
std::string m_proposedValue
The new value of the setting being loaded.
Definition: ConfigWarningList.h:63
std::string m_messageText
Warning message explaining the change (e.g. "switching out 10 dB attenuator")
Definition: ConfigWarningList.h:57
std::string m_existingValue
The current value of the setting.
Definition: ConfigWarningList.h:60
std::string m_object
Human readable name of the channel and setting (e.g. "CH2 input")
Definition: ConfigWarningList.h:54
A single channel of an instrument.
Definition: InstrumentChannel.h:63
An arbitrary lab instrument. Oscilloscope, LA, PSU, DMM, etc.
Definition: Instrument.h:58
A list of ConfigWarningMessage's.
Definition: ConfigWarningList.h:78
std::vector< ConfigWarningMessage > m_messages
The messages in the list.
Definition: ConfigWarningList.h:82