xCPS
|
#include <Stopper.h>
Public Member Functions | |
Stopper (int stoppernumber) | |
void | enable () |
void | disable () |
void | initComm (CommSystem *communication) |
Protected Attributes | |
int | _mask |
int | _card |
CommSystem * | comm |
In the class, the methods to control stoppers of the xCPS are defined. The main function of the stoppers is controlled by using the enable() method, which extends the stopper, and the disable() method, which returns the stopper to its retracted state. Enums can be used to call the stoppers, an attempt was made to keep the names logical. The number on which these enums are based are the ones found in the documentation of the xCPS machine, except for the stopper at band 5, which has been given the number 5. Note that there are no sensors available for the stopper, so it is not possible to check whether a stopper has been extended properly (sleeps may therefore come in handy to ensure correct behaviour).
Stopper::Stopper | ( | int | stoppernumber | ) |
Initializes the stoppers. The numbers are chosen based on the number assigned to them in (hex/masks) documentation, but also enums (as defined in the header file) can be used. The masks are all hardcoded, as are the cards, since the assumption is that these won't (necessarily) need to be changed.
void Stopper::disable | ( | ) |
Disables the stopper, i.e. retract it such that it no longer prevents an approaching block from passing.
void Stopper::enable | ( | ) |
Enables the stopper. Note: with 'enable' is meant: the stopper extends, enabling it to stop an approaching block. The stopper will stay in its extended state until disable() is called!
void Stopper::initComm | ( | CommSystem * | communication | ) |