FACT++  1.0
template<class T , class S >
int StateMachineDrive< T, S >::SendCoordinates ( const EventImp evt,
const Coordinates  type 
)
inlineprivate

Definition at line 900 of file cosyctrl.cc.

References EventImp::GetSize(), EventImp::Ptr(), and Dim::SendCommand().

Referenced by StateMachineDrive< T, S >::StateMachineDrive().

901  {
902  if (!CheckEventSize(evt.GetSize(), "SendCoordinates", 16))
903  return T::kSM_FatalError;
904 
905  const double *dat = evt.Ptr<double>();
906 
907  string command;
908 
909  switch (type)
910  {
911  case kPoint: command += "ZDAZ "; break;
912  case kTrackSlow: command += "RADEC "; break;
913  case kTrackFast: command += "GRB "; break;
914  }
915 
916  if (type!=kPoint)
917  {
918  const array<double, 6> dim = {{ dat[0], dat[1], dat[0], dat[1], 0, 0 }};
919  fDrive.UpdateSource(dim);
920  }
921  else
922  fDrive.UpdateSource("", false);
923 
924 
925  command += AngleToStr(dat[0]) + ' ' + AngleToStr(dat[1]);
926  return SendCommand(command);
927  }
int type
string AngleToStr(double angle)
Definition: cosyctrl.cc:822
int SendCommand(const string &str)
Definition: cosyctrl.cc:843
bool CheckEventSize(size_t has, const char *name, size_t size)
Definition: cosyctrl.cc:804
const T * Ptr(size_t offset=0) const
Definition: EventImp.h:74
virtual size_t GetSize() const
Definition: EventImp.h:55

+ Here is the call graph for this function:

+ Here is the caller graph for this function: