/*2011-01-03T15:23:40-01:00*/

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

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

#include "butee.h"



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

CB_Index butee__num = 0;
CB_Mem_Float *butee_incPositionX;
CB_Mem_Float *butee_incPositionY;
CB_Mem_Float *butee_incPositionZ;
CB_Mem_Float *butee_incRotationX;
CB_Mem_Float *butee_incRotationY;
CB_Mem_Float *butee_incRotationZ;
CB_Mem_Float *butee_coordCentreX;
CB_Mem_Float *butee_coordCentreY;
CB_Mem_Float *butee_coordCentreZ;
CB_Mem_Int *butee_status_act_prod;
CB_Mem_Float *butee_m11;
CB_Mem_Float *butee_m12;
CB_Mem_Float *butee_m13;
CB_Mem_Float *butee_m14;
CB_Mem_Float *butee_m21;
CB_Mem_Float *butee_m22;
CB_Mem_Float *butee_m23;
CB_Mem_Float *butee_m24;
CB_Mem_Float *butee_m31;
CB_Mem_Float *butee_m32;
CB_Mem_Float *butee_m33;
CB_Mem_Float *butee_m34;
CB_Mem_Float *butee_m41;
CB_Mem_Float *butee_m42;
CB_Mem_Float *butee_m43;
CB_Mem_Float *butee_m44;

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

#define incPositionX (butee_incPositionX->CB_current_value)
#define incPositionY (butee_incPositionY->CB_current_value)
#define incPositionZ (butee_incPositionZ->CB_current_value)
#define incRotationX (butee_incRotationX->CB_current_value)
#define incRotationY (butee_incRotationY->CB_current_value)
#define incRotationZ (butee_incRotationZ->CB_current_value)
#define coordCentreX (butee_coordCentreX->CB_current_value)
#define coordCentreY (butee_coordCentreY->CB_current_value)
#define coordCentreZ (butee_coordCentreZ->CB_current_value)
#define status_act_prod (butee_status_act_prod->CB_current_value)
#define m11 (butee_m11->CB_current_value)
#define m12 (butee_m12->CB_current_value)
#define m13 (butee_m13->CB_current_value)
#define m14 (butee_m14->CB_current_value)
#define m21 (butee_m21->CB_current_value)
#define m22 (butee_m22->CB_current_value)
#define m23 (butee_m23->CB_current_value)
#define m24 (butee_m24->CB_current_value)
#define m31 (butee_m31->CB_current_value)
#define m32 (butee_m32->CB_current_value)
#define m33 (butee_m33->CB_current_value)
#define m34 (butee_m34->CB_current_value)
#define m41 (butee_m41->CB_current_value)
#define m42 (butee_m42->CB_current_value)
#define m43 (butee_m43->CB_current_value)
#define m44 (butee_m44->CB_current_value)


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


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

int _bibliotheque_epo__butee_init(void)
{
	self.Int+=1;
	self.Float+=16;


	return 0;
}


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

int bibliotheque_epo__butee(void)
{
	static char *__comp_name = "bibliotheque_epo.butee";
	if (exec_term_node(self_num)) {

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

		butee_status_act_prod = self.Int+0;
		butee_m11 = self.Float+0;
		butee_m12 = self.Float+1;
		butee_m13 = self.Float+2;
		butee_m14 = self.Float+3;
		butee_m21 = self.Float+4;
		butee_m22 = self.Float+5;
		butee_m23 = self.Float+6;
		butee_m24 = self.Float+7;
		butee_m31 = self.Float+8;
		butee_m32 = self.Float+9;
		butee_m33 = self.Float+10;
		butee_m34 = self.Float+11;
		butee_m41 = self.Float+12;
		butee_m42 = self.Float+13;
		butee_m43 = self.Float+14;
		butee_m44 = self.Float+15;

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

		/*no Pre-conditions*/

		/************************ Actor Myself init *************************/

		setMyselfFor(self_num);

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

		{
			/* -------------------------------------------------------------------------------------------------	*/
			/* Modèle de Comportement Opératif											*/
			/* Catégorie Acteurs													*/
			/* Techniques Nouvelles d'Informatique										*/
			/* Date de révision : Octobre 2002											*/
			/* -------------------------------------------------------------------------------------------------	*/
			/* Ce module représente une Butee mécanique									*/
			/* -------------------------------------------------------------------------------------------------	*/
			
			/*	Déplacement de la butée pour un blocage sur les 3 axes							*/
			
			if ((incPositionX != 0.0) || (incPositionY != 0.0) || (incPositionZ != 0.0))
				moveBy(myself, incPositionX, incPositionY, incPositionZ);
			
			/*	Rotation de la butée lorsqu'elle est embarquée sur un plateau tournant				*/
			
			if ((incRotationX != 0.0) || (incRotationY != 0.0) || (incRotationZ != 0.0))
				rotateBy(myself, incRotationX, incRotationY, incRotationZ, coordCentreX, coordCentreY, coordCentreZ);
			
			
			
			
					}


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

		/*no Post-conditions*/
	}

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

	self.Int += 1;
	self.Float += 16;

	return 0;
}

