Changeset 16792


Ignore:
Timestamp:
11/15/13 16:17:59 (11 years ago)
Author:
Eric.Larour
Message:

CHG: making a new SetParam functionality in Parameters for DataSetParam type objects.

Location:
issm/trunk-jpl/src/c/classes/Params
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/Params/DataSetParam.h

    r16233 r16792  
    2222        private:
    2323                int   enum_type;
     24
     25        public:
    2426                DataSet* value;
    2527
    26         public:
    2728                /*DataSetParam constructors, destructors: {{{*/
    2829                DataSetParam();
  • issm/trunk-jpl/src/c/classes/Params/Parameters.cpp

    r16510 r16792  
    2121#include "./BoolParam.h"
    2222#include "./DoubleMatParam.h"
     23#include "./DataSetParam.h"
    2324#include "./DoubleParam.h"
    2425#include "./DoubleVecParam.h"
     
    472473        if(param) param->SetValue(fid); //already exists, just set it.
    473474        else this->AddObject(new FileParam(enum_type,fid)); //just add the new parameter.
     475}
     476/*}}}*/
     477/*FUNCTION Parameters::SetParam(DataSet* dataset, int enum_type);{{{*/
     478void   Parameters::SetParam(DataSet* dataset,int enum_type){
     479
     480        Param* param=NULL;
     481
     482        /*first, figure out if the param has already been created: */
     483        param=dynamic_cast<Param*>(this->FindParamObject(enum_type));
     484
     485        if(param) param->SetValue(dataset); //already exists, just set it.
     486        else this->AddObject(new DataSetParam(enum_type,dataset)); //just add the new parameter.
    474487}
    475488/*}}}*/
  • issm/trunk-jpl/src/c/classes/Params/Parameters.h

    r15128 r16792  
    5252                void  SetParam(Matrix<IssmDouble>* mat,int enum_type);
    5353                void  SetParam(FILE* fid,int enum_type);
     54                void  SetParam(DataSet* dataset,int enum_type);
    5455
    5556                Object* FindParamObject(int enum_type);
Note: See TracChangeset for help on using the changeset viewer.