M1M3 Support System
Loading...
Searching...
No Matches
DigitalInputOutput.h
1/*
2 * This file is part of LSST M1M3 support system package.
3 *
4 * Developed for the Vera C. Rubin Telescope and Site System.
5 * This product includes software developed by the LSST Project
6 * (https://www.lsst.org).
7 * See the COPYRIGHT file at the top-level directory of this distribution
8 * for details of code ownership.
9 *
10 * This program is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22 */
23
24#ifndef DIGITALINPUTOUTPUT_H_
25#define DIGITALINPUTOUTPUT_H_
26
27#include <chrono>
28
29#include <cRIO/Singleton.h>
30
31#include <AirSupplyStatus.h>
32#include <IFPGA.h>
33#include <InterlockStatus.h>
34#include <SafetyController.h>
35#include <cRIO/DataTypes.h>
36
37struct MTM1M3_logevent_airSupplyStatusC;
38struct MTM1M3_logevent_airSupplyWarningC;
39struct MTM1M3_logevent_cellLightStatusC;
40struct MTM1M3_logevent_cellLightWarningC;
41struct MTM1M3_logevent_interlockStatusC;
42struct MTM1M3_logevent_interlockWarningC;
43
44namespace LSST {
45namespace M1M3 {
46namespace SS {
47
51class DigitalInputOutput : public cRIO::Singleton<DigitalInputOutput> {
52public:
56 DigitalInputOutput(token);
57
62 void setSafetyController(SafetyController *safetyController);
63
67 void processData();
68
72 void toggleHeartbeat(double globalTimestamp);
73
81
88
92 void turnAirOn();
96 void turnAirOff();
100 void turnCellLightsOn();
104 void turnCellLightsOff();
105
106private:
107 SafetyController *_safetyController;
108
109 AirSupplyStatus *_airSupplyStatus;
110 MTM1M3_logevent_airSupplyWarningC *_airSupplyWarning;
111 MTM1M3_logevent_cellLightStatusC *_cellLightStatus;
112 MTM1M3_logevent_cellLightWarningC *_cellLightWarning;
113 InterlockStatus *_interlockStatus;
114
115 uint64_t _lastDOTimestamp;
116 uint64_t _lastDITimestamp;
117
118 std::chrono::steady_clock::time_point _lightToggledTime;
119};
120
121} /* namespace SS */
122} /* namespace M1M3 */
123} /* namespace LSST */
124
125#endif /* DIGITALINPUTOUTPUT_H_ */
Handles air supply status.
Definition AirSupplyStatus.h:41
Definition DigitalInputOutput.h:51
void turnAirOff()
Definition DigitalInputOutput.cpp:197
void clearCriticalFailureToSafetyController()
Clear CH1 trigger for critical fault to safety controller.
Definition DigitalInputOutput.cpp:184
void turnAirOn()
Definition DigitalInputOutput.cpp:190
void turnCellLightsOn()
Definition DigitalInputOutput.cpp:204
DigitalInputOutput(token)
Definition DigitalInputOutput.cpp:45
void processData()
Definition DigitalInputOutput.cpp:70
void toggleHeartbeat(double globalTimestamp)
Toggles the global interlock heartbeat signal.
Definition DigitalInputOutput.cpp:168
void turnCellLightsOff()
Definition DigitalInputOutput.cpp:214
void setSafetyController(SafetyController *safetyController)
Definition DigitalInputOutput.cpp:65
void setCriticalFailureToSafetyController()
Sets CH1 trigger for crtitical fult to safety controller.
Definition DigitalInputOutput.cpp:178
Wrapper object for MTM1M3_logevent_interlockStatusC.
Definition InterlockStatus.h:39
Controls mirror safety.
Definition SafetyController.h:50