A class to manage the details of one stage in a Zaber system. More...
#include <zaberStage.hpp>
Public Member Functions | |
zaberStage ()=delete | |
zaberStage (parentT *parent) | |
std::string | name () |
Get the device name. More... | |
int | name (const std::string &n) |
Set the device name. More... | |
std::string | serial () |
Get the device serial number. More... | |
int | serial (const std::string &s) |
Set the device serial. More... | |
int | deviceAddress () |
Get the device address. More... | |
int | deviceAddress (const int &da) |
Set the device address. More... | |
int | axisNumber () |
Get the axis number. More... | |
int | axisNumber (const int &an) |
Set the axis number. More... | |
bool | commandStatus () |
Get the command status. More... | |
char | deviceStatus () |
Get the device status. More... | |
bool | homing () |
Get the homing status. More... | |
long | rawPos () |
Get the current raw position, in counts. More... | |
long | tgtPos () |
Get the current tgt position, in counts. More... | |
long | maxPos () |
Get the max position, in counts. More... | |
bool | warn () |
Get the status of the warning flag. More... | |
float | temp () |
Get the temperature, in C. More... | |
bool | warningState () |
Get the warning state. More... | |
bool | warnFD () |
bool | warnFQ () |
bool | warnFS () |
bool | warnFT () |
bool | warnFB () |
bool | warnFP () |
bool | warnFE () |
bool | warnWH () |
bool | warnWL () |
bool | warnWP () |
bool | warnWV () |
bool | warnWT () |
bool | warnWM () |
bool | warnWR () |
bool | warnNC () |
bool | warnNI () |
bool | warnND () |
bool | warnNU () |
bool | warnNJ () |
bool | warnUNK () |
int | getResponse (std::string &response, const std::string &repBuff) |
Get a response from the device, after a command has been sent. More... | |
int | getResponse (std::string &response, const za_reply &rep) |
Get a response from the device, after a command has been sent. More... | |
int | sendCommand (std::string &response, z_port port, const std::string &command) |
int | getMaxPos (z_port port) |
int | updatePos (z_port port) |
int | updateTemp (z_port port) |
int | stop (z_port port) |
int | estop (z_port port) |
int | home (z_port port) |
int | moveAbs (z_port port, long rawPos) |
int | unsetWarnings () |
Sets all warning flags to false. More... | |
int | processWarning (std::string &warn) |
Process a single warning from the device, setting the appropriate flag. More... | |
int | parseWarnings (std::string &response) |
Parse the warning response from the device. More... | |
int | getWarnings (z_port port) |
Get warnings from the device. More... | |
int | onPowerOff () |
Clear all state so that when the system is powered back on we get the correct new state. More... | |
Protected Attributes | |
parentT * | m_parent {nullptr} |
std::string | m_name |
The stage's name. More... | |
std::string | m_serial |
The stage's serial number. More... | |
int | m_deviceAddress {-1} |
The device's address, a.k.a. its order in the chain. More... | |
int | m_axisNumber {0} |
The axis number at the address (normally 0 in MagAO-X) More... | |
bool | m_commandStatus {true} |
The status of the last command sent. true = OK, false = RJ (rejected) More... | |
char | m_deviceStatus {'U'} |
Current status. Either 'I' for IDLE or 'B' for BUSY. Intializes to 'U' for UNKOWN. More... | |
bool | m_homing {false} |
long | m_rawPos |
The raw position reported by the device, in microsteps. More... | |
long | m_tgtPos {0} |
The tgt position last sent to the device, in microsteps. More... | |
long | m_maxPos |
The max position allowed for the device, set by config. Will be set to no larger m_maxPosHW. More... | |
float | m_temp {-999} |
The driver temperature, in C. More... | |
bool | m_warn {false} |
bool | m_warnFD {false} |
bool | m_warnFDreported {false} |
bool | m_warnFQ {false} |
bool | m_warnFQreported {false} |
bool | m_warnFS {false} |
bool | m_warnFSreported {false} |
bool | m_warnFT {false} |
bool | m_warnFTreported {false} |
bool | m_warnFB {false} |
bool | m_warnFBreported {false} |
bool | m_warnFP {false} |
bool | m_warnFPreported {false} |
bool | m_warnFE {false} |
bool | m_warnFEreported {false} |
bool | m_warnWH {false} |
bool | m_warnWHreported {false} |
bool | m_warnWL {false} |
bool | m_warnWLreported {false} |
bool | m_warnWP {false} |
bool | m_warnWPreported {false} |
bool | m_warnWV {false} |
bool | m_warnWVreported {false} |
bool | m_warnWT {false} |
bool | m_warnWTreported {false} |
bool | m_warnWM {false} |
bool | m_warnWMreported {false} |
bool | m_warnWR {false} |
bool | m_warnWRreported {false} |
bool | m_warnNC {false} |
bool | m_warnNCreported {false} |
bool | m_warnNI {false} |
bool | m_warnNIreported {false} |
bool | m_warnND {false} |
bool | m_warnNDreported {false} |
bool | m_warnNU {false} |
bool | m_warnNUreported {false} |
bool | m_warnNJ {false} |
bool | m_warnNJreported {false} |
bool | m_warnUNK {false} |
A class to manage the details of one stage in a Zaber system.
Definition at line 28 of file zaberStage.hpp.
|
delete |
|
inline |
Definition at line 101 of file zaberStage.hpp.
int MagAOX::app::zaberStage< parentT >::axisNumber |
Get the axis number.
Definition at line 353 of file zaberStage.hpp.
int MagAOX::app::zaberStage< parentT >::axisNumber | ( | const int & | an | ) |
Set the axis number.
[in] | an | the new axis number |
Definition at line 359 of file zaberStage.hpp.
bool MagAOX::app::zaberStage< parentT >::commandStatus |
Get the command status.
Definition at line 366 of file zaberStage.hpp.
int MagAOX::app::zaberStage< parentT >::deviceAddress |
Get the device address.
Definition at line 340 of file zaberStage.hpp.
int MagAOX::app::zaberStage< parentT >::deviceAddress | ( | const int & | da | ) |
Set the device address.
[in] | da | the new device address |
Definition at line 346 of file zaberStage.hpp.
char MagAOX::app::zaberStage< parentT >::deviceStatus |
Get the device status.
Definition at line 372 of file zaberStage.hpp.
int MagAOX::app::zaberStage< parentT >::estop | ( | z_port | port | ) |
Definition at line 833 of file zaberStage.hpp.
int MagAOX::app::zaberStage< parentT >::getMaxPos | ( | z_port | port | ) |
[in] | port | the port with which to communicate |
Definition at line 654 of file zaberStage.hpp.
int MagAOX::app::zaberStage< parentT >::getResponse | ( | std::string & | response, |
const std::string & | repBuff | ||
) |
Get a response from the device, after a command has been sent.
Parses the standard parts of the response in this stage's fields, and extracts the response string.
[out] | response | the text response |
[in] | repBuff | the reply buffer, not decoded. |
Definition at line 540 of file zaberStage.hpp.
int MagAOX::app::zaberStage< parentT >::getResponse | ( | std::string & | response, |
const za_reply & | rep | ||
) |
Get a response from the device, after a command has been sent.
Parses the standard parts of the response in this stages fields, and extracts the response string.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
[out] | response | the text response component |
[in] | rep | the decodedstage reply |
Definition at line 561 of file zaberStage.hpp.
int MagAOX::app::zaberStage< parentT >::getWarnings | ( | z_port | port | ) |
Get warnings from the device.
Log entries will be made and flags will be set in this structure.
[in] | port | the port with which to communicate |
Definition at line 1418 of file zaberStage.hpp.
int MagAOX::app::zaberStage< parentT >::home | ( | z_port | port | ) |
[in] | port | the port with which to communicate |
Definition at line 877 of file zaberStage.hpp.
bool MagAOX::app::zaberStage< parentT >::homing |
Get the homing status.
Definition at line 378 of file zaberStage.hpp.
long MagAOX::app::zaberStage< parentT >::maxPos |
Get the max position, in counts.
Definition at line 396 of file zaberStage.hpp.
int MagAOX::app::zaberStage< parentT >::moveAbs | ( | z_port | port, |
long | rawPos | ||
) |
[in] | port | the port with which to communicate |
[in] | rawPos | the position to move to, in counts |
Definition at line 922 of file zaberStage.hpp.
std::string MagAOX::app::zaberStage< parentT >::name |
Get the device name.
Definition at line 314 of file zaberStage.hpp.
int MagAOX::app::zaberStage< parentT >::name | ( | const std::string & | n | ) |
Set the device name.
[in] | n | the new device name |
Definition at line 320 of file zaberStage.hpp.
int MagAOX::app::zaberStage< parentT >::onPowerOff |
Clear all state so that when the system is powered back on we get the correct new state.
< The status of the last command sent. true = OK, false = RJ (rejected)
< Current status. Either 'I' for IDLE or 'B' for BUSY. Intializes to 'U' for UNKOWN.
< The tgt position last sent to the device, in microsteps.
< The driver temperature, in C.
Definition at line 1464 of file zaberStage.hpp.
int MagAOX::app::zaberStage< parentT >::parseWarnings | ( | std::string & | response | ) |
Parse the warning response from the device.
Sends each warning flag to processWarning.
[in] | response | the response from the warnings query |
Definition at line 1227 of file zaberStage.hpp.
Referenced by zaberStage_test::SCENARIO().
int MagAOX::app::zaberStage< parentT >::processWarning | ( | std::string & | warn | ) |
Process a single warning from the device, setting the appropriate flag.
Warnings are two ASCII characeters, e.g. "WR".
[in] | warn | the two-character warning flag |
Definition at line 999 of file zaberStage.hpp.
long MagAOX::app::zaberStage< parentT >::rawPos |
Get the current raw position, in counts.
Definition at line 384 of file zaberStage.hpp.
int MagAOX::app::zaberStage< parentT >::sendCommand | ( | std::string & | response, |
z_port | port, | ||
const std::string & | command | ||
) |
[out] | response | the response received from the stage |
[in] | port | the port with which to communicate |
[in] | command | the command to send |
Definition at line 594 of file zaberStage.hpp.
std::string MagAOX::app::zaberStage< parentT >::serial |
Get the device serial number.
Definition at line 327 of file zaberStage.hpp.
int MagAOX::app::zaberStage< parentT >::serial | ( | const std::string & | s | ) |
Set the device serial.
[in] | s | the new device serial |
Definition at line 333 of file zaberStage.hpp.
int MagAOX::app::zaberStage< parentT >::stop | ( | z_port | port | ) |
Definition at line 789 of file zaberStage.hpp.
float MagAOX::app::zaberStage< parentT >::temp |
Get the temperature, in C.
Definition at line 408 of file zaberStage.hpp.
long MagAOX::app::zaberStage< parentT >::tgtPos |
Get the current tgt position, in counts.
Definition at line 390 of file zaberStage.hpp.
int MagAOX::app::zaberStage< parentT >::unsetWarnings |
Sets all warning flags to false.
This is not the same as clearing warnings on the device, this is just used for bookkeeping.
Definition at line 970 of file zaberStage.hpp.
int MagAOX::app::zaberStage< parentT >::updatePos | ( | z_port | port | ) |
[in] | port | the port with which to communicate |
Definition at line 699 of file zaberStage.hpp.
int MagAOX::app::zaberStage< parentT >::updateTemp | ( | z_port | port | ) |
[in] | port | the port with which to communicate |
Definition at line 744 of file zaberStage.hpp.
bool MagAOX::app::zaberStage< parentT >::warn |
Get the status of the warning flag.
Definition at line 402 of file zaberStage.hpp.
bool MagAOX::app::zaberStage< parentT >::warnFB |
Definition at line 444 of file zaberStage.hpp.
Referenced by zaberStage_test::SCENARIO().
bool MagAOX::app::zaberStage< parentT >::warnFD |
Definition at line 420 of file zaberStage.hpp.
Referenced by zaberStage_test::SCENARIO().
bool MagAOX::app::zaberStage< parentT >::warnFE |
Definition at line 456 of file zaberStage.hpp.
Referenced by zaberStage_test::SCENARIO().
bool MagAOX::app::zaberStage< parentT >::warnFP |
Definition at line 450 of file zaberStage.hpp.
Referenced by zaberStage_test::SCENARIO().
bool MagAOX::app::zaberStage< parentT >::warnFQ |
Definition at line 426 of file zaberStage.hpp.
Referenced by zaberStage_test::SCENARIO().
bool MagAOX::app::zaberStage< parentT >::warnFS |
Definition at line 432 of file zaberStage.hpp.
Referenced by zaberStage_test::SCENARIO().
bool MagAOX::app::zaberStage< parentT >::warnFT |
Definition at line 438 of file zaberStage.hpp.
Referenced by zaberStage_test::SCENARIO().
bool MagAOX::app::zaberStage< parentT >::warningState |
Get the warning state.
Definition at line 414 of file zaberStage.hpp.
Referenced by zaberStage_test::SCENARIO().
bool MagAOX::app::zaberStage< parentT >::warnNC |
Definition at line 504 of file zaberStage.hpp.
Referenced by zaberStage_test::SCENARIO().
bool MagAOX::app::zaberStage< parentT >::warnND |
Definition at line 516 of file zaberStage.hpp.
Referenced by zaberStage_test::SCENARIO().
bool MagAOX::app::zaberStage< parentT >::warnNI |
Definition at line 510 of file zaberStage.hpp.
Referenced by zaberStage_test::SCENARIO().
bool MagAOX::app::zaberStage< parentT >::warnNJ |
Definition at line 528 of file zaberStage.hpp.
Referenced by zaberStage_test::SCENARIO().
bool MagAOX::app::zaberStage< parentT >::warnNU |
Definition at line 522 of file zaberStage.hpp.
Referenced by zaberStage_test::SCENARIO().
bool MagAOX::app::zaberStage< parentT >::warnUNK |
Definition at line 534 of file zaberStage.hpp.
Referenced by zaberStage_test::SCENARIO().
bool MagAOX::app::zaberStage< parentT >::warnWH |
Definition at line 462 of file zaberStage.hpp.
Referenced by zaberStage_test::SCENARIO().
bool MagAOX::app::zaberStage< parentT >::warnWL |
Definition at line 468 of file zaberStage.hpp.
Referenced by zaberStage_test::SCENARIO().
bool MagAOX::app::zaberStage< parentT >::warnWM |
Definition at line 492 of file zaberStage.hpp.
Referenced by zaberStage_test::SCENARIO().
bool MagAOX::app::zaberStage< parentT >::warnWP |
Definition at line 474 of file zaberStage.hpp.
Referenced by zaberStage_test::SCENARIO().
bool MagAOX::app::zaberStage< parentT >::warnWR |
Definition at line 498 of file zaberStage.hpp.
Referenced by zaberStage_test::SCENARIO().
bool MagAOX::app::zaberStage< parentT >::warnWT |
Definition at line 486 of file zaberStage.hpp.
Referenced by zaberStage_test::SCENARIO().
bool MagAOX::app::zaberStage< parentT >::warnWV |
Definition at line 480 of file zaberStage.hpp.
Referenced by zaberStage_test::SCENARIO().
|
protected |
The axis number at the address (normally 0 in MagAO-X)
Definition at line 39 of file zaberStage.hpp.
|
protected |
The status of the last command sent. true = OK, false = RJ (rejected)
Definition at line 41 of file zaberStage.hpp.
|
protected |
The device's address, a.k.a. its order in the chain.
Definition at line 37 of file zaberStage.hpp.
|
protected |
Current status. Either 'I' for IDLE or 'B' for BUSY. Intializes to 'U' for UNKOWN.
Definition at line 43 of file zaberStage.hpp.
|
protected |
Definition at line 45 of file zaberStage.hpp.
|
protected |
The max position allowed for the device, set by config. Will be set to no larger m_maxPosHW.
Definition at line 51 of file zaberStage.hpp.
|
protected |
The stage's name.
Definition at line 33 of file zaberStage.hpp.
|
protected |
Definition at line 31 of file zaberStage.hpp.
Referenced by MagAOX::app::zaberStage< parentT >::zaberStage().
|
protected |
The raw position reported by the device, in microsteps.
Definition at line 47 of file zaberStage.hpp.
|
protected |
The stage's serial number.
Definition at line 35 of file zaberStage.hpp.
|
protected |
The driver temperature, in C.
Definition at line 53 of file zaberStage.hpp.
|
protected |
The tgt position last sent to the device, in microsteps.
Definition at line 49 of file zaberStage.hpp.
|
protected |
Definition at line 55 of file zaberStage.hpp.
|
protected |
Definition at line 65 of file zaberStage.hpp.
|
protected |
Definition at line 66 of file zaberStage.hpp.
|
protected |
Definition at line 57 of file zaberStage.hpp.
|
protected |
Definition at line 58 of file zaberStage.hpp.
|
protected |
Definition at line 69 of file zaberStage.hpp.
|
protected |
Definition at line 70 of file zaberStage.hpp.
|
protected |
Definition at line 67 of file zaberStage.hpp.
|
protected |
Definition at line 68 of file zaberStage.hpp.
|
protected |
Definition at line 59 of file zaberStage.hpp.
|
protected |
Definition at line 60 of file zaberStage.hpp.
|
protected |
Definition at line 61 of file zaberStage.hpp.
|
protected |
Definition at line 62 of file zaberStage.hpp.
|
protected |
Definition at line 63 of file zaberStage.hpp.
|
protected |
Definition at line 64 of file zaberStage.hpp.
|
protected |
Definition at line 85 of file zaberStage.hpp.
|
protected |
Definition at line 86 of file zaberStage.hpp.
|
protected |
Definition at line 89 of file zaberStage.hpp.
|
protected |
Definition at line 90 of file zaberStage.hpp.
|
protected |
Definition at line 87 of file zaberStage.hpp.
|
protected |
Definition at line 88 of file zaberStage.hpp.
|
protected |
Definition at line 93 of file zaberStage.hpp.
|
protected |
Definition at line 94 of file zaberStage.hpp.
|
protected |
Definition at line 91 of file zaberStage.hpp.
|
protected |
Definition at line 92 of file zaberStage.hpp.
|
protected |
Definition at line 95 of file zaberStage.hpp.
|
protected |
Definition at line 71 of file zaberStage.hpp.
|
protected |
Definition at line 72 of file zaberStage.hpp.
|
protected |
Definition at line 73 of file zaberStage.hpp.
|
protected |
Definition at line 74 of file zaberStage.hpp.
|
protected |
Definition at line 81 of file zaberStage.hpp.
|
protected |
Definition at line 82 of file zaberStage.hpp.
|
protected |
Definition at line 75 of file zaberStage.hpp.
|
protected |
Definition at line 76 of file zaberStage.hpp.
|
protected |
Definition at line 83 of file zaberStage.hpp.
|
protected |
Definition at line 84 of file zaberStage.hpp.
|
protected |
Definition at line 79 of file zaberStage.hpp.
|
protected |
Definition at line 80 of file zaberStage.hpp.
|
protected |
Definition at line 77 of file zaberStage.hpp.
|
protected |
Definition at line 78 of file zaberStage.hpp.