Click here to Skip to main content
15,898,035 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.8K   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.
Please follow the steps to start your application:

1) (SHOULD) Select a kind of framework and a corresponding engine library

The StateWizard provides two frameworks for state machine applicatios, standard C++ class and standard C. 

When you try to create an application in form of standard C, do not forget to choose "Standard C in cpp/c file" option using the setting dialog.

There are two kinds of engine libraries: C++ and C. If you would like to use the C++ engine library, define the macro 

#define SME_CPP TRUE //TRUE is 1

in sme_conf.h. Otherwise, do not define 

#define SME_CPP FALSE //FALSE is 0

it when you use the C engine library. 

2) (SHOULD) The Multi-Threaded Engine
The engine is multi-threaded. On Windows platform, select Multi-threaded DLL as run-time library. On Linux platform, add the following options to your make file. 

-lpthread -D_REENTRANT 

3) The engine interface

The engine interface adopts standard C for the two kind of frameworks.

4) Development model
In simulation environment, developer can design some simulators using Windows program as service providers. These simulators have identical interface with target service providers' interface. On target environment, developer may take little effort to integrate state machine applications with these service providers to real environment.

5) RTOS Virtual Layer porting

You have to redefine several callback functions such as GetMessage() and call the following API to install them.

a) SmeSetExtEventOprProc

The external event handler works as a plug-in to the engine. Use the following function to install your plug-in. 

void SmeSetExtEventOprProc(SME_GET_EXT_EVENT_PROC_T fnGetExtEvent, 
	SME_DEL_EXT_EVENT_PROC_T fnDelExtEvent,
	SME_POST_THREAD_EXT_INT_EVENT_PROC_T fnPostThreadExtIntEvent,
	SME_POST_THREAD_EXT_PTR_EVENT_PROC_T fnPostThreadExtPtrEvent,
	SME_INIT_THREAD_EXT_MSG_BUF_PROC_T fnInitThreadExtMsgBuf,
	SME_INIT_THREAD_EXT_MSG_BUF_PROC_T fnFreeThreadExtMsgBuf);


b) SmeSetMemOprProc 
typedef void* (*SME_MEM_ALLOC_PROC_T)(unsigned int nSize); 
typedef BOOL (*SME_MEM_FREE_PROC_T)(void* pUserData); 
void SmeSetMemOprProc(SME_MEM_ALLOC_PROC_T fnMAllocProc, SME_MEM_FREE_PROC_T fnMFreeProc) 

c) SmeSetTlsProc 
typedef BOOL (*SME_SET_THREAD_CONTEXT_PROC)(SME_THREAD_CONTEXT_PT p); 
typedef SME_THREAD_CONTEXT_PT (*SME_GET_THREAD_CONTEXT_PROC)(); 
void SmeSetTlsProc(SME_SET_THREAD_CONTEXT_PROC pfnSetThreadContext, SME_GET_THREAD_CONTEXT_PROC pfnGetThreadContext) 

The StateWizard provides a cross-platform library for porting to Win32/Linux. 

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