refactor
This commit is contained in:
parent
3b674d75ab
commit
69a47940ce
@ -19,43 +19,72 @@ void Scenerunner::start() {
|
||||
runStepStart = millis();
|
||||
}
|
||||
|
||||
void Scenerunner::nextAction() {
|
||||
void Scenerunner::_runHandler_off() {
|
||||
_lcd->setCursor(0, 1);
|
||||
switch (runStep) {
|
||||
case RUN_OFF:
|
||||
_lcd->print("rS: OFF ");
|
||||
break;
|
||||
case RUN_SETTLE:
|
||||
}
|
||||
|
||||
void Scenerunner::_runHandler_settle() {
|
||||
_lcd->setCursor(0, 1);
|
||||
_lcd->print("rS: SETTLE ");
|
||||
if (millis() >= runStepStart + tSettle) {
|
||||
runStep = RUN_FOCUS;
|
||||
runStepStart = millis();
|
||||
}
|
||||
break;
|
||||
case RUN_FOCUS:
|
||||
}
|
||||
|
||||
void Scenerunner::_runHandler_focus() {
|
||||
_lcd->setCursor(0, 1);
|
||||
_lcd->print("rS: FOCUS ");
|
||||
if (millis() >= runStepStart + tFocus) {
|
||||
runStep = RUN_SHUTTER;
|
||||
runStepStart = millis();
|
||||
}
|
||||
break;
|
||||
case RUN_SHUTTER:
|
||||
}
|
||||
|
||||
void Scenerunner::_runHandler_shutter() {
|
||||
_lcd->setCursor(0, 1);
|
||||
_lcd->print("rS: SHUTTER ");
|
||||
if (millis() >= runStepStart + tShutter) {
|
||||
runStep = RUN_MOVE;
|
||||
runStepStart = millis();
|
||||
}
|
||||
break;
|
||||
case RUN_MOVE:
|
||||
}
|
||||
|
||||
void Scenerunner::_runHandler_move() {
|
||||
_lcd->setCursor(0, 1);
|
||||
_lcd->print("rS: MOVE ");
|
||||
if (millis() >= runStepStart + 1234) {
|
||||
// dummy wait time
|
||||
runStep = RUN_SETTLE;
|
||||
runStepStart = millis();
|
||||
}
|
||||
}
|
||||
|
||||
void Scenerunner::_runHandler_return() {
|
||||
_lcd->setCursor(0, 1);
|
||||
_lcd->print("rS: RETURN ");
|
||||
}
|
||||
|
||||
void Scenerunner::nextAction() {
|
||||
switch (runStep) {
|
||||
case RUN_OFF:
|
||||
_runHandler_off();
|
||||
break;
|
||||
case RUN_SETTLE:
|
||||
_runHandler_settle();
|
||||
break;
|
||||
case RUN_FOCUS:
|
||||
_runHandler_focus();
|
||||
break;
|
||||
case RUN_SHUTTER:
|
||||
_runHandler_shutter();
|
||||
break;
|
||||
case RUN_MOVE:
|
||||
_runHandler_move();
|
||||
break;
|
||||
case RUN_RETURN:
|
||||
_lcd->print("rS: RETURN ");
|
||||
_runHandler_return();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -34,6 +34,13 @@ class Scenerunner {
|
||||
RunStep runStep = RUN_OFF;
|
||||
unsigned long int runStepStart;
|
||||
|
||||
void _runHandler_off();
|
||||
void _runHandler_settle();
|
||||
void _runHandler_focus();
|
||||
void _runHandler_shutter();
|
||||
void _runHandler_move();
|
||||
void _runHandler_return();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user