Skip to content

Commit

Permalink
IbPerfMon: Fix a bug, where the menu window would not be focussed any…
Browse files Browse the repository at this point in the history
…more, after the amount of monitor windows has been changed
  • Loading branch information
fruhland committed Jul 10, 2018
1 parent b1bcd2b commit 38382a9
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/IbPerfMon/IbPerfMon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,18 @@ void IbPerfMon::Run() {
m_monitorWindow[0]->RefreshValues();
m_manager->RequestRefresh();
});
m_manager->AddMenuFunction("Single Window", [&] { SetWindowCount(1); });
m_manager->AddMenuFunction("Dual Window", [&] { SetWindowCount(2); });
m_manager->AddMenuFunction("Quad Window", [&] { SetWindowCount(4); });
m_manager->AddMenuFunction("Single Window", [&] {
SetWindowCount(1);
m_manager->SetFocus(m_menuWindow);
});
m_manager->AddMenuFunction("Dual Window", [&] {
SetWindowCount(2);
m_manager->SetFocus(m_menuWindow);
});
m_manager->AddMenuFunction("Quad Window", [&] {
SetWindowCount(4);
m_manager->SetFocus(m_menuWindow);
});
m_manager->AddMenuFunction("Exit", [&] { m_isRunning = false; });

StartMonitoring();
Expand Down Expand Up @@ -161,6 +170,8 @@ void IbPerfMon::StartMonitoring() {
CursesLib::MenuItem item(node->GetDescription().c_str(), [&, node]() {
SetWindowCount(1);

m_manager->SetFocus(m_menuWindow);

m_monitorWindow[0]->SetPerfCounter(node);
m_monitorWindow[0]->SetTitle(node->GetDescription().c_str());
}, node);
Expand All @@ -172,6 +183,8 @@ void IbPerfMon::StartMonitoring() {
item.AddSubitem(CursesLib::MenuItem(portName, [&, port, portName]() {
SetWindowCount(1);

m_manager->SetFocus(m_menuWindow);

m_monitorWindow[0]->SetPerfCounter(port);
m_monitorWindow[0]->SetTitle(portName);
}, port));
Expand Down

0 comments on commit 38382a9

Please sign in to comment.