state-handler: #6 rename the class
This commit is contained in:
47
StateHandler/src/Counter.cpp
Normal file
47
StateHandler/src/Counter.cpp
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Counter.cpp
|
||||
*
|
||||
* Created on: Sep 1, 2022
|
||||
* Author: tylen
|
||||
*/
|
||||
|
||||
#include "Counter.h"
|
||||
|
||||
#include "Counter.h"
|
||||
|
||||
void Counter::inc() {
|
||||
if(init >= up_lim){
|
||||
init = 0;
|
||||
} else{
|
||||
++init;
|
||||
}
|
||||
}
|
||||
|
||||
void Counter::dec() {
|
||||
if(init <= 0){
|
||||
init = up_lim;
|
||||
} else{
|
||||
--init;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int Counter::getInit(){
|
||||
return this->init;
|
||||
}
|
||||
|
||||
Counter::Counter(int i, int up) {
|
||||
up_lim = up;
|
||||
if(i > up){
|
||||
init = up;
|
||||
}else if(i < 0){
|
||||
init = 0;
|
||||
}else{
|
||||
init = i;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Counter::setInit(int i){
|
||||
init = i;
|
||||
}
|
||||
27
StateHandler/src/StateHandler.cpp
Normal file
27
StateHandler/src/StateHandler.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* StateHandler.cpp
|
||||
*
|
||||
* Created on: Sep 21, 2022
|
||||
* Author: tylen
|
||||
*/
|
||||
|
||||
#include <StateHandler.h>
|
||||
|
||||
StateHandler::StateHandler(EVENT_HANDL * btns) {
|
||||
// TODO Auto-generated constructor stub
|
||||
|
||||
}
|
||||
|
||||
StateHandler::~StateHandler() {
|
||||
// TODO Auto-generated destructor stub
|
||||
}
|
||||
|
||||
int StateHandler::getSetPresuure(){
|
||||
//TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
int StateHandler::getSetSpeed(){
|
||||
// TODO
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user