MotorControlModuleSDFM_TMS3.../Projects/EFC_Communication/UMLibrary/driver/Brake.cpp
2024-06-07 11:12:56 +03:00

38 lines
553 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* Brake.cpp
*
* Created on: 2 февр. 2018 г.
* Author: titov
*/
#include "Brake.hh"
driver::detail::Brake::Brake( IDiscreteOutput & output ) :
output(output), state(true) {}
void driver::detail::Brake::engage() {
output.off();
state = true;
}
void driver::detail::Brake::disengage() {
output.on();
state = false;
}
bool driver::detail::Brake::isApplied() const {
return state && output.isCompleted();
}
bool driver::detail::Brake::isFree() const {
return !state && output.isCompleted();
}