ATLAS Offline Software
Defs.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 #include <MuonCondData/Defs.h>
5 
6 namespace MuonCond {
7 
8 DcsFsmState getFsmStateEnum(const std::string& fsmState){
9  if(fsmState=="UNKNOWN" ) return DcsFsmState::UNKNOWN;
10  if(fsmState=="ON" ) return DcsFsmState::ON;
11  if(fsmState=="OFF" ) return DcsFsmState::OFF;
12  if(fsmState=="STANDBY" ) return DcsFsmState::STANDBY;
13  if(fsmState=="DEAD" ) return DcsFsmState::DEAD;
14  if(fsmState=="UNPLUGGED") return DcsFsmState::UNPLUGGED;
15  if(fsmState=="RAMP_UP" ) return DcsFsmState::RAMP_UP;
16  if(fsmState=="RAMP_DOWN") return DcsFsmState::RAMP_DOWN;
17  if(fsmState=="TRIP" ) return DcsFsmState::TRIP;
18  if(fsmState=="RECOVERY" ) return DcsFsmState::RECOVERY;
19  if(fsmState=="LOCKED" ) return DcsFsmState::LOCKED;
20  return DcsFsmState::NONE;
21 }
22 std::string getFsmStateStrg(DcsFsmState fsmState) {
23  switch (fsmState) {
25  return "UNKNOWN";
26  case DcsFsmState::ON:
27  return "ON";
28  case DcsFsmState::OFF:
29  return "OFF";
31  return "STANDBY";
32  case DcsFsmState::DEAD:
33  return "DEAD";
35  return "UNPLUGGED";
37  return "RAMP_UP";
39  return "RAMP_DOWN";
40  case DcsFsmState::TRIP:
41  return "TRIP";
43  return "RECOVERY" ;
45  return "LOCKED";
46  case DcsFsmState::NONE:
47  return "NONE";
48  }
49  return "NONE";
50 }
51 
52 std::ostream& operator<<(std::ostream& ostr, const MuonCond::DcsConstants& dcs) {
53  ostr<<"DCS (STATE/standby/ready): "<<MuonCond::getFsmStateStrg(dcs.fsmState);
54  ostr<<"/"<<dcs.standbyVolt;
55  ostr<<"/"<<dcs.readyVolt;
56  return ostr;
57 }
58 }
MuonCond::DcsFsmState::RAMP_DOWN
@ RAMP_DOWN
MuonCond::DcsConstants::readyVolt
float readyVolt
Definition: MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/Defs.h:33
MuonCond::getFsmStateStrg
std::string getFsmStateStrg(DcsFsmState fsmState)
Definition: Defs.cxx:22
MuonCond::DcsFsmState::DEAD
@ DEAD
MuonCond::operator<<
std::ostream & operator<<(std::ostream &ostr, const DcsConstants &dcs)
Definition: Defs.cxx:52
MuonCond::DcsFsmState::TRIP
@ TRIP
MuonCond::DcsFsmState::UNPLUGGED
@ UNPLUGGED
MuonCond::DcsFsmState
DcsFsmState
Definition: MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/Defs.h:15
MuonCond::DcsConstants::standbyVolt
float standbyVolt
Definition: MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/Defs.h:32
MuonCond::DcsFsmState::ON
@ ON
MuonCond::DcsFsmState::STANDBY
@ STANDBY
MuonCond::DcsFsmState::UNKNOWN
@ UNKNOWN
MuonCond::DcsConstants
Helper struct to cache all dcs constants in a common place of the memory.
Definition: MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/Defs.h:31
MuonCond::DcsConstants::fsmState
DcsFsmState fsmState
Definition: MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/Defs.h:34
Defs.h
MuonCond::DcsFsmState::NONE
@ NONE
MuonCond::DcsFsmState::OFF
@ OFF
MuonCond::DcsFsmState::LOCKED
@ LOCKED
MuonCond::getFsmStateEnum
DcsFsmState getFsmStateEnum(const std::string &fsmState)
Definition: Defs.cxx:8
MuonCond::DcsFsmState::RAMP_UP
@ RAMP_UP
MuonCond::DcsFsmState::RECOVERY
@ RECOVERY
MuonCond
Definition: MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/Defs.h:10