37#ifndef FilterParameter_h
38#define FilterParameter_h
68 T8B10BSymbol(T8B10BSymbol::disparity_t d, T8B10BSymbol::type_t t, uint8_t v)
107 void ParseString(
const std::string& str,
bool useDisplayLocale =
true);
108 std::string
ToString(
bool useDisplayLocale =
true)
const;
114 {
return (m_intval != 0); }
126 {
return m_floatval; }
132 {
return m_8b10bPattern; }
145 void Set8B10BPattern(
const std::vector<T8B10BSymbol>& pattern);
166 std::string m_fileFilterMask;
167 std::string m_fileFilterName;
177 m_forwardEnumMap[name] = value;
178 m_reverseEnumMap[value] = name;
187 for(
auto it : m_forwardEnumMap)
188 values.push_back(it.first);
196 m_forwardEnumMap.clear();
197 m_reverseEnumMap.clear();
207 {
return m_changeSignal; }
213 {
return m_enumSignal; }
238 { m_readOnly =
true; }
244 {
return m_readOnly; }
249 sigc::signal<void()> m_changeSignal;
250 sigc::signal<void()> m_enumSignal;
254 std::map<std::string, int> m_forwardEnumMap;
255 std::map<int, std::string> m_reverseEnumMap;
257 std::vector<T8B10BSymbol> m_8b10bPattern;
261 std::string m_string;
A parameter to a filter.
Definition: FilterParameter.h:86
sigc::signal< void()> signal_enums_changed()
Signal emitted every time the list of enumeration values changes.
Definition: FilterParameter.h:212
void MarkReadOnly()
Marks this parameter as read-only in the GUI.
Definition: FilterParameter.h:237
bool GetBoolVal() const
Returns the value of the parameter interpreted as a boolean.
Definition: FilterParameter.h:113
void MarkHidden()
Marks this parameter to be hidden from the GUI.
Definition: FilterParameter.h:222
void SetIntVal(int64_t i)
Sets the parameter to an integer value.
Definition: FilterParameter.cpp:307
bool IsReadOnly()
Checks if this parameter should be read-only in the GUI.
Definition: FilterParameter.h:243
bool IsHidden()
Checks if this parameter should be hidden in the GUI.
Definition: FilterParameter.h:228
ParameterTypes GetType() const
Returns the type of the parameter.
Definition: FilterParameter.h:150
int64_t GetIntVal() const
Returns the value of the parameter interpreted as an integer.
Definition: FilterParameter.h:119
ParameterTypes
Types of data a parameter can store.
Definition: FilterParameter.h:93
void AddEnumValue(const std::string &name, int value)
Adds a (name, value) pair to a TYPE_ENUM parameter.
Definition: FilterParameter.h:175
void ClearEnumValues()
Clears the list of enumerated values for a TYPE_ENUM parameter.
Definition: FilterParameter.h:194
sigc::signal< void()> signal_changed()
Signal emitted every time the parameter's value changes.
Definition: FilterParameter.h:206
void SetFloatVal(float f)
Sets the parameter to a floating point value.
Definition: FilterParameter.cpp:323
void SetStringVal(const std::string &f)
Sets the parameter to a string.
Definition: FilterParameter.cpp:336
void SetBoolVal(bool b)
Sets the parameter to a boolean value.
Definition: FilterParameter.cpp:294
void GetEnumValues(std::vector< std::string > &values)
Gets a list of valid enumerated parameter names for a TYPE_ENUM parameter.
Definition: FilterParameter.h:185
void SetFileName(const std::string &f)
Sets the parameter to a file path.
Definition: FilterParameter.cpp:344
std::vector< T8B10BSymbol > Get8B10BPattern()
Access to the underlying pattern.
Definition: FilterParameter.h:131
std::string GetFileName() const
Returns the value of the parameter interpreted as a file path.
Definition: FilterParameter.h:137
std::string ToString(bool useDisplayLocale=true) const
Returns a pretty-printed representation of the parameter's value.
Definition: FilterParameter.cpp:225
float GetFloatVal() const
Returns the value of the parameter interpreted as a floating point number.
Definition: FilterParameter.h:125
void SetUnit(Unit u)
Change the units of the parameter.
Definition: FilterParameter.h:162
FilterParameter(ParameterTypes type=FilterParameter::TYPE_FLOAT, Unit unit=Unit(Unit::UNIT_FS))
Creates a parameter.
Definition: FilterParameter.cpp:51
static FilterParameter UnitSelector()
Constructs a FilterParameter object for choosing from available units.
Definition: FilterParameter.cpp:67
Unit GetUnit() const
Returns the units of the parameter.
Definition: FilterParameter.h:156
void Reinterpret()
Reinterprets our string representation (in case our type or enums changed)
Definition: FilterParameter.cpp:100
void ParseString(const std::string &str, bool useDisplayLocale=true)
Sets the parameter to a value represented as a string.
Definition: FilterParameter.cpp:110
An 8B/10B symbol within a pattern, used for trigger matching.
Definition: FilterParameter.h:45
A unit of measurement, plus conversion to pretty-printed output.
Definition: Unit.h:57