Belle II Software  release-06-00-14
RFCommand.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 #include "daq/rfarm/manager/RFCommand.h"
9 
10 using namespace Belle2;
11 
12 const RFCommand RFCommand::CONFIGURE(601, "RF_CONFIGURE");
13 const RFCommand RFCommand::UNCONFIGURE(602, "RF_UNCONFIGURE");
14 const RFCommand RFCommand::START(603, "RF_START");
15 const RFCommand RFCommand::STOP(604, "RF_STOP");
16 const RFCommand RFCommand::RESTART(605, "RF_RESTART");
17 const RFCommand RFCommand::PAUSE(606, "RF_PAUSE");
18 const RFCommand RFCommand::RESUME(607, "RF_RESUME");
19 const RFCommand RFCommand::STATUS(608, "RF_STATUS");
20 
21 const RFCommand& RFCommand::operator=(const std::string& label)
22 {
23  if (label == CONFIGURE.getLabel()) *this = CONFIGURE;
24  else if (label == UNCONFIGURE.getLabel()) *this = UNCONFIGURE;
25  else if (label == START.getLabel()) *this = START;
26  else if (label == STOP.getLabel()) *this = STOP;
27  else if (label == RESTART.getLabel()) *this = RESTART;
28  else if (label == PAUSE.getLabel()) *this = PAUSE;
29  else if (label == RESUME.getLabel()) *this = RESUME;
30  else if (label == STATUS.getLabel()) *this = STATUS;
31  else if (label == NSMCommand::OK.getLabel()) *this = NSMCommand::OK;
32  else if (label == NSMCommand::ERROR.getLabel()) *this = NSMCommand::ERROR;
33  else *this = Enum::UNKNOWN;
34  return *this;
35 }
36 
37 const RFCommand& RFCommand::operator=(const char* label)
38 {
39  if (label != NULL) *this = std::string(label);
40  else *this = Enum::UNKNOWN;
41  return *this;
42 }
43 
Abstract base class for different kinds of events.