示例#1
0
void CXReflectorApp::createThread()
{
	CXReflectorThread* thread = new CXReflectorThread(m_name, m_logDir);

	wxString reflector, address;
	getReflector(reflector, address);
	thread->setReflector(reflector, address);
	wxLogInfo(wxT("Callsign set to \"%s\", address set to \"%s\""), reflector.c_str(), address.c_str());

	reflector.Append(wxT("        "));

	reflector.Truncate(LONG_CALLSIGN_LENGTH - 1U);
	reflector.Append(wxT("A"));
	CXReflectorReflectorHandler::add(reflector);
	wxLogInfo(wxT("Creating reflector 1 with callsign \"%s\""), reflector.c_str());

	reflector.Truncate(LONG_CALLSIGN_LENGTH - 1U);
	reflector.Append(wxT("B"));
	CXReflectorReflectorHandler::add(reflector);
	wxLogInfo(wxT("Creating reflector 2 with callsign \"%s\""), reflector.c_str());

	reflector.Truncate(LONG_CALLSIGN_LENGTH - 1U);
	reflector.Append(wxT("C"));
	CXReflectorReflectorHandler::add(reflector);
	wxLogInfo(wxT("Creating reflector 3 with callsign \"%s\""), reflector.c_str());

	reflector.Truncate(LONG_CALLSIGN_LENGTH - 1U);
	reflector.Append(wxT("D"));
	CXReflectorReflectorHandler::add(reflector);
	wxLogInfo(wxT("Creating reflector 4 with callsign \"%s\""), reflector.c_str());

	reflector.Truncate(LONG_CALLSIGN_LENGTH - 1U);
	reflector.Append(wxT("E"));
	CXReflectorReflectorHandler::add(reflector);
	wxLogInfo(wxT("Creating reflector 5 with callsign \"%s\""), reflector.c_str());

	bool dplusEnabled;
	getDPlus(dplusEnabled);
	wxLogInfo(wxT("D-Plus enabled set to %d"), dplusEnabled);
	thread->setDPlus(dplusEnabled);

	bool logEnabled;
	getMiscellaneous(logEnabled);
	wxLogInfo(wxT("Log enabled set to %d"), logEnabled);
	thread->setMiscellaneous(logEnabled);

	// Convert the worker class into a thread
	m_thread = new CXReflectorThreadHelper(thread);
	m_thread->start();
}
void CXReflectorApp::createThread()
{
	m_thread = new CXReflectorThread(m_name, m_logDir);

	wxString reflector, address;
	getReflector(reflector, address);
	m_thread->setReflector(reflector, address);
	wxLogInfo(wxT("Callsign set to \"%s\", address set to \"%s\""), reflector.c_str(), address.c_str());

	reflector.Append(wxT("        "));

	reflector.Truncate(LONG_CALLSIGN_LENGTH - 1U);
	reflector.Append(wxT("A"));
	CXReflectorReflectorHandler::add(reflector);
	wxLogInfo(wxT("Creating reflector 1 with callsign \"%s\""), reflector.c_str());

	reflector.Truncate(LONG_CALLSIGN_LENGTH - 1U);
	reflector.Append(wxT("B"));
	CXReflectorReflectorHandler::add(reflector);
	wxLogInfo(wxT("Creating reflector 2 with callsign \"%s\""), reflector.c_str());

	reflector.Truncate(LONG_CALLSIGN_LENGTH - 1U);
	reflector.Append(wxT("C"));
	CXReflectorReflectorHandler::add(reflector);
	wxLogInfo(wxT("Creating reflector 3 with callsign \"%s\""), reflector.c_str());

	reflector.Truncate(LONG_CALLSIGN_LENGTH - 1U);
	reflector.Append(wxT("D"));
	CXReflectorReflectorHandler::add(reflector);
	wxLogInfo(wxT("Creating reflector 4 with callsign \"%s\""), reflector.c_str());

	reflector.Truncate(LONG_CALLSIGN_LENGTH - 1U);
	reflector.Append(wxT("E"));
	CXReflectorReflectorHandler::add(reflector);
	wxLogInfo(wxT("Creating reflector 5 with callsign \"%s\""), reflector.c_str());

	bool dplusEnabled;
	getDPlus(dplusEnabled);
	wxLogInfo(wxT("D-Plus enabled set to %d"), dplusEnabled);
	m_thread->setDPlus(dplusEnabled);

	bool logEnabled;
	getMiscellaneous(logEnabled);
	wxLogInfo(wxT("Log enabled set to %d"), logEnabled);
	m_thread->setMiscellaneous(logEnabled);

	m_thread->Create();
	m_thread->SetPriority(100U);
	m_thread->Run();
}