7 #include "../../../tests/catch2/catch.hpp"
9 #include "../ocamUtils.hpp"
16 SCENARIO(
"Parsing the temp response",
"[ocamUtils]" )
18 GIVEN(
"A valid response to temp from the OCAM")
22 WHEN(
"Valid temp response")
24 std::string tstr =
"Temperatures : CCD[26.3] CPU[41] POWER[34] BIAS[47] WATER[24.2] LEFT[33] RIGHT[38] SET[200]\nCooling Power [102]mW.\n\n";
44 GIVEN(
"An invalid response to temp from the OCAM, too short")
48 WHEN(
"Temp response is too short")
50 std::string tstr =
"Temperatures : CCD[26.3] CPU[41] POWER[34] BIAS[47] WATER[24.2] LEFT[33] RIGHT[38] SET[200]\nCooling Power";
62 SCENARIO(
"Parsing the gain response",
"[ocamUtils]" )
64 GIVEN(
"A valid response to gain from the OCAM")
68 WHEN(
"Valid gain response, gain=2")
70 std::string tstr =
"Gain set to 2 \n\n";
83 GIVEN(
"A valid response to gain from the OCAM")
87 WHEN(
"Valid gain response, gain=512")
89 std::string tstr =
"Gain set to 512 \n\n";
103 GIVEN(
"An invalid response to gain from the OCAM")
107 WHEN(
"Invalid gain response, too short, no trailing space")
109 std::string tstr =
"Gain set to 512\n\n";
119 WHEN(
"Invalid gain response, too short, no gain")
121 std::string tstr =
"Gain set to \n\n";
131 WHEN(
"Invalid gain response, too long")
133 std::string tstr =
"Gain set to 512 rubbish added\n\n";
143 WHEN(
"Invalid gain response, low gain")
145 std::string tstr =
"Gain set to 0 \n\n";
155 WHEN(
"Invalid gain response, high gain")
157 std::string tstr =
"Gain set to 601 \n\n";
167 WHEN(
"Invalid gain response, bad gain")
169 std::string tstr =
"Gain set to x \n\n";
int parseTemps(ocamTemps &temps, const std::string &tstr)
Parse the OCAM temp query and fill the ocamTemps structure.
int parseEMGain(unsigned &emGain, const std::string &fstr)
Parse the EM gain response.
SCENARIO("Parsing the gain response", "[ocamUtils]")
Structure to hold the OCAM camera temperature readings returned by the device.
float WATER
Cooling water temperature.
float COOLING_POWER
the cooling power in 100 mw.
float BIAS
Bias temperature.
float SET
The CCD set temeperature.
float CCD
The detector temperature.
float POWER
Power supply temperature.
float CPU
The CPU temperature.
float LEFT
The left amplifier temperature.
float RIGHT
The right amplifier temperature.