Is called continously to execute actions in the current state.
This is what the state machine is doing in a certain state continously. In an idle state this might just be doing nothing.
In the tracking state of the drive system this might be sending new command values to the drive based on its current position.
79 (rst.rise<rst.set && (now.
JD()>rst.rise && now.
JD()<rst.set)) ||
80 (rst.rise>rst.set && (now.
JD()<rst.set || now.
JD()>rst.rise));
95 const string name =
fAuxPath +
Tools::Form(
"/%04d/%02d/%02d/%08d.FAD_CONTROL_EVENT_DATA.fits", night/10000, (night/100)%100, night%100, night);
100 Error(
string(
"Failed to open "+name+
": ")+strerror(errno));
114 catch (
const runtime_error &e)
119 Error(
"Failed to open "+name+
": "+e.what());
131 catch (
const runtime_error &e) { }
133 Info(
"File "+name+
" open.");
140 vector<float> sorted;
150 if (
fQoS & FAD::EventHeader::kAll)
153 for (
int i=0;
i<1440;
i++)
156 for (
int i=8;
i<1440;
i+=9)
161 sort(sorted.begin(), sorted.end());
163 const double med = sorted[719];
165 vector<float>
dev(1440);
166 for (
int i=0;
i<1440;
i++)
167 dev[
i] = fabs(sorted[
i]-med);
168 sort(
dev.begin(),
dev.end());
170 const double deviation =
dev[uint32_t(0.682689477208650697*1440)];
176 if (sorted[1439-3]>med+deviation*5)
180 const double scale = max(0.25f, sorted[1436]);
185 out << scale <<
'\n';
186 out << setprecision(3);
189 out <<
fEvt <<
'\n' <<
fRun <<
"\nDEMO\x7f";
191 out <<
"DEMO\nDEMO\nDEMO\x7f";
199 vector<uint8_t> val(1440);
200 for (uint64_t
i=0;
i<1440;
i++)
202 float range = nearbyint(126*
fMax[
i]/scale);
207 val[
i] = (uint8_t)range;
210 const char *ptr =
reinterpret_cast<char*
>(val.data());
211 out.write(ptr, val.size()*
sizeof(uint8_t));
217 ofstream(
fOutPath+
"/cam-fadcontrol-eventdata.bin") << out.str();
Mainloop running, state machine in operation.
int GetCurrentState() const
return the current state of the machine
uint64_t JavaDate() const
Adds some functionality to boost::posix_time::ptime for our needs.
uint32_t NightAsInt() const
const int32_t & state() const
bool SetVecAddress(const std::string &name, std::vector< T > &vec)
std::ostream & Out() const
bool GetNextRow(bool check=true)
int Error(const std::string &str)
DimDescribedState fDimFadControl
RstTime GetSolarRst(double jd, const LnLatPosn &obs, double hrz=LN_SOLAR_STANDART_HORIZON)
Error states should be between 0x100 and 0xffff.
Return to feeserver c CVS log Up to[MAIN] dcscvs FeeServer feeserver src Wed FeeServer_v0 v0 dev
int Info(const std::string &str)
bool SetRefAddress(const std::string &name, T &ptr)