FACT++  1.0
void FactGui::SetFadLed ( QPushButton *  led,
const DimData d,
uint16_t  bitmask,
bool  invert = false 
)
inlineprivate

Definition at line 1523 of file FactGui.h.

References Time::GetAsStr(), DimData::ptr(), DimData::size(), and DimData::time.

1524  {
1525  if (d.size()==0)
1526  {
1527  SetLedColor(led, kLedGray, d.time);
1528  return;
1529  }
1530 
1531  const bool quality = d.ptr<uint16_t>()[0]&bitmask;
1532  const bool value = d.ptr<uint16_t>()[1]&bitmask;
1533  const uint16_t *ptr = d.ptr<uint16_t>()+2;
1534 
1535  SetLedColor(led, quality?kLedOrange:(value^invert?kLedGreen:kLedGreenBar), d.time);
1536 
1537  ostringstream tip;
1538  tip << "<table border='1'><tr><th colspan='11'>" << d.time.GetAsStr() << " (UTC)</th></tr><tr><th></th>";
1539  for (int b=0; b<10; b++)
1540  tip << "<th>" << b << "</th>";
1541  tip << "</tr>";
1542 
1543  /*
1544  tip << "<tr>" << hex;
1545  tip << "<th>" << d.ptr<uint16_t>()[0] << " " << (d.ptr<uint16_t>()[0]&bitmask) << "</th>";
1546  tip << "<th>" << d.ptr<uint16_t>()[1] << " " << (d.ptr<uint16_t>()[1]&bitmask) << "</th>";
1547  tip << "</tr>";
1548  */
1549 
1550  for (int c=0; c<4; c++)
1551  {
1552  tip << "<tr><th>" << dec << c << "</th>" << hex;
1553  for (int b=0; b<10; b++)
1554  {
1555  tip << "<td>"
1556  << (ptr[c*10+b]&bitmask)
1557  << "</td>";
1558  }
1559  tip << "</tr>";
1560  }
1561  tip << "</table>";
1562 
1563  led->setToolTip(tip.str().c_str());
1564  }
void SetLedColor(QPushButton *button, LedColor_t col, const Time &t)
Definition: FactGui.h:156
const Time time
Definition: DimData.h:9
size_t size() const
Definition: DimData.h:39
std::string GetAsStr(const char *fmt="%Y-%m-%d %H:%M:%S") const
Definition: Time.cc:240
const T * ptr(uint32_t offset=0) const
Definition: DimData.h:32

+ Here is the call graph for this function: