void Channel::init(int inv, int pin) { //sensibility are used to approximate Time Pulse //usefull on Middle position where there variation of value sensibility = ERROR; //Save Ping of channel if (pin) channelpin = pin; // channelpin[1] = 7, 7 is pin to read Channel 1 //if option inverted are enabled, store config into class Channel if (inv != 1) invert = inv; //init Statics for current Channel ChannelStatistic = Statistic(); ChannelStatistic.clear(); PositionStatistic = Statistic(); PositionStatistic.clear(); //start configuration of Channel clas with output of Reciever configChannel(); }
void BiMotor::Move( MTMovDir_enum Direction, uint8_t Para, MTSpeed_enum Speed ) { if ( 0 == Para ) { ASSERT_T(0); return; } switch ( Direction ) { case MT_FORWARD: case MT_BACKWARD: case MT_STOP: Walk( Direction, Para ); break; case MT_CLOCKWISE: case MT_ANTICLOCK: Rotate( Direction, Para ); break; case MT_TURNLEFT: case MT_TURNRIGHT: //todo break; default: ASSERT_T(0); } /** RunCnt must be set before SpeedVal**/ SetSpeed(Speed); Run(); Statistic( Direction, Para); }
User::User() { this->name = "Name"; this->password = "******"; this->email = Email("*****@*****.**"); this->statistic = Statistic(); }
Statistic Statistic::getInstance(const std::string & name, double value) { if(name.empty()) raiseBugException("empty statistic name"); return Statistic(name, value); }