Skip to content

Commit

Permalink
#1: Additional code tweaks per advice of https://github.com/sylveon
Browse files Browse the repository at this point in the history
  • Loading branch information
OOPMan committed Aug 2, 2019
1 parent 7940280 commit 67957af
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions RazorAtroxWinUSBVigEmFeeder/PDCursesUIManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,12 @@ void PDCursesUIManager::render(bool exiting)
{
erase();
mvwprintw(this->window, 0, 0, "Razer Atrox WinUSB VigEm Feeder %s", exiting ? "" : "(Press Q to exit)");
mvwprintw(this->window, 2, 0, "WinUSB Device Manager (Thread ID %d) status: %s", this->winUsbDeviceManager->getThreadId(), threadMessageToString(this->winUsbDeviceManagerStatus).data());
auto counter = 0;
std::list<std::pair<DWORD, std::string>> statusList;
for (auto threadId : this->winUsbDeviceThreadIdList) statusList.push_back(std::make_pair(
threadId, threadMessageToString(this->winUsbDeviceStatusMap[threadId])
));
for (auto tuple : statusList) {
mvwprintw(this->window, 3 + counter, 0, "WinUSB Device %d (Thread ID %d) status: %s", counter, tuple.first, tuple.second.data());
mvwprintw(this->window, 2, 0, "WinUSB Device Manager (Thread ID %d) status: %s", this->winUsbDeviceManager->getThreadId(), threadMessageToString(this->winUsbDeviceManagerStatus).c_str());
auto counter = 0;
for (auto threadId : this->winUsbDeviceThreadIdList) {
mvwprintw(this->window, 3 + counter, 0, "WinUSB Device %d (Thread ID %d) status: %s", counter, threadId, threadMessageToString(this->winUsbDeviceStatusMap.at(threadId)).c_str());
counter++;
}
}
if (exiting) mvwprintw(this->window, 4 + counter, 0, "Exiting. Waiting for all threads to exit...");
refresh();
}
Expand Down

0 comments on commit 67957af

Please sign in to comment.