replace spinbox with line edit; correct issue where AffListWnd and PeerListWnd would steal focus preventing input;

pull/72/head
Bryan Biedenkapp 1 year ago
parent b0b8a42a2c
commit c7ff885c72

@ -147,7 +147,6 @@ public:
} }
} }
setFocusWidget(&m_listView);
redraw(); redraw();
} }

@ -91,10 +91,11 @@ private:
FLabel m_dialogLabel{"Dynamic Regroup Subscriber", this}; FLabel m_dialogLabel{"Dynamic Regroup Subscriber", this};
FLabel m_subscriberLabel{"Subscriber ID: ", this}; FLabel m_subscriberLabel{"Subscriber ID: ", this};
FSpinBox m_subscriber{this}; RIDLineEdit m_subscriber{this};
FLabel m_tgLabel{"Talkgroup ID: ", this}; FLabel m_tgLabel{"Talkgroup ID: ", this};
TGIdLineEdit m_tgId{this}; TGIdLineEdit m_tgId{this};
uint32_t m_srcId = 1U;
uint32_t m_selectedTgId = 1U; uint32_t m_selectedTgId = 1U;
/** /**
@ -141,19 +142,51 @@ private:
m_subscriberLabel.setGeometry(FPoint(2, 8), FSize(25, 1)); m_subscriberLabel.setGeometry(FPoint(2, 8), FSize(25, 1));
m_subscriber.setGeometry(FPoint(28, 8), FSize(20, 1)); m_subscriber.setGeometry(FPoint(28, 8), FSize(20, 1));
m_subscriber.setRange(0, 16777211); m_subscriber.setText(std::to_string(m_srcId));
m_subscriber.setValue(1);
m_subscriber.setShadow(false); m_subscriber.setShadow(false);
m_subscriber.addCallback("changed", [&]() { m_subscriber.addCallback("up-pressed", [&]() {
if (m_subscriber.getValue() >= 1 && m_subscriber.getValue() <= 16777211) { uint32_t rid = ::atoi(m_subscriber.getText().c_str());
m_txButton.setEnable(true); rid++;
if (rid > 16777215U) {
rid = 16777215U;
} }
else {
m_txButton.setEnable(false); m_subscriber.setText(std::to_string(rid));
m_srcId = rid;
redraw();
});
m_subscriber.addCallback("down-pressed", [&]() {
uint32_t rid = ::atoi(m_subscriber.getText().c_str());
rid--;
if (rid < 1U) {
rid = 1U;
} }
m_subscriber.setText(std::to_string(rid));
m_srcId = rid;
redraw(); redraw();
}); });
m_subscriber.addCallback("changed", [&]() {
if (m_subscriber.getText().c_str() == "") {
m_srcId = 1U;
return;
}
uint32_t rid = ::atoi(m_subscriber.getText().c_str());
if (rid < 1U) {
rid = 1U;
}
if (rid > 16777215U) {
rid = 16777215U;
}
m_subscriber.setText(std::to_string(rid));
m_srcId = rid;
});
m_tgLabel.setGeometry(FPoint(2, 9), FSize(25, 1)); m_tgLabel.setGeometry(FPoint(2, 9), FSize(25, 1));
m_tgId.setGeometry(FPoint(28, 9), FSize(20, 1)); m_tgId.setGeometry(FPoint(28, 9), FSize(20, 1));
@ -181,6 +214,11 @@ private:
redraw(); redraw();
}); });
m_tgId.addCallback("changed", [&]() { m_tgId.addCallback("changed", [&]() {
if (m_tgId.getText().getLength() == 0) {
m_selectedTgId = 1U;
return;
}
uint32_t tgId = ::atoi(m_tgId.getText().c_str()); uint32_t tgId = ::atoi(m_tgId.getText().c_str());
if (tgId < 1U) { if (tgId < 1U) {
tgId = 1U; tgId = 1U;
@ -217,16 +255,16 @@ private:
using namespace p25::defines; using namespace p25::defines;
if (lock) { if (lock) {
writeP25_Ext_Func(ExtendedFunctions::DYN_REGRP_LOCK, WUID_FNE, (uint32_t)m_subscriber.getValue()); writeP25_Ext_Func(ExtendedFunctions::DYN_REGRP_LOCK, WUID_FNE, m_srcId);
break; break;
} }
if (unlock) { if (unlock) {
writeP25_Ext_Func(ExtendedFunctions::DYN_REGRP_UNLOCK, WUID_FNE, (uint32_t)m_subscriber.getValue()); writeP25_Ext_Func(ExtendedFunctions::DYN_REGRP_UNLOCK, WUID_FNE, m_srcId);
break; break;
} }
writeP25_Ext_Func(ExtendedFunctions::DYN_REGRP_REQ, m_selectedTgId, (uint32_t)m_subscriber.getValue()); writeP25_Ext_Func(ExtendedFunctions::DYN_REGRP_REQ, m_selectedTgId, m_srcId);
} }
break; break;

@ -43,7 +43,9 @@ private:
FLabel m_dialogLabel{"Inhibit Subscriber", this}; FLabel m_dialogLabel{"Inhibit Subscriber", this};
FLabel m_subscriberLabel{"Subscriber ID: ", this}; FLabel m_subscriberLabel{"Subscriber ID: ", this};
FSpinBox m_subscriber{this}; RIDLineEdit m_subscriber{this};
uint32_t m_srcId = 1U;
/** /**
* @brief Initializes the window layout. * @brief Initializes the window layout.
@ -71,19 +73,51 @@ private:
m_subscriberLabel.setGeometry(FPoint(2, 8), FSize(25, 1)); m_subscriberLabel.setGeometry(FPoint(2, 8), FSize(25, 1));
m_subscriber.setGeometry(FPoint(28, 8), FSize(20, 1)); m_subscriber.setGeometry(FPoint(28, 8), FSize(20, 1));
m_subscriber.setRange(0, 16777211); m_subscriber.setText(std::to_string(m_srcId));
m_subscriber.setValue(1);
m_subscriber.setShadow(false); m_subscriber.setShadow(false);
m_subscriber.addCallback("changed", [&]() { m_subscriber.addCallback("up-pressed", [&]() {
if (m_subscriber.getValue() >= 1 && m_subscriber.getValue() <= 16777211) { uint32_t rid = ::atoi(m_subscriber.getText().c_str());
m_txButton.setEnable(true); rid++;
if (rid > 16777215U) {
rid = 16777215U;
} }
else {
m_txButton.setEnable(false); m_subscriber.setText(std::to_string(rid));
m_srcId = rid;
redraw();
});
m_subscriber.addCallback("down-pressed", [&]() {
uint32_t rid = ::atoi(m_subscriber.getText().c_str());
rid--;
if (rid < 1U) {
rid = 1U;
} }
m_subscriber.setText(std::to_string(rid));
m_srcId = rid;
redraw(); redraw();
}); });
m_subscriber.addCallback("changed", [&]() {
if (m_subscriber.getText().getLength() == 0) {
m_srcId = 1U;
return;
}
uint32_t rid = ::atoi(m_subscriber.getText().c_str());
if (rid < 1U) {
rid = 1U;
}
if (rid > 16777215U) {
rid = 16777215U;
}
m_subscriber.setText(std::to_string(rid));
m_srcId = rid;
});
} }
m_dialogLabel.redraw(); m_dialogLabel.redraw();
@ -102,8 +136,7 @@ private:
using namespace dmr; using namespace dmr;
using namespace dmr::defines; using namespace dmr::defines;
writeDMR_Ext_Func((uint8_t)m_dmrSlot.getValue(), ExtendedFunctions::INHIBIT, WUID_STUNI, writeDMR_Ext_Func((uint8_t)m_dmrSlot.getValue(), ExtendedFunctions::INHIBIT, WUID_STUNI, m_srcId);
(uint32_t)m_subscriber.getValue());
} }
break; break;
@ -112,7 +145,7 @@ private:
using namespace p25; using namespace p25;
using namespace p25::defines; using namespace p25::defines;
writeP25_Ext_Func(ExtendedFunctions::INHIBIT, WUID_FNE, (uint32_t)m_subscriber.getValue()); writeP25_Ext_Func(ExtendedFunctions::INHIBIT, WUID_FNE, m_srcId);
} }
break; break;

@ -42,7 +42,9 @@ private:
FLabel m_dialogLabel{"Page Subscriber", this}; FLabel m_dialogLabel{"Page Subscriber", this};
FLabel m_subscriberLabel{"Subscriber ID: ", this}; FLabel m_subscriberLabel{"Subscriber ID: ", this};
FSpinBox m_subscriber{this}; RIDLineEdit m_subscriber{this};
uint32_t m_srcId = 1U;
/** /**
* @brief Initializes the window layout. * @brief Initializes the window layout.
@ -70,19 +72,51 @@ private:
m_subscriberLabel.setGeometry(FPoint(2, 8), FSize(25, 1)); m_subscriberLabel.setGeometry(FPoint(2, 8), FSize(25, 1));
m_subscriber.setGeometry(FPoint(28, 8), FSize(20, 1)); m_subscriber.setGeometry(FPoint(28, 8), FSize(20, 1));
m_subscriber.setRange(0, 16777211); m_subscriber.setText(std::to_string(m_srcId));
m_subscriber.setValue(1);
m_subscriber.setShadow(false); m_subscriber.setShadow(false);
m_subscriber.addCallback("changed", [&]() { m_subscriber.addCallback("up-pressed", [&]() {
if (m_subscriber.getValue() >= 1 && m_subscriber.getValue() <= 16777211) { uint32_t rid = ::atoi(m_subscriber.getText().c_str());
m_txButton.setEnable(true); rid++;
if (rid > 16777215U) {
rid = 16777215U;
} }
else {
m_txButton.setEnable(false); m_subscriber.setText(std::to_string(rid));
m_srcId = rid;
redraw();
});
m_subscriber.addCallback("down-pressed", [&]() {
uint32_t rid = ::atoi(m_subscriber.getText().c_str());
rid--;
if (rid < 1U) {
rid = 1U;
} }
m_subscriber.setText(std::to_string(rid));
m_srcId = rid;
redraw(); redraw();
}); });
m_subscriber.addCallback("changed", [&]() {
if (m_subscriber.getText().getLength() == 0) {
m_srcId = 1U;
return;
}
uint32_t rid = ::atoi(m_subscriber.getText().c_str());
if (rid < 1U) {
rid = 1U;
}
if (rid > 16777215U) {
rid = 16777215U;
}
m_subscriber.setText(std::to_string(rid));
m_srcId = rid;
});
} }
m_dialogLabel.redraw(); m_dialogLabel.redraw();
@ -104,7 +138,7 @@ private:
std::unique_ptr<CSBK_CALL_ALRT> csbk = std::make_unique<CSBK_CALL_ALRT>(); std::unique_ptr<CSBK_CALL_ALRT> csbk = std::make_unique<CSBK_CALL_ALRT>();
csbk->setGI(false); csbk->setGI(false);
csbk->setSrcId(DMRDEF::WUID_ALL); csbk->setSrcId(DMRDEF::WUID_ALL);
csbk->setDstId((uint32_t)m_subscriber.getValue()); csbk->setDstId(m_srcId);
write_CSBK((uint8_t)m_dmrSlot.getValue(), csbk.get()); write_CSBK((uint8_t)m_dmrSlot.getValue(), csbk.get());
} }
@ -117,7 +151,7 @@ private:
std::unique_ptr<IOSP_CALL_ALRT> iosp = std::make_unique<IOSP_CALL_ALRT>(); std::unique_ptr<IOSP_CALL_ALRT> iosp = std::make_unique<IOSP_CALL_ALRT>();
iosp->setSrcId(P25DEF::WUID_FNE); iosp->setSrcId(P25DEF::WUID_FNE);
iosp->setDstId((uint32_t)m_subscriber.getValue()); iosp->setDstId(m_srcId);
write_TSDU(iosp.get()); write_TSDU(iosp.get());
} }

@ -210,7 +210,6 @@ public:
} }
} }
setFocusWidget(&m_listView);
redraw(); redraw();
} }

@ -42,7 +42,9 @@ private:
FLabel m_dialogLabel{"Radio Check Subscriber", this}; FLabel m_dialogLabel{"Radio Check Subscriber", this};
FLabel m_subscriberLabel{"Subscriber ID: ", this}; FLabel m_subscriberLabel{"Subscriber ID: ", this};
FSpinBox m_subscriber{this}; RIDLineEdit m_subscriber{this};
uint32_t m_srcId = 1U;
/** /**
* @brief Initializes the window layout. * @brief Initializes the window layout.
@ -70,19 +72,51 @@ private:
m_subscriberLabel.setGeometry(FPoint(2, 8), FSize(25, 1)); m_subscriberLabel.setGeometry(FPoint(2, 8), FSize(25, 1));
m_subscriber.setGeometry(FPoint(28, 8), FSize(20, 1)); m_subscriber.setGeometry(FPoint(28, 8), FSize(20, 1));
m_subscriber.setRange(0, 16777211); m_subscriber.setText(std::to_string(m_srcId));
m_subscriber.setValue(1);
m_subscriber.setShadow(false); m_subscriber.setShadow(false);
m_subscriber.addCallback("changed", [&]() { m_subscriber.addCallback("up-pressed", [&]() {
if (m_subscriber.getValue() >= 1 && m_subscriber.getValue() <= 16777211) { uint32_t rid = ::atoi(m_subscriber.getText().c_str());
m_txButton.setEnable(true); rid++;
if (rid > 16777215U) {
rid = 16777215U;
} }
else {
m_txButton.setEnable(false); m_subscriber.setText(std::to_string(rid));
m_srcId = rid;
redraw();
});
m_subscriber.addCallback("down-pressed", [&]() {
uint32_t rid = ::atoi(m_subscriber.getText().c_str());
rid--;
if (rid < 1U) {
rid = 1U;
} }
m_subscriber.setText(std::to_string(rid));
m_srcId = rid;
redraw(); redraw();
}); });
m_subscriber.addCallback("changed", [&]() {
if (m_subscriber.getText().getLength() == 0) {
m_srcId = 1U;
return;
}
uint32_t rid = ::atoi(m_subscriber.getText().c_str());
if (rid < 1U) {
rid = 1U;
}
if (rid > 16777215U) {
rid = 16777215U;
}
m_subscriber.setText(std::to_string(rid));
m_srcId = rid;
});
} }
m_dialogLabel.redraw(); m_dialogLabel.redraw();
@ -101,8 +135,7 @@ private:
using namespace dmr; using namespace dmr;
using namespace dmr::defines; using namespace dmr::defines;
writeDMR_Ext_Func((uint8_t)m_dmrSlot.getValue(), ExtendedFunctions::CHECK, WUID_STUNI, writeDMR_Ext_Func((uint8_t)m_dmrSlot.getValue(), ExtendedFunctions::CHECK, WUID_STUNI, m_srcId);
(uint32_t)m_subscriber.getValue());
} }
break; break;
@ -111,7 +144,7 @@ private:
using namespace p25; using namespace p25;
using namespace p25::defines; using namespace p25::defines;
writeP25_Ext_Func(ExtendedFunctions::CHECK, WUID_FNE, (uint32_t)m_subscriber.getValue()); writeP25_Ext_Func(ExtendedFunctions::CHECK, WUID_FNE, m_srcId);
} }
break; break;

@ -35,6 +35,50 @@ using namespace finalcut;
// Class Declaration // Class Declaration
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
/**
* @brief This class implements the line edit control for RIDs.
* @ingroup fneSysView
*/
class HOST_SW_API RIDLineEdit final : public FLineEdit {
public:
/**
* @brief Initializes a new instance of the RIDLineEdit class.
* @param widget
*/
explicit RIDLineEdit(FWidget* widget = nullptr) : FLineEdit{widget}
{
setInputFilter("[[:digit:]]");
}
/*
** Event Handlers
*/
/**
* @brief Event that occurs on keyboard key press.
* @param e Keyboard Event.
*/
void onKeyPress(finalcut::FKeyEvent* e) override
{
const auto key = e->key();
if (key == FKey::Up) {
emitCallback("up-pressed");
e->accept();
return;
} else if (key == FKey::Down) {
emitCallback("down-pressed");
e->accept();
return;
}
FLineEdit::onKeyPress(e);
}
};
// ---------------------------------------------------------------------------
// Class Declaration
// ---------------------------------------------------------------------------
/** /**
* @brief This class implements the base class for transmit windows. * @brief This class implements the base class for transmit windows.
* @ingroup fneSysView * @ingroup fneSysView
@ -307,11 +351,13 @@ protected:
// Set first busy bits to 1,1 // Set first busy bits to 1,1
P25Utils::setStatusBits(data, P25_SS0_START, true, true); P25Utils::setStatusBits(data, P25_SS0_START, true, true);
LogDebug(LOG_RF, P25_TSDU_STR ", lco = $%02X, mfId = $%02X, lastBlock = %u, AIV = %u, EX = %u, srcId = %u, dstId = %u, sysId = $%03X, netId = $%05X", if (g_debug) {
tsbk->getLCO(), tsbk->getMFId(), tsbk->getLastBlock(), tsbk->getAIV(), tsbk->getEX(), tsbk->getSrcId(), tsbk->getDstId(), LogDebug(LOG_RF, P25_TSDU_STR ", lco = $%02X, mfId = $%02X, lastBlock = %u, AIV = %u, EX = %u, srcId = %u, dstId = %u, sysId = $%03X, netId = $%05X",
tsbk->getSysId(), tsbk->getNetId()); tsbk->getLCO(), tsbk->getMFId(), tsbk->getLastBlock(), tsbk->getAIV(), tsbk->getEX(), tsbk->getSrcId(), tsbk->getDstId(),
tsbk->getSysId(), tsbk->getNetId());
Utils::dump(1U, "!!! *TSDU (SBF) TSBK Block Data", data + P25_PREAMBLE_LENGTH_BYTES, P25_TSBK_FEC_LENGTH_BYTES); Utils::dump(1U, "!!! *TSDU (SBF) TSBK Block Data", data + P25_PREAMBLE_LENGTH_BYTES, P25_TSBK_FEC_LENGTH_BYTES);
}
lc::LC lc = lc::LC(); lc::LC lc = lc::LC();
lc.setLCO(tsbk->getLCO()); lc.setLCO(tsbk->getLCO());

@ -43,7 +43,9 @@ private:
FLabel m_dialogLabel{"Uninhibit Subscriber", this}; FLabel m_dialogLabel{"Uninhibit Subscriber", this};
FLabel m_subscriberLabel{"Subscriber ID: ", this}; FLabel m_subscriberLabel{"Subscriber ID: ", this};
FSpinBox m_subscriber{this}; RIDLineEdit m_subscriber{this};
uint32_t m_srcId = 1U;
/** /**
* @brief Initializes the window layout. * @brief Initializes the window layout.
@ -71,19 +73,51 @@ private:
m_subscriberLabel.setGeometry(FPoint(2, 8), FSize(25, 1)); m_subscriberLabel.setGeometry(FPoint(2, 8), FSize(25, 1));
m_subscriber.setGeometry(FPoint(28, 8), FSize(20, 1)); m_subscriber.setGeometry(FPoint(28, 8), FSize(20, 1));
m_subscriber.setRange(0, 16777211); m_subscriber.setText(std::to_string(m_srcId));
m_subscriber.setValue(1);
m_subscriber.setShadow(false); m_subscriber.setShadow(false);
m_subscriber.addCallback("changed", [&]() { m_subscriber.addCallback("up-pressed", [&]() {
if (m_subscriber.getValue() >= 1 && m_subscriber.getValue() <= 16777211) { uint32_t rid = ::atoi(m_subscriber.getText().c_str());
m_txButton.setEnable(true); rid++;
if (rid > 16777215U) {
rid = 16777215U;
} }
else {
m_txButton.setEnable(false); m_subscriber.setText(std::to_string(rid));
m_srcId = rid;
redraw();
});
m_subscriber.addCallback("down-pressed", [&]() {
uint32_t rid = ::atoi(m_subscriber.getText().c_str());
rid--;
if (rid < 1U) {
rid = 1U;
} }
m_subscriber.setText(std::to_string(rid));
m_srcId = rid;
redraw(); redraw();
}); });
m_subscriber.addCallback("changed", [&]() {
if (m_subscriber.getText().getLength() == 0) {
m_srcId = 1U;
return;
}
uint32_t rid = ::atoi(m_subscriber.getText().c_str());
if (rid < 1U) {
rid = 1U;
}
if (rid > 16777215U) {
rid = 16777215U;
}
m_subscriber.setText(std::to_string(rid));
m_srcId = rid;
});
} }
m_dialogLabel.redraw(); m_dialogLabel.redraw();
@ -102,8 +136,7 @@ private:
using namespace dmr; using namespace dmr;
using namespace dmr::defines; using namespace dmr::defines;
writeDMR_Ext_Func((uint8_t)m_dmrSlot.getValue(), ExtendedFunctions::UNINHIBIT, WUID_STUNI, writeDMR_Ext_Func((uint8_t)m_dmrSlot.getValue(), ExtendedFunctions::UNINHIBIT, WUID_STUNI, m_srcId);
(uint32_t)m_subscriber.getValue());
} }
break; break;
@ -112,7 +145,7 @@ private:
using namespace p25; using namespace p25;
using namespace p25::defines; using namespace p25::defines;
writeP25_Ext_Func(ExtendedFunctions::UNINHIBIT, WUID_FNE, (uint32_t)m_subscriber.getValue()); writeP25_Ext_Func(ExtendedFunctions::UNINHIBIT, WUID_FNE, m_srcId);
} }
break; break;

@ -218,6 +218,13 @@ private:
redraw(); redraw();
}); });
m_tgId.addCallback("changed", [&]() { m_tgId.addCallback("changed", [&]() {
if (m_tgId.getText().getLength() == 0) {
auto source = m_rule.source();
source.tgId(1U);
m_rule.source(source);
return;
}
uint32_t tgId = ::atoi(m_tgId.getText().c_str()); uint32_t tgId = ::atoi(m_tgId.getText().c_str());
if (tgId < 1U) { if (tgId < 1U) {
tgId = 1U; tgId = 1U;

Loading…
Cancel
Save

Powered by TurnKey Linux.