⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nocoffeepot_test.cpp

📁 含有uml的多个实例及实例的java源码。
💻 CPP
字号:
// {{{RME classifier 'Logical View::TestHarnesses::MarkI_Tests::Scenarios_MarkI::NoCoffeePot_Test'#if defined( PRAGMA ) && ! defined( PRAGMA_IMPLEMENTED )#pragma implementation "rtg/NoCoffeePot_Test.h"#endif#include <RTSystem/AutoTestMarkI_x86VisualCpp60.h>#include <rtg/NoCoffeePot_Test.h>#include <rtg/Boiler.h>#include <rtg/BrewButton.h>#include <rtg/IndicatorLight.h>#include <rtg/ReliefValve.h>#include <rtg/Warmer.h>// {{{RME tool 'OT::Cpp' property 'ImplementationPreface'// {{{USR// }}}USR// }}}RMEstatic const RTRelayDescriptor rtg_relays[] ={	{		"reliefValve"	  , &ReliefValve::Base::rt_class	  , 1 // cardinality	}  , {		"boiler"	  , &Boiler::Base::rt_class	  , 1 // cardinality	}  , {		"brewButton"	  , &BrewButton::Base::rt_class	  , 1 // cardinality	}  , {		"warmer"	  , &Warmer::Base::rt_class	  , 1 // cardinality	}  , {		"indicatorLight"	  , &IndicatorLight::Base::rt_class	  , 1 // cardinality	}  , {		"testResults"	  , &TestResults::Base::rt_class	  , 1 // cardinality	}};static RTActor * new_NoCoffeePot_Test_Actor( RTController * _rts, RTActorRef * _ref ){	return new NoCoffeePot_Test_Actor( _rts, _ref );}const RTActorClass NoCoffeePot_Test ={	&MarkI_TestContainer  , "NoCoffeePot_Test"  , (RTVersionId)0  , 6  , rtg_relays  , new_NoCoffeePot_Test_Actor};static const char * const rtg_state_names[] ={	"TOP"  , "Remove_pot"  , "Failed"  , "No_Brew"};#define SUPER MarkI_TestContainer_ActorNoCoffeePot_Test_Actor::NoCoffeePot_Test_Actor( RTController * rtg_rts, RTActorRef * rtg_ref )	: MarkI_TestContainer_Actor( rtg_rts, rtg_ref ){}NoCoffeePot_Test_Actor::~NoCoffeePot_Test_Actor( void ){}int NoCoffeePot_Test_Actor::_followInV( RTBindingEnd & rtg_end, int rtg_portId, int rtg_repIndex ){	switch( rtg_portId )	{	case 0:		// reliefValve		if( rtg_repIndex < 1 )		{			// t_reliefValve			rtg_end.port = &t_reliefValve;			rtg_end.index = rtg_repIndex;			return 1;		}		break;	case 1:		// boiler		if( rtg_repIndex < 1 )		{			// t_boiler			rtg_end.port = &t_boiler;			rtg_end.index = rtg_repIndex;			return 1;		}		break;	case 2:		// brewButton		if( rtg_repIndex < 1 )		{			// t_brewButton			rtg_end.port = &t_brewButton;			rtg_end.index = rtg_repIndex;			return 1;		}		break;	case 3:		// warmer		if( rtg_repIndex < 1 )		{			// t_warmer			rtg_end.port = &t_warmer;			rtg_end.index = rtg_repIndex;			return 1;		}		break;	case 4:		// indicatorLight		if( rtg_repIndex < 1 )		{			// t_indicatorLight			rtg_end.port = &t_indicatorLight;			rtg_end.index = rtg_repIndex;			return 1;		}		break;	case 5:		// testResults		if( rtg_repIndex < 1 )		{			rtg_end.port = &testResults;			rtg_end.index = rtg_repIndex;			return 1;		}		break;	default:		break;	}	return MarkI_TestContainer_Actor::_followInV( rtg_end, rtg_portId, rtg_repIndex );}// {{{RME enter ':TOP:Failed'#define CALLSUPER MarkI_TestContainer_Actor::enter3_Failed()INLINE_METHODS void NoCoffeePot_Test_Actor::enter3_Failed( void ){	// {{{USR	testResults.fail().send();	// }}}USR}#undef CALLSUPER// }}}RMEvoid NoCoffeePot_Test_Actor::enterStateV( void ){	switch( getCurrentState() )	{	case 3:		enter3_Failed();		break;	default:		MarkI_TestContainer_Actor::enterStateV();		break;	}}// {{{RME transition ':TOP:Junction1:timeout'#define SUPERMETHOD MarkI_TestContainer_Actor::transition1_timeout#define CALLSUPER MarkI_TestContainer_Actor::transition1_timeout( rtdata, rtport )INLINE_METHODS void NoCoffeePot_Test_Actor::transition1_timeout( const void * rtdata, Timing::Base * rtport ){	// {{{USR	testResults.success().send();	// }}}USR}#undef SUPERMETHOD#undef CALLSUPER// }}}RME// {{{RME transition ':TOP:Remove_pot:Junction2:boiler_goes_on'#define SUPERMETHOD MarkI_TestContainer_Actor::transition3_boiler_goes_on#define CALLSUPER MarkI_TestContainer_Actor::transition3_boiler_goes_on( rtdata, rtport )INLINE_METHODS void NoCoffeePot_Test_Actor::transition3_boiler_goes_on( const void * rtdata, TestResults::Base * rtport ){	// {{{USR	t_warmer.warmerEmpty().send();	t_brewButton.brewButtonPushed().send();	timer.informIn( RTTimespec( 2,0 ) );	// }}}USR}#undef SUPERMETHOD#undef CALLSUPER// }}}RMEINLINE_CHAINS void NoCoffeePot_Test_Actor::chain2_Initialize( void ){	// transition ':TOP:Initial:Initialize'	rtgChainBegin( 1, "Initialize" );	rtgTransitionBegin();	rtgTransitionEnd();	enterState( 2 );}INLINE_CHAINS void NoCoffeePot_Test_Actor::chain1_timeout( void ){	// transition ':TOP:Junction1:timeout'	rtgChainBegin( 1, "timeout" );	exitToChainState( 1, rtg_parent_state );	rtgTransitionBegin();	transition1_timeout( msg->data, (Timing::Base *)msg->sap() );	rtgTransitionEnd();	processHistory();}INLINE_CHAINS void NoCoffeePot_Test_Actor::chain3_boiler_goes_on( void ){	// transition ':TOP:Remove_pot:Junction2:boiler_goes_on'	rtgChainBegin( 2, "boiler_goes_on" );	exitState( rtg_parent_state );	rtgTransitionBegin();	transition3_boiler_goes_on( msg->data, (TestResults::Base *)msg->sap() );	rtgTransitionEnd();	enterState( 4 );}INLINE_CHAINS void NoCoffeePot_Test_Actor::chain5_indicator_warmer_off( void ){	// transition ':TOP:No_Brew:Junction3:indicator_warmer_off'	rtgChainBegin( 4, "indicator_warmer_off" );	exitState( rtg_parent_state );	rtgTransitionBegin();	rtgTransitionEnd();	enterState( 4 );}INLINE_CHAINS void NoCoffeePot_Test_Actor::chain4_t1( void ){	// transition ':TOP:No_Brew:Junction2:t1'	rtgChainBegin( 4, "t1" );	exitState( rtg_parent_state );	rtgTransitionBegin();	rtgTransitionEnd();	enterState( 3 );}void NoCoffeePot_Test_Actor::rtsBehavior( int signalIndex, int portIndex ){	for( int stateIndex = getCurrentState(); ; stateIndex = rtg_parent_state[ stateIndex - 1 ] )		switch( stateIndex )		{		case 1:			// {{{RME state ':TOP'			switch( portIndex )			{			case 0:				switch( signalIndex )				{				case 1:					chain2_Initialize();					return;				default:					break;				}				break;			case 12:				// {{{RME classifier 'Logical View::TestHarnesses::MarkI_Tests::MarkI_TestContainer' port 'timer'				switch( signalIndex )				{				case Timing::Base::rti_timeout:					chain1_timeout();					return;				default:					break;				}				break;				// }}}RME			default:				break;			}			unexpectedMessage();			return;			// }}}RME		case 2:			// {{{RME state ':TOP:Remove_pot'			switch( portIndex )			{			case 0:				switch( signalIndex )				{				case 1:					return;				default:					break;				}				break;			case 6:				// {{{RME classifier 'Logical View::TestHarnesses::MarkI_Tests::MarkI_TestContainer' port 'testResults'				switch( signalIndex )				{				case TestResults::Base::rti_start:					chain3_boiler_goes_on();					return;				default:					break;				}				break;				// }}}RME			default:				break;			}			break;			// }}}RME		case 3:			// {{{RME state ':TOP:Failed'			switch( portIndex )			{			case 0:				switch( signalIndex )				{				case 1:					return;				default:					break;				}				break;			default:				break;			}			break;			// }}}RME		case 4:			// {{{RME state ':TOP:No_Brew'			switch( portIndex )			{			case 0:				switch( signalIndex )				{				case 1:					return;				default:					break;				}				break;			case 8:				// {{{RME classifier 'Logical View::TestHarnesses::MarkI_Tests::MarkI_TestContainer' port 't_indicatorLight'				switch( signalIndex )				{				case IndicatorLight::Base::rti_indicatorOff:					chain5_indicator_warmer_off();					return;				default:					break;				}				break;				// }}}RME			case 9:				// {{{RME classifier 'Logical View::TestHarnesses::MarkI_Tests::MarkI_TestContainer' port 't_boiler'				switch( signalIndex )				{				case Boiler::Base::rti_boilerOn:					chain4_t1();					return;				default:					break;				}				break;				// }}}RME			case 11:				// {{{RME classifier 'Logical View::TestHarnesses::MarkI_Tests::MarkI_TestContainer' port 't_warmer'				switch( signalIndex )				{				case Warmer::Base::rti_warmerOff:					chain5_indicator_warmer_off();					return;				default:					break;				}				break;				// }}}RME			default:				break;			}			break;			// }}}RME		default:			unexpectedState();			return;		}}const RTActor_class * NoCoffeePot_Test_Actor::getActorData( void ) const{	return &NoCoffeePot_Test_Actor::rtg_class;}const RTActor_class NoCoffeePot_Test_Actor::rtg_class ={	&MarkI_TestContainer_Actor::rtg_class  , rtg_state_names  , 4  , NoCoffeePot_Test_Actor::rtg_parent_state  , &NoCoffeePot_Test  , 0  , (const RTComponentDescriptor *)0  , 7  , NoCoffeePot_Test_Actor::rtg_ports  , 0  , (const RTLocalBindingDescriptor *)0  , 0  , (const RTFieldDescriptor *)0};const RTStateId NoCoffeePot_Test_Actor::rtg_parent_state[] ={	0  , 1  , 1  , 1};const RTPortDescriptor NoCoffeePot_Test_Actor::rtg_ports[] ={	{		"testResults"	  , (const char *)0	  , &TestResults::Base::rt_class	  , RTOffsetOf( NoCoffeePot_Test_Actor, MarkI_TestContainer_Actor::testResults )	  , 1 // cardinality	  , 6	  , RTPortDescriptor::KindWired + RTPortDescriptor::NotificationDisabled + RTPortDescriptor::RegisterNotPermitted + RTPortDescriptor::VisibilityPublic	}  , {		"t_reliefValve"	  , (const char *)0	  , &ReliefValve::Base::rt_class	  , RTOffsetOf( NoCoffeePot_Test_Actor, MarkI_TestContainer_Actor::t_reliefValve )	  , 1 // cardinality	  , 7	  , RTPortDescriptor::KindWired + RTPortDescriptor::NotificationDisabled + RTPortDescriptor::RegisterNotPermitted + RTPortDescriptor::VisibilityProtected	}  , {		"t_indicatorLight"	  , (const char *)0	  , &IndicatorLight::Base::rt_class	  , RTOffsetOf( NoCoffeePot_Test_Actor, MarkI_TestContainer_Actor::t_indicatorLight )	  , 1 // cardinality	  , 8	  , RTPortDescriptor::KindWired + RTPortDescriptor::NotificationDisabled + RTPortDescriptor::RegisterNotPermitted + RTPortDescriptor::VisibilityProtected	}  , {		"t_boiler"	  , (const char *)0	  , &Boiler::Base::rt_class	  , RTOffsetOf( NoCoffeePot_Test_Actor, MarkI_TestContainer_Actor::t_boiler )	  , 1 // cardinality	  , 9	  , RTPortDescriptor::KindWired + RTPortDescriptor::NotificationDisabled + RTPortDescriptor::RegisterNotPermitted + RTPortDescriptor::VisibilityProtected	}  , {		"t_brewButton"	  , (const char *)0	  , &BrewButton::Base::rt_class	  , RTOffsetOf( NoCoffeePot_Test_Actor, MarkI_TestContainer_Actor::t_brewButton )	  , 1 // cardinality	  , 10	  , RTPortDescriptor::KindWired + RTPortDescriptor::NotificationDisabled + RTPortDescriptor::RegisterNotPermitted + RTPortDescriptor::VisibilityProtected	}  , {		"t_warmer"	  , (const char *)0	  , &Warmer::Base::rt_class	  , RTOffsetOf( NoCoffeePot_Test_Actor, MarkI_TestContainer_Actor::t_warmer )	  , 1 // cardinality	  , 11	  , RTPortDescriptor::KindWired + RTPortDescriptor::NotificationDisabled + RTPortDescriptor::RegisterNotPermitted + RTPortDescriptor::VisibilityProtected	}  , {		"timer"	  , (const char *)0	  , &Timing::Base::rt_class	  , RTOffsetOf( NoCoffeePot_Test_Actor, MarkI_TestContainer_Actor::timer )	  , 1 // cardinality	  , 12	  , RTPortDescriptor::KindSpecial + RTPortDescriptor::NotificationDisabled + RTPortDescriptor::RegisterNotPermitted + RTPortDescriptor::VisibilityProtected	}};#undef SUPER// {{{RME tool 'OT::Cpp' property 'ImplementationEnding'// {{{USR// }}}USR// }}}RME// }}}RME

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -