Commit 50eb10f8 authored by Rashad Kanavath's avatar Rashad Kanavath

ENH: adding save xml process to ApplicationEngine

parent ff199a98
......@@ -114,6 +114,22 @@ void Application::Init()
m_DocExample = DocExampleStructure::New();
m_ParameterList = ParameterGroup::New();
this->DoInit();
//rashad: global parameters. now used only for save xml
AddGlobalParameters();
}
void Application::AddGlobalParameters()
{
const std::string xmlKey = "xml";
AddParameter(ParameterType_String, xmlKey, "Save process to xml file");
SetParameterDescription(xmlKey, "Save process to xml file");
MandatoryOff(xmlKey);
const std::string defaultXmlFileName = std::string(GetName()) + ".xml";
SetParameterString(xmlKey, defaultXmlFileName);
DisableParameter(xmlKey);
}
void Application::UpdateParameters()
......@@ -226,6 +242,25 @@ int Application::ExecuteAndWriteOutput()
AddProcess(outputParam->GetWriter(), progressId.str());
outputParam->Write();
}
//rashad: xml writer parameter
else if (GetParameterType(key) == ParameterType_OutputProcessXml
&& IsParameterEnabled(key) && HasValue(key) )
{
/*
Parameter* param = GetParameterByKey(key);
OutputProcessXmlParameter* outputParam = dynamic_cast<OutputProcessXmlParameter*>(param);
outputParam->InitializeWriters();
if (useRAM)
{
outputParam->SetRAMValue(ram);
}
std::ostringstream progressId;
progressId << "Writing " << outputParam->GetFileName() << "...";
AddProcess(outputParam->GetWriter(), progressId.str());
outputParam->Write();
*/
}
}
}
......
......@@ -33,7 +33,6 @@
#include "otbWrapperOutputImageParameter.h"
#include "otbWrapperComplexInputImageParameter.h"
#include "otbWrapperComplexOutputImageParameter.h"
#include "otbWrapperDocExampleStructure.h"
#include "itkMersenneTwisterRandomVariateGenerator.h"
......@@ -83,6 +82,9 @@ public:
/** Check if the application has been initialized */
bool IsInitialized() const;
/** rashad: Adding global parameters eg: -xml */
void AddGlobalParameters();
/** Update the value of parameters for which no user value has been provided */
void UpdateParameters();
......
......@@ -53,7 +53,8 @@ typedef enum
ParameterType_ListView,
ParameterType_ComplexInputImage,
ParameterType_ComplexOutputImage,
ParameterType_RAM
ParameterType_RAM,
ParameterType_OutputProcessXml
} ParameterType;
typedef enum
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment