1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-12-24 13:21:23 +01:00

Add move check

This commit is contained in:
peteGSX 2023-09-04 07:38:26 +10:00
parent 1e48c59cd8
commit dd890e65bf
2 changed files with 6 additions and 0 deletions

View File

@ -95,6 +95,7 @@ void EXTurntable::_broadcastStatus (VPIN vpin, uint8_t status) {
Turntable *tto = Turntable::getByVpin(vpin);
if (tto) {
CommandDistributor::broadcastTurntable(tto->getId(), tto->getPosition(), status);
tto->setMoving(status);
}
}

View File

@ -109,6 +109,9 @@ protected:
// Store the previous position to allow checking for changes
uint8_t _previousPosition = 0;
// Store the current state of the turntable
bool _isMoving = false;
/*
* Constructor
*/
@ -159,6 +162,8 @@ public:
void addPosition(uint16_t value);
uint16_t getPositionValue(uint8_t position);
uint8_t getPositionCount();
bool isMoving() { return _isMoving; }
void setMoving(bool moving) { _isMoving=moving; }
/*
* Virtual functions