Complete PrtCnv Qt6 migration so CoPrtCnv/PrtCnvLib/PrtCnv/ddsview build
Restore dropped m_logger members, QMutex->QRecursiveMutex, splitView->split, error->errorOccurred (migration-only, verified vs legacy).
This commit is contained in:
1 parent
ed81fccb1d
commit
985aa9787b
14 files changed
+32
-22
No files matched your search
@@ -35,7 +35,7 @@ TetraIF::TetraIF(const QHostAddress &addr, unsigned short port, unsigned short i
|
|||||||
connect(m_socket, &QTcpSocket::connected, this, &TetraIF::onConnected);
|
connect(m_socket, &QTcpSocket::connected, this, &TetraIF::onConnected);
|
||||||
connect(m_socket, &QTcpSocket::disconnected, this, &TetraIF::onDisconnected);
|
connect(m_socket, &QTcpSocket::disconnected, this, &TetraIF::onDisconnected);
|
||||||
connect(m_socket, &QTcpSocket::readyRead, this, &TetraIF::onReadyRead);
|
connect(m_socket, &QTcpSocket::readyRead, this, &TetraIF::onReadyRead);
|
||||||
connect(m_socket, QOverload<QAbstractSocket::SocketError>::of(&QTcpSocket::error), this, &TetraIF::onError);
|
connect(m_socket, &QAbstractSocket::errorOccurred, this, &TetraIF::onError);
|
||||||
|
|
||||||
m_outputDir = QCoreApplication::applicationDirPath();
|
m_outputDir = QCoreApplication::applicationDirPath();
|
||||||
m_outputDir += QLatin1Char('/') + QString::number(m_issi) + QLatin1Char('-');
|
m_outputDir += QLatin1Char('/') + QString::number(m_issi) + QLatin1Char('-');
|
||||||
|
|||||||
@@ -43,13 +43,13 @@ PrtCnvDbThread::PrtCnvDbThread(const QString &dbDriver,
|
|||||||
const QString &dbPassword,
|
const QString &dbPassword,
|
||||||
PrtCnv::PrtCnvThreadStarter *a_parent)
|
PrtCnv::PrtCnvThreadStarter *a_parent)
|
||||||
: PrtCnvThread(a_parent, "PrtCnvDbThread")
|
: PrtCnvThread(a_parent, "PrtCnvDbThread")
|
||||||
, m_BattleFieldOpStateMutex(QMutex::Recursive)
|
, m_BattleFieldOpStateMutex()
|
||||||
, m_MemberListByIdMutex(QMutex::Recursive)
|
, m_MemberListByIdMutex()
|
||||||
, m_CentralListMutex(QMutex::Recursive)
|
, m_CentralListMutex()
|
||||||
, m_OldCentralAckCounter(0)
|
, m_OldCentralAckCounter(0)
|
||||||
, m_RadioListMutex(QMutex::Recursive)
|
, m_RadioListMutex()
|
||||||
, m_SqlCmdListMutex(QMutex::Recursive)
|
, m_SqlCmdListMutex()
|
||||||
, m_BroadcastMapMutex(QMutex::Recursive)
|
, m_BroadcastMapMutex()
|
||||||
, m_DoClean(false)
|
, m_DoClean(false)
|
||||||
, m_DoWaitUntilSqlWritten(false)
|
, m_DoWaitUntilSqlWritten(false)
|
||||||
, m_DoStorePermanent(false)
|
, m_DoStorePermanent(false)
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
#include <QtCore/QAtomicInt>
|
#include <QtCore/QAtomicInt>
|
||||||
#include <QtCore/QMutex>
|
#include <QtCore/QMutex>
|
||||||
|
#include <QtCore/QRecursiveMutex>
|
||||||
#include <QtCore/QString>
|
#include <QtCore/QString>
|
||||||
#include <QtSql/QSqlDatabase>
|
#include <QtSql/QSqlDatabase>
|
||||||
#include "PrtCnvThread.hpp"
|
#include "PrtCnvThread.hpp"
|
||||||
@@ -213,15 +214,15 @@ namespace PrtCnv
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
mutable QMutex m_BattleFieldOpStateMutex;
|
mutable QRecursiveMutex m_BattleFieldOpStateMutex;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
mutable QMutex m_MemberListByIdMutex;
|
mutable QRecursiveMutex m_MemberListByIdMutex;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
mutable QMutex m_CentralListMutex;
|
mutable QRecursiveMutex m_CentralListMutex;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -238,16 +239,16 @@ namespace PrtCnv
|
|||||||
std::list<PrtCnvStoredRadioTelegram*> m_RadioList;
|
std::list<PrtCnvStoredRadioTelegram*> m_RadioList;
|
||||||
|
|
||||||
|
|
||||||
mutable QMutex m_RadioListMutex;
|
mutable QRecursiveMutex m_RadioListMutex;
|
||||||
|
|
||||||
|
|
||||||
std::vector<QString> m_SqlCommandList;
|
std::vector<QString> m_SqlCommandList;
|
||||||
|
|
||||||
|
|
||||||
mutable QMutex m_SqlCmdListMutex;
|
mutable QRecursiveMutex m_SqlCmdListMutex;
|
||||||
|
|
||||||
|
|
||||||
mutable QMutex m_BroadcastMapMutex;
|
mutable QRecursiveMutex m_BroadcastMapMutex;
|
||||||
|
|
||||||
|
|
||||||
std::list<PrtCnvStoredRadioTelegram*> m_BroadcastList;
|
std::list<PrtCnvStoredRadioTelegram*> m_BroadcastList;
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ namespace PrtCnv
|
|||||||
PrtCnvInjectionSocket::PrtCnvInjectionSocket()
|
PrtCnvInjectionSocket::PrtCnvInjectionSocket()
|
||||||
: m_Socket(nullptr)
|
: m_Socket(nullptr)
|
||||||
, m_Server(nullptr)
|
, m_Server(nullptr)
|
||||||
|
, m_logger(getLogger("PrtCnvInjectionSocket"))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
PrtCnvInjectionSocket::~PrtCnvInjectionSocket()
|
PrtCnvInjectionSocket::~PrtCnvInjectionSocket()
|
||||||
|
|||||||
@@ -39,6 +39,8 @@ namespace PrtCnv
|
|||||||
QTcpSocket *m_Socket;
|
QTcpSocket *m_Socket;
|
||||||
|
|
||||||
PrtCnvInjectionThread *m_Server;
|
PrtCnvInjectionThread *m_Server;
|
||||||
|
|
||||||
|
NGL::INGLLogger &m_logger;
|
||||||
protected slots:
|
protected slots:
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -89,8 +89,7 @@ PrtCnvRadioThread::PrtCnvRadioThread(int exerciseId, PrtCnvThreadStarter *a_pare
|
|||||||
m_ReceivedBytes(0),
|
m_ReceivedBytes(0),
|
||||||
m_bUseScrambling(false),
|
m_bUseScrambling(false),
|
||||||
m_loggerStats(getLogger("PrtCnvRadioThread.statistic")),
|
m_loggerStats(getLogger("PrtCnvRadioThread.statistic")),
|
||||||
m_exerciseEquipmentAssignmentMutex(QMutex::Recursive),
|
m_exerciseEquipmentAssignmentMutex() {
|
||||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {
|
|
||||||
m_Name = QStringLiteral("Radio");
|
m_Name = QStringLiteral("Radio");
|
||||||
for (int i = 0; i < AVERAGE_COUNT; ++i)
|
for (int i = 0; i < AVERAGE_COUNT; ++i)
|
||||||
{
|
{
|
||||||
@@ -176,8 +175,8 @@ int32_t PrtCnvRadioThread::init()
|
|||||||
m_DbThread->licenseMember(m_DbThread->addMember(0, m_BroadcastISSI));
|
m_DbThread->licenseMember(m_DbThread->addMember(0, m_BroadcastISSI));
|
||||||
|
|
||||||
QString groupString = m_Config->getString(getName(), QStringLiteral("ListenGroups"), QString());
|
QString groupString = m_Config->getString(getName(), QStringLiteral("ListenGroups"), QString());
|
||||||
const QVector<QStringView> groups = groupString.splitView(QLatin1Char(','), Qt::SkipEmptyParts);
|
const QStringList groups = groupString.split(QLatin1Char(','), Qt::SkipEmptyParts);
|
||||||
for (const QStringView &sr : groups)
|
for (const QString &sr : groups)
|
||||||
{
|
{
|
||||||
uint32_t group = sr.toUInt();
|
uint32_t group = sr.toUInt();
|
||||||
if (group > 0)
|
if (group > 0)
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
#include <set>
|
#include <set>
|
||||||
#include <QtCore/QList>
|
#include <QtCore/QList>
|
||||||
#include <QtCore/QMutex>
|
#include <QtCore/QMutex>
|
||||||
|
#include <QtCore/QRecursiveMutex>
|
||||||
#include <TrainingAreaBase/training_area_telegrams.h>
|
#include <TrainingAreaBase/training_area_telegrams.h>
|
||||||
|
|
||||||
#define MAX_IDENTITY 65535
|
#define MAX_IDENTITY 65535
|
||||||
@@ -263,7 +264,7 @@ public:
|
|||||||
|
|
||||||
std::unordered_map<int, std::unordered_set<int>> m_exerciseEquipmentAssignments;
|
std::unordered_map<int, std::unordered_set<int>> m_exerciseEquipmentAssignments;
|
||||||
std::unordered_map<int, TrainingAreaBase::TetraIcd::GroupIssiInformation> m_groupIssiInformation;
|
std::unordered_map<int, TrainingAreaBase::TetraIcd::GroupIssiInformation> m_groupIssiInformation;
|
||||||
mutable QMutex m_exerciseEquipmentAssignmentMutex;
|
mutable QRecursiveMutex m_exerciseEquipmentAssignmentMutex;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ PrtCnvRadioTrafficThread::PrtCnvRadioTrafficThread(PrtCnvThreadStarter* a_parent
|
|||||||
, m_hystLoad(5)
|
, m_hystLoad(5)
|
||||||
, m_calcTimeout(1000)
|
, m_calcTimeout(1000)
|
||||||
, m_cleanupTimeout(5000)
|
, m_cleanupTimeout(5000)
|
||||||
, m_mutex(QMutex::Recursive)
|
, m_mutex()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void PrtCnvRadioTrafficThread::newTelegramArrived(unsigned int size)
|
void PrtCnvRadioTrafficThread::newTelegramArrived(unsigned int size)
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
#include "PrtCnvRadioThread.hpp"
|
#include "PrtCnvRadioThread.hpp"
|
||||||
#include <QtCore/QMap>
|
#include <QtCore/QMap>
|
||||||
#include <QtCore/QMutex>
|
#include <QtCore/QMutex>
|
||||||
|
#include <QtCore/QRecursiveMutex>
|
||||||
|
|
||||||
namespace PrtCnv
|
namespace PrtCnv
|
||||||
{
|
{
|
||||||
@@ -72,7 +73,7 @@ protected:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
QMutex m_mutex;
|
QRecursiveMutex m_mutex;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ void PrtCnvSocketThread::createNewSocket()
|
|||||||
|
|
||||||
connect(m_Socket, &QTcpSocket::connected, this, &PrtCnvSocketThread::connected, Qt::QueuedConnection);
|
connect(m_Socket, &QTcpSocket::connected, this, &PrtCnvSocketThread::connected, Qt::QueuedConnection);
|
||||||
connect(m_Socket, &QTcpSocket::disconnected, this, &PrtCnvSocketThread::disconnected, Qt::QueuedConnection);
|
connect(m_Socket, &QTcpSocket::disconnected, this, &PrtCnvSocketThread::disconnected, Qt::QueuedConnection);
|
||||||
connect(m_Socket, QOverload<QAbstractSocket::SocketError>::of(&QTcpSocket::error), this, &PrtCnvSocketThread::error, Qt::QueuedConnection);
|
connect(m_Socket, &QAbstractSocket::errorOccurred, this, &PrtCnvSocketThread::error, Qt::QueuedConnection);
|
||||||
connect(m_Socket, &QTcpSocket::hostFound, this, &PrtCnvSocketThread::hostFound, Qt::QueuedConnection);
|
connect(m_Socket, &QTcpSocket::hostFound, this, &PrtCnvSocketThread::hostFound, Qt::QueuedConnection);
|
||||||
connect(m_Socket, &QTcpSocket::stateChanged, this, &PrtCnvSocketThread::stateChanged);
|
connect(m_Socket, &QTcpSocket::stateChanged, this, &PrtCnvSocketThread::stateChanged);
|
||||||
connect(m_Socket, &QTcpSocket::readyRead, this, &PrtCnvSocketThread::readyRead, Qt::QueuedConnection);
|
connect(m_Socket, &QTcpSocket::readyRead, this, &PrtCnvSocketThread::readyRead, Qt::QueuedConnection);
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ protected:
|
|||||||
|
|
||||||
|
|
||||||
Qt::HANDLE m_currentThreadId;
|
Qt::HANDLE m_currentThreadId;
|
||||||
|
|
||||||
|
NGL::INGLLogger &m_logger;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ PrtCnvThreadStarter::PrtCnvThreadStarter(const PrtCnv::PrtCnvApplication::E_Thre
|
|||||||
, m_Application(a_mainApp)
|
, m_Application(a_mainApp)
|
||||||
, m_Id(a_id)
|
, m_Id(a_id)
|
||||||
, m_settings(new NGL::Settings(configFileName))
|
, m_settings(new NGL::Settings(configFileName))
|
||||||
|
, m_logger(getLogger("PrtCnvThreadStarter"))
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << "Using Config file '" << configFileName << "'";
|
DEBUG_LOG(m_logger) << "Using Config file '" << configFileName << "'";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ protected:
|
|||||||
|
|
||||||
|
|
||||||
NGL::Settings *m_settings;
|
NGL::Settings *m_settings;
|
||||||
|
|
||||||
|
NGL::INGLLogger &m_logger;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ bool TTWorker::init()
|
|||||||
{
|
{
|
||||||
connect(m_socket, &QTcpSocket::disconnected,
|
connect(m_socket, &QTcpSocket::disconnected,
|
||||||
this, &TTWorker::deleteLater);
|
this, &TTWorker::deleteLater);
|
||||||
connect(m_socket, QOverload<QAbstractSocket::SocketError>::of(&QTcpSocket::error),
|
connect(m_socket, &QAbstractSocket::errorOccurred,
|
||||||
this, &TTWorker::onSocketError);
|
this, &TTWorker::onSocketError);
|
||||||
connect(m_socket, &QTcpSocket::readyRead,
|
connect(m_socket, &QTcpSocket::readyRead,
|
||||||
this, &TTWorker::onReadyRead);
|
this, &TTWorker::onReadyRead);
|
||||||
|
|||||||
Reference in new issue
Block a user