// {{{RME classifier 'Logical View::DetectarAlteracaoRota'

#if defined( PRAGMA ) && ! defined( PRAGMA_IMPLEMENTED )
#pragma implementation "DetectarAlteracaoRota.h"
#endif

#include <RTSystem/PVA.h>
#include <DetectarAlteracaoRota.h>

// {{{RME classifier 'Logical View::DetectarAlteracaoRota' tool 'OT::Cpp' property 'ImplementationPreface'
// {{{USR tool 'OT::Cpp' property 'ImplementationPreface'
// }}}USR
// }}}RME

static const RTRelayDescriptor rtg_relays[] =
{
	{
		"NewPort1"
	  , &CommAlteracaoRota::Base::rt_class
	  , 1 // cardinality
	}
};

static RTActor * new_DetectarAlteracaoRota_Actor( RTController * _rts, RTActorRef * _ref )
{
	return new DetectarAlteracaoRota_Actor( _rts, _ref );
}

const RTActorClass DetectarAlteracaoRota =
{
	(const RTActorClass *)0
  , "DetectarAlteracaoRota"
  , (RTVersionId)0
  , 1
  , rtg_relays
  , new_DetectarAlteracaoRota_Actor
};

static const char * const rtg_state_names[] =
{
	"TOP"
  , "AlteracaoRota"
};

#define SUPER RTActor

DetectarAlteracaoRota_Actor::DetectarAlteracaoRota_Actor( RTController * rtg_rts, RTActorRef * rtg_ref )
	: RTActor( rtg_rts, rtg_ref )
	, ForaRota( 0 )
{
}

DetectarAlteracaoRota_Actor::~DetectarAlteracaoRota_Actor( void )
{
}

// {{{RME classifier 'Logical View::DetectarAlteracaoRota' operation 'Informar_Alteracao()'
void DetectarAlteracaoRota_Actor::Informar_Alteracao( void )
{
	// {{{USR operation 'Informar_Alteracao()'
	// }}}USR
}
// }}}RME

int DetectarAlteracaoRota_Actor::_followInV( RTBindingEnd & rtg_end, int rtg_portId, int rtg_repIndex )
{
	switch( rtg_portId )
	{
	case 0:
		// NewPort1
		if( rtg_repIndex < 1 )
		{
			rtg_end.port = &NewPort1;
			rtg_end.index = rtg_repIndex;
			return 1;
		}
		break;
	default:
		break;
	}
	return RTActor::_followInV( rtg_end, rtg_portId, rtg_repIndex );
}

INLINE_CHAINS void DetectarAlteracaoRota_Actor::chain1_Initial( void )
{
	// transition ':TOP:Initial:Initial'
	rtgChainBegin( 1, "Initial" );
	rtgTransitionBegin();
	rtgTransitionEnd();
	enterState( 2 );
}

void DetectarAlteracaoRota_Actor::rtsBehavior( int signalIndex, int portIndex )
{
	for( int stateIndex = getCurrentState(); ; stateIndex = rtg_parent_state[ stateIndex - 1 ] )
		switch( stateIndex )
		{
		case 1:
			// {{{RME classifier 'Logical View::DetectarAlteracaoRota' state ':TOP'
			switch( portIndex )
			{
			case 0:
				switch( signalIndex )
				{
				case 1:
					chain1_Initial();
					return;
				default:
					break;
				}
				break;
			default:
				break;
			}
			unexpectedMessage();
			return;
			// }}}RME
		case 2:
			// {{{RME classifier 'Logical View::DetectarAlteracaoRota' state ':TOP:AlteracaoRota'
			switch( portIndex )
			{
			case 0:
				switch( signalIndex )
				{
				case 1:
					return;
				default:
					break;
				}
				break;
			default:
				break;
			}
			break;
			// }}}RME
		default:
			unexpectedState();
			return;
		}
}

const RTActor_class * DetectarAlteracaoRota_Actor::getActorData( void ) const
{
	return &DetectarAlteracaoRota_Actor::rtg_class;
}

const RTActor_class DetectarAlteracaoRota_Actor::rtg_class =
{
	(const RTActor_class *)0
  , rtg_state_names
  , 2
  , DetectarAlteracaoRota_Actor::rtg_parent_state
  , &DetectarAlteracaoRota
  , 0
  , (const RTComponentDescriptor *)0
  , 1
  , DetectarAlteracaoRota_Actor::rtg_ports
  , 0
  , (const RTLocalBindingDescriptor *)0
  , 4
  , DetectarAlteracaoRota_Actor::rtg_DetectarAlteracaoRota_fields
};

