From f95c15e13c2a6d587634222f83058ca9c2e4b2f3 Mon Sep 17 00:00:00 2001 From: Vasily Davydov Date: Wed, 5 Oct 2022 11:47:14 +0300 Subject: [PATCH] state-handler: #6 change constructor args --- StateHandler/src/StateHandler.cpp | 71 ++++++++++++++++++------------- 1 file changed, 41 insertions(+), 30 deletions(-) diff --git a/StateHandler/src/StateHandler.cpp b/StateHandler/src/StateHandler.cpp index bfd7393..b57e2c0 100644 --- a/StateHandler/src/StateHandler.cpp +++ b/StateHandler/src/StateHandler.cpp @@ -7,46 +7,57 @@ #include -StateHandler::StateHandler(LiquidCrystal * lcd) { - this->_lcd = lcd; - // TODO +StateHandler::StateHandler (LiquidCrystal *lcd) +{ + this->_lcd = lcd; + // TODO } -StateHandler::~StateHandler() { - // TODO Auto-generated destructor stub +StateHandler::~StateHandler () +{ + // TODO Auto-generated destructor stub } -unsigned int StateHandler::getSetPressure(){ - return (unsigned int)this->set[PRESSURE].getCurrent(); +unsigned int +StateHandler::getSetPressure () +{ + return (unsigned int)this->set[PRESSURE].getCurrent (); } -unsigned int StateHandler::getSetSpeed(){ - return (unsigned int)this->set[FAN_SPEED].getCurrent(); +unsigned int +StateHandler::getSetSpeed () +{ + return (unsigned int)this->set[FAN_SPEED].getCurrent (); } -void StateHandler::displaySet(unsigned int value1, unsigned int value2){ - // TODO - /** - * MANUAL MODE: - * ---------------- - * SPEED: 20% - * PRESSURE: XXPa - * ---------------- - * AUTO MODE: - * ---------------- - * PRESSURE SET: 35Pa - * PRESSURE CUR: XXPa - * ---------------- - */ +void +StateHandler::displaySet (unsigned int value1, unsigned int value2) +{ + // TODO + /** + * MANUAL MODE: + * ---------------- + * SPEED: 20% + * PRESSURE: XXPa + * ---------------- + * AUTO MODE: + * ---------------- + * PRESSURE SET: 35Pa + * PRESSURE CUR: XXPa + * ---------------- + */ } -void StateHandler::HandleState(const Event &event){ - (this->*current)(event); +void +StateHandler::HandleState (const Event &event) +{ + (this->*current) (event); } -void StateHandler::SetState(state_pointer newstate){ - (this->*current)(Event(Event::eExit)); - current = newstate; - (this->*current)(Event(Event::eEnter)); - +void +StateHandler::SetState (state_pointer newstate) +{ + (this->*current) (Event (Event::eExit)); + current = newstate; + (this->*current) (Event (Event::eEnter)); }