31.01.2014 Views

Ph.D. - geht es zur Homepage der Informatik des Fachbereiches 3 ...

Ph.D. - geht es zur Homepage der Informatik des Fachbereiches 3 ...

Ph.D. - geht es zur Homepage der Informatik des Fachbereiches 3 ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

8.6. Implementation<br />

execution<br />

global<br />

∆t ∆t ∆t ∆t ∆t<br />

local<br />

0 t<br />

t e<br />

∆t<br />

0<br />

1T s 2T s 3T s 4T s 5T s<br />

Figure 8.22.: Example of global and local execution drift<br />

t<br />

pp. 457-504] of a real-time system.<br />

8.6.3. Control Flow Implementation<br />

As the execution of CControlFlow objects is driven by the CDataFlow objects and CControlFlow<br />

objects are always a part of CDataFlow objects, their implementation is not relevant for<br />

a detailed discussion here. While the CDataFlow instanc<strong>es</strong> handle the transition to new<br />

CEVCState objects by their m_TransitionStack, CControlFlow must take care of transition<br />

between its CState objects by itself. In contrast to the transition between CEVCState instanc<strong>es</strong>,<br />

the evaluation of transition between CState objects is done in the currently executed CState<br />

object and not in the parent CControlFlow instance. This simplification can be done because<br />

a control flow cannot be executed in parallel as independent data flow.<br />

Thus, a CState object execut<strong>es</strong> all CFunctionBlock objects m_FunctionBlocks and afterwards<br />

evaluat<strong>es</strong> its transition stack m_TransitionStack, which is implemented in Listing D.4 in<br />

Appendix D.<br />

8.6.4. EVC State Machine Implementation<br />

Since the core functionality of the openETCS domain framework or rather the execution of<br />

the currently active data flows is located in CDataFlow, the transition between EVC Mod<strong>es</strong><br />

and switching to ETCS Application Levels is mostly implemented in CDataFlow. Also, the<br />

CEVCStateMachine::Start() should be non-blocking according to the behavioural d<strong>es</strong>ign<br />

in Section 8.4. Hence, the execution of CEVCState must be done in a separated thread<br />

that is created and started by that method. The thread is implemented in a method of<br />

CEVCStateMachine:<br />

void CEVCStateMachine : : StateThread ( ) throw ( )<br />

153

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!