38 lines
635 B
C++
38 lines
635 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);
|
||
|
||
}
|