add display of peer identity (if available) on peer status display;

pull/72/head
Bryan Biedenkapp 1 year ago
parent 9d2efc3028
commit bc5e49e80a

@ -17,6 +17,7 @@
#include "host/modem/Modem.h"
#include "common/Log.h"
#include "common/Thread.h"
#include "SysViewMain.h"
#include <final/final.h>
using namespace finalcut;
@ -110,6 +111,12 @@ public:
break;
}
m_peerIdentityStr.setText("UNK");
auto it = std::find_if(g_peerIdentityNameMap.begin(), g_peerIdentityNameMap.end(), [&](PeerIdentityMapPair x) { return x.first == peerId; });
if (it != g_peerIdentityNameMap.end()) {
m_peerIdentityStr.setText(it->second);
}
// pad peer IDs properly
std::ostringstream peerOss;
peerOss << std::setw(9) << std::setfill('0') << peerId;
@ -178,6 +185,7 @@ private:
FLabel m_modeStr{this};
FLabel m_peerIdStr{this};
FLabel m_peerIdentityStr{this};
FLabel m_channelNoLabel{"Ch. No.: ", this};
FLabel m_chanNo{this};
@ -318,6 +326,11 @@ private:
m_peerIdStr.setBackgroundColor(FColor::LightGray); // why?
m_peerIdStr.setAlignment(Align::Right);
m_peerIdentityStr.setGeometry(FPoint(19, 5), FSize(9, 1));
m_peerIdentityStr.setForegroundColor(FColor::DarkBlue); // why?
m_peerIdentityStr.setBackgroundColor(FColor::LightGray); // why?
m_peerIdentityStr.setAlignment(Align::Right);
// channel number
{
m_channelNoLabel.setGeometry(FPoint(2, 3), FSize(10, 1));

@ -155,6 +155,8 @@ public:
uint32_t chNo = (uint32_t)channel["channelNo"].get<int>();
uint8_t chId = channel["channelId"].get<uint8_t>();
g_peerIdentityNameMap[peerId] = std::string(identity);
// pad peer IDs properly
std::ostringstream peerOss;
peerOss << std::setw(9) << std::setfill('0') << peerId;

@ -69,6 +69,8 @@ lookups::RadioIdLookup* g_ridLookup = nullptr;
lookups::TalkgroupRulesLookup* g_tidLookup = nullptr;
lookups::IdenTableLookup* g_idenTable = nullptr;
std::unordered_map<uint32_t, std::string> g_peerIdentityNameMap = std::unordered_map<uint32_t, std::string>();
SysViewApplication* g_app = nullptr;
network::PeerNetwork* g_network = nullptr;

@ -68,6 +68,10 @@ extern lookups::TalkgroupRulesLookup* g_tidLookup;
/** @brief */
extern lookups::IdenTableLookup* g_idenTable;
typedef std::pair<const uint32_t, std::string> PeerIdentityMapPair;
/** @brief */
extern std::unordered_map<uint32_t, std::string> g_peerIdentityNameMap;
/**
* @brief Helper to trigger a fatal error message. This will cause the program to terminate
* immediately with an error message.

Loading…
Cancel
Save

Powered by TurnKey Linux.