38 lines
631 B
C++
38 lines
631 B
C++
/*
|
|
* SettableValue.cpp
|
|
*
|
|
* Created on: 10 àâã. 2020 ã.
|
|
* Author: LeonidTitov
|
|
*/
|
|
|
|
#include "SettableValue.hh"
|
|
|
|
#include <cmath>
|
|
|
|
|
|
void schematic::SettableValue::configure( Setting & config ) {
|
|
|
|
stored_value = static_cast<float>( config.preset_value );
|
|
|
|
}
|
|
|
|
void schematic::SettableFlag::configure( Setting & config ) {
|
|
|
|
stored_value = static_cast<bool>( config.preset_value );
|
|
|
|
}
|
|
|
|
bool schematic::SettableValue::Setting::isValid() {
|
|
|
|
using namespace std;
|
|
|
|
return not isnan( preset_value );
|
|
|
|
}
|
|
|
|
bool schematic::SettableFlag::Setting::isValid() {
|
|
|
|
return (preset_value == 0u) or (preset_value == 1u);
|
|
|
|
}
|