FACT++  1.0
string StateMachineSmartFACT::GetStateHtml ( const DimState state,
int  green 
) const
inlineprivate

Definition at line 2228 of file smartfact.cc.

References DimState::description(), HTML::kGreen, HTML::kRed, HTML::kWhite, HTML::kYellow, DimState::online(), DimControl::shortmsg, and DimState::state().

2229  {
2230  if (!state.online())
2231  return HTML::kWhite+"\t—\n";
2232 
2233  if (&state==&fDimControl)
2234  return HTML::kGreen +'\t'+(state.state()==0?"Idle":fDimControl.shortmsg)+'\n';
2235 
2236  const State rc = state.description();
2237 
2238  // Sate not found in list, server online (-3: offline; -2: not found)
2239  if (rc.index==-2)
2240  {
2241  ostringstream out;
2242  out << HTML::kWhite << '\t' << state.state() << '\n';
2243  return out.str();
2244  }
2245 
2246  //ostringstream msg;
2247  //msg << HTML::kWhite << '\t' << rc.name << " [" << rc.index << "]\n";
2248  //return msg.str();
2249 
2250  if (rc.index<0)
2251  return HTML::kWhite + "\t&mdash;\n";
2252 
2253  string col = HTML::kGreen;
2254  if (rc.index<green)
2255  col = HTML::kYellow;
2256  if (rc.index>0xff)
2257  col = HTML::kRed;
2258 
2259  return col + '\t' + rc.name + '\n';
2260  }
virtual State description() const
Definition: DimState.h:84
static const string kYellow
Definition: smartfact.cc:75
const int32_t & state() const
Definition: DimState.h:80
std::string shortmsg
Definition: DimState.h:300
static const string kWhite
Definition: smartfact.cc:74
static const string kGreen
Definition: smartfact.cc:77
bool online() const
Definition: DimState.h:82
static const string kRed
Definition: smartfact.cc:76
DimControl fDimControl
Definition: smartfact.cc:624

+ Here is the call graph for this function: