13
0

add TransportFSM::transport_speed(), a putative replacement for the Session method of the same name

This commit is contained in:
Paul Davis 2021-04-27 09:51:45 -06:00
parent 438b1e5eab
commit 825c299feb
2 changed files with 16 additions and 0 deletions

View File

@ -151,6 +151,8 @@ struct TransportFSM
std::string current_state () const;
int transport_speed () const;
private:
MotionState _motion_state;
ButlerState _butler_state;

View File

@ -638,6 +638,20 @@ TransportFSM::enqueue (Event* ev)
}
}
int
TransportFSM::transport_speed() const
{
if (_motion_state == Stopped || _direction_state == Reversing) {
return 0;
}
if (_direction_state == Backwards) {
return -1;
}
return 1;
}
void
TransportFSM::set_speed (Event const & ev)
{