mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4429 Implement return status handling for command file interface
This commit is contained in:
@@ -49,20 +49,22 @@ RicfScaleFractureTemplate::RicfScaleFractureTemplate()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicfScaleFractureTemplate::execute()
|
||||
RicfCommandResponse RicfScaleFractureTemplate::execute()
|
||||
{
|
||||
if (m_id < 0)
|
||||
{
|
||||
RiaLogging::error("scaleFractureTemplate: Fracture template id not specified");
|
||||
return;
|
||||
QString error("scaleFractureTemplate: Fracture template id not specified");
|
||||
RiaLogging::error(error);
|
||||
return RicfCommandResponse(RicfCommandResponse::COMMAND_ERROR, error);
|
||||
}
|
||||
|
||||
RimProject* project = RiaApplication::instance()->project();
|
||||
|
||||
if (!project)
|
||||
{
|
||||
RiaLogging::error("scaleFractureTemplate: Project not found");
|
||||
return;
|
||||
QString error("scaleFractureTemplate: Project not found");
|
||||
RiaLogging::error(error);
|
||||
return RicfCommandResponse(RicfCommandResponse::COMMAND_ERROR, error);
|
||||
}
|
||||
|
||||
RimFractureTemplateCollection* templColl =
|
||||
@@ -71,12 +73,14 @@ void RicfScaleFractureTemplate::execute()
|
||||
|
||||
if (!templ)
|
||||
{
|
||||
RiaLogging::error(QString("scaleFractureTemplate: Fracture template not found. Id=%1").arg(m_id));
|
||||
return;
|
||||
QString error = QString("scaleFractureTemplate: Fracture template not found. Id=%1").arg(m_id);
|
||||
RiaLogging::error(error);
|
||||
return RicfCommandResponse(RicfCommandResponse::COMMAND_ERROR, error);
|
||||
}
|
||||
|
||||
templ->setScaleFactors(m_halfLengthScaleFactor, m_heightScaleFactor, m_dFactorScaleFactor, m_conductivityScaleFactor);
|
||||
templ->loadDataAndUpdateGeometryHasChanged();
|
||||
return RicfCommandResponse();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user