Hi, Monique
I think this is a kind of event-driven application, it can be
organized in a state machine. I draw a state chart with StateChart
(
http://www.intelliwizard.com/products.htm) as below:
http://www.intelliwizard.com/down/case/dvd/DVD_State.JPG
The StateTree is as blow:
DVD_State Machine
-> Closed
----> Stop
----> Burn
-> Open
The state machine structure with state transitions is as blow with
StateWizard. The source code is available at
http://www.intelliwizard.com/down/case/dvd/dvd.zip
.
SME_BEGIN_ROOT_COMP_STATE_DEF(DVD_State,DVD_StateEntry,DVD_StateExit)
SME_ON_INIT_STATE(SME_NULL_ACTION,DVD_StateInitChild)
SME_END_STATE_DEF
SME_BEGIN_SUB_STATE_DEF_P(Closed)
SME_ON_EVENT(E_OPEN_DRAWER,OnClosedE_OPEN_DRAWER,Open)
SME_END_STATE_DEF
SME_BEGIN_LEAF_STATE_DEF_P(Open,OpenEntry,OpenExit)
SME_ON_EVENT(E_OPEN_DRAWER,OnOpenE_OPEN_DRAWER,Open)
SME_END_STATE_DEF
SME_BEGIN_COMP_STATE_DEF(Closed,DVD_State,ClosedEntry,ClosedExit)
SME_ON_INIT_STATE(SME_NULL_ACTION,ClosedInitChild)
SME_END_STATE_DEF
SME_BEGIN_LEAF_STATE_DEF_P(Burn,BurnEntry,BurnExit)
SME_ON_EVENT(E_STOP,OnBurnE_STOP,Stop)
SME_END_STATE_DEF
SME_BEGIN_LEAF_STATE_DEF_P(Stop,StopEntry,StopExit)
SME_ON_EVENT(E_BURN,OnStopE_BURN,Burn)
SME_END_STATE_DEF
Sate machine applications may operate with lower layer software
modules or hardware interfaces, which are called service providers. A
service is formally specified by a set of primitives (operations)
available to service users (applications). These primitives tell the
service to perform some action or report on an action taken by a peer
component/entity. The service primitives are classified into four
categories:
* Request
* Indication
* Response
* Confirm
[Computer Networks, Andrew S.Tanenbaum]. The request and confirm
primitives can be implemented in form of service calls. The indication
and response primitives can be implemented in form of external event
posting.
You may refer the following page for more information:
http://www.intelliwizard.com/doc/State_Machines_and_Applications.htm
Wish these information is helpful for you.
Jerry Ding
StateWizard:
http://www.intelliwizard.com
> the drawer. But it really doesn't matter what the actions actually /do/.
>
H.lah...@verizon.net
> software blog:
http://pathfinderpeople.blogs.com/hslahman/index.html