MotorControlModuleSDFM_TMS3.../Projects/EFC_Communication/UMLibrary/schematic/SettableValue.cpp

38 lines
635 B
C++
Raw Normal View History

2024-06-07 11:12:56 +03:00
/*
* 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);
}