Adds immediate migration results in progress

This commit is contained in:
torsten committed 2026-08-19 11:18:24 +02:00
1 parent 8453e104c5
commit 3bb6e89496
2102 files changed
+17482 -15071

No files matched your search

@@ -70,7 +70,7 @@ bool HandlerOcData::init()
// read all reset counter from database
if (!m_dbHandler->select(dataVec))
{
ERROR_LOG() << "Error reading reset counter from database!";
ERROR_LOG(m_logger) << "Error reading reset counter from database!";
return false;
}
@@ -90,7 +90,7 @@ bool HandlerOcData::init()
}
default:
{
WARNING_LOG() << "Reset counter for aes type: " << data.aesTypeId << " read from db is not handled.";
WARNING_LOG(m_logger) << "Reset counter for aes type: " << data.aesTypeId << " read from db is not handled.";
break;
}
}
@@ -99,14 +99,14 @@ bool HandlerOcData::init()
// EVL FTC enable
if (!m_evlFtc->enableEvlSchemaModify())
{
ERROR_LOG() << "Enabling EVL Function-Topics failed.";
ERROR_LOG(m_logger) << "Enabling EVL Function-Topics failed.";
return false;
}
// MSG DTC enable
if (!m_msgDtc->enableOperatorMessage())
{
ERROR_LOG() << "Enabling MSG Data-Topics failed.";
ERROR_LOG(m_logger) << "Enabling MSG Data-Topics failed.";
return false;
}
connect(m_msgDtc.get(), &Messaging::Interface::Dtc::operatorMessageChanged, this, &HandlerOcData::onOperatorMessageChanged);
@@ -115,41 +115,41 @@ bool HandlerOcData::init()
if (!m_msgFtc->enableCreateOperatorMessage() ||
!m_msgFtc->enableModifyOperatorMessage())
{
ERROR_LOG() << "Enabling MSG Function-Topics failed.";
ERROR_LOG(m_logger) << "Enabling MSG Function-Topics failed.";
return false;
}
// OPM DTC enable
if (!m_opmDtc->enableUser())
{
ERROR_LOG() << "Enabling OPM Data-Topics failed.";
ERROR_LOG(m_logger) << "Enabling OPM Data-Topics failed.";
return false;
}
// OSS FTS enable
if (!m_ossFts->enableSendEquipmentMessageOc())
{
ERROR_LOG() << "Enabling OSS Function-Topics failed.";
ERROR_LOG(m_logger) << "Enabling OSS Function-Topics failed.";
return false;
}
// PPM DTC enable
if (!m_ppmDtc->enableParticipant())
{
ERROR_LOG() << "Enabling PPM Data-Topics failed.";
ERROR_LOG(m_logger) << "Enabling PPM Data-Topics failed.";
return false;
}
if (!m_ppmDtc->waitForHistoricalDataParticipant(10000))
{
ERROR_LOG() << "Waiting for historical data PPM-participant failed.";
ERROR_LOG(m_logger) << "Waiting for historical data PPM-participant failed.";
return false;
}
// TAB DTC enable
if (!m_tabDtc->enableOcData())
{
ERROR_LOG() << "Enabling TAB Data-Topics failed.";
ERROR_LOG(m_logger) << "Enabling TAB Data-Topics failed.";
return false;
}
connect(m_tabDtc.get(), &TrainingAreaBase::Interface::Dtc::ocDataChanged, this, &HandlerOcData::onOcDataChanged);
@@ -157,14 +157,14 @@ bool HandlerOcData::init()
// TAB DTC enable
if (!m_tabDtc->enableEquipmentPosition())
{
ERROR_LOG() << "Enabling TAB DTS Data-Topics failed.";
ERROR_LOG(m_logger) << "Enabling TAB DTS Data-Topics failed.";
return false;
}
// TAB FTC enable
if (!m_tabFtc->enableSendOcData())
{
ERROR_LOG() << "Enabling TAB Function-Topics failed.";
ERROR_LOG(m_logger) << "Enabling TAB Function-Topics failed.";
return false;
}
@@ -173,7 +173,7 @@ bool HandlerOcData::init()
!m_tabocDtc->enableOwnPosition() ||
!m_tabocDtc->enableSpecificsEquipment())
{
ERROR_LOG() << "Enabling TABOC Data-Topics failed.";
ERROR_LOG(m_logger) << "Enabling TABOC Data-Topics failed.";
return false;
}
connect(m_tabocDtc.get(), &TrainingAreaBaseOC::Interface::Dtc::ownPositionChanged, this, &HandlerOcData::onOwnPosition);
@@ -187,21 +187,21 @@ bool HandlerOcData::init()
// handler oc situation data
if (!m_handlerOcSituationData->init())
{
ERROR_LOG() << "Initialising HandlerOcSituationData failed.";
ERROR_LOG(m_logger) << "Initialising HandlerOcSituationData failed.";
return false;
}
// handler oc central aes data
if (!m_handlerOcCentralAesData->init())
{
ERROR_LOG() << "Initialising HandlerOcCentralAesData failed.";
ERROR_LOG(m_logger) << "Initialising HandlerOcCentralAesData failed.";
return false;
}
// Handler aes data
if (!m_handlerOcAesData->init())
{
ERROR_LOG() << "Initialising HandlerOcAesData failed.";
ERROR_LOG(m_logger) << "Initialising HandlerOcAesData failed.";
return false;
}
@@ -211,40 +211,40 @@ bool HandlerOcData::init()
connect(m_opmDtc.get(), &OperatorManagement::Interface::Dtc::userChanged,
this, &HandlerOcData::onUserChanged);
DEBUG_LOG() << "Initialisation HandlerOcData succesful.";
DEBUG_LOG(m_logger) << "Initialisation HandlerOcData succesful.";
return true;
}
void HandlerOcData::onEvlSchemaModifyReply(const Core::FunctionReplyObject &reply)
{
if (reply.error())
ERROR_LOG() << "Schema could not be transmitted to EVL: " << reply.translated();
ERROR_LOG(m_logger) << "Schema could not be transmitted to EVL: " << reply.translated();
else
DEBUG_LOG() << "Schema successfully transmitted to EVL!";
DEBUG_LOG(m_logger) << "Schema successfully transmitted to EVL!";
}
void HandlerOcData::onCreateOperatorMessageReply(const Core::FunctionReplyObject &reply)
{
if (reply.error())
ERROR_LOG() << "Msg could not be created: " << reply.translated();
ERROR_LOG(m_logger) << "Msg could not be created: " << reply.translated();
else
DEBUG_LOG() << "Msg created successfully!";
DEBUG_LOG(m_logger) << "Msg created successfully!";
}
void HandlerOcData::onModifyOperatorMessageReply(const Core::FunctionReplyObject &reply)
{
if (reply.error())
ERROR_LOG() << "Msg could not be modified: " << reply.translated();
ERROR_LOG(m_logger) << "Msg could not be modified: " << reply.translated();
else
DEBUG_LOG() << "Msg modified successfully!";
DEBUG_LOG(m_logger) << "Msg modified successfully!";
}
void HandlerOcData::onSendOcDataReply(const Core::FunctionReplyObject &reply)
{
if (reply.error())
ERROR_LOG() << "Oc data could not be send: " << reply.translated();
ERROR_LOG(m_logger) << "Oc data could not be send: " << reply.translated();
else
DEBUG_LOG() << "Oc data send successfully to TAB!";
DEBUG_LOG(m_logger) << "Oc data send successfully to TAB!";
}
void HandlerOcData::onOcDataChanged(const TrainingAreaBase::OcData &data, DataModification modType)
@@ -297,7 +297,7 @@ void HandlerOcData::onOcDataChanged(const TrainingAreaBase::OcData &data, DataMo
}
default:
{
INFO_LOG() << "OC-data with telegram ID: " << telegramId << " is not handled by HandlerOcData OSC!";
INFO_LOG(m_logger) << "OC-data with telegram ID: " << telegramId << " is not handled by HandlerOcData OSC!";
break;
}
}
@@ -314,7 +314,7 @@ void HandlerOcData::onTechnicalStateSfmChanged(const TrainingAreaBaseOC::Technic
m_licensed = data.licensed();
if (data.licensed())
{
DEBUG_LOG() << "Newly licensed -> demanding situation / sending messages";
DEBUG_LOG(m_logger) << "Newly licensed -> demanding situation / sending messages";
demandSituation(true);
sendNewMessages();
}
@@ -342,7 +342,7 @@ void HandlerOcData::onOperatorMessageChanged(const Messaging::OperatorMessage &d
{
if (DataModification::eRemoved == modType)
return;
DEBUG_LOG() << data.recipientId() << "new message changed is send" << data.isSend() << " id" << data.id() ;
DEBUG_LOG(m_logger) << data.recipientId() << "new message changed is send" << data.isSend() << " id" << data.id() ;
const int ownEqNo = m_tabocDtc->specificsEquipment(1).equipmentNumber();
if (data.recipientId() > 0)
{
@@ -365,7 +365,7 @@ void HandlerOcData::onOperatorMessageChanged(const Messaging::OperatorMessage &d
const auto participantEqNo = m_ppmDtc->participant(data.recipientId()).equipmentNumber();
if (!participantEqNo.is_set())
{
WARNING_LOG() << "Recipient with id " << data.recipientId() << " has no equipment number set - can not send message";
WARNING_LOG(m_logger) << "Recipient with id " << data.recipientId() << " has no equipment number set - can not send message";
return;
}
LtsUtils::set2Byte(participantEqNo.get(), payload);
@@ -384,7 +384,7 @@ void HandlerOcData::onOperatorMessageChanged(const Messaging::OperatorMessage &d
TrainingAreaBase::SendOcDataRequest out;
out.payload(LtsUtils::convert<std::vector<uint8_t>>(payload));
DEBUG_LOG() << "Sending operator message: " << data;
DEBUG_LOG(m_logger) << "Sending operator message: " << data;
m_tabFtc->sendOcDataRequest(out, this);
@@ -399,7 +399,7 @@ void HandlerOcData::situationRequestCycleTimeout()
void HandlerOcData::onUserChanged(const OperatorManagement::User &data, DataModification modType)
{
TRACE_LOG() << Q_FUNC_INFO;
TRACE_LOG(m_logger) << Q_FUNC_INFO;
if (modType != DataModification::eModified || data.id() == 99) // id 99 = Organisator
return;
@@ -408,7 +408,7 @@ void HandlerOcData::onUserChanged(const OperatorManagement::User &data, DataModi
// user changes, we remember the user. now we are able to see, if the user logs out
if (data.workstationId() != 0)
{
DEBUG_LOG() << "User " << data.name() << " logged in.";
DEBUG_LOG(m_logger) << "User " << data.name() << " logged in.";
m_user = data;
@@ -419,11 +419,11 @@ void HandlerOcData::onUserChanged(const OperatorManagement::User &data, DataModi
// or all applications are closed. now we have to stop situation data (if already requested) and forget the user.
if (m_user.id() == data.id() && data.workstationId() == 0)
{
DEBUG_LOG() << "User " << m_user.name() << " logged out.";
DEBUG_LOG(m_logger) << "User " << m_user.name() << " logged out.";
if (m_centerEquipmentId > 0 || m_position.is_set())
{
DEBUG_LOG() << "Stopping situation requests.";
DEBUG_LOG(m_logger) << "Stopping situation requests.";
// stopping situation data
m_centerEquipmentId = 0;
@@ -473,7 +473,7 @@ void HandlerOcData::onSendEvaluationRequest(const rti::core::SampleIdentity &coo
void HandlerOcData::onSendDemandSituationRequest(const rti::core::SampleIdentity &cookie, const SendDemandSituationRequest &request)
{
DEBUG_LOG() << "New demand situation request from UI: " << request;
DEBUG_LOG(m_logger) << "New demand situation request from UI: " << request;
m_centerEquipmentId = request.centerEquipmentId();
m_radius = request.radius();
@@ -532,14 +532,14 @@ void HandlerOcData::onSendEquipmentRegistrationRequest(const rti::core::SampleId
TrainingAreaBase::SendOcDataRequest out;
out.payload(LtsUtils::convert<std::vector<uint8_t>>(payload));
m_tabFtc->sendOcDataRequest(out, this);
DEBUG_LOG() << "try send out to OcData";
DEBUG_LOG(m_logger) << "try send out to OcData";
m_fts->sendEquipmentRegistrationReply(cookie, Core::FunctionReplyObject());
}
void HandlerOcData::demandEvaluationSchema(int schemaId)
{
INFO_LOG() << "Demand evaluation schema: " << schemaId;
INFO_LOG(m_logger) << "Demand evaluation schema: " << schemaId;
QByteArray payload;
@@ -559,7 +559,7 @@ void HandlerOcData::demandSituation(bool initial)
if (m_centerEquipmentId < -1)
{
DEBUG_LOG() << "No situation requested as tlnId < -1!";
DEBUG_LOG(m_logger) << "No situation requested as tlnId < -1!";
return;
}
@@ -573,17 +573,17 @@ void HandlerOcData::demandSituation(bool initial)
if (m_centerEquipmentId == -1)
{
INFO_LOG() << "Last demand situation m_centerEquipmentId < -1!";
INFO_LOG(m_logger) << "Last demand situation m_centerEquipmentId < -1!";
// PlayerId -2 setzen, damit keine weiteren Telegramme uebertragen werden
m_centerEquipmentId = -2;
}
if (m_centerEquipmentId > 0)
INFO_LOG() << "Demand OC situation around m_centerEquipmentId: " << m_centerEquipmentId
INFO_LOG(m_logger) << "Demand OC situation around m_centerEquipmentId: " << m_centerEquipmentId
<< " radius: " << m_radius;
else if (m_position.is_set())
INFO_LOG() << "Demand OC situation around position: " << m_position.get()
INFO_LOG(m_logger) << "Demand OC situation around position: " << m_position.get()
<< " radius: " << m_radius;
QByteArray payload;
@@ -628,7 +628,7 @@ void HandlerOcData::demandSituation(bool initial)
void HandlerOcData::demandAesItems(OcSituation::AesType aesType)
{
INFO_LOG() << "Demand aes items type: " << aesType;
INFO_LOG(m_logger) << "Demand aes items type: " << aesType;
QByteArray payload;
LtsUtils::set1Byte(OcSituation::TelegramId::DemandAesItems, payload);
@@ -642,7 +642,7 @@ void HandlerOcData::demandAesItems(OcSituation::AesType aesType)
void HandlerOcData::sendNewMessages()
{
DEBUG_LOG() << "Sending operator messages that havn't been send yet.";
DEBUG_LOG(m_logger) << "Sending operator messages that havn't been send yet.";
auto cb = [this](const Messaging::OperatorMessage & message)
{
@@ -667,7 +667,7 @@ void HandlerOcData::handleMessage(const QByteArray &data)
out.recipientIds().push_back(ownParticipantId);
else
{
ERROR_LOG() << "Receiver invalid, do not publish message.";
ERROR_LOG(m_logger) << "Receiver invalid, do not publish message.";
return;
}
@@ -691,7 +691,7 @@ void HandlerOcData::handleMessage(const QByteArray &data)
}
else
{
WARNING_LOG() << "Sender equipment number: " << tmp << " is unknown. Setting senderId to 0.";
WARNING_LOG(m_logger) << "Sender equipment number: " << tmp << " is unknown. Setting senderId to 0.";
out.senderId(0);
}
}
@@ -713,7 +713,7 @@ void HandlerOcData::handleMessage(const QByteArray &data)
out.message(msg.mid(idx + 1).constData());
}
DEBUG_LOG() << "Got new message: " << out;
DEBUG_LOG(m_logger) << "Got new message: " << out;
m_msgFtc->createOperatorMessageRequest(out, this);
}
@@ -733,7 +733,7 @@ void HandlerOcData::handleEvaluationSchema(const QByteArray &data)
// set sendToTa true
out.sendToTa(true);
DEBUG_LOG() << "Got new evaluation schema: ";
DEBUG_LOG(m_logger) << "Got new evaluation schema: ";
m_evlFtc->evlSchemaModifyRequest(out, this);
}
@@ -787,14 +787,14 @@ void HandlerOcData::setResetCnt(OcSituation::AesType aesType, int resetCnt)
}
default:
{
WARNING_LOG() << "Setting reset counter for aes type: " << aesType << " is not handled.";
WARNING_LOG(m_logger) << "Setting reset counter for aes type: " << aesType << " is not handled.";
break;
}
}
// update db
if (!m_dbHandler->update(data))
ERROR_LOG() << "Error updating reset counter in db.";
ERROR_LOG(m_logger) << "Error updating reset counter in db.";
}
int HandlerOcData::getParticipantIdByEquipmentNumber(int eqNumber)
@@ -802,7 +802,7 @@ int HandlerOcData::getParticipantIdByEquipmentNumber(int eqNumber)
int partId = m_ppmDtc->participantIdByEquipmentNumber(eqNumber);
if (partId <= 0)
ERROR_LOG() << "Couldn't find our own ID in ppm!";
ERROR_LOG(m_logger) << "Couldn't find our own ID in ppm!";
return partId;
}