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

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

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

// {{{RME classifier 'Logical View::AlteracaoRota' 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_AlteracaoRota_Actor( RTController * _rts, RTActorRef * _ref )
{
	return new AlteracaoRota_Actor( _rts, _ref );
}

const RTActorClass AlteracaoRota =
{
	(const RTActorClass *)0
  , "AlteracaoRota"
  , (RTVersionId)0
  , 1
  , rtg_relays
  , new_AlteracaoRota_Actor
};

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

#define SUPER RTActor

AlteracaoRota_Actor::AlteracaoRota_Actor( RTController * rtg_rts, RTActorRef * rtg_ref )
	: RTActor( rtg_rts, rtg_ref )
	, ForaRota( 0 )
	, Corrigido( false )
{
}

AlteracaoRota_Actor::~AlteracaoRota_Actor( void )
{
}

// {{{RME classifier 'Logical View::AlteracaoRota' operation 'Corrigir()'
void AlteracaoRota_Actor::Corrigir( void )
{
	// {{{USR operation 'Corrigir()'
	// }}}USR
}
// }}}RME

int AlteracaoRota_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 AlteracaoRota_Actor::chain1_Initial( void )
{
	// transition ':TOP:Initial:Initial'
	rtgChainBegin( 1, "Initial" );
	rtgTransitionBegin();
	rtgTransitionEnd();
	enterState( 2 );
}

void AlteracaoRota_Actor::rtsBehavior( int signalIndex, int portIndex )
{
	for( int stateIndex = getCurrentState(); ; stateIndex = rtg_parent_state[ stateIndex - 1 ] )
		switch( stateIndex )
		{
		case 1:
			// {{{RME classifier 'Logical View::AlteracaoRota' 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::AlteracaoRota' 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 * AlteracaoRota_Actor::getActorData( void ) const
{
	return &AlteracaoRota_Actor::rtg_class;
}

const RTActor_class AlteracaoRota_Actor::rtg_class =
{
	(const RTActor_class *)0
  , rtg_state_names
  , 2
  , AlteracaoRota_Actor::rtg_parent_state
  , &AlteracaoRota
  , 0
  , (const RTComponentDescriptor *)0
  , 1
  , AlteracaoRota_Actor::rtg_ports
  , 0
  , (const RTLocalBindingDescriptor *)0
  , 2
  , AlteracaoRota_Actor::rtg_AlteracaoRota_fields
};

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

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

const RTFieldDescriptor AlteracaoRota_Actor::rtg_AlteracaoRota_fields[] =
{
	// {{{RME classifier 'Logical View::AlteracaoRota' classAttribute 'ForaRota'
	{
		"ForaRota"
	  , RTOffsetOf( AlteracaoRota_Actor, ForaRota )
		// {{{RME classifier 'Logical View::AlteracaoRota' classAttribute 'ForaRota' tool 'OT::CppTargetRTS' property 'TypeDescriptor'
	  , &RTType_double
		// }}}RME
		// {{{RME classifier 'Logical View::AlteracaoRota' classAttribute 'ForaRota' tool 'OT::CppTargetRTS' property 'GenerateTypeModifier'
	  , (const RTTypeModifier *)0
		// }}}RME
	}
	// }}}RME
	// {{{RME classifier 'Logical View::AlteracaoRota' classAttribute 'Corrigido'
  , {
		"Corrigido"
	  , RTOffsetOf( AlteracaoRota_Actor, Corrigido )
		// {{{RME classifier 'Logical View::AlteracaoRota' classAttribute 'Corrigido' tool 'OT::CppTargetRTS' property 'TypeDescriptor'
	  , &RTType_bool
		// }}}RME
		// {{{RME classifier 'Logical View::AlteracaoRota' classAttribute 'Corrigido' tool 'OT::CppTargetRTS' property 'GenerateTypeModifier'
	  , (const RTTypeModifier *)0
		// }}}RME
	}
	// }}}RME
};
#undef SUPER

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

// }}}RME
