FACT++  1.0
bool StateMachineDim::AddStateName ( const int  state,
const std::string &  name,
const std::string &  doc = "" 
)
virtual

Overwrite StateMachineImp::AddStateName. In addition to storing the state locally it is also propagated through Dim in the STATE_LIST service.

Parameters
stateNumber of the state to which a name should be assigned
nameA name which should be assigned to the state, e.g. "Tracking"
docA explanatory text describing the state

Reimplemented from StateMachineImp.

Definition at line 109 of file StateMachineDim.cc.

References StateMachineImp::AddStateName(), fDescriptionStates, StateMachineImp::fStateNames, StateMachineImp::GetStateIndex(), StateMachineImp::HasState(), StateMachineImp::kSM_NotAvailable, str, and DimDescribedService::Update().

Referenced by DataLogger::DataLogger(), FitsLoader::FitsLoader(), RemoteControl< Shell >::JsNewState(), and StateMachineDimControl::StateMachineDimControl().

110 {
111  if (name.empty())
112  return false;
113 
114  const bool rc = HasState(state) || GetStateIndex(name)!=kSM_NotAvailable;
115 
116  StateMachineImp::AddStateName(state, name, doc);
117 
118  string str;
119  for (auto it=fStateNames.begin(); it!=fStateNames.end(); it++)
120  str += to_string(it->first)+':'+it->second.first+'='+it->second.second+'\n';
121 
123 
124  return rc;
125 }
int GetStateIndex(const std::string &name) const
DimDescribedService fDescriptionStates
Version number.
char str[80]
Definition: test_client.c:7
bool HasState(int index) const
StateNames fStateNames
Human readable names associated with the states.
Possible return value for GetStateIndex.
virtual bool AddStateName(const int state, const std::string &name, const std::string &doc="")

+ Here is the call graph for this function:

+ Here is the caller graph for this function: