2 #include "controller.h"
8 void Controller::Control::set(float v)
16 else if(type==DISCRETE)
17 value = min_value+floor((v-min_value)/step)*step;
18 else if(type==CONTINUOUS)
22 Controller::Control Controller::Control::binary(const string &n)
24 Controller::Control tc;
35 Controller::Control Controller::Control::discrete(const string &n, float m, float x, float s)
38 throw invalid_argument("Controller::Control::discrete");
40 Controller::Control tc;
44 tc.max_value = m+floor((x-m)/s)*s;
51 Controller::Control Controller::Control::continuous(const string &n, float m, float x)
54 throw invalid_argument("Controller::Control::continuous");
56 Controller::Control tc;