Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+14
-14
@@ -112,12 +112,12 @@ SituationReplayEditor::SituationReplayEditor(
|
||||
|
||||
if ((*m_essentialsViewsSrpIfc) != nullptr)
|
||||
{
|
||||
WARNING_LOG() << "essentials view available - using srp replay control widget as editor!";
|
||||
WARNING_LOG(m_logger) << "essentials view available - using srp replay control widget as editor!";
|
||||
onAddReplayControlWidget();
|
||||
}
|
||||
else
|
||||
{
|
||||
WARNING_LOG() << "essentials view not available - using traditional editor";
|
||||
WARNING_LOG(m_logger) << "essentials view not available - using traditional editor";
|
||||
}
|
||||
|
||||
setOnlineHelpFilename(QStringLiteral("Script_Editor-Add_Situation_Replay_Topic"));
|
||||
@@ -133,7 +133,7 @@ SituationReplayEditor::~SituationReplayEditor()
|
||||
|
||||
void SituationReplayEditor::updateInternalData()
|
||||
{
|
||||
DEBUG_LOG() << Q_FUNC_INFO;
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO;
|
||||
|
||||
if (m_firstUpdate)
|
||||
{
|
||||
@@ -181,7 +181,7 @@ void SituationReplayEditor::updateInternalData()
|
||||
|
||||
void SituationReplayEditor::updateInternalLength()
|
||||
{
|
||||
DEBUG_LOG() << Q_FUNC_INFO;
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO;
|
||||
qint64 end = calculateEnd(m_ui->dteStartTime->msecsSinceEpoch(), m_topicData.duration, m_ui->sbSpeed->value(), true);
|
||||
bool hasChanges = hasUnsavedChanges();
|
||||
m_ui->dteEndTime->setMsecsSinceEpoch(end);
|
||||
@@ -226,19 +226,19 @@ qint64 SituationReplayEditor::calculateEnd(qint64 startTime, int lengthInSeconds
|
||||
else
|
||||
result /= speed;
|
||||
result += startTime;
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " result = " << result;
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " result = " << result;
|
||||
return result;
|
||||
}
|
||||
|
||||
qint64 SituationReplayEditor::calculateDuration(qint64 startTime, qint64 endTime, double speed)
|
||||
{
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " startTime=" << startTime << " endTime=" << endTime << " speed=" << speed;
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " startTime=" << startTime << " endTime=" << endTime << " speed=" << speed;
|
||||
qint64 duration = endTime - startTime;
|
||||
double result = duration;
|
||||
result /= speed;
|
||||
qint64 result2 = result;
|
||||
result2 += 500;
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " result = " << result2;
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " result = " << result2;
|
||||
return result2;
|
||||
}
|
||||
|
||||
@@ -256,7 +256,7 @@ void SituationReplayEditor::setMapSettings(const QByteArray &mapSettings)
|
||||
|
||||
if (parseError.error != QJsonParseError::NoError)
|
||||
{
|
||||
ERROR_LOG() << "map settings not valid json at" << parseError.errorString();
|
||||
ERROR_LOG(m_logger) << "map settings not valid json at" << parseError.errorString();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@ void SituationReplayEditor::setMapFilter(const QByteArray &mapFilter)
|
||||
|
||||
if (parseError.error != QJsonParseError::NoError)
|
||||
{
|
||||
ERROR_LOG() << "filter settings not valid json at" << parseError.errorString();
|
||||
ERROR_LOG(m_logger) << "filter settings not valid json at" << parseError.errorString();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -345,7 +345,7 @@ bool SituationReplayEditor::apply2()
|
||||
m_ui->lblDuration->setText(QStringLiteral(" - "));
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " setText length = " << duration;
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " setText length = " << duration;
|
||||
m_ui->lblDuration->setText(tr("%1 sec").arg(m_topicDuration));
|
||||
}
|
||||
}
|
||||
@@ -463,7 +463,7 @@ void SituationReplayEditor::onMarkerSelected(const QModelIndex &idx)
|
||||
|
||||
if (marker.id() <= 0)
|
||||
{
|
||||
ERROR_LOG() << "marker has id 0";
|
||||
ERROR_LOG(m_logger) << "marker has id 0";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -477,13 +477,13 @@ void SituationReplayEditor::onMarkerSelected(const QModelIndex &idx)
|
||||
|
||||
void SituationReplayEditor::onChangesMade()
|
||||
{
|
||||
DEBUG_LOG() << Q_FUNC_INFO;
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO;
|
||||
|
||||
qint64 start = m_ui->dteStartTime->msecsSinceEpoch();
|
||||
qint64 end = m_ui->dteEndTime->msecsSinceEpoch();
|
||||
double speed = m_ui->sbSpeed->value();
|
||||
qint64 duration = calculateDuration(start, end, speed) / 1000;
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " duration = " << duration;
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " duration = " << duration;
|
||||
|
||||
if (duration < 0)
|
||||
m_ui->lblDuration->setText(QStringLiteral(" - "));
|
||||
@@ -493,7 +493,7 @@ void SituationReplayEditor::onChangesMade()
|
||||
m_topicData.duration = duration;
|
||||
m_ui->widget->previewer()->setTopicData(m_topicData);
|
||||
m_ui->lblDuration->setText(tr("%1 sec").arg(m_topicDuration));
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " setText duration = " << duration;
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " setText duration = " << duration;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
@@ -38,6 +38,8 @@ public:
|
||||
~SituationReplayEditor();
|
||||
|
||||
private:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
void updateInternalData() override;
|
||||
void updateInternalLength() override;
|
||||
void retranslate() override;
|
||||
|
||||
+2
@@ -18,6 +18,8 @@ public:
|
||||
explicit SituationReplayControlDialog(SituationReplayControlWidget *replayWidget, QWidget *parent = nullptr);
|
||||
|
||||
private:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
void retranslate() override;
|
||||
};
|
||||
}
|
||||
+25
-25
@@ -116,7 +116,7 @@ bool SituationReplayControlWidget::init(LtsSession::LtsSession *session,
|
||||
|
||||
if (!m_session->getDtc<ExerciseManagement::DataInterface>(m_exmDtc))
|
||||
{
|
||||
ERROR_LOG()<<" couldn't init exmDtc!";
|
||||
ERROR_LOG(m_logger)<<" couldn't init exmDtc!";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ bool SituationReplayControlWidget::init(LtsSession::LtsSession *session,
|
||||
{
|
||||
m_state = replay.state();
|
||||
m_id = replay.id();
|
||||
DEBUG_LOG() << "recycling replay with id" << m_id;
|
||||
DEBUG_LOG(m_logger) << "recycling replay with id" << m_id;
|
||||
m_ui->dteStartTime->setMsecsSinceEpoch(replay.beginTime());
|
||||
useExistingReplay = true;
|
||||
break;
|
||||
@@ -220,19 +220,19 @@ bool SituationReplayControlWidget::init(LtsSession::LtsSession *session,
|
||||
|
||||
if (beginTime > 0)
|
||||
{
|
||||
WARNING_LOG() << "no exc start time set, using exc begin time " << beginTime;
|
||||
WARNING_LOG(m_logger) << "no exc start time set, using exc begin time " << beginTime;
|
||||
m_ui->dteStartTime->setMsecsSinceEpoch(beginTime);
|
||||
}
|
||||
else
|
||||
{
|
||||
WARNING_LOG() << "no valid exc for getting exercise start time";
|
||||
WARNING_LOG(m_logger) << "no valid exc for getting exercise start time";
|
||||
m_ui->dteStartTime->setMsecsSinceEpoch(QDateTime::currentDateTime().addDays(-5).toMSecsSinceEpoch());
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
WARNING_LOG() << "no exc dtc for getting exercise start time";
|
||||
WARNING_LOG(m_logger) << "no exc dtc for getting exercise start time";
|
||||
m_ui->dteStartTime->setMsecsSinceEpoch(QDateTime::currentDateTime().addDays(-5).toMSecsSinceEpoch());
|
||||
}
|
||||
}
|
||||
@@ -294,10 +294,10 @@ qint64 SituationReplayControlWidget::startTime() const
|
||||
|
||||
void SituationReplayControlWidget::setStartTime(qint64 startTime)
|
||||
{
|
||||
ERROR_LOG() << Q_FUNC_INFO << " " << startTime;
|
||||
ERROR_LOG(m_logger) << Q_FUNC_INFO << " " << startTime;
|
||||
if (startTime < 0)
|
||||
{
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " called with invalid start time: " << startTime;
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " called with invalid start time: " << startTime;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -361,7 +361,7 @@ void SituationReplayControlWidget::pauseReplay()
|
||||
|
||||
if (m_id == 0)
|
||||
{
|
||||
WARNING_LOG() << "replay pause requested, but no replay active in this context";
|
||||
WARNING_LOG(m_logger) << "replay pause requested, but no replay active in this context";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -381,13 +381,13 @@ void SituationReplayControlWidget::pauseReplay()
|
||||
}))
|
||||
{
|
||||
enaDisa();
|
||||
ERROR_LOG() << "pausing failed for replay " << m_id << ": " << m_requestHelper->getErrorString();
|
||||
ERROR_LOG(m_logger) << "pausing failed for replay " << m_id << ": " << m_requestHelper->getErrorString();
|
||||
}
|
||||
else
|
||||
emit replayPaused();
|
||||
}
|
||||
else
|
||||
ERROR_LOG() << "pause requested, but replay state was not resumed or started, but " << m_state << " for " << m_id;
|
||||
ERROR_LOG(m_logger) << "pause requested, but replay state was not resumed or started, but " << m_state << " for " << m_id;
|
||||
}
|
||||
|
||||
|
||||
@@ -398,7 +398,7 @@ void SituationReplayControlWidget::stopReplay()
|
||||
|
||||
if (m_id == 0)
|
||||
{
|
||||
WARNING_LOG() << "replay stop requested, but no replay active in this context";
|
||||
WARNING_LOG(m_logger) << "replay stop requested, but no replay active in this context";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -424,7 +424,7 @@ void SituationReplayControlWidget::stopReplay()
|
||||
else
|
||||
{
|
||||
enaDisa();
|
||||
ERROR_LOG() << "stopping failed for replay " << m_id << ": " << m_requestHelper->getErrorString();
|
||||
ERROR_LOG(m_logger) << "stopping failed for replay " << m_id << ": " << m_requestHelper->getErrorString();
|
||||
}
|
||||
|
||||
m_requestHelper->setQuiet(wasQuiet);
|
||||
@@ -453,14 +453,14 @@ void SituationReplayControlWidget::resumeReplay()
|
||||
}))
|
||||
{
|
||||
enaDisa();
|
||||
ERROR_LOG() << "resuming failed for replay " << m_id << ": " << m_requestHelper->getErrorString();
|
||||
ERROR_LOG(m_logger) << "resuming failed for replay " << m_id << ": " << m_requestHelper->getErrorString();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SituationReplayControlWidget::onSitReplayChanged(const SitReplay &data, DataModification modType)
|
||||
{
|
||||
DEBUG_LOG() << "onSitReplayChanged: id = " << data.id() << ", exId = " << data.exerciseId() << ", repPartitionId = " << data.replayPartitionId()
|
||||
DEBUG_LOG(m_logger) << "onSitReplayChanged: id = " << data.id() << ", exId = " << data.exerciseId() << ", repPartitionId = " << data.replayPartitionId()
|
||||
<< ", state = " << (int)data.state().underlying() << ", m_partitionId = " << m_partitionId << ", modType = " << (int)modType;
|
||||
|
||||
if (m_partitionId != data.replayPartitionId())
|
||||
@@ -512,7 +512,7 @@ void SituationReplayControlWidget::onMarkerClicked(const QModelIndex &index)
|
||||
)
|
||||
appFilter = new MarkerManagement::MarkerManagementApplyFilter(m_session, fltParticipantIfc, fltAesIfc, fltBuildingComponentGuiIfc);
|
||||
else
|
||||
WARNING_LOG() << "unable to set filters from marker as flt ifc`s are missing";
|
||||
WARNING_LOG(m_logger) << "unable to set filters from marker as flt ifc`s are missing";
|
||||
|
||||
|
||||
|
||||
@@ -522,7 +522,7 @@ void SituationReplayControlWidget::onMarkerClicked(const QModelIndex &index)
|
||||
if (appFilter->applyFilter(mapFilter))
|
||||
emit signalSetMapFilter(mapFilter);
|
||||
else
|
||||
ERROR_LOG() << "Error while setting filters";
|
||||
ERROR_LOG(m_logger) << "Error while setting filters";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -545,20 +545,20 @@ void SituationReplayControlWidget::onMarkerClicked(const QModelIndex &index)
|
||||
if (appFilter)
|
||||
{
|
||||
QByteArray mapSettings(QByteArray::fromRawData(marker.mapSettings().c_str(), marker.mapSettings().size()));
|
||||
DEBUG_LOG() << "set map settings from marker " << (mapSettings.toStdString());
|
||||
DEBUG_LOG(m_logger) << "set map settings from marker " << (mapSettings.toStdString());
|
||||
|
||||
|
||||
|
||||
SituationMap::OperatorMapSettings oms;
|
||||
oms.fromJson(mapSettings);
|
||||
DEBUG_LOG() << ">>>> oms.orderedLayers.size() " << oms.orderedLayers.size();
|
||||
DEBUG_LOG(m_logger) << ">>>> oms.orderedLayers.size() " << oms.orderedLayers.size();
|
||||
|
||||
static const QLatin1String LayerNameEmergencyCall("EmergencyCall");
|
||||
|
||||
auto pos = std::remove_if( oms.orderedLayers.begin(),
|
||||
oms.orderedLayers.end(),
|
||||
[](const QPair<QString, SituationMap::LayerParameter> &pair) { return pair.first == LayerNameEmergencyCall; } );
|
||||
DEBUG_LOG() << ">>>> remove iterator: " << pos << " END: " << oms.orderedLayers.end();
|
||||
DEBUG_LOG(m_logger) << ">>>> remove iterator: " << pos << " END: " << oms.orderedLayers.end();
|
||||
if(pos != oms.orderedLayers.end())
|
||||
oms.orderedLayers.erase(pos);
|
||||
|
||||
@@ -569,7 +569,7 @@ void SituationReplayControlWidget::onMarkerClicked(const QModelIndex &index)
|
||||
if (appFilter->applyMapSettings(mapSettings))
|
||||
emit signalSetMapSettings(mapSettings);
|
||||
else
|
||||
ERROR_LOG() << "Error while setting mapSettings";
|
||||
ERROR_LOG(m_logger) << "Error while setting mapSettings";
|
||||
}
|
||||
delete appFilter;
|
||||
}
|
||||
@@ -634,7 +634,7 @@ bool SituationReplayControlWidget::startReplayDelayed(qint64 start, qint64 end,
|
||||
req.endTime(end);
|
||||
req.pace(speed);
|
||||
|
||||
ERROR_LOG() << "Start Replay Partition: "
|
||||
ERROR_LOG(m_logger) << "Start Replay Partition: "
|
||||
<< "id: " << m_id
|
||||
<< ", partition id: " << m_partitionId
|
||||
<< ", partition type: " << m_session->partitionType()
|
||||
@@ -652,15 +652,15 @@ bool SituationReplayControlWidget::startReplayDelayed(qint64 start, qint64 end,
|
||||
if (repliedId > 0)
|
||||
{
|
||||
m_id = repliedId;
|
||||
ERROR_LOG() << "Replied replay id: " << repliedId;
|
||||
ERROR_LOG(m_logger) << "Replied replay id: " << repliedId;
|
||||
emit replayStarted();
|
||||
return true;
|
||||
}
|
||||
|
||||
ERROR_LOG() << "replay start didn't return a replay id!";
|
||||
ERROR_LOG(m_logger) << "replay start didn't return a replay id!";
|
||||
}
|
||||
|
||||
ERROR_LOG() << "could not start replay: " << m_requestHelper->getErrorString() << " (" << m_requestHelper->getRepliedId() << ")";
|
||||
ERROR_LOG(m_logger) << "could not start replay: " << m_requestHelper->getErrorString() << " (" << m_requestHelper->getRepliedId() << ")";
|
||||
enaDisa();
|
||||
return false;
|
||||
}
|
||||
@@ -671,7 +671,7 @@ void SituationReplayControlWidget::onStartReplay()
|
||||
double speed = m_ui->slSpeed->value();
|
||||
speed /= 10;
|
||||
qint64 startInSecs = getSecs(m_ui->dteStartTime->msecsSinceEpoch());
|
||||
DEBUG_LOG() << "onStartReplay startInSecs=" << startInSecs;
|
||||
DEBUG_LOG(m_logger) << "onStartReplay startInSecs=" << startInSecs;
|
||||
m_ui->slPeriodSlider->setValue(startInSecs);
|
||||
|
||||
startReplay(m_ui->dteStartTime->msecsSinceEpoch(), 0 , speed);
|
||||
|
||||
+2
@@ -97,6 +97,8 @@ private slots:
|
||||
void onDteStartChanged();
|
||||
|
||||
private:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
void disableAllReplayButtons();
|
||||
qint64 getMSecs(qint64 sec);
|
||||
qint64 getSecs(qint64 msec);
|
||||
|
||||
Reference in new issue
Block a user