Reinserts original comments

This commit is contained in:
torsten committed 2026-10-14 12:56:16 +00:00
1 parent 1dd1e86355
commit b662e4daf9
112 files changed
+7113 -5131

No files matched your search

@@ -1,16 +1,16 @@
// **************************************************************************
//
// (C) Copyright 2009 Swiss SIMTEC AG
//
// **************************************************************************
//
// $HeadURL$
// $LastChangedBy$
// $LastChangedDate$
// $LastChangedRevision$
//
// Implementation of the Class PrtCnvApplication
// **************************************************************************
#pragma once
@@ -23,20 +23,32 @@
#include "prtcnvlib_export.h"
#include <TrainingAreaBase/training_area_telegrams.h>
/**
* Here are all project specific classes of protocol-converter implemented.
*/
namespace PrtCnv
{
class PrtCnvThreadStarter;
/**
* The main-application of protocol-converter. It is responsible for starting and
* controlling the threads of this application.
*
* @author alois.wismer
* @version 1.0
* @created 23-Jun-2009 17:48:47
*/
class PRTCNVLIB_EXPORT PrtCnvApplication : public QObject, public N_AppComponent::AppComponent
{
Q_OBJECT
public:
/**
* This enum will be used to unique identify the threads
*
* @author alois.wismer
* @version 1.0
* @created 19-Jan-2010 17:09:00
*/
enum E_ThreadId
{
e_Central,
@@ -50,8 +62,9 @@ namespace PrtCnv
PrtCnvApplication();
~PrtCnvApplication();
/**
* Starts the main-application
*/
void startApp();
void shutdownApp();
static void setCleanDb(bool bCleanDb);
@@ -59,33 +72,51 @@ namespace PrtCnv
int exerciseId() const { return m_exerciseId; }
void setConfigFile(const QString &configFile);
/**
* Starts the childs and then the main application
*/
int32_t start() override;
/**
* Synchronisation of threads before init().
*
* @param a_threadId id of the calling thread
*/
void waitForInit(E_ThreadId a_threadId);
/**
* Synchronisation of threads before start().
*
* @param a_threadId id of the calling thread
*/
void waitForStart(E_ThreadId a_threadId);
/**
* Synchronisation of threads before create().
*
* @param a_threadId Id of the calling thread
*/
void waitForCreate(const E_ThreadId a_threadId);
/**
* Synchronisation of threads before execution of thread.
*
* @param a_threadId id of the calling thread
*/
void waitForExec(E_ThreadId a_threadId);
/**
* Returns the desired thread-starter
*
* @param a_threadId Id of the desired thread-started (corresponding thread has
* the same id)
*/
PrtCnvThreadStarter* getThreadStarter(const E_ThreadId a_threadId);
/**
* @brief Set the database connection parameter when used as library
*/
void setDatabaseConnectionParams(const QString &driver,
const QString &hostName,
const QString &database,
@@ -108,45 +139,59 @@ signals:
void outgoingBroadcastTelegramsRequest(int equipmentNumber, int broadcastIndex, int resetCounter);
void warehouseMessageFromPtrCnv(const QByteArray &jsonData);
protected:
/**
* Creates the childs
*/
int32_t createApplication();
/**
* Returns true when the specified thread is
* already constructed
*/
bool isConstructed(const E_ThreadId a_threadId) const;
/**
* The specifed thread is now constructed
*/
void setConstructed(const E_ThreadId a_threadId);
/**
* Returns true when the specified thread is
* already initialized
*/
bool isInitialized(const E_ThreadId a_threadId) const;
/**
* The specifed thread is now initialized
*/
void setInitialized(const E_ThreadId a_threadId);
/**
* Returns true when the specified thread is
* already created
*/
bool isCreated(const E_ThreadId a_threadId) const;
/**
* The specifed thread is now created
*/
void setCreated(const E_ThreadId a_threadId);
/**
* Returns true when the specified thread is
* already started
*/
bool isStarted(const E_ThreadId a_threadId) const;
/**
* The specifed thread is now started
*/
void setStarted(const E_ThreadId a_threadId);
protected:
/**
* Used to get configuration-parameter
*/
NGL::Settings *m_Config;
struct ThreadInfo
@@ -157,11 +202,13 @@ protected:
bool isInitialized = false;
bool isStarted = false;
} m_threadInfo[e_ThreadIdMax];
/**
* The name of the config-file
*/
QString m_ConfigFileName;
/**
* The exerciseId (or zero if not set)
*/
int m_exerciseId;