Formats minimally release source files based on former clang-format

This commit is contained in:
torsten committed 2026-10-14 13:28:01 +00:00
1 parent b662e4daf9
commit 5644914fe3
387 files changed
+37323 -38074

No files matched your search

@@ -1,14 +1,14 @@
// **************************************************************************
//
//
// (C) Copyright 2009 Swiss SIMTEC AG
//
//
// **************************************************************************
//
//
// $HeadURL$
// $LastChangedBy$
// $LastChangedDate$
// $LastChangedRevision$
//
//
// Implementation of the Class PrtCnvThreadStarter
// **************************************************************************
#include "PrtCnvThreadStarter.hpp"
@@ -23,103 +23,101 @@
namespace PrtCnv
{
// ---------------------------------------------------------------
// Constructor with id and ptr to main-app as parameters.
// ---------------------------------------------------------------
PrtCnvThreadStarter::PrtCnvThreadStarter(const PrtCnv::PrtCnvApplication::E_ThreadId a_id,
const QString &configFileName,
PrtCnv::PrtCnvApplication* a_mainApp)
: m_Thread(nullptr)
, m_Application(a_mainApp)
, m_Id(a_id)
, m_settings(new NGL::Settings(configFileName))
, m_logger(getLogger("PrtCnvThreadStarter"))
{
DEBUG_LOG(m_logger) << "Using Config file '" << configFileName << "'";
}
PrtCnvThreadStarter::~PrtCnvThreadStarter()
{
delete m_settings;
}
// ---------------------------------------------------------------
// The run()-function, which will be called by Qt-Framework,
// when starting the thread.
// ---------------------------------------------------------------
void PrtCnvThreadStarter::run()
{
INFO_LOG(m_logger) << "Entering event loop for thread " << this << ", id: " << m_Id;
// allocate the thread
switch (m_Id)
// ---------------------------------------------------------------
// Constructor with id and ptr to main-app as parameters.
// ---------------------------------------------------------------
PrtCnvThreadStarter::PrtCnvThreadStarter(const PrtCnv::PrtCnvApplication::E_ThreadId a_id, const QString &configFileName, PrtCnv::PrtCnvApplication *a_mainApp)
: m_Thread(nullptr)
, m_Application(a_mainApp)
, m_Id(a_id)
, m_settings(new NGL::Settings(configFileName))
, m_logger(getLogger("PrtCnvThreadStarter"))
{
case PrtCnvApplication::e_Central:
m_Thread = new PrtCnvCentralThread(this);
break;
case PrtCnvApplication::e_Radio:
m_Thread = new PrtCnvRadioThread(m_Application->exerciseId(), this);
break;
case PrtCnvApplication::e_Db:
m_Thread = new PrtCnvDbThread(m_Application->databaseDriver(),
m_Application->databaseHostName(),
m_Application->databaseName(),
m_Application->databaseSchemaName(),
m_Application->databaseUserName(),
m_Application->databasePassword(),
this);
break;
case PrtCnvApplication::e_Log:
m_Thread = new PrtCnvTelegramLogThread(this);
break;
case PrtCnvApplication::e_Injection:
m_Thread = new PrtCnvInjectionThread(this);
break;
case PrtCnvApplication::e_RadioTraffic:
m_Thread = new PrtCnvRadioTrafficThread(this);
break;
case PrtCnvApplication::e_ThreadIdMax:
break;
DEBUG_LOG(m_logger) << "Using Config file '" << configFileName << "'";
}
if (!m_Thread)
PrtCnvThreadStarter::~PrtCnvThreadStarter()
{
ERROR_LOG(m_logger) << "Unknown threadId: " << m_Id;
return;
delete m_settings;
}
while (!m_Application)
sleep(1);
m_Application->waitForCreate(m_Id);
m_Thread->create(m_settings);
m_Application->waitForInit(m_Id);
m_Thread->init();
m_Application->waitForStart(m_Id);
m_Thread->start();
m_Application->waitForExec(m_Id);
// ---------------------------------------------------------------
// The run()-function, which will be called by Qt-Framework,
// when starting the thread.
// ---------------------------------------------------------------
void PrtCnvThreadStarter::run()
{
INFO_LOG(m_logger) << "Entering event loop for thread " << this << ", id: " << m_Id;
// allocate the thread
switch (m_Id)
{
case PrtCnvApplication::e_Central:
m_Thread = new PrtCnvCentralThread(this);
break;
exec();
case PrtCnvApplication::e_Radio:
m_Thread = new PrtCnvRadioThread(m_Application->exerciseId(), this);
break;
INFO_LOG(m_logger) << "Leaving event loop for thread " << this << ", id: " << m_Id;
delete m_Thread;
m_Thread = nullptr;
}
case PrtCnvApplication::e_Db:
m_Thread = new PrtCnvDbThread(m_Application->databaseDriver(),
m_Application->databaseHostName(),
m_Application->databaseName(),
m_Application->databaseSchemaName(),
m_Application->databaseUserName(),
m_Application->databasePassword(),
this);
break;
case PrtCnvApplication::e_Log:
m_Thread = new PrtCnvTelegramLogThread(this);
break;
case PrtCnvApplication::e_Injection:
m_Thread = new PrtCnvInjectionThread(this);
break;
case PrtCnvApplication::e_RadioTraffic:
m_Thread = new PrtCnvRadioTrafficThread(this);
break;
case PrtCnvApplication::e_ThreadIdMax:
break;
}
if (!m_Thread)
{
ERROR_LOG(m_logger) << "Unknown threadId: " << m_Id;
return;
}
while (!m_Application)
sleep(1);
m_Application->waitForCreate(m_Id);
m_Thread->create(m_settings);
m_Application->waitForInit(m_Id);
m_Thread->init();
m_Application->waitForStart(m_Id);
m_Thread->start();
m_Application->waitForExec(m_Id);
exec();
INFO_LOG(m_logger) << "Leaving event loop for thread " << this << ", id: " << m_Id;
delete m_Thread;
m_Thread = nullptr;
}
// ---------------------------------------------------------------
// Returns the desired thread.
// ---------------------------------------------------------------
PrtCnvThread *PrtCnvThreadStarter::getOtherThread(PrtCnvApplication::E_ThreadId a_threadId) const
{
return m_Application->getThreadStarter(a_threadId)->m_Thread;
}
// ---------------------------------------------------------------
// Returns the desired thread.
// ---------------------------------------------------------------
PrtCnvThread *PrtCnvThreadStarter::getOtherThread(PrtCnvApplication::E_ThreadId a_threadId) const
{
return m_Application->getThreadStarter(a_threadId)->m_Thread;
}
} // namespace PrtCnv