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:
parent
1e48c59cd8
commit
dd890e65bf
@ -95,6 +95,7 @@ void EXTurntable::_broadcastStatus (VPIN vpin, uint8_t status) {
|
|||||||
Turntable *tto = Turntable::getByVpin(vpin);
|
Turntable *tto = Turntable::getByVpin(vpin);
|
||||||
if (tto) {
|
if (tto) {
|
||||||
CommandDistributor::broadcastTurntable(tto->getId(), tto->getPosition(), status);
|
CommandDistributor::broadcastTurntable(tto->getId(), tto->getPosition(), status);
|
||||||
|
tto->setMoving(status);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,6 +109,9 @@ protected:
|
|||||||
// Store the previous position to allow checking for changes
|
// Store the previous position to allow checking for changes
|
||||||
uint8_t _previousPosition = 0;
|
uint8_t _previousPosition = 0;
|
||||||
|
|
||||||
|
// Store the current state of the turntable
|
||||||
|
bool _isMoving = false;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
@ -159,6 +162,8 @@ public:
|
|||||||
void addPosition(uint16_t value);
|
void addPosition(uint16_t value);
|
||||||
uint16_t getPositionValue(uint8_t position);
|
uint16_t getPositionValue(uint8_t position);
|
||||||
uint8_t getPositionCount();
|
uint8_t getPositionCount();
|
||||||
|
bool isMoving() { return _isMoving; }
|
||||||
|
void setMoving(bool moving) { _isMoving=moving; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Virtual functions
|
* Virtual functions
|
||||||
|
Loading…
Reference in New Issue
Block a user