phaser-server  0.0.7
phaseJob.h
Go to the documentation of this file.
1 #ifndef PHASE_PLAN_H
2 #define PHASE_PLAN_H
8 #include <JSON.h>
9 
16 class PhaseJob
17 { public:
18  PhaseJob(const JSONObject &);
19  void SetPaused(bool);
20  const std::string & GetCurrentCavity(void) const;
21  const std::string & StartCavity(void);
22  const std::string & GetNextCavity(bool &);
24  double GetMaxPhaseErr(void) const { return m_maxPhaseError; }
26  unsigned GetKickSamples(void) const { return m_kickSamples; }
28  double GetMaxDpp(void) const { return m_maxDpp; }
30  const std::vector<std::string> & GetJobCavities(void) const
31  { return m_cavities; }
33  time_t GetJobDate(void) const { return m_start; }
35  time_t GetCavityDate(void) const { return m_cavBegin; }
37  unsigned GetIteration(void) const { return m_iteration; }
39  bool IsCorrecting(void) const { return m_correctPhase; }
41  bool IsContinuous(void) const { return m_continuous; }
43  bool IsPaused(void) const { return m_paused; }
45  int GetDbId(void) const { return m_id; }
47  void SetDbId(int id) { m_id = id; }
49  unsigned GetProgress(std::string &act) const
50  { act = m_activity;
51  return m_progress;
52  }
54  void SetProgress(unsigned pro, std::string act)
55  { m_progress = pro;
56  m_activity = act;
57  }
58 
59  private:
60  std::vector<std::string> m_cavities;
61  unsigned m_index;
62  unsigned m_progress;
63  std::string m_activity;
64  time_t m_start;
65  time_t m_cavBegin;
66  bool m_correctPhase;
67  bool m_continuous;
68  double m_maxPhaseError;
69  double m_maxDpp;
70  unsigned m_kickSamples;
71  const std::string m_empty;
72  bool m_paused;
73  unsigned m_iteration;
74  int m_id;
75 };
76 
77 #endif
A job for processing RF cavities.
Definition: phaseJob.h:17
double GetMaxPhaseErr(void) const
Get the job's maximum expected cavity phase error.
Definition: phaseJob.h:24
const std::string & StartCavity(void)
Get the current cavity name and set its start date to now.
Definition: phaseJob.cpp:83
double GetMaxDpp(void) const
Get the maximum momentum error allowed for this job.
Definition: phaseJob.h:28
unsigned GetKickSamples(void) const
Get the samples per kick associated with this job.
Definition: phaseJob.h:26
const std::string & GetCurrentCavity(void) const
Get the name of the cavity being processed.
Definition: phaseJob.cpp:74
void SetProgress(unsigned pro, std::string act)
Set current cavity progress.
Definition: phaseJob.h:54
void SetDbId(int id)
Set the database ID associated with the phase job.
Definition: phaseJob.h:47
bool IsCorrecting(void) const
Correct the phase errors measured?
Definition: phaseJob.h:39
time_t GetCavityDate(void) const
Get the date of the start of the current cavity.
Definition: phaseJob.h:35
const std::string & GetNextCavity(bool &)
Advance to the next cavity and return its name.
Definition: phaseJob.cpp:96
bool IsPaused(void) const
Is execution of the job paused?
Definition: phaseJob.h:43
void SetPaused(bool)
Set the 'paused' state of job execution.
Definition: phaseJob.cpp:63
PhaseJob(const JSONObject &)
Construct a RF Cavity phasing job.
Definition: phaseJob.cpp:15
int GetDbId(void) const
Get the database ID associated with the phase job.
Definition: phaseJob.h:45
const std::vector< std::string > & GetJobCavities(void) const
Get the list of cavities in the job.
Definition: phaseJob.h:30
unsigned GetProgress(std::string &act) const
Get current cavity progress.
Definition: phaseJob.h:49
time_t GetJobDate(void) const
Get the date when the job was started.
Definition: phaseJob.h:33
bool IsContinuous(void) const
Get the job execution mode.
Definition: phaseJob.h:41