Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+13
-13
@@ -25,7 +25,7 @@ HandlerTargetConfig::HandlerTargetConfig(const std::shared_ptr<DdsHandler> &ddsH
|
||||
|
||||
bool HandlerTargetConfig::init()
|
||||
{
|
||||
INFO_LOG() << "init";
|
||||
INFO_LOG(m_logger) << "init";
|
||||
connect(m_dtcTab.get(), &TrainingAreaBase::Interface::Dtc::targetDataChanged,
|
||||
this, &HandlerTargetConfig::onTargetDataChanged);
|
||||
|
||||
@@ -40,10 +40,10 @@ void HandlerTargetConfig::onTargetDataChanged(const TrainingAreaBase::TargetData
|
||||
|
||||
uint8_t responseCmd = 100;
|
||||
TargetManagement::TargetConfig tgtTargetData;
|
||||
INFO_LOG() << "onTargetDataChanged payload.size=" << targetData.payload().size();
|
||||
INFO_LOG(m_logger) << "onTargetDataChanged payload.size=" << targetData.payload().size();
|
||||
tgtTargetData.participantId(m_ddsHandler->equipNo2participantId(targetData.equipmentNumber()));
|
||||
for (size_t i = 0; i < targetData.payload().size(); i++)
|
||||
INFO_LOG() << "payload[" << i << "]=" << targetData.payload()[i];
|
||||
INFO_LOG(m_logger) << "payload[" << i << "]=" << targetData.payload()[i];
|
||||
|
||||
if (targetData.payload().size() < 6)
|
||||
return;
|
||||
@@ -51,29 +51,29 @@ void HandlerTargetConfig::onTargetDataChanged(const TrainingAreaBase::TargetData
|
||||
tgtTargetData.tgtCommand(static_cast <TargetManagement::TgtCommand_def::type>(targetData.payload()[0] - responseCmd));
|
||||
tgtTargetData.mode(static_cast <TargetManagement::Mode_def::type>(targetData.payload()[1]));
|
||||
tgtTargetData.weapon(targetData.payload()[2]);
|
||||
INFO_LOG() << "tgtTargetData.tgtCommand =" << tgtTargetData.tgtCommand()
|
||||
INFO_LOG(m_logger) << "tgtTargetData.tgtCommand =" << tgtTargetData.tgtCommand()
|
||||
<< " mode=" << tgtTargetData.mode()
|
||||
<< " weapon=" << tgtTargetData.weapon();
|
||||
if (!m_dtsTgt->publish(tgtTargetData))
|
||||
ERROR_LOG() << "Error publish targetData";
|
||||
ERROR_LOG(m_logger) << "Error publish targetData";
|
||||
} // end of onTargetDataChanged
|
||||
|
||||
void HandlerTargetConfig::onSendTargetDataReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
if (replyObject.error())
|
||||
WARNING_LOG() << "Can not send target data to target participant : " << replyObject();
|
||||
WARNING_LOG(m_logger) << "Can not send target data to target participant : " << replyObject();
|
||||
else
|
||||
DEBUG_LOG() << "onSendTargetDataReply for id " << replyObject.id() << " success";
|
||||
DEBUG_LOG(m_logger) << "onSendTargetDataReply for id " << replyObject.id() << " success";
|
||||
}
|
||||
|
||||
// Send to TAB
|
||||
void HandlerTargetConfig::onConfigureTargetRequest(const rti::core::SampleIdentity &cookie,
|
||||
const ConfigureTargetRequest &request)
|
||||
{
|
||||
INFO_LOG() << "onConfigureTargetRequest";
|
||||
INFO_LOG(m_logger) << "onConfigureTargetRequest";
|
||||
Core::FunctionReplyObject reply = Core::FunctionReplyObject(request.id());
|
||||
|
||||
DEBUG_LOG() << "HandlerTargetConfig onTargetConfigChanged participantId=" << request.participantId();
|
||||
DEBUG_LOG(m_logger) << "HandlerTargetConfig onTargetConfigChanged participantId=" << request.participantId();
|
||||
|
||||
TrainingAreaBase::SendTargetDataRequest tgt;
|
||||
const int participantId = request.participantId();
|
||||
@@ -87,7 +87,7 @@ void HandlerTargetConfig::onConfigureTargetRequest(const rti::core::SampleIdenti
|
||||
case TargetManagement::TgtCommand_def::Unknown:
|
||||
case TargetManagement::TgtCommand_def::PlaySound:
|
||||
{
|
||||
WARNING_LOG() << "onTargetConfigChanged Command =" << request.tgtCommand() << " not handled.";
|
||||
WARNING_LOG(m_logger) << "onTargetConfigChanged Command =" << request.tgtCommand() << " not handled.";
|
||||
m_ddsHandler->ftsTgt()->configureTargetReply(cookie, reply);
|
||||
return;
|
||||
}
|
||||
@@ -101,7 +101,7 @@ void HandlerTargetConfig::onConfigureTargetRequest(const rti::core::SampleIdenti
|
||||
{
|
||||
if (!request.mode().is_set())
|
||||
{
|
||||
ERROR_LOG() << "Set mode requested, but mode ist not set";
|
||||
ERROR_LOG(m_logger) << "Set mode requested, but mode ist not set";
|
||||
m_ddsHandler->ftsTgt()->configureTargetReply(cookie, Core::FunctionReplyObject(request.participantId(), tr_lts("dds", "Set mode requested, but mode is not set")));
|
||||
return;
|
||||
}
|
||||
@@ -112,7 +112,7 @@ void HandlerTargetConfig::onConfigureTargetRequest(const rti::core::SampleIdenti
|
||||
{
|
||||
if (!request.weapon().is_set())
|
||||
{
|
||||
ERROR_LOG() << "Set weapon requested, but weapon ist not set";
|
||||
ERROR_LOG(m_logger) << "Set weapon requested, but weapon ist not set";
|
||||
m_ddsHandler->ftsTgt()->configureTargetReply(cookie, Core::FunctionReplyObject(request.participantId(), tr_lts("dds", "Set weapon requested, but weapon is not set")));
|
||||
return;
|
||||
}
|
||||
@@ -123,7 +123,7 @@ void HandlerTargetConfig::onConfigureTargetRequest(const rti::core::SampleIdenti
|
||||
{
|
||||
if (!request.parameterSet().is_set())
|
||||
{
|
||||
ERROR_LOG() << "Set parameterset requested, but parameterset ist not set";
|
||||
ERROR_LOG(m_logger) << "Set parameterset requested, but parameterset ist not set";
|
||||
m_ddsHandler->ftsTgt()->configureTargetReply(cookie, Core::FunctionReplyObject(request.participantId(), tr_lts("dds", "Set parameterset requested, but parameterset is not set")));
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user