VAPOR3 3.9.4
AppSettingsParams.h
Go to the documentation of this file.
1//************************************************************************
2// *
3// Copyright (C) 2015 *
4// University Corporation for Atmospheric Research *
5// All Rights Reserved *
6// *
7//************************************************************************/
8//
9// File: AppSettingsParams.h
10//
11// Author: Alan Norton
12// National Center for Atmospheric Research
13// PO 3000, Boulder, Colorado
14//
15// Date: June 2015
16//
17// Description: Defines the AppSettingsParams class.
18// This class supports parameters associted with the
19// AppSettings panel, describing the visual features in the visualizer
20//
21#ifndef APPSETTINGSPARAMS_H
22#define APPSETTINGSPARAMS_H
23
24#include <vector>
25#include <vapor/ParamsBase.h>
26
33
42public:
44
46
48
51 const std::string getShortName() { return _shortName; }
52
53#ifdef VAPOR3_0_0_ALPHA
58 void saveCurrentSettings();
59
62 void copySavedSettings();
63#endif
64
68
71 void SetJpegQuality(int val);
72
75 long GetJpegQuality() const;
76
79 void SetAutosaveInterval(int val);
80
83 long GetAutosaveInterval() const;
84
85 bool GetAutosaveEnabled() { return (0 != GetValueLong(_autosaveEnabledTag, (long)true)); }
86
87 void SetAutosaveEnabled(bool onOff) { SetValueLong(_autosaveEnabledTag, "toggle autosave enabled", (long)onOff); }
88
89 bool GetShowWarning() const { return (0 != GetValueLong(_showDataWarningTag, (long)true)); }
90 void SetShowWarning(bool onOff) { SetValueLong(_showDataWarningTag, "toggle warn data missing", (long)onOff); }
91
92 bool GetUseLessAccurate() const { return (0 != GetValueLong(_useLessAccurateTag, (long)false)); }
93 void SetUseLessAccurate(bool onOff) { SetValueLong(_useLessAccurateTag, "toggle use lower accuracy", (long)onOff); }
94
95 bool GetTrackMouse() const { return (0 != GetValueLong(_trackMouseTag, (long)true)); }
96
97 void SetTrackMouse(bool onOff) { SetValueLong(_trackMouseTag, "toggle track mouse", (long)onOff); }
98
99 bool GetShowCitation() const { return (0 != GetValueLong(_showCitationTag, (long)true)); }
100
101 void SetShowCitation(bool onOff) { SetValueLong(_showCitationTag, "toggle show citation info", (long)onOff); }
102
103 void SetMessageSilence(bool val) { SetValueLong(_messagesSilencedTag, "(Un)Silence messages", (long)val); }
104
105 bool GetMessageSilence() const { return (0 != GetValueLong(_messagesSilencedTag, (long)false)); }
106 string GetAutosaveName() { return GetValueString(_autosaveFileNameTag, string("/tmp/vapor_autosave.vs3")); }
107
108 void SetAutosaveName(string name) { SetValueString(_autosaveFileNameTag, "set autosave file", name); }
109
110 string GetLogFileName() const { return GetValueString(_logFileNameTag, string("/tmp/vaporLog.txt")); }
111
112 void SetLogFileName(string name) { SetValueString(_logFileNameTag, "set log file", name); }
113
114 bool GetLogfileEnabled() const { return (0 != GetValueLong(_logfileEnabledTag, (long)false)); }
115
116 void SetLogfileEnabled(bool val) { SetValueLong(_logfileEnabledTag, "toggle logfile enabled", (long)val); }
117
121
123
127
131
132 bool GetCurrentAutosaveEnabled() const { return (0 != GetValueLong(_currentAutosaveEnabledTag, (long)true)); }
133
134 void SetCurrentAutosaveEnabled(bool onOff) { SetValueLong(_currentAutosaveEnabledTag, "Toggle current autosave enabled", (long)onOff); }
135
136 bool GetCurrentShowWarning() const { return (0 != GetValueLong(_currentShowDataWarningTag, (long)true)); }
137
138 void SetCurrentShowWarning(bool onOff) { SetValueLong(_currentShowDataWarningTag, "toggle current show warning", (long)onOff); }
139
140 bool GetCurrentUseLessAccurate() const { return (0 != GetValueLong(_currentUseLessAccurateTag, (long)false)); }
141
142 void SetCurrentUseLessAccurate(bool onOff) { SetValueLong(_currentUseLessAccurateTag, "toggle current use less accuracy", (long)onOff); }
143
144 bool GetCurrentTrackMouse() const { return (0 != GetValueLong(_currentTrackMouseTag, (long)true)); }
145
146 void SetCurrentTrackMouse(bool onOff) { SetValueLong(_currentTrackMouseTag, "toggle current track mouse", (long)onOff); }
147
148 bool GetCurrentShowCitation() const { return (0 != GetValueLong(_currentShowCitationTag, (long)true)); }
149
150 void SetCurrentShowCitation(bool onOff) { SetValueLong(_currentShowCitationTag, "toggle current show citation", (long)onOff); }
151
152 string GetCurrentAutosaveName() const { return GetValueString(_currentAutosaveFileNameTag, string("/tmp/vapor_autosave.vs3")); }
153
154 void SetCurrentAutosaveName(string name) { SetValueString(_currentAutosaveFileNameTag, "set current autosave file", name); }
155
156 string GetCurrentLogFileName() const { return GetValueString(_currentLogFileNameTag, string("/tmp/vaporLog.txt")); }
157 void SetCurrentLogFileName(string name) { SetValueString(_currentLogFileNameTag, "set current log file", name); }
158 void SetCurrentMessageSilence(bool val) { SetValueLong(_currentMessagesSilencedTag, "(Un)Silence current messages", (long)val); }
159
160 bool GetCurrentMessageSilence() const { return (0 != GetValueLong(_currentMessagesSilencedTag, (long)false)); }
161
162 bool GetCurrentLogfileEnabled() const { return (0 != GetValueLong(_currentLogfileEnabledTag, (long)false)); }
163
164 void SetCurrentLogfileEnabled(bool val) { SetValueLong(_currentLogfileEnabledTag, "toggle current logfile enabled", (long)val); }
165
166 // Get static string identifier for this params class
167 //
168 static string GetClassType() { return (m_classType); }
169
170private:
171 static const string m_classType;
172 static const string _shortName;
173 static const string _jpegQualityTag;
174 static const string _autosaveEnabledTag;
175 static const string _autosaveIntervalTag;
176 static const string _showDataWarningTag;
177 static const string _useLessAccurateTag;
178 static const string _trackMouseTag;
179 static const string _showCitationTag;
180 static const string _logFileNameTag;
181 static const string _logfileEnabledTag;
182 static const string _autosaveFileNameTag;
183 static const string _messagesSilencedTag;
184 static const string _currentLogFileNameTag;
185 static const string _currentLogfileEnabledTag;
186 static const string _currentAutosaveFileNameTag;
187 static const string _currentJpegQualityTag;
188 static const string _currentAutosaveEnabledTag;
189 static const string _currentAutosaveIntervalTag;
190 static const string _currentShowDataWarningTag;
191 static const string _currentUseLessAccurateTag;
192 static const string _currentTrackMouseTag;
193 static const string _currentShowCitationTag;
194 static const string _currentMessagesSilencedTag;
195
196 void _init();
197};
198
199#endif // APPSETTINGSPARAMS_H
A class for describing visual features displayed in the visualizer.
bool GetCurrentTrackMouse() const
bool GetTrackMouse() const
bool GetCurrentUseLessAccurate() const
void SetCurrentLogFileName(string name)
bool GetMessageSilence() const
string GetLogFileName() const
void SetMessageSilence(bool val)
AppSettingsParams(VAPoR::ParamsBase::StateSave *ssave)
bool GetCurrentAutosaveEnabled() const
void SetUseLessAccurate(bool onOff)
static string GetClassType()
void SetCurrentMessageSilence(bool val)
void SetCurrentAutosaveInterval(int val)
long GetCurrentJpegQuality() const
void SetAutosaveInterval(int val)
void SetAutosaveEnabled(bool onOff)
bool GetShowWarning() const
void SetCurrentShowCitation(bool onOff)
long GetCurrentAutosaveInterval() const
void SetLogFileName(string name)
bool GetShowCitation() const
void SetTrackMouse(bool onOff)
void SetLogfileEnabled(bool val)
void SetCurrentAutosaveEnabled(bool onOff)
void SetCurrentJpegQuality(int val)
void SetCurrentShowWarning(bool onOff)
void SetCurrentAutosaveName(string name)
virtual ~AppSettingsParams()
void SetAutosaveName(string name)
long GetJpegQuality() const
string GetCurrentAutosaveName() const
bool GetUseLessAccurate() const
void SetJpegQuality(int val)
bool GetCurrentShowCitation() const
long GetAutosaveInterval() const
void SetShowWarning(bool onOff)
string GetCurrentLogFileName() const
AppSettingsParams(VAPoR::ParamsBase::StateSave *ssave, VAPoR::XmlNode *node)
void SetCurrentTrackMouse(bool onOff)
void SetCurrentLogfileEnabled(bool val)
void SetShowCitation(bool onOff)
bool GetCurrentShowWarning() const
bool GetCurrentLogfileEnabled() const
void SetCurrentUseLessAccurate(bool onOff)
bool GetLogfileEnabled() const
const std::string getShortName()
bool GetCurrentMessageSilence() const
State capture class.
Definition: ParamsBase.h:62
Nodes with state in Xml tree representation.
Definition: ParamsBase.h:50
virtual void SetValueString(const string &tag, string description, const string &value)
virtual string GetValueString(const string tag, string defaultVal) const
virtual void SetValueLong(const string &tag, string description, long value)
virtual long GetValueLong(const string tag, long defaultVal) const
An Xml tree.
Definition: XmlNode.h:49