Exemple #1
0
bool
PeaksOverThresholdAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
{
    if(parentNode == 0)
        return false;

    PeaksOverThresholdAttributes defaultObject;
    bool addToParent = false;
    // Create a node for PeaksOverThresholdAttributes.
    DataNode *node = new DataNode("PeaksOverThresholdAttributes");

    if(completeSave || !FieldsEqual(ID_dataYearBegin, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("dataYearBegin", dataYearBegin));
    }

    if(completeSave || !FieldsEqual(ID_dataAnalysisYearRangeEnabled, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("dataAnalysisYearRangeEnabled", dataAnalysisYearRangeEnabled));
    }

    if(completeSave || !FieldsEqual(ID_dataAnalysisYearRange, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("dataAnalysisYearRange", dataAnalysisYearRange, 2));
    }

    if(completeSave || !FieldsEqual(ID_aggregation, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("aggregation", AggregationType_ToString(aggregation)));
    }

    if(completeSave || !FieldsEqual(ID_annualPercentile, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("annualPercentile", annualPercentile));
    }

    if(completeSave || !FieldsEqual(ID_seasonalPercentile, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("seasonalPercentile", seasonalPercentile, 4));
    }

    if(completeSave || !FieldsEqual(ID_monthlyPercentile, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("monthlyPercentile", monthlyPercentile, 12));
    }

    if(completeSave || !FieldsEqual(ID_displaySeason, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("displaySeason", SeasonType_ToString(displaySeason)));
    }

    if(completeSave || !FieldsEqual(ID_displayMonth, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("displayMonth", MonthType_ToString(displayMonth)));
    }

    if(completeSave || !FieldsEqual(ID_cutoff, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("cutoff", cutoff));
    }

    if(completeSave || !FieldsEqual(ID_computeParamValues, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("computeParamValues", computeParamValues));
    }

    if(completeSave || !FieldsEqual(ID_computeCovariates, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("computeCovariates", computeCovariates));
    }

    if(completeSave || !FieldsEqual(ID_covariateReturnYears, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("covariateReturnYears", covariateReturnYears));
    }

    if(completeSave || !FieldsEqual(ID_covariateModelLocation, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("covariateModelLocation", covariateModelLocation));
    }

    if(completeSave || !FieldsEqual(ID_covariateModelShape, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("covariateModelShape", covariateModelShape));
    }

    if(completeSave || !FieldsEqual(ID_covariateModelScale, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("covariateModelScale", covariateModelScale));
    }

    if(completeSave || !FieldsEqual(ID_computeRVDifferences, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("computeRVDifferences", computeRVDifferences));
    }

    if(completeSave || !FieldsEqual(ID_rvDifferences, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("rvDifferences", rvDifferences, 2));
    }

    if(completeSave || !FieldsEqual(ID_dataScaling, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("dataScaling", dataScaling));
    }

    if(completeSave || !FieldsEqual(ID_dumpData, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("dumpData", dumpData));
    }


    // Add the node to the parent node.
    if(addToParent || forceAdd)
        parentNode->AddNode(node);
    else
        delete node;

    return (addToParent || forceAdd);
}
bool
ExtremeValueAnalysisAttributes::CreateNode(DataNode *parentNode, bool completeSave, bool forceAdd)
{
    if(parentNode == 0)
        return false;

    ExtremeValueAnalysisAttributes defaultObject;
    bool addToParent = false;
    // Create a node for ExtremeValueAnalysisAttributes.
    DataNode *node = new DataNode("ExtremeValueAnalysisAttributes");

    if(completeSave || !FieldsEqual(ID_dataYearBegin, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("dataYearBegin", dataYearBegin));
    }

    if(completeSave || !FieldsEqual(ID_dataAnalysisYearRangeEnabled, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("dataAnalysisYearRangeEnabled", dataAnalysisYearRangeEnabled));
    }

    if(completeSave || !FieldsEqual(ID_dataAnalysisYear1, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("dataAnalysisYear1", dataAnalysisYear1));
    }

    if(completeSave || !FieldsEqual(ID_dataAnalysisYear2, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("dataAnalysisYear2", dataAnalysisYear2));
    }

    if(completeSave || !FieldsEqual(ID_ensemble, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("ensemble", ensemble));
    }

    if(completeSave || !FieldsEqual(ID_numEnsembles, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("numEnsembles", numEnsembles));
    }

    if(completeSave || !FieldsEqual(ID_dataScaling, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("dataScaling", dataScaling));
    }

    if(completeSave || !FieldsEqual(ID_extremeMethod, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("extremeMethod", ExtremeType_ToString(extremeMethod)));
    }

    if(completeSave || !FieldsEqual(ID_optimizationMethod, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("optimizationMethod", OptimizationType_ToString(optimizationMethod)));
    }

    if(completeSave || !FieldsEqual(ID_aggregation, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("aggregation", AggregationType_ToString(aggregation)));
    }

    if(completeSave || !FieldsEqual(ID_covariateModelScale, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("covariateModelScale", covariateModelScale));
    }

    if(completeSave || !FieldsEqual(ID_covariateModelLocation, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("covariateModelLocation", covariateModelLocation));
    }

    if(completeSave || !FieldsEqual(ID_covariateModelShape, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("covariateModelShape", covariateModelShape));
    }

    if(completeSave || !FieldsEqual(ID_computeReturnValues, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("computeReturnValues", computeReturnValues));
    }

    if(completeSave || !FieldsEqual(ID_returnValues, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("returnValues", returnValues));
    }

    if(completeSave || !FieldsEqual(ID_computeRVDifferences, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("computeRVDifferences", computeRVDifferences));
    }

    if(completeSave || !FieldsEqual(ID_rvDifference1, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("rvDifference1", rvDifference1));
    }

    if(completeSave || !FieldsEqual(ID_rvDifference2, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("rvDifference2", rvDifference2));
    }

    if(completeSave || !FieldsEqual(ID_displayMonth, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("displayMonth", MonthType_ToString(displayMonth)));
    }

    if(completeSave || !FieldsEqual(ID_displaySeason, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("displaySeason", SeasonType_ToString(displaySeason)));
    }

    if(completeSave || !FieldsEqual(ID_computeParamValues, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("computeParamValues", computeParamValues));
    }

    if(completeSave || !FieldsEqual(ID_dumpData, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("dumpData", dumpData));
    }

    if(completeSave || !FieldsEqual(ID_dumpDebug, &defaultObject))
    {
        addToParent = true;
        node->AddNode(new DataNode("dumpDebug", dumpDebug));
    }


    // Add the node to the parent node.
    if(addToParent || forceAdd)
        parentNode->AddNode(node);
    else
        delete node;

    return (addToParent || forceAdd);
}