M1M3 Support System
Loading...
Searching...
No Matches
State.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 STATE_H_
25#define STATE_H_
26
27#include <string>
28#include <time.h>
29
30#include <AbortProfileCommand.h>
31#include <AbortRaiseM1M3Command.h>
32#include <ApplyActiveOpticForcesCommand.h>
33#include <ApplyOffsetForcesByMirrorForceCommand.h>
34#include <ApplyOffsetForcesCommand.h>
35#include <BoosterValveCloseCommand.h>
36#include <BoosterValveOpenCommand.h>
37#include <ClearActiveOpticForcesCommand.h>
38#include <ClearOffsetForcesCommand.h>
39#include <ClearSlewFlagCommand.h>
40#include <Command.h>
41#include <DisableCommand.h>
42#include <DisableForceActuatorCommand.h>
43#include <DisableHardpointChaseCommand.h>
44#include <DisableHardpointCorrectionsCommand.h>
45#include <EnableAllForceActuatorsCommand.h>
46#include <EnableCommand.h>
47#include <EnableDisableForceComponentCommand.h>
48#include <EnableForceActuatorCommand.h>
49#include <EnableHardpointChaseCommand.h>
50#include <EnableHardpointCorrectionsCommand.h>
51#include <EnterControlCommand.h>
52#include <EnterEngineeringCommand.h>
53#include <ExitControlCommand.h>
54#include <ExitEngineeringCommand.h>
55#include <ForceActuatorBumpTestCommand.h>
56#include <KillForceActuatorBumpTestCommand.h>
57#include <KillHardpointTestCommand.h>
58#include <LowerM1M3Command.h>
59#include <MoveHardpointActuatorsCommand.h>
60#include <PauseM1M3RaisingLoweringCommand.h>
61#include <PositionM1M3Command.h>
62#include <RaiseM1M3Command.h>
63#include <ResetPIDCommand.h>
64#include <ResumeM1M3RaisingLoweringCommand.h>
65#include <RunMirrorForceProfileCommand.h>
66#include <SetSlewControllerSettingsCommand.h>
67#include <SetSlewFlagCommand.h>
68#include <StandbyCommand.h>
69#include <StartCommand.h>
70#include <StateTypes.h>
71#include <StopHardpointMotionCommand.h>
72#include <TMAAzimuthSampleCommand.h>
73#include <TMAElevationSampleCommand.h>
74#include <TestHardpointCommand.h>
75#include <TranslateM1M3Command.h>
76#include <TurnAirOffCommand.h>
77#include <TurnAirOnCommand.h>
78#include <TurnLightsOffCommand.h>
79#include <TurnLightsOnCommand.h>
80#include <TurnPowerOffCommand.h>
81#include <TurnPowerOnCommand.h>
82#include <UpdateCommand.h>
83#include <UpdatePIDCommand.h>
84
85namespace LSST {
86namespace M1M3 {
87namespace SS {
88
94class State {
95public:
96 State(std::string name);
97 virtual ~State();
98
107 virtual States::Type enterControl(EnterControlCommand *command);
108 virtual States::Type start(StartCommand *command);
109 virtual States::Type enable(EnableCommand *command);
110 virtual States::Type disable(DisableCommand *command);
111 virtual States::Type standby(StandbyCommand *command);
112 virtual States::Type exitControl(ExitControlCommand *command);
113
124 virtual States::Type update(UpdateCommand *command) = 0;
125 virtual States::Type setSlewFlag(SetSlewFlagCommand *command);
126 virtual States::Type clearSlewFlag(ClearSlewFlagCommand *command);
127 virtual States::Type turnAirOn(TurnAirOnCommand *command);
128 virtual States::Type turnAirOff(TurnAirOffCommand *command);
129 virtual States::Type boosterValveOpen(BoosterValveOpenCommand *command);
130 virtual States::Type boosterValveClose(BoosterValveCloseCommand *command);
131 virtual States::Type applyOffsetForces(ApplyOffsetForcesCommand *command);
132 virtual States::Type clearOffsetForces(ClearOffsetForcesCommand *command);
133 virtual States::Type raiseM1M3(RaiseM1M3Command *command);
134 virtual States::Type lowerM1M3(LowerM1M3Command *command);
135 virtual States::Type pauseM1M3RaisingLowering(PauseM1M3RaisingLoweringCommand *command);
136 virtual States::Type resumeM1M3RaisingLowering(ResumeM1M3RaisingLoweringCommand *command);
137 virtual States::Type applyActiveOpticForces(ApplyActiveOpticForcesCommand *command);
138 virtual States::Type clearActiveOpticForces(ClearActiveOpticForcesCommand *command);
139 virtual States::Type enterEngineering(EnterEngineeringCommand *command);
140 virtual States::Type exitEngineering(ExitEngineeringCommand *command);
141 virtual States::Type testHardpoint(TestHardpointCommand *command);
142 virtual States::Type killHardpointTest(KillHardpointTestCommand *command);
143 virtual States::Type moveHardpointActuators(MoveHardpointActuatorsCommand *command);
144 virtual States::Type enableHardpointChase(EnableHardpointChaseCommand *command);
145 virtual States::Type disableHardpointChase(DisableHardpointChaseCommand *command);
146 virtual States::Type abortRaiseM1M3(AbortRaiseM1M3Command *command);
147 virtual States::Type translateM1M3(TranslateM1M3Command *command);
148 virtual States::Type stopHardpointMotion(StopHardpointMotionCommand *command);
149 virtual States::Type storeTMAAzimuthSample(TMAAzimuthSampleCommand *command);
150 virtual States::Type storeTMAElevationSample(TMAElevationSampleCommand *command);
151 virtual States::Type positionM1M3(PositionM1M3Command *command);
152 virtual States::Type turnLightsOn(TurnLightsOnCommand *command);
153 virtual States::Type turnLightsOff(TurnLightsOffCommand *command);
154 virtual States::Type turnPowerOn(TurnPowerOnCommand *command);
155 virtual States::Type turnPowerOff(TurnPowerOffCommand *command);
156 virtual States::Type enableHardpointCorrections(EnableHardpointCorrectionsCommand *command);
157 virtual States::Type disableHardpointCorrections(DisableHardpointCorrectionsCommand *command);
158 virtual States::Type runMirrorForceProfile(RunMirrorForceProfileCommand *command);
159 virtual States::Type abortProfile(AbortProfileCommand *command);
160 virtual States::Type applyOffsetForcesByMirrorForce(ApplyOffsetForcesByMirrorForceCommand *command);
161 virtual States::Type updatePID(UpdatePIDCommand *command);
162 virtual States::Type resetPID(ResetPIDCommand *command);
163 virtual States::Type forceActuatorBumpTest(ForceActuatorBumpTestCommand *command);
164 virtual States::Type killForceActuatorBumpTest(KillForceActuatorBumpTestCommand *command);
165 virtual States::Type disableForceActuator(DisableForceActuatorCommand *command);
166 virtual States::Type enableForceActuator(EnableForceActuatorCommand *command);
167 virtual States::Type enableAllForceActuators(EnableAllForceActuatorsCommand *command);
168 virtual States::Type enableDisableForceComponent(EnableDisableForceComponentCommand *command);
169 virtual States::Type setSlewControllerSettings(SetSlewControllerSettingsCommand *command);
170
171protected:
172 std::string name;
173
174 States::Type rejectCommandInvalidState(Command *command, std::string cmd_name);
175};
176
177} /* namespace SS */
178} /* namespace M1M3 */
179} /* namespace LSST */
180
181#endif /* STATE_H_ */
Definition AbortProfileCommand.h:35
Definition AbortRaiseM1M3Command.h:37
Definition ApplyActiveOpticForcesCommand.h:35
Definition ApplyOffsetForcesByMirrorForceCommand.h:35
Definition ApplyOffsetForcesCommand.h:35
Sets slew flag for force actuators.
Definition BoosterValveCloseCommand.h:40
Command system to open booster valves.
Definition BoosterValveOpenCommand.h:39
Definition ClearActiveOpticForcesCommand.h:35
Definition ClearOffsetForcesCommand.h:35
Definition ClearSlewFlagCommand.h:35
Parent class for all commands.
Definition Command.h:42
Definition DisableCommand.h:40
Disable single force actuator for use in static support.
Definition DisableForceActuatorCommand.h:38
Definition DisableHardpointChaseCommand.h:35
Definition DisableHardpointCorrectionsCommand.h:35
Enable all force actuators for use in static support.
Definition EnableAllForceActuatorsCommand.h:38
Definition EnableCommand.h:40
Definition EnableDisableForceComponentCommand.h:35
Enable single force actuator for use in static support.
Definition EnableForceActuatorCommand.h:38
Definition EnableHardpointChaseCommand.h:35
Definition EnableHardpointCorrectionsCommand.h:35
Definition EnterControlCommand.h:39
Definition EnterEngineeringCommand.h:34
Definition ExitControlCommand.h:40
Definition ExitEngineeringCommand.h:34
Command to start bump testing of force actuator.
Definition ForceActuatorBumpTestCommand.h:40
Stops any running force actuator bump test.
Definition KillForceActuatorBumpTestCommand.h:40
Abort any hardpoint test in progress,.
Definition KillHardpointTestCommand.h:38
Definition LowerM1M3Command.h:35
Definition MoveHardpointActuatorsCommand.h:35
Definition PauseM1M3RaisingLoweringCommand.h:34
Definition PositionM1M3Command.h:35
Definition RaiseM1M3Command.h:35
Definition ResetPIDCommand.h:35
Definition ResumeM1M3RaisingLoweringCommand.h:34
Definition RunMirrorForceProfileCommand.h:35
Definition SetSlewControllerSettingsCommand.h:35
Definition SetSlewFlagCommand.h:35
Definition StandbyCommand.h:40
Definition StartCommand.h:43
virtual States::Type update(UpdateCommand *command)=0
Called to retrieve telemetry data.
virtual States::Type enterControl(EnterControlCommand *command)
Executes EnterControlCommand.
Definition State.cpp:37
Definition StopHardpointMotionCommand.h:35
Definition TMAAzimuthSampleCommand.h:36
Definition TMAElevationSampleCommand.h:36
Definition TestHardpointCommand.h:35
Definition TranslateM1M3Command.h:35
Definition TurnAirOffCommand.h:35
Definition TurnAirOnCommand.h:35
Definition TurnLightsOffCommand.h:35
Definition TurnLightsOnCommand.h:35
Definition TurnPowerOffCommand.h:35
Definition TurnPowerOnCommand.h:35
Definition UpdateCommand.h:39
Definition UpdatePIDCommand.h:35