const RTStateId DetectarAlteracaoRota_Actor::rtg_parent_state[] =
{
	0
  , 1
};

const RTPortDescriptor DetectarAlteracaoRota_Actor::rtg_ports[] =
{
	{
		"NewPort1"
	  , (const char *)0
	  , &CommAlteracaoRota::Base::rt_class
	  , RTOffsetOf( DetectarAlteracaoRota_Actor, DetectarAlteracaoRota_Actor::NewPort1 )
	  , 1 // cardinality
	  , 1
	  , RTPortDescriptor::End
	  , RTPortDescriptor::NotificationDisabled
	  , RTPortDescriptor::RegisterNotPermitted
	  , RTPortDescriptor::PublicVisibility
	  , RTPortDescriptor::Wired
	}
};

const RTFieldDescriptor DetectarAlteracaoRota_Actor::rtg_DetectarAlteracaoRota_fields[] =
{
	// {{{RME classifier 'Logical View::DetectarAlteracaoRota' classAttribute 'ForaRota'
	{
		"ForaRota"
	  , RTOffsetOf( DetectarAlteracaoRota_Actor, ForaRota )
		// {{{RME classifier 'Logical View::DetectarAlteracaoRota' classAttribute 'ForaRota' tool 'OT::CppTargetRTS' property 'TypeDescriptor'
	  , &RTType_double
		// }}}RME
		// {{{RME classifier 'Logical View::DetectarAlteracaoRota' classAttribute 'ForaRota' tool 'OT::CppTargetRTS' property 'GenerateTypeModifier'
	  , (const RTTypeModifier *)0
		// }}}RME
	}
	// }}}RME
	// {{{RME classifier 'Logical View::DetectarAlteracaoRota' classAttribute 'DesAngular'
  , {
		"DesAngular"
	  , RTOffsetOf( DetectarAlteracaoRota_Actor, DesAngular )
		// {{{RME classifier 'Logical View::DetectarAlteracaoRota' classAttribute 'DesAngular' tool 'OT::CppTargetRTS' property 'TypeDescriptor'
	  , &RTType_float
		// }}}RME
		// {{{RME classifier 'Logical View::DetectarAlteracaoRota' classAttribute 'DesAngular' tool 'OT::CppTargetRTS' property 'GenerateTypeModifier'
	  , (const RTTypeModifier *)0
		// }}}RME
	}
	// }}}RME
	// {{{RME classifier 'Logical View::DetectarAlteracaoRota' classAttribute 'DesLinear'
  , {
		"DesLinear"
	  , RTOffsetOf( DetectarAlteracaoRota_Actor, DesLinear )
		// {{{RME classifier 'Logical View::DetectarAlteracaoRota' classAttribute 'DesLinear' tool 'OT::CppTargetRTS' property 'TypeDescriptor'
	  , &RTType_float
		// }}}RME
		// {{{RME classifier 'Logical View::DetectarAlteracaoRota' classAttribute 'DesLinear' tool 'OT::CppTargetRTS' property 'GenerateTypeModifier'
	  , (const RTTypeModifier *)0
		// }}}RME
	}
	// }}}RME
	// {{{RME classifier 'Logical View::DetectarAlteracaoRota' classAttribute 'PosBase'
  , {
		"PosBase"
	  , RTOffsetOf( DetectarAlteracaoRota_Actor, PosBase )
		// {{{RME classifier 'Logical View::DetectarAlteracaoRota' classAttribute 'PosBase' tool 'OT::CppTargetRTS' property 'TypeDescriptor'
	  , &RTType_float
		// }}}RME
		// {{{RME classifier 'Logical View::DetectarAlteracaoRota' classAttribute 'PosBase' tool 'OT::CppTargetRTS' property 'GenerateTypeModifier'
	  , (const RTTypeModifier *)0
		// }}}RME
	}
	// }}}RME
};
#undef SUPER

// {{{RME classifier 'Logical View::DetectarAlteracaoRota' tool 'OT::Cpp' property 'ImplementationEnding'
// {{{USR tool 'OT::Cpp' property 'ImplementationEnding'
// }}}USR
// }}}RME

// }}}RME
