Pv_ionosProcess.cc 1.84 KB
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/* 
 * File:   Pv_ionosProcess.c++
 * Author: hacene
 * 
 * Created on October 14, 2021, 4:25 PM
 */

#include "Operation.hh"
#include "ParameterManager.hh"
#include "ParameterCreatorFromExpression.hh"
#include <boost/lexical_cast.hpp>
#include "DicError.hh"
#include "AMDA_exception.hh"
#include "CainCreator.hh"

#include "Pv_ionosProcess.hh"
namespace AMDA {
    namespace Parameters {

        Pv_ionosProcess::Pv_ionosProcess(Parameter& parameter) : SingleParamProcess_CRTP(parameter) {
        }
        

        Pv_ionosProcess::Pv_ionosProcess(const Pv_ionosProcess& pProcess, Parameter &parameter) : SingleParamProcess_CRTP(pProcess, parameter) {
        }

        Pv_ionosProcess::~Pv_ionosProcess() {
        }
        TimeStamp Pv_ionosProcess::init() {
                   if (_attributList.size() < 1) {
                BOOST_THROW_EXCEPTION(AMDA::AMDA_exception() << AMDA::errno_code(AMDA_PROCESS_ERR) << AMDA::ex_msg(std::string("Pv_ionosProcess::init required at least 1 attribute")));
            }
            std::string ouputType = _attributList[0];
            TimeStamp timeStamp = _parameterInput->init(this, _timeIntervalList);
            Parameter::InfoList lInfoList = _parameterInput->getInfoList();
            _parameter.getInfoList().insert(lInfoList.begin(), lInfoList.end());
            _paramInput = _parameterInput->getParamData(this).get();
            CainCreator ICreator(*this, *_paramInput, ouputType);
            _operation = ICreator.getOperation();
            _paramData = ParamDataSPtr(_operation->getParamOutput());
            _paramData->setMinSampling(_paramInput->getMinSampling());
            return timeStamp;
            
        }

    }
}