/*2011-01-03T15:22:37-01:00*/

/********************************************************************
 * aligner_cov.c
 * 
 * generated by: plcgen 2.1.201
 ********************************************************************/

#include "cb_comp.h"
#include "cb_covs.h"
#include "iec_1131.h"

#include "aligner.h"
#include "sfp/functional/graf_mdl_verin_mono/graf_mdl_verin_mono.h"


/**************************** Variables *****************************/

CB_Index aligner__num = 0;
CB_Mem_Bool *aligner_Demande_alignement;
CB_Mem_Bool *aligner_Encoch;
CB_Mem_Bool *aligner_FCA0R;
CB_Mem_Bool *aligner_FCA0S;
CB_Mem_Bool *aligner_acq;
CB_Mem_Bool *aligner_AU;
CB_Mem_Bool *aligner_OK_align;
CB_Mem_Bool *aligner_EVAO;
CB_Mem_Bool *aligner_Def_Align;

/**************************** Variables *****************************/



/************************ Components offsets ************************/

static CB_Offset sfp__aligner_offset_graf_mdl_verin_mono1;
static CB_Offset sfp__aligner_offset__end = {0, 0, 0, 0};


/********************* Initialization function **********************/

int _sfp__aligner_init(void)
{
	CB_Object __start = self;
	self.Bool+=5;

	/*initialize child graf_mdl_verin_mono1 (sfp.graf_mdl_verin_mono):*/
	sfp__aligner_offset_graf_mdl_verin_mono1.Bool = self.Bool - __start.Bool;
	sfp__aligner_offset_graf_mdl_verin_mono1.Int = self.Int - __start.Int;
	sfp__aligner_offset_graf_mdl_verin_mono1.Float = self.Float - __start.Float;
	sfp__aligner_offset_graf_mdl_verin_mono1.Char = self.Char - __start.Char;
	graf_mdl_verin_mono_DS = __start.Bool+4; /*aligner__cn_1*/
	graf_mdl_verin_mono_DR = __start.Bool+3; /*aligner__cn_2*/
	graf_mdl_verin_mono_ACQ = aligner_acq;
	graf_mdl_verin_mono_AU = aligner_AU;
	graf_mdl_verin_mono_CR = aligner_FCA0R;
	graf_mdl_verin_mono_CS = aligner_FCA0S;
	graf_mdl_verin_mono_OrdreS = aligner_EVAO;
	graf_mdl_verin_mono_EtatR = __start.Bool+2; /*aligner__cn_3*/
	graf_mdl_verin_mono_EtatS = __start.Bool+1; /*aligner__cn_4*/
	graf_mdl_verin_mono_Def_verin = __start.Bool+0; /*aligner__cn_5*/
	_sfp__graf_mdl_verin_mono_init();

	sfp__aligner_offset__end.Bool = self.Bool - __start.Bool;
	sfp__aligner_offset__end.Int = self.Int - __start.Int;
	sfp__aligner_offset__end.Float = self.Float - __start.Float;
	sfp__aligner_offset__end.Char = self.Char - __start.Char;

	return 0;
}


/************************ Behavior function *************************/

int sfp__aligner(void)
{
	CB_Object __start = self;
	int __ret;
	static char *__comp_name = "sfp.aligner";
	if (exec_mac_node(self_num)) {

		/*********************** Internals variables ************************/

										
		/********************* Pre-conditions execution *********************/

		/*no Pre-conditions*/

		/************************ Behavior execution ************************/

		{
			self.Bool = __start.Bool + sfp__aligner_offset_graf_mdl_verin_mono1.Bool;
			self.Int = __start.Int + sfp__aligner_offset_graf_mdl_verin_mono1.Int;
			self.Float = __start.Float + sfp__aligner_offset_graf_mdl_verin_mono1.Float;
			self.Char = __start.Char + sfp__aligner_offset_graf_mdl_verin_mono1.Char;

			/****************** graf_mdl_verin_mono1 execution ******************/

			self_num++;
			if (graf_mdl_verin_mono__num != self_num) {
				graf_mdl_verin_mono__num = self_num;
				graf_mdl_verin_mono_DS = __start.Bool+4; /*aligner__cn_1*/
				graf_mdl_verin_mono_DR = __start.Bool+3; /*aligner__cn_2*/
				graf_mdl_verin_mono_ACQ = aligner_acq;
				graf_mdl_verin_mono_AU = aligner_AU;
				graf_mdl_verin_mono_CR = aligner_FCA0R;
				graf_mdl_verin_mono_CS = aligner_FCA0S;
				graf_mdl_verin_mono_OrdreS = aligner_EVAO;
				graf_mdl_verin_mono_EtatR = __start.Bool+2; /*aligner__cn_3*/
				graf_mdl_verin_mono_EtatS = __start.Bool+1; /*aligner__cn_4*/
				graf_mdl_verin_mono_Def_verin = __start.Bool+0; /*aligner__cn_5*/
			}
			__ret = sfp__graf_mdl_verin_mono();
			if (__ret != 0) {
				return __ret; /*child execution failure*/
			}

		}


		/******************** Post-conditions execution *********************/

		/*no Post-conditions*/
	}

	/*************************** self update ****************************/

	self.Bool = __start.Bool + sfp__aligner_offset__end.Bool;
	self.Int = __start.Int + sfp__aligner_offset__end.Int;
	self.Float = __start.Float + sfp__aligner_offset__end.Float;
	self.Char = __start.Char + sfp__aligner_offset__end.Char;

	return 0;
}

