Click here to Skip to main content
15,889,116 members
Articles / Desktop Programming / Win32

Visual Modeling of Complex Reactive Systems with Harel UML StateCharts

Rate me:
Please Sign up or sign in to vote.
5.00/5 (7 votes)
8 Sep 2009LGPL310 min read 43.6K   692   35  
This article presents a commercial-grade cross-platform Harel UML StateChart Open-Source application framework named StateWizard for concurrent, distributed, and real-time reactive system development with simplicity, efficiency, and scalability.
/* State Chart:

PowerDown -> Join1 -> Cond1 -> PowerUp -> 
    ^                                   |  
    -------------------------------------

PowerUp (Playing <---> Pause)

Refer to Readme.txt for more information.
*/

#include "sme.h"

#include "Player_c.h"
#include "Player2_c.h"
#include "EventId.h"
#include <stdio.h>
#include "sme_cross_platform.h"
#include "sme_debug.h"
#include "SingleState.h"

/************* A new file **************/
/* Define Orthogonal Sub State */

SME_DEC_EXT_OBJ_VAR(SingleState1)
SME_DEC_EXT_OBJ_VAR(Player)

int OrthoStateEntry(SME_OBJ_T *pApp, SME_EVENT_T *pEvent);
int OrthoStateExit(SME_OBJ_T *pApp, SME_EVENT_T *pEvent);


SME_BEGIN_ORTHO_COMP_STATE_DEF(OrthoState, Player, OrthoStateEntry, OrthoStateExit)	
SME_REGION_DEF(SingleStateReg1,SingleState,SME_RUN_MODE_PARENT_THREAD,0)
SME_REGION_DEF(SingleStateReg2,SingleState,SME_RUN_MODE_PARENT_THREAD,0)
//SME_REGION_DEF(PlayerReg1,Player,SME_RUN_MODE_SEPARATE_THREAD,0)
//SME_REGION_DEF(PlayerReg2,Player,SME_RUN_MODE_SEPARATE_THREAD,0)
SME_MULTI_REGION_DEF(PlayerReg,2,Player,SME_RUN_MODE_SEPARATE_THREAD,0)
SME_END_ORTHO_STATE_DEF

SME_END_COMP_STATE_DEF(OrthoState)

int OrthoStateEntry(SME_OBJ_T *pApp, SME_EVENT_T *pEvent)
{
	printf("OrthoStateEntry\n");
	return 0;
}


int OrthoStateExit(SME_OBJ_T *pApp, SME_EVENT_T *pEvent)
{
	printf("OrthoStateExit\n");
	return 0;
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU Lesser General Public License (LGPLv3)


Written By
Software Developer (Senior)
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions