phaser-server  0.0.3
Public Member Functions | List of all members
PhaseJob Class Reference

A job for processing RF cavities. More...

#include <phaseJob.h>

Public Member Functions

 PhaseJob (const JSONObject &)
 Construct a RF Cavity phasing job. More...
 
void SetPaused (bool)
 Set the 'paused' state of job execution. More...
 
const std::string & GetCurrentCavity (void) const
 Get the name of the cavity being processed. More...
 
const std::string & StartCavity (void)
 Get the current cavity name and set its start date to now. More...
 
const std::string & GetNextCavity (bool &)
 Advance to the next cavity and return its name. More...
 
double GetMaxPhaseErr (void) const
 Get the job's maximum expected cavity phase error.
 
unsigned GetKickSamples (void) const
 Get the samples per kick associated with this job.
 
double GetMaxDpp (void) const
 Get the maximum momentum error allowed for this job.
 
const std::vector< std::string > & GetJobCavities (void) const
 Get the list of cavities in the job.
 
time_t GetJobDate (void) const
 Get the date when the job was started.
 
time_t GetCavityDate (void) const
 Get the date of the start of the current cavity. More...
 
unsigned GetIteration (void) const
 
bool IsCorrecting (void) const
 Correct the phase errors measured?
 
bool IsContinuous (void) const
 Get the job execution mode.
 
bool IsPaused (void) const
 Is execution of the job paused?
 
int GetDbId (void) const
 Get the database ID associated with the phase job.
 
void SetDbId (int id)
 Set the database ID associated with the phase job.
 
unsigned GetProgress (std::string &act) const
 Get current cavity progress.
 
void SetProgress (unsigned pro, std::string act)
 Set current cavity progress.
 

Detailed Description

A job for processing RF cavities.

A job is received from a client session. It defines the RF cavity phase error measuring operation.

Note
It is the responsibility of the users of an instance to serialize access in the server's multi-threaded environment.

Constructor & Destructor Documentation

◆ PhaseJob()

PhaseJob::PhaseJob ( const JSONObject &  job)

Construct a RF Cavity phasing job.

Exceptions
cpplib::Exceptionif the job is invalid.
Parameters
job- JSON encoded phase job.

Member Function Documentation

◆ GetCavityDate()

time_t PhaseJob::GetCavityDate ( void  ) const
inline

Get the date of the start of the current cavity.

Get which iteration of the job is executing.

◆ GetCurrentCavity()

const std::string & PhaseJob::GetCurrentCavity ( void  ) const

Get the name of the cavity being processed.

Note
An empty string is returned when there is no cavity being processed.
Returns
The name of the cavity being phased.

◆ GetNextCavity()

const std::string & PhaseJob::GetNextCavity ( bool &  reset)

Advance to the next cavity and return its name.

Note
An empty string is returned when there is no next cavity.
Parameters
reset- Set to true if a new iteration of the job is started.
Returns
The name of the next cavity to be phased.

◆ SetPaused()

void PhaseJob::SetPaused ( bool  paused)

Set the 'paused' state of job execution.

Parameters
paused- Desired state.

◆ StartCavity()

const string & PhaseJob::StartCavity ( void  )

Get the current cavity name and set its start date to now.

Returns
The name of the cavity being phased.

The documentation for this class was generated from the following files: