1
0
Fork 0

Add more details to the IMRS description.

ycs232-kbc
Jonathan Naylor 4 years ago
parent 1b8b2918c0
commit 019ee2437e

@ -370,12 +370,12 @@ unsigned int CConf::getLogFileLevel() const
std::string CConf::getLogFilePath() const std::string CConf::getLogFilePath() const
{ {
return m_logFilePath; return m_logFilePath;
} }
std::string CConf::getLogFileRoot() const std::string CConf::getLogFileRoot() const
{ {
return m_logFileRoot; return m_logFileRoot;
} }
bool CConf::getAPRSEnabled() const bool CConf::getAPRSEnabled() const

@ -244,6 +244,7 @@ int CDGIdGateway::run()
if (imrs != NULL) { if (imrs != NULL) {
std::vector<IMRSDestination*> destinations = (*it)->m_destinations; std::vector<IMRSDestination*> destinations = (*it)->m_destinations;
std::vector<IMRSDest*> dests; std::vector<IMRSDest*> dests;
std::string name = (*it)->m_name;
for (std::vector<IMRSDestination*>::const_iterator it = destinations.begin(); it != destinations.end(); ++it) { for (std::vector<IMRSDestination*>::const_iterator it = destinations.begin(); it != destinations.end(); ++it) {
IMRSDest* dest = new IMRSDest; IMRSDest* dest = new IMRSDest;
@ -252,7 +253,7 @@ int CDGIdGateway::run()
dests.push_back(dest); dests.push_back(dest);
} }
imrs->addDGId(dgid, dests, debug); imrs->addDGId(dgid, name, dests, debug);
dgIdNetwork[dgid] = imrs; dgIdNetwork[dgid] = imrs;
dgIdNetwork[dgid]->m_modes = YSF_DT_VD_MODE1 | YSF_DT_VD_MODE2 | YSF_DT_VOICE_FR_MODE | YSF_DT_DATA_FR_MODE; dgIdNetwork[dgid]->m_modes = YSF_DT_VD_MODE1 | YSF_DT_VD_MODE2 | YSF_DT_VOICE_FR_MODE | YSF_DT_DATA_FR_MODE;
@ -361,7 +362,7 @@ int CDGIdGateway::run()
dgIdNetwork[dgId]->link(); dgIdNetwork[dgId]->link();
} }
std::string desc = dgIdNetwork[dgId]->getDesc(); std::string desc = dgIdNetwork[dgId]->getDesc(dgId);
LogDebug("DG-ID set to %u (%s) via RF", dgId, desc.c_str()); LogDebug("DG-ID set to %u (%s) via RF", dgId, desc.c_str());
currentDGId = dgId; currentDGId = dgId;
} }
@ -408,7 +409,7 @@ int CDGIdGateway::run()
inactivityTimer.start(); inactivityTimer.start();
if (currentDGId == 0U) { if (currentDGId == 0U) {
std::string desc = dgIdNetwork[i]->getDesc(); std::string desc = dgIdNetwork[i]->getDesc(i);
LogDebug("DG-ID set to %u (%s) via Network", i, desc.c_str()); LogDebug("DG-ID set to %u (%s) via Network", i, desc.c_str());
currentDGId = i; currentDGId = i;
} }

@ -125,6 +125,7 @@ Debug=0
[DGId=100] [DGId=100]
# Local IMRS System Fusion Network # Local IMRS System Fusion Network
Type=IMRS Type=IMRS
Name=West Sussex
Destination=100,44.131.4.1 Destination=100,44.131.4.1
Destination=75,44.131.4.2 Destination=75,44.131.4.2
#RFHangTime=120 #RFHangTime=120

@ -25,7 +25,7 @@ class CDGIdNetwork {
public: public:
virtual ~CDGIdNetwork() = 0; virtual ~CDGIdNetwork() = 0;
virtual std::string getDesc() = 0; virtual std::string getDesc(unsigned int dgId) = 0;
virtual bool open() = 0; virtual bool open() = 0;

@ -63,7 +63,7 @@ CFCSNetwork::~CFCSNetwork()
delete[] m_ping; delete[] m_ping;
} }
std::string CFCSNetwork::getDesc() std::string CFCSNetwork::getDesc(unsigned int dgId)
{ {
return "FCS: " + m_reflector; return "FCS: " + m_reflector;
} }

