phaser-server  0.0.2
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
ResultsDb Class Reference

Log phasing job results to a database. More...

#include <resultsDb.h>

Public Types

enum class  Outcome_t { Corrected , Measured , Bypass , Skip }
 Apply phase correction outcomes.
 

Public Member Functions

 ResultsDb (PhaseJob &)
 Construct an instance. More...
 
 ~ResultsDb (void)
 Destroy an instance by setting the Job-end-date.
 
int GetJobId (void)
 Get the job's database identifier.
 
int LogResult (time_t, const std::string &, double, Outcome_t, double)
 Log a cavity phasing completion result. More...
 

Static Public Member Functions

static void Apply (const std::vector< unsigned > &)
 Apply phase corrections. More...
 

Detailed Description

Log phasing job results to a database.

The phasing job definition is logged as well as all progress of phasing cavities in the job.

Constructor & Destructor Documentation

◆ ResultsDb()

ResultsDb::ResultsDb ( PhaseJob job)

Construct an instance.

Information about the passed phasing job is inserted into the database and the created unique 'job_id' is saved so cavity completion updates can be related to this job.

Parameters
job- The RF phasing job associated with this instance.

Member Function Documentation

◆ Apply()

void ResultsDb::Apply ( const std::vector< unsigned > &  ids)
static

Apply phase corrections.

Update the control system as well as the Cavity Phase Measurement database.

Parameters
ids- The database identifiers of RESULT table rows to update

◆ LogResult()

int ResultsDb::LogResult ( time_t  begin,
const std::string &  cavity,
double  phaseErr,
Outcome_t  outcome,
double  phase 
)

Log a cavity phasing completion result.

Parameters
begin- Date when phasing of the cavity began.
cavity- The phased cavity.
phaseErr- The measured phase error.
outcome- The outcome (enumeration) of cavity phasing.
phase- Cavity's current phase setting.

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