mirror of
https://github.com/g4klx/ircDDBGateway.git
synced 2026-01-06 16:29:59 +01:00
Add basic JSON logging and JSON status messages.
This commit is contained in:
parent
5a489bff1e
commit
7da1a79730
15
.gitignore
vendored
15
.gitignore
vendored
|
|
@ -9,3 +9,18 @@ Release
|
|||
.vs
|
||||
*.a
|
||||
*.d
|
||||
APRSTransmit/aprstransmitd
|
||||
RemoteControl/remotecontrol
|
||||
RemoteControl/remotecontrold
|
||||
StarNetServer/starnetserver
|
||||
StarNetServer/starnetserverd
|
||||
TextTransmit/texttransmitd
|
||||
TimeServer/timeserver
|
||||
TimeServer/timeserverd
|
||||
TimerControl/timercontrol
|
||||
TimerControl/timercontrold
|
||||
VoiceTransmit/voicetransmitd
|
||||
ircDDBGateway/ircddbgateway
|
||||
ircDDBGateway/ircddbgatewayd
|
||||
GitVersion.h
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2010-2014,2018,2020 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2010-2014,2018,2020,2023 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -17,10 +17,14 @@
|
|||
*/
|
||||
|
||||
#include "APRSWriter.h"
|
||||
#include "MQTTConnection.h"
|
||||
|
||||
#include "DStarDefines.h"
|
||||
#include "Defs.h"
|
||||
|
||||
// In MQTTLog.cpp
|
||||
extern CMQTTConnection* m_mqtt;
|
||||
|
||||
CAPRSEntry::CAPRSEntry(const wxString& callsign, const wxString& band, double frequency, double offset, double range, double latitude, double longitude, double agl) :
|
||||
m_callsign(callsign),
|
||||
m_band(band),
|
||||
|
|
@ -118,13 +122,10 @@ bool CAPRSEntry::isOK()
|
|||
}
|
||||
}
|
||||
|
||||
CAPRSWriter::CAPRSWriter(const wxString& address, unsigned int port, const wxString& gateway) :
|
||||
CAPRSWriter::CAPRSWriter(const wxString& gateway) :
|
||||
m_idTimer(1000U),
|
||||
m_gateway(),
|
||||
m_array(),
|
||||
m_aprsAddress(),
|
||||
m_aprsPort(port),
|
||||
m_aprsSocket()
|
||||
m_array()
|
||||
#if defined(USE_GPSD)
|
||||
,m_gpsdEnabled(false),
|
||||
m_gpsdAddress(),
|
||||
|
|
@ -132,15 +133,11 @@ m_gpsdPort(),
|
|||
m_gpsdData()
|
||||
#endif
|
||||
{
|
||||
wxASSERT(!address.IsEmpty());
|
||||
wxASSERT(port > 0U);
|
||||
wxASSERT(!gateway.IsEmpty());
|
||||
|
||||
m_gateway = gateway;
|
||||
m_gateway.Truncate(LONG_CALLSIGN_LENGTH - 1U);
|
||||
m_gateway.Trim();
|
||||
|
||||
m_aprsAddress = CUDPReaderWriter::lookup(address);
|
||||
}
|
||||
|
||||
CAPRSWriter::~CAPRSWriter()
|
||||
|
|
@ -193,12 +190,6 @@ bool CAPRSWriter::open()
|
|||
wxLogMessage(wxT("Connected to GPSD"));
|
||||
}
|
||||
#endif
|
||||
bool ret = m_aprsSocket.open();
|
||||
if (!ret)
|
||||
return false;
|
||||
|
||||
wxLogMessage(wxT("Opened connection to the APRS Gateway"));
|
||||
|
||||
m_idTimer.setTimeout(60U);
|
||||
m_idTimer.start();
|
||||
|
||||
|
|
@ -284,7 +275,7 @@ void CAPRSWriter::writeData(const wxString& callsign, const CAMBEData& data)
|
|||
|
||||
wxLogDebug(wxT("APRS ==> %s"), output.c_str());
|
||||
|
||||
m_aprsSocket.write((unsigned char*)ascii, (unsigned int)::strlen(ascii), m_aprsAddress, m_aprsPort);
|
||||
m_mqtt->publish("aprs-gateway/aprs", ascii);
|
||||
|
||||
collector->reset();
|
||||
}
|
||||
|
|
@ -316,8 +307,6 @@ void CAPRSWriter::clock(unsigned int ms)
|
|||
|
||||
void CAPRSWriter::close()
|
||||
{
|
||||
m_aprsSocket.close();
|
||||
|
||||
#if defined(USE_GPSD)
|
||||
if (m_gpsdEnabled) {
|
||||
::gps_stream(&m_gpsdData, WATCH_DISABLE, NULL);
|
||||
|
|
@ -419,7 +408,7 @@ void CAPRSWriter::sendIdFramesFixed()
|
|||
|
||||
wxLogDebug(wxT("APRS ==> %s"), output.c_str());
|
||||
|
||||
m_aprsSocket.write((unsigned char*)ascii, (unsigned int)::strlen(ascii), m_aprsAddress, m_aprsPort);
|
||||
m_mqtt->publish("aprs-gateway/aprs", ascii);
|
||||
|
||||
if (entry->getBand().Len() == 1U) {
|
||||
output.Printf(wxT("%s-%s>APDG02,TCPIP*,qAC,%s-%sS:!%s%cD%s%c&RNG%04.0lf/A=%06.0lf %s %s\r\n"),
|
||||
|
|
@ -434,7 +423,7 @@ void CAPRSWriter::sendIdFramesFixed()
|
|||
|
||||
wxLogDebug(wxT("APRS ==> %s"), output.c_str());
|
||||
|
||||
m_aprsSocket.write((unsigned char*)ascii, (unsigned int)::strlen(ascii), m_aprsAddress, m_aprsPort);
|
||||
m_mqtt->publish("aprs-gateway/aprs", ascii);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2010,2011,2012,2018,2020 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2010,2011,2012,2018,2020.2023 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -19,7 +19,6 @@
|
|||
#ifndef APRSWriter_H
|
||||
#define APRSWriter_H
|
||||
|
||||
#include "UDPReaderWriter.h"
|
||||
#include "APRSCollector.h"
|
||||
#include "DStarDefines.h"
|
||||
#include "HeaderData.h"
|
||||
|
|
@ -71,7 +70,7 @@ WX_DECLARE_STRING_HASH_MAP(CAPRSEntry*, CEntry_t);
|
|||
|
||||
class CAPRSWriter {
|
||||
public:
|
||||
CAPRSWriter(const wxString& address, unsigned int port, const wxString& gateway);
|
||||
CAPRSWriter(const wxString& gateway);
|
||||
~CAPRSWriter();
|
||||
|
||||
bool open();
|
||||
|
|
@ -92,9 +91,6 @@ private:
|
|||
CTimer m_idTimer;
|
||||
wxString m_gateway;
|
||||
CEntry_t m_array;
|
||||
in_addr m_aprsAddress;
|
||||
unsigned int m_aprsPort;
|
||||
CUDPReaderWriter m_aprsSocket;
|
||||
#if defined(USE_GPSD)
|
||||
bool m_gpsdEnabled;
|
||||
wxString m_gpsdAddress;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2010-2015,2018,2020 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2010-2015,2018,2020,2023 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -116,21 +116,19 @@ const wxString KEY_IRCDDB_ENABLED1 = wxT("ircddbEnabled");
|
|||
const wxString KEY_IRCDDB_HOSTNAME1 = wxT("ircddbHostname");
|
||||
const wxString KEY_IRCDDB_USERNAME1 = wxT("ircddbUsername");
|
||||
const wxString KEY_IRCDDB_PASSWORD1 = wxT("ircddbPassword");
|
||||
const wxString KEY_IRCDDB_ENABLED2 = wxT("ircddbEnabled2");
|
||||
const wxString KEY_IRCDDB_ENABLED2 = wxT("ircddbEnabled2");
|
||||
const wxString KEY_IRCDDB_HOSTNAME2 = wxT("ircddbHostname2");
|
||||
const wxString KEY_IRCDDB_USERNAME2 = wxT("ircddbUsername2");
|
||||
const wxString KEY_IRCDDB_PASSWORD2 = wxT("ircddbPassword2");
|
||||
const wxString KEY_IRCDDB_ENABLED3 = wxT("ircddbEnabled3");
|
||||
const wxString KEY_IRCDDB_ENABLED3 = wxT("ircddbEnabled3");
|
||||
const wxString KEY_IRCDDB_HOSTNAME3 = wxT("ircddbHostname3");
|
||||
const wxString KEY_IRCDDB_USERNAME3 = wxT("ircddbUsername3");
|
||||
const wxString KEY_IRCDDB_PASSWORD3 = wxT("ircddbPassword3");
|
||||
const wxString KEY_IRCDDB_ENABLED4 = wxT("ircddbEnabled4");
|
||||
const wxString KEY_IRCDDB_ENABLED4 = wxT("ircddbEnabled4");
|
||||
const wxString KEY_IRCDDB_HOSTNAME4 = wxT("ircddbHostname4");
|
||||
const wxString KEY_IRCDDB_USERNAME4 = wxT("ircddbUsername4");
|
||||
const wxString KEY_IRCDDB_PASSWORD4 = wxT("ircddbPassword4");
|
||||
const wxString KEY_APRS_ENABLED = wxT("aprsEnabled");
|
||||
const wxString KEY_APRS_ADDRESS = wxT("aprsAddress");
|
||||
const wxString KEY_APRS_PORT = wxT("aprsPort");
|
||||
const wxString KEY_DEXTRA_ENABLED = wxT("dextraEnabled");
|
||||
const wxString KEY_DEXTRA_MAXDONGLES = wxT("dextraMaxDongles");
|
||||
const wxString KEY_DPLUS_ENABLED = wxT("dplusEnabled");
|
||||
|
|
@ -139,7 +137,7 @@ const wxString KEY_DPLUS_LOGIN = wxT("dplusLogin");
|
|||
const wxString KEY_DCS_ENABLED = wxT("dcsEnabled");
|
||||
const wxString KEY_CCS_ENABLED = wxT("ccsEnabled");
|
||||
const wxString KEY_CCS_HOST = wxT("ccsHost");
|
||||
const wxString KEY_XLX_ENABLED = wxT("xlxEnabled");
|
||||
const wxString KEY_XLX_ENABLED = wxT("xlxEnabled");
|
||||
const wxString KEY_XLX_HOSTS_FILE_URL = wxT("xlxHostsFileUrl");
|
||||
const wxString KEY_STARNET_BAND1 = wxT("starNetBand1");
|
||||
const wxString KEY_STARNET_CALLSIGN1 = wxT("starNetCallsign1");
|
||||
|
|
@ -203,6 +201,9 @@ const wxString KEY_DTMF_ENABLED = wxT("dtmfEnabled");
|
|||
const wxString KEY_GPSD_ENABLED = wxT("gpsdEnabled");
|
||||
const wxString KEY_GPSD_ADDRESS = wxT("gpsdAddress");
|
||||
const wxString KEY_GPSD_PORT = wxT("gpsdPort");
|
||||
const wxString KEY_MQTT_ADDRESS = wxT("mqttAddress");
|
||||
const wxString KEY_MQTT_PORT = wxT("mqttPort");
|
||||
const wxString KEY_MQTT_KEEPALIVE = wxT("mqttKeepalive");
|
||||
const wxString KEY_WINDOW_X = wxT("windowX");
|
||||
const wxString KEY_WINDOW_Y = wxT("windowY");
|
||||
|
||||
|
|
@ -240,21 +241,19 @@ const bool DEFAULT_IRCDDB_ENABLED1 = true;
|
|||
const wxString DEFAULT_IRCDDB_HOSTNAME1 = wxT("group1-irc.ircddb.net");
|
||||
const wxString DEFAULT_IRCDDB_USERNAME1 = wxEmptyString;
|
||||
const wxString DEFAULT_IRCDDB_PASSWORD1 = wxEmptyString;
|
||||
const bool DEFAULT_IRCDDB_ENABLED2 = true;
|
||||
const wxString DEFAULT_IRCDDB_HOSTNAME2 = wxT("rr.openquad.net");
|
||||
const wxString DEFAULT_IRCDDB_USERNAME2 = wxEmptyString;
|
||||
const wxString DEFAULT_IRCDDB_PASSWORD2 = wxEmptyString;
|
||||
const bool DEFAULT_IRCDDB_ENABLED3 = false;
|
||||
const bool DEFAULT_IRCDDB_ENABLED2 = true;
|
||||
const wxString DEFAULT_IRCDDB_HOSTNAME2 = wxT("rr.openquad.net");
|
||||
const wxString DEFAULT_IRCDDB_USERNAME2 = wxEmptyString;
|
||||
const wxString DEFAULT_IRCDDB_PASSWORD2 = wxEmptyString;
|
||||
const bool DEFAULT_IRCDDB_ENABLED3 = false;
|
||||
const wxString DEFAULT_IRCDDB_HOSTNAME3 = wxEmptyString;
|
||||
const wxString DEFAULT_IRCDDB_USERNAME3 = wxEmptyString;
|
||||
const wxString DEFAULT_IRCDDB_PASSWORD3 = wxEmptyString;
|
||||
const bool DEFAULT_IRCDDB_ENABLED4 = false;
|
||||
const wxString DEFAULT_IRCDDB_HOSTNAME4 = wxEmptyString;
|
||||
const wxString DEFAULT_IRCDDB_USERNAME4 = wxEmptyString;
|
||||
const wxString DEFAULT_IRCDDB_PASSWORD4 = wxEmptyString;
|
||||
const wxString DEFAULT_IRCDDB_USERNAME3 = wxEmptyString;
|
||||
const wxString DEFAULT_IRCDDB_PASSWORD3 = wxEmptyString;
|
||||
const bool DEFAULT_IRCDDB_ENABLED4 = false;
|
||||
const wxString DEFAULT_IRCDDB_HOSTNAME4 = wxEmptyString;
|
||||
const wxString DEFAULT_IRCDDB_USERNAME4 = wxEmptyString;
|
||||
const wxString DEFAULT_IRCDDB_PASSWORD4 = wxEmptyString;
|
||||
const bool DEFAULT_APRS_ENABLED = false;
|
||||
const wxString DEFAULT_APRS_ADDRESS = wxT("127.0.0.1");
|
||||
const unsigned int DEFAULT_APRS_PORT = 8673U;
|
||||
const bool DEFAULT_DEXTRA_ENABLED = true;
|
||||
const unsigned int DEFAULT_DEXTRA_MAXDONGLES = 5U;
|
||||
const bool DEFAULT_DPLUS_ENABLED = false;
|
||||
|
|
@ -263,7 +262,7 @@ const wxString DEFAULT_DPLUS_LOGIN = wxEmptyString;
|
|||
const bool DEFAULT_DCS_ENABLED = true;
|
||||
const bool DEFAULT_CCS_ENABLED = true;
|
||||
const wxString DEFAULT_CCS_HOST = wxT("CCS704 ");
|
||||
const bool DEFAULT_XLX_ENABLED = true;
|
||||
const bool DEFAULT_XLX_ENABLED = true;
|
||||
const wxString DEFAULT_XLX_HOSTS_FILE_URL = wxT("http://xlxapi.rlx.lu/api.php?do=GetXLXDMRMaster");//we use the XLXDMRMaster list because it starts with XLX instead of DCS, XRF etc ....
|
||||
const wxString DEFAULT_STARNET_BAND = wxEmptyString;
|
||||
const wxString DEFAULT_STARNET_CALLSIGN = wxEmptyString;
|
||||
|
|
@ -287,6 +286,9 @@ const bool DEFAULT_DTMF_ENABLED = true;
|
|||
const bool DEFAULT_GPSD_ENABLED = false;
|
||||
const wxString DEFAULT_GPSD_ADDRESS = wxT("127.0.0.1");
|
||||
const wxString DEFAULT_GPSD_PORT = wxT("2947");
|
||||
const wxString DEFAULT_MQTT_ADDRESS = wxT("127.0.0.1");
|
||||
const unsigned short DEFAULT_MQTT_PORT = 1883U;
|
||||
const unsigned int DEFAULT_MQTT_KEEPALIVE = 60U;
|
||||
const int DEFAULT_WINDOW_X = -1;
|
||||
const int DEFAULT_WINDOW_Y = -1;
|
||||
|
||||
|
|
@ -406,8 +408,6 @@ m_ircddbHostname4(DEFAULT_IRCDDB_HOSTNAME4),
|
|||
m_ircddbUsername4(DEFAULT_IRCDDB_USERNAME4),
|
||||
m_ircddbPassword4(DEFAULT_IRCDDB_PASSWORD4),
|
||||
m_aprsEnabled(DEFAULT_APRS_ENABLED),
|
||||
m_aprsAddress(DEFAULT_APRS_ADDRESS),
|
||||
m_aprsPort(DEFAULT_APRS_PORT),
|
||||
m_dextraEnabled(DEFAULT_DEXTRA_ENABLED),
|
||||
m_dextraMaxDongles(DEFAULT_DEXTRA_MAXDONGLES),
|
||||
m_dplusEnabled(DEFAULT_DPLUS_ENABLED),
|
||||
|
|
@ -480,6 +480,9 @@ m_dtmfEnabled(DEFAULT_DTMF_ENABLED),
|
|||
m_gpsdEnabled(DEFAULT_GPSD_ENABLED),
|
||||
m_gpsdAddress(DEFAULT_GPSD_ADDRESS),
|
||||
m_gpsdPort(DEFAULT_GPSD_PORT),
|
||||
m_mqttAddress(DEFAULT_MQTT_ADDRESS),
|
||||
m_mqttPort(DEFAULT_MQTT_PORT),
|
||||
m_mqttKeepalive(DEFAULT_MQTT_KEEPALIVE),
|
||||
m_x(DEFAULT_WINDOW_X),
|
||||
m_y(DEFAULT_WINDOW_Y)
|
||||
{
|
||||
|
|
@ -729,11 +732,6 @@ m_y(DEFAULT_WINDOW_Y)
|
|||
|
||||
m_config->Read(m_name + KEY_APRS_ENABLED, &m_aprsEnabled, DEFAULT_APRS_ENABLED);
|
||||
|
||||
m_config->Read(m_name + KEY_APRS_ADDRESS, &m_aprsAddress, DEFAULT_APRS_ADDRESS);
|
||||
|
||||
m_config->Read(m_name + KEY_APRS_PORT, &temp, long(DEFAULT_APRS_PORT));
|
||||
m_aprsPort = (unsigned int)temp;
|
||||
|
||||
m_config->Read(m_name + KEY_DEXTRA_ENABLED, &m_dextraEnabled, DEFAULT_DEXTRA_ENABLED);
|
||||
|
||||
m_config->Read(m_name + KEY_DEXTRA_MAXDONGLES, &temp, long(DEFAULT_DEXTRA_MAXDONGLES));
|
||||
|
|
@ -900,6 +898,14 @@ m_y(DEFAULT_WINDOW_Y)
|
|||
m_config->Read(m_name + KEY_GPSD_PORT, &temp, long(DEFAULT_GPSD_PORT));
|
||||
m_gpsdPort = (unsigned int)temp;
|
||||
|
||||
m_config->Read(m_name + KEY_MQTT_ADDRESS, &m_mqttAddress, DEFAULT_MQTT_ADDRESS);
|
||||
|
||||
m_config->Read(m_name + KEY_MQTT_PORT, &temp, long(DEFAULT_MQTT_PORT));
|
||||
m_mqttPort = (unsigned short)temp;
|
||||
|
||||
m_config->Read(m_name + KEY_MQTT_KEEPALIVE, &temp, long(DEFAULT_MQTT_KEEPALIVE));
|
||||
m_mqttKeepalive = (unsigned int)temp;
|
||||
|
||||
m_config->Read(m_name + KEY_WINDOW_X, &temp, long(DEFAULT_WINDOW_X));
|
||||
m_x = int(temp);
|
||||
|
||||
|
|
@ -1025,8 +1031,6 @@ m_ircddbHostname4(DEFAULT_IRCDDB_HOSTNAME4),
|
|||
m_ircddbUsername4(DEFAULT_IRCDDB_USERNAME4),
|
||||
m_ircddbPassword4(DEFAULT_IRCDDB_PASSWORD4),
|
||||
m_aprsEnabled(DEFAULT_APRS_ENABLED),
|
||||
m_aprsAddress(DEFAULT_APRS_ADDRESS),
|
||||
m_aprsPort(DEFAULT_APRS_PORT),
|
||||
m_dextraEnabled(DEFAULT_DEXTRA_ENABLED),
|
||||
m_dextraMaxDongles(DEFAULT_DEXTRA_MAXDONGLES),
|
||||
m_dplusEnabled(DEFAULT_DPLUS_ENABLED),
|
||||
|
|
@ -1099,6 +1103,9 @@ m_dtmfEnabled(DEFAULT_DTMF_ENABLED),
|
|||
m_gpsdEnabled(DEFAULT_GPSD_ENABLED),
|
||||
m_gpsdAddress(DEFAULT_GPSD_ADDRESS),
|
||||
m_gpsdPort(DEFAULT_GPSD_PORT),
|
||||
m_mqttAddress(DEFAULT_MQTT_ADDRESS),
|
||||
m_mqttPort(DEFAULT_MQTT_PORT),
|
||||
m_mqttKeepalive(DEFAULT_MQTT_KEEPALIVE),
|
||||
m_x(DEFAULT_WINDOW_X),
|
||||
m_y(DEFAULT_WINDOW_Y)
|
||||
{
|
||||
|
|
@ -1396,11 +1403,6 @@ m_y(DEFAULT_WINDOW_Y)
|
|||
} else if (key.IsSameAs(KEY_APRS_ENABLED)) {
|
||||
val.ToLong(&temp1);
|
||||
m_aprsEnabled = temp1 == 1L;
|
||||
} else if (key.IsSameAs(KEY_APRS_ADDRESS)) {
|
||||
m_aprsAddress = val;
|
||||
} else if (key.IsSameAs(KEY_APRS_PORT)) {
|
||||
val.ToULong(&temp2);
|
||||
m_aprsPort = (unsigned int)temp2;
|
||||
} else if (key.IsSameAs(KEY_DEXTRA_ENABLED)) {
|
||||
val.ToLong(&temp1);
|
||||
m_dextraEnabled = temp1 == 1L;
|
||||
|
|
@ -1581,6 +1583,14 @@ m_y(DEFAULT_WINDOW_Y)
|
|||
m_gpsdAddress = val;
|
||||
} else if (key.IsSameAs(KEY_GPSD_PORT)) {
|
||||
m_gpsdPort = val;
|
||||
} else if (key.IsSameAs(KEY_MQTT_ADDRESS)) {
|
||||
m_mqttAddress = val;
|
||||
} else if (key.IsSameAs(KEY_MQTT_PORT)) {
|
||||
val.ToULong(&temp2);
|
||||
m_mqttPort = (unsigned short)temp2;
|
||||
} else if (key.IsSameAs(KEY_MQTT_KEEPALIVE)) {
|
||||
val.ToULong(&temp2);
|
||||
m_mqttKeepalive = (unsigned int)temp2;
|
||||
} else if (key.IsSameAs(KEY_WINDOW_X)) {
|
||||
val.ToLong(&temp1);
|
||||
m_x = int(temp1);
|
||||
|
|
@ -1888,18 +1898,14 @@ void CIRCDDBGatewayConfig::setIrcDDB4(bool enabled, const wxString& hostname, co
|
|||
m_ircddbPassword4 = password;
|
||||
}
|
||||
|
||||
void CIRCDDBGatewayConfig::getDPRS(bool& enabled, wxString& address, unsigned int& port) const
|
||||
void CIRCDDBGatewayConfig::getDPRS(bool& enabled) const
|
||||
{
|
||||
enabled = m_aprsEnabled;
|
||||
address = m_aprsAddress;
|
||||
port = m_aprsPort;
|
||||
}
|
||||
|
||||
void CIRCDDBGatewayConfig::setDPRS(bool enabled, const wxString& address, unsigned int port)
|
||||
void CIRCDDBGatewayConfig::setDPRS(bool enabled)
|
||||
{
|
||||
m_aprsEnabled = enabled;
|
||||
m_aprsAddress = address;
|
||||
m_aprsPort = port;
|
||||
m_aprsEnabled = enabled;
|
||||
}
|
||||
|
||||
void CIRCDDBGatewayConfig::getDExtra(bool& enabled, unsigned int& maxDongles) const
|
||||
|
|
@ -2212,6 +2218,13 @@ void CIRCDDBGatewayConfig::setGPSD(bool enabled, const wxString& address, const
|
|||
m_gpsdPort = port;
|
||||
}
|
||||
|
||||
void CIRCDDBGatewayConfig::getMQTT(wxString& address, unsigned short& port, unsigned int& keepalive) const
|
||||
{
|
||||
address = m_mqttAddress;
|
||||
port = m_mqttPort;
|
||||
keepalive = m_mqttKeepalive;
|
||||
}
|
||||
|
||||
void CIRCDDBGatewayConfig::getPosition(int& x, int& y) const
|
||||
{
|
||||
x = m_x;
|
||||
|
|
@ -2379,8 +2392,6 @@ bool CIRCDDBGatewayConfig::write()
|
|||
m_config->Write(m_name + KEY_IRCDDB_USERNAME4, m_ircddbUsername4);
|
||||
m_config->Write(m_name + KEY_IRCDDB_PASSWORD4, m_ircddbPassword4);
|
||||
m_config->Write(m_name + KEY_APRS_ENABLED, m_aprsEnabled);
|
||||
m_config->Write(m_name + KEY_APRS_ADDRESS, m_aprsAddress);
|
||||
m_config->Write(m_name + KEY_APRS_PORT, long(m_aprsPort));
|
||||
m_config->Write(m_name + KEY_DEXTRA_ENABLED, m_dextraEnabled);
|
||||
m_config->Write(m_name + KEY_DEXTRA_MAXDONGLES, long(m_dextraMaxDongles));
|
||||
m_config->Write(m_name + KEY_DPLUS_ENABLED, m_dplusEnabled);
|
||||
|
|
@ -2453,6 +2464,9 @@ bool CIRCDDBGatewayConfig::write()
|
|||
m_config->Write(m_name + KEY_GPSD_ENABLED, m_gpsdEnabled);
|
||||
m_config->Write(m_name + KEY_GPSD_ADDRESS, m_gpsdAddress);
|
||||
m_config->Write(m_name + KEY_GPSD_PORT, m_gpsdPort);
|
||||
m_config->Write(m_name + KEY_MQTT_ADDRESS, m_mqttAddress);
|
||||
m_config->Write(m_name + KEY_MQTT_PORT, long(m_mqttPort));
|
||||
m_config->Write(m_name + KEY_MQTT_KEEPALIVE, long(m_mqttKeepalive));
|
||||
m_config->Write(m_name + KEY_WINDOW_X, long(m_x));
|
||||
m_config->Write(m_name + KEY_WINDOW_Y, long(m_y));
|
||||
m_config->Flush();
|
||||
|
|
@ -2588,8 +2602,6 @@ bool CIRCDDBGatewayConfig::write()
|
|||
buffer.Printf("%s=%s", KEY_IRCDDB_USERNAME4.c_str(), m_ircddbUsername4.c_str()); file.AddLine(buffer);
|
||||
buffer.Printf("%s=%s", KEY_IRCDDB_PASSWORD4.c_str(), m_ircddbPassword4.c_str()); file.AddLine(buffer);
|
||||
buffer.Printf(wxT("%s=%d"), KEY_APRS_ENABLED.c_str(), m_aprsEnabled ? 1 : 0); file.AddLine(buffer);
|
||||
buffer.Printf(wxT("%s=%s"), KEY_APRS_ADDRESS.c_str(), m_aprsAddress.c_str()); file.AddLine(buffer);
|
||||
buffer.Printf(wxT("%s=%u"), KEY_APRS_PORT.c_str(), m_aprsPort); file.AddLine(buffer);
|
||||
buffer.Printf(wxT("%s=%d"), KEY_DEXTRA_ENABLED.c_str(), m_dextraEnabled ? 1 : 0); file.AddLine(buffer);
|
||||
buffer.Printf(wxT("%s=%u"), KEY_DEXTRA_MAXDONGLES.c_str(), m_dextraMaxDongles); file.AddLine(buffer);
|
||||
buffer.Printf(wxT("%s=%d"), KEY_DPLUS_ENABLED.c_str(), m_dplusEnabled ? 1 : 0); file.AddLine(buffer);
|
||||
|
|
@ -2662,6 +2674,9 @@ bool CIRCDDBGatewayConfig::write()
|
|||
buffer.Printf(wxT("%s=%d"), KEY_GPSD_ENABLED.c_str(), m_gpsdEnabled ? 1 : 0); file.AddLine(buffer);
|
||||
buffer.Printf(wxT("%s=%s"), KEY_GPSD_ADDRESS.c_str(), m_gpsdAddress.c_str()); file.AddLine(buffer);
|
||||
buffer.Printf(wxT("%s=%s"), KEY_GPSD_PORT.c_str(), m_gpsdPort.c_str()); file.AddLine(buffer);
|
||||
buffer.Printf(wxT("%s=%s"), KEY_MQTT_ADDRESS.c_str(), m_mqttAddress.c_str()); file.AddLine(buffer);
|
||||
buffer.Printf(wxT("%s=%u"), KEY_MQTT_PORT.c_str(), m_mqttPort); file.AddLine(buffer);
|
||||
buffer.Printf(wxT("%s=%u"), KEY_MQTT_KEEPALIVE.c_str(), m_mqttKeepalive); file.AddLine(buffer);
|
||||
buffer.Printf(wxT("%s=%d"), KEY_WINDOW_X.c_str(), m_x); file.AddLine(buffer);
|
||||
buffer.Printf(wxT("%s=%d"), KEY_WINDOW_Y.c_str(), m_y); file.AddLine(buffer);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2010-2014,2018,2020 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2010-2014,2018,2020,2023 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -59,8 +59,8 @@ public:
|
|||
void setIrcDDB3(bool enabled, const wxString& hostname, const wxString& username, const wxString& password);
|
||||
void setIrcDDB4(bool enabled, const wxString& hostname, const wxString& username, const wxString& password);
|
||||
|
||||
void getDPRS(bool& enabled, wxString& address, unsigned int& port) const;
|
||||
void setDPRS(bool enabled, const wxString& address, unsigned int port);
|
||||
void getDPRS(bool& enabled) const;
|
||||
void setDPRS(bool enabled);
|
||||
|
||||
void getDExtra(bool& enabled, unsigned int& maxDongles) const;
|
||||
void setDExtra(bool enabled, unsigned int maxDongles);
|
||||
|
|
@ -118,6 +118,8 @@ public:
|
|||
void getPosition(int& x, int& y) const;
|
||||
void setPosition(int x, int y);
|
||||
|
||||
void getMQTT(wxString& address, unsigned short& port, unsigned int& keepalive) const;
|
||||
|
||||
bool write();
|
||||
|
||||
private:
|
||||
|
|
@ -235,8 +237,6 @@ private:
|
|||
wxString m_ircddbUsername4;
|
||||
wxString m_ircddbPassword4;
|
||||
bool m_aprsEnabled;
|
||||
wxString m_aprsAddress;
|
||||
unsigned int m_aprsPort;
|
||||
bool m_dextraEnabled;
|
||||
unsigned int m_dextraMaxDongles;
|
||||
bool m_dplusEnabled;
|
||||
|
|
@ -310,6 +310,9 @@ private:
|
|||
bool m_gpsdEnabled;
|
||||
wxString m_gpsdAddress;
|
||||
wxString m_gpsdPort;
|
||||
wxString m_mqttAddress;
|
||||
unsigned short m_mqttPort;
|
||||
unsigned int m_mqttKeepalive;
|
||||
int m_x;
|
||||
int m_y;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2002,2003,2009,2011,2012,2019 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2002,2003,2009,2011,2012,2019,2023 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -17,49 +17,24 @@
|
|||
*/
|
||||
|
||||
#include "Logger.h"
|
||||
#include "MQTTLog.h"
|
||||
|
||||
CLogger::CLogger(const wxString& directory, const wxString& name) :
|
||||
wxLog(),
|
||||
m_name(name),
|
||||
m_file(NULL),
|
||||
m_fileName(),
|
||||
m_day(0)
|
||||
// In MQTTLog.cpp
|
||||
extern CMQTTConnection* m_mqtt;
|
||||
|
||||
CLogger::CLogger() :
|
||||
wxLog()
|
||||
{
|
||||
m_file = new wxFFile;
|
||||
|
||||
m_fileName.SetPath(directory);
|
||||
m_fileName.SetExt(wxT("log"));
|
||||
|
||||
time_t timestamp;
|
||||
::time(×tamp);
|
||||
struct tm* tm = ::gmtime(×tamp);
|
||||
|
||||
wxString text;
|
||||
text.Printf(wxT("%s-%04d-%02d-%02d"), m_name.c_str(), tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday);
|
||||
|
||||
m_day = tm->tm_yday;
|
||||
m_fileName.SetName(text);
|
||||
|
||||
bool ret = m_file->Open(m_fileName.GetFullPath(), wxT("a+t"));
|
||||
if (!ret) {
|
||||
wxLogError(wxT("Cannot open %s file for appending"), m_fileName.GetFullPath().c_str());
|
||||
return;
|
||||
}
|
||||
MQTTLogInitialise();
|
||||
}
|
||||
|
||||
CLogger::~CLogger()
|
||||
{
|
||||
wxASSERT(m_file != NULL);
|
||||
|
||||
m_file->Close();
|
||||
delete m_file;
|
||||
MQTTLogFinalise();
|
||||
}
|
||||
|
||||
void CLogger::DoLogRecord(wxLogLevel level, const wxString& msg, const wxLogRecordInfo& info)
|
||||
{
|
||||
wxASSERT(m_file != NULL);
|
||||
wxASSERT(m_file->IsOpened());
|
||||
|
||||
wxString letter;
|
||||
|
||||
switch (level) {
|
||||
|
|
@ -79,38 +54,10 @@ void CLogger::DoLogRecord(wxLogLevel level, const wxString& msg, const wxLogReco
|
|||
wxString message;
|
||||
message.Printf(wxT("%s: %04d-%02d-%02d %02d:%02d:%02d: %s\n"), letter.c_str(), tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, msg.c_str());
|
||||
|
||||
writeLog(message.c_str(), info.timestamp);
|
||||
if (m_mqtt != NULL)
|
||||
m_mqtt->publish("log", message.c_str());
|
||||
|
||||
if (level == wxLOG_FatalError)
|
||||
::abort();
|
||||
}
|
||||
|
||||
void CLogger::writeLog(const wxChar* msg, time_t timestamp)
|
||||
{
|
||||
wxASSERT(m_file != NULL);
|
||||
wxASSERT(m_file->IsOpened());
|
||||
wxASSERT(msg != NULL);
|
||||
|
||||
struct tm* tm = ::gmtime(×tamp);
|
||||
|
||||
int day = tm->tm_yday;
|
||||
if (day != m_day) {
|
||||
wxString text;
|
||||
text.Printf(wxT("%s-%04d-%02d-%02d"), m_name.c_str(), tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday);
|
||||
|
||||
m_day = day;
|
||||
m_fileName.SetName(text);
|
||||
|
||||
m_file->Close();
|
||||
|
||||
bool ret = m_file->Open(m_fileName.GetFullPath(), wxT("a+t"));
|
||||
if (!ret) {
|
||||
wxLogError(wxT("Cannot open %s file for appending"), m_fileName.GetFullPath().c_str());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
m_file->Write(wxString(msg));
|
||||
m_file->Flush();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2002,2003,2009,2011,2012,2019 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2002,2003,2009,2011,2012,2019,2023 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -20,23 +20,15 @@
|
|||
#define Logger_H
|
||||
|
||||
#include <wx/wx.h>
|
||||
#include <wx/ffile.h>
|
||||
#include <wx/filename.h>
|
||||
|
||||
class CLogger : public wxLog {
|
||||
public:
|
||||
CLogger(const wxString& directory, const wxString& name);
|
||||
CLogger();
|
||||
virtual ~CLogger();
|
||||
|
||||
virtual void DoLogRecord(wxLogLevel level, const wxString& msg, const wxLogRecordInfo& info);
|
||||
|
||||
private:
|
||||
wxString m_name;
|
||||
wxFFile* m_file;
|
||||
wxFileName m_fileName;
|
||||
int m_day;
|
||||
|
||||
void writeLog(const wxChar* msg, time_t timestamp);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
211
Common/MQTTConnection.cpp
Normal file
211
Common/MQTTConnection.cpp
Normal file
|
|
@ -0,0 +1,211 @@
|
|||
/*
|
||||
* Copyright (C) 2022,2023 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include "MQTTConnection.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
|
||||
CMQTTConnection::CMQTTConnection(const wxString& host, unsigned short port, const wxString& name, const std::vector<std::pair<wxString, void (*)(const unsigned char*, unsigned int)>>& subs, unsigned int keepalive, MQTT_QOS qos) :
|
||||
m_host(host),
|
||||
m_port(port),
|
||||
m_name(name),
|
||||
m_subs(subs),
|
||||
m_keepalive(keepalive),
|
||||
m_qos(qos),
|
||||
m_mosq(NULL),
|
||||
m_connected(false)
|
||||
{
|
||||
assert(!host.IsEmpty());
|
||||
assert(port > 0U);
|
||||
assert(!name.IsEmpty());
|
||||
assert(keepalive >= 5U);
|
||||
|
||||
::mosquitto_lib_init();
|
||||
}
|
||||
|
||||
CMQTTConnection::~CMQTTConnection()
|
||||
{
|
||||
::mosquitto_lib_cleanup();
|
||||
}
|
||||
|
||||
bool CMQTTConnection::open()
|
||||
{
|
||||
m_mosq = ::mosquitto_new(m_name.c_str(), true, this);
|
||||
if (m_mosq == NULL){
|
||||
::fprintf(stderr, "MQTT Error newing: Out of memory.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
::mosquitto_connect_callback_set(m_mosq, onConnect);
|
||||
::mosquitto_subscribe_callback_set(m_mosq, onSubscribe);
|
||||
::mosquitto_message_callback_set(m_mosq, onMessage);
|
||||
::mosquitto_disconnect_callback_set(m_mosq, onDisconnect);
|
||||
|
||||
int rc = ::mosquitto_connect(m_mosq, m_host.c_str(), m_port, m_keepalive);
|
||||
if (rc != MOSQ_ERR_SUCCESS) {
|
||||
::mosquitto_destroy(m_mosq);
|
||||
m_mosq = NULL;
|
||||
::fprintf(stderr, "MQTT Error connecting: %s\n", ::mosquitto_strerror(rc));
|
||||
return false;
|
||||
}
|
||||
|
||||
rc = ::mosquitto_loop_start(m_mosq);
|
||||
if (rc != MOSQ_ERR_SUCCESS) {
|
||||
::mosquitto_disconnect(m_mosq);
|
||||
::mosquitto_destroy(m_mosq);
|
||||
m_mosq = NULL;
|
||||
::fprintf(stderr, "MQTT Error loop starting: %s\n", ::mosquitto_strerror(rc));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CMQTTConnection::publish(const char* topic, const char* text)
|
||||
{
|
||||
assert(topic != NULL);
|
||||
assert(text != NULL);
|
||||
|
||||
return publish(topic, (unsigned char*)text, ::strlen(text));
|
||||
}
|
||||
|
||||
bool CMQTTConnection::publish(const char* topic, const std::string& text)
|
||||
{
|
||||
assert(topic != NULL);
|
||||
|
||||
return publish(topic, (unsigned char*)text.c_str(), text.size());
|
||||
}
|
||||
|
||||
bool CMQTTConnection::publish(const char* topic, const unsigned char* data, unsigned int len)
|
||||
{
|
||||
assert(topic != NULL);
|
||||
assert(data != NULL);
|
||||
|
||||
if (!m_connected)
|
||||
return false;
|
||||
|
||||
if (::strchr(topic, '/') == NULL) {
|
||||
char topicEx[100U];
|
||||
::sprintf(topicEx, "%s/%s", (char*)m_name.char_str(), topic);
|
||||
|
||||
int rc = ::mosquitto_publish(m_mosq, NULL, topicEx, len, data, static_cast<int>(m_qos), false);
|
||||
if (rc != MOSQ_ERR_SUCCESS) {
|
||||
::fprintf(stderr, "MQTT Error publishing: %s\n", ::mosquitto_strerror(rc));
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
int rc = ::mosquitto_publish(m_mosq, NULL, topic, len, data, static_cast<int>(m_qos), false);
|
||||
if (rc != MOSQ_ERR_SUCCESS) {
|
||||
::fprintf(stderr, "MQTT Error publishing: %s\n", ::mosquitto_strerror(rc));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CMQTTConnection::close()
|
||||
{
|
||||
if (m_mosq != NULL) {
|
||||
::mosquitto_disconnect(m_mosq);
|
||||
::mosquitto_destroy(m_mosq);
|
||||
m_mosq = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void CMQTTConnection::onConnect(mosquitto* mosq, void* obj, int rc)
|
||||
{
|
||||
assert(mosq != NULL);
|
||||
assert(obj != NULL);
|
||||
|
||||
::fprintf(stdout, "MQTT: on_connect: %s\n", ::mosquitto_connack_string(rc));
|
||||
if (rc != 0) {
|
||||
::mosquitto_disconnect(mosq);
|
||||
return;
|
||||
}
|
||||
|
||||
CMQTTConnection* p = static_cast<CMQTTConnection*>(obj);
|
||||
p->m_connected = true;
|
||||
|
||||
for (std::vector<std::pair<wxString, void (*)(const unsigned char*, unsigned int)>>::const_iterator it = p->m_subs.cbegin(); it != p->m_subs.cend(); ++it) {
|
||||
wxString topic = (*it).first;
|
||||
|
||||
if (topic.find_first_of('/') == std::string::npos) {
|
||||
char topicEx[100U];
|
||||
::sprintf(topicEx, "%s/%s", (char*)p->m_name.char_str(), (char*)topic.char_str());
|
||||
|
||||
rc = ::mosquitto_subscribe(mosq, NULL, topicEx, static_cast<int>(p->m_qos));
|
||||
if (rc != MOSQ_ERR_SUCCESS) {
|
||||
::fprintf(stderr, "MQTT: error subscribing to %s - %s\n", topicEx, ::mosquitto_strerror(rc));
|
||||
::mosquitto_disconnect(mosq);
|
||||
}
|
||||
} else {
|
||||
rc = ::mosquitto_subscribe(mosq, NULL, topic.c_str(), static_cast<int>(p->m_qos));
|
||||
if (rc != MOSQ_ERR_SUCCESS) {
|
||||
::fprintf(stderr, "MQTT: error subscribing to %s - %s\n", (char*)topic.char_str(), ::mosquitto_strerror(rc));
|
||||
::mosquitto_disconnect(mosq);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CMQTTConnection::onSubscribe(mosquitto* mosq, void* obj, int mid, int qosCount, const int* grantedQOS)
|
||||
{
|
||||
assert(mosq != NULL);
|
||||
assert(obj != NULL);
|
||||
assert(grantedQOS != NULL);
|
||||
|
||||
for (int i = 0; i < qosCount; i++)
|
||||
::fprintf(stdout, "MQTT: on_subscribe: %d:%d\n", i, grantedQOS[i]);
|
||||
}
|
||||
|
||||
void CMQTTConnection::onMessage(mosquitto* mosq, void* obj, const mosquitto_message* message)
|
||||
{
|
||||
assert(mosq != NULL);
|
||||
assert(obj != NULL);
|
||||
assert(message != NULL);
|
||||
|
||||
CMQTTConnection* p = static_cast<CMQTTConnection*>(obj);
|
||||
|
||||
for (std::vector<std::pair<wxString, void (*)(const unsigned char*, unsigned int)>>::const_iterator it = p->m_subs.cbegin(); it != p->m_subs.cend(); ++it) {
|
||||
wxString topic = (*it).first;
|
||||
|
||||
char topicEx[100U];
|
||||
::sprintf(topicEx, "%s/%s", (char*)p->m_name.char_str(), (char*)topic.char_str());
|
||||
|
||||
if (::strcmp(topicEx, message->topic) == 0) {
|
||||
(*it).second((unsigned char*)message->payload, message->payloadlen);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CMQTTConnection::onDisconnect(mosquitto* mosq, void* obj, int rc)
|
||||
{
|
||||
assert(mosq != NULL);
|
||||
assert(obj != NULL);
|
||||
|
||||
::fprintf(stdout, "MQTT: on_disconnect: %s\n", ::mosquitto_reason_string(rc));
|
||||
|
||||
CMQTTConnection* p = static_cast<CMQTTConnection*>(obj);
|
||||
p->m_connected = false;
|
||||
}
|
||||
|
||||
65
Common/MQTTConnection.h
Normal file
65
Common/MQTTConnection.h
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
* Copyright (C) 2022,2023 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#if !defined(MQTTPUBLISHER_H)
|
||||
#define MQTTPUBLISHER_H
|
||||
|
||||
#include <wx/wx.h>
|
||||
|
||||
#include <mosquitto.h>
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
enum MQTT_QOS {
|
||||
MQTT_QOS_AT_MODE_ONCE = 0U,
|
||||
MQTT_QOS_AT_LEAST_ONCE = 1U,
|
||||
MQTT_QOS_EXACTLY_ONCE = 2U
|
||||
};
|
||||
|
||||
class CMQTTConnection {
|
||||
public:
|
||||
CMQTTConnection(const wxString& host, unsigned short port, const wxString& name, const std::vector<std::pair<wxString, void (*)(const unsigned char*, unsigned int)>>& subs, unsigned int keepalive, MQTT_QOS qos = MQTT_QOS_EXACTLY_ONCE);
|
||||
~CMQTTConnection();
|
||||
|
||||
bool open();
|
||||
|
||||
bool publish(const char* topic, const char* text);
|
||||
bool publish(const char* topic, const std::string& text);
|
||||
bool publish(const char* topic, const unsigned char* data, unsigned int len);
|
||||
|
||||
void close();
|
||||
|
||||
private:
|
||||
wxString m_host;
|
||||
unsigned short m_port;
|
||||
wxString m_name;
|
||||
std::vector<std::pair<wxString, void (*)(const unsigned char*, unsigned int)>> m_subs;
|
||||
unsigned int m_keepalive;
|
||||
MQTT_QOS m_qos;
|
||||
mosquitto* m_mosq;
|
||||
bool m_connected;
|
||||
|
||||
static void onConnect(mosquitto* mosq, void* obj, int rc);
|
||||
static void onSubscribe(mosquitto* mosq, void* obj, int mid, int qosCount, const int* grantedQOS);
|
||||
static void onMessage(mosquitto* mosq, void* obj, const mosquitto_message* message);
|
||||
static void onDisconnect(mosquitto* mosq, void* obj, int rc);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2012,2013 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2015,2016,2020,2022,2023 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -16,27 +16,38 @@
|
|||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef StarNetServerThreadHelper_H
|
||||
#define StarNetServerThreadHelper_H
|
||||
#include "MQTTLog.h"
|
||||
|
||||
#include "StarNetServerThread.h"
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstdarg>
|
||||
#include <ctime>
|
||||
#include <cassert>
|
||||
#include <cstring>
|
||||
|
||||
#include <wx/wx.h>
|
||||
CMQTTConnection* m_mqtt = NULL;
|
||||
|
||||
class CStarNetServerThreadHelper : public wxThread {
|
||||
void MQTTLogInitialise()
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
CStarNetServerThreadHelper(CStarNetServerThread* thread);
|
||||
virtual ~CStarNetServerThreadHelper();
|
||||
void MQTTLogFinalise()
|
||||
{
|
||||
if (m_mqtt != NULL) {
|
||||
m_mqtt->close();
|
||||
delete m_mqtt;
|
||||
m_mqtt = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
virtual void start();
|
||||
void WriteJSON(const std::string& topLevel, nlohmann::json& json)
|
||||
{
|
||||
if (m_mqtt != NULL) {
|
||||
nlohmann::json top;
|
||||
|
||||
virtual void* Entry();
|
||||
top[topLevel] = json;
|
||||
|
||||
virtual void kill();
|
||||
m_mqtt->publish("json", top.dump());
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
CStarNetServerThread* m_thread;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2002,2003,2009-2011,2018 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2015,2016,2020,2022,2023 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -16,20 +16,18 @@
|
|||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef StarNetServerLogRedirect_H
|
||||
#define StarNetServerLogRedirect_H
|
||||
#if !defined(MQTTLOG_H)
|
||||
#define MQTTLOG_H
|
||||
|
||||
#include <wx/wx.h>
|
||||
#include <wx/log.h>
|
||||
#include "MQTTConnection.h"
|
||||
|
||||
class CStarNetServerLogRedirect : public wxLog {
|
||||
public:
|
||||
CStarNetServerLogRedirect();
|
||||
virtual ~CStarNetServerLogRedirect();
|
||||
#include <string>
|
||||
|
||||
virtual void DoLogRecord(wxLogLevel level, const wxString& msg, const wxLogRecordInfo& info);
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
private:
|
||||
};
|
||||
extern void MQTTLogInitialise();
|
||||
extern void MQTTLogFinalise();
|
||||
|
||||
extern void WriteJSON(const std::string& topLevel, nlohmann::json& json);
|
||||
|
||||
#endif
|
||||
|
|
@ -4,7 +4,7 @@ OBJECTS = AMBEData.o AnnouncementUnit.o APRSCollector.o APRSWriter.o AudioUnit.o
|
|||
DPlusAuthenticator.o DPlusHandler.o DPlusProtocolHandler.o DPlusProtocolHandlerPool.o DRATSServer.o DTMF.o \
|
||||
DummyRepeaterProtocolHandler.o DVTOOLFileReader.o EchoUnit.o G2Handler.o G2ProtocolHandler.o GatewayCache.o \
|
||||
HBRepeaterProtocolHandler.o HeaderData.o HeaderLogger.o HeardData.o HostFile.o IcomRepeaterProtocolHandler.o IRCDDBGatewayConfig.o \
|
||||
LogEvent.o Logger.o NatTraversalHandler.o PollData.o RemoteHandler.o RemoteLinkData.o RemoteProtocolHandler.o RemoteRepeaterData.o RemoteStarNetGroup.o \
|
||||
LogEvent.o Logger.o MQTTConnection.o MQTTLog.o NatTraversalHandler.o PollData.o RemoteHandler.o RemoteLinkData.o RemoteProtocolHandler.o RemoteRepeaterData.o RemoteStarNetGroup.o \
|
||||
RemoteStarNetUser.o RepeaterCache.o RepeaterHandler.o SHA256.o SlowDataEncoder.o StarNetHandler.o StatusData.o \
|
||||
TCPReaderWriterClient.o TCPReaderWriterServer.o TextCollector.o TextData.o Timer.o UDPReaderWriter.o UserCache.o Utils.o \
|
||||
VersionUnit.o XLXHostsFileDownloader.o
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2009,2013 Jonathan Naylor, G4KLX
|
||||
* Copyright (C) 2009,2013,2023 Jonathan Naylor, G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -13,6 +13,13 @@
|
|||
|
||||
#include "Utils.h"
|
||||
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
#include <Windows.h>
|
||||
#else
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
void CUtils::dump(const wxChar* title, const bool* data, unsigned int length)
|
||||
{
|
||||
wxASSERT(title != NULL);
|
||||
|
|
@ -255,3 +262,25 @@ void CUtils::clean(wxString &str, const wxString& allowed)
|
|||
str.SetChar(i, wxT(' '));
|
||||
}
|
||||
}
|
||||
|
||||
std::string CUtils::createTimestamp()
|
||||
{
|
||||
char buffer[100U];
|
||||
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
SYSTEMTIME st;
|
||||
::GetSystemTime(&st);
|
||||
|
||||
::sprintf(buffer, "%04u-%02u-%02u %02u:%02u:%02u.%03u", st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond, st.wMilliseconds);
|
||||
#else
|
||||
struct timeval now;
|
||||
::gettimeofday(&now, NULL);
|
||||
|
||||
struct tm* tm = ::gmtime(&now.tv_sec);
|
||||
|
||||
::sprintf(buffer, "%04d-%02d-%02d %02d:%02d:%02d.%03lld", tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, now.tv_usec / 1000LL);
|
||||
#endif
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2009,2013 by Jonathan Naylor, G4KLX
|
||||
* Copyright (C) 2009,2013,2023 by Jonathan Naylor, G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -34,6 +34,8 @@ public:
|
|||
static wxString latLonToLoc(double latitude, double longitude);
|
||||
static void clean(wxString& str, const wxString& allowed);
|
||||
|
||||
static std::string createTimestamp();
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2010-2015,2018,2019,2020 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2010-2015,2018,2019,2020,2023 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -24,9 +24,9 @@
|
|||
const wxString VENDOR_NAME = wxT("G4KLX");
|
||||
|
||||
#if defined(__WXDEBUG__)
|
||||
const wxString VERSION = wxT("20200621 - DEBUG");
|
||||
const wxString VERSION = wxT("20230718 - DEBUG");
|
||||
#else
|
||||
const wxString VERSION = wxT("20190621");
|
||||
const wxString VERSION = wxT("20230718");
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
24
Makefile
24
Makefile
|
|
@ -26,14 +26,14 @@ ifeq ($(BUILD), debug)
|
|||
else ifeq ($(BUILD), release)
|
||||
export CFLAGS := $(CFLAGS) $(RELEASEFLAGS)
|
||||
endif
|
||||
export LIBS := $(shell wx-config --libs base,net)
|
||||
export LIBS := $(shell wx-config --libs base,net) -lmosquitto
|
||||
export LDFLAGS :=
|
||||
|
||||
.PHONY: all
|
||||
all: ircDDBGateway/ircddbgatewayd APRSTransmit/aprstransmitd RemoteControl/remotecontrold \
|
||||
StarNetServer/starnetserverd TextTransmit/texttransmitd TimerControl/timercontrold TimeServer/timeserverd VoiceTransmit/voicetransmitd
|
||||
TextTransmit/texttransmitd TimerControl/timercontrold TimeServer/timeserverd VoiceTransmit/voicetransmitd
|
||||
|
||||
ircDDBGateway/ircddbgatewayd: Common/Common.a ircDDB/IRCDDB.a force
|
||||
ircDDBGateway/ircddbgatewayd: GitVersion.h Common/Common.a ircDDB/IRCDDB.a force
|
||||
$(MAKE) -C ircDDBGateway
|
||||
|
||||
APRSTransmit/aprstransmitd: Common/Common.a force
|
||||
|
|
@ -42,9 +42,6 @@ APRSTransmit/aprstransmitd: Common/Common.a force
|
|||
RemoteControl/remotecontrold: Common/Common.a force
|
||||
$(MAKE) -C RemoteControl
|
||||
|
||||
StarNetServer/starnetserverd: Common/Common.a ircDDB/IRCDDB.a force
|
||||
$(MAKE) -C StarNetServer
|
||||
|
||||
TextTransmit/texttransmitd: Common/Common.a force
|
||||
$(MAKE) -C TextTransmit
|
||||
|
||||
|
|
@ -63,6 +60,18 @@ Common/Common.a: force
|
|||
ircDDB/IRCDDB.a: force
|
||||
$(MAKE) -C ircDDB
|
||||
|
||||
Common/Common.a: GitVersion.h
|
||||
|
||||
.PHONY: GitVersion.h
|
||||
|
||||
# Export the current git version if the index file exists, else 000...
|
||||
GitVersion.h:
|
||||
ifneq ("$(wildcard .git/index)","")
|
||||
echo "const wxChar *gitversion = wxT(\"$(shell git rev-parse HEAD)\");" > $@
|
||||
else
|
||||
echo "const wxChar *gitversion = wxT(\"0000000000000000000000000000000000000000\");" > $@
|
||||
endif
|
||||
|
||||
.PHONY: installdirs
|
||||
installdirs: force
|
||||
/bin/mkdir -p $(DESTDIR)$(DATADIR) $(DESTDIR)$(LOGDIR) $(DESTDIR)$(CONFDIR) $(DESTDIR)$(BINDIR)
|
||||
|
|
@ -85,7 +94,6 @@ endif
|
|||
$(MAKE) -C APRSTransmit install
|
||||
$(MAKE) -C ircDDBGateway install
|
||||
$(MAKE) -C RemoteControl install
|
||||
$(MAKE) -C StarNetServer install
|
||||
$(MAKE) -C TextTransmit install
|
||||
$(MAKE) -C TimerControl install
|
||||
$(MAKE) -C TimeServer install
|
||||
|
|
@ -98,7 +106,6 @@ clean:
|
|||
$(MAKE) -C APRSTransmit clean
|
||||
$(MAKE) -C ircDDBGateway clean
|
||||
$(MAKE) -C RemoteControl clean
|
||||
$(MAKE) -C StarNetServer clean
|
||||
$(MAKE) -C TextTransmit clean
|
||||
$(MAKE) -C TimerControl clean
|
||||
$(MAKE) -C TimeServer clean
|
||||
|
|
@ -116,7 +123,6 @@ endif
|
|||
rm $(DESTDIR)$(BINDIR)/aprstransmitd || true
|
||||
rm $(DESTDIR)$(BINDIR)/ircddbgatewayd || true
|
||||
rm $(DESTDIR)$(BINDIR)/remotecontrold || true
|
||||
rm $(DESTDIR)$(BINDIR)/starnetserverd || true
|
||||
rm $(DESTDIR)$(BINDIR)/texttransmitd || true
|
||||
rm $(DESTDIR)$(BINDIR)/timercontrold || true
|
||||
rm $(DESTDIR)$(BINDIR)/timeserverd || true
|
||||
|
|
|
|||
21
MakefileGUI
21
MakefileGUI
|
|
@ -19,12 +19,12 @@ endif
|
|||
export CXX := $(shell wx-config --cxx)
|
||||
export CFLAGS := -O2 -Wall $(shell wx-config --cxxflags) -DLOG_DIR='$(LOGDIR)' -DCONF_DIR='$(CONFDIR)' -DDATA_DIR='$(DATADIR)'
|
||||
export GUILIBS := $(shell wx-config --libs adv,core,base)
|
||||
export LIBS := $(shell wx-config --libs base,net)
|
||||
export LIBS := $(shell wx-config --libs base,net) -lmosquitto
|
||||
export LDFLAGS :=
|
||||
|
||||
.PHONY: all
|
||||
all: ircDDBGateway/ircddbgateway ircDDBGatewayConfig/ircddbgatewayconfig APRSTransmit/aprstransmitd RemoteControl/remotecontrol \
|
||||
StarNetServer/starnetserver TextTransmit/texttransmitd TimerControl/timercontrol TimeServer/timeserver VoiceTransmit/voicetransmitd
|
||||
TextTransmit/texttransmitd TimerControl/timercontrol TimeServer/timeserver VoiceTransmit/voicetransmitd
|
||||
|
||||
ircDDBGateway/ircddbgateway: GUICommon/GUICommon.a Common/Common.a ircDDB/IRCDDB.a force
|
||||
$(MAKE) -C ircDDBGateway -f MakefileGUI
|
||||
|
|
@ -38,9 +38,6 @@ APRSTransmit/aprstransmitd: Common/Common.a force
|
|||
RemoteControl/remotecontrol: Common/Common.a force
|
||||
$(MAKE) -C RemoteControl -f MakefileGUI
|
||||
|
||||
StarNetServer/starnetserver: Common/Common.a ircDDB/IRCDDB.a force
|
||||
$(MAKE) -C StarNetServer -f MakefileGUI
|
||||
|
||||
TextTransmit/texttransmitd: Common/Common.a force
|
||||
$(MAKE) -C TextTransmit
|
||||
|
||||
|
|
@ -62,13 +59,24 @@ Common/Common.a: force
|
|||
ircDDB/IRCDDB.a: force
|
||||
$(MAKE) -C ircDDB
|
||||
|
||||
Common/Common.a: GitVersion.h
|
||||
|
||||
.PHONY: GitVersion.h
|
||||
|
||||
# Export the current git version if the index file exists, else 000...
|
||||
GitVersion.h:
|
||||
ifneq ("$(wildcard .git/index)","")
|
||||
echo "const wxChar *gitversion = wxT(\"$(shell git rev-parse HEAD)\");" > $@
|
||||
else
|
||||
echo "const wxChar *gitversion = wxT(\"0000000000000000000000000000000000000000\");" > $@
|
||||
endif
|
||||
|
||||
.PHONY: install
|
||||
install: all
|
||||
$(MAKE) -C Data install
|
||||
$(MAKE) -C APRSTransmit install
|
||||
$(MAKE) -C ircDDBGateway -f MakefileGUI install
|
||||
$(MAKE) -C RemoteControl -f MakefileGUI install
|
||||
$(MAKE) -C StarNetServer -f MakefileGUI install
|
||||
$(MAKE) -C TextTransmit install
|
||||
$(MAKE) -C TimerControl -f MakefileGUI install
|
||||
$(MAKE) -C TimeServer -f MakefileGUI install
|
||||
|
|
@ -83,7 +91,6 @@ clean:
|
|||
$(MAKE) -C APRSTransmit clean
|
||||
$(MAKE) -C ircDDBGateway -f MakefileGUI clean
|
||||
$(MAKE) -C RemoteControl -f MakefileGUI clean
|
||||
$(MAKE) -C StarNetServer -f MakefileGUI clean
|
||||
$(MAKE) -C TextTransmit clean
|
||||
$(MAKE) -C TimerControl -f MakefileGUI clean
|
||||
$(MAKE) -C TimeServer -f MakefileGUI clean
|
||||
|
|
|
|||
|
|
@ -1,24 +0,0 @@
|
|||
OBJECTS = StarNetServerAppD.o StarNetServerConfig.o StarNetServerThread.o StarNetServerThreadHelper.o
|
||||
|
||||
.PHONY: all
|
||||
all: starnetserverd
|
||||
|
||||
starnetserverd: $(OBJECTS) ../Common/Common.a ../ircDDB/IRCDDB.a
|
||||
$(CXX) $(OBJECTS) ../Common/Common.a ../ircDDB/IRCDDB.a $(LDFLAGS) $(LIBS) -o starnetserverd
|
||||
|
||||
-include $(OBJECTS:.o=.d)
|
||||
|
||||
%.o: %.cpp
|
||||
$(CXX) -DwxUSE_GUI=0 $(CFLAGS) -I../Common -I../ircDDB -c -o $@ $<
|
||||
$(CXX) -MM -DwxUSE_GUI=0 $(CFLAGS) -I../Common -I../ircDDB $< > $*.d
|
||||
|
||||
.PHONY: install
|
||||
install:
|
||||
install -g root -o root -m 0755 starnetserverd $(DESTDIR)$(BINDIR)
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
$(RM) starnetserverd *.o *.d *.bak *~
|
||||
|
||||
../Common/Common.a:
|
||||
../ircDDB/IRCDDB.a:
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
OBJECTS = StarNetServerApp.o StarNetServerCallsignSet.o StarNetServerConfig.o StarNetServerFrame.o StarNetServerIrcDDBSet.o \
|
||||
StarNetServerLogRedirect.o StarNetServerMiscellaneousSet.o StarNetServerPreferences.o StarNetServerThread.o \
|
||||
StarNetServerThreadHelper.o
|
||||
|
||||
.PHONY: all
|
||||
all: starnetserver
|
||||
|
||||
starnetserver: $(OBJECTS) ../GUICommon/GUICommon.a ../Common/Common.a
|
||||
$(CXX) $(OBJECTS) ../GUICommon/GUICommon.a ../Common/Common.a ../ircDDB/IRCDDB.a $(LDFLAGS) $(GUILIBS) -o starnetserver
|
||||
|
||||
-include $(OBJECTS:.o=.d)
|
||||
|
||||
%.o: %.cpp
|
||||
$(CXX) $(CFLAGS) -I../Common -I../GUICommon -I../ircDDB -c -o $@ $<
|
||||
$(CXX) -MM $(CFLAGS) -I../Common -I../GUICommon -I../ircDDB $< > $*.d
|
||||
|
||||
.PHONY: install
|
||||
install:
|
||||
install -g bin -o root -m 0775 starnetserver $(BINDIR)
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
$(RM) starnetserver *.o *.d *.bak *~
|
||||
|
||||
../GUICommon/GUICommon.a:
|
||||
../Common/Common.a:
|
||||
|
|
@ -1,214 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{4E9989C8-80D4-4F6E-BCA1-754DCED3AF5F}</ProjectGuid>
|
||||
<RootNamespace>StarNetServer</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>14.0.24720.0</_ProjectFileVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir>$(Configuration)\</IntDir>
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<IncludePath>$(WXWIN)\include;$(WXWIN)\lib\vc_dll\mswud;$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<IncludePath>$(WXWIN)\include;$(WXWIN)\lib\vc_x64_dll\mswud;$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
|
||||
<IntDir>$(Configuration)\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<IncludePath>$(WXWIN)\include;$(WXWIN)\lib\vc_dll\mswu;$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<IncludePath>$(WXWIN)\include;$(WXWIN)\lib\vc_x64_dll\mswu;$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>$(WXWIN)\include\msvc;$(WXWIN)\include;../Common;../GUICommon;../ircDDB;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;WINVER=0x0400;__WXMSW__;WXUSINGDLL;wxUSE_GUI=1;__WXDEBUG__;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;DCS_LINK;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader />
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(WXWIN)\lib\vc_dll;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>$(WXWIN)\include\msvc;$(WXWIN)\include;../Common;../GUICommon;../ircDDB;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;WINVER=0x0400;__WXMSW__;WXUSINGDLL;wxUSE_GUI=1;__WXDEBUG__;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;DCS_LINK;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(WXWIN)\lib\vc_x64_dll;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>$(WXWIN)\include\msvc;$(WXWIN)\include;../ircDDB;../Common;../GUICommon;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;WINVER=0x0400;__WXMSW__;WXUSINGDLL;wxUSE_GUI=1;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader />
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(WXWIN)\lib\vc_dll;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>$(WXWIN)\include\msvc;$(WXWIN)\include;../ircDDB;../Common;../GUICommon;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;WINVER=0x0400;__WXMSW__;WXUSINGDLL;wxUSE_GUI=1;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>$(WXWIN)\lib\vc_x64_dll;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="StarNetServerApp.cpp" />
|
||||
<ClCompile Include="StarNetServerCallsignSet.cpp" />
|
||||
<ClCompile Include="StarNetServerConfig.cpp" />
|
||||
<ClCompile Include="StarNetServerFrame.cpp" />
|
||||
<ClCompile Include="StarNetServerIrcDDBSet.cpp" />
|
||||
<ClCompile Include="StarNetServerLogRedirect.cpp" />
|
||||
<ClCompile Include="StarNetServerMiscellaneousSet.cpp" />
|
||||
<ClCompile Include="StarNetServerPreferences.cpp" />
|
||||
<ClCompile Include="StarNetServerThread.cpp" />
|
||||
<ClCompile Include="StarNetServerThreadHelper.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="StarNetServerApp.h" />
|
||||
<ClInclude Include="StarNetServerCallsignSet.h" />
|
||||
<ClInclude Include="StarNetServerConfig.h" />
|
||||
<ClInclude Include="StarNetServerDefs.h" />
|
||||
<ClInclude Include="StarNetServerFrame.h" />
|
||||
<ClInclude Include="StarNetServerIrcDDBSet.h" />
|
||||
<ClInclude Include="StarNetServerLogRedirect.h" />
|
||||
<ClInclude Include="StarNetServerMiscellaneousSet.h" />
|
||||
<ClInclude Include="StarNetServerPreferences.h" />
|
||||
<ClInclude Include="StarNetServerThread.h" />
|
||||
<ClInclude Include="StarNetServerThreadHelper.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Common\Common.vcxproj">
|
||||
<Project>{e793cb8e-2ac9-431a-bbfc-3f52537bb3cf}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\GUICommon\GUICommon.vcxproj">
|
||||
<Project>{02d03515-0bbe-4553-8c40-566a597478f8}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\ircDDB\ircDDB.vcxproj">
|
||||
<Project>{276bc54d-5581-4a0c-afd5-a5bdc947f0ad}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="StarNetServerApp.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="StarNetServerCallsignSet.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="StarNetServerConfig.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="StarNetServerFrame.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="StarNetServerIrcDDBSet.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="StarNetServerLogRedirect.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="StarNetServerMiscellaneousSet.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="StarNetServerPreferences.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="StarNetServerThread.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="StarNetServerThreadHelper.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="StarNetServerApp.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="StarNetServerCallsignSet.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="StarNetServerConfig.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="StarNetServerDefs.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="StarNetServerFrame.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="StarNetServerIrcDDBSet.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="StarNetServerLogRedirect.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="StarNetServerMiscellaneousSet.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="StarNetServerPreferences.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="StarNetServerThread.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="StarNetServerThreadHelper.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -1,947 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2010,2011,2012,2015,2018 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include "StarNetServerLogRedirect.h"
|
||||
#include "StarNetServerThread.h"
|
||||
#include "StarNetServerDefs.h"
|
||||
#include "StarNetServerApp.h"
|
||||
#include "Version.h"
|
||||
#include "Logger.h"
|
||||
#include "IRCDDBClient.h"
|
||||
|
||||
#include <wx/config.h>
|
||||
#include <wx/cmdline.h>
|
||||
#include <wx/filename.h>
|
||||
|
||||
wxIMPLEMENT_APP(CStarNetServerApp);
|
||||
|
||||
const wxChar* NOLOGGING_SWITCH = wxT("nolog");
|
||||
const wxChar* GUI_SWITCH = wxT("gui");
|
||||
const wxChar* LOGDIR_OPTION = wxT("logdir");
|
||||
const wxChar* CONFDIR_OPTION = wxT("confdir");
|
||||
|
||||
CStarNetServerApp::CStarNetServerApp() :
|
||||
wxApp(),
|
||||
m_nolog(false),
|
||||
m_gui(false),
|
||||
m_logDir(),
|
||||
m_confDir(),
|
||||
m_frame(NULL),
|
||||
m_thread(NULL),
|
||||
m_config(NULL),
|
||||
m_logChain(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
CStarNetServerApp::~CStarNetServerApp()
|
||||
{
|
||||
}
|
||||
|
||||
bool CStarNetServerApp::OnInit()
|
||||
{
|
||||
#if defined(__WINDOWS__)
|
||||
WSAData data;
|
||||
int wsaRet = ::WSAStartup(MAKEWORD(2, 2), &data);
|
||||
if (wsaRet != 0) {
|
||||
wxLogError(wxT("Error from WSAStartup"));
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
SetVendorName(VENDOR_NAME);
|
||||
|
||||
if (!wxApp::OnInit())
|
||||
return false;
|
||||
|
||||
if (!m_nolog) {
|
||||
#if defined(__WINDOWS__)
|
||||
if (m_logDir.IsEmpty())
|
||||
m_logDir = ::wxGetHomeDir();
|
||||
#else
|
||||
if (m_logDir.IsEmpty())
|
||||
m_logDir = wxT(LOG_DIR);
|
||||
#endif
|
||||
|
||||
wxLog* log = new CLogger(m_logDir, LOG_BASE_NAME);
|
||||
wxLog::SetActiveTarget(log);
|
||||
} else {
|
||||
new wxLogNull;
|
||||
}
|
||||
|
||||
m_logChain = new wxLogChain(new CStarNetServerLogRedirect);
|
||||
|
||||
#if defined(__WINDOWS__)
|
||||
if (m_confDir.IsEmpty())
|
||||
m_confDir = wxGetHomeDir();
|
||||
|
||||
m_config = new CStarNetServerConfig(new wxConfig(APPLICATION_NAME), m_confDir);
|
||||
#else
|
||||
if (m_confDir.IsEmpty())
|
||||
m_confDir = wxT(CONF_DIR);
|
||||
|
||||
m_config = new CStarNetServerConfig(m_confDir);
|
||||
#endif
|
||||
|
||||
wxPoint position = wxDefaultPosition;
|
||||
|
||||
int x, y;
|
||||
getPosition(x, y);
|
||||
if (x >= 0 && y >= 0)
|
||||
position = wxPoint(x, y);
|
||||
|
||||
m_frame = new CStarNetServerFrame(APPLICATION_NAME + wxT(" - ") + VERSION, position, m_gui);
|
||||
m_frame->Show();
|
||||
|
||||
SetTopWindow(m_frame);
|
||||
|
||||
wxLogInfo(wxT("Starting ") + APPLICATION_NAME + wxT(" - ") + VERSION);
|
||||
|
||||
// Log the version of wxWidgets and the Operating System
|
||||
wxLogInfo(wxT("Using wxWidgets %d.%d.%d on %s"), wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER, ::wxGetOsDescription().c_str());
|
||||
|
||||
createThread();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
int CStarNetServerApp::OnExit()
|
||||
{
|
||||
m_logChain->SetLog(NULL);
|
||||
|
||||
wxLogInfo(APPLICATION_NAME + wxT(" is exiting"));
|
||||
|
||||
m_thread->kill();
|
||||
|
||||
delete m_config;
|
||||
|
||||
#if defined(__WINDOWS__)
|
||||
::WSACleanup();
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CStarNetServerApp::OnInitCmdLine(wxCmdLineParser& parser)
|
||||
{
|
||||
parser.AddSwitch(NOLOGGING_SWITCH, wxEmptyString, wxEmptyString, wxCMD_LINE_PARAM_OPTIONAL);
|
||||
parser.AddSwitch(GUI_SWITCH, wxEmptyString, wxEmptyString, wxCMD_LINE_PARAM_OPTIONAL);
|
||||
parser.AddOption(LOGDIR_OPTION, wxEmptyString, wxEmptyString, wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL);
|
||||
parser.AddOption(CONFDIR_OPTION, wxEmptyString, wxEmptyString, wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL);
|
||||
|
||||
wxApp::OnInitCmdLine(parser);
|
||||
}
|
||||
|
||||
bool CStarNetServerApp::OnCmdLineParsed(wxCmdLineParser& parser)
|
||||
{
|
||||
if (!wxApp::OnCmdLineParsed(parser))
|
||||
return false;
|
||||
|
||||
m_nolog = parser.Found(NOLOGGING_SWITCH);
|
||||
m_gui = parser.Found(GUI_SWITCH);
|
||||
|
||||
wxString logDir;
|
||||
bool found = parser.Found(LOGDIR_OPTION, &logDir);
|
||||
if (found)
|
||||
m_logDir = logDir;
|
||||
|
||||
wxString confDir;
|
||||
found = parser.Found(CONFDIR_OPTION, &confDir);
|
||||
if (found)
|
||||
m_confDir = confDir;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#if defined(__WXDEBUG__)
|
||||
void CStarNetServerApp::OnAssertFailure(const wxChar* file, int line, const wxChar* func, const wxChar* cond, const wxChar* msg)
|
||||
{
|
||||
wxLogFatalError(wxT("Assertion failed on line %d in file %s and function %s: %s %s"), line, file, func, cond, msg);
|
||||
}
|
||||
#endif
|
||||
|
||||
void CStarNetServerApp::showLog(const wxString& text)
|
||||
{
|
||||
m_frame->showLog(text);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::getGateway(wxString& callsign, wxString& address) const
|
||||
{
|
||||
m_config->getGateway(callsign, address);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::setGateway(const wxString& callsign, const wxString& address)
|
||||
{
|
||||
m_config->setGateway(callsign, address);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::getIrcDDB(wxString& hostname, wxString& username, wxString& password) const
|
||||
{
|
||||
m_config->getIrcDDB(hostname, username, password);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::setIrcDDB(const wxString& hostname, const wxString& username, const wxString& password)
|
||||
{
|
||||
m_config->setIrcDDB(hostname, username, password);
|
||||
}
|
||||
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
void CStarNetServerApp::getStarNet1(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const
|
||||
{
|
||||
m_config->getStarNet1(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::setStarNet1(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector)
|
||||
{
|
||||
m_config->setStarNet1(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::getStarNet2(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const
|
||||
{
|
||||
m_config->getStarNet2(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::setStarNet2(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector)
|
||||
{
|
||||
m_config->setStarNet2(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::getStarNet3(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const
|
||||
{
|
||||
m_config->getStarNet3(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::setStarNet3(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector)
|
||||
{
|
||||
m_config->setStarNet3(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::getStarNet4(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const
|
||||
{
|
||||
m_config->getStarNet4(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::setStarNet4(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector)
|
||||
{
|
||||
m_config->setStarNet4(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::getStarNet5(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const
|
||||
{
|
||||
m_config->getStarNet5(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::setStarNet5(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector)
|
||||
{
|
||||
m_config->setStarNet5(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::getStarNet6(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const
|
||||
{
|
||||
m_config->getStarNet6(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::setStarNet6(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector)
|
||||
{
|
||||
m_config->setStarNet6(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::getStarNet7(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const
|
||||
{
|
||||
m_config->getStarNet7(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::setStarNet7(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector)
|
||||
{
|
||||
m_config->setStarNet7(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::getStarNet8(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const
|
||||
{
|
||||
m_config->getStarNet8(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::setStarNet8(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector)
|
||||
{
|
||||
m_config->setStarNet8(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::getStarNet9(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const
|
||||
{
|
||||
m_config->getStarNet9(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::setStarNet9(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector)
|
||||
{
|
||||
m_config->setStarNet9(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::getStarNet10(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const
|
||||
{
|
||||
m_config->getStarNet10(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::setStarNet10(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector)
|
||||
{
|
||||
m_config->setStarNet10(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::getStarNet11(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const
|
||||
{
|
||||
m_config->getStarNet11(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::setStarNet11(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector)
|
||||
{
|
||||
m_config->setStarNet11(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::getStarNet12(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const
|
||||
{
|
||||
m_config->getStarNet12(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::setStarNet12(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector)
|
||||
{
|
||||
m_config->setStarNet12(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::getStarNet13(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const
|
||||
{
|
||||
m_config->getStarNet13(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::setStarNet13(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector)
|
||||
{
|
||||
m_config->setStarNet13(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::getStarNet14(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const
|
||||
{
|
||||
m_config->getStarNet14(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::setStarNet14(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector)
|
||||
{
|
||||
m_config->setStarNet14(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::getStarNet15(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const
|
||||
{
|
||||
m_config->getStarNet15(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::setStarNet15(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector)
|
||||
{
|
||||
m_config->setStarNet15(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector);
|
||||
}
|
||||
#else
|
||||
void CStarNetServerApp::getStarNet1(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const
|
||||
{
|
||||
m_config->getStarNet1(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::setStarNet1(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch)
|
||||
{
|
||||
m_config->setStarNet1(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::getStarNet2(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const
|
||||
{
|
||||
m_config->getStarNet2(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::setStarNet2(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch)
|
||||
{
|
||||
m_config->setStarNet2(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::getStarNet3(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const
|
||||
{
|
||||
m_config->getStarNet3(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::setStarNet3(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch)
|
||||
{
|
||||
m_config->setStarNet3(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::getStarNet4(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const
|
||||
{
|
||||
m_config->getStarNet4(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::setStarNet4(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch)
|
||||
{
|
||||
m_config->setStarNet4(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::getStarNet5(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const
|
||||
{
|
||||
m_config->getStarNet5(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::setStarNet5(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch)
|
||||
{
|
||||
m_config->setStarNet5(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::getStarNet6(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const
|
||||
{
|
||||
m_config->getStarNet6(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::setStarNet6(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch)
|
||||
{
|
||||
m_config->setStarNet6(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::getStarNet7(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const
|
||||
{
|
||||
m_config->getStarNet7(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::setStarNet7(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch)
|
||||
{
|
||||
m_config->setStarNet7(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::getStarNet8(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const
|
||||
{
|
||||
m_config->getStarNet8(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::setStarNet8(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch)
|
||||
{
|
||||
m_config->setStarNet8(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::getStarNet9(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const
|
||||
{
|
||||
m_config->getStarNet9(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::setStarNet9(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch)
|
||||
{
|
||||
m_config->setStarNet9(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::getStarNet10(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const
|
||||
{
|
||||
m_config->getStarNet10(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::setStarNet10(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch)
|
||||
{
|
||||
m_config->setStarNet10(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::getStarNet11(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const
|
||||
{
|
||||
m_config->getStarNet11(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::setStarNet11(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch)
|
||||
{
|
||||
m_config->setStarNet11(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::getStarNet12(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const
|
||||
{
|
||||
m_config->getStarNet12(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::setStarNet12(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch)
|
||||
{
|
||||
m_config->setStarNet12(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::getStarNet13(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const
|
||||
{
|
||||
m_config->getStarNet13(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::setStarNet13(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch)
|
||||
{
|
||||
m_config->setStarNet13(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::getStarNet14(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const
|
||||
{
|
||||
m_config->getStarNet14(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::setStarNet14(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch)
|
||||
{
|
||||
m_config->setStarNet14(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::getStarNet15(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const
|
||||
{
|
||||
m_config->getStarNet15(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::setStarNet15(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch)
|
||||
{
|
||||
m_config->setStarNet15(band, callsign, logoff, info, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch);
|
||||
}
|
||||
#endif
|
||||
|
||||
void CStarNetServerApp::getRemote(bool& enabled, wxString& password, unsigned int& port) const
|
||||
{
|
||||
m_config->getRemote(enabled, password, port);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::setRemote(bool enabled, const wxString& password, unsigned int port)
|
||||
{
|
||||
m_config->setRemote(enabled, password, port);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::getMiscellaneous(bool& logEnabled) const
|
||||
{
|
||||
m_config->getMiscellaneous(logEnabled);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::setMiscellaneous(bool logEnabled)
|
||||
{
|
||||
m_config->setMiscellaneous(logEnabled);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::getPosition(int& x, int& y) const
|
||||
{
|
||||
m_config->getPosition(x, y);
|
||||
}
|
||||
|
||||
void CStarNetServerApp::setPosition(int x, int y)
|
||||
{
|
||||
m_config->setPosition(x, y);
|
||||
}
|
||||
|
||||
bool CStarNetServerApp::writeConfig()
|
||||
{
|
||||
return m_config->write();
|
||||
}
|
||||
|
||||
void CStarNetServerApp::createThread()
|
||||
{
|
||||
CStarNetServerThread* thread = new CStarNetServerThread(m_nolog, m_logDir);
|
||||
|
||||
wxString callsign, address;
|
||||
getGateway(callsign, address);
|
||||
|
||||
callsign.Append(wxT(" "));
|
||||
callsign.Truncate(LONG_CALLSIGN_LENGTH - 1U);
|
||||
callsign.Append(wxT("G"));
|
||||
|
||||
wxLogInfo(wxT("Gateway callsign set to %s, local address set to %s"), callsign.c_str(), address.c_str());
|
||||
|
||||
bool logEnabled;
|
||||
getMiscellaneous(logEnabled);
|
||||
wxLogInfo(wxT("Log enabled set to %d"), int(logEnabled));
|
||||
|
||||
wxString hostname, username, password;
|
||||
getIrcDDB(hostname, username, password);
|
||||
wxLogInfo(wxT("ircDDB host set to %s, username set to %s"), hostname.c_str(), username.c_str());
|
||||
|
||||
if (!hostname.IsEmpty() && !username.IsEmpty()) {
|
||||
#if defined(__WINDOWS__)
|
||||
CIRCDDB* ircDDB = new CIRCDDBClient(hostname, 9007U, username, password, wxT("win_") + LOG_BASE_NAME + wxT("-") + VERSION, address);
|
||||
#else
|
||||
CIRCDDB* ircDDB = new CIRCDDBClient(hostname, 9007U, username, password, wxT("linux_") + LOG_BASE_NAME + wxT("-") + VERSION, address);
|
||||
#endif
|
||||
bool res = ircDDB->open();
|
||||
if (!res)
|
||||
wxLogError(wxT("Cannot initialise the ircDDB protocol handler"));
|
||||
else
|
||||
thread->setIRC(ircDDB);
|
||||
}
|
||||
|
||||
wxString starNetBand1, starNetCallsign1, starNetLogoff1, starNetInfo1, starNetPermanent1, starNetLink1; // DEXTRA_LINK || DCS_LINK
|
||||
unsigned int starNetUserTimeout1, starNetGroupTimeout1;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch1;
|
||||
bool starNetTXMsgSwitch1;
|
||||
getStarNet1(starNetBand1, starNetCallsign1, starNetLogoff1, starNetInfo1, starNetPermanent1, starNetUserTimeout1, starNetGroupTimeout1, starNetCallsignSwitch1, starNetTXMsgSwitch1
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
,starNetLink1
|
||||
#endif
|
||||
);
|
||||
|
||||
if (!starNetCallsign1.IsEmpty() && !starNetCallsign1.IsSameAs(wxT(" "))) {
|
||||
wxString repeater = callsign;
|
||||
repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U);
|
||||
repeater.Append(starNetBand1);
|
||||
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
thread->addStarNet(starNetCallsign1, starNetLogoff1, repeater, starNetInfo1, starNetPermanent1, starNetUserTimeout1, starNetGroupTimeout1, starNetCallsignSwitch1, starNetTXMsgSwitch1, starNetLink1);
|
||||
wxLogInfo(wxT("StarNet 1 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign1.c_str(), starNetLogoff1.c_str(), repeater.c_str(), starNetInfo1.c_str(), starNetPermanent1.c_str(), starNetUserTimeout1, starNetGroupTimeout1, int(starNetCallsignSwitch1), int(starNetTXMsgSwitch1), starNetLink1.c_str());
|
||||
#else
|
||||
thread->addStarNet(starNetCallsign1, starNetLogoff1, repeater, starNetInfo1, starNetPermanent1, starNetUserTimeout1, starNetGroupTimeout1, starNetCallsignSwitch1, starNetTXMsgSwitch1);
|
||||
wxLogInfo(wxT("StarNet 1 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign1.c_str(), starNetLogoff1.c_str(), repeater.c_str(), starNetInfo1.c_str(), starNetPermanent1.c_str(), starNetUserTimeout1, starNetGroupTimeout1, int(starNetCallsignSwitch1), int(starNetTXMsgSwitch1));
|
||||
#endif
|
||||
}
|
||||
|
||||
wxString starNetBand2, starNetCallsign2, starNetLogoff2, starNetInfo2, starNetPermanent2, starNetLink2; // DEXTRA_LINK || DCS_LINK
|
||||
unsigned int starNetUserTimeout2, starNetGroupTimeout2;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch2;
|
||||
bool starNetTXMsgSwitch2;
|
||||
getStarNet2(starNetBand2, starNetCallsign2, starNetLogoff2, starNetInfo2, starNetPermanent2, starNetUserTimeout2, starNetGroupTimeout2, starNetCallsignSwitch2, starNetTXMsgSwitch2
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
,starNetLink2
|
||||
#endif
|
||||
);
|
||||
|
||||
if (!starNetCallsign2.IsEmpty() && !starNetCallsign2.IsSameAs(wxT(" "))) {
|
||||
wxString repeater = callsign;
|
||||
repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U);
|
||||
repeater.Append(starNetBand2);
|
||||
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
thread->addStarNet(starNetCallsign2, starNetLogoff2, repeater, starNetInfo2, starNetPermanent2, starNetUserTimeout2, starNetGroupTimeout2, starNetCallsignSwitch2, starNetTXMsgSwitch2, starNetLink2);
|
||||
wxLogInfo(wxT("StarNet 2 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign2.c_str(), starNetLogoff2.c_str(), repeater.c_str(), starNetInfo2.c_str(), starNetPermanent2.c_str(), starNetUserTimeout2, starNetGroupTimeout2, int(starNetCallsignSwitch2), int(starNetTXMsgSwitch2), starNetLink2.c_str());
|
||||
#else
|
||||
thread->addStarNet(starNetCallsign2, starNetLogoff2, repeater, starNetInfo2, starNetPermanent2, starNetUserTimeout2, starNetGroupTimeout2, starNetCallsignSwitch2, starNetTXMsgSwitch2);
|
||||
wxLogInfo(wxT("StarNet 2 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign2.c_str(), starNetLogoff2.c_str(), repeater.c_str(), starNetInfo2.c_str(), starNetPermanent2.c_str(), starNetUserTimeout2, starNetGroupTimeout2, int(starNetCallsignSwitch2), int(starNetTXMsgSwitch2));
|
||||
#endif
|
||||
}
|
||||
|
||||
wxString starNetBand3, starNetCallsign3, starNetLogoff3, starNetInfo3, starNetPermanent3, starNetLink3; // DEXTRA_LINK || DCS_LINK
|
||||
unsigned int starNetUserTimeout3, starNetGroupTimeout3;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch3;
|
||||
bool starNetTXMsgSwitch3;
|
||||
getStarNet3(starNetBand3, starNetCallsign3, starNetLogoff3, starNetInfo3, starNetPermanent3, starNetUserTimeout3, starNetGroupTimeout3, starNetCallsignSwitch3, starNetTXMsgSwitch3
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
,starNetLink3
|
||||
#endif
|
||||
);
|
||||
|
||||
if (!starNetCallsign3.IsEmpty() && !starNetCallsign3.IsSameAs(wxT(" "))) {
|
||||
wxString repeater = callsign;
|
||||
repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U);
|
||||
repeater.Append(starNetBand3);
|
||||
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
thread->addStarNet(starNetCallsign3, starNetLogoff3, repeater, starNetInfo3, starNetPermanent3, starNetUserTimeout3, starNetGroupTimeout3, starNetCallsignSwitch3, starNetTXMsgSwitch3, starNetLink3);
|
||||
wxLogInfo(wxT("StarNet 3 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign3.c_str(), starNetLogoff3.c_str(), repeater.c_str(), starNetInfo3.c_str(), starNetPermanent3.c_str(), starNetUserTimeout3, starNetGroupTimeout3, int(starNetCallsignSwitch3), int(starNetTXMsgSwitch3), starNetLink3.c_str());
|
||||
#else
|
||||
thread->addStarNet(starNetCallsign3, starNetLogoff3, repeater, starNetInfo3, starNetPermanent3, starNetUserTimeout3, starNetGroupTimeout3, starNetCallsignSwitch3, starNetTXMsgSwitch3);
|
||||
wxLogInfo(wxT("StarNet 3 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign3.c_str(), starNetLogoff3.c_str(), repeater.c_str(), starNetInfo3.c_str(), starNetPermanent3.c_str(), starNetUserTimeout3, starNetGroupTimeout3, int(starNetCallsignSwitch3), int(starNetTXMsgSwitch3));
|
||||
#endif
|
||||
}
|
||||
|
||||
wxString starNetBand4, starNetCallsign4, starNetLogoff4, starNetInfo4, starNetPermanent4, starNetLink4; // DEXTRA_LINK || DCS_LINK
|
||||
unsigned int starNetUserTimeout4, starNetGroupTimeout4;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch4;
|
||||
bool starNetTXMsgSwitch4;
|
||||
getStarNet4(starNetBand4, starNetCallsign4, starNetLogoff4, starNetInfo4, starNetPermanent4, starNetUserTimeout4, starNetGroupTimeout4, starNetCallsignSwitch4, starNetTXMsgSwitch4
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
,starNetLink4
|
||||
#endif
|
||||
);
|
||||
|
||||
if (!starNetCallsign4.IsEmpty() && !starNetCallsign4.IsSameAs(wxT(" "))) {
|
||||
wxString repeater = callsign;
|
||||
repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U);
|
||||
repeater.Append(starNetBand4);
|
||||
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
thread->addStarNet(starNetCallsign4, starNetLogoff4, repeater, starNetInfo4, starNetPermanent4, starNetUserTimeout4, starNetGroupTimeout4, starNetCallsignSwitch4, starNetTXMsgSwitch4, starNetLink4);
|
||||
wxLogInfo(wxT("StarNet 4 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign4.c_str(), starNetLogoff4.c_str(), repeater.c_str(), starNetInfo4.c_str(), starNetPermanent4.c_str(), starNetUserTimeout4, starNetGroupTimeout4, int(starNetCallsignSwitch4), int(starNetTXMsgSwitch4), starNetLink4.c_str());
|
||||
#else
|
||||
thread->addStarNet(starNetCallsign4, starNetLogoff4, repeater, starNetInfo4, starNetPermanent4, starNetUserTimeout4, starNetGroupTimeout4, starNetCallsignSwitch4, starNetTXMsgSwitch4);
|
||||
wxLogInfo(wxT("StarNet 4 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign4.c_str(), starNetLogoff4.c_str(), repeater.c_str(), starNetInfo4.c_str(), starNetPermanent4.c_str(), starNetUserTimeout4, starNetGroupTimeout4, int(starNetCallsignSwitch4), int(starNetTXMsgSwitch4));
|
||||
#endif
|
||||
}
|
||||
|
||||
wxString starNetBand5, starNetCallsign5, starNetLogoff5, starNetInfo5, starNetPermanent5, starNetLink5; // DEXTRA_LINK || DCS_LINK
|
||||
unsigned int starNetUserTimeout5, starNetGroupTimeout5;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch5;
|
||||
bool starNetTXMsgSwitch5;
|
||||
getStarNet5(starNetBand5, starNetCallsign5, starNetLogoff5, starNetInfo5, starNetPermanent5, starNetUserTimeout5, starNetGroupTimeout5, starNetCallsignSwitch5, starNetTXMsgSwitch5
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
,starNetLink5
|
||||
#endif
|
||||
);
|
||||
|
||||
if (!starNetCallsign5.IsEmpty() && !starNetCallsign5.IsSameAs(wxT(" "))) {
|
||||
wxString repeater = callsign;
|
||||
repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U);
|
||||
repeater.Append(starNetBand5);
|
||||
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
thread->addStarNet(starNetCallsign5, starNetLogoff5, repeater, starNetInfo5, starNetPermanent5, starNetUserTimeout5, starNetGroupTimeout5, starNetCallsignSwitch5, starNetTXMsgSwitch5, starNetLink5);
|
||||
wxLogInfo(wxT("StarNet 5 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign5.c_str(), starNetLogoff5.c_str(), repeater.c_str(), starNetInfo5.c_str(), starNetPermanent5.c_str(), starNetUserTimeout5, starNetGroupTimeout5, int(starNetCallsignSwitch5), int(starNetTXMsgSwitch5), starNetLink5.c_str());
|
||||
#else
|
||||
thread->addStarNet(starNetCallsign5, starNetLogoff5, repeater, starNetInfo5, starNetPermanent5, starNetUserTimeout5, starNetGroupTimeout5, starNetCallsignSwitch5, starNetTXMsgSwitch5);
|
||||
wxLogInfo(wxT("StarNet 5 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign5.c_str(), starNetLogoff5.c_str(), repeater.c_str(), starNetInfo5.c_str(), starNetPermanent5.c_str(), starNetUserTimeout5, starNetGroupTimeout5, int(starNetCallsignSwitch5), int(starNetTXMsgSwitch5));
|
||||
#endif
|
||||
}
|
||||
|
||||
wxString starNetBand6, starNetCallsign6, starNetLogoff6, starNetInfo6, starNetPermanent6, starNetLink6; // DEXTRA_LINK || DCS_LINK
|
||||
unsigned int starNetUserTimeout6, starNetGroupTimeout6;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch6;
|
||||
bool starNetTXMsgSwitch6;
|
||||
getStarNet6(starNetBand6, starNetCallsign6, starNetLogoff6, starNetInfo6, starNetPermanent6, starNetUserTimeout6, starNetGroupTimeout6, starNetCallsignSwitch6, starNetTXMsgSwitch6
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
,starNetLink6
|
||||
#endif
|
||||
);
|
||||
|
||||
if (!starNetCallsign6.IsEmpty() && !starNetCallsign6.IsSameAs(wxT(" "))) {
|
||||
wxString repeater = callsign;
|
||||
repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U);
|
||||
repeater.Append(starNetBand6);
|
||||
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
thread->addStarNet(starNetCallsign6, starNetLogoff6, repeater, starNetInfo6, starNetPermanent6, starNetUserTimeout6, starNetGroupTimeout6, starNetCallsignSwitch6, starNetTXMsgSwitch6, starNetLink6);
|
||||
wxLogInfo(wxT("StarNet 6 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign6.c_str(), starNetLogoff6.c_str(), repeater.c_str(), starNetInfo6.c_str(), starNetPermanent6.c_str(), starNetUserTimeout6, starNetGroupTimeout6, int(starNetCallsignSwitch6), int(starNetTXMsgSwitch6), starNetLink6.c_str());
|
||||
#else
|
||||
thread->addStarNet(starNetCallsign6, starNetLogoff6, repeater, starNetInfo6, starNetPermanent6, starNetUserTimeout6, starNetGroupTimeout6, starNetCallsignSwitch6, starNetTXMsgSwitch6);
|
||||
wxLogInfo(wxT("StarNet 6 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign6.c_str(), starNetLogoff6.c_str(), repeater.c_str(), starNetInfo6.c_str(), starNetPermanent6.c_str(), starNetUserTimeout6, starNetGroupTimeout6, int(starNetCallsignSwitch6), int(starNetTXMsgSwitch6));
|
||||
#endif
|
||||
}
|
||||
|
||||
wxString starNetBand7, starNetCallsign7, starNetLogoff7, starNetInfo7, starNetPermanent7, starNetLink7; // DEXTRA_LINK || DCS_LINK
|
||||
unsigned int starNetUserTimeout7, starNetGroupTimeout7;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch7;
|
||||
bool starNetTXMsgSwitch7;
|
||||
getStarNet7(starNetBand7, starNetCallsign7, starNetLogoff7, starNetInfo7, starNetPermanent7, starNetUserTimeout7, starNetGroupTimeout7, starNetCallsignSwitch7, starNetTXMsgSwitch7
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
,starNetLink7
|
||||
#endif
|
||||
);
|
||||
|
||||
if (!starNetCallsign7.IsEmpty() && !starNetCallsign7.IsSameAs(wxT(" "))) {
|
||||
wxString repeater = callsign;
|
||||
repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U);
|
||||
repeater.Append(starNetBand7);
|
||||
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
thread->addStarNet(starNetCallsign7, starNetLogoff7, repeater, starNetInfo7, starNetPermanent7, starNetUserTimeout7, starNetGroupTimeout7, starNetCallsignSwitch7, starNetTXMsgSwitch7, starNetLink7);
|
||||
wxLogInfo(wxT("StarNet 7 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign7.c_str(), starNetLogoff7.c_str(), repeater.c_str(), starNetInfo7.c_str(), starNetPermanent7.c_str(), starNetUserTimeout7, starNetGroupTimeout7, int(starNetCallsignSwitch7), int(starNetTXMsgSwitch7), starNetLink7.c_str());
|
||||
#else
|
||||
thread->addStarNet(starNetCallsign7, starNetLogoff7, repeater, starNetInfo7, starNetPermanent7, starNetUserTimeout7, starNetGroupTimeout7, starNetCallsignSwitch7, starNetTXMsgSwitch7);
|
||||
wxLogInfo(wxT("StarNet 7 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign7.c_str(), starNetLogoff7.c_str(), repeater.c_str(), starNetInfo7.c_str(), starNetPermanent7.c_str(), starNetUserTimeout7, starNetGroupTimeout7, int(starNetCallsignSwitch7), int(starNetTXMsgSwitch7));
|
||||
#endif
|
||||
}
|
||||
|
||||
wxString starNetBand8, starNetCallsign8, starNetLogoff8, starNetInfo8, starNetPermanent8, starNetLink8; // DEXTRA_LINK || DCS_LINK
|
||||
unsigned int starNetUserTimeout8, starNetGroupTimeout8;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch8;
|
||||
bool starNetTXMsgSwitch8;
|
||||
getStarNet8(starNetBand8, starNetCallsign8, starNetLogoff8, starNetInfo8, starNetPermanent8, starNetUserTimeout8, starNetGroupTimeout8, starNetCallsignSwitch8, starNetTXMsgSwitch8
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
,starNetLink8
|
||||
#endif
|
||||
);
|
||||
|
||||
if (!starNetCallsign8.IsEmpty() && !starNetCallsign8.IsSameAs(wxT(" "))) {
|
||||
wxString repeater = callsign;
|
||||
repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U);
|
||||
repeater.Append(starNetBand8);
|
||||
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
thread->addStarNet(starNetCallsign8, starNetLogoff8, repeater, starNetInfo8, starNetPermanent8, starNetUserTimeout8, starNetGroupTimeout8, starNetCallsignSwitch8, starNetTXMsgSwitch8, starNetLink8);
|
||||
wxLogInfo(wxT("StarNet 8 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign8.c_str(), starNetLogoff8.c_str(), repeater.c_str(), starNetInfo8.c_str(), starNetPermanent8.c_str(), starNetUserTimeout8, starNetGroupTimeout8, int(starNetCallsignSwitch8), int(starNetTXMsgSwitch8), starNetLink8.c_str());
|
||||
#else
|
||||
thread->addStarNet(starNetCallsign8, starNetLogoff8, repeater, starNetInfo8, starNetPermanent8, starNetUserTimeout8, starNetGroupTimeout8, starNetCallsignSwitch8, starNetTXMsgSwitch8);
|
||||
wxLogInfo(wxT("StarNet 8 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign8.c_str(), starNetLogoff8.c_str(), repeater.c_str(), starNetInfo8.c_str(), starNetPermanent8.c_str(), starNetUserTimeout8, starNetGroupTimeout8, int(starNetCallsignSwitch8), int(starNetTXMsgSwitch8));
|
||||
#endif
|
||||
}
|
||||
|
||||
wxString starNetBand9, starNetCallsign9, starNetLogoff9, starNetInfo9, starNetPermanent9, starNetLink9; // DEXTRA_LINK || DCS_LINK
|
||||
unsigned int starNetUserTimeout9, starNetGroupTimeout9;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch9;
|
||||
bool starNetTXMsgSwitch9;
|
||||
getStarNet9(starNetBand9, starNetCallsign9, starNetLogoff9, starNetInfo9, starNetPermanent9, starNetUserTimeout9, starNetGroupTimeout9, starNetCallsignSwitch9, starNetTXMsgSwitch9
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
,starNetLink9
|
||||
#endif
|
||||
);
|
||||
|
||||
if (!starNetCallsign9.IsEmpty() && !starNetCallsign9.IsSameAs(wxT(" "))) {
|
||||
wxString repeater = callsign;
|
||||
repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U);
|
||||
repeater.Append(starNetBand9);
|
||||
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
thread->addStarNet(starNetCallsign9, starNetLogoff9, repeater, starNetInfo9, starNetPermanent9, starNetUserTimeout9, starNetGroupTimeout9, starNetCallsignSwitch9, starNetTXMsgSwitch9, starNetLink9);
|
||||
wxLogInfo(wxT("StarNet 9 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign9.c_str(), starNetLogoff9.c_str(), repeater.c_str(), starNetInfo9.c_str(), starNetPermanent9.c_str(), starNetUserTimeout9, starNetGroupTimeout9, int(starNetCallsignSwitch9), int(starNetTXMsgSwitch9), starNetLink9.c_str());
|
||||
#else
|
||||
thread->addStarNet(starNetCallsign9, starNetLogoff9, repeater, starNetInfo9, starNetPermanent9, starNetUserTimeout9, starNetGroupTimeout9, starNetCallsignSwitch9, starNetTXMsgSwitch9);
|
||||
wxLogInfo(wxT("StarNet 9 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign9.c_str(), starNetLogoff9.c_str(), repeater.c_str(), starNetInfo9.c_str(), starNetPermanent9.c_str(), starNetUserTimeout9, starNetGroupTimeout9, int(starNetCallsignSwitch9), int(starNetTXMsgSwitch9));
|
||||
#endif
|
||||
}
|
||||
|
||||
wxString starNetBand10, starNetCallsign10, starNetLogoff10, starNetInfo10, starNetPermanent10, starNetLink10; // DEXTRA_LINK || DCS_LINK
|
||||
unsigned int starNetUserTimeout10, starNetGroupTimeout10;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch10;
|
||||
bool starNetTXMsgSwitch10;
|
||||
getStarNet10(starNetBand10, starNetCallsign10, starNetLogoff10, starNetInfo10, starNetPermanent10, starNetUserTimeout10, starNetGroupTimeout10, starNetCallsignSwitch10, starNetTXMsgSwitch10
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
,starNetLink10
|
||||
#endif
|
||||
);
|
||||
|
||||
if (!starNetCallsign10.IsEmpty() && !starNetCallsign10.IsSameAs(wxT(" "))) {
|
||||
wxString repeater = callsign;
|
||||
repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U);
|
||||
repeater.Append(starNetBand10);
|
||||
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
thread->addStarNet(starNetCallsign10, starNetLogoff10, repeater, starNetInfo10, starNetPermanent10, starNetUserTimeout10, starNetGroupTimeout10, starNetCallsignSwitch10, starNetTXMsgSwitch10, starNetLink10);
|
||||
wxLogInfo(wxT("StarNet 10 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign10.c_str(), starNetLogoff10.c_str(), repeater.c_str(), starNetInfo10.c_str(), starNetPermanent10.c_str(), starNetUserTimeout10, starNetGroupTimeout10, int(starNetCallsignSwitch10), int(starNetTXMsgSwitch10), starNetLink10.c_str());
|
||||
#else
|
||||
thread->addStarNet(starNetCallsign10, starNetLogoff10, repeater, starNetInfo10, starNetPermanent10, starNetUserTimeout10, starNetGroupTimeout10, starNetCallsignSwitch10, starNetTXMsgSwitch10);
|
||||
wxLogInfo(wxT("StarNet 10 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign10.c_str(), starNetLogoff10.c_str(), repeater.c_str(), starNetInfo10.c_str(), starNetPermanent10.c_str(), starNetUserTimeout10, starNetGroupTimeout10, int(starNetCallsignSwitch10), int(starNetTXMsgSwitch10));
|
||||
#endif
|
||||
}
|
||||
|
||||
wxString starNetBand11, starNetCallsign11, starNetLogoff11, starNetInfo11, starNetPermanent11, starNetLink11; // DEXTRA_LINK || DCS_LINK
|
||||
unsigned int starNetUserTimeout11, starNetGroupTimeout11;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch11;
|
||||
bool starNetTXMsgSwitch11;
|
||||
getStarNet11(starNetBand11, starNetCallsign11, starNetLogoff11, starNetInfo11, starNetPermanent11, starNetUserTimeout11, starNetGroupTimeout11, starNetCallsignSwitch11, starNetTXMsgSwitch11
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
,starNetLink11
|
||||
#endif
|
||||
);
|
||||
|
||||
if (!starNetCallsign11.IsEmpty() && !starNetCallsign11.IsSameAs(wxT(" "))) {
|
||||
wxString repeater = callsign;
|
||||
repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U);
|
||||
repeater.Append(starNetBand11);
|
||||
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
thread->addStarNet(starNetCallsign11, starNetLogoff11, repeater, starNetInfo11, starNetPermanent11, starNetUserTimeout11, starNetGroupTimeout11, starNetCallsignSwitch11, starNetTXMsgSwitch11, starNetLink11);
|
||||
wxLogInfo(wxT("StarNet 11 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign11.c_str(), starNetLogoff11.c_str(), repeater.c_str(), starNetInfo11.c_str(), starNetPermanent11.c_str(), starNetUserTimeout11, starNetGroupTimeout11, int(starNetCallsignSwitch11), int(starNetTXMsgSwitch11), starNetLink11.c_str());
|
||||
#else
|
||||
thread->addStarNet(starNetCallsign11, starNetLogoff11, repeater, starNetInfo11, starNetPermanent11, starNetUserTimeout11, starNetGroupTimeout11, starNetCallsignSwitch11, starNetTXMsgSwitch11);
|
||||
wxLogInfo(wxT("StarNet 11 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign11.c_str(), starNetLogoff11.c_str(), repeater.c_str(), starNetInfo11.c_str(), starNetPermanent11.c_str(), starNetUserTimeout11, starNetGroupTimeout11, int(starNetCallsignSwitch11), int(starNetTXMsgSwitch11));
|
||||
#endif
|
||||
}
|
||||
|
||||
wxString starNetBand12, starNetCallsign12, starNetLogoff12, starNetInfo12, starNetPermanent12, starNetLink12; // DEXTRA_LINK || DCS_LINK
|
||||
unsigned int starNetUserTimeout12, starNetGroupTimeout12;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch12;
|
||||
bool starNetTXMsgSwitch12;
|
||||
getStarNet12(starNetBand12, starNetCallsign12, starNetLogoff12, starNetInfo12, starNetPermanent12, starNetUserTimeout12, starNetGroupTimeout12, starNetCallsignSwitch12, starNetTXMsgSwitch12
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
,starNetLink12
|
||||
#endif
|
||||
);
|
||||
|
||||
if (!starNetCallsign12.IsEmpty() && !starNetCallsign12.IsSameAs(wxT(" "))) {
|
||||
wxString repeater = callsign;
|
||||
repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U);
|
||||
repeater.Append(starNetBand12);
|
||||
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
thread->addStarNet(starNetCallsign12, starNetLogoff12, repeater, starNetInfo12, starNetPermanent12, starNetUserTimeout12, starNetGroupTimeout12, starNetCallsignSwitch12, starNetTXMsgSwitch12, starNetLink12);
|
||||
wxLogInfo(wxT("StarNet 12 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign12.c_str(), starNetLogoff12.c_str(), repeater.c_str(), starNetInfo12.c_str(), starNetPermanent12.c_str(), starNetUserTimeout12, starNetGroupTimeout12, int(starNetCallsignSwitch12), int(starNetTXMsgSwitch12), starNetLink12.c_str());
|
||||
#else
|
||||
thread->addStarNet(starNetCallsign12, starNetLogoff12, repeater, starNetInfo12, starNetPermanent12, starNetUserTimeout12, starNetGroupTimeout12, starNetCallsignSwitch12, starNetTXMsgSwitch12);
|
||||
wxLogInfo(wxT("StarNet 12 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign12.c_str(), starNetLogoff12.c_str(), repeater.c_str(), starNetInfo12.c_str(), starNetPermanent12.c_str(), starNetUserTimeout12, starNetGroupTimeout12, int(starNetCallsignSwitch12), int(starNetTXMsgSwitch12));
|
||||
#endif
|
||||
}
|
||||
|
||||
wxString starNetBand13, starNetCallsign13, starNetLogoff13, starNetInfo13, starNetPermanent13, starNetLink13; // DEXTRA_LINK || DCS_LINK
|
||||
unsigned int starNetUserTimeout13, starNetGroupTimeout13;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch13;
|
||||
bool starNetTXMsgSwitch13;
|
||||
getStarNet13(starNetBand13, starNetCallsign13, starNetLogoff13, starNetInfo13, starNetPermanent13, starNetUserTimeout13, starNetGroupTimeout13, starNetCallsignSwitch13, starNetTXMsgSwitch13
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
,starNetLink13
|
||||
#endif
|
||||
);
|
||||
|
||||
if (!starNetCallsign13.IsEmpty() && !starNetCallsign13.IsSameAs(wxT(" "))) {
|
||||
wxString repeater = callsign;
|
||||
repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U);
|
||||
repeater.Append(starNetBand13);
|
||||
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
thread->addStarNet(starNetCallsign13, starNetLogoff13, repeater, starNetInfo13, starNetPermanent13, starNetUserTimeout13, starNetGroupTimeout13, starNetCallsignSwitch13, starNetTXMsgSwitch13, starNetLink13);
|
||||
wxLogInfo(wxT("StarNet 13 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign13.c_str(), starNetLogoff13.c_str(), repeater.c_str(), starNetInfo13.c_str(), starNetPermanent13.c_str(), starNetUserTimeout13, starNetGroupTimeout13, int(starNetCallsignSwitch13), int(starNetTXMsgSwitch13), starNetLink13.c_str());
|
||||
#else
|
||||
thread->addStarNet(starNetCallsign13, starNetLogoff13, repeater, starNetInfo13, starNetPermanent13, starNetUserTimeout13, starNetGroupTimeout13, starNetCallsignSwitch13, starNetTXMsgSwitch13);
|
||||
wxLogInfo(wxT("StarNet 13 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign13.c_str(), starNetLogoff13.c_str(), repeater.c_str(), starNetInfo13.c_str(), starNetPermanent13.c_str(), starNetUserTimeout13, starNetGroupTimeout13, int(starNetCallsignSwitch13), int(starNetTXMsgSwitch13));
|
||||
#endif
|
||||
}
|
||||
|
||||
wxString starNetBand14, starNetCallsign14, starNetLogoff14, starNetInfo14, starNetPermanent14, starNetLink14; // DEXTRA_LINK || DCS_LINK
|
||||
unsigned int starNetUserTimeout14, starNetGroupTimeout14;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch14;
|
||||
bool starNetTXMsgSwitch14;
|
||||
getStarNet14(starNetBand14, starNetCallsign14, starNetLogoff14, starNetInfo14, starNetPermanent14, starNetUserTimeout14, starNetGroupTimeout14, starNetCallsignSwitch14, starNetTXMsgSwitch14
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
,starNetLink14
|
||||
#endif
|
||||
);
|
||||
|
||||
if (!starNetCallsign14.IsEmpty() && !starNetCallsign14.IsSameAs(wxT(" "))) {
|
||||
wxString repeater = callsign;
|
||||
repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U);
|
||||
repeater.Append(starNetBand14);
|
||||
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
thread->addStarNet(starNetCallsign14, starNetLogoff14, repeater, starNetInfo14, starNetPermanent14, starNetUserTimeout14, starNetGroupTimeout14, starNetCallsignSwitch14, starNetTXMsgSwitch14, starNetLink14);
|
||||
wxLogInfo(wxT("StarNet 14 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign14.c_str(), starNetLogoff14.c_str(), repeater.c_str(), starNetInfo14.c_str(), starNetPermanent14.c_str(), starNetUserTimeout14, starNetGroupTimeout14, int(starNetCallsignSwitch14), int(starNetTXMsgSwitch14), starNetLink14.c_str());
|
||||
#else
|
||||
thread->addStarNet(starNetCallsign14, starNetLogoff14, repeater, starNetInfo14, starNetPermanent14, starNetUserTimeout14, starNetGroupTimeout14, starNetCallsignSwitch14, starNetTXMsgSwitch14);
|
||||
wxLogInfo(wxT("StarNet 14 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign14.c_str(), starNetLogoff14.c_str(), repeater.c_str(), starNetInfo14.c_str(), starNetPermanent14.c_str(), starNetUserTimeout14, starNetGroupTimeout14, int(starNetCallsignSwitch14), int(starNetTXMsgSwitch14));
|
||||
#endif
|
||||
}
|
||||
|
||||
wxString starNetBand15, starNetCallsign15, starNetLogoff15, starNetInfo15, starNetPermanent15, starNetLink15; // DEXTRA_LINK || DCS_LINK
|
||||
unsigned int starNetUserTimeout15, starNetGroupTimeout15;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch15;
|
||||
bool starNetTXMsgSwitch15;
|
||||
getStarNet15(starNetBand15, starNetCallsign15, starNetLogoff15, starNetInfo15, starNetPermanent15, starNetUserTimeout15, starNetGroupTimeout15, starNetCallsignSwitch15, starNetTXMsgSwitch15
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
,starNetLink15
|
||||
#endif
|
||||
);
|
||||
|
||||
if (!starNetCallsign15.IsEmpty() && !starNetCallsign15.IsSameAs(wxT(" "))) {
|
||||
wxString repeater = callsign;
|
||||
repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U);
|
||||
repeater.Append(starNetBand15);
|
||||
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
thread->addStarNet(starNetCallsign15, starNetLogoff15, repeater, starNetInfo15, starNetPermanent15, starNetUserTimeout15, starNetGroupTimeout15, starNetCallsignSwitch15, starNetTXMsgSwitch15, starNetLink15);
|
||||
wxLogInfo(wxT("StarNet 15 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign15.c_str(), starNetLogoff15.c_str(), repeater.c_str(), starNetInfo15.c_str(), starNetPermanent15.c_str(), starNetUserTimeout15, starNetGroupTimeout15, int(starNetCallsignSwitch15), int(starNetTXMsgSwitch15), starNetLink15.c_str());
|
||||
#else
|
||||
thread->addStarNet(starNetCallsign15, starNetLogoff15, repeater, starNetInfo15, starNetPermanent15, starNetUserTimeout15, starNetGroupTimeout15, starNetCallsignSwitch15, starNetTXMsgSwitch15);
|
||||
wxLogInfo(wxT("StarNet 15 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign15.c_str(), starNetLogoff15.c_str(), repeater.c_str(), starNetInfo15.c_str(), starNetPermanent15.c_str(), starNetUserTimeout15, starNetGroupTimeout15, int(starNetCallsignSwitch15), int(starNetTXMsgSwitch15));
|
||||
#endif
|
||||
}
|
||||
|
||||
bool remoteEnabled;
|
||||
wxString remotePassword;
|
||||
unsigned int remotePort;
|
||||
getRemote(remoteEnabled, remotePassword, remotePort);
|
||||
wxLogInfo(wxT("Remote enabled set to %d, port set to %u"), int(remoteEnabled), remotePort);
|
||||
thread->setRemote(remoteEnabled, remotePassword, remotePort);
|
||||
|
||||
thread->setLog(logEnabled);
|
||||
thread->setAddress(address);
|
||||
thread->setCallsign(callsign);
|
||||
|
||||
// Convert the worker class into a thread
|
||||
m_thread = new CStarNetServerThreadHelper(thread);
|
||||
m_thread->start();
|
||||
}
|
||||
|
|
@ -1,172 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2010,2011,2012,2018 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef StarNetServerApp_H
|
||||
#define StarNetServerApp_H
|
||||
|
||||
#include "StarNetServerThreadHelper.h"
|
||||
#include "StarNetServerConfig.h"
|
||||
#include "StarNetServerFrame.h"
|
||||
#include "Defs.h"
|
||||
|
||||
#include <wx/wx.h>
|
||||
|
||||
class CStarNetServerApp : public wxApp {
|
||||
|
||||
public:
|
||||
CStarNetServerApp();
|
||||
virtual ~CStarNetServerApp();
|
||||
|
||||
virtual bool OnInit();
|
||||
virtual int OnExit();
|
||||
|
||||
virtual void OnInitCmdLine(wxCmdLineParser& parser);
|
||||
virtual bool OnCmdLineParsed(wxCmdLineParser& parser);
|
||||
|
||||
// This is overridden because dialog boxes from threads are bad news
|
||||
#if defined(__WXDEBUG__)
|
||||
virtual void OnAssertFailure(const wxChar* file, int line, const wxChar* func, const wxChar* cond, const wxChar* msg);
|
||||
#endif
|
||||
|
||||
virtual void showLog(const wxString& text);
|
||||
|
||||
virtual void getGateway(wxString& callsign, wxString& address) const;
|
||||
virtual void setGateway(const wxString& callsign, const wxString& address);
|
||||
|
||||
virtual void getIrcDDB(wxString& hostname, wxString& username, wxString& password) const;
|
||||
virtual void setIrcDDB(const wxString& hostname, const wxString& username, const wxString& password);
|
||||
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
virtual void getStarNet1(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const;
|
||||
virtual void setStarNet1(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector);
|
||||
|
||||
virtual void getStarNet2(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const;
|
||||
virtual void setStarNet2(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector);
|
||||
|
||||
virtual void getStarNet3(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const;
|
||||
virtual void setStarNet3(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector);
|
||||
|
||||
virtual void getStarNet4(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const;
|
||||
virtual void setStarNet4(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector);
|
||||
|
||||
virtual void getStarNet5(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const;
|
||||
virtual void setStarNet5(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector);
|
||||
|
||||
virtual void getStarNet6(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const;
|
||||
virtual void setStarNet6(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector);
|
||||
|
||||
virtual void getStarNet7(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const;
|
||||
virtual void setStarNet7(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector);
|
||||
|
||||
virtual void getStarNet8(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const;
|
||||
virtual void setStarNet8(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector);
|
||||
|
||||
virtual void getStarNet9(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const;
|
||||
virtual void setStarNet9(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector);
|
||||
|
||||
virtual void getStarNet10(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const;
|
||||
virtual void setStarNet10(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector);
|
||||
|
||||
virtual void getStarNet11(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const;
|
||||
virtual void setStarNet11(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector);
|
||||
|
||||
virtual void getStarNet12(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const;
|
||||
virtual void setStarNet12(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector);
|
||||
|
||||
virtual void getStarNet13(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const;
|
||||
virtual void setStarNet13(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector);
|
||||
|
||||
virtual void getStarNet14(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const;
|
||||
virtual void setStarNet14(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector);
|
||||
|
||||
virtual void getStarNet15(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const;
|
||||
virtual void setStarNet15(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector);
|
||||
#else
|
||||
virtual void getStarNet1(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const;
|
||||
virtual void setStarNet1(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch);
|
||||
|
||||
virtual void getStarNet2(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const;
|
||||
virtual void setStarNet2(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch);
|
||||
|
||||
virtual void getStarNet3(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const;
|
||||
virtual void setStarNet3(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch);
|
||||
|
||||
virtual void getStarNet4(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const;
|
||||
virtual void setStarNet4(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch);
|
||||
|
||||
virtual void getStarNet5(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const;
|
||||
virtual void setStarNet5(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch);
|
||||
|
||||
virtual void getStarNet6(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const;
|
||||
virtual void setStarNet6(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch);
|
||||
|
||||
virtual void getStarNet7(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const;
|
||||
virtual void setStarNet7(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch);
|
||||
|
||||
virtual void getStarNet8(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const;
|
||||
virtual void setStarNet8(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch);
|
||||
|
||||
virtual void getStarNet9(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const;
|
||||
virtual void setStarNet9(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch);
|
||||
|
||||
virtual void getStarNet10(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const;
|
||||
virtual void setStarNet10(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch);
|
||||
|
||||
virtual void getStarNet11(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const;
|
||||
virtual void setStarNet11(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch);
|
||||
|
||||
virtual void getStarNet12(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const;
|
||||
virtual void setStarNet12(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch);
|
||||
|
||||
virtual void getStarNet13(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const;
|
||||
virtual void setStarNet13(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch);
|
||||
|
||||
virtual void getStarNet14(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const;
|
||||
virtual void setStarNet14(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch);
|
||||
|
||||
virtual void getStarNet15(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const;
|
||||
virtual void setStarNet15(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch);
|
||||
#endif
|
||||
|
||||
virtual void getRemote(bool& enabled, wxString& password, unsigned int& port) const;
|
||||
virtual void setRemote(bool enabled, const wxString& password, unsigned int port);
|
||||
|
||||
virtual void getMiscellaneous(bool& logEnabled) const;
|
||||
virtual void setMiscellaneous(bool logEnabled);
|
||||
|
||||
virtual void getPosition(int& x, int& y) const;
|
||||
virtual void setPosition(int x, int y);
|
||||
|
||||
virtual bool writeConfig();
|
||||
|
||||
private:
|
||||
bool m_nolog;
|
||||
bool m_gui;
|
||||
wxString m_logDir;
|
||||
wxString m_confDir;
|
||||
CStarNetServerFrame* m_frame;
|
||||
CStarNetServerThreadHelper* m_thread;
|
||||
CStarNetServerConfig* m_config;
|
||||
wxLogChain* m_logChain;
|
||||
|
||||
void createThread();
|
||||
};
|
||||
|
||||
wxDECLARE_APP(CStarNetServerApp);
|
||||
|
||||
#endif
|
||||
|
|
@ -1,561 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2010-2015 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include "IcomRepeaterProtocolHandler.h"
|
||||
#include "HBRepeaterProtocolHandler.h"
|
||||
#include "StarNetServerConfig.h"
|
||||
#include "StarNetServerAppD.h"
|
||||
#include "StarNetServerDefs.h"
|
||||
#include "APRSWriter.h"
|
||||
#include "Version.h"
|
||||
#include "Logger.h"
|
||||
#include "IRCDDBClient.h"
|
||||
|
||||
#include <wx/cmdline.h>
|
||||
#include <wx/wfstream.h>
|
||||
#include <wx/fileconf.h>
|
||||
#include <wx/filename.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
const wxChar* NOLOGGING_SWITCH = wxT("nolog");
|
||||
const wxChar* LOGDIR_OPTION = wxT("logdir");
|
||||
const wxChar* CONFDIR_OPTION = wxT("confdir");
|
||||
const wxChar* DAEMON_SWITCH = wxT("daemon");
|
||||
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
bool res = ::wxInitialize();
|
||||
if (!res) {
|
||||
::fprintf(stderr, "starnetserverd: failed to initialise the wxWidgets library, exiting\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
wxCmdLineParser parser(argc, argv);
|
||||
parser.AddSwitch(NOLOGGING_SWITCH, wxEmptyString, wxEmptyString, wxCMD_LINE_PARAM_OPTIONAL);
|
||||
parser.AddSwitch(DAEMON_SWITCH, wxEmptyString, wxEmptyString, wxCMD_LINE_PARAM_OPTIONAL);
|
||||
parser.AddOption(LOGDIR_OPTION, wxEmptyString, wxEmptyString, wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL);
|
||||
parser.AddOption(CONFDIR_OPTION, wxEmptyString, wxEmptyString, wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL);
|
||||
|
||||
int cmd = parser.Parse();
|
||||
if (cmd != 0) {
|
||||
::wxUninitialize();
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool nolog = parser.Found(NOLOGGING_SWITCH);
|
||||
bool daemon = parser.Found(DAEMON_SWITCH);
|
||||
|
||||
wxString logDir;
|
||||
bool found = parser.Found(LOGDIR_OPTION, &logDir);
|
||||
if (!found)
|
||||
logDir.Clear();
|
||||
|
||||
wxString confDir;
|
||||
found = parser.Found(CONFDIR_OPTION, &confDir);
|
||||
if (!found)
|
||||
confDir = wxT(CONF_DIR);
|
||||
|
||||
if (daemon) {
|
||||
pid_t pid = ::fork();
|
||||
|
||||
if (pid < 0) {
|
||||
::fprintf(stderr, "starnetserverd: error in fork(), exiting\n");
|
||||
::wxUninitialize();
|
||||
return 1;
|
||||
}
|
||||
|
||||
// If this is the parent, exit
|
||||
if (pid > 0)
|
||||
return 0;
|
||||
|
||||
// We are the child from here onwards
|
||||
::setsid();
|
||||
|
||||
::chdir("/");
|
||||
|
||||
::umask(0);
|
||||
}
|
||||
|
||||
CStarNetServerAppD gateway(nolog, logDir, confDir);
|
||||
|
||||
if (!gateway.init()) {
|
||||
::wxUninitialize();
|
||||
return 1;
|
||||
}
|
||||
|
||||
gateway.run();
|
||||
|
||||
::wxUninitialize();
|
||||
return 0;
|
||||
}
|
||||
|
||||
CStarNetServerAppD::CStarNetServerAppD(bool nolog, const wxString& logDir, const wxString& confDir) :
|
||||
m_nolog(nolog),
|
||||
m_logDir(logDir),
|
||||
m_confDir(confDir),
|
||||
m_thread(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
CStarNetServerAppD::~CStarNetServerAppD()
|
||||
{
|
||||
}
|
||||
|
||||
bool CStarNetServerAppD::init()
|
||||
{
|
||||
if (!m_nolog) {
|
||||
if (m_logDir.IsEmpty())
|
||||
m_logDir = wxT(LOG_DIR);
|
||||
|
||||
wxLog* log = new CLogger(m_logDir, LOG_BASE_NAME);
|
||||
wxLog::SetActiveTarget(log);
|
||||
} else {
|
||||
new wxLogNull;
|
||||
}
|
||||
|
||||
wxLogInfo(wxT("Starting ") + APPLICATION_NAME + wxT(" daemon - ") + VERSION);
|
||||
|
||||
// Log the version of wxWidgets and the Operating System
|
||||
wxLogInfo(wxT("Using wxWidgets %d.%d.%d on %s"), wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER, ::wxGetOsDescription().c_str());
|
||||
|
||||
return createThread();
|
||||
}
|
||||
|
||||
void CStarNetServerAppD::run()
|
||||
{
|
||||
m_thread->run();
|
||||
|
||||
wxLogInfo(APPLICATION_NAME + wxT(" is exiting"));
|
||||
}
|
||||
|
||||
bool CStarNetServerAppD::createThread()
|
||||
{
|
||||
CStarNetServerConfig config(m_confDir);
|
||||
|
||||
m_thread = new CStarNetServerThread(m_nolog, m_logDir);
|
||||
|
||||
wxString callsign, address;
|
||||
config.getGateway(callsign, address);
|
||||
|
||||
callsign.Append(wxT(" "));
|
||||
callsign.Truncate(LONG_CALLSIGN_LENGTH - 1U);
|
||||
callsign.Append(wxT("G"));
|
||||
|
||||
wxLogInfo(wxT("Gateway callsign set to %s, local address set to %s"), callsign.c_str(), address.c_str());
|
||||
|
||||
bool logEnabled;
|
||||
config.getMiscellaneous(logEnabled);
|
||||
wxLogInfo(wxT("Log enabled set to %d"), int(logEnabled));
|
||||
|
||||
wxString hostname, username, password;
|
||||
config.getIrcDDB(hostname, username, password);
|
||||
wxLogInfo(wxT("ircDDB host set to %s, username set to %s"), hostname.c_str(), username.c_str());
|
||||
|
||||
if (!hostname.IsEmpty() && !username.IsEmpty()) {
|
||||
#if defined(__WINDOWS__)
|
||||
CIRCDDB* ircDDB = new CIRCDDBClient(hostname, 9007U, username, password, wxT("win_") + LOG_BASE_NAME + wxT("-") + VERSION, address);
|
||||
#else
|
||||
CIRCDDB* ircDDB = new CIRCDDBClient(hostname, 9007U, username, password, wxT("linux_") + LOG_BASE_NAME + wxT("-") + VERSION, address);
|
||||
#endif
|
||||
bool res = ircDDB->open();
|
||||
if (!res) {
|
||||
wxLogError(wxT("Cannot initialise the ircDDB protocol handler"));
|
||||
return false;
|
||||
}
|
||||
|
||||
m_thread->setIRC(ircDDB);
|
||||
}
|
||||
|
||||
wxString starNetBand1, starNetCallsign1, starNetLogoff1, starNetInfo1, starNetPermanent1, starNetLink1; // DEXTRA_LINK || DCS_LINK
|
||||
unsigned int starNetUserTimeout1, starNetGroupTimeout1;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch1;
|
||||
bool starNetTXMsgSwitch1;
|
||||
config.getStarNet1(starNetBand1, starNetCallsign1, starNetLogoff1, starNetInfo1, starNetPermanent1, starNetUserTimeout1, starNetGroupTimeout1, starNetCallsignSwitch1, starNetTXMsgSwitch1
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
,starNetLink1
|
||||
#endif
|
||||
);
|
||||
|
||||
if (!starNetCallsign1.IsEmpty() && !starNetCallsign1.IsSameAs(wxT(" "))) {
|
||||
wxString repeater = callsign;
|
||||
repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U);
|
||||
repeater.Append(starNetBand1);
|
||||
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
m_thread->addStarNet(starNetCallsign1, starNetLogoff1, repeater, starNetInfo1, starNetPermanent1, starNetUserTimeout1, starNetGroupTimeout1, starNetCallsignSwitch1, starNetTXMsgSwitch1, starNetLink1);
|
||||
wxLogInfo(wxT("StarNet 1 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign1.c_str(), starNetLogoff1.c_str(), repeater.c_str(), starNetInfo1.c_str(), starNetPermanent1.c_str(), starNetUserTimeout1, starNetGroupTimeout1, int(starNetCallsignSwitch1), int(starNetTXMsgSwitch1), starNetLink1.c_str());
|
||||
#else
|
||||
m_thread->addStarNet(starNetCallsign1, starNetLogoff1, repeater, starNetInfo1, starNetPermanent1, starNetUserTimeout1, starNetGroupTimeout1, starNetCallsignSwitch1, starNetTXMsgSwitch1);
|
||||
wxLogInfo(wxT("StarNet 1 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign1.c_str(), starNetLogoff1.c_str(), repeater.c_str(), starNetInfo1.c_str(), starNetPermanent1.c_str(), starNetUserTimeout1, starNetGroupTimeout1, int(starNetCallsignSwitch1), int(starNetTXMsgSwitch1));
|
||||
#endif
|
||||
}
|
||||
|
||||
wxString starNetBand2, starNetCallsign2, starNetLogoff2, starNetInfo2, starNetPermanent2, starNetLink2; // DEXTRA_LINK || DCS_LINK
|
||||
unsigned int starNetUserTimeout2, starNetGroupTimeout2;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch2;
|
||||
bool starNetTXMsgSwitch2;
|
||||
config.getStarNet2(starNetBand2, starNetCallsign2, starNetLogoff2, starNetInfo2, starNetPermanent2, starNetUserTimeout2, starNetGroupTimeout2, starNetCallsignSwitch2, starNetTXMsgSwitch2
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
,starNetLink2
|
||||
#endif
|
||||
);
|
||||
|
||||
if (!starNetCallsign2.IsEmpty() && !starNetCallsign2.IsSameAs(wxT(" "))) {
|
||||
wxString repeater = callsign;
|
||||
repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U);
|
||||
repeater.Append(starNetBand2);
|
||||
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
m_thread->addStarNet(starNetCallsign2, starNetLogoff2, repeater, starNetInfo2, starNetPermanent2, starNetUserTimeout2, starNetGroupTimeout2, starNetCallsignSwitch2, starNetTXMsgSwitch2, starNetLink2);
|
||||
wxLogInfo(wxT("StarNet 2 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign2.c_str(), starNetLogoff2.c_str(), repeater.c_str(), starNetInfo2.c_str(), starNetPermanent2.c_str(), starNetUserTimeout2, starNetGroupTimeout2, int(starNetCallsignSwitch2), int(starNetTXMsgSwitch2), starNetLink2.c_str());
|
||||
#else
|
||||
m_thread->addStarNet(starNetCallsign2, starNetLogoff2, repeater, starNetInfo2, starNetPermanent2, starNetUserTimeout2, starNetGroupTimeout2, starNetCallsignSwitch2, starNetTXMsgSwitch2);
|
||||
wxLogInfo(wxT("StarNet 2 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign2.c_str(), starNetLogoff2.c_str(), repeater.c_str(), starNetInfo2.c_str(), starNetPermanent2.c_str(), starNetUserTimeout2, starNetGroupTimeout2, int(starNetCallsignSwitch2), int(starNetTXMsgSwitch2));
|
||||
#endif
|
||||
}
|
||||
|
||||
wxString starNetBand3, starNetCallsign3, starNetLogoff3, starNetInfo3, starNetPermanent3, starNetLink3; // DEXTRA_LINK || DCS_LINK
|
||||
unsigned int starNetUserTimeout3, starNetGroupTimeout3;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch3;
|
||||
bool starNetTXMsgSwitch3;
|
||||
config.getStarNet3(starNetBand3, starNetCallsign3, starNetLogoff3, starNetInfo3, starNetPermanent3, starNetUserTimeout3, starNetGroupTimeout3, starNetCallsignSwitch3, starNetTXMsgSwitch3
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
,starNetLink3
|
||||
#endif
|
||||
);
|
||||
|
||||
if (!starNetCallsign3.IsEmpty() && !starNetCallsign3.IsSameAs(wxT(" "))) {
|
||||
wxString repeater = callsign;
|
||||
repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U);
|
||||
repeater.Append(starNetBand3);
|
||||
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
m_thread->addStarNet(starNetCallsign3, starNetLogoff3, repeater, starNetInfo3, starNetPermanent3, starNetUserTimeout3, starNetGroupTimeout3, starNetCallsignSwitch3, starNetTXMsgSwitch3, starNetLink3);
|
||||
wxLogInfo(wxT("StarNet 3 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign3.c_str(), starNetLogoff3.c_str(), repeater.c_str(), starNetInfo3.c_str(), starNetPermanent3.c_str(), starNetUserTimeout3, starNetGroupTimeout3, int(starNetCallsignSwitch3), int(starNetTXMsgSwitch3), starNetLink3.c_str());
|
||||
#else
|
||||
m_thread->addStarNet(starNetCallsign3, starNetLogoff3, repeater, starNetInfo3, starNetPermanent3, starNetUserTimeout3, starNetGroupTimeout3, starNetCallsignSwitch3, starNetTXMsgSwitch3);
|
||||
wxLogInfo(wxT("StarNet 3 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign3.c_str(), starNetLogoff3.c_str(), repeater.c_str(), starNetInfo3.c_str(), starNetPermanent3.c_str(), starNetUserTimeout3, starNetGroupTimeout3, int(starNetCallsignSwitch3), int(starNetTXMsgSwitch3));
|
||||
#endif
|
||||
}
|
||||
|
||||
wxString starNetBand4, starNetCallsign4, starNetLogoff4, starNetInfo4, starNetPermanent4, starNetLink4; // DEXTRA_LINK || DCS_LINK
|
||||
unsigned int starNetUserTimeout4, starNetGroupTimeout4;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch4;
|
||||
bool starNetTXMsgSwitch4;
|
||||
config.getStarNet4(starNetBand4, starNetCallsign4, starNetLogoff4, starNetInfo4, starNetPermanent4, starNetUserTimeout4, starNetGroupTimeout4, starNetCallsignSwitch4, starNetTXMsgSwitch4
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
,starNetLink4
|
||||
#endif
|
||||
);
|
||||
|
||||
if (!starNetCallsign4.IsEmpty() && !starNetCallsign4.IsSameAs(wxT(" "))) {
|
||||
wxString repeater = callsign;
|
||||
repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U);
|
||||
repeater.Append(starNetBand4);
|
||||
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
m_thread->addStarNet(starNetCallsign4, starNetLogoff4, repeater, starNetInfo4, starNetPermanent4, starNetUserTimeout4, starNetGroupTimeout4, starNetCallsignSwitch4, starNetTXMsgSwitch4, starNetLink4);
|
||||
wxLogInfo(wxT("StarNet 4 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign4.c_str(), starNetLogoff4.c_str(), repeater.c_str(), starNetInfo4.c_str(), starNetPermanent4.c_str(), starNetUserTimeout4, starNetGroupTimeout4, int(starNetCallsignSwitch4), int(starNetTXMsgSwitch4), starNetLink4.c_str());
|
||||
#else
|
||||
m_thread->addStarNet(starNetCallsign4, starNetLogoff4, repeater, starNetInfo4, starNetPermanent4, starNetUserTimeout4, starNetGroupTimeout4, starNetCallsignSwitch4, starNetTXMsgSwitch4);
|
||||
wxLogInfo(wxT("StarNet 4 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign4.c_str(), starNetLogoff4.c_str(), repeater.c_str(), starNetInfo4.c_str(), starNetPermanent4.c_str(), starNetUserTimeout4, starNetGroupTimeout4, int(starNetCallsignSwitch4), int(starNetTXMsgSwitch4));
|
||||
#endif
|
||||
}
|
||||
|
||||
wxString starNetBand5, starNetCallsign5, starNetLogoff5, starNetInfo5, starNetPermanent5, starNetLink5; // DEXTRA_LINK || DCS_LINK
|
||||
unsigned int starNetUserTimeout5, starNetGroupTimeout5;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch5;
|
||||
bool starNetTXMsgSwitch5;
|
||||
config.getStarNet5(starNetBand5, starNetCallsign5, starNetLogoff5, starNetInfo5, starNetPermanent5, starNetUserTimeout5, starNetGroupTimeout5, starNetCallsignSwitch5, starNetTXMsgSwitch5
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
,starNetLink5
|
||||
#endif
|
||||
);
|
||||
|
||||
if (!starNetCallsign5.IsEmpty() && !starNetCallsign5.IsSameAs(wxT(" "))) {
|
||||
wxString repeater = callsign;
|
||||
repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U);
|
||||
repeater.Append(starNetBand5);
|
||||
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
m_thread->addStarNet(starNetCallsign5, starNetLogoff5, repeater, starNetInfo5, starNetPermanent5, starNetUserTimeout5, starNetGroupTimeout5, starNetCallsignSwitch5, starNetTXMsgSwitch5, starNetLink5);
|
||||
wxLogInfo(wxT("StarNet 5 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign5.c_str(), starNetLogoff5.c_str(), repeater.c_str(), starNetInfo5.c_str(), starNetPermanent5.c_str(), starNetUserTimeout5, starNetGroupTimeout5, int(starNetCallsignSwitch5), int(starNetTXMsgSwitch5), starNetLink5.c_str());
|
||||
#else
|
||||
m_thread->addStarNet(starNetCallsign5, starNetLogoff5, repeater, starNetInfo5, starNetPermanent5, starNetUserTimeout5, starNetGroupTimeout5, starNetCallsignSwitch5, starNetTXMsgSwitch5);
|
||||
wxLogInfo(wxT("StarNet 5 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign5.c_str(), starNetLogoff5.c_str(), repeater.c_str(), starNetInfo5.c_str(), starNetPermanent5.c_str(), starNetUserTimeout5, starNetGroupTimeout5, int(starNetCallsignSwitch5), int(starNetTXMsgSwitch5));
|
||||
#endif
|
||||
}
|
||||
|
||||
wxString starNetBand6, starNetCallsign6, starNetLogoff6, starNetInfo6, starNetPermanent6, starNetLink6; // DEXTRA_LINK || DCS_LINK
|
||||
unsigned int starNetUserTimeout6, starNetGroupTimeout6;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch6;
|
||||
bool starNetTXMsgSwitch6;
|
||||
config.getStarNet6(starNetBand6, starNetCallsign6, starNetLogoff6, starNetInfo6, starNetPermanent6, starNetUserTimeout6, starNetGroupTimeout6, starNetCallsignSwitch6, starNetTXMsgSwitch6
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
,starNetLink6
|
||||
#endif
|
||||
);
|
||||
|
||||
if (!starNetCallsign6.IsEmpty() && !starNetCallsign6.IsSameAs(wxT(" "))) {
|
||||
wxString repeater = callsign;
|
||||
repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U);
|
||||
repeater.Append(starNetBand6);
|
||||
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
m_thread->addStarNet(starNetCallsign6, starNetLogoff6, repeater, starNetInfo6, starNetPermanent6, starNetUserTimeout6, starNetGroupTimeout6, starNetCallsignSwitch6, starNetTXMsgSwitch6, starNetLink6);
|
||||
wxLogInfo(wxT("StarNet 6 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign6.c_str(), starNetLogoff6.c_str(), repeater.c_str(), starNetInfo6.c_str(), starNetPermanent6.c_str(), starNetUserTimeout6, starNetGroupTimeout6, int(starNetCallsignSwitch6), int(starNetTXMsgSwitch6), starNetLink6.c_str());
|
||||
#else
|
||||
m_thread->addStarNet(starNetCallsign6, starNetLogoff6, repeater, starNetInfo6, starNetPermanent6, starNetUserTimeout6, starNetGroupTimeout6, starNetCallsignSwitch6, starNetTXMsgSwitch6);
|
||||
wxLogInfo(wxT("StarNet 6 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign6.c_str(), starNetLogoff6.c_str(), repeater.c_str(), starNetInfo6.c_str(), starNetPermanent6.c_str(), starNetUserTimeout6, starNetGroupTimeout6, int(starNetCallsignSwitch6), int(starNetTXMsgSwitch6));
|
||||
#endif
|
||||
}
|
||||
|
||||
wxString starNetBand7, starNetCallsign7, starNetLogoff7, starNetInfo7, starNetPermanent7, starNetLink7; // DEXTRA_LINK || DCS_LINK
|
||||
unsigned int starNetUserTimeout7, starNetGroupTimeout7;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch7;
|
||||
bool starNetTXMsgSwitch7;
|
||||
config.getStarNet7(starNetBand7, starNetCallsign7, starNetLogoff7, starNetInfo7, starNetPermanent7, starNetUserTimeout7, starNetGroupTimeout7, starNetCallsignSwitch7, starNetTXMsgSwitch7
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
,starNetLink7
|
||||
#endif
|
||||
);
|
||||
|
||||
if (!starNetCallsign7.IsEmpty() && !starNetCallsign7.IsSameAs(wxT(" "))) {
|
||||
wxString repeater = callsign;
|
||||
repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U);
|
||||
repeater.Append(starNetBand7);
|
||||
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
m_thread->addStarNet(starNetCallsign7, starNetLogoff7, repeater, starNetInfo7, starNetPermanent7, starNetUserTimeout7, starNetGroupTimeout7, starNetCallsignSwitch7, starNetTXMsgSwitch7, starNetLink7);
|
||||
wxLogInfo(wxT("StarNet 7 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign7.c_str(), starNetLogoff7.c_str(), repeater.c_str(), starNetInfo7.c_str(), starNetPermanent7.c_str(), starNetUserTimeout7, starNetGroupTimeout7, int(starNetCallsignSwitch7), int(starNetTXMsgSwitch7), starNetLink7.c_str());
|
||||
#else
|
||||
m_thread->addStarNet(starNetCallsign7, starNetLogoff7, repeater, starNetInfo7, starNetPermanent7, starNetUserTimeout7, starNetGroupTimeout7, starNetCallsignSwitch7, starNetTXMsgSwitch7);
|
||||
wxLogInfo(wxT("StarNet 7 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign7.c_str(), starNetLogoff7.c_str(), repeater.c_str(), starNetInfo7.c_str(), starNetPermanent7.c_str(), starNetUserTimeout7, starNetGroupTimeout7, int(starNetCallsignSwitch7), int(starNetTXMsgSwitch7));
|
||||
#endif
|
||||
}
|
||||
|
||||
wxString starNetBand8, starNetCallsign8, starNetLogoff8, starNetInfo8, starNetPermanent8, starNetLink8; // DEXTRA_LINK || DCS_LINK
|
||||
unsigned int starNetUserTimeout8, starNetGroupTimeout8;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch8;
|
||||
bool starNetTXMsgSwitch8;
|
||||
config.getStarNet8(starNetBand8, starNetCallsign8, starNetLogoff8, starNetInfo8, starNetPermanent8, starNetUserTimeout8, starNetGroupTimeout8, starNetCallsignSwitch8, starNetTXMsgSwitch8
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
,starNetLink8
|
||||
#endif
|
||||
);
|
||||
|
||||
if (!starNetCallsign8.IsEmpty() && !starNetCallsign8.IsSameAs(wxT(" "))) {
|
||||
wxString repeater = callsign;
|
||||
repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U);
|
||||
repeater.Append(starNetBand8);
|
||||
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
m_thread->addStarNet(starNetCallsign8, starNetLogoff8, repeater, starNetInfo8, starNetPermanent8, starNetUserTimeout8, starNetGroupTimeout8, starNetCallsignSwitch8, starNetTXMsgSwitch8, starNetLink8);
|
||||
wxLogInfo(wxT("StarNet 8 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign8.c_str(), starNetLogoff8.c_str(), repeater.c_str(), starNetInfo8.c_str(), starNetPermanent8.c_str(), starNetUserTimeout8, starNetGroupTimeout8, int(starNetCallsignSwitch8), int(starNetTXMsgSwitch8), starNetLink8.c_str());
|
||||
#else
|
||||
m_thread->addStarNet(starNetCallsign8, starNetLogoff8, repeater, starNetInfo8, starNetPermanent8, starNetUserTimeout8, starNetGroupTimeout8, starNetCallsignSwitch8, starNetTXMsgSwitch8);
|
||||
wxLogInfo(wxT("StarNet 8 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign8.c_str(), starNetLogoff8.c_str(), repeater.c_str(), starNetInfo8.c_str(), starNetPermanent8.c_str(), starNetUserTimeout8, starNetGroupTimeout8, int(starNetCallsignSwitch8), int(starNetTXMsgSwitch8));
|
||||
#endif
|
||||
}
|
||||
|
||||
wxString starNetBand9, starNetCallsign9, starNetLogoff9, starNetInfo9, starNetPermanent9, starNetLink9; // DEXTRA_LINK || DCS_LINK
|
||||
unsigned int starNetUserTimeout9, starNetGroupTimeout9;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch9;
|
||||
bool starNetTXMsgSwitch9;
|
||||
config.getStarNet9(starNetBand9, starNetCallsign9, starNetLogoff9, starNetInfo9, starNetPermanent9, starNetUserTimeout9, starNetGroupTimeout9, starNetCallsignSwitch9, starNetTXMsgSwitch9
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
,starNetLink9
|
||||
#endif
|
||||
);
|
||||
|
||||
if (!starNetCallsign9.IsEmpty() && !starNetCallsign9.IsSameAs(wxT(" "))) {
|
||||
wxString repeater = callsign;
|
||||
repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U);
|
||||
repeater.Append(starNetBand9);
|
||||
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
m_thread->addStarNet(starNetCallsign9, starNetLogoff9, repeater, starNetInfo9, starNetPermanent9, starNetUserTimeout9, starNetGroupTimeout9, starNetCallsignSwitch9, starNetTXMsgSwitch9, starNetLink9);
|
||||
wxLogInfo(wxT("StarNet 9 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign9.c_str(), starNetLogoff9.c_str(), repeater.c_str(), starNetInfo9.c_str(), starNetPermanent9.c_str(), starNetUserTimeout9, starNetGroupTimeout9, int(starNetCallsignSwitch9), int(starNetTXMsgSwitch9), starNetLink9.c_str());
|
||||
#else
|
||||
m_thread->addStarNet(starNetCallsign9, starNetLogoff9, repeater, starNetInfo9, starNetPermanent9, starNetUserTimeout9, starNetGroupTimeout9, starNetCallsignSwitch9, starNetTXMsgSwitch9);
|
||||
wxLogInfo(wxT("StarNet 9 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign9.c_str(), starNetLogoff9.c_str(), repeater.c_str(), starNetInfo9.c_str(), starNetPermanent9.c_str(), starNetUserTimeout9, starNetGroupTimeout9, int(starNetCallsignSwitch9), int(starNetTXMsgSwitch9));
|
||||
#endif
|
||||
}
|
||||
|
||||
wxString starNetBand10, starNetCallsign10, starNetLogoff10, starNetInfo10, starNetPermanent10, starNetLink10; // DEXTRA_LINK || DCS_LINK
|
||||
unsigned int starNetUserTimeout10, starNetGroupTimeout10;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch10;
|
||||
bool starNetTXMsgSwitch10;
|
||||
config.getStarNet10(starNetBand10, starNetCallsign10, starNetLogoff10, starNetInfo10, starNetPermanent10, starNetUserTimeout10, starNetGroupTimeout10, starNetCallsignSwitch10, starNetTXMsgSwitch10
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
,starNetLink10
|
||||
#endif
|
||||
);
|
||||
|
||||
if (!starNetCallsign10.IsEmpty() && !starNetCallsign10.IsSameAs(wxT(" "))) {
|
||||
wxString repeater = callsign;
|
||||
repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U);
|
||||
repeater.Append(starNetBand10);
|
||||
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
m_thread->addStarNet(starNetCallsign10, starNetLogoff10, repeater, starNetInfo10, starNetPermanent10, starNetUserTimeout10, starNetGroupTimeout10, starNetCallsignSwitch10, starNetTXMsgSwitch10, starNetLink10);
|
||||
wxLogInfo(wxT("StarNet 10 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign10.c_str(), starNetLogoff10.c_str(), repeater.c_str(), starNetInfo10.c_str(), starNetPermanent10.c_str(), starNetUserTimeout10, starNetGroupTimeout10, int(starNetCallsignSwitch10), int(starNetTXMsgSwitch10), starNetLink10.c_str());
|
||||
#else
|
||||
m_thread->addStarNet(starNetCallsign10, starNetLogoff10, repeater, starNetInfo10, starNetPermanent10, starNetUserTimeout10, starNetGroupTimeout10, starNetCallsignSwitch10, starNetTXMsgSwitch10);
|
||||
wxLogInfo(wxT("StarNet 10 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign10.c_str(), starNetLogoff10.c_str(), repeater.c_str(), starNetInfo10.c_str(), starNetPermanent10.c_str(), starNetUserTimeout10, starNetGroupTimeout10, int(starNetCallsignSwitch10), int(starNetTXMsgSwitch10));
|
||||
#endif
|
||||
}
|
||||
|
||||
wxString starNetBand11, starNetCallsign11, starNetLogoff11, starNetInfo11, starNetPermanent11, starNetLink11; // DEXTRA_LINK || DCS_LINK
|
||||
unsigned int starNetUserTimeout11, starNetGroupTimeout11;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch11;
|
||||
bool starNetTXMsgSwitch11;
|
||||
config.getStarNet11(starNetBand11, starNetCallsign11, starNetLogoff11, starNetInfo11, starNetPermanent11, starNetUserTimeout11, starNetGroupTimeout11, starNetCallsignSwitch11, starNetTXMsgSwitch11
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
,starNetLink11
|
||||
#endif
|
||||
);
|
||||
|
||||
if (!starNetCallsign11.IsEmpty() && !starNetCallsign11.IsSameAs(wxT(" "))) {
|
||||
wxString repeater = callsign;
|
||||
repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U);
|
||||
repeater.Append(starNetBand11);
|
||||
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
m_thread->addStarNet(starNetCallsign11, starNetLogoff11, repeater, starNetInfo11, starNetPermanent11, starNetUserTimeout11, starNetGroupTimeout11, starNetCallsignSwitch11, starNetTXMsgSwitch11, starNetLink11);
|
||||
wxLogInfo(wxT("StarNet 11 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign11.c_str(), starNetLogoff11.c_str(), repeater.c_str(), starNetInfo11.c_str(), starNetPermanent11.c_str(), starNetUserTimeout11, starNetGroupTimeout11, int(starNetCallsignSwitch11), int(starNetTXMsgSwitch11), starNetLink11.c_str());
|
||||
#else
|
||||
m_thread->addStarNet(starNetCallsign11, starNetLogoff11, repeater, starNetInfo11, starNetPermanent11, starNetUserTimeout11, starNetGroupTimeout11, starNetCallsignSwitch11, starNetTXMsgSwitch11);
|
||||
wxLogInfo(wxT("StarNet 11 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign11.c_str(), starNetLogoff11.c_str(), repeater.c_str(), starNetInfo11.c_str(), starNetPermanent11.c_str(), starNetUserTimeout11, starNetGroupTimeout11, int(starNetCallsignSwitch11), int(starNetTXMsgSwitch11));
|
||||
#endif
|
||||
}
|
||||
|
||||
wxString starNetBand12, starNetCallsign12, starNetLogoff12, starNetInfo12, starNetPermanent12, starNetLink12; // DEXTRA_LINK || DCS_LINK
|
||||
unsigned int starNetUserTimeout12, starNetGroupTimeout12;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch12;
|
||||
bool starNetTXMsgSwitch12;
|
||||
config.getStarNet12(starNetBand12, starNetCallsign12, starNetLogoff12, starNetInfo12, starNetPermanent12, starNetUserTimeout12, starNetGroupTimeout12, starNetCallsignSwitch12, starNetTXMsgSwitch12
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
,starNetLink12
|
||||
#endif
|
||||
);
|
||||
|
||||
if (!starNetCallsign12.IsEmpty() && !starNetCallsign12.IsSameAs(wxT(" "))) {
|
||||
wxString repeater = callsign;
|
||||
repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U);
|
||||
repeater.Append(starNetBand12);
|
||||
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
m_thread->addStarNet(starNetCallsign12, starNetLogoff12, repeater, starNetInfo12, starNetPermanent12, starNetUserTimeout12, starNetGroupTimeout12, starNetCallsignSwitch12, starNetTXMsgSwitch12, starNetLink12);
|
||||
wxLogInfo(wxT("StarNet 12 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign12.c_str(), starNetLogoff12.c_str(), repeater.c_str(), starNetInfo12.c_str(), starNetPermanent12.c_str(), starNetUserTimeout12, starNetGroupTimeout12, int(starNetCallsignSwitch12), int(starNetTXMsgSwitch12), starNetLink12.c_str());
|
||||
#else
|
||||
m_thread->addStarNet(starNetCallsign12, starNetLogoff12, repeater, starNetInfo12, starNetPermanent12, starNetUserTimeout12, starNetGroupTimeout12, starNetCallsignSwitch12, starNetTXMsgSwitch12);
|
||||
wxLogInfo(wxT("StarNet 12 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign12.c_str(), starNetLogoff12.c_str(), repeater.c_str(), starNetInfo12.c_str(), starNetPermanent12.c_str(), starNetUserTimeout12, starNetGroupTimeout12, int(starNetCallsignSwitch12), int(starNetTXMsgSwitch12));
|
||||
#endif
|
||||
}
|
||||
|
||||
wxString starNetBand13, starNetCallsign13, starNetLogoff13, starNetInfo13, starNetPermanent13, starNetLink13; // DEXTRA_LINK || DCS_LINK
|
||||
unsigned int starNetUserTimeout13, starNetGroupTimeout13;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch13;
|
||||
bool starNetTXMsgSwitch13;
|
||||
config.getStarNet13(starNetBand13, starNetCallsign13, starNetLogoff13, starNetInfo13, starNetPermanent13, starNetUserTimeout13, starNetGroupTimeout13, starNetCallsignSwitch13, starNetTXMsgSwitch13
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
,starNetLink13
|
||||
#endif
|
||||
);
|
||||
|
||||
if (!starNetCallsign13.IsEmpty() && !starNetCallsign13.IsSameAs(wxT(" "))) {
|
||||
wxString repeater = callsign;
|
||||
repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U);
|
||||
repeater.Append(starNetBand13);
|
||||
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
m_thread->addStarNet(starNetCallsign13, starNetLogoff13, repeater, starNetInfo13, starNetPermanent13, starNetUserTimeout13, starNetGroupTimeout13, starNetCallsignSwitch13, starNetTXMsgSwitch13, starNetLink13);
|
||||
wxLogInfo(wxT("StarNet 13 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign13.c_str(), starNetLogoff13.c_str(), repeater.c_str(), starNetInfo13.c_str(), starNetPermanent13.c_str(), starNetUserTimeout13, starNetGroupTimeout13, int(starNetCallsignSwitch13), int(starNetTXMsgSwitch13), starNetLink13.c_str());
|
||||
#else
|
||||
m_thread->addStarNet(starNetCallsign13, starNetLogoff13, repeater, starNetInfo13, starNetPermanent13, starNetUserTimeout13, starNetGroupTimeout13, starNetCallsignSwitch13, starNetTXMsgSwitch13);
|
||||
wxLogInfo(wxT("StarNet 13 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign13.c_str(), starNetLogoff13.c_str(), repeater.c_str(), starNetInfo13.c_str(), starNetPermanent13.c_str(), starNetUserTimeout13, starNetGroupTimeout13, int(starNetCallsignSwitch13), int(starNetTXMsgSwitch13));
|
||||
#endif
|
||||
}
|
||||
|
||||
wxString starNetBand14, starNetCallsign14, starNetLogoff14, starNetInfo14, starNetPermanent14, starNetLink14; // DEXTRA_LINK || DCS_LINK
|
||||
unsigned int starNetUserTimeout14, starNetGroupTimeout14;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch14;
|
||||
bool starNetTXMsgSwitch14;
|
||||
config.getStarNet14(starNetBand14, starNetCallsign14, starNetLogoff14, starNetInfo14, starNetPermanent14, starNetUserTimeout14, starNetGroupTimeout14, starNetCallsignSwitch14, starNetTXMsgSwitch14
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
,starNetLink14
|
||||
#endif
|
||||
);
|
||||
|
||||
if (!starNetCallsign14.IsEmpty() && !starNetCallsign14.IsSameAs(wxT(" "))) {
|
||||
wxString repeater = callsign;
|
||||
repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U);
|
||||
repeater.Append(starNetBand14);
|
||||
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
m_thread->addStarNet(starNetCallsign14, starNetLogoff14, repeater, starNetInfo14, starNetPermanent14, starNetUserTimeout14, starNetGroupTimeout14, starNetCallsignSwitch14, starNetTXMsgSwitch14, starNetLink14);
|
||||
wxLogInfo(wxT("StarNet 14 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign14.c_str(), starNetLogoff14.c_str(), repeater.c_str(), starNetInfo14.c_str(), starNetPermanent14.c_str(), starNetUserTimeout14, starNetGroupTimeout14, int(starNetCallsignSwitch14), int(starNetTXMsgSwitch14), starNetLink14.c_str());
|
||||
#else
|
||||
m_thread->addStarNet(starNetCallsign14, starNetLogoff14, repeater, starNetInfo14, starNetPermanent14, starNetUserTimeout14, starNetGroupTimeout14, starNetCallsignSwitch14, starNetTXMsgSwitch14);
|
||||
wxLogInfo(wxT("StarNet 14 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign14.c_str(), starNetLogoff14.c_str(), repeater.c_str(), starNetInfo14.c_str(), starNetPermanent14.c_str(), starNetUserTimeout14, starNetGroupTimeout14, int(starNetCallsignSwitch14), int(starNetTXMsgSwitch14));
|
||||
#endif
|
||||
}
|
||||
|
||||
wxString starNetBand15, starNetCallsign15, starNetLogoff15, starNetInfo15, starNetPermanent15, starNetLink15; // DEXTRA_LINK || DCS_LINK
|
||||
unsigned int starNetUserTimeout15, starNetGroupTimeout15;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch15;
|
||||
bool starNetTXMsgSwitch15;
|
||||
config.getStarNet15(starNetBand15, starNetCallsign15, starNetLogoff15, starNetInfo15, starNetPermanent15, starNetUserTimeout15, starNetGroupTimeout15, starNetCallsignSwitch15, starNetTXMsgSwitch15
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
,starNetLink15
|
||||
#endif
|
||||
);
|
||||
|
||||
if (!starNetCallsign15.IsEmpty() && !starNetCallsign15.IsSameAs(wxT(" "))) {
|
||||
wxString repeater = callsign;
|
||||
repeater.Truncate(LONG_CALLSIGN_LENGTH - 1U);
|
||||
repeater.Append(starNetBand15);
|
||||
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
m_thread->addStarNet(starNetCallsign15, starNetLogoff15, repeater, starNetInfo15, starNetPermanent15, starNetUserTimeout15, starNetGroupTimeout15, starNetCallsignSwitch15, starNetTXMsgSwitch15, starNetLink15);
|
||||
wxLogInfo(wxT("StarNet 15 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d, reflector: %s"), starNetCallsign15.c_str(), starNetLogoff15.c_str(), repeater.c_str(), starNetInfo15.c_str(), starNetPermanent15.c_str(), starNetUserTimeout15, starNetGroupTimeout15, int(starNetCallsignSwitch15), int(starNetTXMsgSwitch15), starNetLink15.c_str());
|
||||
#else
|
||||
m_thread->addStarNet(starNetCallsign15, starNetLogoff15, repeater, starNetInfo15, starNetPermanent15, starNetUserTimeout15, starNetGroupTimeout15, starNetCallsignSwitch15, starNetTXMsgSwitch15);
|
||||
wxLogInfo(wxT("StarNet 15 set to %s/%s on repeater %s, info: \"%s\", permanent: %s, user: %u mins, group: %u mins, callsign switch: %d, tx msg switch: %d"), starNetCallsign15.c_str(), starNetLogoff15.c_str(), repeater.c_str(), starNetInfo15.c_str(), starNetPermanent15.c_str(), starNetUserTimeout15, starNetGroupTimeout15, int(starNetCallsignSwitch15), int(starNetTXMsgSwitch15));
|
||||
#endif
|
||||
}
|
||||
|
||||
bool remoteEnabled;
|
||||
wxString remotePassword;
|
||||
unsigned int remotePort;
|
||||
config.getRemote(remoteEnabled, remotePassword, remotePort);
|
||||
wxLogInfo(wxT("Remote enabled set to %d, port set to %u"), int(remoteEnabled), remotePort);
|
||||
m_thread->setRemote(remoteEnabled, remotePassword, remotePort);
|
||||
|
||||
m_thread->setLog(logEnabled);
|
||||
m_thread->setAddress(address);
|
||||
m_thread->setCallsign(callsign);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2010,2011 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef StarNetServerAppD_H
|
||||
#define StarNetServerAppD_H
|
||||
|
||||
#include "StarNetServerThread.h"
|
||||
|
||||
#include <wx/wx.h>
|
||||
#include <wx/config.h>
|
||||
|
||||
class CStarNetServerAppD {
|
||||
|
||||
public:
|
||||
CStarNetServerAppD(bool nolog, const wxString& logDir, const wxString& confDir);
|
||||
~CStarNetServerAppD();
|
||||
|
||||
bool init();
|
||||
|
||||
void run();
|
||||
|
||||
private:
|
||||
bool m_nolog;
|
||||
wxString m_logDir;
|
||||
wxString m_confDir;
|
||||
CStarNetServerThread* m_thread;
|
||||
|
||||
bool createThread();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -1,94 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2010,2011 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include "StarNetServerCallsignSet.h"
|
||||
#include "DStarDefines.h"
|
||||
#include <cctype>
|
||||
|
||||
const unsigned int CALLSIGN_WIDTH = 120U;
|
||||
const unsigned int ADDRESS_WIDTH = 120U;
|
||||
|
||||
const unsigned int ADDRESS_LENGTH = 15U;
|
||||
|
||||
const unsigned int BORDER_SIZE = 5U;
|
||||
|
||||
CStarNetServerCallsignSet::CStarNetServerCallsignSet(wxWindow* parent, int id, const wxString& title, const wxString& callsign, const wxString& address) :
|
||||
wxPanel(parent, id),
|
||||
m_title(title),
|
||||
m_callsign(NULL),
|
||||
m_address(NULL)
|
||||
{
|
||||
wxFlexGridSizer* sizer = new wxFlexGridSizer(3);
|
||||
|
||||
wxStaticText* callsignLabel = new wxStaticText(this, -1, _("Callsign"));
|
||||
sizer->Add(callsignLabel, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE);
|
||||
|
||||
wxString call = callsign;
|
||||
call.Truncate(LONG_CALLSIGN_LENGTH - 1U);
|
||||
call.Trim();
|
||||
|
||||
m_callsign = new CCallsignTextCtrl(this, -1, call, wxDefaultPosition, wxSize(CALLSIGN_WIDTH, -1));
|
||||
m_callsign->SetMaxLength(LONG_CALLSIGN_LENGTH);
|
||||
sizer->Add(m_callsign, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
|
||||
|
||||
wxStaticText* gLabel = new wxStaticText(this, -1, wxT("G"));
|
||||
sizer->Add(gLabel, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE);
|
||||
|
||||
wxStaticText* addressLabel = new wxStaticText(this, -1, _("Address"));
|
||||
sizer->Add(addressLabel, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE);
|
||||
|
||||
m_address = new CAddressTextCtrl(this, -1, address, wxDefaultPosition, wxSize(ADDRESS_WIDTH, -1));
|
||||
m_address->SetMaxLength(ADDRESS_LENGTH);
|
||||
sizer->Add(m_address, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
|
||||
|
||||
SetAutoLayout(true);
|
||||
|
||||
SetSizer(sizer);
|
||||
}
|
||||
|
||||
|
||||
CStarNetServerCallsignSet::~CStarNetServerCallsignSet()
|
||||
{
|
||||
}
|
||||
|
||||
bool CStarNetServerCallsignSet::Validate()
|
||||
{
|
||||
wxString callsign = getCallsign();
|
||||
|
||||
if (callsign.IsEmpty()) {
|
||||
wxMessageDialog dialog(this, _("The Callsign Callsign is not valid"), m_title + _(" Error"), wxICON_ERROR);
|
||||
dialog.ShowModal();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
wxString CStarNetServerCallsignSet::getCallsign() const
|
||||
{
|
||||
wxString callsign = m_callsign->GetValue();
|
||||
|
||||
callsign.MakeUpper();
|
||||
|
||||
return callsign;
|
||||
}
|
||||
|
||||
wxString CStarNetServerCallsignSet::getAddress() const
|
||||
{
|
||||
return m_address->GetValue();
|
||||
}
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2010,2011 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef StarNetServerCallsignSet_H
|
||||
#define StarNetServerCallsignSet_H
|
||||
|
||||
#include "CallsignTextCtrl.h"
|
||||
#include "AddressTextCtrl.h"
|
||||
#include "Defs.h"
|
||||
|
||||
#include <wx/wx.h>
|
||||
|
||||
class CStarNetServerCallsignSet : public wxPanel {
|
||||
public:
|
||||
CStarNetServerCallsignSet(wxWindow* parent, int id, const wxString& title, const wxString& callsign, const wxString& address);
|
||||
virtual ~CStarNetServerCallsignSet();
|
||||
|
||||
virtual bool Validate();
|
||||
|
||||
virtual wxString getCallsign() const;
|
||||
virtual wxString getAddress() const;
|
||||
|
||||
private:
|
||||
wxString m_title;
|
||||
CCallsignTextCtrl* m_callsign;
|
||||
CAddressTextCtrl* m_address;
|
||||
};
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,314 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2010,2011,2012,2014 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef StarNetServerConfig_H
|
||||
#define StarNetServerConfig_H
|
||||
|
||||
#include "Defs.h"
|
||||
|
||||
#include <wx/wx.h>
|
||||
#include <wx/config.h>
|
||||
#include <wx/filename.h>
|
||||
|
||||
class CStarNetServerConfig {
|
||||
public:
|
||||
#if defined(__WINDOWS__)
|
||||
CStarNetServerConfig(wxConfigBase* config, const wxString& dir);
|
||||
#else
|
||||
CStarNetServerConfig(const wxString& dir);
|
||||
#endif
|
||||
~CStarNetServerConfig();
|
||||
|
||||
void getGateway(wxString& callsign, wxString& address) const;
|
||||
void setGateway(const wxString& callsign, const wxString& address);
|
||||
|
||||
void getIrcDDB(wxString& hostname, wxString& username, wxString& password) const;
|
||||
void setIrcDDB(const wxString& hostname, const wxString& username, const wxString& password);
|
||||
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
void getStarNet1(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const;
|
||||
void setStarNet1(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector);
|
||||
|
||||
void getStarNet2(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const;
|
||||
void setStarNet2(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector);
|
||||
|
||||
void getStarNet3(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const;
|
||||
void setStarNet3(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector);
|
||||
|
||||
void getStarNet4(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const;
|
||||
void setStarNet4(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector);
|
||||
|
||||
void getStarNet5(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const;
|
||||
void setStarNet5(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector);
|
||||
|
||||
void getStarNet6(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const;
|
||||
void setStarNet6(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector);
|
||||
|
||||
void getStarNet7(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const;
|
||||
void setStarNet7(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector);
|
||||
|
||||
void getStarNet8(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const;
|
||||
void setStarNet8(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector);
|
||||
|
||||
void getStarNet9(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const;
|
||||
void setStarNet9(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector);
|
||||
|
||||
void getStarNet10(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const;
|
||||
void setStarNet10(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector);
|
||||
|
||||
void getStarNet11(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const;
|
||||
void setStarNet11(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector);
|
||||
|
||||
void getStarNet12(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const;
|
||||
void setStarNet12(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector);
|
||||
|
||||
void getStarNet13(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const;
|
||||
void setStarNet13(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector);
|
||||
|
||||
void getStarNet14(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const;
|
||||
void setStarNet14(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector);
|
||||
|
||||
void getStarNet15(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch, wxString& reflector) const;
|
||||
void setStarNet15(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector);
|
||||
#else
|
||||
void getStarNet1(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const;
|
||||
void setStarNet1(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch);
|
||||
|
||||
void getStarNet2(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const;
|
||||
void setStarNet2(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch);
|
||||
|
||||
void getStarNet3(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const;
|
||||
void setStarNet3(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch);
|
||||
|
||||
void getStarNet4(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const;
|
||||
void setStarNet4(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch);
|
||||
|
||||
void getStarNet5(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const;
|
||||
void setStarNet5(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch);
|
||||
|
||||
void getStarNet6(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const;
|
||||
void setStarNet6(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch);
|
||||
|
||||
void getStarNet7(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const;
|
||||
void setStarNet7(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch);
|
||||
|
||||
void getStarNet8(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const;
|
||||
void setStarNet8(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch);
|
||||
|
||||
void getStarNet9(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const;
|
||||
void setStarNet9(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch);
|
||||
|
||||
void getStarNet10(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const;
|
||||
void setStarNet10(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch);
|
||||
|
||||
void getStarNet11(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const;
|
||||
void setStarNet11(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch);
|
||||
|
||||
void getStarNet12(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const;
|
||||
void setStarNet12(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch);
|
||||
|
||||
void getStarNet13(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const;
|
||||
void setStarNet13(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch);
|
||||
|
||||
void getStarNet14(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const;
|
||||
void setStarNet14(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch);
|
||||
|
||||
void getStarNet15(wxString& band, wxString& callsign, wxString& logoff, wxString& info, wxString& permanent, unsigned int& userTimeout, unsigned int& groupTimeout, STARNET_CALLSIGN_SWITCH& callsignSwitch, bool& txMsgSwitch) const;
|
||||
void setStarNet15(const wxString& band, const wxString& callsign, const wxString& logoff, const wxString& info, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch);
|
||||
#endif
|
||||
|
||||
void getRemote(bool& enabled, wxString& password, unsigned int& port) const;
|
||||
void setRemote(bool enabled, const wxString& password, unsigned int port);
|
||||
|
||||
void getMiscellaneous(bool& enabled) const;
|
||||
void setMiscellaneous(bool enabled);
|
||||
|
||||
void getPosition(int& x, int& y) const;
|
||||
void setPosition(int x, int y);
|
||||
|
||||
bool write();
|
||||
|
||||
private:
|
||||
#if defined(__WINDOWS__)
|
||||
wxConfigBase* m_config;
|
||||
#endif
|
||||
wxFileName m_fileName;
|
||||
wxString m_callsign;
|
||||
wxString m_address;
|
||||
wxString m_ircddbHostname;
|
||||
wxString m_ircddbUsername;
|
||||
wxString m_ircddbPassword;
|
||||
wxString m_starNet1Band;
|
||||
wxString m_starNet1Callsign;
|
||||
wxString m_starNet1Logoff;
|
||||
wxString m_starNet1Info;
|
||||
wxString m_starNet1Permanent;
|
||||
unsigned int m_starNet1UserTimeout;
|
||||
unsigned int m_starNet1GroupTimeout;
|
||||
STARNET_CALLSIGN_SWITCH m_starNet1CallsignSwitch;
|
||||
bool m_starNet1TxMsgSwitch;
|
||||
wxString m_starNet1Reflector;
|
||||
wxString m_starNet2Band;
|
||||
wxString m_starNet2Callsign;
|
||||
wxString m_starNet2Logoff;
|
||||
wxString m_starNet2Info;
|
||||
wxString m_starNet2Permanent;
|
||||
unsigned int m_starNet2UserTimeout;
|
||||
unsigned int m_starNet2GroupTimeout;
|
||||
STARNET_CALLSIGN_SWITCH m_starNet2CallsignSwitch;
|
||||
bool m_starNet2TxMsgSwitch;
|
||||
wxString m_starNet2Reflector;
|
||||
wxString m_starNet3Band;
|
||||
wxString m_starNet3Callsign;
|
||||
wxString m_starNet3Logoff;
|
||||
wxString m_starNet3Info;
|
||||
wxString m_starNet3Permanent;
|
||||
unsigned int m_starNet3UserTimeout;
|
||||
unsigned int m_starNet3GroupTimeout;
|
||||
STARNET_CALLSIGN_SWITCH m_starNet3CallsignSwitch;
|
||||
bool m_starNet3TxMsgSwitch;
|
||||
wxString m_starNet3Reflector;
|
||||
wxString m_starNet4Band;
|
||||
wxString m_starNet4Callsign;
|
||||
wxString m_starNet4Logoff;
|
||||
wxString m_starNet4Info;
|
||||
wxString m_starNet4Permanent;
|
||||
unsigned int m_starNet4UserTimeout;
|
||||
unsigned int m_starNet4GroupTimeout;
|
||||
STARNET_CALLSIGN_SWITCH m_starNet4CallsignSwitch;
|
||||
bool m_starNet4TxMsgSwitch;
|
||||
wxString m_starNet4Reflector;
|
||||
wxString m_starNet5Band;
|
||||
wxString m_starNet5Callsign;
|
||||
wxString m_starNet5Logoff;
|
||||
wxString m_starNet5Info;
|
||||
wxString m_starNet5Permanent;
|
||||
unsigned int m_starNet5UserTimeout;
|
||||
unsigned int m_starNet5GroupTimeout;
|
||||
STARNET_CALLSIGN_SWITCH m_starNet5CallsignSwitch;
|
||||
bool m_starNet5TxMsgSwitch;
|
||||
wxString m_starNet5Reflector;
|
||||
wxString m_starNet6Band;
|
||||
wxString m_starNet6Callsign;
|
||||
wxString m_starNet6Logoff;
|
||||
wxString m_starNet6Info;
|
||||
wxString m_starNet6Permanent;
|
||||
unsigned int m_starNet6UserTimeout;
|
||||
unsigned int m_starNet6GroupTimeout;
|
||||
STARNET_CALLSIGN_SWITCH m_starNet6CallsignSwitch;
|
||||
bool m_starNet6TxMsgSwitch;
|
||||
wxString m_starNet6Reflector;
|
||||
wxString m_starNet7Band;
|
||||
wxString m_starNet7Callsign;
|
||||
wxString m_starNet7Logoff;
|
||||
wxString m_starNet7Info;
|
||||
wxString m_starNet7Permanent;
|
||||
unsigned int m_starNet7UserTimeout;
|
||||
unsigned int m_starNet7GroupTimeout;
|
||||
STARNET_CALLSIGN_SWITCH m_starNet7CallsignSwitch;
|
||||
bool m_starNet7TxMsgSwitch;
|
||||
wxString m_starNet7Reflector;
|
||||
wxString m_starNet8Band;
|
||||
wxString m_starNet8Callsign;
|
||||
wxString m_starNet8Logoff;
|
||||
wxString m_starNet8Info;
|
||||
wxString m_starNet8Permanent;
|
||||
unsigned int m_starNet8UserTimeout;
|
||||
unsigned int m_starNet8GroupTimeout;
|
||||
STARNET_CALLSIGN_SWITCH m_starNet8CallsignSwitch;
|
||||
bool m_starNet8TxMsgSwitch;
|
||||
wxString m_starNet8Reflector;
|
||||
wxString m_starNet9Band;
|
||||
wxString m_starNet9Callsign;
|
||||
wxString m_starNet9Logoff;
|
||||
wxString m_starNet9Info;
|
||||
wxString m_starNet9Permanent;
|
||||
unsigned int m_starNet9UserTimeout;
|
||||
unsigned int m_starNet9GroupTimeout;
|
||||
STARNET_CALLSIGN_SWITCH m_starNet9CallsignSwitch;
|
||||
bool m_starNet9TxMsgSwitch;
|
||||
wxString m_starNet9Reflector;
|
||||
wxString m_starNet10Band;
|
||||
wxString m_starNet10Callsign;
|
||||
wxString m_starNet10Logoff;
|
||||
wxString m_starNet10Info;
|
||||
wxString m_starNet10Permanent;
|
||||
unsigned int m_starNet10UserTimeout;
|
||||
unsigned int m_starNet10GroupTimeout;
|
||||
STARNET_CALLSIGN_SWITCH m_starNet10CallsignSwitch;
|
||||
bool m_starNet10TxMsgSwitch;
|
||||
wxString m_starNet10Reflector;
|
||||
wxString m_starNet11Band;
|
||||
wxString m_starNet11Callsign;
|
||||
wxString m_starNet11Logoff;
|
||||
wxString m_starNet11Info;
|
||||
wxString m_starNet11Permanent;
|
||||
unsigned int m_starNet11UserTimeout;
|
||||
unsigned int m_starNet11GroupTimeout;
|
||||
STARNET_CALLSIGN_SWITCH m_starNet11CallsignSwitch;
|
||||
bool m_starNet11TxMsgSwitch;
|
||||
wxString m_starNet11Reflector;
|
||||
wxString m_starNet12Band;
|
||||
wxString m_starNet12Callsign;
|
||||
wxString m_starNet12Logoff;
|
||||
wxString m_starNet12Info;
|
||||
wxString m_starNet12Permanent;
|
||||
unsigned int m_starNet12UserTimeout;
|
||||
unsigned int m_starNet12GroupTimeout;
|
||||
STARNET_CALLSIGN_SWITCH m_starNet12CallsignSwitch;
|
||||
bool m_starNet12TxMsgSwitch;
|
||||
wxString m_starNet12Reflector;
|
||||
wxString m_starNet13Band;
|
||||
wxString m_starNet13Callsign;
|
||||
wxString m_starNet13Logoff;
|
||||
wxString m_starNet13Info;
|
||||
wxString m_starNet13Permanent;
|
||||
unsigned int m_starNet13UserTimeout;
|
||||
unsigned int m_starNet13GroupTimeout;
|
||||
STARNET_CALLSIGN_SWITCH m_starNet13CallsignSwitch;
|
||||
bool m_starNet13TxMsgSwitch;
|
||||
wxString m_starNet13Reflector;
|
||||
wxString m_starNet14Band;
|
||||
wxString m_starNet14Callsign;
|
||||
wxString m_starNet14Logoff;
|
||||
wxString m_starNet14Info;
|
||||
wxString m_starNet14Permanent;
|
||||
unsigned int m_starNet14UserTimeout;
|
||||
unsigned int m_starNet14GroupTimeout;
|
||||
STARNET_CALLSIGN_SWITCH m_starNet14CallsignSwitch;
|
||||
bool m_starNet14TxMsgSwitch;
|
||||
wxString m_starNet14Reflector;
|
||||
wxString m_starNet15Band;
|
||||
wxString m_starNet15Callsign;
|
||||
wxString m_starNet15Logoff;
|
||||
wxString m_starNet15Info;
|
||||
wxString m_starNet15Permanent;
|
||||
unsigned int m_starNet15UserTimeout;
|
||||
unsigned int m_starNet15GroupTimeout;
|
||||
STARNET_CALLSIGN_SWITCH m_starNet15CallsignSwitch;
|
||||
bool m_starNet15TxMsgSwitch;
|
||||
wxString m_starNet15Reflector;
|
||||
bool m_remoteEnabled;
|
||||
wxString m_remotePassword;
|
||||
unsigned int m_remotePort;
|
||||
bool m_logEnabled;
|
||||
int m_x;
|
||||
int m_y;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2010,2011,2012,2014 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef StarNetServerDefs_H
|
||||
#define StarNetServerDefs_H
|
||||
|
||||
#include <wx/wx.h>
|
||||
|
||||
const wxString APPLICATION_NAME = wxT("StarNet Server");
|
||||
|
||||
const wxString LOG_BASE_NAME = wxT("STARnetServer");
|
||||
|
||||
const wxString CONFIG_FILE_NAME = wxT("starnetserver");
|
||||
|
||||
const unsigned int MAX_STARNETS = 15U;
|
||||
const unsigned int MAX_DEXTRA_LINKS = 15U;
|
||||
const unsigned int MAX_DCS_LINKS = 15U;
|
||||
const unsigned int MAX_ROUTES = 0U;
|
||||
|
||||
#endif
|
||||
|
|
@ -1,719 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2010-2015,2018 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include "StarNetServerPreferences.h"
|
||||
#include "StarNetServerFrame.h"
|
||||
#include "StarNetServerDefs.h"
|
||||
#include "StarNetServerApp.h"
|
||||
#include "LogEvent.h"
|
||||
#include "Version.h"
|
||||
|
||||
const unsigned int BORDER_SIZE = 5U;
|
||||
|
||||
#if defined(__WINDOWS__)
|
||||
const unsigned int LOGTEXT_WIDTH = 560U;
|
||||
#else
|
||||
const unsigned int LOGTEXT_WIDTH = 700U;
|
||||
#endif
|
||||
|
||||
#include <wx/gbsizer.h>
|
||||
#include <wx/aboutdlg.h>
|
||||
|
||||
DEFINE_EVENT_TYPE(LOG_EVENT)
|
||||
|
||||
enum {
|
||||
Menu_Edit_Preferences = 6000,
|
||||
Menu_View_Updates
|
||||
};
|
||||
|
||||
BEGIN_EVENT_TABLE(CStarNetServerFrame, wxFrame)
|
||||
EVT_MENU(wxID_EXIT, CStarNetServerFrame::onQuit)
|
||||
EVT_MENU(Menu_Edit_Preferences, CStarNetServerFrame::onPreferences)
|
||||
EVT_MENU(Menu_View_Updates, CStarNetServerFrame::onUpdates)
|
||||
EVT_MENU(wxID_ABOUT, CStarNetServerFrame::onAbout)
|
||||
|
||||
EVT_CLOSE(CStarNetServerFrame::onClose)
|
||||
|
||||
EVT_CUSTOM(LOG_EVENT, wxID_ANY, CStarNetServerFrame::onLog)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
CStarNetServerFrame::CStarNetServerFrame(const wxString& title, const wxPoint& position, bool gui) :
|
||||
wxFrame(NULL, -1, title, position),
|
||||
#if defined(__WXDEBUG__)
|
||||
m_updates(true)
|
||||
#else
|
||||
m_updates(gui)
|
||||
#endif
|
||||
{
|
||||
SetMenuBar(createMenuBar());
|
||||
|
||||
wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
wxPanel* panel = new wxPanel(this);
|
||||
|
||||
wxBoxSizer* panelSizer = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
wxStaticBoxSizer* log1Sizer = new wxStaticBoxSizer(new wxStaticBox(panel, -1, _("Log")), wxVERTICAL);
|
||||
wxBoxSizer* log2Sizer = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
for (unsigned int i = 0U; i < 20U; i++) {
|
||||
m_logLine[i] = new wxStaticText(panel, -1, wxEmptyString, wxDefaultPosition, wxSize(LOGTEXT_WIDTH, -1));
|
||||
m_logLine[i]->Wrap(LOGTEXT_WIDTH);
|
||||
log2Sizer->Add(m_logLine[i], 0, wxTOP | wxLEFT | wxRIGHT, BORDER_SIZE);
|
||||
}
|
||||
|
||||
log1Sizer->Add(log2Sizer);
|
||||
panelSizer->Add(log1Sizer, 0, wxALL, BORDER_SIZE);
|
||||
|
||||
panel->SetSizer(panelSizer);
|
||||
panelSizer->SetSizeHints(panel);
|
||||
|
||||
mainSizer->Add(panel);
|
||||
|
||||
SetSizer(mainSizer);
|
||||
mainSizer->SetSizeHints(this);
|
||||
}
|
||||
|
||||
CStarNetServerFrame::~CStarNetServerFrame()
|
||||
{
|
||||
}
|
||||
|
||||
wxMenuBar* CStarNetServerFrame::createMenuBar()
|
||||
{
|
||||
wxMenu* fileMenu = new wxMenu();
|
||||
fileMenu->Append(wxID_EXIT, _("Exit"));
|
||||
|
||||
wxMenu* editMenu = new wxMenu();
|
||||
editMenu->Append(Menu_Edit_Preferences, _("Preferences..."));
|
||||
|
||||
wxMenu* viewMenu = new wxMenu();
|
||||
viewMenu->AppendCheckItem(Menu_View_Updates, _("GUI Updates"));
|
||||
viewMenu->Check(Menu_View_Updates, m_updates);
|
||||
|
||||
wxMenu* helpMenu = new wxMenu();
|
||||
helpMenu->Append(wxID_ABOUT, _("About StarNet Server"));
|
||||
|
||||
wxMenuBar* menuBar = new wxMenuBar();
|
||||
menuBar->Append(fileMenu, _("File"));
|
||||
menuBar->Append(editMenu, _("Edit"));
|
||||
menuBar->Append(viewMenu, _("View"));
|
||||
menuBar->Append(helpMenu, _("Help"));
|
||||
|
||||
return menuBar;
|
||||
}
|
||||
|
||||
void CStarNetServerFrame::onQuit(wxCommandEvent&)
|
||||
{
|
||||
Close(false);
|
||||
}
|
||||
|
||||
void CStarNetServerFrame::onClose(wxCloseEvent&)
|
||||
{
|
||||
int x, y;
|
||||
GetPosition(&x, &y);
|
||||
if (x >= 0 && y >= 0) {
|
||||
::wxGetApp().setPosition(x, y);
|
||||
::wxGetApp().writeConfig();
|
||||
}
|
||||
|
||||
Destroy();
|
||||
}
|
||||
|
||||
void CStarNetServerFrame::onPreferences(wxCommandEvent&)
|
||||
{
|
||||
wxString callsign, address;
|
||||
::wxGetApp().getGateway(callsign, address);
|
||||
|
||||
wxString hostname, username, password;
|
||||
::wxGetApp().getIrcDDB(hostname, username, password);
|
||||
|
||||
unsigned int remotePort;
|
||||
wxString remotePassword;
|
||||
bool remoteEnabled;
|
||||
::wxGetApp().getRemote(remoteEnabled, remotePassword, remotePort);
|
||||
|
||||
bool logEnabled;
|
||||
::wxGetApp().getMiscellaneous(logEnabled);
|
||||
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
wxString starNetBand1, starNetCallsign1, starNetLogoff1, starNetInfo1, starNetLink1, starNetPermanent1;
|
||||
unsigned int starNetUserTimeout1, starNetGroupTimeout1;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch1;
|
||||
bool starNetTXMsgSwitch1;
|
||||
::wxGetApp().getStarNet1(starNetBand1, starNetCallsign1, starNetLogoff1, starNetInfo1, starNetPermanent1, starNetUserTimeout1, starNetGroupTimeout1, starNetCallsignSwitch1, starNetTXMsgSwitch1, starNetLink1);
|
||||
|
||||
wxString starNetBand2, starNetCallsign2, starNetLogoff2, starNetInfo2, starNetLink2, starNetPermanent2;
|
||||
unsigned int starNetUserTimeout2, starNetGroupTimeout2;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch2;
|
||||
bool starNetTXMsgSwitch2;
|
||||
::wxGetApp().getStarNet2(starNetBand2, starNetCallsign2, starNetLogoff2, starNetInfo2, starNetPermanent2, starNetUserTimeout2, starNetGroupTimeout2, starNetCallsignSwitch2, starNetTXMsgSwitch2, starNetLink2);
|
||||
|
||||
wxString starNetBand3, starNetCallsign3, starNetLogoff3, starNetInfo3, starNetLink3, starNetPermanent3;
|
||||
unsigned int starNetUserTimeout3, starNetGroupTimeout3;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch3;
|
||||
bool starNetTXMsgSwitch3;
|
||||
::wxGetApp().getStarNet3(starNetBand3, starNetCallsign3, starNetLogoff3, starNetInfo3, starNetPermanent3, starNetUserTimeout3, starNetGroupTimeout3, starNetCallsignSwitch3, starNetTXMsgSwitch3, starNetLink3);
|
||||
|
||||
wxString starNetBand4, starNetCallsign4, starNetLogoff4, starNetInfo4, starNetLink4, starNetPermanent4;
|
||||
unsigned int starNetUserTimeout4, starNetGroupTimeout4;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch4;
|
||||
bool starNetTXMsgSwitch4;
|
||||
::wxGetApp().getStarNet4(starNetBand4, starNetCallsign4, starNetLogoff4, starNetInfo4, starNetPermanent4, starNetUserTimeout4, starNetGroupTimeout4, starNetCallsignSwitch4, starNetTXMsgSwitch4, starNetLink4);
|
||||
|
||||
wxString starNetBand5, starNetCallsign5, starNetLogoff5, starNetInfo5, starNetLink5, starNetPermanent5;
|
||||
unsigned int starNetUserTimeout5, starNetGroupTimeout5;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch5;
|
||||
bool starNetTXMsgSwitch5;
|
||||
::wxGetApp().getStarNet5(starNetBand5, starNetCallsign5, starNetLogoff5, starNetInfo5, starNetPermanent5, starNetUserTimeout5, starNetGroupTimeout5, starNetCallsignSwitch5, starNetTXMsgSwitch5, starNetLink5);
|
||||
|
||||
wxString starNetBand6, starNetCallsign6, starNetLogoff6, starNetInfo6, starNetLink6, starNetPermanent6;
|
||||
unsigned int starNetUserTimeout6, starNetGroupTimeout6;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch6;
|
||||
bool starNetTXMsgSwitch6;
|
||||
::wxGetApp().getStarNet6(starNetBand6, starNetCallsign6, starNetLogoff6, starNetInfo6, starNetPermanent6, starNetUserTimeout6, starNetGroupTimeout6, starNetCallsignSwitch6, starNetTXMsgSwitch6, starNetLink6);
|
||||
|
||||
wxString starNetBand7, starNetCallsign7, starNetLogoff7, starNetInfo7, starNetLink7, starNetPermanent7;
|
||||
unsigned int starNetUserTimeout7, starNetGroupTimeout7;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch7;
|
||||
bool starNetTXMsgSwitch7;
|
||||
::wxGetApp().getStarNet7(starNetBand7, starNetCallsign7, starNetLogoff7, starNetInfo7, starNetPermanent7, starNetUserTimeout7, starNetGroupTimeout7, starNetCallsignSwitch7, starNetTXMsgSwitch7, starNetLink7);
|
||||
|
||||
wxString starNetBand8, starNetCallsign8, starNetLogoff8, starNetInfo8, starNetLink8, starNetPermanent8;
|
||||
unsigned int starNetUserTimeout8, starNetGroupTimeout8;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch8;
|
||||
bool starNetTXMsgSwitch8;
|
||||
::wxGetApp().getStarNet8(starNetBand8, starNetCallsign8, starNetLogoff8, starNetInfo8, starNetPermanent8, starNetUserTimeout8, starNetGroupTimeout8, starNetCallsignSwitch8, starNetTXMsgSwitch8, starNetLink8);
|
||||
|
||||
wxString starNetBand9, starNetCallsign9, starNetLogoff9, starNetInfo9, starNetLink9, starNetPermanent9;
|
||||
unsigned int starNetUserTimeout9, starNetGroupTimeout9;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch9;
|
||||
bool starNetTXMsgSwitch9;
|
||||
::wxGetApp().getStarNet9(starNetBand9, starNetCallsign9, starNetLogoff9, starNetInfo9, starNetPermanent9, starNetUserTimeout9, starNetGroupTimeout9, starNetCallsignSwitch9, starNetTXMsgSwitch9, starNetLink9);
|
||||
|
||||
wxString starNetBand10, starNetCallsign10, starNetInfo10, starNetLogoff10, starNetLink10, starNetPermanent10;
|
||||
unsigned int starNetUserTimeout10, starNetGroupTimeout10;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch10;
|
||||
bool starNetTXMsgSwitch10;
|
||||
::wxGetApp().getStarNet10(starNetBand10, starNetCallsign10, starNetLogoff10, starNetInfo10, starNetPermanent10, starNetUserTimeout10, starNetGroupTimeout10, starNetCallsignSwitch10, starNetTXMsgSwitch10, starNetLink10);
|
||||
|
||||
wxString starNetBand11, starNetCallsign11, starNetLogoff11, starNetInfo11, starNetLink11, starNetPermanent11;
|
||||
unsigned int starNetUserTimeout11, starNetGroupTimeout11;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch11;
|
||||
bool starNetTXMsgSwitch11;
|
||||
::wxGetApp().getStarNet11(starNetBand11, starNetCallsign11, starNetLogoff11, starNetInfo11, starNetPermanent11, starNetUserTimeout11, starNetGroupTimeout11, starNetCallsignSwitch11, starNetTXMsgSwitch11, starNetLink11);
|
||||
|
||||
wxString starNetBand12, starNetCallsign12, starNetLogoff12, starNetInfo12, starNetLink12, starNetPermanent12;
|
||||
unsigned int starNetUserTimeout12, starNetGroupTimeout12;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch12;
|
||||
bool starNetTXMsgSwitch12;
|
||||
::wxGetApp().getStarNet12(starNetBand12, starNetCallsign12, starNetLogoff12, starNetInfo12, starNetPermanent12, starNetUserTimeout12, starNetGroupTimeout12, starNetCallsignSwitch12, starNetTXMsgSwitch12, starNetLink12);
|
||||
|
||||
wxString starNetBand13, starNetCallsign13, starNetLogoff13, starNetInfo13, starNetLink13, starNetPermanent13;
|
||||
unsigned int starNetUserTimeout13, starNetGroupTimeout13;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch13;
|
||||
bool starNetTXMsgSwitch13;
|
||||
::wxGetApp().getStarNet13(starNetBand13, starNetCallsign13, starNetLogoff13, starNetInfo13, starNetPermanent13, starNetUserTimeout13, starNetGroupTimeout13, starNetCallsignSwitch13, starNetTXMsgSwitch13, starNetLink13);
|
||||
|
||||
wxString starNetBand14, starNetCallsign14, starNetLogoff14, starNetInfo14, starNetLink14, starNetPermanent14;
|
||||
unsigned int starNetUserTimeout14, starNetGroupTimeout14;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch14;
|
||||
bool starNetTXMsgSwitch14;
|
||||
::wxGetApp().getStarNet14(starNetBand14, starNetCallsign14, starNetLogoff14, starNetInfo14, starNetPermanent14, starNetUserTimeout14, starNetGroupTimeout14, starNetCallsignSwitch14, starNetTXMsgSwitch14, starNetLink14);
|
||||
|
||||
wxString starNetBand15, starNetCallsign15, starNetLogoff15, starNetInfo15, starNetLink15, starNetPermanent15;
|
||||
unsigned int starNetUserTimeout15, starNetGroupTimeout15;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch15;
|
||||
bool starNetTXMsgSwitch15;
|
||||
::wxGetApp().getStarNet15(starNetBand15, starNetCallsign15, starNetLogoff15, starNetInfo15, starNetPermanent15, starNetUserTimeout15, starNetGroupTimeout15, starNetCallsignSwitch15, starNetTXMsgSwitch15, starNetLink15);
|
||||
|
||||
CStarNetServerPreferences dialog1(this, -1, callsign, address,
|
||||
hostname, username, password, logEnabled,
|
||||
starNetBand1, starNetCallsign1, starNetLogoff1, starNetInfo1, starNetPermanent1, starNetUserTimeout1, starNetGroupTimeout1, starNetCallsignSwitch1, starNetTXMsgSwitch1, starNetLink1,
|
||||
starNetBand2, starNetCallsign2, starNetLogoff2, starNetInfo2, starNetPermanent2, starNetUserTimeout2, starNetGroupTimeout2, starNetCallsignSwitch2, starNetTXMsgSwitch2, starNetLink2,
|
||||
starNetBand3, starNetCallsign3, starNetLogoff3, starNetInfo3, starNetPermanent3, starNetUserTimeout3, starNetGroupTimeout3, starNetCallsignSwitch3, starNetTXMsgSwitch3, starNetLink3,
|
||||
starNetBand4, starNetCallsign4, starNetLogoff4, starNetInfo4, starNetPermanent4, starNetUserTimeout4, starNetGroupTimeout4, starNetCallsignSwitch4, starNetTXMsgSwitch4, starNetLink4,
|
||||
starNetBand5, starNetCallsign5, starNetLogoff5, starNetInfo5, starNetPermanent5, starNetUserTimeout5, starNetGroupTimeout5, starNetCallsignSwitch5, starNetTXMsgSwitch5, starNetLink5,
|
||||
starNetBand6, starNetCallsign6, starNetLogoff6, starNetInfo6, starNetPermanent6, starNetUserTimeout6, starNetGroupTimeout6, starNetCallsignSwitch6, starNetTXMsgSwitch6, starNetLink6,
|
||||
starNetBand7, starNetCallsign7, starNetLogoff7, starNetInfo7, starNetPermanent7, starNetUserTimeout7, starNetGroupTimeout7, starNetCallsignSwitch7, starNetTXMsgSwitch7, starNetLink7,
|
||||
starNetBand8, starNetCallsign8, starNetLogoff8, starNetInfo8, starNetPermanent8, starNetUserTimeout8, starNetGroupTimeout8, starNetCallsignSwitch8, starNetTXMsgSwitch8, starNetLink8,
|
||||
starNetBand9, starNetCallsign9, starNetLogoff9, starNetInfo9, starNetPermanent9, starNetUserTimeout9, starNetGroupTimeout9, starNetCallsignSwitch9, starNetTXMsgSwitch9, starNetLink9,
|
||||
starNetBand10, starNetCallsign10, starNetLogoff10, starNetInfo10, starNetPermanent10, starNetUserTimeout10, starNetGroupTimeout10, starNetCallsignSwitch10, starNetTXMsgSwitch10, starNetLink10,
|
||||
starNetBand11, starNetCallsign11, starNetLogoff11, starNetInfo11, starNetPermanent11, starNetUserTimeout11, starNetGroupTimeout11, starNetCallsignSwitch11, starNetTXMsgSwitch11, starNetLink11,
|
||||
starNetBand12, starNetCallsign12, starNetLogoff12, starNetInfo12, starNetPermanent12, starNetUserTimeout12, starNetGroupTimeout12, starNetCallsignSwitch12, starNetTXMsgSwitch12, starNetLink12,
|
||||
starNetBand13, starNetCallsign13, starNetLogoff13, starNetInfo13, starNetPermanent13, starNetUserTimeout13, starNetGroupTimeout13, starNetCallsignSwitch13, starNetTXMsgSwitch13, starNetLink13,
|
||||
starNetBand14, starNetCallsign14, starNetLogoff14, starNetInfo14, starNetPermanent14, starNetUserTimeout14, starNetGroupTimeout14, starNetCallsignSwitch14, starNetTXMsgSwitch14, starNetLink14,
|
||||
starNetBand15, starNetCallsign15, starNetLogoff15, starNetInfo15, starNetPermanent15, starNetUserTimeout15, starNetGroupTimeout15, starNetCallsignSwitch15, starNetTXMsgSwitch15, starNetLink15,
|
||||
remoteEnabled, remotePassword, remotePort);
|
||||
#else
|
||||
wxString starNetBand1, starNetCallsign1, starNetLogoff1, starNetInfo1, starNetPermanent1;
|
||||
unsigned int starNetUserTimeout1, starNetGroupTimeout1;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch1;
|
||||
bool starNetTXMsgSwitch1;
|
||||
::wxGetApp().getStarNet1(starNetBand1, starNetCallsign1, starNetLogoff1, starNetInfo1, starNetPermanent1, starNetUserTimeout1, starNetGroupTimeout1, starNetCallsignSwitch1, starNetTXMsgSwitch1);
|
||||
|
||||
wxString starNetBand2, starNetCallsign2, starNetLogoff2, starNetInfo2, starNetPermanent2;
|
||||
unsigned int starNetUserTimeout2, starNetGroupTimeout2;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch2;
|
||||
bool starNetTXMsgSwitch2;
|
||||
::wxGetApp().getStarNet2(starNetBand2, starNetCallsign2, starNetLogoff2, starNetInfo2, starNetPermanent2, starNetUserTimeout2, starNetGroupTimeout2, starNetCallsignSwitch2, starNetTXMsgSwitch2);
|
||||
|
||||
wxString starNetBand3, starNetCallsign3, starNetLogoff3, starNetInfo3, starNetPermanent3;
|
||||
unsigned int starNetUserTimeout3, starNetGroupTimeout3;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch3;
|
||||
bool starNetTXMsgSwitch3;
|
||||
::wxGetApp().getStarNet3(starNetBand3, starNetCallsign3, starNetLogoff3, starNetInfo3, starNetPermanent3, starNetUserTimeout3, starNetGroupTimeout3, starNetCallsignSwitch3, starNetTXMsgSwitch3);
|
||||
|
||||
wxString starNetBand4, starNetCallsign4, starNetLogoff4, starNetInfo4, starNetPermanent4;
|
||||
unsigned int starNetUserTimeout4, starNetGroupTimeout4;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch4;
|
||||
bool starNetTXMsgSwitch4;
|
||||
::wxGetApp().getStarNet4(starNetBand4, starNetCallsign4, starNetLogoff4, starNetInfo4, starNetPermanent4, starNetUserTimeout4, starNetGroupTimeout4, starNetCallsignSwitch4, starNetTXMsgSwitch4);
|
||||
|
||||
wxString starNetBand5, starNetCallsign5, starNetLogoff5, starNetInfo5, starNetPermanent5;
|
||||
unsigned int starNetUserTimeout5, starNetGroupTimeout5;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch5;
|
||||
bool starNetTXMsgSwitch5;
|
||||
::wxGetApp().getStarNet5(starNetBand5, starNetCallsign5, starNetLogoff5, starNetInfo5, starNetPermanent5, starNetUserTimeout5, starNetGroupTimeout5, starNetCallsignSwitch5, starNetTXMsgSwitch5);
|
||||
|
||||
wxString starNetBand6, starNetCallsign6, starNetLogoff6, starNetInfo6, starNetPermanent6;
|
||||
unsigned int starNetUserTimeout6, starNetGroupTimeout6;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch6;
|
||||
bool starNetTXMsgSwitch6;
|
||||
::wxGetApp().getStarNet6(starNetBand6, starNetCallsign6, starNetLogoff6, starNetInfo6, starNetPermanent6, starNetUserTimeout6, starNetGroupTimeout6, starNetCallsignSwitch6, starNetTXMsgSwitch6);
|
||||
|
||||
wxString starNetBand7, starNetCallsign7, starNetLogoff7, starNetInfo7, starNetPermanent7;
|
||||
unsigned int starNetUserTimeout7, starNetGroupTimeout7;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch7;
|
||||
bool starNetTXMsgSwitch7;
|
||||
::wxGetApp().getStarNet7(starNetBand7, starNetCallsign7, starNetLogoff7, starNetInfo7, starNetPermanent7, starNetUserTimeout7, starNetGroupTimeout7, starNetCallsignSwitch7, starNetTXMsgSwitch7);
|
||||
|
||||
wxString starNetBand8, starNetCallsign8, starNetLogoff8, starNetInfo8, starNetPermanent8;
|
||||
unsigned int starNetUserTimeout8, starNetGroupTimeout8;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch8;
|
||||
bool starNetTXMsgSwitch8;
|
||||
::wxGetApp().getStarNet8(starNetBand8, starNetCallsign8, starNetLogoff8, starNetInfo8, starNetPermanent8, starNetUserTimeout8, starNetGroupTimeout8, starNetCallsignSwitch8, starNetTXMsgSwitch8);
|
||||
|
||||
wxString starNetBand9, starNetCallsign9, starNetLogoff9, starNetInfo9, starNetPermanent9;
|
||||
unsigned int starNetUserTimeout9, starNetGroupTimeout9;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch9;
|
||||
bool starNetTXMsgSwitch9;
|
||||
::wxGetApp().getStarNet9(starNetBand9, starNetCallsign9, starNetLogoff9, starNetInfo9, starNetPermanent9, starNetUserTimeout9, starNetGroupTimeout9, starNetCallsignSwitch9, starNetTXMsgSwitch9);
|
||||
|
||||
wxString starNetBand10, starNetCallsign10, starNetLogoff10, starNetInfo10, starNetPermanent10;
|
||||
unsigned int starNetUserTimeout10, starNetGroupTimeout10;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch10;
|
||||
bool starNetTXMsgSwitch10;
|
||||
::wxGetApp().getStarNet10(starNetBand10, starNetCallsign10, starNetLogoff10, starNetInfo10, starNetPermanent10, starNetUserTimeout10, starNetGroupTimeout10, starNetCallsignSwitch10, starNetTXMsgSwitch10);
|
||||
|
||||
wxString starNetBand11, starNetCallsign11, starNetLogoff11, starNetInfo11, starNetPermanent11;
|
||||
unsigned int starNetUserTimeout11, starNetGroupTimeout11;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch11;
|
||||
bool starNetTXMsgSwitch11;
|
||||
::wxGetApp().getStarNet11(starNetBand11, starNetCallsign11, starNetLogoff11, starNetInfo11, starNetPermanent11, starNetUserTimeout11, starNetGroupTimeout11, starNetCallsignSwitch11, starNetTXMsgSwitch11);
|
||||
|
||||
wxString starNetBand12, starNetCallsign12, starNetLogoff12, starNetInfo12, starNetPermanent12;
|
||||
unsigned int starNetUserTimeout12, starNetGroupTimeout12;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch12;
|
||||
bool starNetTXMsgSwitch12;
|
||||
::wxGetApp().getStarNet12(starNetBand12, starNetCallsign12, starNetLogoff12, starNetInfo12, starNetPermanent12, starNetUserTimeout12, starNetGroupTimeout12, starNetCallsignSwitch12, starNetTXMsgSwitch12);
|
||||
|
||||
wxString starNetBand13, starNetCallsign13, starNetLogoff13, starNetInfo13, starNetPermanent13;
|
||||
unsigned int starNetUserTimeout13, starNetGroupTimeout13;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch13;
|
||||
bool starNetTXMsgSwitch13;
|
||||
::wxGetApp().getStarNet13(starNetBand13, starNetCallsign13, starNetLogoff13, starNetInfo13, starNetPermanent13, starNetUserTimeout13, starNetGroupTimeout13, starNetCallsignSwitch13, starNetTXMsgSwitch13);
|
||||
|
||||
wxString starNetBand14, starNetCallsign14, starNetLogoff14, starNetInfo14, starNetPermanent14;
|
||||
unsigned int starNetUserTimeout14, starNetGroupTimeout14;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch14;
|
||||
bool starNetTXMsgSwitch14;
|
||||
::wxGetApp().getStarNet14(starNetBand14, starNetCallsign14, starNetLogoff14, starNetInfo14, starNetPermanent14, starNetUserTimeout14, starNetGroupTimeout14, starNetCallsignSwitch14, starNetTXMsgSwitch14);
|
||||
|
||||
wxString starNetBand15, starNetCallsign15, starNetLogoff15, starNetInfo15, starNetPermanent15;
|
||||
unsigned int starNetUserTimeout15, starNetGroupTimeout15;
|
||||
STARNET_CALLSIGN_SWITCH starNetCallsignSwitch15;
|
||||
bool starNetTXMsgSwitch15;
|
||||
::wxGetApp().getStarNet15(starNetBand15, starNetCallsign15, starNetLogoff15, starNetInfo15, starNetPermanent15, starNetUserTimeout15, starNetGroupTimeout15, starNetCallsignSwitch15, starNetTXMsgSwitch15);
|
||||
|
||||
CStarNetServerPreferences dialog1(this, -1, callsign, address,
|
||||
hostname, username, password, logEnabled,
|
||||
starNetBand1, starNetCallsign1, starNetLogoff1, starNetInfo1, starNetPermanent1, starNetUserTimeout1, starNetGroupTimeout1, starNetCallsignSwitch1, starNetTXMsgSwitch1,
|
||||
starNetBand2, starNetCallsign2, starNetLogoff2, starNetInfo2, starNetPermanent2, starNetUserTimeout2, starNetGroupTimeout2, starNetCallsignSwitch2, starNetTXMsgSwitch2,
|
||||
starNetBand3, starNetCallsign3, starNetLogoff3, starNetInfo3, starNetPermanent3, starNetUserTimeout3, starNetGroupTimeout3, starNetCallsignSwitch3, starNetTXMsgSwitch3,
|
||||
starNetBand4, starNetCallsign4, starNetLogoff4, starNetInfo4, starNetPermanent4, starNetUserTimeout4, starNetGroupTimeout4, starNetCallsignSwitch4, starNetTXMsgSwitch4,
|
||||
starNetBand5, starNetCallsign5, starNetLogoff5, starNetInfo5, starNetPermanent5, starNetUserTimeout5, starNetGroupTimeout5, starNetCallsignSwitch5, starNetTXMsgSwitch5,
|
||||
starNetBand6, starNetCallsign6, starNetLogoff6, starNetInfo6, starNetPermanent6, starNetUserTimeout6, starNetGroupTimeout6, starNetCallsignSwitch6, starNetTXMsgSwitch6,
|
||||
starNetBand7, starNetCallsign7, starNetLogoff7, starNetInfo7, starNetPermanent7, starNetUserTimeout7, starNetGroupTimeout7, starNetCallsignSwitch7, starNetTXMsgSwitch7,
|
||||
starNetBand8, starNetCallsign8, starNetLogoff8, starNetInfo8, starNetPermanent8, starNetUserTimeout8, starNetGroupTimeout8, starNetCallsignSwitch8, starNetTXMsgSwitch8,
|
||||
starNetBand9, starNetCallsign9, starNetLogoff9, starNetInfo9, starNetPermanent9, starNetUserTimeout9, starNetGroupTimeout9, starNetCallsignSwitch9, starNetTXMsgSwitch9,
|
||||
starNetBand10, starNetCallsign10, starNetLogoff10, starNetInfo10, starNetPermanent10, starNetUserTimeout10, starNetGroupTimeout10, starNetCallsignSwitch10, starNetTXMsgSwitch10,
|
||||
starNetBand11, starNetCallsign11, starNetLogoff11, starNetInfo11, starNetPermanent11, starNetUserTimeout11, starNetGroupTimeout11, starNetCallsignSwitch11, starNetTXMsgSwitch11,
|
||||
starNetBand12, starNetCallsign12, starNetLogoff12, starNetInfo12, starNetPermanent12, starNetUserTimeout12, starNetGroupTimeout12, starNetCallsignSwitch12, starNetTXMsgSwitch12,
|
||||
starNetBand13, starNetCallsign13, starNetLogoff13, starNetInfo13, starNetPermanent13, starNetUserTimeout13, starNetGroupTimeout13, starNetCallsignSwitch13, starNetTXMsgSwitch13,
|
||||
starNetBand14, starNetCallsign14, starNetLogoff14, starNetInfo14, starNetPermanent14, starNetUserTimeout14, starNetGroupTimeout14, starNetCallsignSwitch14, starNetTXMsgSwitch14,
|
||||
starNetBand15, starNetCallsign15, starNetLogoff15, starNetInfo15, starNetPermanent15, starNetUserTimeout15, starNetGroupTimeout15, starNetCallsignSwitch15, starNetTXMsgSwitch15,
|
||||
remoteEnabled, remotePassword, remotePort);
|
||||
#endif
|
||||
if (dialog1.ShowModal() != wxID_OK)
|
||||
return;
|
||||
|
||||
callsign = dialog1.getCallsign();
|
||||
address = dialog1.getAddress();
|
||||
|
||||
hostname = dialog1.getHostname();
|
||||
username = dialog1.getUsername();
|
||||
password = dialog1.getPassword();
|
||||
|
||||
starNetBand1 = dialog1.getStarNetBand1();
|
||||
starNetCallsign1 = dialog1.getStarNetCallsign1();
|
||||
starNetLogoff1 = dialog1.getStarNetLogoff1();
|
||||
starNetInfo1 = dialog1.getStarNetInfo1();
|
||||
starNetPermanent1 = dialog1.getStarNetPermanent1();
|
||||
starNetUserTimeout1 = dialog1.getStarNetUserTimeout1();
|
||||
starNetGroupTimeout1 = dialog1.getStarNetGroupTimeout1();
|
||||
starNetCallsignSwitch1 = dialog1.getStarNetCallsignSwitch1();
|
||||
starNetTXMsgSwitch1 = dialog1.getStarNetTXMsgSwitch1();
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
starNetLink1 = dialog1.getStarNetLink1();
|
||||
#endif
|
||||
|
||||
starNetBand2 = dialog1.getStarNetBand2();
|
||||
starNetCallsign2 = dialog1.getStarNetCallsign2();
|
||||
starNetLogoff2 = dialog1.getStarNetLogoff2();
|
||||
starNetInfo2 = dialog1.getStarNetInfo2();
|
||||
starNetPermanent2 = dialog1.getStarNetPermanent2();
|
||||
starNetUserTimeout2 = dialog1.getStarNetUserTimeout2();
|
||||
starNetGroupTimeout2 = dialog1.getStarNetGroupTimeout2();
|
||||
starNetCallsignSwitch2 = dialog1.getStarNetCallsignSwitch2();
|
||||
starNetTXMsgSwitch2 = dialog1.getStarNetTXMsgSwitch2();
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
starNetLink2 = dialog1.getStarNetLink2();
|
||||
#endif
|
||||
|
||||
starNetBand3 = dialog1.getStarNetBand3();
|
||||
starNetCallsign3 = dialog1.getStarNetCallsign3();
|
||||
starNetLogoff3 = dialog1.getStarNetLogoff3();
|
||||
starNetInfo3 = dialog1.getStarNetInfo3();
|
||||
starNetPermanent3 = dialog1.getStarNetPermanent3();
|
||||
starNetUserTimeout3 = dialog1.getStarNetUserTimeout3();
|
||||
starNetGroupTimeout3 = dialog1.getStarNetGroupTimeout3();
|
||||
starNetCallsignSwitch3 = dialog1.getStarNetCallsignSwitch3();
|
||||
starNetTXMsgSwitch3 = dialog1.getStarNetTXMsgSwitch3();
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
starNetLink3 = dialog1.getStarNetLink3();
|
||||
#endif
|
||||
|
||||
starNetBand4 = dialog1.getStarNetBand4();
|
||||
starNetCallsign4 = dialog1.getStarNetCallsign4();
|
||||
starNetLogoff4 = dialog1.getStarNetLogoff4();
|
||||
starNetInfo4 = dialog1.getStarNetInfo4();
|
||||
starNetPermanent4 = dialog1.getStarNetPermanent4();
|
||||
starNetUserTimeout4 = dialog1.getStarNetUserTimeout4();
|
||||
starNetGroupTimeout4 = dialog1.getStarNetGroupTimeout4();
|
||||
starNetCallsignSwitch4 = dialog1.getStarNetCallsignSwitch4();
|
||||
starNetTXMsgSwitch4 = dialog1.getStarNetTXMsgSwitch4();
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
starNetLink4 = dialog1.getStarNetLink4();
|
||||
#endif
|
||||
|
||||
starNetBand5 = dialog1.getStarNetBand5();
|
||||
starNetCallsign5 = dialog1.getStarNetCallsign5();
|
||||
starNetLogoff5 = dialog1.getStarNetLogoff5();
|
||||
starNetInfo5 = dialog1.getStarNetInfo5();
|
||||
starNetPermanent5 = dialog1.getStarNetPermanent5();
|
||||
starNetUserTimeout5 = dialog1.getStarNetUserTimeout5();
|
||||
starNetGroupTimeout5 = dialog1.getStarNetGroupTimeout5();
|
||||
starNetCallsignSwitch5 = dialog1.getStarNetCallsignSwitch5();
|
||||
starNetTXMsgSwitch5 = dialog1.getStarNetTXMsgSwitch5();
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
starNetLink5 = dialog1.getStarNetLink5();
|
||||
#endif
|
||||
|
||||
starNetBand6 = dialog1.getStarNetBand6();
|
||||
starNetCallsign6 = dialog1.getStarNetCallsign6();
|
||||
starNetLogoff6 = dialog1.getStarNetLogoff6();
|
||||
starNetInfo6 = dialog1.getStarNetInfo6();
|
||||
starNetPermanent6 = dialog1.getStarNetPermanent6();
|
||||
starNetUserTimeout6 = dialog1.getStarNetUserTimeout6();
|
||||
starNetGroupTimeout6 = dialog1.getStarNetGroupTimeout6();
|
||||
starNetCallsignSwitch6 = dialog1.getStarNetCallsignSwitch6();
|
||||
starNetTXMsgSwitch6 = dialog1.getStarNetTXMsgSwitch6();
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
starNetLink6 = dialog1.getStarNetLink6();
|
||||
#endif
|
||||
|
||||
starNetBand7 = dialog1.getStarNetBand7();
|
||||
starNetCallsign7 = dialog1.getStarNetCallsign7();
|
||||
starNetLogoff7 = dialog1.getStarNetLogoff7();
|
||||
starNetInfo7 = dialog1.getStarNetInfo7();
|
||||
starNetPermanent7 = dialog1.getStarNetPermanent7();
|
||||
starNetUserTimeout7 = dialog1.getStarNetUserTimeout7();
|
||||
starNetGroupTimeout7 = dialog1.getStarNetGroupTimeout7();
|
||||
starNetCallsignSwitch7 = dialog1.getStarNetCallsignSwitch7();
|
||||
starNetTXMsgSwitch7 = dialog1.getStarNetTXMsgSwitch7();
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
starNetLink7 = dialog1.getStarNetLink7();
|
||||
#endif
|
||||
|
||||
starNetBand8 = dialog1.getStarNetBand8();
|
||||
starNetCallsign8 = dialog1.getStarNetCallsign8();
|
||||
starNetLogoff8 = dialog1.getStarNetLogoff8();
|
||||
starNetInfo8 = dialog1.getStarNetInfo8();
|
||||
starNetPermanent8 = dialog1.getStarNetPermanent8();
|
||||
starNetUserTimeout8 = dialog1.getStarNetUserTimeout8();
|
||||
starNetGroupTimeout8 = dialog1.getStarNetGroupTimeout8();
|
||||
starNetCallsignSwitch8 = dialog1.getStarNetCallsignSwitch8();
|
||||
starNetTXMsgSwitch8 = dialog1.getStarNetTXMsgSwitch8();
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
starNetLink8 = dialog1.getStarNetLink8();
|
||||
#endif
|
||||
|
||||
starNetBand9 = dialog1.getStarNetBand9();
|
||||
starNetCallsign9 = dialog1.getStarNetCallsign9();
|
||||
starNetLogoff9 = dialog1.getStarNetLogoff9();
|
||||
starNetInfo9 = dialog1.getStarNetInfo9();
|
||||
starNetPermanent9 = dialog1.getStarNetPermanent9();
|
||||
starNetUserTimeout9 = dialog1.getStarNetUserTimeout9();
|
||||
starNetGroupTimeout9 = dialog1.getStarNetGroupTimeout9();
|
||||
starNetCallsignSwitch9 = dialog1.getStarNetCallsignSwitch9();
|
||||
starNetTXMsgSwitch9 = dialog1.getStarNetTXMsgSwitch9();
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
starNetLink9 = dialog1.getStarNetLink9();
|
||||
#endif
|
||||
|
||||
starNetBand10 = dialog1.getStarNetBand10();
|
||||
starNetCallsign10 = dialog1.getStarNetCallsign10();
|
||||
starNetLogoff10 = dialog1.getStarNetLogoff10();
|
||||
starNetInfo10 = dialog1.getStarNetInfo10();
|
||||
starNetPermanent10 = dialog1.getStarNetPermanent10();
|
||||
starNetUserTimeout10 = dialog1.getStarNetUserTimeout10();
|
||||
starNetGroupTimeout10 = dialog1.getStarNetGroupTimeout10();
|
||||
starNetCallsignSwitch10 = dialog1.getStarNetCallsignSwitch10();
|
||||
starNetTXMsgSwitch10 = dialog1.getStarNetTXMsgSwitch10();
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
starNetLink10 = dialog1.getStarNetLink10();
|
||||
#endif
|
||||
|
||||
starNetBand11 = dialog1.getStarNetBand11();
|
||||
starNetCallsign11 = dialog1.getStarNetCallsign11();
|
||||
starNetLogoff11 = dialog1.getStarNetLogoff11();
|
||||
starNetInfo11 = dialog1.getStarNetInfo11();
|
||||
starNetPermanent11 = dialog1.getStarNetPermanent11();
|
||||
starNetUserTimeout11 = dialog1.getStarNetUserTimeout11();
|
||||
starNetGroupTimeout11 = dialog1.getStarNetGroupTimeout11();
|
||||
starNetCallsignSwitch11 = dialog1.getStarNetCallsignSwitch11();
|
||||
starNetTXMsgSwitch11 = dialog1.getStarNetTXMsgSwitch11();
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
starNetLink11 = dialog1.getStarNetLink11();
|
||||
#endif
|
||||
|
||||
starNetBand12 = dialog1.getStarNetBand12();
|
||||
starNetCallsign12 = dialog1.getStarNetCallsign12();
|
||||
starNetLogoff12 = dialog1.getStarNetLogoff12();
|
||||
starNetInfo12 = dialog1.getStarNetInfo12();
|
||||
starNetPermanent12 = dialog1.getStarNetPermanent12();
|
||||
starNetUserTimeout12 = dialog1.getStarNetUserTimeout12();
|
||||
starNetGroupTimeout12 = dialog1.getStarNetGroupTimeout12();
|
||||
starNetCallsignSwitch12 = dialog1.getStarNetCallsignSwitch12();
|
||||
starNetTXMsgSwitch12 = dialog1.getStarNetTXMsgSwitch12();
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
starNetLink12 = dialog1.getStarNetLink12();
|
||||
#endif
|
||||
|
||||
starNetBand13 = dialog1.getStarNetBand13();
|
||||
starNetCallsign13 = dialog1.getStarNetCallsign13();
|
||||
starNetLogoff13 = dialog1.getStarNetLogoff13();
|
||||
starNetInfo13 = dialog1.getStarNetInfo13();
|
||||
starNetPermanent13 = dialog1.getStarNetPermanent13();
|
||||
starNetUserTimeout13 = dialog1.getStarNetUserTimeout13();
|
||||
starNetGroupTimeout13 = dialog1.getStarNetGroupTimeout13();
|
||||
starNetCallsignSwitch13 = dialog1.getStarNetCallsignSwitch13();
|
||||
starNetTXMsgSwitch13 = dialog1.getStarNetTXMsgSwitch13();
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
starNetLink13 = dialog1.getStarNetLink13();
|
||||
#endif
|
||||
|
||||
starNetBand14 = dialog1.getStarNetBand14();
|
||||
starNetCallsign14 = dialog1.getStarNetCallsign14();
|
||||
starNetLogoff14 = dialog1.getStarNetLogoff14();
|
||||
starNetInfo14 = dialog1.getStarNetInfo14();
|
||||
starNetPermanent14 = dialog1.getStarNetPermanent14();
|
||||
starNetUserTimeout14 = dialog1.getStarNetUserTimeout14();
|
||||
starNetGroupTimeout14 = dialog1.getStarNetGroupTimeout14();
|
||||
starNetCallsignSwitch14 = dialog1.getStarNetCallsignSwitch14();
|
||||
starNetTXMsgSwitch14 = dialog1.getStarNetTXMsgSwitch14();
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
starNetLink14 = dialog1.getStarNetLink14();
|
||||
#endif
|
||||
|
||||
starNetBand15 = dialog1.getStarNetBand15();
|
||||
starNetCallsign15 = dialog1.getStarNetCallsign15();
|
||||
starNetLogoff15 = dialog1.getStarNetLogoff15();
|
||||
starNetInfo15 = dialog1.getStarNetInfo15();
|
||||
starNetPermanent15 = dialog1.getStarNetPermanent15();
|
||||
starNetUserTimeout15 = dialog1.getStarNetUserTimeout15();
|
||||
starNetGroupTimeout15 = dialog1.getStarNetGroupTimeout15();
|
||||
starNetCallsignSwitch15 = dialog1.getStarNetCallsignSwitch15();
|
||||
starNetTXMsgSwitch15 = dialog1.getStarNetTXMsgSwitch15();
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
starNetLink15 = dialog1.getStarNetLink15();
|
||||
#endif
|
||||
|
||||
remoteEnabled = dialog1.getRemoteEnabled();
|
||||
remotePassword = dialog1.getRemotePassword();
|
||||
remotePort = dialog1.getRemotePort();
|
||||
|
||||
logEnabled = dialog1.getLogEnabled();
|
||||
|
||||
::wxGetApp().setGateway(callsign, address);
|
||||
::wxGetApp().setIrcDDB(hostname, username, password);
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
::wxGetApp().setStarNet1(starNetBand1, starNetCallsign1, starNetLogoff1, starNetInfo1, starNetPermanent1, starNetUserTimeout1, starNetGroupTimeout1, starNetCallsignSwitch1, starNetTXMsgSwitch1, starNetLink1);
|
||||
::wxGetApp().setStarNet2(starNetBand2, starNetCallsign2, starNetLogoff2, starNetInfo2, starNetPermanent2, starNetUserTimeout2, starNetGroupTimeout2, starNetCallsignSwitch2, starNetTXMsgSwitch2, starNetLink2);
|
||||
::wxGetApp().setStarNet3(starNetBand3, starNetCallsign3, starNetLogoff3, starNetInfo3, starNetPermanent3, starNetUserTimeout3, starNetGroupTimeout3, starNetCallsignSwitch3, starNetTXMsgSwitch3, starNetLink3);
|
||||
::wxGetApp().setStarNet4(starNetBand4, starNetCallsign4, starNetLogoff4, starNetInfo4, starNetPermanent4, starNetUserTimeout4, starNetGroupTimeout4, starNetCallsignSwitch4, starNetTXMsgSwitch4, starNetLink4);
|
||||
::wxGetApp().setStarNet5(starNetBand5, starNetCallsign5, starNetLogoff5, starNetInfo5, starNetPermanent5, starNetUserTimeout5, starNetGroupTimeout5, starNetCallsignSwitch5, starNetTXMsgSwitch5, starNetLink5);
|
||||
::wxGetApp().setStarNet6(starNetBand6, starNetCallsign6, starNetLogoff6, starNetInfo6, starNetPermanent6, starNetUserTimeout6, starNetGroupTimeout6, starNetCallsignSwitch6, starNetTXMsgSwitch6, starNetLink6);
|
||||
::wxGetApp().setStarNet7(starNetBand7, starNetCallsign7, starNetLogoff7, starNetInfo7, starNetPermanent7, starNetUserTimeout7, starNetGroupTimeout7, starNetCallsignSwitch7, starNetTXMsgSwitch7, starNetLink7);
|
||||
::wxGetApp().setStarNet8(starNetBand8, starNetCallsign8, starNetLogoff8, starNetInfo8, starNetPermanent8, starNetUserTimeout8, starNetGroupTimeout8, starNetCallsignSwitch8, starNetTXMsgSwitch8, starNetLink8);
|
||||
::wxGetApp().setStarNet9(starNetBand9, starNetCallsign9, starNetLogoff9, starNetInfo9, starNetPermanent9, starNetUserTimeout9, starNetGroupTimeout9, starNetCallsignSwitch9, starNetTXMsgSwitch9, starNetLink9);
|
||||
::wxGetApp().setStarNet10(starNetBand10, starNetCallsign10, starNetLogoff10, starNetInfo10, starNetPermanent10, starNetUserTimeout10, starNetGroupTimeout10, starNetCallsignSwitch10, starNetTXMsgSwitch10, starNetLink10);
|
||||
::wxGetApp().setStarNet11(starNetBand11, starNetCallsign11, starNetLogoff11, starNetInfo11, starNetPermanent11, starNetUserTimeout11, starNetGroupTimeout11, starNetCallsignSwitch11, starNetTXMsgSwitch11, starNetLink11);
|
||||
::wxGetApp().setStarNet12(starNetBand12, starNetCallsign12, starNetLogoff12, starNetInfo12, starNetPermanent12, starNetUserTimeout12, starNetGroupTimeout12, starNetCallsignSwitch12, starNetTXMsgSwitch12, starNetLink12);
|
||||
::wxGetApp().setStarNet13(starNetBand13, starNetCallsign13, starNetLogoff13, starNetInfo13, starNetPermanent13, starNetUserTimeout13, starNetGroupTimeout13, starNetCallsignSwitch13, starNetTXMsgSwitch13, starNetLink13);
|
||||
::wxGetApp().setStarNet14(starNetBand14, starNetCallsign14, starNetLogoff14, starNetInfo14, starNetPermanent14, starNetUserTimeout14, starNetGroupTimeout14, starNetCallsignSwitch14, starNetTXMsgSwitch14, starNetLink14);
|
||||
::wxGetApp().setStarNet15(starNetBand15, starNetCallsign15, starNetLogoff15, starNetInfo15, starNetPermanent15, starNetUserTimeout15, starNetGroupTimeout15, starNetCallsignSwitch15, starNetTXMsgSwitch15, starNetLink15);
|
||||
#else
|
||||
::wxGetApp().setStarNet1(starNetBand1, starNetCallsign1, starNetLogoff1, starNetInfo1, starNetPermanent1, starNetUserTimeout1, starNetGroupTimeout1, starNetCallsignSwitch1, starNetTXMsgSwitch1);
|
||||
::wxGetApp().setStarNet2(starNetBand2, starNetCallsign2, starNetLogoff2, starNetInfo2, starNetPermanent2, starNetUserTimeout2, starNetGroupTimeout2, starNetCallsignSwitch2, starNetTXMsgSwitch2);
|
||||
::wxGetApp().setStarNet3(starNetBand3, starNetCallsign3, starNetLogoff3, starNetInfo3, starNetPermanent3, starNetUserTimeout3, starNetGroupTimeout3, starNetCallsignSwitch3, starNetTXMsgSwitch3);
|
||||
::wxGetApp().setStarNet4(starNetBand4, starNetCallsign4, starNetLogoff4, starNetInfo4, starNetPermanent4, starNetUserTimeout4, starNetGroupTimeout4, starNetCallsignSwitch4, starNetTXMsgSwitch4);
|
||||
::wxGetApp().setStarNet5(starNetBand5, starNetCallsign5, starNetLogoff5, starNetInfo5, starNetPermanent5, starNetUserTimeout5, starNetGroupTimeout5, starNetCallsignSwitch5, starNetTXMsgSwitch5);
|
||||
::wxGetApp().setStarNet6(starNetBand6, starNetCallsign6, starNetLogoff6, starNetInfo6, starNetPermanent6, starNetUserTimeout6, starNetGroupTimeout6, starNetCallsignSwitch6, starNetTXMsgSwitch6);
|
||||
::wxGetApp().setStarNet7(starNetBand7, starNetCallsign7, starNetLogoff7, starNetInfo7, starNetPermanent7, starNetUserTimeout7, starNetGroupTimeout7, starNetCallsignSwitch7, starNetTXMsgSwitch7);
|
||||
::wxGetApp().setStarNet8(starNetBand8, starNetCallsign8, starNetLogoff8, starNetInfo8, starNetPermanent8, starNetUserTimeout8, starNetGroupTimeout8, starNetCallsignSwitch8, starNetTXMsgSwitch8);
|
||||
::wxGetApp().setStarNet9(starNetBand9, starNetCallsign9, starNetLogoff9, starNetInfo9, starNetPermanent9, starNetUserTimeout9, starNetGroupTimeout9, starNetCallsignSwitch9, starNetTXMsgSwitch9);
|
||||
::wxGetApp().setStarNet10(starNetBand10, starNetCallsign10, starNetLogoff10, starNetInfo10, starNetPermanent10, starNetUserTimeout10, starNetGroupTimeout10, starNetCallsignSwitch10, starNetTXMsgSwitch10);
|
||||
::wxGetApp().setStarNet11(starNetBand11, starNetCallsign11, starNetLogoff11, starNetInfo11, starNetPermanent11, starNetUserTimeout11, starNetGroupTimeout11, starNetCallsignSwitch11, starNetTXMsgSwitch11);
|
||||
::wxGetApp().setStarNet12(starNetBand12, starNetCallsign12, starNetLogoff12, starNetInfo12, starNetPermanent12, starNetUserTimeout12, starNetGroupTimeout12, starNetCallsignSwitch12, starNetTXMsgSwitch12);
|
||||
::wxGetApp().setStarNet13(starNetBand13, starNetCallsign13, starNetLogoff13, starNetInfo13, starNetPermanent13, starNetUserTimeout13, starNetGroupTimeout13, starNetCallsignSwitch13, starNetTXMsgSwitch13);
|
||||
::wxGetApp().setStarNet14(starNetBand14, starNetCallsign14, starNetLogoff14, starNetInfo14, starNetPermanent14, starNetUserTimeout14, starNetGroupTimeout14, starNetCallsignSwitch14, starNetTXMsgSwitch14);
|
||||
::wxGetApp().setStarNet15(starNetBand15, starNetCallsign15, starNetLogoff15, starNetInfo15, starNetPermanent15, starNetUserTimeout15, starNetGroupTimeout15, starNetCallsignSwitch15, starNetTXMsgSwitch15);
|
||||
#endif
|
||||
::wxGetApp().setRemote(remoteEnabled, remotePassword, remotePort);
|
||||
::wxGetApp().setMiscellaneous(logEnabled);
|
||||
::wxGetApp().writeConfig();
|
||||
|
||||
wxMessageDialog dialog2(this, _("The changes made will not take effect\nuntil the application is restarted"), _("StarNET Server Information"), wxICON_INFORMATION);
|
||||
dialog2.ShowModal();
|
||||
}
|
||||
|
||||
void CStarNetServerFrame::onUpdates(wxCommandEvent& event)
|
||||
{
|
||||
m_updates = event.IsChecked();
|
||||
}
|
||||
|
||||
void CStarNetServerFrame::onAbout(wxCommandEvent&)
|
||||
{
|
||||
wxAboutDialogInfo info;
|
||||
info.AddDeveloper(wxT("Jonathan Naylor, G4KLX"));
|
||||
info.AddDeveloper(wxT("Michael Dirska, DL1BFF"));
|
||||
info.SetCopyright(wxT("(C) 2011-2018 using GPL v2 or later"));
|
||||
info.SetName(APPLICATION_NAME);
|
||||
info.SetVersion(VERSION);
|
||||
info.SetDescription(_("This program allows an Internet connected computer \nto become a StarNet Digital Server."));
|
||||
|
||||
::wxAboutBox(info);
|
||||
}
|
||||
|
||||
void CStarNetServerFrame::onLog(wxEvent& event)
|
||||
{
|
||||
CLogEvent& logEvent = dynamic_cast<CLogEvent&>(event);
|
||||
|
||||
wxString text;
|
||||
|
||||
text = m_logLine[1U]->GetLabel();
|
||||
m_logLine[0U]->SetLabel(text);
|
||||
|
||||
text = m_logLine[2U]->GetLabel();
|
||||
m_logLine[1U]->SetLabel(text);
|
||||
|
||||
text = m_logLine[3U]->GetLabel();
|
||||
m_logLine[2U]->SetLabel(text);
|
||||
|
||||
text = m_logLine[4U]->GetLabel();
|
||||
m_logLine[3U]->SetLabel(text);
|
||||
|
||||
text = m_logLine[5U]->GetLabel();
|
||||
m_logLine[4U]->SetLabel(text);
|
||||
|
||||
text = m_logLine[6U]->GetLabel();
|
||||
m_logLine[5U]->SetLabel(text);
|
||||
|
||||
text = m_logLine[7U]->GetLabel();
|
||||
m_logLine[6U]->SetLabel(text);
|
||||
|
||||
text = m_logLine[8U]->GetLabel();
|
||||
m_logLine[7U]->SetLabel(text);
|
||||
|
||||
text = m_logLine[9U]->GetLabel();
|
||||
m_logLine[8U]->SetLabel(text);
|
||||
|
||||
text = m_logLine[10U]->GetLabel();
|
||||
m_logLine[9U]->SetLabel(text);
|
||||
|
||||
text = m_logLine[11U]->GetLabel();
|
||||
m_logLine[10U]->SetLabel(text);
|
||||
|
||||
text = m_logLine[12U]->GetLabel();
|
||||
m_logLine[11U]->SetLabel(text);
|
||||
|
||||
text = m_logLine[13U]->GetLabel();
|
||||
m_logLine[12U]->SetLabel(text);
|
||||
|
||||
text = m_logLine[14U]->GetLabel();
|
||||
m_logLine[13U]->SetLabel(text);
|
||||
|
||||
text = m_logLine[15U]->GetLabel();
|
||||
m_logLine[14U]->SetLabel(text);
|
||||
|
||||
text = m_logLine[16U]->GetLabel();
|
||||
m_logLine[15U]->SetLabel(text);
|
||||
|
||||
text = m_logLine[17U]->GetLabel();
|
||||
m_logLine[16U]->SetLabel(text);
|
||||
|
||||
text = m_logLine[18U]->GetLabel();
|
||||
m_logLine[17U]->SetLabel(text);
|
||||
|
||||
text = m_logLine[19U]->GetLabel();
|
||||
m_logLine[18U]->SetLabel(text);
|
||||
|
||||
text = logEvent.getText();
|
||||
m_logLine[19U]->SetLabel(text);
|
||||
}
|
||||
|
||||
void CStarNetServerFrame::showLog(const wxString& text)
|
||||
{
|
||||
if (!m_updates)
|
||||
return;
|
||||
|
||||
CLogEvent event(text, LOG_EVENT);
|
||||
|
||||
AddPendingEvent(event);
|
||||
}
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2010,2011,2012 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef StarNetServerFrame_H
|
||||
#define StarNetServerFrame_H
|
||||
|
||||
#include "Defs.h"
|
||||
|
||||
#include <wx/wx.h>
|
||||
#include <wx/tglbtn.h>
|
||||
|
||||
class CStarNetServerFrame : public wxFrame {
|
||||
public:
|
||||
CStarNetServerFrame(const wxString& title, const wxPoint& position, bool gui);
|
||||
virtual ~CStarNetServerFrame();
|
||||
|
||||
virtual void onQuit(wxCommandEvent& event);
|
||||
virtual void onPreferences(wxCommandEvent& event);
|
||||
virtual void onUpdates(wxCommandEvent& event);
|
||||
virtual void onAbout(wxCommandEvent& event);
|
||||
virtual void onClose(wxCloseEvent& event);
|
||||
virtual void onLog(wxEvent& event);
|
||||
|
||||
virtual void showLog(const wxString& text);
|
||||
|
||||
private:
|
||||
wxStaticText* m_logLine[20];
|
||||
bool m_updates;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
wxMenuBar* createMenuBar();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -1,107 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2010,2012,2013,2014 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include "StarNetServerIrcDDBSet.h"
|
||||
|
||||
const unsigned int BORDER_SIZE = 5U;
|
||||
const unsigned int CONTROL_WIDTH1 = 200U;
|
||||
const unsigned int CONTROL_WIDTH2 = 80U;
|
||||
|
||||
const unsigned int PORT_LENGTH = 5U;
|
||||
|
||||
CStarNetServerIrcDDBSet::CStarNetServerIrcDDBSet(wxWindow* parent, int id, const wxString& title, const wxString& hostname, const wxString& username, const wxString& password) :
|
||||
wxPanel(parent, id),
|
||||
m_title(title),
|
||||
m_hostname(NULL),
|
||||
m_username(NULL),
|
||||
m_password(NULL)
|
||||
{
|
||||
wxFlexGridSizer* sizer = new wxFlexGridSizer(2);
|
||||
|
||||
wxStaticText* hostnameLabel = new wxStaticText(this, -1, _("Hostname"));
|
||||
sizer->Add(hostnameLabel, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
|
||||
|
||||
m_hostname = new wxChoice(this, -1, wxDefaultPosition, wxSize(CONTROL_WIDTH1, -1));
|
||||
m_hostname->Append(wxT("group1-irc.ircddb.net"));
|
||||
m_hostname->Append(wxT("group2-irc.ircddb.net"));
|
||||
m_hostname->Append(wxT("irc1.openquad.net"));
|
||||
m_hostname->Append(wxT("irc2.openquad.net"));
|
||||
m_hostname->Append(wxT("irc3.openquad.net"));
|
||||
m_hostname->Append(wxT("irc4.openquad.net"));
|
||||
m_hostname->Append(wxT("irc5.openquad.net"));
|
||||
m_hostname->Append(wxT("irc6.openquad.net"));
|
||||
m_hostname->Append(wxT("server1-ik2xyp.free-dstar.org"));
|
||||
m_hostname->Append(wxT("ircddb.dstar.su"));
|
||||
sizer->Add(m_hostname, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
|
||||
m_hostname->SetStringSelection(hostname);
|
||||
|
||||
wxStaticText* usernameLabel = new wxStaticText(this, -1, _("Username"));
|
||||
sizer->Add(usernameLabel, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
|
||||
|
||||
m_username = new wxTextCtrl(this, -1, username, wxDefaultPosition, wxSize(CONTROL_WIDTH2, -1));
|
||||
sizer->Add(m_username, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
|
||||
|
||||
wxStaticText* passwordLabel = new wxStaticText(this, -1, _("Password"));
|
||||
sizer->Add(passwordLabel, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
|
||||
|
||||
m_password = new wxTextCtrl(this, -1, password, wxDefaultPosition, wxSize(CONTROL_WIDTH1, -1), wxTE_PASSWORD);
|
||||
sizer->Add(m_password, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
|
||||
|
||||
SetAutoLayout(true);
|
||||
|
||||
SetSizer(sizer);
|
||||
}
|
||||
|
||||
|
||||
CStarNetServerIrcDDBSet::~CStarNetServerIrcDDBSet()
|
||||
{
|
||||
}
|
||||
|
||||
bool CStarNetServerIrcDDBSet::Validate()
|
||||
{
|
||||
bool res = getHostname().IsEmpty();
|
||||
if (res) {
|
||||
wxMessageDialog dialog(this, _("The Hostname may not be empty"), m_title + _(" Error"), wxICON_ERROR);
|
||||
dialog.ShowModal();
|
||||
return false;
|
||||
}
|
||||
|
||||
res = getUsername().IsEmpty();
|
||||
if (res) {
|
||||
wxMessageDialog dialog(this, _("The Username may not be empty"), m_title + _(" Error"), wxICON_ERROR);
|
||||
dialog.ShowModal();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
wxString CStarNetServerIrcDDBSet::getHostname() const
|
||||
{
|
||||
return m_hostname->GetStringSelection();
|
||||
}
|
||||
|
||||
wxString CStarNetServerIrcDDBSet::getUsername() const
|
||||
{
|
||||
return m_username->GetValue();
|
||||
}
|
||||
|
||||
wxString CStarNetServerIrcDDBSet::getPassword() const
|
||||
{
|
||||
return m_password->GetValue();
|
||||
}
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2010,2012,2013 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef StarNetServerIrcDDBSet_H
|
||||
#define StarNetServerIrcDDBSet_H
|
||||
|
||||
#include <wx/wx.h>
|
||||
|
||||
class CStarNetServerIrcDDBSet : public wxPanel {
|
||||
public:
|
||||
CStarNetServerIrcDDBSet(wxWindow* parent, int id, const wxString& title, const wxString& hostname, const wxString& username, const wxString& password);
|
||||
virtual ~CStarNetServerIrcDDBSet();
|
||||
|
||||
virtual bool Validate();
|
||||
|
||||
virtual wxString getHostname() const;
|
||||
virtual wxString getUsername() const;
|
||||
virtual wxString getPassword() const;
|
||||
|
||||
private:
|
||||
wxString m_title;
|
||||
wxChoice* m_hostname;
|
||||
wxTextCtrl* m_username;
|
||||
wxTextCtrl* m_password;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2002,2003,2009-2013,2018 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include "StarNetServerLogRedirect.h"
|
||||
#include "StarNetServerApp.h"
|
||||
|
||||
CStarNetServerLogRedirect::CStarNetServerLogRedirect() :
|
||||
wxLog()
|
||||
{
|
||||
}
|
||||
|
||||
CStarNetServerLogRedirect::~CStarNetServerLogRedirect()
|
||||
{
|
||||
}
|
||||
|
||||
void CStarNetServerLogRedirect::DoLogRecord(wxLogLevel level, const wxString& msg, const wxLogRecordInfo& info)
|
||||
{
|
||||
wxString letter;
|
||||
|
||||
switch (level) {
|
||||
case wxLOG_FatalError: letter = wxT("F"); break;
|
||||
case wxLOG_Error: letter = wxT("E"); break;
|
||||
case wxLOG_Warning: letter = wxT("W"); break;
|
||||
case wxLOG_Info: letter = wxT("I"); break;
|
||||
case wxLOG_Message: letter = wxT("M"); break;
|
||||
case wxLOG_Status: letter = wxT("M"); break;
|
||||
case wxLOG_Trace: letter = wxT("T"); break;
|
||||
case wxLOG_Debug: letter = wxT("D"); break;
|
||||
default: letter = wxT("U"); break;
|
||||
}
|
||||
|
||||
struct tm* tm = ::gmtime(&info.timestamp);
|
||||
|
||||
wxString message;
|
||||
message.Printf(wxT("%s: %04d-%02d-%02d %02d:%02d:%02d: %s\n"), letter.c_str(), tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec, msg.c_str());
|
||||
|
||||
::wxGetApp().showLog(message);
|
||||
|
||||
if (level == wxLOG_FatalError)
|
||||
::abort();
|
||||
}
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2010,2011 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include "StarNetServerMiscellaneousSet.h"
|
||||
#include "DStarDefines.h"
|
||||
|
||||
const unsigned int CONTROL_WIDTH = 130U;
|
||||
|
||||
const unsigned int BORDER_SIZE = 5U;
|
||||
|
||||
CStarNetServerMiscellaneousSet::CStarNetServerMiscellaneousSet(wxWindow* parent, int id, const wxString& title, bool logEnabled) :
|
||||
wxPanel(parent, id),
|
||||
m_title(title),
|
||||
m_logEnabled(NULL)
|
||||
{
|
||||
wxFlexGridSizer* sizer = new wxFlexGridSizer(2);
|
||||
|
||||
wxStaticText* logEnabledLabel = new wxStaticText(this, -1, _("GUI Log"));
|
||||
sizer->Add(logEnabledLabel, 0, wxALL | wxALIGN_RIGHT, BORDER_SIZE);
|
||||
|
||||
m_logEnabled = new wxChoice(this, -1, wxDefaultPosition, wxSize(CONTROL_WIDTH, -1));
|
||||
m_logEnabled->Append(_("Disabled"));
|
||||
m_logEnabled->Append(_("Enabled"));
|
||||
sizer->Add(m_logEnabled, 0, wxALL | wxALIGN_LEFT, BORDER_SIZE);
|
||||
m_logEnabled->SetSelection(logEnabled ? 1 : 0);
|
||||
|
||||
SetAutoLayout(true);
|
||||
|
||||
SetSizer(sizer);
|
||||
}
|
||||
|
||||
|
||||
CStarNetServerMiscellaneousSet::~CStarNetServerMiscellaneousSet()
|
||||
{
|
||||
}
|
||||
|
||||
bool CStarNetServerMiscellaneousSet::Validate()
|
||||
{
|
||||
return m_logEnabled->GetCurrentSelection() != wxNOT_FOUND;
|
||||
}
|
||||
|
||||
bool CStarNetServerMiscellaneousSet::getLogEnabled() const
|
||||
{
|
||||
int c = m_logEnabled->GetCurrentSelection();
|
||||
if (c == wxNOT_FOUND)
|
||||
return false;
|
||||
|
||||
return c == 1;
|
||||
}
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2010,2011 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef StarNetServerMiscellaneousSet_H
|
||||
#define StarNetServerMiscellaneousSet_H
|
||||
|
||||
#include "Defs.h"
|
||||
|
||||
#include <wx/wx.h>
|
||||
|
||||
class CStarNetServerMiscellaneousSet : public wxPanel {
|
||||
public:
|
||||
CStarNetServerMiscellaneousSet(wxWindow* parent, int id, const wxString& title, bool logEnabled);
|
||||
virtual ~CStarNetServerMiscellaneousSet();
|
||||
|
||||
virtual bool Validate();
|
||||
|
||||
virtual bool getLogEnabled() const;
|
||||
|
||||
private:
|
||||
wxString m_title;
|
||||
wxChoice* m_logEnabled;
|
||||
};
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,305 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2010,2011,2012,2013 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef StarNetServerPreferences_H
|
||||
#define StarNetServerPreferences_H
|
||||
|
||||
#include <wx/wx.h>
|
||||
#include <wx/notebook.h>
|
||||
|
||||
#include "StarNetServerMiscellaneousSet.h"
|
||||
#include "StarNetServerCallsignSet.h"
|
||||
#include "StarNetServerIrcDDBSet.h"
|
||||
#include "StarNetSet.h"
|
||||
#include "RemoteSet.h"
|
||||
|
||||
class CStarNetServerPreferences : public wxDialog {
|
||||
public:
|
||||
CStarNetServerPreferences(wxWindow* parent, int id,
|
||||
const wxString& callsign, const wxString& address,
|
||||
const wxString& hostname, const wxString& username, const wxString& password,
|
||||
bool logEnabled,
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
const wxString& starNetBand1, const wxString& callsign1, const wxString& logoff1, const wxString& info1, const wxString& permanent1, unsigned int userTimeout1, unsigned int groupTimeout1, STARNET_CALLSIGN_SWITCH callsignSwitch1, bool txMsgSwitch1, const wxString& link1,
|
||||
const wxString& starNetBand2, const wxString& callsign2, const wxString& logoff2, const wxString& info2, const wxString& permanent2, unsigned int userTimeout2, unsigned int groupTimeout2, STARNET_CALLSIGN_SWITCH callsignSwitch2, bool txMsgSwitch2, const wxString& link2,
|
||||
const wxString& starNetBand3, const wxString& callsign3, const wxString& logoff3, const wxString& info3, const wxString& permanent3, unsigned int userTimeout3, unsigned int groupTimeout3, STARNET_CALLSIGN_SWITCH callsignSwitch3, bool txMsgSwitch3, const wxString& link3,
|
||||
const wxString& starNetBand4, const wxString& callsign4, const wxString& logoff4, const wxString& info4, const wxString& permanent4, unsigned int userTimeout4, unsigned int groupTimeout4, STARNET_CALLSIGN_SWITCH callsignSwitch4, bool txMsgSwitch4, const wxString& link4,
|
||||
const wxString& starNetBand5, const wxString& callsign5, const wxString& logoff5, const wxString& info5, const wxString& permanent5, unsigned int userTimeout5, unsigned int groupTimeout5, STARNET_CALLSIGN_SWITCH callsignSwitch5, bool txMsgSwitch5, const wxString& link5,
|
||||
const wxString& starNetBand6, const wxString& callsign6, const wxString& logoff6, const wxString& info6, const wxString& permanent6, unsigned int userTimeout6, unsigned int groupTimeout6, STARNET_CALLSIGN_SWITCH callsignSwitch6, bool txMsgSwitch6, const wxString& link6,
|
||||
const wxString& starNetBand7, const wxString& callsign7, const wxString& logoff7, const wxString& info7, const wxString& permanent7, unsigned int userTimeout7, unsigned int groupTimeout7, STARNET_CALLSIGN_SWITCH callsignSwitch7, bool txMsgSwitch7, const wxString& link7,
|
||||
const wxString& starNetBand8, const wxString& callsign8, const wxString& logoff8, const wxString& info8, const wxString& permanent8, unsigned int userTimeout8, unsigned int groupTimeout8, STARNET_CALLSIGN_SWITCH callsignSwitch8, bool txMsgSwitch8, const wxString& link8,
|
||||
const wxString& starNetBand9, const wxString& callsign9, const wxString& logoff9, const wxString& info9, const wxString& permanent9, unsigned int userTimeout9, unsigned int groupTimeout9, STARNET_CALLSIGN_SWITCH callsignSwitch9, bool txMsgSwitch9, const wxString& link9,
|
||||
const wxString& starNetBand10, const wxString& callsign10, const wxString& logoff10, const wxString& info10, const wxString& permanent10, unsigned int userTimeout10, unsigned int groupTimeout10, STARNET_CALLSIGN_SWITCH callsignSwitch10, bool txMsgSwitch10, const wxString& link10,
|
||||
const wxString& starNetBand11, const wxString& callsign11, const wxString& logoff11, const wxString& info11, const wxString& permanent11, unsigned int userTimeout11, unsigned int groupTimeout11, STARNET_CALLSIGN_SWITCH callsignSwitch11, bool txMsgSwitch11, const wxString& link11,
|
||||
const wxString& starNetBand12, const wxString& callsign12, const wxString& logoff12, const wxString& info12, const wxString& permanent12, unsigned int userTimeout12, unsigned int groupTimeout12, STARNET_CALLSIGN_SWITCH callsignSwitch12, bool txMsgSwitch12, const wxString& link12,
|
||||
const wxString& starNetBand13, const wxString& callsign13, const wxString& logoff13, const wxString& info13, const wxString& permanent13, unsigned int userTimeout13, unsigned int groupTimeout13, STARNET_CALLSIGN_SWITCH callsignSwitch13, bool txMsgSwitch13, const wxString& link13,
|
||||
const wxString& starNetBand14, const wxString& callsign14, const wxString& logoff14, const wxString& info14, const wxString& permanent14, unsigned int userTimeout14, unsigned int groupTimeout14, STARNET_CALLSIGN_SWITCH callsignSwitch14, bool txMsgSwitch14, const wxString& link14,
|
||||
const wxString& starNetBand15, const wxString& callsign15, const wxString& logoff15, const wxString& info15, const wxString& permanent15, unsigned int userTimeout15, unsigned int groupTimeout15, STARNET_CALLSIGN_SWITCH callsignSwitch15, bool txMsgSwitch15, const wxString& link15,
|
||||
#else
|
||||
const wxString& starNetBand1, const wxString& callsign1, const wxString& logoff1, const wxString& info1, const wxString& permanent1, unsigned int userTimeout1, unsigned int groupTimeout1, STARNET_CALLSIGN_SWITCH callsignSwitch1, bool txMsgSwitch1,
|
||||
const wxString& starNetBand2, const wxString& callsign2, const wxString& logoff2, const wxString& info2, const wxString& permanent2, unsigned int userTimeout2, unsigned int groupTimeout2, STARNET_CALLSIGN_SWITCH callsignSwitch2, bool txMsgSwitch2,
|
||||
const wxString& starNetBand3, const wxString& callsign3, const wxString& logoff3, const wxString& info3, const wxString& permanent3, unsigned int userTimeout3, unsigned int groupTimeout3, STARNET_CALLSIGN_SWITCH callsignSwitch3, bool txMsgSwitch3,
|
||||
const wxString& starNetBand4, const wxString& callsign4, const wxString& logoff4, const wxString& info4, const wxString& permanent4, unsigned int userTimeout4, unsigned int groupTimeout4, STARNET_CALLSIGN_SWITCH callsignSwitch4, bool txMsgSwitch4,
|
||||
const wxString& starNetBand5, const wxString& callsign5, const wxString& logoff5, const wxString& info5, const wxString& permanent5, unsigned int userTimeout5, unsigned int groupTimeout5, STARNET_CALLSIGN_SWITCH callsignSwitch5, bool txMsgSwitch5,
|
||||
const wxString& starNetBand6, const wxString& callsign6, const wxString& logoff6, const wxString& info6, const wxString& permanent6, unsigned int userTimeout6, unsigned int groupTimeout6, STARNET_CALLSIGN_SWITCH callsignSwitch6, bool txMsgSwitch6,
|
||||
const wxString& starNetBand7, const wxString& callsign7, const wxString& logoff7, const wxString& info7, const wxString& permanent7, unsigned int userTimeout7, unsigned int groupTimeout7, STARNET_CALLSIGN_SWITCH callsignSwitch7, bool txMsgSwitch7,
|
||||
const wxString& starNetBand8, const wxString& callsign8, const wxString& logoff8, const wxString& info8, const wxString& permanent8, unsigned int userTimeout8, unsigned int groupTimeout8, STARNET_CALLSIGN_SWITCH callsignSwitch8, bool txMsgSwitch8,
|
||||
const wxString& starNetBand9, const wxString& callsign9, const wxString& logoff9, const wxString& info9, const wxString& permanent9, unsigned int userTimeout9, unsigned int groupTimeout9, STARNET_CALLSIGN_SWITCH callsignSwitch9, bool txMsgSwitch9,
|
||||
const wxString& starNetBand10, const wxString& callsign10, const wxString& logoff10, const wxString& info10, const wxString& permanent10, unsigned int userTimeout10, unsigned int groupTimeout10, STARNET_CALLSIGN_SWITCH callsignSwitch10, bool txMsgSwitch10,
|
||||
const wxString& starNetBand11, const wxString& callsign11, const wxString& logoff11, const wxString& info11, const wxString& permanent11, unsigned int userTimeout11, unsigned int groupTimeout11, STARNET_CALLSIGN_SWITCH callsignSwitch11, bool txMsgSwitch11,
|
||||
const wxString& starNetBand12, const wxString& callsign12, const wxString& logoff12, const wxString& info12, const wxString& permanent12, unsigned int userTimeout12, unsigned int groupTimeout12, STARNET_CALLSIGN_SWITCH callsignSwitch12, bool txMsgSwitch12,
|
||||
const wxString& starNetBand13, const wxString& callsign13, const wxString& logoff13, const wxString& info13, const wxString& permanent13, unsigned int userTimeout13, unsigned int groupTimeout13, STARNET_CALLSIGN_SWITCH callsignSwitch13, bool txMsgSwitch13,
|
||||
const wxString& starNetBand14, const wxString& callsign14, const wxString& logoff14, const wxString& info14, const wxString& permanent14, unsigned int userTimeout14, unsigned int groupTimeout14, STARNET_CALLSIGN_SWITCH callsignSwitch14, bool txMsgSwitch14,
|
||||
const wxString& starNetBand15, const wxString& callsign15, const wxString& logoff15, const wxString& info15, const wxString& permanent15, unsigned int userTimeout15, unsigned int groupTimeout15, STARNET_CALLSIGN_SWITCH callsignSwitch15, bool txMsgSwitch15,
|
||||
#endif
|
||||
bool remoteEnabled, const wxString& remotePassword, unsigned int remotePort);
|
||||
virtual ~CStarNetServerPreferences();
|
||||
|
||||
virtual bool Validate();
|
||||
|
||||
virtual wxString getCallsign() const;
|
||||
virtual wxString getAddress() const;
|
||||
|
||||
virtual wxString getHostname() const;
|
||||
virtual wxString getUsername() const;
|
||||
virtual wxString getPassword() const;
|
||||
|
||||
virtual bool getLogEnabled() const;
|
||||
|
||||
virtual wxString getStarNetBand1() const;
|
||||
virtual wxString getStarNetCallsign1() const;
|
||||
virtual wxString getStarNetLogoff1() const;
|
||||
virtual wxString getStarNetInfo1() const;
|
||||
virtual wxString getStarNetPermanent1() const;
|
||||
virtual unsigned int getStarNetUserTimeout1() const;
|
||||
virtual unsigned int getStarNetGroupTimeout1() const;
|
||||
virtual STARNET_CALLSIGN_SWITCH getStarNetCallsignSwitch1() const;
|
||||
virtual bool getStarNetTXMsgSwitch1() const;
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
virtual wxString getStarNetLink1() const;
|
||||
#endif
|
||||
|
||||
virtual wxString getStarNetBand2() const;
|
||||
virtual wxString getStarNetCallsign2() const;
|
||||
virtual wxString getStarNetLogoff2() const;
|
||||
virtual wxString getStarNetInfo2() const;
|
||||
virtual wxString getStarNetPermanent2() const;
|
||||
virtual unsigned int getStarNetUserTimeout2() const;
|
||||
virtual unsigned int getStarNetGroupTimeout2() const;
|
||||
virtual STARNET_CALLSIGN_SWITCH getStarNetCallsignSwitch2() const;
|
||||
virtual bool getStarNetTXMsgSwitch2() const;
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
virtual wxString getStarNetLink2() const;
|
||||
#endif
|
||||
|
||||
virtual wxString getStarNetBand3() const;
|
||||
virtual wxString getStarNetCallsign3() const;
|
||||
virtual wxString getStarNetLogoff3() const;
|
||||
virtual wxString getStarNetInfo3() const;
|
||||
virtual wxString getStarNetPermanent3() const;
|
||||
virtual unsigned int getStarNetUserTimeout3() const;
|
||||
virtual unsigned int getStarNetGroupTimeout3() const;
|
||||
virtual STARNET_CALLSIGN_SWITCH getStarNetCallsignSwitch3() const;
|
||||
virtual bool getStarNetTXMsgSwitch3() const;
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
virtual wxString getStarNetLink3() const;
|
||||
#endif
|
||||
|
||||
virtual wxString getStarNetBand4() const;
|
||||
virtual wxString getStarNetCallsign4() const;
|
||||
virtual wxString getStarNetLogoff4() const;
|
||||
virtual wxString getStarNetInfo4() const;
|
||||
virtual wxString getStarNetPermanent4() const;
|
||||
virtual unsigned int getStarNetUserTimeout4() const;
|
||||
virtual unsigned int getStarNetGroupTimeout4() const;
|
||||
virtual STARNET_CALLSIGN_SWITCH getStarNetCallsignSwitch4() const;
|
||||
virtual bool getStarNetTXMsgSwitch4() const;
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
virtual wxString getStarNetLink4() const;
|
||||
#endif
|
||||
|
||||
virtual wxString getStarNetBand5() const;
|
||||
virtual wxString getStarNetCallsign5() const;
|
||||
virtual wxString getStarNetLogoff5() const;
|
||||
virtual wxString getStarNetInfo5() const;
|
||||
virtual wxString getStarNetPermanent5() const;
|
||||
virtual unsigned int getStarNetUserTimeout5() const;
|
||||
virtual unsigned int getStarNetGroupTimeout5() const;
|
||||
virtual STARNET_CALLSIGN_SWITCH getStarNetCallsignSwitch5() const;
|
||||
virtual bool getStarNetTXMsgSwitch5() const;
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
virtual wxString getStarNetLink5() const;
|
||||
#endif
|
||||
|
||||
virtual wxString getStarNetBand6() const;
|
||||
virtual wxString getStarNetCallsign6() const;
|
||||
virtual wxString getStarNetLogoff6() const;
|
||||
virtual wxString getStarNetInfo6() const;
|
||||
virtual wxString getStarNetPermanent6() const;
|
||||
virtual unsigned int getStarNetUserTimeout6() const;
|
||||
virtual unsigned int getStarNetGroupTimeout6() const;
|
||||
virtual STARNET_CALLSIGN_SWITCH getStarNetCallsignSwitch6() const;
|
||||
virtual bool getStarNetTXMsgSwitch6() const;
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
virtual wxString getStarNetLink6() const;
|
||||
#endif
|
||||
|
||||
virtual wxString getStarNetBand7() const;
|
||||
virtual wxString getStarNetCallsign7() const;
|
||||
virtual wxString getStarNetLogoff7() const;
|
||||
virtual wxString getStarNetInfo7() const;
|
||||
virtual wxString getStarNetPermanent7() const;
|
||||
virtual unsigned int getStarNetUserTimeout7() const;
|
||||
virtual unsigned int getStarNetGroupTimeout7() const;
|
||||
virtual STARNET_CALLSIGN_SWITCH getStarNetCallsignSwitch7() const;
|
||||
virtual bool getStarNetTXMsgSwitch7() const;
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
virtual wxString getStarNetLink7() const;
|
||||
#endif
|
||||
|
||||
virtual wxString getStarNetBand8() const;
|
||||
virtual wxString getStarNetCallsign8() const;
|
||||
virtual wxString getStarNetLogoff8() const;
|
||||
virtual wxString getStarNetInfo8() const;
|
||||
virtual wxString getStarNetPermanent8() const;
|
||||
virtual unsigned int getStarNetUserTimeout8() const;
|
||||
virtual unsigned int getStarNetGroupTimeout8() const;
|
||||
virtual STARNET_CALLSIGN_SWITCH getStarNetCallsignSwitch8() const;
|
||||
virtual bool getStarNetTXMsgSwitch8() const;
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
virtual wxString getStarNetLink8() const;
|
||||
#endif
|
||||
|
||||
virtual wxString getStarNetBand9() const;
|
||||
virtual wxString getStarNetCallsign9() const;
|
||||
virtual wxString getStarNetLogoff9() const;
|
||||
virtual wxString getStarNetInfo9() const;
|
||||
virtual wxString getStarNetPermanent9() const;
|
||||
virtual unsigned int getStarNetUserTimeout9() const;
|
||||
virtual unsigned int getStarNetGroupTimeout9() const;
|
||||
virtual STARNET_CALLSIGN_SWITCH getStarNetCallsignSwitch9() const;
|
||||
virtual bool getStarNetTXMsgSwitch9() const;
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
virtual wxString getStarNetLink9() const;
|
||||
#endif
|
||||
|
||||
virtual wxString getStarNetBand10() const;
|
||||
virtual wxString getStarNetCallsign10() const;
|
||||
virtual wxString getStarNetLogoff10() const;
|
||||
virtual wxString getStarNetInfo10() const;
|
||||
virtual wxString getStarNetPermanent10() const;
|
||||
virtual unsigned int getStarNetUserTimeout10() const;
|
||||
virtual unsigned int getStarNetGroupTimeout10() const;
|
||||
virtual STARNET_CALLSIGN_SWITCH getStarNetCallsignSwitch10() const;
|
||||
virtual bool getStarNetTXMsgSwitch10() const;
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
virtual wxString getStarNetLink10() const;
|
||||
#endif
|
||||
|
||||
virtual wxString getStarNetBand11() const;
|
||||
virtual wxString getStarNetCallsign11() const;
|
||||
virtual wxString getStarNetLogoff11() const;
|
||||
virtual wxString getStarNetInfo11() const;
|
||||
virtual wxString getStarNetPermanent11() const;
|
||||
virtual unsigned int getStarNetUserTimeout11() const;
|
||||
virtual unsigned int getStarNetGroupTimeout11() const;
|
||||
virtual STARNET_CALLSIGN_SWITCH getStarNetCallsignSwitch11() const;
|
||||
virtual bool getStarNetTXMsgSwitch11() const;
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
virtual wxString getStarNetLink11() const;
|
||||
#endif
|
||||
|
||||
virtual wxString getStarNetBand12() const;
|
||||
virtual wxString getStarNetCallsign12() const;
|
||||
virtual wxString getStarNetLogoff12() const;
|
||||
virtual wxString getStarNetInfo12() const;
|
||||
virtual wxString getStarNetPermanent12() const;
|
||||
virtual unsigned int getStarNetUserTimeout12() const;
|
||||
virtual unsigned int getStarNetGroupTimeout12() const;
|
||||
virtual STARNET_CALLSIGN_SWITCH getStarNetCallsignSwitch12() const;
|
||||
virtual bool getStarNetTXMsgSwitch12() const;
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
virtual wxString getStarNetLink12() const;
|
||||
#endif
|
||||
|
||||
virtual wxString getStarNetBand13() const;
|
||||
virtual wxString getStarNetCallsign13() const;
|
||||
virtual wxString getStarNetLogoff13() const;
|
||||
virtual wxString getStarNetInfo13() const;
|
||||
virtual wxString getStarNetPermanent13() const;
|
||||
virtual unsigned int getStarNetUserTimeout13() const;
|
||||
virtual unsigned int getStarNetGroupTimeout13() const;
|
||||
virtual STARNET_CALLSIGN_SWITCH getStarNetCallsignSwitch13() const;
|
||||
virtual bool getStarNetTXMsgSwitch13() const;
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
virtual wxString getStarNetLink13() const;
|
||||
#endif
|
||||
|
||||
virtual wxString getStarNetBand14() const;
|
||||
virtual wxString getStarNetCallsign14() const;
|
||||
virtual wxString getStarNetLogoff14() const;
|
||||
virtual wxString getStarNetInfo14() const;
|
||||
virtual wxString getStarNetPermanent14() const;
|
||||
virtual unsigned int getStarNetUserTimeout14() const;
|
||||
virtual unsigned int getStarNetGroupTimeout14() const;
|
||||
virtual STARNET_CALLSIGN_SWITCH getStarNetCallsignSwitch14() const;
|
||||
virtual bool getStarNetTXMsgSwitch14() const;
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
virtual wxString getStarNetLink14() const;
|
||||
#endif
|
||||
|
||||
virtual wxString getStarNetBand15() const;
|
||||
virtual wxString getStarNetCallsign15() const;
|
||||
virtual wxString getStarNetLogoff15() const;
|
||||
virtual wxString getStarNetInfo15() const;
|
||||
virtual wxString getStarNetPermanent15() const;
|
||||
virtual unsigned int getStarNetUserTimeout15() const;
|
||||
virtual unsigned int getStarNetGroupTimeout15() const;
|
||||
virtual STARNET_CALLSIGN_SWITCH getStarNetCallsignSwitch15() const;
|
||||
virtual bool getStarNetTXMsgSwitch15() const;
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
virtual wxString getStarNetLink15() const;
|
||||
#endif
|
||||
|
||||
virtual bool getRemoteEnabled() const;
|
||||
virtual wxString getRemotePassword() const;
|
||||
virtual unsigned int getRemotePort() const;
|
||||
|
||||
private:
|
||||
CStarNetServerCallsignSet* m_callsign;
|
||||
CStarNetServerIrcDDBSet* m_ircDDB;
|
||||
CStarNetSet* m_starNet1;
|
||||
CStarNetSet* m_starNet2;
|
||||
CStarNetSet* m_starNet3;
|
||||
CStarNetSet* m_starNet4;
|
||||
CStarNetSet* m_starNet5;
|
||||
CStarNetSet* m_starNet6;
|
||||
CStarNetSet* m_starNet7;
|
||||
CStarNetSet* m_starNet8;
|
||||
CStarNetSet* m_starNet9;
|
||||
CStarNetSet* m_starNet10;
|
||||
CStarNetSet* m_starNet11;
|
||||
CStarNetSet* m_starNet12;
|
||||
CStarNetSet* m_starNet13;
|
||||
CStarNetSet* m_starNet14;
|
||||
CStarNetSet* m_starNet15;
|
||||
CRemoteSet* m_remote;
|
||||
CStarNetServerMiscellaneousSet* m_miscellaneous;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -1,627 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2010-2014 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include "StarNetServerThread.h"
|
||||
#include "StarNetServerDefs.h"
|
||||
#include "StarNetHandler.h"
|
||||
#include "DExtraHandler.h" // DEXTRA LINK
|
||||
#include "DCSHandler.h" // DCS LINK
|
||||
#include "HeaderData.h"
|
||||
#include "G2Handler.h"
|
||||
#include "AMBEData.h"
|
||||
#include "HostFile.h" // DEXTRA_LINK || DCS_LINK
|
||||
#include "Utils.h"
|
||||
|
||||
#include <wx/filename.h>
|
||||
#include <wx/ffile.h>
|
||||
|
||||
const unsigned int REMOTE_DUMMY_PORT = 65015U;
|
||||
|
||||
CStarNetServerThread::CStarNetServerThread(bool nolog, const wxString& logDir) :
|
||||
m_nolog(nolog),
|
||||
m_logDir(logDir),
|
||||
m_killed(false),
|
||||
m_stopped(true),
|
||||
m_callsign(),
|
||||
m_address(),
|
||||
#if defined(DEXTRA_LINK)
|
||||
m_dextraPool(NULL),
|
||||
#endif
|
||||
#if defined(DCS_LINK)
|
||||
m_dcsPool(NULL),
|
||||
#endif
|
||||
m_g2Handler(NULL),
|
||||
m_irc(NULL),
|
||||
m_cache(),
|
||||
m_logEnabled(false),
|
||||
m_statusTimer(1000U, 1U), // 1 second
|
||||
m_lastStatus(IS_DISCONNECTED),
|
||||
m_remoteEnabled(false),
|
||||
m_remotePassword(),
|
||||
m_remotePort(0U),
|
||||
m_remote(NULL)
|
||||
{
|
||||
CHeaderData::initialise();
|
||||
CG2Handler::initialise(MAX_ROUTES);
|
||||
CStarNetHandler::initialise(MAX_STARNETS);
|
||||
#if defined(DEXTRA_LINK)
|
||||
CDExtraHandler::initialise(MAX_DEXTRA_LINKS);
|
||||
#endif
|
||||
#if defined(DCS_LINK)
|
||||
CDCSHandler::initialise(MAX_DCS_LINKS);
|
||||
#endif
|
||||
}
|
||||
|
||||
CStarNetServerThread::~CStarNetServerThread()
|
||||
{
|
||||
CHeaderData::finalise();
|
||||
CG2Handler::finalise();
|
||||
CStarNetHandler::finalise();
|
||||
#if defined(DEXTRA_LINK)
|
||||
CDExtraHandler::finalise();
|
||||
#endif
|
||||
#if defined(DCS_LINK)
|
||||
CDCSHandler::finalise();
|
||||
#endif
|
||||
}
|
||||
|
||||
void CStarNetServerThread::run()
|
||||
{
|
||||
// Truncate the old StarNet.log file
|
||||
wxFileName fileName(m_logDir, STARNET_BASE_NAME, wxT("log"));
|
||||
wxLogMessage(wxT("Truncating %s"), fileName.GetFullPath().c_str());
|
||||
|
||||
wxFFile file;
|
||||
bool ret = file.Open(fileName.GetFullPath(), wxT("wt"));
|
||||
if (ret)
|
||||
file.Close();
|
||||
|
||||
#if defined(DEXTRA_LINK)
|
||||
m_dextraPool = new CDExtraProtocolHandlerPool(MAX_DEXTRA_LINKS, DEXTRA_PORT, m_address);
|
||||
ret = m_dextraPool->open();
|
||||
if (!ret) {
|
||||
wxLogError(wxT("Could not open the DExtra protocol pool"));
|
||||
delete m_dextraPool;
|
||||
m_dextraPool = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(DCS_LINK)
|
||||
m_dcsPool = new CDCSProtocolHandlerPool(MAX_DCS_LINKS, DCS_PORT, m_address);
|
||||
ret = m_dcsPool->open();
|
||||
if (!ret) {
|
||||
wxLogError(wxT("Could not open the DCS protocol pool"));
|
||||
delete m_dcsPool;
|
||||
m_dcsPool = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
m_g2Handler = new CG2ProtocolHandler(G2_DV_PORT, m_address);
|
||||
ret = m_g2Handler->open();
|
||||
if (!ret) {
|
||||
wxLogError(wxT("Could not open the G2 protocol handler"));
|
||||
delete m_g2Handler;
|
||||
m_g2Handler = NULL;
|
||||
}
|
||||
|
||||
// Wait here until we have the essentials to run
|
||||
#if defined(DEXTRA_LINK)
|
||||
while (!m_killed && (m_g2Handler == NULL || m_dextraPool == NULL || m_irc == NULL || m_callsign.IsEmpty()))
|
||||
::wxMilliSleep(500UL); // 1/2 sec
|
||||
#elif defined(DCS_LINK)
|
||||
while (!m_killed && (m_g2Handler == NULL || m_dcsPool == NULL || m_irc == NULL || m_callsign.IsEmpty()))
|
||||
::wxMilliSleep(500UL); // 1/2 sec
|
||||
#else
|
||||
while (!m_killed && (m_g2Handler == NULL || m_irc == NULL || m_callsign.IsEmpty()))
|
||||
::wxMilliSleep(500UL); // 1/2 sec
|
||||
#endif
|
||||
|
||||
if (m_killed)
|
||||
return;
|
||||
|
||||
m_stopped = false;
|
||||
|
||||
wxLogMessage(wxT("Starting the StarNet Server thread"));
|
||||
|
||||
CHeaderLogger* headerLogger = NULL;
|
||||
if (m_logEnabled) {
|
||||
headerLogger = new CHeaderLogger(m_logDir);
|
||||
ret = headerLogger->open();
|
||||
if (!ret) {
|
||||
delete headerLogger;
|
||||
headerLogger = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
loadReflectors();
|
||||
#endif
|
||||
|
||||
CG2Handler::setG2ProtocolHandler(m_g2Handler);
|
||||
CG2Handler::setHeaderLogger(headerLogger);
|
||||
|
||||
#if defined(DEXTRA_LINK)
|
||||
CDExtraHandler::setCallsign(m_callsign);
|
||||
CDExtraHandler::setDExtraProtocolHandlerPool(m_dextraPool);
|
||||
CDExtraHandler::setHeaderLogger(headerLogger);
|
||||
#endif
|
||||
#if defined(DCS_LINK)
|
||||
CDCSHandler::setDCSProtocolHandlerPool(m_dcsPool);
|
||||
CDCSHandler::setHeaderLogger(headerLogger);
|
||||
CDCSHandler::setGatewayType(GT_STARNET);
|
||||
#endif
|
||||
|
||||
CStarNetHandler::setCache(&m_cache);
|
||||
CStarNetHandler::setGateway(m_callsign);
|
||||
CStarNetHandler::setG2Handler(m_g2Handler);
|
||||
CStarNetHandler::setIRC(m_irc);
|
||||
CStarNetHandler::setLogging(m_logEnabled, m_logDir);
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
CStarNetHandler::link();
|
||||
#endif
|
||||
|
||||
if (m_remoteEnabled && !m_remotePassword.IsEmpty() && m_remotePort > 0U) {
|
||||
m_remote = new CRemoteHandler(m_remotePassword, m_remotePort);
|
||||
bool res = m_remote->open();
|
||||
if (!res) {
|
||||
delete m_remote;
|
||||
m_remote = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
wxStopWatch stopWatch;
|
||||
stopWatch.Start();
|
||||
|
||||
m_statusTimer.start();
|
||||
|
||||
try {
|
||||
while (!m_killed) {
|
||||
processIrcDDB();
|
||||
processG2();
|
||||
#if defined(DEXTRA_LINK)
|
||||
processDExtra();
|
||||
#endif
|
||||
#if defined(DCS_LINK)
|
||||
processDCS();
|
||||
#endif
|
||||
if (m_remote != NULL)
|
||||
m_remote->process();
|
||||
|
||||
unsigned long ms = stopWatch.Time();
|
||||
stopWatch.Start();
|
||||
|
||||
m_statusTimer.clock(ms);
|
||||
|
||||
CG2Handler::clock(ms);
|
||||
CStarNetHandler::clock(ms);
|
||||
#if defined(DEXTRA_LINK)
|
||||
CDExtraHandler::clock(ms);
|
||||
#endif
|
||||
#if defined(DCS_LINK)
|
||||
CDCSHandler::clock(ms);
|
||||
#endif
|
||||
|
||||
::wxMilliSleep(TIME_PER_TIC_MS);
|
||||
}
|
||||
}
|
||||
catch (std::exception& e) {
|
||||
wxString message(e.what(), wxConvLocal);
|
||||
wxLogError(wxT("Exception raised - \"%s\""), message.c_str());
|
||||
}
|
||||
catch (...) {
|
||||
wxLogError(wxT("Unknown exception raised"));
|
||||
}
|
||||
|
||||
wxLogMessage(wxT("Stopping the StarNet Server thread"));
|
||||
|
||||
#if defined(DEXTRA_LINK)
|
||||
// Unlink from all reflectors
|
||||
CDExtraHandler::unlink();
|
||||
|
||||
m_dextraPool->close();
|
||||
delete m_dextraPool;
|
||||
#endif
|
||||
|
||||
#if defined(DCS_LINK)
|
||||
// Unlink from all reflectors
|
||||
CDCSHandler::unlink();
|
||||
|
||||
m_dcsPool->close();
|
||||
delete m_dcsPool;
|
||||
#endif
|
||||
|
||||
m_g2Handler->close();
|
||||
delete m_g2Handler;
|
||||
|
||||
m_irc->close();
|
||||
delete m_irc;
|
||||
|
||||
if (m_remote != NULL) {
|
||||
m_remote->close();
|
||||
delete m_remote;
|
||||
}
|
||||
|
||||
if (headerLogger != NULL) {
|
||||
headerLogger->close();
|
||||
delete headerLogger;
|
||||
}
|
||||
}
|
||||
|
||||
void CStarNetServerThread::kill()
|
||||
{
|
||||
m_killed = true;
|
||||
}
|
||||
|
||||
void CStarNetServerThread::setCallsign(const wxString& callsign)
|
||||
{
|
||||
if (!m_stopped)
|
||||
return;
|
||||
|
||||
m_callsign = callsign;
|
||||
}
|
||||
|
||||
void CStarNetServerThread::setAddress(const wxString& address)
|
||||
{
|
||||
m_address = address;
|
||||
}
|
||||
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
void CStarNetServerThread::addStarNet(const wxString& callsign, const wxString& logoff, const wxString& repeater, const wxString& infoText, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector)
|
||||
{
|
||||
CStarNetHandler::add(callsign, logoff, repeater, infoText, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch, reflector);
|
||||
}
|
||||
#else
|
||||
void CStarNetServerThread::addStarNet(const wxString& callsign, const wxString& logoff, const wxString& repeater, const wxString& infoText, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch)
|
||||
{
|
||||
CStarNetHandler::add(callsign, logoff, repeater, infoText, permanent, userTimeout, groupTimeout, callsignSwitch, txMsgSwitch);
|
||||
}
|
||||
#endif
|
||||
|
||||
void CStarNetServerThread::setIRC(CIRCDDB* irc)
|
||||
{
|
||||
wxASSERT(irc != NULL);
|
||||
|
||||
m_irc = irc;
|
||||
}
|
||||
|
||||
void CStarNetServerThread::setLog(bool enabled)
|
||||
{
|
||||
m_logEnabled = enabled;
|
||||
}
|
||||
|
||||
void CStarNetServerThread::setRemote(bool enabled, const wxString& password, unsigned int port)
|
||||
{
|
||||
if (enabled) {
|
||||
m_remoteEnabled = true;
|
||||
m_remotePassword = password;
|
||||
m_remotePort = port;
|
||||
} else {
|
||||
m_remoteEnabled = false;
|
||||
m_remotePassword = password;
|
||||
m_remotePort = REMOTE_DUMMY_PORT;
|
||||
}
|
||||
}
|
||||
|
||||
void CStarNetServerThread::processIrcDDB()
|
||||
{
|
||||
// Once per second
|
||||
if (m_statusTimer.hasExpired()) {
|
||||
int status = m_irc->getConnectionState();
|
||||
switch (status) {
|
||||
case 0:
|
||||
case 10:
|
||||
if (m_lastStatus != IS_DISCONNECTED) {
|
||||
wxLogInfo(wxT("Disconnected from ircDDB"));
|
||||
m_lastStatus = IS_DISCONNECTED;
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
if (m_lastStatus != IS_CONNECTED) {
|
||||
wxLogInfo(wxT("Connected to ircDDB"));
|
||||
m_lastStatus = IS_CONNECTED;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (m_lastStatus != IS_CONNECTING) {
|
||||
wxLogInfo(wxT("Connecting to ircDDB"));
|
||||
m_lastStatus = IS_CONNECTING;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
m_statusTimer.start();
|
||||
}
|
||||
|
||||
// Process all incoming ircDDB messages, updating the caches
|
||||
for (;;) {
|
||||
IRCDDB_RESPONSE_TYPE type = m_irc->getMessageType();
|
||||
|
||||
switch (type) {
|
||||
case IDRT_NONE:
|
||||
return;
|
||||
|
||||
case IDRT_USER: {
|
||||
wxString user, repeater, gateway, address, timestamp;
|
||||
bool res = m_irc->receiveUser(user, repeater, gateway, address, timestamp);
|
||||
if (!res)
|
||||
break;
|
||||
|
||||
if (!address.IsEmpty()) {
|
||||
wxLogMessage(wxT("USER: %s %s %s %s"), user.c_str(), repeater.c_str(), gateway.c_str(), address.c_str());
|
||||
m_cache.updateUser(user, repeater, gateway, address, timestamp, DP_DEXTRA, false, false);
|
||||
} else {
|
||||
wxLogMessage(wxT("USER: %s NOT FOUND"), user.c_str());
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case IDRT_REPEATER: {
|
||||
wxString repeater, gateway, address;
|
||||
bool res = m_irc->receiveRepeater(repeater, gateway, address);
|
||||
if (!res)
|
||||
break;
|
||||
|
||||
if (!address.IsEmpty()) {
|
||||
wxLogMessage(wxT("REPEATER: %s %s %s"), repeater.c_str(), gateway.c_str(), address.c_str());
|
||||
m_cache.updateRepeater(repeater, gateway, address, DP_DEXTRA, false, false);
|
||||
} else {
|
||||
wxLogMessage(wxT("REPEATER: %s NOT FOUND"), repeater.c_str());
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case IDRT_GATEWAY: {
|
||||
wxString gateway, address;
|
||||
bool res = m_irc->receiveGateway(gateway, address);
|
||||
if (!res)
|
||||
break;
|
||||
|
||||
#if defined(DEXTRA_LINK)
|
||||
CDExtraHandler::gatewayUpdate(gateway, address);
|
||||
#endif
|
||||
#if defined(DCS_LINK)
|
||||
CDCSHandler::gatewayUpdate(gateway, address);
|
||||
#endif
|
||||
|
||||
if (!address.IsEmpty()) {
|
||||
wxLogMessage(wxT("GATEWAY: %s %s"), gateway.c_str(), address.c_str());
|
||||
m_cache.updateGateway(gateway, address, DP_DEXTRA, false, false);
|
||||
} else {
|
||||
wxLogMessage(wxT("GATEWAY: %s NOT FOUND"), gateway.c_str());
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(DEXTRA_LINK)
|
||||
void CStarNetServerThread::processDExtra()
|
||||
{
|
||||
for (;;) {
|
||||
DEXTRA_TYPE type = m_dextraPool->read();
|
||||
|
||||
switch (type) {
|
||||
case DE_NONE:
|
||||
return;
|
||||
|
||||
case DE_POLL: {
|
||||
CPollData* poll = m_dextraPool->readPoll();
|
||||
if (poll != NULL) {
|
||||
CDExtraHandler::process(*poll);
|
||||
delete poll;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case DE_CONNECT: {
|
||||
CConnectData* connect = m_dextraPool->readConnect();
|
||||
if (connect != NULL) {
|
||||
CDExtraHandler::process(*connect);
|
||||
delete connect;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case DE_HEADER: {
|
||||
CHeaderData* header = m_dextraPool->readHeader();
|
||||
if (header != NULL) {
|
||||
// wxLogMessage(wxT("DExtra header - My: %s/%s Your: %s Rpt1: %s Rpt2: %s"), header->getMyCall1().c_str(), header->getMyCall2().c_str(), header->getYourCall().c_str(), header->getRptCall1().c_str(), header->getRptCall2().c_str());
|
||||
CDExtraHandler::process(*header);
|
||||
delete header;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case DE_AMBE: {
|
||||
CAMBEData* data = m_dextraPool->readAMBE();
|
||||
if (data != NULL) {
|
||||
CDExtraHandler::process(*data);
|
||||
delete data;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(DCS_LINK)
|
||||
void CStarNetServerThread::processDCS()
|
||||
{
|
||||
for (;;) {
|
||||
DCS_TYPE type = m_dcsPool->read();
|
||||
|
||||
switch (type) {
|
||||
case DC_NONE:
|
||||
return;
|
||||
|
||||
case DC_POLL: {
|
||||
CPollData* poll = m_dcsPool->readPoll();
|
||||
if (poll != NULL) {
|
||||
CDCSHandler::process(*poll);
|
||||
delete poll;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case DC_CONNECT: {
|
||||
CConnectData* connect = m_dcsPool->readConnect();
|
||||
if (connect != NULL) {
|
||||
CDCSHandler::process(*connect);
|
||||
delete connect;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case DC_DATA: {
|
||||
CAMBEData* data = m_dcsPool->readData();
|
||||
if (data != NULL) {
|
||||
// wxLogMessage(wxT("DCS header - My: %s/%s Your: %s Rpt1: %s Rpt2: %s"), header->getMyCall1().c_str(), header->getMyCall2().c_str(), header->getYourCall().c_str(), header->getRptCall1().c_str(), header->getRptCall2().c_str());
|
||||
CDCSHandler::process(*data);
|
||||
delete data;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void CStarNetServerThread::processG2()
|
||||
{
|
||||
for (;;) {
|
||||
G2_TYPE type = m_g2Handler->read();
|
||||
|
||||
switch (type) {
|
||||
case GT_NONE:
|
||||
return;
|
||||
|
||||
case GT_HEADER: {
|
||||
CHeaderData* header = m_g2Handler->readHeader();
|
||||
if (header != NULL) {
|
||||
// wxLogMessage(wxT("G2 header - My: %s/%s Your: %s Rpt1: %s Rpt2: %s Flags: %02X %02X %02X"), header->getMyCall1().c_str(), header->getMyCall2().c_str(), header->getYourCall().c_str(), header->getRptCall1().c_str(), header->getRptCall2().c_str(), header->getFlag1(), header->getFlag2(), header->getFlag3());
|
||||
CG2Handler::process(*header);
|
||||
delete header;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case GT_AMBE: {
|
||||
CAMBEData* data = m_g2Handler->readAMBE();
|
||||
if (data != NULL) {
|
||||
CG2Handler::process(*data);
|
||||
delete data;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(DEXTRA_LINK)
|
||||
void CStarNetServerThread::loadReflectors()
|
||||
{
|
||||
wxFileName fileName(wxFileName::GetHomeDir(), DEXTRA_HOSTS_FILE_NAME);
|
||||
|
||||
if (!fileName.IsFileReadable()) {
|
||||
wxLogMessage(wxT("File %s not readable"), fileName.GetFullPath().c_str());
|
||||
#if defined(__WINDOWS__)
|
||||
fileName.Assign(::wxGetCwd(), DEXTRA_HOSTS_FILE_NAME);
|
||||
#else
|
||||
fileName.Assign(wxT(DATA_DIR), DEXTRA_HOSTS_FILE_NAME);
|
||||
#endif
|
||||
if (!fileName.IsFileReadable())
|
||||
wxLogMessage(wxT("File %s not readable"), fileName.GetFullPath().c_str());
|
||||
}
|
||||
|
||||
unsigned int count = 0U;
|
||||
|
||||
CHostFile hostFile(fileName.GetFullPath(), true);
|
||||
for (unsigned int i = 0U; i < hostFile.getCount(); i++) {
|
||||
wxString reflector = hostFile.getName(i);
|
||||
in_addr address = CUDPReaderWriter::lookup(hostFile.getAddress(i));
|
||||
bool lock = hostFile.getLock(i);
|
||||
|
||||
if (address.s_addr != INADDR_NONE) {
|
||||
unsigned char* ucp = (unsigned char*)&address;
|
||||
|
||||
wxString addrText;
|
||||
addrText.Printf(wxT("%u.%u.%u.%u"), ucp[0U] & 0xFFU, ucp[1U] & 0xFFU, ucp[2U] & 0xFFU, ucp[3U] & 0xFFU);
|
||||
|
||||
if (lock)
|
||||
wxLogMessage(wxT("Locking %s to %s"), reflector.c_str(), addrText.c_str());
|
||||
|
||||
reflector.Append(wxT(" "));
|
||||
reflector.Truncate(LONG_CALLSIGN_LENGTH - 1U);
|
||||
reflector.Append(wxT("G"));
|
||||
m_cache.updateGateway(reflector, addrText, DP_DEXTRA, lock, true);
|
||||
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
wxLogMessage(wxT("Loaded %u of %u DExtra reflectors"), count, hostFile.getCount());
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(DCS_LINK)
|
||||
void CStarNetServerThread::loadReflectors()
|
||||
{
|
||||
wxFileName fileName(wxFileName::GetHomeDir(), DCS_HOSTS_FILE_NAME);
|
||||
|
||||
if (!fileName.IsFileReadable()) {
|
||||
wxLogMessage(wxT("File %s not readable"), fileName.GetFullPath().c_str());
|
||||
#if defined(__WINDOWS__)
|
||||
fileName.Assign(::wxGetCwd(), DCS_HOSTS_FILE_NAME);
|
||||
#else
|
||||
fileName.Assign(wxT(DATA_DIR), DCS_HOSTS_FILE_NAME);
|
||||
#endif
|
||||
if (!fileName.IsFileReadable())
|
||||
wxLogMessage(wxT("File %s not readable"), fileName.GetFullPath().c_str());
|
||||
}
|
||||
|
||||
unsigned int count = 0U;
|
||||
|
||||
CHostFile hostFile(fileName.GetFullPath(), true);
|
||||
for (unsigned int i = 0U; i < hostFile.getCount(); i++) {
|
||||
wxString reflector = hostFile.getName(i);
|
||||
in_addr address = CUDPReaderWriter::lookup(hostFile.getAddress(i));
|
||||
bool lock = hostFile.getLock(i);
|
||||
|
||||
if (address.s_addr != INADDR_NONE) {
|
||||
unsigned char* ucp = (unsigned char*)&address;
|
||||
|
||||
wxString addrText;
|
||||
addrText.Printf(wxT("%u.%u.%u.%u"), ucp[0U] & 0xFFU, ucp[1U] & 0xFFU, ucp[2U] & 0xFFU, ucp[3U] & 0xFFU);
|
||||
|
||||
if (lock)
|
||||
wxLogMessage(wxT("Locking %s to %s"), reflector.c_str(), addrText.c_str());
|
||||
|
||||
reflector.Append(wxT(" "));
|
||||
reflector.Truncate(LONG_CALLSIGN_LENGTH - 1U);
|
||||
reflector.Append(wxT("G"));
|
||||
m_cache.updateGateway(reflector, addrText, DP_DCS, lock, true);
|
||||
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
wxLogMessage(wxT("Loaded %u of %u DCS reflectors"), count, hostFile.getCount());
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1,88 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2010,2011,2012,2013 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef StarNetServerThread_H
|
||||
#define StarNetServerThread_H
|
||||
|
||||
#include "DExtraProtocolHandlerPool.h" // DEXTRA_LINK
|
||||
#include "DCSProtocolHandlerPool.h" // DCS_LINK
|
||||
#include "G2ProtocolHandler.h"
|
||||
#include "RemoteHandler.h"
|
||||
#include "CacheManager.h"
|
||||
#include "IRCDDB.h"
|
||||
#include "Timer.h"
|
||||
#include "Defs.h"
|
||||
|
||||
#include <wx/wx.h>
|
||||
|
||||
class CStarNetServerThread {
|
||||
public:
|
||||
CStarNetServerThread(bool nolog, const wxString& logDir);
|
||||
virtual ~CStarNetServerThread();
|
||||
|
||||
virtual void setCallsign(const wxString& callsign);
|
||||
virtual void setAddress(const wxString& address);
|
||||
#if defined(DEXTRA_LINK) || defined(DCS_LINK)
|
||||
virtual void addStarNet(const wxString& callsign, const wxString& logoff, const wxString& repeater, const wxString& infoText, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch, const wxString& reflector);
|
||||
#else
|
||||
virtual void addStarNet(const wxString& callsign, const wxString& logoff, const wxString& repeater, const wxString& infoText, const wxString& permanent, unsigned int userTimeout, unsigned int groupTimeout, STARNET_CALLSIGN_SWITCH callsignSwitch, bool txMsgSwitch);
|
||||
#endif
|
||||
virtual void setRemote(bool enabled, const wxString& password, unsigned int port);
|
||||
virtual void setIRC(CIRCDDB* irc);
|
||||
virtual void setLog(bool enabled);
|
||||
|
||||
virtual void run();
|
||||
virtual void kill();
|
||||
|
||||
private:
|
||||
bool m_nolog;
|
||||
wxString m_logDir;
|
||||
bool m_killed;
|
||||
bool m_stopped;
|
||||
wxString m_callsign;
|
||||
wxString m_address;
|
||||
#if defined(DEXTRA_LINK)
|
||||
CDExtraProtocolHandlerPool* m_dextraPool;
|
||||
#endif
|
||||
#if defined(DCS_LINK)
|
||||
CDCSProtocolHandlerPool* m_dcsPool;
|
||||
#endif
|
||||
CG2ProtocolHandler* m_g2Handler;
|
||||
CIRCDDB* m_irc;
|
||||
CCacheManager m_cache;
|
||||
bool m_logEnabled;
|
||||
CTimer m_statusTimer;
|
||||
IRCDDB_STATUS m_lastStatus;
|
||||
bool m_remoteEnabled;
|
||||
wxString m_remotePassword;
|
||||
unsigned int m_remotePort;
|
||||
CRemoteHandler* m_remote;
|
||||
|
||||
void processIrcDDB();
|
||||
void processG2();
|
||||
#if defined(DEXTRA_LINK)
|
||||
void processDExtra();
|
||||
void loadReflectors();
|
||||
#endif
|
||||
#if defined(DCS_LINK)
|
||||
void processDCS();
|
||||
void loadReflectors();
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2012 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include "StarNetServerThreadHelper.h"
|
||||
|
||||
CStarNetServerThreadHelper::CStarNetServerThreadHelper(CStarNetServerThread* thread) :
|
||||
wxThread(wxTHREAD_JOINABLE),
|
||||
m_thread(thread)
|
||||
{
|
||||
wxASSERT(thread != NULL);
|
||||
}
|
||||
|
||||
CStarNetServerThreadHelper::~CStarNetServerThreadHelper()
|
||||
{
|
||||
delete m_thread;
|
||||
}
|
||||
|
||||
void CStarNetServerThreadHelper::start()
|
||||
{
|
||||
Create();
|
||||
|
||||
SetPriority(100U);
|
||||
|
||||
Run();
|
||||
}
|
||||
|
||||
void* CStarNetServerThreadHelper::Entry()
|
||||
{
|
||||
wxASSERT(m_thread != NULL);
|
||||
|
||||
m_thread->run();
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void CStarNetServerThreadHelper::kill()
|
||||
{
|
||||
wxASSERT(m_thread != NULL);
|
||||
|
||||
m_thread->kill();
|
||||
|
||||
Wait();
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2010-2015,2018,2020 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2010-2015,2018,2020,2023 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -23,6 +23,7 @@
|
|||
#include "IRCDDBGatewayThread.h"
|
||||
#include "IRCDDBGatewayDefs.h"
|
||||
#include "IRCDDBGatewayApp.h"
|
||||
#include "MQTTConnection.h"
|
||||
#include "CallsignList.h"
|
||||
#include "APRSWriter.h"
|
||||
#include "Version.h"
|
||||
|
|
@ -47,6 +48,9 @@ const wxChar* CONFDIR_OPTION = wxT("confdir");
|
|||
|
||||
const wxString LOG_BASE_NAME = wxT("ircddbgateway");
|
||||
|
||||
// In MQTTLog.cpp
|
||||
extern CMQTTConnection* m_mqtt;
|
||||
|
||||
CIRCDDBGatewayApp::CIRCDDBGatewayApp() :
|
||||
wxApp(),
|
||||
m_name(),
|
||||
|
|
@ -74,6 +78,28 @@ bool CIRCDDBGatewayApp::OnInit()
|
|||
if (!wxApp::OnInit())
|
||||
return false;
|
||||
|
||||
#if defined(__WINDOWS__)
|
||||
if (m_confDir.IsEmpty())
|
||||
m_confDir = ::wxGetHomeDir();
|
||||
|
||||
m_config = new CIRCDDBGatewayConfig(new wxConfig(APPLICATION_NAME), m_confDir, CONFIG_FILE_NAME, m_name);
|
||||
#else
|
||||
if (m_confDir.IsEmpty())
|
||||
m_confDir = wxT(CONF_DIR);
|
||||
|
||||
m_config = new CIRCDDBGatewayConfig(m_confDir, CONFIG_FILE_NAME, m_name);
|
||||
#endif
|
||||
|
||||
std::string mqttAddress;
|
||||
unsigned short mqttPort;
|
||||
unsigned int mqttKeepalive;
|
||||
m_config->getMQTT(mqttAddress, mqttPort, mqttKeepalive);
|
||||
std::vector<std::pair<wxString, void (*)(const unsigned char*, unsigned int)>> subscriptions;
|
||||
m_mqtt = new CMQTTConnection(mqttAddress, mqttPort, "ircddb-gateway", subscriptions, mqttKeepalive);m_conf.getMQTTKeepalive());
|
||||
bool ret = m_mqtt->open();
|
||||
if (!ret)
|
||||
return false;
|
||||
|
||||
if (!m_nolog) {
|
||||
wxString logBaseName = LOG_BASE_NAME;
|
||||
if (!m_name.IsEmpty()) {
|
||||
|
|
@ -89,7 +115,7 @@ bool CIRCDDBGatewayApp::OnInit()
|
|||
m_logDir = wxT(LOG_DIR);
|
||||
#endif
|
||||
|
||||
wxLog* log = new CLogger(m_logDir, logBaseName);
|
||||
wxLog* log = new CLogger;
|
||||
wxLog::SetActiveTarget(log);
|
||||
|
||||
if (m_debug) {
|
||||
|
|
@ -118,24 +144,12 @@ bool CIRCDDBGatewayApp::OnInit()
|
|||
m_checker = new wxSingleInstanceChecker(appName);
|
||||
#endif
|
||||
|
||||
bool ret = m_checker->IsAnotherRunning();
|
||||
ret = m_checker->IsAnotherRunning();
|
||||
if (ret) {
|
||||
wxLogError(wxT("Another copy of the ircDDB Gateway is running, exiting"));
|
||||
return false;
|
||||
}
|
||||
|
||||
#if defined(__WINDOWS__)
|
||||
if (m_confDir.IsEmpty())
|
||||
m_confDir = ::wxGetHomeDir();
|
||||
|
||||
m_config = new CIRCDDBGatewayConfig(new wxConfig(APPLICATION_NAME), m_confDir, CONFIG_FILE_NAME, m_name);
|
||||
#else
|
||||
if (m_confDir.IsEmpty())
|
||||
m_confDir = wxT(CONF_DIR);
|
||||
|
||||
m_config = new CIRCDDBGatewayConfig(m_confDir, CONFIG_FILE_NAME, m_name);
|
||||
#endif
|
||||
|
||||
wxString frameName = APPLICATION_NAME + wxT(" - ");
|
||||
if (!m_name.IsEmpty()) {
|
||||
frameName.Append(m_name);
|
||||
|
|
@ -268,15 +282,13 @@ void CIRCDDBGatewayApp::createThread()
|
|||
|
||||
thread->setGateway(gatewayType, gatewayCallsign, gatewayAddress);
|
||||
|
||||
wxString aprsAddress;
|
||||
unsigned int aprsPort;
|
||||
bool aprsEnabled;
|
||||
m_config->getDPRS(aprsEnabled, aprsAddress, aprsPort);
|
||||
wxLogInfo(wxT("APRS enabled: %d, host: %s:%u"), int(aprsEnabled), aprsAddress.c_str(), aprsPort);
|
||||
m_config->getDPRS(aprsEnabled);
|
||||
wxLogInfo(wxT("APRS enabled: %d"), int(aprsEnabled));
|
||||
|
||||
CAPRSWriter* aprs = NULL;
|
||||
if (aprsEnabled && !aprsAddress.IsEmpty() && aprsPort != 0U) {
|
||||
aprs = new CAPRSWriter(aprsAddress, aprsPort, gatewayCallsign);
|
||||
if (aprsEnabled) {
|
||||
aprs = new CAPRSWriter(gatewayCallsign);
|
||||
|
||||
bool res = aprs->open();
|
||||
if (!res)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2010-2013,2015,2018,2020 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2010-2013,2015,2018,2020,2023 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -22,6 +22,7 @@
|
|||
#include "IRCDDBGatewayConfig.h"
|
||||
#include "IRCDDBGatewayAppD.h"
|
||||
#include "IRCDDBGatewayDefs.h"
|
||||
#include "MQTTConnection.h"
|
||||
#include "CallsignList.h"
|
||||
#include "APRSWriter.h"
|
||||
#include "Version.h"
|
||||
|
|
@ -55,6 +56,9 @@ const wxString LOG_BASE_NAME = wxT("ircDDBGateway");
|
|||
|
||||
static CIRCDDBGatewayAppD* m_gateway = NULL;
|
||||
|
||||
// In MQTTLog.cpp
|
||||
extern CMQTTConnection* m_mqtt;
|
||||
|
||||
static void handler(int signum)
|
||||
{
|
||||
m_gateway->kill();
|
||||
|
|
@ -185,6 +189,18 @@ CIRCDDBGatewayAppD::~CIRCDDBGatewayAppD()
|
|||
|
||||
bool CIRCDDBGatewayAppD::init()
|
||||
{
|
||||
CIRCDDBGatewayConfig config(m_confDir, CONFIG_FILE_NAME, m_name);
|
||||
|
||||
wxString mqttAddress;
|
||||
unsigned short mqttPort;
|
||||
unsigned int mqttKeepalive;
|
||||
config.getMQTT(mqttAddress, mqttPort, mqttKeepalive);
|
||||
std::vector<std::pair<wxString, void (*)(const unsigned char*, unsigned int)>> subscriptions;
|
||||
m_mqtt = new CMQTTConnection(mqttAddress, mqttPort, "ircddb-gateway", subscriptions, mqttKeepalive);
|
||||
bool ret = m_mqtt->open();
|
||||
if (!ret)
|
||||
return false;
|
||||
|
||||
if (m_foreground) {
|
||||
initLogging(new CConsoleLogger());
|
||||
} else if (!m_nolog) {
|
||||
|
|
@ -197,7 +213,7 @@ bool CIRCDDBGatewayAppD::init()
|
|||
if (m_logDir.IsEmpty())
|
||||
m_logDir = wxT(LOG_DIR);
|
||||
|
||||
initLogging(new CLogger(m_logDir, logBaseName));
|
||||
initLogging(new CLogger);
|
||||
} else {
|
||||
new wxLogNull;
|
||||
}
|
||||
|
|
@ -210,7 +226,7 @@ bool CIRCDDBGatewayAppD::init()
|
|||
appName.Replace(wxT(" "), wxT("_"));
|
||||
|
||||
m_checker = new wxSingleInstanceChecker(appName, wxT("/tmp"));
|
||||
bool ret = m_checker->IsAnotherRunning();
|
||||
ret = m_checker->IsAnotherRunning();
|
||||
if (ret) {
|
||||
wxLogError(wxT("Another copy of the ircDDB Gateway is running, exiting"));
|
||||
return false;
|
||||
|
|
@ -232,13 +248,13 @@ void CIRCDDBGatewayAppD::initLogging(wxLog *logger)
|
|||
{
|
||||
wxLog::SetActiveTarget(logger);
|
||||
|
||||
if (m_debug) {
|
||||
wxLog::SetVerbose(true);
|
||||
wxLog::SetLogLevel(wxLOG_Debug);
|
||||
} else {
|
||||
wxLog::SetVerbose(false);
|
||||
wxLog::SetLogLevel(wxLOG_Message);
|
||||
}
|
||||
if (m_debug) {
|
||||
wxLog::SetVerbose(true);
|
||||
wxLog::SetLogLevel(wxLOG_Debug);
|
||||
} else {
|
||||
wxLog::SetVerbose(false);
|
||||
wxLog::SetLogLevel(wxLOG_Message);
|
||||
}
|
||||
}
|
||||
|
||||
void CIRCDDBGatewayAppD::run()
|
||||
|
|
@ -275,15 +291,13 @@ bool CIRCDDBGatewayAppD::createThread()
|
|||
|
||||
m_thread->setGateway(gatewayType, gatewayCallsign, gatewayAddress);
|
||||
|
||||
wxString aprsAddress;
|
||||
unsigned int aprsPort;
|
||||
bool aprsEnabled;
|
||||
config.getDPRS(aprsEnabled, aprsAddress, aprsPort);
|
||||
wxLogInfo(wxT("APRS enabled: %d, host: %s:%u"), int(aprsEnabled), aprsAddress.c_str(), aprsPort);
|
||||
config.getDPRS(aprsEnabled);
|
||||
wxLogInfo(wxT("APRS enabled: %d"), int(aprsEnabled));
|
||||
|
||||
CAPRSWriter* aprs = NULL;
|
||||
if (aprsEnabled && !aprsAddress.IsEmpty() && aprsPort != 0U) {
|
||||
aprs = new CAPRSWriter(aprsAddress, aprsPort, gatewayCallsign);
|
||||
if (aprsEnabled) {
|
||||
aprs = new CAPRSWriter(gatewayCallsign);
|
||||
|
||||
bool res = aprs->open();
|
||||
if (!res)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2010-2015,2018,2020 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2010-2015,2018,2020,2023 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -21,6 +21,7 @@
|
|||
#include "RepeaterHandler.h"
|
||||
#include "StarNetHandler.h"
|
||||
#include "CallsignServer.h"
|
||||
#include "MQTTConnection.h"
|
||||
#include "DExtraHandler.h"
|
||||
#include "DPlusHandler.h"
|
||||
#include "HeaderLogger.h"
|
||||
|
|
@ -35,10 +36,13 @@
|
|||
#include "PollData.h"
|
||||
#include "AMBEData.h"
|
||||
#include "HostFile.h"
|
||||
#include "Version.h"
|
||||
#include "CCSData.h"
|
||||
#include "MQTTLog.h"
|
||||
#include "DDData.h"
|
||||
#include "Utils.h"
|
||||
#include "Defs.h"
|
||||
#include "../GitVersion.h"
|
||||
|
||||
#include <wx/filename.h>
|
||||
#include <wx/textfile.h>
|
||||
|
|
@ -53,6 +57,9 @@
|
|||
#include <arpa/inet.h>
|
||||
#endif
|
||||
|
||||
// In MQTTLog.cpp
|
||||
extern CMQTTConnection* m_mqtt;
|
||||
|
||||
const wxString LOOPBACK_ADDRESS = wxT("127.0.0.1");
|
||||
|
||||
const unsigned int REMOTE_DUMMY_PORT = 65016U;
|
||||
|
|
@ -236,7 +243,10 @@ void CIRCDDBGatewayThread::run()
|
|||
|
||||
m_stopped = false;
|
||||
|
||||
wxLogMessage(wxT("Starting the ircDDB Gateway thread"));
|
||||
wxLogInfo(wxT("ircDDBGateway-%s is starting"), VERSION);
|
||||
wxLogInfo(wxT("Built %s %s (GitID #%.7s)"), __TIME__, __DATE__, gitversion);
|
||||
|
||||
writeJSONStatus("ircDDBGateway is starting");
|
||||
|
||||
CHeaderLogger* headerLogger = NULL;
|
||||
if (m_logEnabled) {
|
||||
|
|
@ -427,7 +437,8 @@ void CIRCDDBGatewayThread::run()
|
|||
wxLogError(wxT("Unknown exception raised in the main thread"));
|
||||
}
|
||||
|
||||
wxLogMessage(wxT("Stopping the ircDDB Gateway thread"));
|
||||
wxLogInfo(wxT("ircDDBGateway is stopping"));
|
||||
writeJSONStatus("ircDDBGateway is stopping");
|
||||
|
||||
// Unlink from all reflectors
|
||||
CDExtraHandler::unlink();
|
||||
|
|
@ -1416,3 +1427,14 @@ void CIRCDDBGatewayThread::readStatusFile(const wxString& filename, unsigned int
|
|||
var = text;
|
||||
}
|
||||
}
|
||||
|
||||
void CIRCDDBGatewayThread::writeJSONStatus(const std::string& status)
|
||||
{
|
||||
nlohmann::json json;
|
||||
|
||||
json["timestamp"] = CUtils::createTimestamp();
|
||||
json["message"] = status;
|
||||
|
||||
WriteJSON("status", json);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2010-2013,2015 by Jonathan Naylor G4KLX
|
||||
* Copyright (C) 2010-2013,2015,2023 by Jonathan Naylor G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -155,6 +155,8 @@ private:
|
|||
|
||||
void readStatusFiles();
|
||||
void readStatusFile(const wxString& filename, unsigned int n, wxString& var);
|
||||
|
||||
void writeJSONStatus(const std::string& status);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
29
ircDDBGateway/schema.json
Normal file
29
ircDDBGateway/schema.json
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"$defs": {
|
||||
"timestamp": {"type": "string"},
|
||||
"reflector": {"type": "string"},
|
||||
"action": {"type": "string", "enum": ["linking", "unlinked", "failed", "relinking"]},
|
||||
"protocol": {"type": "string", "enum": ["d-plus", "dextra", "dcs"]},
|
||||
"direction": {"type": "string", "enum": ["in", "out"]},
|
||||
"reason": {"type": "string", "enum": ["user", "timer", "remote", "startup"]}
|
||||
},
|
||||
|
||||
"status": {
|
||||
"type": "object",
|
||||
"timestamp": {"$ref": "#/$defs/timestamp"},
|
||||
"message": {"type": "string"},
|
||||
"required": ["timestamp", "message"]
|
||||
},
|
||||
|
||||
"link": {
|
||||
"type": "object",
|
||||
"timestamp": {"$ref": "#/$defs/timestamp"},
|
||||
"action": {"$ref": "#/$defs/action"},
|
||||
"reason": {"$ref": "#/$defs/reason"},
|
||||
"reflector": {"$ref": "#/defs/reflector"},
|
||||
"direction": {"$ref": "#/defs/direction"},
|
||||
"protocol": {"$ref": "#/defs/protocol"},
|
||||
"required": ["timestamp", "action"]
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in a new issue