add support to report source ID; enhance coloring abit more;

pull/33/head
Bryan Biedenkapp 3 years ago
parent 180bce2d62
commit b341c7ee13

@ -41,7 +41,7 @@ using namespace finalcut;
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
#define NODE_STATUS_WIDTH 28 #define NODE_STATUS_WIDTH 28
#define NODE_STATUS_HEIGHT 7 #define NODE_STATUS_HEIGHT 8
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// Class Declaration // Class Declaration
@ -99,6 +99,8 @@ private:
uint8_t m_channelId; uint8_t m_channelId;
uint32_t m_channelNo; uint32_t m_channelNo;
FLabel m_modeStr{this};
FLabel m_channelNoLabel{"Ch. No.: ", this}; FLabel m_channelNoLabel{"Ch. No.: ", this};
FLabel m_chanNo{this}; FLabel m_chanNo{this};
@ -109,6 +111,8 @@ private:
FLabel m_lastTGLabel{"Last TG: ", this}; FLabel m_lastTGLabel{"Last TG: ", this};
FLabel m_lastTG{this}; FLabel m_lastTG{this};
FLabel m_lastSrcLabel{"Last Src: ", this};
FLabel m_lastSrc{this};
/// <summary> /// <summary>
/// ///
@ -138,13 +142,13 @@ private:
FDialog::draw(); FDialog::draw();
if (m_failed) { if (m_failed) {
setColor(FColor::LightGray, FColor::Red3); setColor(FColor::LightGray, FColor::LightRed);
} }
else if (m_control) { else if (m_control) {
setColor(FColor::LightGray, FColor::Purple1); setColor(FColor::LightGray, FColor::Purple1);
} }
else if (m_tx) { else if (m_tx) {
setColor(FColor::LightGray, FColor::Green1); setColor(FColor::LightGray, FColor::LightGreen);
} }
else { else {
setColor(FColor::LightGray, FColor::Black); setColor(FColor::LightGray, FColor::Black);
@ -158,6 +162,10 @@ private:
/// </summary> /// </summary>
void initControls() void initControls()
{ {
m_modeStr.setGeometry(FPoint(22, 1), FSize(4, 1));
m_modeStr.setAlignment(Align::Right);
m_modeStr.setEmphasis();
// channel number // channel number
{ {
m_channelNoLabel.setGeometry(FPoint(2, 1), FSize(10, 1)); m_channelNoLabel.setGeometry(FPoint(2, 1), FSize(10, 1));
@ -179,11 +187,19 @@ private:
// last TG // last TG
{ {
m_lastTGLabel.setGeometry(FPoint(2, 4), FSize(10, 1)); m_lastTGLabel.setGeometry(FPoint(2, 4), FSize(11, 1));
m_lastTG.setGeometry(FPoint(11, 4), FSize(8, 1)); m_lastTG.setGeometry(FPoint(13, 4), FSize(8, 1));
m_lastTG.setText("None"); m_lastTG.setText("None");
} }
// last source
{
m_lastSrcLabel.setGeometry(FPoint(2, 5), FSize(11, 1));
m_lastSrc.setGeometry(FPoint(13, 5), FSize(8, 1));
m_lastSrc.setText("None");
}
} }
/// <summary> /// <summary>
@ -260,6 +276,19 @@ private:
} }
else { else {
try { try {
uint8_t mode = rsp["state"].get<uint8_t>();
switch (mode) {
case modem::STATE_DMR:
m_modeStr.setText("DMR");
break;
case modem::STATE_P25:
m_modeStr.setText("P25");
break;
case modem::STATE_NXDN:
m_modeStr.setText("NXDN");
break;
}
// get remote node state // get remote node state
if (rsp["dmrTSCCEnable"].is<bool>() && rsp["p25CtrlEnable"].is<bool>() && if (rsp["dmrTSCCEnable"].is<bool>() && rsp["p25CtrlEnable"].is<bool>() &&
rsp["nxdnCtrlEnable"].is<bool>()) { rsp["nxdnCtrlEnable"].is<bool>()) {
@ -332,6 +361,20 @@ private:
else { else {
::LogWarning(LOG_HOST, "%s:%u, does not report last TG information"); ::LogWarning(LOG_HOST, "%s:%u, does not report last TG information");
} }
// report last known transmitted source ID
if (rsp["lastSrcId"].is<uint32_t>()) {
uint32_t lastSrcId = rsp["lastSrcId"].get<uint32_t>();
if (lastSrcId == 0) {
m_lastSrc.setText("None");
}
else {
m_lastSrc.setText(__INT_STR(lastSrcId));
}
}
else {
::LogWarning(LOG_HOST, "%s:%u, does not report last source information");
}
} }
catch (std::exception&) { catch (std::exception&) {
::LogWarning(LOG_HOST, "%s:%u, failed to properly handle status"); ::LogWarning(LOG_HOST, "%s:%u, failed to properly handle status");

Loading…
Cancel
Save

Powered by TurnKey Linux.