43 #ifndef _MLAB_CANPOWERSUPPLY_H_ 44 #define _MLAB_CANPOWERSUPPLY_H_ 46 namespace mira {
namespace robot {
73 template <
typename Reflector>
76 r.property(
"MaxCurrent",
88 r.roproperty(
"Current",
90 "Current current [A]");
96 r.roproperty(
"Voltage",
98 "Current voltage [V]");
102 r.roproperty(
"Status",
118 uint16 maxCurrent = (uint16)(current*1000.0f);
168 std::string r = (status & 0x01) ?
"on" :
"off";
169 if ((status & 0x01) && (status & 0x02))
mira::can::CANOpenSDOClientPtr sdoClient
Definition: CANPowerSupply.h:199
void enable(bool enable)
Enable the power supply.
Definition: CANPowerSupply.h:133
uint8 subIndexCurrent
Subindex for retrieving the current.
Definition: CANPowerSupply.h:190
uint8 subIndexMaxCurrent
Subindex for setting/retrieving max current.
Definition: CANPowerSupply.h:187
uint8 subIndexStatus
Subindex for retrieving the status.
Definition: CANPowerSupply.h:196
uint16 index
Index.
Definition: CANPowerSupply.h:181
bool hasVoltage
Does this supply support reading voltage information.
Definition: CANPowerSupply.h:202
CANPowerSupply()
Constructor.
Definition: CANPowerSupply.h:60
boost::shared_ptr< CANOpenSDOClient > CANOpenSDOClientPtr
uint8 nodeID
Id of the can node.
Definition: CANPowerSupply.h:178
float getVoltage()
Return the current voltage.
Definition: CANPowerSupply.h:157
uint8 subIndexVoltage
Subindex for retrieving the voltage.
Definition: CANPowerSupply.h:193
uint8 subIndexEnable
Subindex for enabling the power supply.
Definition: CANPowerSupply.h:184
void reflect(Reflector &r)
Reflect for serialization.
Definition: CANPowerSupply.h:74
Base class for SCITOS modules that act as power supply.
Definition: CANPowerSupply.h:53
float getMaxCurrent()
Return the maximum value for current.
Definition: CANPowerSupply.h:125
void setMaxCurrent(float current)
Set the maximum current.
Definition: CANPowerSupply.h:116
virtual ~CANPowerSupply()
Destructor.
Definition: CANPowerSupply.h:70
float getCurrent()
Return the current current.
Definition: CANPowerSupply.h:149
bool isEnabled()
Is the power supply enabled.
Definition: CANPowerSupply.h:141
virtual std::string getStatus()
Return the status [(on,off)|error] of the power supply.
Definition: CANPowerSupply.h:165