FACT++  1.0
StateMachineSmartFACT::StateMachineSmartFACT ( ostream &  out = cout)
inline

Definition at line 3202 of file smartfact.cc.

References DimControl::AddCallback(), HandleAgilentData(), HandleBiasCurrent(), HandleBiasVoltage(), HandleChatMsg(), HandleControlStateChange(), HandleDimControlMessage(), HandleDoTest(), HandleDriveControlStateChange(), HandleDrivePointing(), HandleDriveSource(), HandleDriveTracking(), HandleFadConnections(), HandleFadDrsRuns(), HandleFadEventData(), HandleFadEvents(), HandleFadStartRun(), HandleFeedbackCalibratedCurrents(), HandleFscBiasTemp(), HandleFscControlStateChange(), HandleFscHumidity(), HandleFscTemperature(), HandleFtmFtuList(), HandleFtmStaticData(), HandleFtmTriggerRates(), HandleGpsNema(), HandleMagicWeatherData(), HandleMcpConfiguration(), HandlePfMiniData(), HandleRateControlThreshold(), HandleRateScanData(), HandleSqmData(), HandleStats(), HandleTemperatureData(), HandleTngWeatherDust(), Print(), DimState::SetCallback(), DimState::Subscribe(), and DimDescribedState::Subscribe().

