M1M3 Support System
Loading...
Searching...
No Matches
BumpTestController.h
1/*
2 * This file is part of LSST M1M3 support system package.
3 *
4 * Developed for the Telescope & Site Software Systems.
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 BUMPTESTCONTROLLER_H_
25#define BUMPTESTCONTROLLER_H_
26
27#include <cRIO/DataTypes.h>
28
29namespace LSST {
30namespace M1M3 {
31namespace SS {
32
93class BumpTestController {
94public:
95 BumpTestController();
96
106 int setBumpTestActuator(int actuatorId, bool testPrimary, bool testSecondary);
107
112 void runLoop();
113
119 void stopAll(bool forced);
120
126 void stopCylinder(char axis);
127
128private:
129 int _xIndex;
130 int _yIndex;
131 int _zIndex;
132 int _secondaryIndex;
133 bool _testPrimary;
134 bool _testSecondary;
135
136 float _testForce;
137
138 float _testedWarning;
139 float _testedError;
140 float _nonTestedWarning;
141 float _nonTestedError;
142
143 float _testSettleTime;
144 int _testMeasurements;
145 int _testProgress;
146 // if NAN, don't sleep
147 double _sleepUntil;
148
149 typedef enum { FINISHED, FAILED, NO_CHANGE, STATE_CHANGED } runCylinderReturn_t;
150 runCylinderReturn_t _runCylinder(char axis, int index, double averages[], short int *stage);
151
152 void _resetProgress(bool zeroOffsets = true);
153 void _resetAverages();
154
155 double _xAverages[FA_X_COUNT];
156 double _yAverages[FA_Y_COUNT];
157 double _zAverages[FA_Z_COUNT];
158
162 bool _collectAverages();
163
167 int _checkAverages(char axis = ' ', int index = -1, double value = 0);
168};
169
170} // namespace SS
171} // namespace M1M3
172} // namespace LSST
173
174#endif /* BUMPTESTCONTROLLER_H_ */
void stopAll(bool forced)
Stops all running bump tests.
Definition BumpTestController.cpp:164
void runLoop()
Run single loop.
Definition BumpTestController.cpp:100
void stopCylinder(char axis)
Stops bump test on given cylinder.
Definition BumpTestController.cpp:176
int setBumpTestActuator(int actuatorId, bool testPrimary, bool testSecondary)
Set current bump tests parameters.
Definition BumpTestController.cpp:60