int NDBT_TestSuite::createTables(Ndb_cluster_connection& con) const { Ndb ndb(&con, "TEST_DB"); ndb.init(1); NdbDictionary::Dictionary* pDict = ndb.getDictionary(); for(unsigned i = 0; i<m_tables_in_test.size(); i++) { const char *tab_name= m_tables_in_test[i].c_str(); if (pDict->dropTable(tab_name) != 0 && pDict->getNdbError().code != 723) // No such table { g_err << "runCreateTables: Failed to drop table " << tab_name << endl << pDict->getNdbError() << endl; return NDBT_FAILED; } if(NDBT_Tables::createTable(&ndb, tab_name, !getLogging()) != 0) { g_err << "runCreateTables: Failed to create table " << tab_name << endl << pDict->getNdbError() << endl; return NDBT_FAILED; } if (i == 0){ // Update ctx with a pointer to the first created table const NdbDictionary::Table* pTab2 = pDict->getTable(tab_name); ctx->setTab(pTab2); } g_info << "created " << tab_name << endl; } return NDBT_OK; }
void CGMSKRepeaterApp::createThread() { wxString callsign, gateway; DSTAR_MODE mode; ACK_TYPE ack; bool restriction, rpt1Validation; getCallsign(callsign, gateway, mode, ack, restriction, rpt1Validation); IGMSKRepeaterThread* thread = NULL; switch (mode) { case MODE_RXONLY: thread = new CGMSKRepeaterRXThread; break; case MODE_TXONLY: thread = new CGMSKRepeaterTXThread; break; case MODE_TXANDRX: thread = new CGMSKRepeaterTXRXThread; break; default: thread = new CGMSKRepeaterTRXThread; break; } thread->setCallsign(callsign, gateway, mode, ack, restriction, rpt1Validation); wxLogInfo(wxT("Callsign set to \"%s\", gateway set to \"%s\", mode: %d, ack: %d, restriction: %d, RPT1 validation: %d"), callsign.c_str(), gateway.c_str(), int(mode), int(ack), restriction, rpt1Validation); wxString gatewayAddress, localAddress; unsigned int gatewayPort, localPort; getNetwork(gatewayAddress, gatewayPort, localAddress, localPort); wxLogInfo(wxT("Gateway set to %s:%u, local set to %s:%u"), gatewayAddress.c_str(), gatewayPort, localAddress.c_str(), localPort); if (!gatewayAddress.IsEmpty()) { CRepeaterProtocolHandler* handler = new CRepeaterProtocolHandler(gatewayAddress, gatewayPort, localAddress, localPort); bool res = handler->open(); if (!res) wxLogError(wxT("Cannot open the protocol handler")); else thread->setProtocolHandler(handler); } unsigned int timeout, ackTime; getTimes(timeout, ackTime); thread->setTimes(timeout, ackTime); wxLogInfo(wxT("Timeout set to %u secs, ack time set to %u ms"), timeout, ackTime); unsigned int beaconTime; wxString beaconText; bool beaconVoice; TEXT_LANG language; getBeacon(beaconTime, beaconText, beaconVoice, language); if (mode == MODE_GATEWAY) beaconTime = 0U; thread->setBeacon(beaconTime, beaconText, beaconVoice, language); wxLogInfo(wxT("Beacon set to %u mins, text set to \"%s\", voice set to %d, language set to %d"), beaconTime / 60U, beaconText.c_str(), int(beaconVoice), int(language)); GMSK_MODEM_TYPE modemType; unsigned int modemAddress; getModem(modemType, modemAddress); #if defined(WIN32) IGMSKModem* modem = NULL; switch (modemType) { case GMT_LIBUSB: wxLogInfo(wxT("GMSK modem: type: LibUsb, address: 0x%04X"), modemAddress); modem = new CGMSKModemLibUsb(modemAddress); break; case GMT_WINUSB: wxLogInfo(wxT("GMSK modem: type: WinUSB, address: 0x%04X"), modemAddress); modem = new CGMSKModemWinUSB(modemAddress); break; default: wxLogError(wxT("Unknown GMSK Modem type - %d"), int(modemType)); break; } #else wxLogInfo(wxT("GMSK modem: type: LibUsb, address: 0x%04X"), modemAddress); IGMSKModem* modem = new CGMSKModemLibUsb(modemAddress); #endif if (modem != NULL) { bool res = modem->open(); if (!res) wxLogError(wxT("Cannot open the GMSK modem")); else thread->setModem(modem); } wxString controllerType; unsigned int activeHangTime; getController(controllerType, activeHangTime); wxLogInfo(wxT("Controller set to %s, active hang time: %u ms"), controllerType.c_str(), activeHangTime); CExternalController* controller = NULL; wxString port; if (controllerType.StartsWith(wxT("Velleman K8055 - "), &port)) { unsigned long num; port.ToULong(&num); controller = new CExternalController(new CK8055Controller(num), false, false); } else if (controllerType.IsSameAs(wxT("Raspberry Pi"))) { controller = new CExternalController(new CRaspberryController, false, false); } else { controller = new CExternalController(new CDummyController, false, false); } bool res = controller->open(); if (!res) wxLogError(wxT("Cannot open the hardware interface - %s"), controllerType.c_str()); else thread->setController(controller, activeHangTime); bool out1, out2, out3, out4; getOutputs(out1, out2, out3, out4); thread->setOutputs(out1, out2, out3, out4); m_frame->setOutputs(out1, out2, out3, out4); wxLogInfo(wxT("Output 1 = %d, output 2 = %d, output 3 = %d, output 4 = %d"), out1, out2, out3, out4); bool enabled; wxString rpt1Callsign, rpt2Callsign; wxString shutdown, startup; wxString status1, status2, status3, status4, status5; wxString command1, command1Line, command2, command2Line; wxString command3, command3Line, command4, command4Line; wxString output1, output2, output3, output4; getControl(enabled, rpt1Callsign, rpt2Callsign, shutdown, startup, status1, status2, status3, status4, status5, command1, command1Line, command2, command2Line, command3, command3Line, command4, command4Line, output1, output2, output3, output4); thread->setControl(enabled, rpt1Callsign, rpt2Callsign, shutdown, startup, status1, status2, status3, status4, status5, command1, command1Line, command2, command2Line, command3, command3Line, command4, command4Line, output1, output2, output3, output4); wxLogInfo(wxT("Control: enabled: %d, RPT1: %s, RPT2: %s, shutdown: %s, startup: %s, status1: %s, status2: %s, status3: %s, status4: %s, status5: %s, command1: %s = %s, command2: %s = %s, command3: %s = %s, command4: %s = %s, output1: %s, output2: %s, output3: %s, output4: %s"), enabled, rpt1Callsign.c_str(), rpt2Callsign.c_str(), shutdown.c_str(), startup.c_str(), status1.c_str(), status2.c_str(), status3.c_str(), status4.c_str(), status5.c_str(), command1.c_str(), command1Line.c_str(), command2.c_str(), command2Line.c_str(), command3.c_str(), command3Line.c_str(), command4.c_str(), command4Line.c_str(), output1.c_str(), output2.c_str(), output3.c_str(), output4.c_str()); bool logging; getLogging(logging); thread->setLogging(logging, m_audioDir); m_frame->setLogging(logging); wxLogInfo(wxT("Frame logging set to %d, in %s"), int(logging), m_audioDir.c_str()); wxFileName wlFilename(wxFileName::GetHomeDir(), WHITELIST_FILE_NAME); bool exists = wlFilename.FileExists(); if (exists) { CCallsignList* list = new CCallsignList(wlFilename.GetFullPath()); bool res = list->load(); if (!res) { wxLogError(wxT("Unable to open white list file - %s"), wlFilename.GetFullPath().c_str()); delete list; } else { wxLogInfo(wxT("%u callsigns loaded into the white list"), list->getCount()); thread->setWhiteList(list); } } wxFileName blFilename(wxFileName::GetHomeDir(), BLACKLIST_FILE_NAME); exists = blFilename.FileExists(); if (exists) { CCallsignList* list = new CCallsignList(blFilename.GetFullPath()); bool res = list->load(); if (!res) { wxLogError(wxT("Unable to open black list file - %s"), blFilename.GetFullPath().c_str()); delete list; } else { wxLogInfo(wxT("%u callsigns loaded into the black list"), list->getCount()); thread->setBlackList(list); } } // Convert the worker class into a thread m_thread = new CGMSKRepeaterThreadHelper(thread); m_thread->start(); }
void CDVRPTRRepeaterApp::createThread() { wxString callsign, gateway; DSTAR_MODE mode; ACK_TYPE ack; bool restriction, rpt1Validation; getCallsign(callsign, gateway, mode, ack, restriction, rpt1Validation); IDVRPTRRepeaterThread* thread = NULL; switch (mode) { case MODE_RXONLY: thread = new CDVRPTRRepeaterRXThread; break; case MODE_TXONLY: thread = new CDVRPTRRepeaterTXThread; break; case MODE_TXANDRX: thread = new CDVRPTRRepeaterTXRXThread; break; default: thread = new CDVRPTRRepeaterTRXThread; break; } thread->setCallsign(callsign, gateway, mode, ack, restriction, rpt1Validation); wxLogInfo(wxT("Callsign set to \"%s\", gateway set to \"%s\", mode: %d, ack: %d, restriction: %d, RPT1 validation: %d"), callsign.c_str(), gateway.c_str(), int(mode), int(ack), restriction, rpt1Validation); wxString gatewayAddress, localAddress; unsigned int gatewayPort, localPort; getNetwork(gatewayAddress, gatewayPort, localAddress, localPort); wxLogInfo(wxT("Gateway set to %s:%u, local set to %s:%u"), gatewayAddress.c_str(), gatewayPort, localAddress.c_str(), localPort); if (!gatewayAddress.IsEmpty()) { CRepeaterProtocolHandler* handler = new CRepeaterProtocolHandler(gatewayAddress, gatewayPort, localAddress, localPort); bool res = handler->open(); if (!res) wxLogError(wxT("Cannot open the protocol handler")); else thread->setProtocolHandler(handler); } unsigned int timeout, ackTime; getTimes(timeout, ackTime); thread->setTimes(timeout, ackTime); wxLogInfo(wxT("Timeout set to %u secs, ack time set to %u ms"), timeout, ackTime); unsigned int beaconTime; wxString beaconText; bool beaconVoice; TEXT_LANG language; getBeacon(beaconTime, beaconText, beaconVoice, language); if (mode == MODE_GATEWAY) beaconTime = 0U; thread->setBeacon(beaconTime, beaconText, beaconVoice, language); wxLogInfo(wxT("Beacon set to %u mins, text set to \"%s\", voice set to %d, language set to %d"), beaconTime / 60U, beaconText.c_str(), int(beaconVoice), int(language)); DVRPTR_VERSION modemVersion; CONNECTION_TYPE modemType; wxString modemUSBPort, modemAddress, modemUSBPath; bool rxInvert, txInvert, channel; unsigned int modemPort, modLevel, txDelay; getModem(modemVersion, modemType, modemUSBPort, modemAddress, modemPort, rxInvert, txInvert, channel, modLevel, txDelay); wxLogInfo(wxT("DV-RPTR modem: version: %d, type: %d, USB port: %s, address: %s:%u, RX invert: %d, TX invert: %d, channel: %s, mod level: %u%%, TX delay: %u ms"), int(modemVersion), int(modemType), modemUSBPort.c_str(), modemAddress.c_str(), modemPort, int(rxInvert), int(txInvert), channel ? wxT("B") : wxT("A"), modLevel, txDelay); if (modemType == CT_USB) { if (!modemUSBPort.IsEmpty()) { getModem(modemUSBPath); if (!modemUSBPath.IsEmpty()) wxLogInfo(wxT("DV-RPTR modem: path: %s"), modemUSBPath.c_str()); IDVRPTRController* controller = NULL; switch (modemVersion) { case DVRPTR_V1: controller = new CDVRPTRControllerV1(modemUSBPort, modemUSBPath, rxInvert, txInvert, channel, modLevel, txDelay); break; case DVRPTR_V2: controller = new CDVRPTRControllerV2(modemUSBPort, modemUSBPath, txInvert, modLevel, mode == MODE_DUPLEX || mode == MODE_TXANDRX, callsign); break; default: wxLogError(wxT("Unknown DV-RPTR modem version - %d"), int(modemVersion)); break; } if (controller != NULL) { bool res = controller->open(); if (!res) { wxLogError(wxT("Cannot open the DV-RPTR modem")); } else { thread->setModem(controller); setModem(controller->getPath()); } } } } else if (modemType == CT_NETWORK) { if (!modemAddress.IsEmpty()) { CDVRPTRControllerV2* controller = new CDVRPTRControllerV2(modemAddress, modemPort, txInvert, modLevel, mode == MODE_DUPLEX || mode == MODE_TXANDRX, callsign); bool res = controller->open(); if (!res) wxLogError(wxT("Cannot open the DV-RPTR modem")); else thread->setModem(controller); } } wxString controllerType; unsigned int activeHangTime; getController(controllerType, activeHangTime); wxLogInfo(wxT("Controller set to %s, active hang time: %u ms"), controllerType.c_str(), activeHangTime); CExternalController* controller = NULL; wxString port; if (controllerType.StartsWith(wxT("Velleman K8055 - "), &port)) { unsigned long num; port.ToULong(&num); controller = new CExternalController(new CK8055Controller(num), false, false); } else if (controllerType.IsSameAs(wxT("Raspberry Pi"))) { controller = new CExternalController(new CRaspberryController, false, false); } else { controller = new CExternalController(new CDummyController, false, false); } bool res = controller->open(); if (!res) wxLogError(wxT("Cannot open the hardware interface - %s"), controllerType.c_str()); else thread->setController(controller, activeHangTime); bool out1, out2, out3, out4; getOutputs(out1, out2, out3, out4); thread->setOutputs(out1, out2, out3, out4); m_frame->setOutputs(out1, out2, out3, out4); wxLogInfo(wxT("Output 1 = %d, output 2 = %d, output 3 = %d, output 4 = %d"), out1, out2, out3, out4); bool enabled; wxString rpt1Callsign, rpt2Callsign; wxString shutdown, startup; wxString status1, status2, status3, status4, status5; wxString command1, command1Line, command2, command2Line; wxString command3, command3Line, command4, command4Line; wxString output1, output2, output3, output4; getControl(enabled, rpt1Callsign, rpt2Callsign, shutdown, startup, status1, status2, status3, status4, status5, command1, command1Line, command2, command2Line, command3, command3Line, command4, command4Line, output1, output2, output3, output4); thread->setControl(enabled, rpt1Callsign, rpt2Callsign, shutdown, startup, status1, status2, status3, status4, status5, command1, command1Line, command2, command2Line, command3, command3Line, command4, command4Line, output1, output2, output3, output4); wxLogInfo(wxT("Control: enabled: %d, RPT1: %s, RPT2: %s, shutdown: %s, startup: %s, status1: %s, status2: %s, status3: %s, status4: %s, status5: %s, command1: %s = %s, command2: %s = %s, command3: %s = %s, command4: %s = %s, output1: %s, output2: %s, output3: %s, output4: %s"), enabled, rpt1Callsign.c_str(), rpt2Callsign.c_str(), shutdown.c_str(), startup.c_str(), status1.c_str(), status2.c_str(), status3.c_str(), status4.c_str(), status5.c_str(), command1.c_str(), command1Line.c_str(), command2.c_str(), command2Line.c_str(), command3.c_str(), command3Line.c_str(), command4.c_str(), command4Line.c_str(), output1.c_str(), output2.c_str(), output3.c_str(), output4.c_str()); bool logging; getLogging(logging); thread->setLogging(logging, m_audioDir); m_frame->setLogging(logging); wxLogInfo(wxT("Frame logging set to %d, in %s"), int(logging), m_audioDir.c_str()); wxFileName wlFilename(wxFileName::GetHomeDir(), WHITELIST_FILE_NAME); bool exists = wlFilename.FileExists(); if (exists) { CCallsignList* list = new CCallsignList(wlFilename.GetFullPath()); bool res = list->load(); if (!res) { wxLogError(wxT("Unable to open white list file - %s"), wlFilename.GetFullPath().c_str()); delete list; } else { wxLogInfo(wxT("%u callsigns loaded into the white list"), list->getCount()); thread->setWhiteList(list); } } wxFileName blFilename(wxFileName::GetHomeDir(), BLACKLIST_FILE_NAME); exists = blFilename.FileExists(); if (exists) { CCallsignList* list = new CCallsignList(blFilename.GetFullPath()); bool res = list->load(); if (!res) { wxLogError(wxT("Unable to open black list file - %s"), blFilename.GetFullPath().c_str()); delete list; } else { wxLogInfo(wxT("%u callsigns loaded into the black list"), list->getCount()); thread->setBlackList(list); } } // Convert the worker class into a thread m_thread = new CDVRPTRRepeaterThreadHelper(thread); m_thread->start(); }
bool getStoredIndex() const { return getLogging(); }
bool getStoredTable() const { return getLogging(); }
void CDVAPNodeApp::createThread() { wxString callsign, gateway; DSTAR_MODE mode; ACK_TYPE ack; bool restriction, rpt1Validation; getCallsign(callsign, gateway, mode, ack, restriction, rpt1Validation); IDVAPNodeThread* thread = NULL; switch (mode) { case MODE_RXONLY: thread = new CDVAPNodeRXThread; break; case MODE_TXONLY: thread = new CDVAPNodeTXThread; break; default: thread = new CDVAPNodeTRXThread; break; } thread->setCallsign(callsign, gateway, mode, ack, restriction, rpt1Validation); wxLogInfo(wxT("Callsign set to \"%s\", gateway set to \"%s\", mode: %d, ack: %d, restriction: %d, RPT1 validation: %d"), callsign.c_str(), gateway.c_str(), int(mode), int(ack), restriction, rpt1Validation); wxString gatewayAddress, localAddress; unsigned int gatewayPort, localPort; getNetwork(gatewayAddress, gatewayPort, localAddress, localPort); wxLogInfo(wxT("Gateway set to %s:%u, local set to %s:%u"), gatewayAddress.c_str(), gatewayPort, localAddress.c_str(), localPort); if (!gatewayAddress.IsEmpty()) { CRepeaterProtocolHandler* handler = new CRepeaterProtocolHandler(gatewayAddress, gatewayPort, localAddress, localPort); bool res = handler->open(); if (!res) wxLogError(wxT("Cannot open the protocol handler")); else thread->setProtocolHandler(handler); } unsigned int timeout, ackTime; getTimes(timeout, ackTime); thread->setTimes(timeout, ackTime); wxLogInfo(wxT("Timeout set to %u secs, ack time set to %u ms"), timeout, ackTime); unsigned int beaconTime; wxString beaconText; bool beaconVoice; TEXT_LANG language; getBeacon(beaconTime, beaconText, beaconVoice, language); thread->setBeacon(beaconTime, beaconText, beaconVoice, language); wxLogInfo(wxT("Beacon set to %u mins, text set to \"%s\", voice set to %d, language set to %d"), beaconTime / 60U, beaconText.c_str(), int(beaconVoice), int(language)); wxString dvapPort; unsigned int dvapFrequency; int dvapPower, dvapSquelch, dvapOffset; getDVAP(dvapPort, dvapFrequency, dvapPower, dvapSquelch, dvapOffset); wxLogInfo(wxT("DVAP: port: %s, frequency: %u Hz, power: %d dBm, squelch: %d dBm, offset: %d Hz"), dvapPort.c_str(), dvapFrequency, dvapPower, dvapSquelch, dvapOffset); if (!dvapPort.IsEmpty()) { CDVAPController* dvap = new CDVAPController(dvapPort, dvapFrequency, dvapPower, dvapSquelch, dvapOffset); bool res = dvap->open(); if (!res) wxLogError(wxT("Unable to open the DVAP")); else thread->setDVAP(dvap); } bool logging; getLogging(logging); thread->setLogging(logging, ::wxGetHomeDir()); m_frame->setLogging(logging); wxLogInfo(wxT("Frame logging set to %d, in %s"), int(logging), ::wxGetHomeDir().c_str()); wxFileName wlFilename(wxFileName::GetHomeDir(), WHITELIST_FILE_NAME); bool exists = wlFilename.FileExists(); if (exists) { CCallsignList* list = new CCallsignList(wlFilename.GetFullPath()); bool res = list->load(); if (!res) { wxLogError(wxT("Unable to open white list file - %s"), wlFilename.GetFullPath().c_str()); delete list; } else { wxLogInfo(wxT("%u callsigns loaded into the white list"), list->getCount()); thread->setWhiteList(list); } } wxFileName blFilename(wxFileName::GetHomeDir(), BLACKLIST_FILE_NAME); exists = blFilename.FileExists(); if (exists) { CCallsignList* list = new CCallsignList(blFilename.GetFullPath()); bool res = list->load(); if (!res) { wxLogError(wxT("Unable to open black list file - %s"), blFilename.GetFullPath().c_str()); delete list; } else { wxLogInfo(wxT("%u callsigns loaded into the black list"), list->getCount()); thread->setBlackList(list); } } // Convert the worker class into a thread m_thread = new CDVAPNodeThreadHelper(thread); m_thread->start(); }
void CSoundCardRepeaterApp::createThread() { wxString callsign, gateway; DSTAR_MODE mode; ACK_TYPE ack; bool restriction, rpt1Validation; getCallsign(callsign, gateway, mode, ack, restriction, rpt1Validation); switch (mode) { case MODE_RXONLY: m_thread = new CSoundCardRepeaterRXThread; break; case MODE_TXONLY: m_thread = new CSoundCardRepeaterTXThread; break; case MODE_TXANDRX: m_thread = new CSoundCardRepeaterTXRXThread; break; default: m_thread = new CSoundCardRepeaterTRXThread; break; } m_thread->setCallsign(callsign, gateway, mode, ack, restriction, rpt1Validation); wxLogInfo(wxT("Callsign set to \"%s\", gateway set to \"%s\", mode: %d, ack: %d, restriction: %d, RPT1 validation: %d"), callsign.c_str(), gateway.c_str(), int(mode), int(ack), restriction, rpt1Validation); wxString gatewayAddress, localAddress; unsigned int gatewayPort, localPort; getNetwork(gatewayAddress, gatewayPort, localAddress, localPort); wxLogInfo(wxT("Gateway set to %s:%u, local set to %s:%u"), gatewayAddress.c_str(), gatewayPort, localAddress.c_str(), localPort); if (!gatewayAddress.IsEmpty()) { CRepeaterProtocolHandler* handler = new CRepeaterProtocolHandler(gatewayAddress, gatewayPort, localAddress, localPort); bool res = handler->open(); if (!res) wxLogError(wxT("Cannot open the protocol handler")); else m_thread->setProtocolHandler(handler); } unsigned int timeout, ackTime, hangTime; getTimes(timeout, ackTime, hangTime); m_thread->setTimes(timeout, ackTime, hangTime); wxLogInfo(wxT("Timeout set to %u secs, Ack time set to %u ms, Hang time set to %u ms"), timeout, ackTime, hangTime); unsigned int beaconTime; wxString beaconText; bool beaconVoice; TEXT_LANG language; getBeacon(beaconTime, beaconText, beaconVoice, language); m_thread->setBeacon(beaconTime, beaconText, beaconVoice, language); wxLogInfo(wxT("Beacon set to %u mins, text set to \"%s\", voice set to %d, language set to %d"), beaconTime / 60U, beaconText.c_str(), int(beaconVoice), int(language)); wxString readDevice, writeDevice; bool rxInvert, txInvert; wxFloat32 rxLevel, txLevel, squelchLevel; SQUELCH_MODE squelchMode; getRadio(readDevice, writeDevice, rxLevel, txLevel, squelchMode, squelchLevel, rxInvert, txInvert); wxLogInfo(wxT("Soundcard set to %s:%s, levels: %.2f:%.2f, GMSK Inversion set to %d:%d, squelch: mode: %d level: %.2f"), readDevice.c_str(), writeDevice.c_str(), rxLevel, txLevel, rxInvert, txInvert, int(squelchMode), squelchLevel); if (!readDevice.IsEmpty() && !writeDevice.IsEmpty()) { #if defined(__WINDOWS__) CSoundCardReaderWriter* soundcard = new CSoundCardReaderWriter(readDevice, writeDevice, DSTAR_RADIO_SAMPLE_RATE, DSTAR_RADIO_BLOCK_SIZE); #else CSoundCardReaderWriter* soundcard = new CSoundCardReaderWriter(readDevice, writeDevice, DSTAR_RADIO_SAMPLE_RATE, 64U); #endif soundcard->setCallback(m_thread, 0U); bool res = soundcard->open(); if (!res) wxLogError(wxT("Cannot open the sound card")); else m_thread->setSoundCard(soundcard, rxLevel, txLevel, squelchMode, squelchLevel, rxInvert, txInvert); } wxString type; unsigned int cfg; int pttDelay; bool pttInvert; getController(type, cfg, pttDelay, pttInvert); wxLogInfo(wxT("Controller set to %s, config: %u, ptt delay: %d ms, PTT Inversion set to %d"), type.c_str(), cfg, pttDelay * 20, pttInvert); CExternalController* controller = NULL; wxString port; if (type.StartsWith(wxT("Velleman K8055 - "), &port)) { unsigned long num; port.ToULong(&num); controller = new CExternalController(new CK8055Controller(num), pttInvert, false); } else if (type.StartsWith(wxT("URI USB - "), &port)) { unsigned long num; port.ToULong(&num); controller = new CExternalController(new CURIUSBController(num, false), pttInvert, false); } else if (type.StartsWith(wxT("Serial - "), &port)) { controller = new CExternalController(new CSerialController(port, cfg), pttInvert, false); } else { controller = new CExternalController(new CDummyController, pttInvert, false); } bool res = controller->open(); if (!res) wxLogError(wxT("Cannot open the hardware interface - %s"), type.c_str()); else m_thread->setController(controller, pttDelay); bool out1, out2, out3, out4; getOutputs(out1, out2, out3, out4); m_thread->setOutputs(out1, out2, out3, out4); m_frame->setOutputs(out1, out2, out3, out4); wxLogInfo(wxT("Output 1 = %d, output 2 = %d, output 3 = %d, output 4 = %d"), out1, out2, out3, out4); bool enabled; wxString rpt1Callsign, rpt2Callsign; wxString shutdown, startup; wxString status1, status2, status3, status4, status5; wxString command1, command1Line, command2, command2Line; wxString command3, command3Line, command4, command4Line; wxString output1, output2, output3, output4; getControl(enabled, rpt1Callsign, rpt2Callsign, shutdown, startup, status1, status2, status3, status4, status5, command1, command1Line, command2, command2Line, command3, command3Line, command4, command4Line, output1, output2, output3, output4); m_thread->setControl(enabled, rpt1Callsign, rpt2Callsign, shutdown, startup, status1, status2, status3, status4, status5, command1, command1Line, command2, command2Line, command3, command3Line, command4, command4Line, output1, output2, output3, output4); wxLogInfo(wxT("Control: enabled: %d, RPT1: %s, RPT2: %s, shutdown: %s, startup: %s, status1: %s, status2: %s, status3: %s, status4: %s, status5: %s, command1: %s = %s, command2: %s = %s, command3: %s = %s, command4: %s = %s, output1: %s, output2: %s, output3: %s, output4: %s"), enabled, rpt1Callsign.c_str(), rpt2Callsign.c_str(), shutdown.c_str(), startup.c_str(), status1.c_str(), status2.c_str(), status3.c_str(), status4.c_str(), status5.c_str(), command1.c_str(), command1Line.c_str(), command2.c_str(), command2Line.c_str(), command1.c_str(), command1Line.c_str(), command2.c_str(), command2Line.c_str(), command3.c_str(), command3Line.c_str(), command4.c_str(), command4Line.c_str(), output1.c_str(), output2.c_str(), output3.c_str(), output4.c_str()); unsigned int activeHangTime; getActiveHang(activeHangTime); m_thread->setActiveHang(activeHangTime); wxLogInfo(wxT("Active Hang: time: %u"), activeHangTime); bool logging; getLogging(logging); m_thread->setLogging(logging, ::wxGetHomeDir()); m_frame->setLogging(logging); wxLogInfo(wxT("Frame logging set to %d, in %s"), int(logging), ::wxGetHomeDir().c_str()); wxFileName wlFilename(wxFileName::GetHomeDir(), WHITELIST_FILE_NAME); bool exists = wlFilename.FileExists(); if (exists) { CCallsignList* list = new CCallsignList(wlFilename.GetFullPath()); bool res = list->load(); if (!res) { wxLogError(wxT("Unable to open white list file - %s"), wlFilename.GetFullPath().c_str()); delete list; } else { wxLogInfo(wxT("%u callsigns loaded into the white list"), list->getCount()); m_thread->setWhiteList(list); } } wxFileName blFilename(wxFileName::GetHomeDir(), BLACKLIST_FILE_NAME); exists = blFilename.FileExists(); if (exists) { CCallsignList* list = new CCallsignList(blFilename.GetFullPath()); bool res = list->load(); if (!res) { wxLogError(wxT("Unable to open black list file - %s"), blFilename.GetFullPath().c_str()); delete list; } else { wxLogInfo(wxT("%u callsigns loaded into the black list"), list->getCount()); m_thread->setBlackList(list); } } m_thread->start(); }