3202  : StateMachineDim(out, fIsServer?"SMART_FACT":""),
3203  fLastAstroCalc(boost::date_time::neg_infin),
3204  fPath("www/smartfact/data"),
3217  fFadControlDrsRuns(3),
3219  fRateScanDataId(0),
3220  fRateScanBoard(0),
3221  fFreeSpace(UINT64_MAX),
3222  // ---
3223  fDimMcp ("MCP"),
3224  fDimDataLogger ("DATA_LOGGER"),
3225  fDimDriveControl ("DRIVE_CONTROL"),
3226  fDimTimeCheck ("TIME_CHECK"),
3227  fDimMagicWeather ("MAGIC_WEATHER"),
3228  fDimMagicLidar ("MAGIC_LIDAR"),
3229  fDimTngWeather ("TNG_WEATHER"),
3230  fDimTemperature ("TEMPERATURE"),
3231  fDimFeedback ("FEEDBACK"),
3232  fDimBiasControl ("BIAS_CONTROL"),
3233  fDimFtmControl ("FTM_CONTROL"),
3234  fDimFadControl ("FAD_CONTROL"),
3235  fDimFscControl ("FSC_CONTROL"),
3236  fDimPfMiniControl ("PFMINI_CONTROL"),
3237  fDimGpsControl ("GPS_CONTROL"),
3238  fDimSqmControl ("SQM_CONTROL"),
3239  fDimAgilentControl24("AGILENT_CONTROL_24V"),
3240  fDimAgilentControl50("AGILENT_CONTROL_50V"),
3241  fDimAgilentControl80("AGILENT_CONTROL_80V"),
3242  fDimPwrControl ("PWR_CONTROL"),
3243  fDimLidControl ("LID_CONTROL"),
3244  fDimRateControl ("RATE_CONTROL"),
3245  fDimRateScan ("RATE_SCAN"),
3246  fDimChat ("CHAT"),
3247  fDimSkypeClient ("SKYPE_CLIENT")
3248  {
3249  fDimDNS.Subscribe(*this);
3250  fDimControl.Subscribe(*this);
3251  fDimMcp.Subscribe(*this);
3252  fDimDataLogger.Subscribe(*this);
3253  fDimDriveControl.Subscribe(*this);
3254  fDimTimeCheck.Subscribe(*this);
3255  fDimMagicWeather.Subscribe(*this);
3256  fDimMagicLidar.Subscribe(*this);
3257  fDimTngWeather.Subscribe(*this);
3258  fDimTemperature.Subscribe(*this);
3259  fDimFeedback.Subscribe(*this);
3260  fDimBiasControl.Subscribe(*this);
3261  fDimFtmControl.Subscribe(*this);
3262  fDimFadControl.Subscribe(*this);
3263  fDimFscControl.Subscribe(*this);
3265  fDimGpsControl.Subscribe(*this);
3266  fDimSqmControl.Subscribe(*this);
3270  fDimPwrControl.Subscribe(*this);
3271  fDimLidControl.Subscribe(*this);
3272  fDimRateControl.Subscribe(*this);
3273  fDimRateScan.Subscribe(*this);
3274  fDimChat.Subscribe(*this);
3275  fDimSkypeClient.Subscribe(*this);
3276 
3278  //fDimFtmControl.SetCallback(bind(&StateMachineSmartFACT::HandleFtmControlStateChange, this));
3281  fDimControl.AddCallback("dotest.dim", bind(&StateMachineSmartFACT::HandleDoTest, this, placeholders::_1));
3282 
3283  Subscribe("DIM_CONTROL/MESSAGE")
3284  (bind(&StateMachineSmartFACT::HandleDimControlMessage, this, placeholders::_1));
3285 
3286  Subscribe("MCP/CONFIGURATION")
3287  (bind(&StateMachineSmartFACT::HandleMcpConfiguration, this, placeholders::_1));
3288 
3289  Subscribe("DRIVE_CONTROL/POINTING_POSITION")
3290  (bind(&StateMachineSmartFACT::HandleDrivePointing, this, placeholders::_1));
3291  Subscribe("DRIVE_CONTROL/TRACKING_POSITION")
3292  (bind(&StateMachineSmartFACT::HandleDriveTracking, this, placeholders::_1));
3293  Subscribe("DRIVE_CONTROL/SOURCE_POSITION")
3294  (bind(&StateMachineSmartFACT::HandleDriveSource, this, placeholders::_1));
3295 
3296  Subscribe("FSC_CONTROL/TEMPERATURE")
3297  (bind(&StateMachineSmartFACT::HandleFscTemperature, this, placeholders::_1));
3298  Subscribe("FSC_CONTROL/HUMIDITY")
3299  (bind(&StateMachineSmartFACT::HandleFscHumidity, this, placeholders::_1));
3300  Subscribe("FSC_CONTROL/BIAS_TEMP")
3301  (bind(&StateMachineSmartFACT::HandleFscBiasTemp, this, placeholders::_1));
3302 
3303  Subscribe("PFMINI_CONTROL/DATA")
3304  (bind(&StateMachineSmartFACT::HandlePfMiniData, this, placeholders::_1));
3305 
3306  Subscribe("GPS_CONTROL/NEMA")
3307  (bind(&StateMachineSmartFACT::HandleGpsNema, this, placeholders::_1));
3308 
3309  Subscribe("SQM_CONTROL/DATA")
3310  (bind(&StateMachineSmartFACT::HandleSqmData, this, placeholders::_1));
3311 
3312  Subscribe("TEMPERATURE/DATA")
3313  (bind(&StateMachineSmartFACT::HandleTemperatureData, this, placeholders::_1));
3314 
3315  Subscribe("AGILENT_CONTROL_24V/DATA")
3316  (bind(&StateMachineSmartFACT::HandleAgilentData, this, placeholders::_1, "24"));
3317  Subscribe("AGILENT_CONTROL_50V/DATA")
3318  (bind(&StateMachineSmartFACT::HandleAgilentData, this, placeholders::_1, "50"));
3319  Subscribe("AGILENT_CONTROL_80V/DATA")
3320  (bind(&StateMachineSmartFACT::HandleAgilentData, this, placeholders::_1, "80"));
3321 
3322  Subscribe("MAGIC_WEATHER/DATA")
3323  (bind(&StateMachineSmartFACT::HandleMagicWeatherData, this, placeholders::_1));
3324  Subscribe("TNG_WEATHER/DUST")
3325  (bind(&StateMachineSmartFACT::HandleTngWeatherDust, this, placeholders::_1));
3326 
3327  Subscribe("FEEDBACK/CALIBRATED_CURRENTS")
3328  (bind(&StateMachineSmartFACT::HandleFeedbackCalibratedCurrents, this, placeholders::_1));
3329 
3330  Subscribe("BIAS_CONTROL/VOLTAGE")
3331  (bind(&StateMachineSmartFACT::HandleBiasVoltage, this, placeholders::_1));
3332  Subscribe("BIAS_CONTROL/CURRENT")
3333  (bind(&StateMachineSmartFACT::HandleBiasCurrent, this, placeholders::_1));
3334 
3335  Subscribe("FAD_CONTROL/CONNECTIONS")
3336  (bind(&StateMachineSmartFACT::HandleFadConnections, this, placeholders::_1));
3337  Subscribe("FAD_CONTROL/EVENTS")
3338  (bind(&StateMachineSmartFACT::HandleFadEvents, this, placeholders::_1));
3339  Subscribe("FAD_CONTROL/START_RUN")
3340  (bind(&StateMachineSmartFACT::HandleFadStartRun, this, placeholders::_1));
3341  Subscribe("FAD_CONTROL/DRS_RUNS")
3342  (bind(&StateMachineSmartFACT::HandleFadDrsRuns, this, placeholders::_1));
3343  Subscribe("FAD_CONTROL/EVENT_DATA")
3344  (bind(&StateMachineSmartFACT::HandleFadEventData, this, placeholders::_1));
3345  Subscribe("FAD_CONTROL/STATS")
3346  (bind(&StateMachineSmartFACT::HandleStats, this, placeholders::_1));
3347 
3348  Subscribe("DATA_LOGGER/STATS")
3349  (bind(&StateMachineSmartFACT::HandleStats, this, placeholders::_1));
3350 
3351  Subscribe("FTM_CONTROL/TRIGGER_RATES")
3352  (bind(&StateMachineSmartFACT::HandleFtmTriggerRates, this, placeholders::_1));
3353  Subscribe("FTM_CONTROL/STATIC_DATA")
3354  (bind(&StateMachineSmartFACT::HandleFtmStaticData, this, placeholders::_1));
3355  Subscribe("FTM_CONTROL/FTU_LIST")
3356  (bind(&StateMachineSmartFACT::HandleFtmFtuList, this, placeholders::_1));
3357 
3358  Subscribe("RATE_CONTROL/THRESHOLD")
3359  (bind(&StateMachineSmartFACT::HandleRateControlThreshold,this, placeholders::_1));
3360 
3361  Subscribe("RATE_SCAN/DATA")
3362  (bind(&StateMachineSmartFACT::HandleRateScanData, this, placeholders::_1));
3363 
3364  Subscribe("CHAT/MESSAGE")
3365  (bind(&StateMachineSmartFACT::HandleChatMsg, this, placeholders::_1));
3366 
3367 
3368  // =================================================================
3369 
3370  // State names
3371  AddStateName(kStateDimNetworkNA, "DimNetworkNotAvailable",
3372  "The Dim DNS is not reachable.");
3373 
3374  AddStateName(kStateRunning, "Running", "");
3375 
3376  // =================================================================
3377 
3378  AddEvent("PRINT")
3379  (bind(&StateMachineSmartFACT::Print, this))
3380  ("Print a list of the states of all connected servers.");
3381 
3382  }
int HandleSqmData(const EventImp &d)
Definition: smartfact.cc:1992
DimDescribedState fDimGpsControl
Definition: smartfact.cc:639
DimDescribedState fDimPwrControl
Definition: smartfact.cc:644
EventImp & AddEvent(const std::string &name, const std::string &states, const std::string &fmt)
DimDescribedState fDimPfMiniControl
Definition: smartfact.cc:638
int HandlePfMiniData(const EventImp &d)
Definition: smartfact.cc:1926
DimDescribedState fDimMagicWeather
Definition: smartfact.cc:629
virtual void Subscribe(StateMachineImp &imp)
Definition: DimState.h:134
int HandleStats(const EventImp &d)
Definition: smartfact.cc:1785
int HandleFadConnections(const EventImp &d)
Definition: smartfact.cc:1475
DimDescribedState fDimDriveControl
Definition: smartfact.cc:627
int HandleDrivePointing(const EventImp &d)
Definition: smartfact.cc:1077
int HandleFscHumidity(const EventImp &d)
Definition: smartfact.cc:1904
DimDescribedState fDimLidControl
Definition: smartfact.cc:645
StateMachineDim(std::ostream &out=std::cout, const std::string &name="DEFAULT")
int HandleGpsNema(const EventImp &d)
Definition: smartfact.cc:1960
int HandleFtmStaticData(const EventImp &d)
Definition: smartfact.cc:1609
int HandleRateControlThreshold(const EventImp &d)
Definition: smartfact.cc:2126
DimDescribedState fDimDataLogger
Definition: smartfact.cc:626
int HandleDriveControlStateChange(const EventImp &d)
Definition: smartfact.cc:1060
DimDescribedState fDimMagicLidar
Definition: smartfact.cc:630
DimDescribedState fDimChat
Definition: smartfact.cc:648
int Print() const
Definition: smartfact.cc:2198
DimDescribedState fDimAgilentControl80
Definition: smartfact.cc:643
DimDescribedState fDimFeedback
Definition: smartfact.cc:633
bool fLastRunFinishedWithZeroEvents
Definition: smartfact.cc:537
DimDescribedState fDimMcp
Definition: smartfact.cc:625
DimDescribedState fDimSkypeClient
Definition: smartfact.cc:649
static bool fIsServer
Definition: smartfact.cc:442
int HandleDoTest(const EventImp &d)
Definition: smartfact.cc:2166
DimDescribedState fDimAgilentControl24
Definition: smartfact.cc:641
int HandleRateScanData(const EventImp &d)
Definition: smartfact.cc:2075
DimDescribedState fDimTngWeather
Definition: smartfact.cc:631
int HandleDriveTracking(const EventImp &d)
Definition: smartfact.cc:1100
int HandleMagicWeatherData(const EventImp &d)
Definition: smartfact.cc:990
int HandleDimControlMessage(const EventImp &d)
Definition: smartfact.cc:815
DimDescribedState fDimAgilentControl50
Definition: smartfact.cc:642
int HandleFadEvents(const EventImp &d)
Definition: smartfact.cc:1432
uint64_t fRateScanDataId
Definition: smartfact.cc:585
int HandleBiasCurrent(const EventImp &d)
Definition: smartfact.cc:1336
void AddCallback(const std::string &script, const callback &cb)
Definition: DimState.h:303
int HandleTngWeatherDust(const EventImp &d)
Definition: smartfact.cc:1035
DimDescribedState fDimTimeCheck
Definition: smartfact.cc:628
int HandleFadEventData(const EventImp &d)
Definition: smartfact.cc:1734
int HandleFeedbackCalibratedCurrents(const EventImp &d)
Definition: smartfact.cc:1181
int HandleChatMsg(const EventImp &d)
Definition: smartfact.cc:2142
int HandleFtmTriggerRates(const EventImp &d)
Definition: smartfact.cc:1542
int HandleFtmFtuList(const EventImp &d)
Definition: smartfact.cc:1697
int32_t fControlScriptDepth
Definition: smartfact.cc:529
int64_t fMcpConfigurationMaxEvents
Definition: smartfact.cc:533
DimDescribedState fDimRateScan
Definition: smartfact.cc:647
int HandleDriveSource(const EventImp &d)
Definition: smartfact.cc:1149
int HandleFscTemperature(const EventImp &d)
Definition: smartfact.cc:1799
vector< uint32_t > fFadControlDrsRuns
Definition: smartfact.cc:572
DimDescribedState fDimBiasControl
Definition: smartfact.cc:634
virtual void Subscribe(StateMachineImp &imp)
Definition: DimState.h:68
EventImp & Subscribe(const std::string &name)
int HandleFadStartRun(const EventImp &d)
Definition: smartfact.cc:1445
DimDescribedState fDimTemperature
Definition: smartfact.cc:632
DimDescribedState fDimSqmControl
Definition: smartfact.cc:640
int64_t fMcpConfigurationMaxTime
Definition: smartfact.cc:532
int HandleMcpConfiguration(const EventImp &d)
Definition: smartfact.cc:914
int HandleControlStateChange(const EventImp &d)
Definition: smartfact.cc:835
DimDescribedState fDimFtmControl
Definition: smartfact.cc:635
int HandleFscControlStateChange(const EventImp &d)
Definition: smartfact.cc:891
DimDescribedState fDimFadControl
Definition: smartfact.cc:636
DimDescribedState fDimFscControl
Definition: smartfact.cc:637
int64_t fFadControlNumEvents
Definition: smartfact.cc:569
DimDescribedState fDimRateControl
Definition: smartfact.cc:646
int HandleBiasVoltage(const EventImp &d)
Definition: smartfact.cc:1394
bool AddStateName(const int state, const std::string &name, const std::string &doc="")
DimControl fDimControl
Definition: smartfact.cc:624
Do not initialize the time.
Definition: Time.h:51
void SetCallback(const callback &cb)
Definition: DimState.h:74
int HandleAgilentData(const EventImp &d, const string &ext)
Definition: smartfact.cc:2053
int HandleTemperatureData(const EventImp &d)
Definition: smartfact.cc:2025
int HandleFscBiasTemp(const EventImp &d)
Definition: smartfact.cc:1883
int HandleFadDrsRuns(const EventImp &d)
Definition: smartfact.cc:1458
int32_t fMcpConfigurationState
Definition: smartfact.cc:531

+ Here is the call graph for this function: