Railcar control system case study - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

Railcar control system case study

Description:

D veloppement coordonn UML 2 / Enterprise JavaBeans Franck.Barbier_at_FranckBarbier.com ... logique dans l'application en veillant attentivement ce que Control center ne ... – PowerPoint PPT presentation

Number of Views:49
Avg rating:3.0/5.0
Slides: 14
Provided by: For54
Category:

less

Transcript and Presenter's Notes

Title: Railcar control system case study


1
Railcar control system case study
  • Franck Barbier
  • Université de Pau et des Pays de lAdour
  • Download www.PauWare.com

2
Railcar control system
3
PIMs, Class Diagram, topology PSMs
4
PIMs, Railcar State Machine Diagram
5
PIMs, Terminal State Machine Diagram
6
PauWare library-based design
  • protected void init_behavior() throws
    Statechart_exception
  • _Busy new Statechart("Busy")
  • _Busy.entryAction(this,"clockwise_ingoing_
    vehicle_stop")
  • _Busy.entryAction(this,"counterclockwise_i
    ngoing_vehicle_stop")
  • _Idle new Statechart("Idle")
  • _Idle.entryAction(this,"unset_my_current_r
    ailcar")
  • _Idle.inputState()
  • protected void start(String terminal) throws
    Statechart_exception
  • _Terminal new Statechart_monitor(_Busy.x
    or(_Idle),terminal,true)
  • Object args new Object1
  • args0 new Long(1000) // value in
    spec. is 30000
  • _Terminal.fires("terminal_stopping",_Busy,
    _Busy,true,this,"to_be_set",args)
  • _Terminal.fires("terminal_stopping",_Busy,
    _Busy,true,this,"my_current_railcar_terminal_stopp
    ing")
  • _Terminal.fires("time_out",_Busy,_Idle,tru
    e,this,"to_be_killed")
  • _Terminal.fires("time_out",_Busy,_Idle,tru
    e,this,"my_current_railcar_go")
  • _Terminal.fires("time_out",_Busy,_Idle,tru
    e,this,"clockwise_ingoing_vehicle_go_on")
  • _Terminal.fires("time_out",_Busy,_Idle,tru
    e,this,"counterclockwise_ingoing_vehicle_go_on")

7
PIMs, Sequence Diagram (partial)
8
PIMs, Communication Diagram
9
PSMs, Class Diagram, situation
10
Proprietary PSM
11
EJB 2.1-compliant PSM
12
Message routing to terminals
  • public class Terminal_event_queueBean implements
    MessageDrivenBean,MessageListener
  • public void onMessage(Message message)
  • ObjectMessage object_message
  • if(message instanceof ObjectMessage)
  • object_message (ObjectMessage)messag
    e
  • try
  • TerminalRailcarIs_clockwise
    message_data (TerminalRailcarIs_clockwise)((Obje
    ctMessage)object_message).getObject()
  • if(message_data._event ! null
    message_data._event.equals("alert100"))
    ((TerminalRemote)message_data._terminal.getEJBObje
    ct()).alert100((TerminalRemote)message_data._termi
    nal.getEJBObject(),(RailcarRemote)message_data._ra
    ilcar.getEJBObject(),message_data._is_clockwise)
  • if(message_data._event ! null
    message_data._event.equals("approaching"))
    ((TerminalRemote)message_data._terminal.getEJBObje
    ct()).approaching((TerminalRemote)message_data._te
    rminal.getEJBObject(),(RailcarRemote)message_data.
    _railcar.getEJBObject(),message_data._is_clockwise
    )
  • if(message_data._event ! null
    message_data._event.equals("terminal_crossing"))
    ((TerminalRemote)message_data._terminal.getEJBObje
    ct()).terminal_crossing((TerminalRemote)message_da
    ta._terminal.getEJBObject(),(RailcarRemote)message
    _data._railcar.getEJBObject(),message_data._is_clo
    ckwise)
  • if(message_data._event ! null
    message_data._event.equals("terminal_stopping"))
    ((TerminalRemote)message_data._terminal.getEJBObje
    ct()).terminal_stopping((TerminalRemote)message_da
    ta._terminal.getEJBObject(),(RailcarRemote)message
    _data._railcar.getEJBObject(),message_data._is_clo
    ckwise)
  • catch(Exception e)
  • throw new RuntimeException(e)

13
Exercice
  • Les propriétés destination board de Railcar et de
    Terminal ne sont pas actuellement utilisées dans
    lapplication
  • Logiquement, Control center émet lévénement
    terminal crossing si le champ destination board
    de Railcar ne contient pas le terminal dont il
    sapproche et si le champ destination board de ce
    même terminal ne contient pas son terminal
    adjacent. Dans le cas contraire, Control center
    doit émettre lévénement terminal stopping
  • Implanter cette logique dans lapplication en
    veillant attentivement à ce que Control center ne
    reçoive des requêtes que dun seul client
Write a Comment
User Comments (0)
About PowerShow.com