59 lines
1.6 KiB
C++
Executable File
59 lines
1.6 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* Abstract class which defines selection behavior when clicking on mounting points on the map
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Hannes Baeuerle, SLSE, 2017-04-05
|
|
*/
|
|
|
|
#include "ism_selector.h"
|
|
|
|
#include <LtsUtilsGuiDds/request_helper.h>
|
|
|
|
namespace InfrastructureManagement
|
|
{
|
|
|
|
MountingPointSelector::MountingPointSelector(const std::shared_ptr<Interface::Dtc> &dtc,
|
|
const std::shared_ptr<Interface::Ftc> &ftc,
|
|
const std::shared_ptr<ForeignDataInterface> &ismDataIfc,
|
|
LtsUtils::RequestHelper *requestHelper,
|
|
LOGGER_T logger)
|
|
: m_ismDataIfc(ismDataIfc)
|
|
, m_ftc(ftc)
|
|
, m_dtc(dtc)
|
|
, m_requestHelper(requestHelper)
|
|
, m_logger(logger)
|
|
{
|
|
if (!m_ftc->enableMountingPointPlanModify())
|
|
{
|
|
ERROR_LOG(m_logger) << "Could not enable FT MountingPointPlanModify of ISM";
|
|
}
|
|
}
|
|
|
|
|
|
void MountingPointSelector::onMountingPointPlanModifyReply(const Core::FunctionReplyObject &replyObject)
|
|
{
|
|
m_requestHelper->requestReply(replyObject);
|
|
|
|
if (replyObject.error())
|
|
ERROR_LOG(m_logger) << "MountingPointPlansRemove error: "
|
|
<< replyObject.str();
|
|
else
|
|
DEBUG_LOG(m_logger) << "MountingPointPlansRemove success";
|
|
}
|
|
|
|
|
|
void MountingPointSelector::startModifyRequest(const std::vector<MountingPointPlan> &data)
|
|
{
|
|
if (data.empty())
|
|
return;
|
|
MountingPointPlanModifyRequest req(m_ismDataIfc->scheduleId(), data);
|
|
m_requestHelper->startSingleRequest([req, this]()
|
|
{
|
|
return m_ftc->mountingPointPlanModifyRequest(req, this);
|
|
});
|
|
}
|
|
|
|
}
|