@ -40,7 +40,7 @@ public:
CFCSNetwork(const std::string& reflector, unsigned int port, const std::string& callsign, unsigned int rxFrequency, unsigned int txFrequency, const std::string& locator, unsigned int id, bool debug); CFCSNetwork(const std::string& reflector, unsigned int port, const std::string& callsign, unsigned int rxFrequency, unsigned int txFrequency, const std::string& locator, unsigned int id, bool debug);
virtual ~CFCSNetwork(); virtual ~CFCSNetwork();
virtual std::string getDesc(); virtual std::string getDesc(unsigned int dgId);
virtual bool open(); virtual bool open();

@ -39,19 +39,24 @@ CIMRSNetwork::~CIMRSNetwork()
{ {
} }
void CIMRSNetwork::addDGId(unsigned int dgId, const std::vector<IMRSDest*>& destinations, bool debug) void CIMRSNetwork::addDGId(unsigned int dgId, const std::string& name, const std::vector<IMRSDest*>& destinations, bool debug)
{ {
IMRSDGId* f = new IMRSDGId; IMRSDGId* f = new IMRSDGId;
f->m_dgId = dgId; f->m_dgId = dgId;
f->m_name = name;
f->m_destinations = destinations; f->m_destinations = destinations;
f->m_debug = debug; f->m_debug = debug;
m_dgIds.push_back(f); m_dgIds.push_back(f);
} }
std::string CIMRSNetwork::getDesc() std::string CIMRSNetwork::getDesc(unsigned int dgId)
{ {
return "IMRS"; IMRSDGId* ptr = find(dgId);
if (ptr == NULL)
return "IMRS: Unknown";
return "IMRS: " + ptr->m_name;
} }
bool CIMRSNetwork::open() bool CIMRSNetwork::open()

@ -36,12 +36,14 @@ class IMRSDGId {
public: public:
IMRSDGId() : IMRSDGId() :
m_dgId(0U), m_dgId(0U),
m_name(),
m_destinations(), m_destinations(),
m_debug(false), m_debug(false),
m_buffer(1000U, "IMRS Buffer") m_buffer(1000U, "IMRS Buffer")
{} {}
unsigned int m_dgId; unsigned int m_dgId;
std::string m_name;
std::vector<IMRSDest*> m_destinations; std::vector<IMRSDest*> m_destinations;
bool m_debug; bool m_debug;
CRingBuffer<unsigned char> m_buffer; CRingBuffer<unsigned char> m_buffer;
@ -52,9 +54,9 @@ public:
CIMRSNetwork(); CIMRSNetwork();
virtual ~CIMRSNetwork(); virtual ~CIMRSNetwork();
void addDGId(unsigned int dgId, const std::vector<IMRSDest*>& destinations, bool debug); void addDGId(unsigned int dgId, const std::string& name, const std::vector<IMRSDest*>& destinations, bool debug);
virtual std::string getDesc(); virtual std::string getDesc(unsigned int dgId);
virtual bool open(); virtual bool open();

@ -86,7 +86,7 @@ CYSFNetwork::~CYSFNetwork()
delete[] m_poll; delete[] m_poll;
} }
std::string CYSFNetwork::getDesc() std::string CYSFNetwork::getDesc(unsigned int dgId)
{ {
return "YSF: " + m_name; return "YSF: " + m_name;
} }

@ -34,7 +34,7 @@ public:
CYSFNetwork(unsigned int localPort, const std::string& name, const in_addr& address, unsigned int port, const std::string& callsign, bool debug); CYSFNetwork(unsigned int localPort, const std::string& name, const in_addr& address, unsigned int port, const std::string& callsign, bool debug);
virtual ~CYSFNetwork(); virtual ~CYSFNetwork();
virtual std::string getDesc(); virtual std::string getDesc(unsigned int dgId);
virtual bool open(); virtual bool open();

Loading…
Cancel
Save