Changes between Version 38 and Version 39 of Writing Rules/Tlmt
- Timestamp:
- Feb 19, 2008, 6:46:45 PM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Writing Rules/Tlmt
v38 v39 18 18 = B) Single VCI initiator and single VCI target = 19 19 20 Figure 1 presents a minimal system containing one single initiator, '''my_initiator''' , and one single target, '''my_target''' . In the proposed example, the '''my_initiator''' module behavior is modeled by the SC_THREAD '''execLoop()''', that contains an infinite loop. The call-back function '''rspReceived()''' is executed when a VCI response packet is received by the initiator module.20 Figure 1 presents a minimal system containing one single initiator, '''my_initiator''' , and one single target, '''my_target''' . The '''my_initiator''' module behavior is modeled by the SC_THREAD '''execLoop()''', that contains an infinite loop. The call-back function '''rspReceived()''' is executed when a VCI response packet is received by the initiator module. 21 21 22 22 [[Image(tlmt_figure_1.png, nolink)]] 23 23 24 Contrary tothe initiator, the target module has a purely reactive behaviour.24 Unlike the initiator, the target module has a purely reactive behaviour. 25 25 There is no need to use a SC_THREAD : The target behaviour is entirely described by the call-back function '''cmdReceived()''', 26 26 that is executed when a VCI command packet is received by the target module. … … 30 30 = C) VCI initiator Modeling = 31 31 32 In the proposed example, the initiator module is modeled by the '''my_initiator''' class. This class inherit the '''!BaseModule''' class, that is the basisfor all TLM-T modules. As there is only one thread in this module, there is only one member variable '''m_time''' of type '''tlmt_time''', corresponding to the PDES process local time ('''H''' on the figure). This '''m_time''' object can be accessed through the '''getTime()''', '''addTime()''' and '''setTime()''' methods.32 In the proposed example, the initiator module is modeled by the '''my_initiator''' class. This class inherits from the '''!BaseModule''' class, that acts as the root classe for all TLM-T modules. As there is only one thread in this module, there is only one member variable '''m_time''' of type '''tlmt_time''', corresponding to the PDES process local time ('''H''' on the figure). This '''m_time''' object can be accessed through the '''getTime()''', '''addTime()''' and '''setTime()''' methods. 33 33 34 34 The '''execLoop()''' method, describing the initiator activity must be declared as a member function of the '''my_initiator''' class.