SpectrumProcess.cc 1.79 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:   SpectrumProcess.cpp
 * Author: hacene
 * 
 * Created on December 31, 2020, 3:42 PM
 */


#include <stdlib.h>
#include <string>

#include <boost/lexical_cast.hpp>

#include "DicError.hh"
#include "AMDA_exception.hh"

#include "Operation.hh"
#include "ParameterManager.hh"
#include "ParamMgr.hh"
#include "ParameterCreatorFromExpression.hh"

#include "SpectrumProcess.hh"


using namespace std;
using namespace boost;
using namespace log4cxx;

namespace AMDA {
namespace Parameters {


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

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

SpectrumProcess::~SpectrumProcess() {
    
    if (_inputImfParam != nullptr) {
		_inputImfParam->closeConnection(this);
	}
	if (_inputPswParam != nullptr) {
		_inputPswParam->closeConnection(this);
	}
     
}
 
  
TimeStamp SpectrumProcess::init() {
   
    
                    
	TimeStamp time = _parameterInput->init( this, _timeIntervalList);
        
         

	_inputImfParam->init( this, _timeIntervalList);
	ParamData* lImfParamInput = _inputImfParam->getParamData(this).get();

	_inputPswParam->init( this, _timeIntervalList);
	ParamData* lPswParamInput = _inputPswParam->getParamData(this).get();

	_paramInput = _parameterInput->getParamData(this).get();

	SpectrumCreator lCreator(*this, *_paramInput);
	_operation = lCreator.getOperation();	
	_paramData = ParamDataSPtr(_operation->getParamOutput());
	_paramData->setMinSampling(_paramInput->getMinSampling());
         
	return time;
}

}
}