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.
2616 if (now-
fLastUpdate<boost::posix_time::seconds(1))
2622 bool reqscript =
false;
2627 const string query =
Tools::Form(
"SELECT COUNT(*) FROM calendar.Data WHERE NOT u LIKE 'moon' AND y=%d AND m=%d AND d=%d",
2632 const uint32_t cnt = res[0][0];
2636 catch (
const exception &e)
2638 Out() << e.what() << endl;
2644 statvfs(
"/daq", &vfs);
2646 const uint64_t freedaq = vfs.f_bsize*vfs.f_bavail;
2650 const bool data_taking =
2654 const bool data_run =
2658 const bool bias_on =
2663 const bool calibrated =
2668 bool newerr =
false;
2671 "<b><#darkred>DIM network not available</#></b>");
2673 "<b>no dimctrl server available</b>");
2675 "<b>datalogger not ready</b>");
2678 "<b>No script running during datataking time.</b>");
2684 "Drive in ERROR state during data-run");
2686 "Moon within the field-of-view of the cones");
2688 "Moon within the field-of-view of the camera");
2691 "BIAS not operating during data-run");
2693 "BIAS channels in OverCurrent");
2695 "BIAS voltage not at reference");
2698 "Feedback in standby due to high currents");
2702 "Median current (excl. crazy) exceeds 115µA/pix");
2704 "Maximum current (excl. crazy) exceeds 160µA/pix");
2707 "Average camera humidity exceed 60%");
2710 "Camera humidity inside camera exceeds 50% (PFmini)");
2712 "Container temperature outside [26.5;29]°C");
2715 "Outside humidity exceeds 98% while lid is open");
2717 "Wind gusts exceed 50km/h during tracking");
2720 "Sensor temperature exceeds outside temperature by more than 15°C");
2723 "Trigger rate below 1Hz while trigger switched on");
2726 "FTM - clock conditioner not locked!");
2729 "Warning NTP time difference of drive PC exceeds 1s");
2731 "Warning timecheck not running");
2736 "Bias voltage switched on, but bias crate not calibrated");
2739 "Last run finshed, but contained zero events.");
2742 "Less than 50GB disk space left on newdaq.");
2744 newerr |=
SetError(freedaq<uint64_t(800000000000),
2745 "Less than 800GB disk space left on daq.");
2748 "Cooling unit reports failure!");
2751 newerr |=
SetError(it->time.IsValid(), it->msg);
2789 ofstream(
fPath+
"/errorhist.data") << out.str();
2794 out << setprecision(3);
2795 out << HTML::kWhite <<
'\t';
2797 out << *it <<
"<br/>";
2801 ofstream(
fPath+
"/error.data") << out.str();
2807 out << setprecision(3);
2849 out <<
"Idle" << conf;
2854 out <<
"Configuring" << conf;
2857 out <<
"Configured" << conf;
2869 out <<
"Calibrating threshold";
2872 out <<
"Rate scan in progress";
2875 out <<
"Lid moving";
2916 const bool has_evt = !evt.str().empty();
2917 const bool has_tim = !tim.str().empty();
2919 if (has_evt || has_tim)
2922 if (has_evt && has_tim)
2925 if (has_evt || has_tim)
2959 out << setprecision(2);
2963 out <<
" ± " << dev <<
'"';
2970 out << setprecision(3);
2973 out << HTML::kWhite <<
'\t';
3009 out << HTML::kWhite <<
'\n';
3026 if (wind>35 || hum>95)
3028 if (wind>45 || hum>98)
3033 out << setprecision(2);
3035 out << setprecision(3);
3038 out << HTML::kWhite <<
"\n";
3059 out << HTML::kWhite <<
'\n';
3121 out << HTML::kWhite <<
'\n';
3123 ofstream(
fPath+
"/fact.data") << out.str();
3131 out << HTML::kWhite <<
"\tOffline\n\n\n\n\n\n\n\n\n\n\n\n\n";
3177 if (freedaq>uint64_t(999999999999))
3179 if (freedaq>uint64_t(149999999999))
3181 if (freedaq==UINT64_MAX)
3186 out <<
HTML::kGreen <<
'\t' << dt.str().substr(0, dt.str().length()-7) <<
'\n';
3189 ofstream(
fPath+
"/status.data") << out.str();
DimDescribedState fDimGpsControl
Time fMcpConfigurationRunStart
DimDescribedState fDimPwrControl
DimDescribedState fDimPfMiniControl
int32_t fFtmControlTriggerRateTooLow
deque< float > fDriveControlTrackingDevHist
DimDescribedState fDimMagicWeather
static const string kYellow
uint64_t JavaDate() const
deque< float > fFscControlTemperatureHist
DimDescribedState fDimDriveControl
Adds some functionality to boost::posix_time::ptime for our needs.
deque< float > fPfMiniHumidityHist
uint32_t NightAsInt() const
DimDescribedState fDimLidControl
float fFscControlHumidityAvg
const int32_t & state() const
DimDescribedState fDimDataLogger
DimDescribedState fDimMagicLidar
DimDescribedState fDimChat
State description() const
FTM and FTUs are being reconfigured.
std::ostream & Out() const
DimDescribedState fDimAgilentControl80
EventHist fControlAlarmHist
DimDescribedState fDimFeedback
std::string SecondsTo(const Time &=Time()) const
std::string version() const
bool fLastRunFinishedWithZeroEvents
DimDescribedState fDimMcp
DimDescribedState fDimSkypeClient
deque< float > fFtmControlTriggerRateHist
DimDescribedState fDimAgilentControl24
DimDescribedState fDimTngWeather
DimDescribedState fDimAgilentControl50
float fBiasControlPowerTot
string Header(const Time &d)
string fDriveControlSourceName
string fDriveControlPointingAz
static const string kBlue
DimDescribedState fDimTimeCheck
string GetStateHtml(const DimState &state, int green) const
static const string kWhite
string fMcpConfigurationName
bool SetError(bool b, const string &err)
deque< float > fMagicWeatherHist[kWeatherEnd]
static const string kGreen
int64_t fMcpConfigurationMaxEvents
DimDescribedState fDimRateScan
float fDriveControlMoonDist
vector< uint32_t > fFadControlDrsRuns
void SetAudio(const string &name)
DimDescribedState fDimBiasControl
float fDriveControlPointingZd
DimDescribedState fDimTemperature
DimDescribedState fDimSqmControl
Return to feeserver c CVS log Up to[MAIN] dcscvs FeeServer feeserver src Wed FeeServer_v0 v0 dev
float fFtmPatchThresholdMed
int64_t fMcpConfigurationMaxTime
DimDescribedState fDimFtmControl
std::string MinutesTo(const Time &=Time()) const
DimDescribedState fDimFadControl
deque< float > fTemperatureControlHist
DimDescribedState fDimFscControl
int64_t fFadControlNumEvents
float fBiasControlCurrentMed
float fBiasControlVoltageMed
DimDescribedState fDimRateControl
float fBiasControlCurrentMax
int32_t fMcpConfigurationState