diff --git a/src/LSST/M1M3/TS/MPU/FlowMeter.h b/src/LSST/M1M3/TS/MPU/FlowMeter.h index ff01a04..a91c348 100644 --- a/src/LSST/M1M3/TS/MPU/FlowMeter.h +++ b/src/LSST/M1M3/TS/MPU/FlowMeter.h @@ -31,11 +31,16 @@ namespace TS { /** * Reads FlowMeter values. + * [Documentation](https://rubinobs.atlassian.net/wiki/spaces/LTS/pages/50081742/Datasheets?preview=/50081742/50505733/FDT40%20Users%20Guide.pdf) + * [Datasheets](https://confluence.lsstcorp.org/display/LTS/Datasheets). */ class FlowMeter : public cRIO::MPU { public: FlowMeter(uint8_t bus) : MPU(bus, 1) {} + /** + * Push calls to readout FlowMeter registers. + */ void readInfo(); uint16_t getSignalStrength() { return getRegister(5500); } @@ -49,6 +54,9 @@ class FlowMeter : public cRIO::MPU { double _getDoubleValue(uint16_t reg); }; +/** + * Add print() method to print readout values. + */ class FlowMeterPrint : public FlowMeter { public: FlowMeterPrint(uint8_t bus) : FlowMeter(bus) {} diff --git a/src/LSST/M1M3/TS/MPU/VFD.h b/src/LSST/M1M3/TS/MPU/VFD.h index c59ccbb..626bf90 100644 --- a/src/LSST/M1M3/TS/MPU/VFD.h +++ b/src/LSST/M1M3/TS/MPU/VFD.h @@ -44,12 +44,31 @@ class VFD : public cRIO::MPU { void readInfo(); + /** + * Starts pump - make sure it is running. + */ void start() { presetHoldingRegister(0x2000, 0x1a); } + + /** + * Stops pump - stop its motor. + */ void stop() { presetHoldingRegister(0x2000, 0x01); } + + /** + * Reset pump state - clear all errors. + */ void resetCommand() { presetHoldingRegister(0x2000, 0x08); } + + /** + * Set pump output frequency. + */ void setFrequency(float freq) { presetHoldingRegister(0x2001, freq * 100.0f); } + /** + * Returns pump status. + */ uint16_t getStatus() { return getRegister(0x2000); } + float getCommandedFrequency() { return getRegister(0x2001) / 100.0f; } uint16_t getVelocityPositionBits() { return getRegister(0x2100); } diff --git a/src/LSST/M1M3/TS/Telemetry/FlowMeterThread.h b/src/LSST/M1M3/TS/Telemetry/FlowMeterThread.h index c669bb9..8dc5c74 100644 --- a/src/LSST/M1M3/TS/Telemetry/FlowMeterThread.h +++ b/src/LSST/M1M3/TS/Telemetry/FlowMeterThread.h @@ -33,6 +33,10 @@ namespace M1M3 { namespace TS { namespace Telemetry { +/** + * Thread reading out flow meter values. Started from TSPublisher when CSC + * enteres disabled state, updates SAL flow meter telemetery. + */ class FlowMeterThread final : public cRIO::Thread, MTM1M3TS_flowMeterC { public: FlowMeterThread(std::shared_ptr flowMeter); diff --git a/src/LSST/M1M3/TS/Telemetry/PumpThread.h b/src/LSST/M1M3/TS/Telemetry/PumpThread.h index 68b874b..d8c5b45 100644 --- a/src/LSST/M1M3/TS/Telemetry/PumpThread.h +++ b/src/LSST/M1M3/TS/Telemetry/PumpThread.h @@ -34,6 +34,10 @@ namespace M1M3 { namespace TS { namespace Telemetry { +/** + * Thread reading out pump values. Started from TSPublisher when CSC + * enteres disabled state, updates SAL VFD pump telemetery. + */ class PumpThread final : public cRIO::Thread, MTM1M3TS_glycolPumpC { public: PumpThread(std::shared_ptr vfd);