in analyzers/src/watch/nc_windows/statistics_window.cpp [92:135]
void StatisticsWindow::updateProtocol(AbstractProtocol* p)
{
if(p != nullptr)
_activeProtocol = p;
if(_window == nullptr)
{
return;
}
werase(_window);
wborder(_window, ACS_VLINE, ACS_VLINE, ACS_HLINE, ACS_HLINE, ACS_ULCORNER, ACS_URCORNER, ACS_LLCORNER, ACS_LRCORNER);
std::string tmp(" ");
for_each(_allProtocols.begin(), _allProtocols.end(), [&](std::string& s) {
if(!s.compare(_activeProtocol->getProtocolName()))
{
tmp += std::string(" < ") + s + std::string(" > ");
}
else
{
tmp += std::string(" ") + s + std::string(" ");
}
});
mvwprintw(_window, STATISTICS::PROTOCOLS_LINE, FIRST_CHAR_POS, "%s", tmp.c_str());
unsigned int line = STATISTICS::FIRST_OPERATION_LINE;
for(unsigned int i = STATISTICS::DEFAULT_GROUP; i <= _activeProtocol->getGroups(); i++)
{
if(canWrite(line))
{
mvwprintw(_window, line - (_scrollOffset.at(p)), FIRST_CHAR_POS, "%s", "Total:");
}
line++;
for(unsigned int j = _activeProtocol->getGroupBegin(i); j < _activeProtocol->getGroupBegin(i + 1); j++)
{
if(canWrite(line))
{
mvwprintw(_window, line - (_scrollOffset.at(p)), FIRST_CHAR_POS, "%s", p->printProcedure(j));
}
line++;
}
line++;
}
}