FACT++  1.0
int StateMachineSmartFACT::HandleDriveTracking ( const EventImp d)
inlineprivate

Definition at line 1100 of file smartfact.cc.

References Moon::Angle(), Moon::Color(), dev, EventImp::Get(), EventImp::GetJavaDate(), HTML::kWhite, and Moon::visible.

Referenced by StateMachineSmartFACT().

1101  {
1102  if (!CheckDataSize(d, "DriveControl:Tracking", 96))
1103  return GetCurrentState();
1104 
1105 
1106 
1107  const double Ra = d.Get<double>(0*8);
1108  const double Dec = d.Get<double>(1*8);
1109  const double Zd = d.Get<double>(6*8);
1110  const double Az = d.Get<double>(7*8);
1111 
1112  const double dev = d.Get<double>(11*8);
1113 
1114  fDriveControlTrackingDevHist.push_back(dev);
1115  if (fDriveControlTrackingDevHist.size()>300)
1116  fDriveControlTrackingDevHist.pop_front();
1117 
1118  WriteHist(d, "hist-control-deviation", fDriveControlTrackingDevHist, 120);
1119 
1120  ostringstream out;
1121  out << d.GetJavaDate() << '\n';
1122 
1123  out << HTML::kWhite << '\t' << fDriveControlSourceName << '\n';
1124  out << setprecision(5);
1125  out << HTML::kWhite << '\t' << Ra << '\n';
1126  out << HTML::kWhite << '\t' << Dec << '\n';
1127  out << setprecision(3);
1128  out << HTML::kWhite << '\t' << Zd << '\n';
1129  out << HTML::kWhite << '\t' << Az << '\n';
1130  out << HTML::kWhite << '\t' << dev << '\n';
1131 
1132  fDriveControlMoonDist = -1;
1133 
1134  if (fMoon.visible)
1135  {
1136  const double angle = fMoon.Angle(Ra, Dec);
1137  out << Moon::Color(angle) << '\t' << setprecision(3) << angle << '\n';
1138 
1139  fDriveControlMoonDist = angle;
1140  }
1141  else
1142  out << HTML::kWhite << "\t&mdash; \n";
1143 
1144  ofstream(fPath+"/tracking.data") << out.str();
1145 
1146  return GetCurrentState();
1147  }
deque< float > fDriveControlTrackingDevHist
Definition: smartfact.cc:567
int GetCurrentState() const
return the current state of the machine
bool CheckDataSize(const EventImp &d, const char *name, size_t size, bool min=false)
Definition: smartfact.cc:669
void WriteHist(const EventImp &d, const string &fname, const T &t, double scale, double offset=0)
Definition: smartfact.cc:752
string fDriveControlSourceName
Definition: smartfact.cc:564
static const string kWhite
Definition: smartfact.cc:74
uint64_t GetJavaDate() const
Definition: EventImp.cc:303
static string Color(double angle)
Definition: smartfact.cc:425
Return to feeserver c CVS log Up to[MAIN] dcscvs FeeServer feeserver src Wed FeeServer_v0 v0 dev
Definition: feeserver.c:5
double Angle(double r, double d) const
Definition: moon.cc:95
T Get(size_t offset=0) const
Definition: EventImp.h:66
bool visible
Definition: moon.cc:26

+ Here is the call graph for this function:

+ Here is the caller graph for this function: