diff options
author | Thomas Schuetz | 2013-07-03 19:08:38 +0000 |
---|---|---|
committer | Thomas Schuetz | 2013-07-03 19:22:05 +0000 |
commit | fa61d452478070e0a1eaed6ac473f1e09592818d (patch) | |
tree | 5a55a4a478881244e3a6ecca7f255d110137edf3 | |
parent | 91db51acfec684d1619ee9f5c1e47afc7913df37 (diff) | |
download | org.eclipse.etrice-fa61d452478070e0a1eaed6ac473f1e09592818d.tar.gz org.eclipse.etrice-fa61d452478070e0a1eaed6ac473f1e09592818d.tar.xz org.eclipse.etrice-fa61d452478070e0a1eaed6ac473f1e09592818d.zip |
Revert "[trafficlight.example] removed src-gen to avoid unnecessary check ins and merge conflicts"
This reverts commit b5dde4c072166a42d9bde67f06327bc7b782f126.
14 files changed, 2226 insertions, 11 deletions
diff --git a/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/.gitignore b/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/.gitignore index 4a19dc63d..566b11f8c 100644 --- a/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/.gitignore +++ b/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/.gitignore @@ -1,4 +1,3 @@ bin
doc-gen
src-gen-info
-src-gen
diff --git a/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/model/diagrams/trafficlight.example.TrafficLight.behavior b/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/model/diagrams/trafficlight.example.TrafficLight.behavior index 89a80c363..bb1476751 100644 --- a/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/model/diagrams/trafficlight.example.TrafficLight.behavior +++ b/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/model/diagrams/trafficlight.example.TrafficLight.behavior @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="ASCII"?>
-<pi:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:al="http://eclipse.org/graphiti/mm/algorithms" xmlns:pi="http://eclipse.org/graphiti/mm/pictograms" visible="true" gridUnit="10" diagramTypeId="room.behavior" name="Behavior of TrafficLight" pictogramLinks="//@link //@children.0/@link //@children.0/@children.1/@link //@children.0/@children.2/@link //@children.0/@children.3/@link //@children.0/@children.4/@link //@children.0/@children.5/@link //@children.0/@children.6/@link //@children.1/@link //@children.1/@children.1/@link //@children.0/@children.6/@children.1/@link //@children.1/@children.2/@link //@children.1/@children.3/@link //@connections.0/@link //@connections.1/@link //@connections.2/@link //@connections.3/@link //@connections.4/@link //@connections.5/@link //@connections.6/@link //@connections.7/@link //@children.0/@children.7/@link //@connections.8/@link //@children.0/@children.8/@link //@connections.9/@link //@children.0/@children.9/@link //@connections.10/@link //@connections.11/@link //@connections.12/@link" verticalGridUnit="10" version="0.10.0">
+<pi:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:al="http://eclipse.org/graphiti/mm/algorithms" xmlns:pi="http://eclipse.org/graphiti/mm/pictograms" visible="true" gridUnit="10" diagramTypeId="room.behavior" name="Behavior of TrafficLight" pictogramLinks="//@link //@children.0/@link //@children.0/@children.1/@link //@children.0/@children.2/@link //@children.0/@children.3/@link //@children.0/@children.4/@link //@children.0/@children.5/@link //@children.0/@children.6/@link //@children.1/@link //@children.1/@children.1/@link //@children.0/@children.6/@children.1/@link //@children.1/@children.2/@link //@children.1/@children.3/@link //@connections.0/@link //@connections.1/@link //@connections.2/@link //@connections.3/@link //@connections.4/@link //@connections.5/@link //@connections.6/@link //@connections.7/@link //@children.0/@children.7/@link //@connections.8/@link //@children.0/@children.8/@link //@connections.9/@link //@children.0/@children.9/@link //@connections.10/@link //@connections.11/@link //@connections.12/@link" verticalGridUnit="10" version="0.9.2">
<graphicsAlgorithm xsi:type="al:Rectangle" background="//@colors.1" foreground="//@colors.0" lineWidth="1" transparency="0.0" width="1000" height="1000"/>
<link>
<businessObjects href="../trafficlight.example.room#ActorClass:TrafficLight"/>
diff --git a/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/src-gen/PiModel/Application.java b/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/src-gen/PiModel/Application.java new file mode 100644 index 000000000..ef5a2832c --- /dev/null +++ b/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/src-gen/PiModel/Application.java @@ -0,0 +1,77 @@ +package PiModel; + +import org.eclipse.etrice.runtime.java.messaging.Address; +import org.eclipse.etrice.runtime.java.messaging.IRTObject; +import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver; +import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase; +import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase; +import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase; +import org.eclipse.etrice.runtime.java.debugging.DebuggingService; +import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*; + +import room.basic.service.tcp.*; +import room.basic.service.timing.*; +import trafficlight.connector.*; + +import trafficlight.connector.PMqtt.*; +import room.basic.service.tcp.PTcpControl.*; +import room.basic.service.tcp.PTcpPayload.*; +import room.basic.service.timing.PTimer.*; +import trafficlight.connector.PTrafficLightInterface.*; + + + +public class Application extends ActorClassBase { + + + //--------------------- ports + + //--------------------- saps + + //--------------------- services + + //--------------------- interface item IDs + + /*--------------------- attributes ---------------------*/ + /*--------------------- operations ---------------------*/ + + //--------------------- construction + public Application(IRTObject parent, String name) { + super(parent, name); + setClassName("Application"); + + // initialize attributes + + // own ports + + // own saps + + // own service implementations + + // sub actors + new ATcpClient(this, "tcpIp"); + new TrafficLightInterface(this, "tfIf"); + new Comtroller(this, "controller"); + new MqttWrapperActor(this, "mqtt"); + + } + + /* --------------------- attribute setters and getters */ + + + //--------------------- port getters + + //--------------------- lifecycle functions + public void stop(){ + stopUser(); + super.stop(); + } + + + //--------------------- no state machine + public void receiveEvent(InterfaceItemBase ifitem, int evt, Object data) { + handleSystemEvent(ifitem, evt, data); + } + + public void executeInitTransition() {} +}; diff --git a/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/src-gen/PiModel/Comtroller.java b/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/src-gen/PiModel/Comtroller.java new file mode 100644 index 000000000..4f6cfc869 --- /dev/null +++ b/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/src-gen/PiModel/Comtroller.java @@ -0,0 +1,351 @@ +package PiModel; + +import org.eclipse.etrice.runtime.java.messaging.Address; +import org.eclipse.etrice.runtime.java.messaging.IRTObject; +import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver; +import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase; +import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase; +import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase; +import org.eclipse.etrice.runtime.java.debugging.DebuggingService; +import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*; + +import room.basic.service.timing.*; +import trafficlight.connector.*; + +import trafficlight.connector.PMqtt.*; +import room.basic.service.timing.PTimer.*; +import trafficlight.connector.PTrafficLightInterface.*; + + + +public class Comtroller extends ActorClassBase { + + + //--------------------- ports + protected PTrafficLightInterfaceConjPort traffic = null; + protected PMqttConjPort mqtt = null; + + //--------------------- saps + protected PTimerConjPort timer = null; + + //--------------------- services + + //--------------------- interface item IDs + public static final int IFITEM_traffic = 1; + public static final int IFITEM_mqtt = 2; + public static final int IFITEM_timer = 3; + + /*--------------------- attributes ---------------------*/ + /*--------------------- operations ---------------------*/ + + //--------------------- construction + public Comtroller(IRTObject parent, String name) { + super(parent, name); + setClassName("Comtroller"); + + // initialize attributes + + // own ports + traffic = new PTrafficLightInterfaceConjPort(this, "traffic", IFITEM_traffic); + mqtt = new PMqttConjPort(this, "mqtt", IFITEM_mqtt); + + // own saps + timer = new PTimerConjPort(this, "timer", IFITEM_timer, 0); + + // own service implementations + + // sub actors + + } + + /* --------------------- attribute setters and getters */ + + + //--------------------- port getters + public PTrafficLightInterfaceConjPort getTraffic (){ + return this.traffic; + } + public PMqttConjPort getMqtt (){ + return this.mqtt; + } + public PTimerConjPort getTimer (){ + return this.timer; + } + + //--------------------- lifecycle functions + public void stop(){ + stopUser(); + super.stop(); + } + + + /* state IDs */ + public static final int STATE_Initialized = 2; + public static final int STATE_Initialize = 3; + public static final int STATE_Initialized_On = 4; + public static final int STATE_Initialized_Off = 5; + public static final int STATE_MQTTInit = 6; + public static final int STATE_MAX = 7; + + /* transition chains */ + public static final int CHAIN_Initialized_TRANS_tr1_FROM_On_TO_Off_BY_timeouttimer = 1; + public static final int CHAIN_Initialized_TRANS_tr2_FROM_Off_TO_On_BY_timeouttimer = 2; + public static final int CHAIN_TRANS_INITIAL_TO__MQTTInit = 3; + public static final int CHAIN_TRANS_tr0_FROM_Initialize_TO_Initialized_tp0_BY_initializedtraffic = 4; + public static final int CHAIN_TRANS_tr1_FROM_MQTTInit_TO_Initialize_BY_connectedmqtt = 5; + + /* triggers */ + public static final int POLLING = 0; + public static final int TRIG_mqtt__connected = IFITEM_mqtt + EVT_SHIFT*PMqtt.OUT_connected; + public static final int TRIG_timer__timeout = IFITEM_timer + EVT_SHIFT*PTimer.OUT_timeout; + public static final int TRIG_traffic__initialized = IFITEM_traffic + EVT_SHIFT*PTrafficLightInterface.OUT_initialized; + + // state names + protected static final String stateStrings[] = {"<no state>","<top>","Initialized", + "Initialize", + "Initialized_On", + "Initialized_Off", + "MQTTInit" + }; + + // history + protected int history[] = {NO_STATE,NO_STATE,NO_STATE,NO_STATE,NO_STATE,NO_STATE,NO_STATE}; + + private void setState(int new_state) { + DebuggingService.getInstance().addActorState(this,stateStrings[new_state]); + if (stateStrings[new_state]!="Idle") { + System.out.println("state switch of "+getInstancePath() + ": " + + stateStrings[this.state] + " -> " + stateStrings[new_state]); + } + this.state = new_state; + } + + /* Entry and Exit Codes */ + protected void entry_Initialize() { + traffic.initialize(); + } + protected void entry_Initialized() { + traffic.pedRed(); + mqtt.publish(new DMqttMessage("eTrice/TraaficLight/Controller", "State: Initialized", true, 1)); + } + protected void entry_Initialized_On() { + traffic.pedRed(); + traffic.carRed(); + timer.startTimeout(1000); + } + protected void exit_Initialized_On() { + traffic.pedOff(); + traffic.carOff(); + } + protected void entry_Initialized_Off() { + timer.startTimeout(1000); + } + protected void entry_MQTTInit() { + mqtt.connect(new DMqttConfig("tcp://m2m.eclipse.org:1883", "eTrice-Paho-Tester")); + } + + /* Action Codes */ + + /** + * calls exit codes while exiting from the current state to one of its + * parent states while remembering the history + * @param current - the current state + * @param to - the final parent state + */ + private void exitTo(int current, int to) { + while (current!=to) { + switch (current) { + case STATE_Initialize: + this.history[STATE_TOP] = STATE_Initialize; + current = STATE_TOP; + break; + case STATE_Initialized: + this.history[STATE_TOP] = STATE_Initialized; + current = STATE_TOP; + break; + case STATE_Initialized_On: + exit_Initialized_On(); + this.history[STATE_Initialized] = STATE_Initialized_On; + current = STATE_Initialized; + break; + case STATE_Initialized_Off: + this.history[STATE_Initialized] = STATE_Initialized_Off; + current = STATE_Initialized; + break; + case STATE_MQTTInit: + this.history[STATE_TOP] = STATE_MQTTInit; + current = STATE_TOP; + break; + default: + /* should not occur */ + break; + } + } + } + + /** + * calls action, entry and exit codes along a transition chain. The generic data are cast to typed data + * matching the trigger of this chain. The ID of the final state is returned + * @param chain - the chain ID + * @param generic_data - the generic data pointer + * @return the +/- ID of the final state either with a positive sign, that indicates to execute the state's entry code, or a negative sign vice versa + */ + private int executeTransitionChain(int chain, InterfaceItemBase ifitem, Object generic_data) { + switch (chain) { + case CHAIN_TRANS_INITIAL_TO__MQTTInit: + { + return STATE_MQTTInit; + } + case CHAIN_TRANS_tr0_FROM_Initialize_TO_Initialized_tp0_BY_initializedtraffic: + { + entry_Initialized(); + return STATE_Initialized_On; + } + case CHAIN_TRANS_tr1_FROM_MQTTInit_TO_Initialize_BY_connectedmqtt: + { + return STATE_Initialize; + } + case CHAIN_Initialized_TRANS_tr1_FROM_On_TO_Off_BY_timeouttimer: + { + return STATE_Initialized_Off; + } + case CHAIN_Initialized_TRANS_tr2_FROM_Off_TO_On_BY_timeouttimer: + { + return STATE_Initialized_On; + } + default: + /* should not occur */ + break; + } + return NO_STATE; + } + + /** + * calls entry codes while entering a state's history. The ID of the final leaf state is returned + * @param state - the state which is entered + * @return - the ID of the final leaf state + */ + private int enterHistory(int state) { + boolean skip_entry = false; + if (state >= STATE_MAX) { + state = (state - STATE_MAX); + skip_entry = true; + } + while (true) { + switch (state) { + case STATE_Initialize: + if (!(skip_entry)) entry_Initialize(); + /* in leaf state: return state id */ + return STATE_Initialize; + case STATE_Initialized: + if (!(skip_entry)) entry_Initialized(); + /* state has a sub graph */ + /* without init transition */ + state = this.history[STATE_Initialized]; + break; + case STATE_Initialized_On: + if (!(skip_entry)) entry_Initialized_On(); + /* in leaf state: return state id */ + return STATE_Initialized_On; + case STATE_Initialized_Off: + if (!(skip_entry)) entry_Initialized_Off(); + /* in leaf state: return state id */ + return STATE_Initialized_Off; + case STATE_MQTTInit: + if (!(skip_entry)) entry_MQTTInit(); + /* in leaf state: return state id */ + return STATE_MQTTInit; + case STATE_TOP: + state = this.history[STATE_TOP]; + break; + default: + /* should not occur */ + break; + } + skip_entry = false; + } + /* return NO_STATE; // required by CDT but detected as unreachable by JDT because of while (true) */ + } + + public void executeInitTransition() { + int chain = CHAIN_TRANS_INITIAL_TO__MQTTInit; + int next = executeTransitionChain(chain, null, null); + next = enterHistory(next); + setState(next); + } + + /* receiveEvent contains the main implementation of the FSM */ + public void receiveEvent(InterfaceItemBase ifitem, int evt, Object generic_data) { + int trigger = ifitem.getLocalId() + EVT_SHIFT*evt; + int chain = NOT_CAUGHT; + int catching_state = NO_STATE; + + if (!handleSystemEvent(ifitem, evt, generic_data)) { + switch (getState()) { + case STATE_Initialize: + switch(trigger) { + case TRIG_traffic__initialized: + { + chain = CHAIN_TRANS_tr0_FROM_Initialize_TO_Initialized_tp0_BY_initializedtraffic; + catching_state = STATE_TOP; + } + break; + default: + /* should not occur */ + break; + } + break; + case STATE_Initialized_On: + switch(trigger) { + case TRIG_timer__timeout: + { + chain = CHAIN_Initialized_TRANS_tr1_FROM_On_TO_Off_BY_timeouttimer; + catching_state = STATE_Initialized; + } + break; + default: + /* should not occur */ + break; + } + break; + case STATE_Initialized_Off: + switch(trigger) { + case TRIG_timer__timeout: + { + chain = CHAIN_Initialized_TRANS_tr2_FROM_Off_TO_On_BY_timeouttimer; + catching_state = STATE_Initialized; + } + break; + default: + /* should not occur */ + break; + } + break; + case STATE_MQTTInit: + switch(trigger) { + case TRIG_mqtt__connected: + { + chain = CHAIN_TRANS_tr1_FROM_MQTTInit_TO_Initialize_BY_connectedmqtt; + catching_state = STATE_TOP; + } + break; + default: + /* should not occur */ + break; + } + break; + default: + /* should not occur */ + break; + } + } + if (chain != NOT_CAUGHT) { + exitTo(getState(), catching_state); + { + int next = executeTransitionChain(chain, ifitem, generic_data); + next = enterHistory(next); + setState(next); + } + } + } +}; diff --git a/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/src-gen/PiModel/PiSubSys.java b/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/src-gen/PiModel/PiSubSys.java new file mode 100644 index 000000000..462725efe --- /dev/null +++ b/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/src-gen/PiModel/PiSubSys.java @@ -0,0 +1,82 @@ +package PiModel; + +import org.eclipse.etrice.runtime.java.config.IVariableService; +import org.eclipse.etrice.runtime.java.messaging.IRTObject; +import org.eclipse.etrice.runtime.java.messaging.MessageService; +import org.eclipse.etrice.runtime.java.messaging.MessageServiceController; +import org.eclipse.etrice.runtime.java.messaging.RTServices; +import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase; +import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase; +import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase; + +import room.basic.service.tcp.*; +import room.basic.service.timing.*; +import trafficlight.connector.*; + + +public class PiSubSys extends SubSystemClassBase { + + public final int THREAD__DEFAULT = 0; + public final int THREAD_DEFAULTTHREAD = 1; + + + public PiSubSys(IRTObject parent, String name) { + super(parent, name); + } + + @Override + public void receiveEvent(InterfaceItemBase ifitem, int evt, Object data){ + } + + @Override + public void instantiateMessageServices() { + + RTServices.getInstance().getMsgSvcCtrl().addMsgSvc(new MessageService(this, 0, THREAD__DEFAULT, "MessageService_Main")); + RTServices.getInstance().getMsgSvcCtrl().addMsgSvc(new MessageService(this, 0, THREAD_DEFAULTTHREAD, "MessageService_defaultThread" /*, thread_prio */)); + } + + @Override + public void instantiateActors() { + + MessageServiceController msgSvcCtrl = RTServices.getInstance().getMsgSvcCtrl(); + + // thread mappings + msgSvcCtrl.addPathToThread("/PiSystem/piSubSys", THREAD__DEFAULT); + + // port to peer port mappings + msgSvcCtrl.addPathToPeers("/PiSystem/piSubSys/application/tcpIp/ControlPort", "/PiSystem/piSubSys/application/tfIf/control"); + msgSvcCtrl.addPathToPeers("/PiSystem/piSubSys/application/tcpIp/PayloadPort", "/PiSystem/piSubSys/application/tfIf/payload"); + msgSvcCtrl.addPathToPeers("/PiSystem/piSubSys/application/tfIf/payload", "/PiSystem/piSubSys/application/tcpIp/PayloadPort"); + msgSvcCtrl.addPathToPeers("/PiSystem/piSubSys/application/tfIf/control", "/PiSystem/piSubSys/application/tcpIp/ControlPort"); + msgSvcCtrl.addPathToPeers("/PiSystem/piSubSys/application/tfIf/fct", "/PiSystem/piSubSys/application/controller/traffic"); + msgSvcCtrl.addPathToPeers("/PiSystem/piSubSys/application/controller/traffic", "/PiSystem/piSubSys/application/tfIf/fct"); + msgSvcCtrl.addPathToPeers("/PiSystem/piSubSys/application/controller/mqtt", "/PiSystem/piSubSys/application/mqtt/fct"); + msgSvcCtrl.addPathToPeers("/PiSystem/piSubSys/application/controller/timer", "/PiSystem/piSubSys/timing/timer"); + msgSvcCtrl.addPathToPeers("/PiSystem/piSubSys/application/mqtt/fct", "/PiSystem/piSubSys/application/controller/mqtt"); + msgSvcCtrl.addPathToPeers("/PiSystem/piSubSys/timing/timer", "/PiSystem/piSubSys/application/controller/timer"); + + // sub actors + new Application(this, "application"); + new ATimingService(this, "timing"); + + // apply instance attribute configurations + { + TrafficLightInterface inst = (TrafficLightInterface) getObject("/PiSystem/piSubSys/application/tfIf"); + if (inst!=null) { + inst.getTcpConfig().setIPAddr("192.168.137.1"); + inst.getTcpConfig().setTcpPort(4441); + } + } + } + + @Override + public void init(){ + super.init(); + } + + @Override + public void stop(){ + super.stop(); + } + +}; diff --git a/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/src-gen/PiModel/PiSubSysRunner.java b/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/src-gen/PiModel/PiSubSysRunner.java new file mode 100644 index 000000000..71a4e4779 --- /dev/null +++ b/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/src-gen/PiModel/PiSubSysRunner.java @@ -0,0 +1,26 @@ +/** + * @author generated by eTrice + * + * this class contains the main function running component piSubSys + * it instantiates piSubSys and starts and ends the lifecycle + */ + +package PiModel; + +import org.eclipse.etrice.runtime.java.modelbase.RTSystem; +import org.eclipse.etrice.runtime.java.modelbase.SubSystemRunnerBase; + +class PiSubSysRunner extends SubSystemRunnerBase { + + /** + * main function + * creates the main component and starts and stops the lifecycle + */ + public static void main(String[] args) { + // instantiate the main component + RTSystem sys = new RTSystem("PiSystem"); + PiSubSys main_component = new PiSubSys(sys, "piSubSys"); + + run(main_component, args); + } +}; diff --git a/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/src-gen/readme.txt b/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/src-gen/readme.txt new file mode 100644 index 000000000..c3b99d458 --- /dev/null +++ b/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/src-gen/readme.txt @@ -0,0 +1,4 @@ +This directory is an eTrice code generation target.
+It will be erased every time the generator is executed.
+
+DO NOT PLACE OTHER FILES HERE!
diff --git a/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/src-gen/trafficlight/connector/DMqttConfig.java b/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/src-gen/trafficlight/connector/DMqttConfig.java new file mode 100644 index 000000000..937b501b0 --- /dev/null +++ b/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/src-gen/trafficlight/connector/DMqttConfig.java @@ -0,0 +1,55 @@ +package trafficlight.connector; + +import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*; + + + + +public class DMqttConfig { + + + /*--------------------- attributes ---------------------*/ + String url; + String id; + + /* --------------------- attribute setters and getters */ + public void setUrl (String url) { + this.url = url; + } + public String getUrl () { + return this.url; + } + public void setId (String id) { + this.id = id; + } + public String getId () { + return this.id; + } + + /*--------------------- operations ---------------------*/ + + // default constructor + public DMqttConfig() { + super(); + + // initialize attributes + this.setUrl(""); + this.setId(""); + } + + // constructor using fields + public DMqttConfig(String url, String id) { + super(); + + this.url = url; + this.id = id; + } + + // deep copy + public DMqttConfig deepCopy() { + DMqttConfig copy = new DMqttConfig(); + copy.url = url; + copy.id = id; + return copy; + } +}; diff --git a/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/src-gen/trafficlight/connector/DMqttMessage.java b/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/src-gen/trafficlight/connector/DMqttMessage.java new file mode 100644 index 000000000..bb1d196e6 --- /dev/null +++ b/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/src-gen/trafficlight/connector/DMqttMessage.java @@ -0,0 +1,73 @@ +package trafficlight.connector; + +import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*; + + + + +public class DMqttMessage { + + + /*--------------------- attributes ---------------------*/ + String topic; + String payload; + boolean retained; + int qos; + + /* --------------------- attribute setters and getters */ + public void setTopic (String topic) { + this.topic = topic; + } + public String getTopic () { + return this.topic; + } + public void setPayload (String payload) { + this.payload = payload; + } + public String getPayload () { + return this.payload; + } + public void setRetained (boolean retained) { + this.retained = retained; + } + public boolean getRetained () { + return this.retained; + } + public void setQos (int qos) { + this.qos = qos; + } + public int getQos () { + return this.qos; + } + + /*--------------------- operations ---------------------*/ + + // default constructor + public DMqttMessage() { + super(); + + // initialize attributes + this.setTopic(""); + this.setPayload(""); + } + + // constructor using fields + public DMqttMessage(String topic, String payload, boolean retained, int qos) { + super(); + + this.topic = topic; + this.payload = payload; + this.retained = retained; + this.qos = qos; + } + + // deep copy + public DMqttMessage deepCopy() { + DMqttMessage copy = new DMqttMessage(); + copy.topic = topic; + copy.payload = payload; + copy.retained = retained; + copy.qos = qos; + return copy; + } +}; diff --git a/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/src-gen/trafficlight/connector/MqttWrapperActor.java b/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/src-gen/trafficlight/connector/MqttWrapperActor.java new file mode 100644 index 000000000..c80c15bbb --- /dev/null +++ b/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/src-gen/trafficlight/connector/MqttWrapperActor.java @@ -0,0 +1,286 @@ +package trafficlight.connector; + +import org.eclipse.etrice.runtime.java.messaging.Address; +import org.eclipse.etrice.runtime.java.messaging.IRTObject; +import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver; +import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase; +import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase; +import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase; +import org.eclipse.etrice.runtime.java.debugging.DebuggingService; +import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*; + + +import trafficlight.connector.PMqtt.*; + +/*--------------------- begin user code ---------------------*/ +import de.protos.etrice.automation.m2m.mqtt.*; +/*--------------------- end user code ---------------------*/ + + +public class MqttWrapperActor extends ActorClassBase { + + + //--------------------- ports + protected PMqttPort fct = null; + + //--------------------- saps + + //--------------------- services + + //--------------------- interface item IDs + public static final int IFITEM_fct = 1; + + /*--------------------- attributes ---------------------*/ + MqttWrapper connectionMQTT; + boolean open; + /*--------------------- operations ---------------------*/ + public void MqttWrapperActor_dtor() { + connectionMQTT.disconnect(); + } + + //--------------------- construction + public MqttWrapperActor(IRTObject parent, String name) { + super(parent, name); + setClassName("MqttWrapperActor"); + + // initialize attributes + this.setConnectionMQTT(new MqttWrapper()); + this.setOpen(false); + + // own ports + fct = new PMqttPort(this, "fct", IFITEM_fct); + + // own saps + + // own service implementations + + // sub actors + + } + + /* --------------------- attribute setters and getters */ + public void setConnectionMQTT (MqttWrapper connectionMQTT) { + this.connectionMQTT = connectionMQTT; + } + public MqttWrapper getConnectionMQTT () { + return this.connectionMQTT; + } + public void setOpen (boolean open) { + this.open = open; + } + public boolean getOpen () { + return this.open; + } + + + //--------------------- port getters + public PMqttPort getFct (){ + return this.fct; + } + + //--------------------- lifecycle functions + public void stop(){ + stopUser(); + super.stop(); + } + + public void destroy(){ + MqttWrapperActor_dtor(); + super.destroy(); + } + + /* state IDs */ + public static final int STATE_NotInitialized = 2; + public static final int STATE_Connected = 3; + public static final int STATE_MAX = 4; + + /* transition chains */ + public static final int CHAIN_TRANS_INITIAL_TO__NotInitialized = 1; + public static final int CHAIN_TRANS_tr0_FROM_NotInitialized_TO_cp0_BY_connectfct = 2; + public static final int CHAIN_TRANS_tr3_FROM_Connected_TO_Connected_BY_publishfct_tr3 = 3; + + /* triggers */ + public static final int POLLING = 0; + public static final int TRIG_fct__connect = IFITEM_fct + EVT_SHIFT*PMqtt.IN_connect; + public static final int TRIG_fct__publish = IFITEM_fct + EVT_SHIFT*PMqtt.IN_publish; + + // state names + protected static final String stateStrings[] = {"<no state>","<top>","NotInitialized", + "Connected" + }; + + // history + protected int history[] = {NO_STATE,NO_STATE,NO_STATE,NO_STATE}; + + private void setState(int new_state) { + DebuggingService.getInstance().addActorState(this,stateStrings[new_state]); + if (stateStrings[new_state]!="Idle") { + System.out.println("state switch of "+getInstancePath() + ": " + + stateStrings[this.state] + " -> " + stateStrings[new_state]); + } + this.state = new_state; + } + + /* Entry and Exit Codes */ + + /* Action Codes */ + protected void action_TRANS_tr0_FROM_NotInitialized_TO_cp0_BY_connectfct(InterfaceItemBase ifitem, DMqttConfig config) { + open=false; + connectionMQTT.connect(config.url, config.id); + //connectionMQTT.connect(new DMqttConfig("tcp://m2m.eclipse.org:1883", "eTrice-Paho-Tester")); + open=true; + } + protected void action_TRANS_tr2_FROM_cp0_TO_Connected_COND_tr2(InterfaceItemBase ifitem, DMqttConfig config) { + fct.connected(); + } + protected void action_TRANS_tr3_FROM_Connected_TO_Connected_BY_publishfct_tr3(InterfaceItemBase ifitem, DMqttMessage message) { + connectionMQTT.publishString(message.topic, message.payload, message.retained, message.qos); + } + + /** + * calls exit codes while exiting from the current state to one of its + * parent states while remembering the history + * @param current - the current state + * @param to - the final parent state + */ + private void exitTo(int current, int to) { + while (current!=to) { + switch (current) { + case STATE_NotInitialized: + this.history[STATE_TOP] = STATE_NotInitialized; + current = STATE_TOP; + break; + case STATE_Connected: + this.history[STATE_TOP] = STATE_Connected; + current = STATE_TOP; + break; + default: + /* should not occur */ + break; + } + } + } + + /** + * calls action, entry and exit codes along a transition chain. The generic data are cast to typed data + * matching the trigger of this chain. The ID of the final state is returned + * @param chain - the chain ID + * @param generic_data - the generic data pointer + * @return the +/- ID of the final state either with a positive sign, that indicates to execute the state's entry code, or a negative sign vice versa + */ + private int executeTransitionChain(int chain, InterfaceItemBase ifitem, Object generic_data) { + switch (chain) { + case CHAIN_TRANS_INITIAL_TO__NotInitialized: + { + return STATE_NotInitialized; + } + case CHAIN_TRANS_tr0_FROM_NotInitialized_TO_cp0_BY_connectfct: + { + DMqttConfig config = (DMqttConfig) generic_data; + action_TRANS_tr0_FROM_NotInitialized_TO_cp0_BY_connectfct(ifitem, config); + if (open==true) { + action_TRANS_tr2_FROM_cp0_TO_Connected_COND_tr2(ifitem, config); + return STATE_Connected;} + else { + return STATE_NotInitialized;} + } + case CHAIN_TRANS_tr3_FROM_Connected_TO_Connected_BY_publishfct_tr3: + { + DMqttMessage message = (DMqttMessage) generic_data; + action_TRANS_tr3_FROM_Connected_TO_Connected_BY_publishfct_tr3(ifitem, message); + return STATE_Connected; + } + default: + /* should not occur */ + break; + } + return NO_STATE; + } + + /** + * calls entry codes while entering a state's history. The ID of the final leaf state is returned + * @param state - the state which is entered + * @return - the ID of the final leaf state + */ + private int enterHistory(int state) { + boolean skip_entry = false; + if (state >= STATE_MAX) { + state = (state - STATE_MAX); + skip_entry = true; + } + while (true) { + switch (state) { + case STATE_NotInitialized: + /* in leaf state: return state id */ + return STATE_NotInitialized; + case STATE_Connected: + /* in leaf state: return state id */ + return STATE_Connected; + case STATE_TOP: + state = this.history[STATE_TOP]; + break; + default: + /* should not occur */ + break; + } + skip_entry = false; + } + /* return NO_STATE; // required by CDT but detected as unreachable by JDT because of while (true) */ + } + + public void executeInitTransition() { + int chain = CHAIN_TRANS_INITIAL_TO__NotInitialized; + int next = executeTransitionChain(chain, null, null); + next = enterHistory(next); + setState(next); + } + + /* receiveEvent contains the main implementation of the FSM */ + public void receiveEvent(InterfaceItemBase ifitem, int evt, Object generic_data) { + int trigger = ifitem.getLocalId() + EVT_SHIFT*evt; + int chain = NOT_CAUGHT; + int catching_state = NO_STATE; + + if (!handleSystemEvent(ifitem, evt, generic_data)) { + switch (getState()) { + case STATE_NotInitialized: + switch(trigger) { + case TRIG_fct__connect: + { + chain = CHAIN_TRANS_tr0_FROM_NotInitialized_TO_cp0_BY_connectfct; + catching_state = STATE_TOP; + } + break; + default: + /* should not occur */ + break; + } + break; + case STATE_Connected: + switch(trigger) { + case TRIG_fct__publish: + { + chain = CHAIN_TRANS_tr3_FROM_Connected_TO_Connected_BY_publishfct_tr3; + catching_state = STATE_TOP; + } + break; + default: + /* should not occur */ + break; + } + break; + default: + /* should not occur */ + break; + } + } + if (chain != NOT_CAUGHT) { + exitTo(getState(), catching_state); + { + int next = executeTransitionChain(chain, ifitem, generic_data); + next = enterHistory(next); + setState(next); + } + } + } +}; diff --git a/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/src-gen/trafficlight/connector/PMqtt.java b/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/src-gen/trafficlight/connector/PMqtt.java new file mode 100644 index 000000000..b3a2b48f0 --- /dev/null +++ b/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/src-gen/trafficlight/connector/PMqtt.java @@ -0,0 +1,194 @@ +package trafficlight.connector; + +import org.eclipse.etrice.runtime.java.messaging.Message; +import org.eclipse.etrice.runtime.java.modelbase.EventMessage; +import org.eclipse.etrice.runtime.java.modelbase.EventWithDataMessage; +import org.eclipse.etrice.runtime.java.modelbase.IEventReceiver; +import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase; +import org.eclipse.etrice.runtime.java.modelbase.PortBase; +import org.eclipse.etrice.runtime.java.modelbase.ReplicatedPortBase; +import org.eclipse.etrice.runtime.java.debugging.DebuggingService; +import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*; + + + +public class PMqtt { + // message IDs + public static final int MSG_MIN = 0; + public static final int OUT_connected = 1; + public static final int IN_connect = 2; + public static final int IN_publish = 3; + public static final int MSG_MAX = 4; + + + private static String messageStrings[] = {"MIN", "connected", "connect","publish","MAX"}; + + public String getMessageString(int msg_id) { + if (msg_id<MSG_MIN || msg_id>MSG_MAX+1){ + // id out of range + return "Message ID out of range"; + } + else{ + return messageStrings[msg_id]; + } + } + + + // port class + static public class PMqttPort extends PortBase { + // constructors + public PMqttPort(IEventReceiver actor, String name, int localId) { + this(actor, name, localId, 0); + } + public PMqttPort(IEventReceiver actor, String name, int localId, int idx) { + super(actor, name, localId, idx); + DebuggingService.getInstance().addPortInstance(this); + } + + @Override + public void receive(Message m) { + if (!(m instanceof EventMessage)) + return; + EventMessage msg = (EventMessage) m; + if (0 < msg.getEvtId() && msg.getEvtId() < MSG_MAX) { + if (messageStrings[msg.getEvtId()] != "timerTick"){ + DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]); + } + if (msg instanceof EventWithDataMessage) + getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData()); + else + getActor().receiveEvent(this, msg.getEvtId(), null); + } + } + + + // sent messages + public void connected() { + if (messageStrings[ OUT_connected] != "timerTick") { + DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[OUT_connected]); + } + if (getPeerAddress()!=null) + getPeerMsgReceiver().receive(new EventMessage(getPeerAddress(), OUT_connected)); + } + } + + // replicated port class + static public class PMqttReplPort extends ReplicatedPortBase { + + public PMqttReplPort(IEventReceiver actor, String name, int localId) { + super(actor, name, localId); + } + + public int getReplication() { + return getNInterfaceItems(); + } + + public int getIndexOf(InterfaceItemBase ifitem){ + return ifitem.getIdx(); + } + + public PMqttPort get(int idx) { + return (PMqttPort) getInterfaceItem(idx); + } + + protected InterfaceItemBase createInterfaceItem(IEventReceiver rcv, String name, int lid, int idx) { + return new PMqttPort(rcv, name, lid, idx); + } + + // outgoing messages + public void connected(){ + for (int i=0; i<getReplication(); ++i) { + get(i).connected(); + } + } + } + + + // port class + static public class PMqttConjPort extends PortBase { + // constructors + public PMqttConjPort(IEventReceiver actor, String name, int localId) { + this(actor, name, localId, 0); + } + public PMqttConjPort(IEventReceiver actor, String name, int localId, int idx) { + super(actor, name, localId, idx); + DebuggingService.getInstance().addPortInstance(this); + } + + @Override + public void receive(Message m) { + if (!(m instanceof EventMessage)) + return; + EventMessage msg = (EventMessage) m; + if (0 < msg.getEvtId() && msg.getEvtId() < MSG_MAX) { + if (messageStrings[msg.getEvtId()] != "timerTick"){ + DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]); + } + if (msg instanceof EventWithDataMessage) + getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData()); + else + getActor().receiveEvent(this, msg.getEvtId(), null); + } + } + + + // sent messages + public void connect(DMqttConfig config) { + if (messageStrings[ IN_connect] != "timerTick") { + DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[IN_connect]); + } + if (getPeerAddress()!=null) + getPeerMsgReceiver().receive(new EventWithDataMessage(getPeerAddress(), IN_connect, config.deepCopy())); + } + public void connect(String url, String id) { + connect(new DMqttConfig(url, id)); + } + public void publish(DMqttMessage message) { + if (messageStrings[ IN_publish] != "timerTick") { + DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[IN_publish]); + } + if (getPeerAddress()!=null) + getPeerMsgReceiver().receive(new EventWithDataMessage(getPeerAddress(), IN_publish, message.deepCopy())); + } + public void publish(String topic, String payload, boolean retained, int qos) { + publish(new DMqttMessage(topic, payload, retained, qos)); + } + } + + // replicated port class + static public class PMqttConjReplPort extends ReplicatedPortBase { + + public PMqttConjReplPort(IEventReceiver actor, String name, int localId) { + super(actor, name, localId); + } + + public int getReplication() { + return getNInterfaceItems(); + } + + public int getIndexOf(InterfaceItemBase ifitem){ + return ifitem.getIdx(); + } + + public PMqttConjPort get(int idx) { + return (PMqttConjPort) getInterfaceItem(idx); + } + + protected InterfaceItemBase createInterfaceItem(IEventReceiver rcv, String name, int lid, int idx) { + return new PMqttConjPort(rcv, name, lid, idx); + } + + // incoming messages + public void connect(DMqttConfig config){ + for (int i=0; i<getReplication(); ++i) { + get(i).connect( config); + } + } + public void publish(DMqttMessage message){ + for (int i=0; i<getReplication(); ++i) { + get(i).publish( message); + } + } + } + +} diff --git a/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/src-gen/trafficlight/connector/PTrafficLightInterface.java b/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/src-gen/trafficlight/connector/PTrafficLightInterface.java new file mode 100644 index 000000000..3a6be752d --- /dev/null +++ b/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/src-gen/trafficlight/connector/PTrafficLightInterface.java @@ -0,0 +1,279 @@ +package trafficlight.connector; + +import org.eclipse.etrice.runtime.java.messaging.Message; +import org.eclipse.etrice.runtime.java.modelbase.EventMessage; +import org.eclipse.etrice.runtime.java.modelbase.EventWithDataMessage; +import org.eclipse.etrice.runtime.java.modelbase.IEventReceiver; +import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase; +import org.eclipse.etrice.runtime.java.modelbase.PortBase; +import org.eclipse.etrice.runtime.java.modelbase.ReplicatedPortBase; +import org.eclipse.etrice.runtime.java.debugging.DebuggingService; +import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*; + + + +public class PTrafficLightInterface { + // message IDs + public static final int MSG_MIN = 0; + public static final int OUT_initialized = 1; + public static final int OUT_request = 2; + public static final int IN_initialize = 3; + public static final int IN_pedRed = 4; + public static final int IN_pedGreen = 5; + public static final int IN_pedOff = 6; + public static final int IN_carRed = 7; + public static final int IN_carYellow = 8; + public static final int IN_carGreen = 9; + public static final int IN_carOff = 10; + public static final int MSG_MAX = 11; + + + private static String messageStrings[] = {"MIN", "initialized","request", "initialize","pedRed","pedGreen","pedOff","carRed","carYellow","carGreen","carOff","MAX"}; + + public String getMessageString(int msg_id) { + if (msg_id<MSG_MIN || msg_id>MSG_MAX+1){ + // id out of range + return "Message ID out of range"; + } + else{ + return messageStrings[msg_id]; + } + } + + + // port class + static public class PTrafficLightInterfacePort extends PortBase { + // constructors + public PTrafficLightInterfacePort(IEventReceiver actor, String name, int localId) { + this(actor, name, localId, 0); + } + public PTrafficLightInterfacePort(IEventReceiver actor, String name, int localId, int idx) { + super(actor, name, localId, idx); + DebuggingService.getInstance().addPortInstance(this); + } + + @Override + public void receive(Message m) { + if (!(m instanceof EventMessage)) + return; + EventMessage msg = (EventMessage) m; + if (0 < msg.getEvtId() && msg.getEvtId() < MSG_MAX) { + if (messageStrings[msg.getEvtId()] != "timerTick"){ + DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]); + } + if (msg instanceof EventWithDataMessage) + getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData()); + else + getActor().receiveEvent(this, msg.getEvtId(), null); + } + } + + + // sent messages + public void initialized() { + if (messageStrings[ OUT_initialized] != "timerTick") { + DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[OUT_initialized]); + } + if (getPeerAddress()!=null) + getPeerMsgReceiver().receive(new EventMessage(getPeerAddress(), OUT_initialized)); + } + public void request() { + if (messageStrings[ OUT_request] != "timerTick") { + DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[OUT_request]); + } + if (getPeerAddress()!=null) + getPeerMsgReceiver().receive(new EventMessage(getPeerAddress(), OUT_request)); + } + } + + // replicated port class + static public class PTrafficLightInterfaceReplPort extends ReplicatedPortBase { + + public PTrafficLightInterfaceReplPort(IEventReceiver actor, String name, int localId) { + super(actor, name, localId); + } + + public int getReplication() { + return getNInterfaceItems(); + } + + public int getIndexOf(InterfaceItemBase ifitem){ + return ifitem.getIdx(); + } + + public PTrafficLightInterfacePort get(int idx) { + return (PTrafficLightInterfacePort) getInterfaceItem(idx); + } + + protected InterfaceItemBase createInterfaceItem(IEventReceiver rcv, String name, int lid, int idx) { + return new PTrafficLightInterfacePort(rcv, name, lid, idx); + } + + // outgoing messages + public void initialized(){ + for (int i=0; i<getReplication(); ++i) { + get(i).initialized(); + } + } + public void request(){ + for (int i=0; i<getReplication(); ++i) { + get(i).request(); + } + } + } + + + // port class + static public class PTrafficLightInterfaceConjPort extends PortBase { + // constructors + public PTrafficLightInterfaceConjPort(IEventReceiver actor, String name, int localId) { + this(actor, name, localId, 0); + } + public PTrafficLightInterfaceConjPort(IEventReceiver actor, String name, int localId, int idx) { + super(actor, name, localId, idx); + DebuggingService.getInstance().addPortInstance(this); + } + + @Override + public void receive(Message m) { + if (!(m instanceof EventMessage)) + return; + EventMessage msg = (EventMessage) m; + if (0 < msg.getEvtId() && msg.getEvtId() < MSG_MAX) { + if (messageStrings[msg.getEvtId()] != "timerTick"){ + DebuggingService.getInstance().addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]); + } + if (msg instanceof EventWithDataMessage) + getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage)msg).getData()); + else + getActor().receiveEvent(this, msg.getEvtId(), null); + } + } + + + // sent messages + public void initialize() { + if (messageStrings[ IN_initialize] != "timerTick") { + DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[IN_initialize]); + } + if (getPeerAddress()!=null) + getPeerMsgReceiver().receive(new EventMessage(getPeerAddress(), IN_initialize)); + } + public void pedRed() { + if (messageStrings[ IN_pedRed] != "timerTick") { + DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[IN_pedRed]); + } + if (getPeerAddress()!=null) + getPeerMsgReceiver().receive(new EventMessage(getPeerAddress(), IN_pedRed)); + } + public void pedGreen() { + if (messageStrings[ IN_pedGreen] != "timerTick") { + DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[IN_pedGreen]); + } + if (getPeerAddress()!=null) + getPeerMsgReceiver().receive(new EventMessage(getPeerAddress(), IN_pedGreen)); + } + public void pedOff() { + if (messageStrings[ IN_pedOff] != "timerTick") { + DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[IN_pedOff]); + } + if (getPeerAddress()!=null) + getPeerMsgReceiver().receive(new EventMessage(getPeerAddress(), IN_pedOff)); + } + public void carRed() { + if (messageStrings[ IN_carRed] != "timerTick") { + DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[IN_carRed]); + } + if (getPeerAddress()!=null) + getPeerMsgReceiver().receive(new EventMessage(getPeerAddress(), IN_carRed)); + } + public void carYellow() { + if (messageStrings[ IN_carYellow] != "timerTick") { + DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[IN_carYellow]); + } + if (getPeerAddress()!=null) + getPeerMsgReceiver().receive(new EventMessage(getPeerAddress(), IN_carYellow)); + } + public void carGreen() { + if (messageStrings[ IN_carGreen] != "timerTick") { + DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[IN_carGreen]); + } + if (getPeerAddress()!=null) + getPeerMsgReceiver().receive(new EventMessage(getPeerAddress(), IN_carGreen)); + } + public void carOff() { + if (messageStrings[ IN_carOff] != "timerTick") { + DebuggingService.getInstance().addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[IN_carOff]); + } + if (getPeerAddress()!=null) + getPeerMsgReceiver().receive(new EventMessage(getPeerAddress(), IN_carOff)); + } + } + + // replicated port class + static public class PTrafficLightInterfaceConjReplPort extends ReplicatedPortBase { + + public PTrafficLightInterfaceConjReplPort(IEventReceiver actor, String name, int localId) { + super(actor, name, localId); + } + + public int getReplication() { + return getNInterfaceItems(); + } + + public int getIndexOf(InterfaceItemBase ifitem){ + return ifitem.getIdx(); + } + + public PTrafficLightInterfaceConjPort get(int idx) { + return (PTrafficLightInterfaceConjPort) getInterfaceItem(idx); + } + + protected InterfaceItemBase createInterfaceItem(IEventReceiver rcv, String name, int lid, int idx) { + return new PTrafficLightInterfaceConjPort(rcv, name, lid, idx); + } + + // incoming messages + public void initialize(){ + for (int i=0; i<getReplication(); ++i) { + get(i).initialize(); + } + } + public void pedRed(){ + for (int i=0; i<getReplication(); ++i) { + get(i).pedRed(); + } + } + public void pedGreen(){ + for (int i=0; i<getReplication(); ++i) { + get(i).pedGreen(); + } + } + public void pedOff(){ + for (int i=0; i<getReplication(); ++i) { + get(i).pedOff(); + } + } + public void carRed(){ + for (int i=0; i<getReplication(); ++i) { + get(i).carRed(); + } + } + public void carYellow(){ + for (int i=0; i<getReplication(); ++i) { + get(i).carYellow(); + } + } + public void carGreen(){ + for (int i=0; i<getReplication(); ++i) { + get(i).carGreen(); + } + } + public void carOff(){ + for (int i=0; i<getReplication(); ++i) { + get(i).carOff(); + } + } + } + +} diff --git a/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/src-gen/trafficlight/connector/TrafficLightInterface.java b/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/src-gen/trafficlight/connector/TrafficLightInterface.java new file mode 100644 index 000000000..52d3fbf85 --- /dev/null +++ b/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/src-gen/trafficlight/connector/TrafficLightInterface.java @@ -0,0 +1,419 @@ +package trafficlight.connector; + +import org.eclipse.etrice.runtime.java.messaging.Address; +import org.eclipse.etrice.runtime.java.messaging.IRTObject; +import org.eclipse.etrice.runtime.java.messaging.IMessageReceiver; +import org.eclipse.etrice.runtime.java.modelbase.ActorClassBase; +import org.eclipse.etrice.runtime.java.modelbase.SubSystemClassBase; +import org.eclipse.etrice.runtime.java.modelbase.InterfaceItemBase; +import org.eclipse.etrice.runtime.java.debugging.DebuggingService; +import static org.eclipse.etrice.runtime.java.etunit.EtUnit.*; + +import room.basic.service.tcp.*; + +import room.basic.service.tcp.PTcpControl.*; +import room.basic.service.tcp.PTcpPayload.*; +import trafficlight.connector.PTrafficLightInterface.*; + + + +public class TrafficLightInterface extends ActorClassBase { + + + //--------------------- ports + protected PTcpPayloadConjPort payload = null; + protected PTcpControlConjPort control = null; + protected PTrafficLightInterfacePort fct = null; + + //--------------------- saps + + //--------------------- services + + //--------------------- interface item IDs + public static final int IFITEM_payload = 1; + public static final int IFITEM_control = 2; + public static final int IFITEM_fct = 3; + + /*--------------------- attributes ---------------------*/ + DTcpControl tcpConfig; + /*--------------------- operations ---------------------*/ + public void sendString(String data) { + payload.send(new DTcpPayload(1, data.length(), data.getBytes())); + } + + //--------------------- construction + public TrafficLightInterface(IRTObject parent, String name) { + super(parent, name); + setClassName("TrafficLightInterface"); + + // initialize attributes + this.setTcpConfig(new DTcpControl()); + + // own ports + payload = new PTcpPayloadConjPort(this, "payload", IFITEM_payload); + control = new PTcpControlConjPort(this, "control", IFITEM_control); + fct = new PTrafficLightInterfacePort(this, "fct", IFITEM_fct); + + // own saps + + // own service implementations + + // sub actors + + } + + /* --------------------- attribute setters and getters */ + public void setTcpConfig (DTcpControl tcpConfig) { + this.tcpConfig = tcpConfig; + } + public DTcpControl getTcpConfig () { + return this.tcpConfig; + } + + + //--------------------- port getters + public PTcpPayloadConjPort getPayload (){ + return this.payload; + } + public PTcpControlConjPort getControl (){ + return this.control; + } + public PTrafficLightInterfacePort getFct (){ + return this.fct; + } + + //--------------------- lifecycle functions + public void stop(){ + stopUser(); + super.stop(); + } + + + /* state IDs */ + public static final int STATE_Uninitialized = 2; + public static final int STATE_Initializing = 3; + public static final int STATE_Running = 4; + public static final int STATE_MAX = 5; + + /* transition chains */ + public static final int CHAIN_TRANS_INITIAL_TO__Uninitialized = 1; + public static final int CHAIN_TRANS_tr0_FROM_Uninitialized_TO_Initializing_BY_initializefct = 2; + public static final int CHAIN_TRANS_tr1_FROM_Initializing_TO_Running_BY_establishedcontrol = 3; + public static final int CHAIN_TRANS_tr2_FROM_Running_TO_Running_BY_pedRedfct_tr2 = 4; + public static final int CHAIN_TRANS_tr3_FROM_Running_TO_Running_BY_pedOfffct_tr3 = 5; + public static final int CHAIN_TRANS_tr4_FROM_Running_TO_Running_BY_pedGreenfct_tr4 = 6; + public static final int CHAIN_TRANS_tr5_FROM_Running_TO_Running_BY_carRedfct_tr5 = 7; + public static final int CHAIN_TRANS_tr6_FROM_Running_TO_Running_BY_carYellowfct_tr6 = 8; + public static final int CHAIN_TRANS_tr7_FROM_Running_TO_Running_BY_carGreenfct_tr7 = 9; + public static final int CHAIN_TRANS_tr8_FROM_Running_TO_Running_BY_carOfffct_tr8 = 10; + public static final int CHAIN_TRANS_tr9_FROM_Running_TO_Running_BY_receivepayload_tr9 = 11; + + /* triggers */ + public static final int POLLING = 0; + public static final int TRIG_control__established = IFITEM_control + EVT_SHIFT*PTcpControl.OUT_established; + public static final int TRIG_fct__carGreen = IFITEM_fct + EVT_SHIFT*PTrafficLightInterface.IN_carGreen; + public static final int TRIG_fct__carOff = IFITEM_fct + EVT_SHIFT*PTrafficLightInterface.IN_carOff; + public static final int TRIG_fct__carRed = IFITEM_fct + EVT_SHIFT*PTrafficLightInterface.IN_carRed; + public static final int TRIG_fct__carYellow = IFITEM_fct + EVT_SHIFT*PTrafficLightInterface.IN_carYellow; + public static final int TRIG_fct__initialize = IFITEM_fct + EVT_SHIFT*PTrafficLightInterface.IN_initialize; + public static final int TRIG_fct__pedGreen = IFITEM_fct + EVT_SHIFT*PTrafficLightInterface.IN_pedGreen; + public static final int TRIG_fct__pedOff = IFITEM_fct + EVT_SHIFT*PTrafficLightInterface.IN_pedOff; + public static final int TRIG_fct__pedRed = IFITEM_fct + EVT_SHIFT*PTrafficLightInterface.IN_pedRed; + public static final int TRIG_payload__receive = IFITEM_payload + EVT_SHIFT*PTcpPayload.OUT_receive; + + // state names + protected static final String stateStrings[] = {"<no state>","<top>","Uninitialized", + "Initializing", + "Running" + }; + + // history + protected int history[] = {NO_STATE,NO_STATE,NO_STATE,NO_STATE,NO_STATE}; + + private void setState(int new_state) { + DebuggingService.getInstance().addActorState(this,stateStrings[new_state]); + if (stateStrings[new_state]!="Idle") { + System.out.println("state switch of "+getInstancePath() + ": " + + stateStrings[this.state] + " -> " + stateStrings[new_state]); + } + this.state = new_state; + } + + /* Entry and Exit Codes */ + + /* Action Codes */ + protected void action_TRANS_tr0_FROM_Uninitialized_TO_Initializing_BY_initializefct(InterfaceItemBase ifitem) { + control.open(tcpConfig); + } + protected void action_TRANS_tr1_FROM_Initializing_TO_Running_BY_establishedcontrol(InterfaceItemBase ifitem) { + fct.initialized(); + } + protected void action_TRANS_tr2_FROM_Running_TO_Running_BY_pedRedfct_tr2(InterfaceItemBase ifitem) { + sendString(new String("pedLights=red\n")); + } + protected void action_TRANS_tr3_FROM_Running_TO_Running_BY_pedOfffct_tr3(InterfaceItemBase ifitem) { + sendString(new String("pedLights=off\n")); + } + protected void action_TRANS_tr4_FROM_Running_TO_Running_BY_pedGreenfct_tr4(InterfaceItemBase ifitem) { + sendString(new String("pedLights=green\n")); + } + protected void action_TRANS_tr5_FROM_Running_TO_Running_BY_carRedfct_tr5(InterfaceItemBase ifitem) { + sendString(new String("carLights=red\n")); + } + protected void action_TRANS_tr6_FROM_Running_TO_Running_BY_carYellowfct_tr6(InterfaceItemBase ifitem) { + sendString(new String("carLights=yellow\n")); + } + protected void action_TRANS_tr7_FROM_Running_TO_Running_BY_carGreenfct_tr7(InterfaceItemBase ifitem) { + sendString(new String("carLights=green\n")); + } + protected void action_TRANS_tr8_FROM_Running_TO_Running_BY_carOfffct_tr8(InterfaceItemBase ifitem) { + sendString(new String("carLights=off\n")); + } + protected void action_TRANS_tr9_FROM_Running_TO_Running_BY_receivepayload_tr9(InterfaceItemBase ifitem, DTcpPayload data) { + fct.request(); + } + + /** + * calls exit codes while exiting from the current state to one of its + * parent states while remembering the history + * @param current - the current state + * @param to - the final parent state + */ + private void exitTo(int current, int to) { + while (current!=to) { + switch (current) { + case STATE_Uninitialized: + this.history[STATE_TOP] = STATE_Uninitialized; + current = STATE_TOP; + break; + case STATE_Initializing: + this.history[STATE_TOP] = STATE_Initializing; + current = STATE_TOP; + break; + case STATE_Running: + this.history[STATE_TOP] = STATE_Running; + current = STATE_TOP; + break; + default: + /* should not occur */ + break; + } + } + } + + /** + * calls action, entry and exit codes along a transition chain. The generic data are cast to typed data + * matching the trigger of this chain. The ID of the final state is returned + * @param chain - the chain ID + * @param generic_data - the generic data pointer + * @return the +/- ID of the final state either with a positive sign, that indicates to execute the state's entry code, or a negative sign vice versa + */ + private int executeTransitionChain(int chain, InterfaceItemBase ifitem, Object generic_data) { + switch (chain) { + case CHAIN_TRANS_INITIAL_TO__Uninitialized: + { + return STATE_Uninitialized; + } + case CHAIN_TRANS_tr0_FROM_Uninitialized_TO_Initializing_BY_initializefct: + { + action_TRANS_tr0_FROM_Uninitialized_TO_Initializing_BY_initializefct(ifitem); + return STATE_Initializing; + } + case CHAIN_TRANS_tr1_FROM_Initializing_TO_Running_BY_establishedcontrol: + { + action_TRANS_tr1_FROM_Initializing_TO_Running_BY_establishedcontrol(ifitem); + return STATE_Running; + } + case CHAIN_TRANS_tr2_FROM_Running_TO_Running_BY_pedRedfct_tr2: + { + action_TRANS_tr2_FROM_Running_TO_Running_BY_pedRedfct_tr2(ifitem); + return STATE_Running; + } + case CHAIN_TRANS_tr3_FROM_Running_TO_Running_BY_pedOfffct_tr3: + { + action_TRANS_tr3_FROM_Running_TO_Running_BY_pedOfffct_tr3(ifitem); + return STATE_Running; + } + case CHAIN_TRANS_tr4_FROM_Running_TO_Running_BY_pedGreenfct_tr4: + { + action_TRANS_tr4_FROM_Running_TO_Running_BY_pedGreenfct_tr4(ifitem); + return STATE_Running; + } + case CHAIN_TRANS_tr5_FROM_Running_TO_Running_BY_carRedfct_tr5: + { + action_TRANS_tr5_FROM_Running_TO_Running_BY_carRedfct_tr5(ifitem); + return STATE_Running; + } + case CHAIN_TRANS_tr6_FROM_Running_TO_Running_BY_carYellowfct_tr6: + { + action_TRANS_tr6_FROM_Running_TO_Running_BY_carYellowfct_tr6(ifitem); + return STATE_Running; + } + case CHAIN_TRANS_tr7_FROM_Running_TO_Running_BY_carGreenfct_tr7: + { + action_TRANS_tr7_FROM_Running_TO_Running_BY_carGreenfct_tr7(ifitem); + return STATE_Running; + } + case CHAIN_TRANS_tr8_FROM_Running_TO_Running_BY_carOfffct_tr8: + { + action_TRANS_tr8_FROM_Running_TO_Running_BY_carOfffct_tr8(ifitem); + return STATE_Running; + } + case CHAIN_TRANS_tr9_FROM_Running_TO_Running_BY_receivepayload_tr9: + { + DTcpPayload data = (DTcpPayload) generic_data; + action_TRANS_tr9_FROM_Running_TO_Running_BY_receivepayload_tr9(ifitem, data); + return STATE_Running; + } + default: + /* should not occur */ + break; + } + return NO_STATE; + } + + /** + * calls entry codes while entering a state's history. The ID of the final leaf state is returned + * @param state - the state which is entered + * @return - the ID of the final leaf state + */ + private int enterHistory(int state) { + boolean skip_entry = false; + if (state >= STATE_MAX) { + state = (state - STATE_MAX); + skip_entry = true; + } + while (true) { + switch (state) { + case STATE_Uninitialized: + /* in leaf state: return state id */ + return STATE_Uninitialized; + case STATE_Initializing: + /* in leaf state: return state id */ + return STATE_Initializing; + case STATE_Running: + /* in leaf state: return state id */ + return STATE_Running; + case STATE_TOP: + state = this.history[STATE_TOP]; + break; + default: + /* should not occur */ + break; + } + skip_entry = false; + } + /* return NO_STATE; // required by CDT but detected as unreachable by JDT because of while (true) */ + } + + public void executeInitTransition() { + int chain = CHAIN_TRANS_INITIAL_TO__Uninitialized; + int next = executeTransitionChain(chain, null, null); + next = enterHistory(next); + setState(next); + } + + /* receiveEvent contains the main implementation of the FSM */ + public void receiveEvent(InterfaceItemBase ifitem, int evt, Object generic_data) { + int trigger = ifitem.getLocalId() + EVT_SHIFT*evt; + int chain = NOT_CAUGHT; + int catching_state = NO_STATE; + + if (!handleSystemEvent(ifitem, evt, generic_data)) { + switch (getState()) { + case STATE_Uninitialized: + switch(trigger) { + case TRIG_fct__initialize: + { + chain = CHAIN_TRANS_tr0_FROM_Uninitialized_TO_Initializing_BY_initializefct; + catching_state = STATE_TOP; + } + break; + default: + /* should not occur */ + break; + } + break; + case STATE_Initializing: + switch(trigger) { + case TRIG_control__established: + { + chain = CHAIN_TRANS_tr1_FROM_Initializing_TO_Running_BY_establishedcontrol; + catching_state = STATE_TOP; + } + break; + default: + /* should not occur */ + break; + } + break; + case STATE_Running: + switch(trigger) { + case TRIG_fct__pedRed: + { + chain = CHAIN_TRANS_tr2_FROM_Running_TO_Running_BY_pedRedfct_tr2; + catching_state = STATE_TOP; + } + break; + case TRIG_fct__pedOff: + { + chain = CHAIN_TRANS_tr3_FROM_Running_TO_Running_BY_pedOfffct_tr3; + catching_state = STATE_TOP; + } + break; + case TRIG_fct__pedGreen: + { + chain = CHAIN_TRANS_tr4_FROM_Running_TO_Running_BY_pedGreenfct_tr4; + catching_state = STATE_TOP; + } + break; + case TRIG_fct__carRed: + { + chain = CHAIN_TRANS_tr5_FROM_Running_TO_Running_BY_carRedfct_tr5; + catching_state = STATE_TOP; + } + break; + case TRIG_fct__carYellow: + { + chain = CHAIN_TRANS_tr6_FROM_Running_TO_Running_BY_carYellowfct_tr6; + catching_state = STATE_TOP; + } + break; + case TRIG_fct__carGreen: + { + chain = CHAIN_TRANS_tr7_FROM_Running_TO_Running_BY_carGreenfct_tr7; + catching_state = STATE_TOP; + } + break; + case TRIG_fct__carOff: + { + chain = CHAIN_TRANS_tr8_FROM_Running_TO_Running_BY_carOfffct_tr8; + catching_state = STATE_TOP; + } + break; + case TRIG_payload__receive: + { + chain = CHAIN_TRANS_tr9_FROM_Running_TO_Running_BY_receivepayload_tr9; + catching_state = STATE_TOP; + } + break; + default: + /* should not occur */ + break; + } + break; + default: + /* should not occur */ + break; + } + } + if (chain != NOT_CAUGHT) { + exitTo(getState(), catching_state); + { + int next = executeTransitionChain(chain, ifitem, generic_data); + next = enterHistory(next); + setState(next); + } + } + } +}; diff --git a/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/tmp/log/main_Async.seq b/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/tmp/log/main_Async.seq index bd20d1b85..007b0e935 100644 --- a/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/tmp/log/main_Async.seq +++ b/examples/org.eclipse.etrice.tutorials.simulators.trafficlight.example/tmp/log/main_Async.seq @@ -36,8 +36,8 @@ /LSTraffic/main/application/light2 --> /LSTraffic/main/TimingService internalStartTimeout
/LSTraffic/main/TimingService >>> Operational
/LSTraffic/main/TimingService >-- /LSTraffic/main/application/light1 internalTimeout
- /LSTraffic/main/TimingService --> /LSTraffic/main/application/light1 internalTimeout
/LSTraffic/main/TimingService >-- /LSTraffic/main/application/light2 internalTimeout
+ /LSTraffic/main/TimingService --> /LSTraffic/main/application/light1 internalTimeout
/LSTraffic/main/application/light1 >-- /LSTraffic/main/application/light1/trafficLightSocket send
/LSTraffic/main/application/light1 >-- /LSTraffic/main/application/light1/trafficLightSocket send
/LSTraffic/main/application/light1 >>> Off_Blinking_Off
@@ -124,6 +124,7 @@ /LSTraffic/main/application/light2 --> /LSTraffic/main/TimingService internalStartTimeout
/LSTraffic/main/TimingService >>> Operational
/LSTraffic/main/TimingService >-- /LSTraffic/main/application/light1 internalTimeout
+ /LSTraffic/main/TimingService >-- /LSTraffic/main/application/light2 internalTimeout
/LSTraffic/main/TimingService --> /LSTraffic/main/application/light1 internalTimeout
/LSTraffic/main/application/light1 >-- /LSTraffic/main/application/light1/trafficLightSocket send
/LSTraffic/main/application/light1 >-- /LSTraffic/main/application/light1/trafficLightSocket send
@@ -134,7 +135,6 @@ /LSTraffic/main/application/light1/trafficLightSocket >>> opened
/LSTraffic/main/application/light1 --> /LSTraffic/main/TimingService internalStartTimeout
/LSTraffic/main/TimingService >>> Operational
- /LSTraffic/main/TimingService >-- /LSTraffic/main/application/light2 internalTimeout
/LSTraffic/main/TimingService --> /LSTraffic/main/application/light2 internalTimeout
/LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
/LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
@@ -146,61 +146,431 @@ /LSTraffic/main/application/light2 --> /LSTraffic/main/TimingService internalStartTimeout
/LSTraffic/main/TimingService >>> Operational
/LSTraffic/main/TimingService >-- /LSTraffic/main/application/controller internalTimeout
- /LSTraffic/main/TimingService >-- /LSTraffic/main/application/light1 internalTimeout
/LSTraffic/main/TimingService --> /LSTraffic/main/application/controller internalTimeout
/LSTraffic/main/application/controller >-- /LSTraffic/main/application/light1 greenForCar
/LSTraffic/main/application/controller >-- /LSTraffic/main/application/light2 greenForPed
/LSTraffic/main/application/controller >>> SwitchToLight1GreenForCars
+ /LSTraffic/main/application/controller --> /LSTraffic/main/application/light1 greenForCar
+ /LSTraffic/main/application/light1 >-- /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1 >-- /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1 >>> PedRed
+ /LSTraffic/main/application/controller --> /LSTraffic/main/application/light2 greenForPed
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >>> CarYellow2
+ /LSTraffic/main/application/light1 --> /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light1 --> /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light1 --> /LSTraffic/main/TimingService internalStartTimeout
+ /LSTraffic/main/TimingService >>> Operational
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/TimingService internalStartTimeout
+ /LSTraffic/main/TimingService >>> Operational
+ /LSTraffic/main/TimingService >-- /LSTraffic/main/application/light2 internalTimeout
+ /LSTraffic/main/TimingService >-- /LSTraffic/main/application/light1 internalTimeout
+ /LSTraffic/main/TimingService --> /LSTraffic/main/application/light2 internalTimeout
+ /LSTraffic/main/TimingService --> /LSTraffic/main/application/light1 internalTimeout
+ /LSTraffic/main/TimingService >-- /LSTraffic/main/application/light1 internalTimeout
+ /LSTraffic/main/TimingService >-- /LSTraffic/main/application/light2 internalTimeout
/LSTraffic/main/TimingService --> /LSTraffic/main/application/light1 internalTimeout
/LSTraffic/main/application/light1 >-- /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1 >>> CarYellow
+ /LSTraffic/main/TimingService --> /LSTraffic/main/application/light2 internalTimeout
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >>> CarRed
+ /LSTraffic/main/application/light1 --> /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light1 --> /LSTraffic/main/TimingService internalStartTimeout
+ /LSTraffic/main/TimingService >>> Operational
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/TimingService internalStartTimeout
+ /LSTraffic/main/TimingService >>> Operational
+ /LSTraffic/main/TimingService >-- /LSTraffic/main/application/light1 internalTimeout
+ /LSTraffic/main/TimingService >-- /LSTraffic/main/application/light2 internalTimeout
+ /LSTraffic/main/TimingService --> /LSTraffic/main/application/light1 internalTimeout
+ /LSTraffic/main/application/light1 >-- /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1 >-- /LSTraffic/main/application/controller greenForCarDone
+ /LSTraffic/main/application/light1 >>> CarGreen
+ /LSTraffic/main/application/light1 --> /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light1 --> /LSTraffic/main/application/controller greenForCarDone
+ /LSTraffic/main/application/controller >>> state0
+ /LSTraffic/main/TimingService --> /LSTraffic/main/application/light2 internalTimeout
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/controller greenForPedDone
+ /LSTraffic/main/application/light2 >>> PedGreen
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/controller greenForPedDone
+ /LSTraffic/main/application/controller >>> Light1GreenForCars
+ /LSTraffic/main/application/controller --> /LSTraffic/main/TimingService internalStartTimeout
+ /LSTraffic/main/TimingService >>> Operational
+ /LSTraffic/main/application/light2/trafficLightSocket >-- /LSTraffic/main/application/light2 receive
+ /LSTraffic/main/application/light2/trafficLightSocket --> /LSTraffic/main/application/light2 receive
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >>> Off_Blinking_On
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/TimingService internalStartTimeout
+ /LSTraffic/main/TimingService >>> Operational
+ /LSTraffic/main/TimingService >-- /LSTraffic/main/application/light2 internalTimeout
+ /LSTraffic/main/TimingService --> /LSTraffic/main/application/light2 internalTimeout
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >>> Off_Blinking_Off
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/TimingService internalStartTimeout
+ /LSTraffic/main/TimingService >>> Operational
+ /LSTraffic/main/TimingService >-- /LSTraffic/main/application/light2 internalTimeout
+ /LSTraffic/main/TimingService --> /LSTraffic/main/application/light2 internalTimeout
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >>> Off_Blinking_On
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/TimingService internalStartTimeout
+ /LSTraffic/main/TimingService >>> Operational
+ /LSTraffic/main/TimingService >-- /LSTraffic/main/application/light2 internalTimeout
+ /LSTraffic/main/TimingService --> /LSTraffic/main/application/light2 internalTimeout
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >>> Off_Blinking_Off
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/TimingService internalStartTimeout
+ /LSTraffic/main/TimingService >>> Operational
+ /LSTraffic/main/TimingService >-- /LSTraffic/main/application/light2 internalTimeout
+ /LSTraffic/main/TimingService --> /LSTraffic/main/application/light2 internalTimeout
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >>> Off_Blinking_On
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/TimingService internalStartTimeout
+ /LSTraffic/main/TimingService >>> Operational
+ /LSTraffic/main/application/light1/trafficLightSocket >-- /LSTraffic/main/application/light1 receive
+ /LSTraffic/main/application/light1/trafficLightSocket --> /LSTraffic/main/application/light1 receive
+ /LSTraffic/main/application/light1 >-- /LSTraffic/main/application/light1/trafficLightSocket send
/LSTraffic/main/application/light1 >-- /LSTraffic/main/application/light1/trafficLightSocket send
/LSTraffic/main/application/light1 >>> Off_Blinking_On
- /LSTraffic/main/application/controller --> /LSTraffic/main/application/light1 greenForCar
+ /LSTraffic/main/application/light1 --> /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light1 --> /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light1 --> /LSTraffic/main/TimingService internalStartTimeout
+ /LSTraffic/main/TimingService >>> Operational
+ /LSTraffic/main/TimingService >-- /LSTraffic/main/application/light2 internalTimeout
+ /LSTraffic/main/TimingService --> /LSTraffic/main/application/light2 internalTimeout
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >>> Off_Blinking_Off
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/TimingService internalStartTimeout
+ /LSTraffic/main/TimingService >>> Operational
+ /LSTraffic/main/TimingService >-- /LSTraffic/main/application/light1 internalTimeout
+ /LSTraffic/main/TimingService --> /LSTraffic/main/application/light1 internalTimeout
/LSTraffic/main/application/light1 >-- /LSTraffic/main/application/light1/trafficLightSocket send
/LSTraffic/main/application/light1 >-- /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1 >>> Off_Blinking_Off
+ /LSTraffic/main/application/light1 --> /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light1 --> /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light1 --> /LSTraffic/main/TimingService internalStartTimeout
+ /LSTraffic/main/TimingService >>> Operational
+ /LSTraffic/main/TimingService >-- /LSTraffic/main/application/light2 internalTimeout
+ /LSTraffic/main/TimingService --> /LSTraffic/main/application/light2 internalTimeout
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >>> Off_Blinking_On
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/TimingService internalStartTimeout
+ /LSTraffic/main/TimingService >>> Operational
+ /LSTraffic/main/TimingService >-- /LSTraffic/main/application/light1 internalTimeout
+ /LSTraffic/main/TimingService --> /LSTraffic/main/application/light1 internalTimeout
/LSTraffic/main/application/light1 >-- /LSTraffic/main/application/light1/trafficLightSocket send
/LSTraffic/main/application/light1 >-- /LSTraffic/main/application/light1/trafficLightSocket send
- /LSTraffic/main/application/light1 >>> PedRed
- /LSTraffic/main/application/controller --> /LSTraffic/main/application/light2 greenForPed
+ /LSTraffic/main/application/light1 >>> Off_Blinking_On
+ /LSTraffic/main/application/light1 --> /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light1 --> /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light1 --> /LSTraffic/main/TimingService internalStartTimeout
+ /LSTraffic/main/TimingService >>> Operational
+ /LSTraffic/main/TimingService >-- /LSTraffic/main/application/light2 internalTimeout
+ /LSTraffic/main/TimingService --> /LSTraffic/main/application/light2 internalTimeout
/LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
- /LSTraffic/main/application/light2 >>> CarYellow2
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >>> Off_Blinking_Off
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/TimingService internalStartTimeout
+ /LSTraffic/main/TimingService >>> Operational
+ /LSTraffic/main/TimingService >-- /LSTraffic/main/application/light1 internalTimeout
+ /LSTraffic/main/TimingService --> /LSTraffic/main/application/light1 internalTimeout
+ /LSTraffic/main/application/light1 >-- /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1 >-- /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1 >>> Off_Blinking_Off
/LSTraffic/main/application/light1 --> /LSTraffic/main/application/light1/trafficLightSocket send
/LSTraffic/main/application/light1/trafficLightSocket >>> opened
/LSTraffic/main/application/light1 --> /LSTraffic/main/application/light1/trafficLightSocket send
/LSTraffic/main/application/light1/trafficLightSocket >>> opened
/LSTraffic/main/application/light1 --> /LSTraffic/main/TimingService internalStartTimeout
/LSTraffic/main/TimingService >>> Operational
+ /LSTraffic/main/TimingService >-- /LSTraffic/main/application/light2 internalTimeout
+ /LSTraffic/main/TimingService --> /LSTraffic/main/application/light2 internalTimeout
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >>> Off_Blinking_On
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/TimingService internalStartTimeout
+ /LSTraffic/main/TimingService >>> Operational
+ /LSTraffic/main/TimingService >-- /LSTraffic/main/application/light1 internalTimeout
+ /LSTraffic/main/TimingService --> /LSTraffic/main/application/light1 internalTimeout
+ /LSTraffic/main/application/light1 >-- /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1 >-- /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1 >>> Off_Blinking_On
/LSTraffic/main/application/light1 --> /LSTraffic/main/application/light1/trafficLightSocket send
/LSTraffic/main/application/light1/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light1 --> /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light1 --> /LSTraffic/main/TimingService internalStartTimeout
+ /LSTraffic/main/TimingService >>> Operational
/LSTraffic/main/TimingService >-- /LSTraffic/main/application/light2 internalTimeout
+ /LSTraffic/main/TimingService --> /LSTraffic/main/application/light2 internalTimeout
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >>> Off_Blinking_Off
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/TimingService internalStartTimeout
+ /LSTraffic/main/TimingService >>> Operational
+ /LSTraffic/main/TimingService >-- /LSTraffic/main/application/light1 internalTimeout
+ /LSTraffic/main/TimingService --> /LSTraffic/main/application/light1 internalTimeout
+ /LSTraffic/main/application/light1 >-- /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1 >-- /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1 >>> Off_Blinking_Off
+ /LSTraffic/main/application/light1 --> /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1/trafficLightSocket >>> opened
/LSTraffic/main/application/light1 --> /LSTraffic/main/application/light1/trafficLightSocket send
/LSTraffic/main/application/light1/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light1 --> /LSTraffic/main/TimingService internalStartTimeout
+ /LSTraffic/main/TimingService >>> Operational
+ /LSTraffic/main/TimingService >-- /LSTraffic/main/application/light2 internalTimeout
+ /LSTraffic/main/TimingService --> /LSTraffic/main/application/light2 internalTimeout
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >>> Off_Blinking_On
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/TimingService internalStartTimeout
+ /LSTraffic/main/TimingService >>> Operational
+ /LSTraffic/main/TimingService >-- /LSTraffic/main/application/light1 internalTimeout
+ /LSTraffic/main/TimingService --> /LSTraffic/main/application/light1 internalTimeout
+ /LSTraffic/main/application/light1 >-- /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1 >-- /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1 >>> Off_Blinking_On
/LSTraffic/main/application/light1 --> /LSTraffic/main/application/light1/trafficLightSocket send
/LSTraffic/main/application/light1/trafficLightSocket >>> opened
/LSTraffic/main/application/light1 --> /LSTraffic/main/application/light1/trafficLightSocket send
/LSTraffic/main/application/light1/trafficLightSocket >>> opened
/LSTraffic/main/application/light1 --> /LSTraffic/main/TimingService internalStartTimeout
/LSTraffic/main/TimingService >>> Operational
+ /LSTraffic/main/TimingService >-- /LSTraffic/main/application/light2 internalTimeout
+ /LSTraffic/main/TimingService --> /LSTraffic/main/application/light2 internalTimeout
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >>> Off_Blinking_Off
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
/LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
/LSTraffic/main/application/light2/trafficLightSocket >>> opened
/LSTraffic/main/application/light2 --> /LSTraffic/main/TimingService internalStartTimeout
/LSTraffic/main/TimingService >>> Operational
+ /LSTraffic/main/TimingService >-- /LSTraffic/main/application/light1 internalTimeout
+ /LSTraffic/main/TimingService --> /LSTraffic/main/application/light1 internalTimeout
+ /LSTraffic/main/application/light1 >-- /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1 >-- /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1 >>> Off_Blinking_Off
+ /LSTraffic/main/application/light1 --> /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light1 --> /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light1 --> /LSTraffic/main/TimingService internalStartTimeout
+ /LSTraffic/main/TimingService >>> Operational
+ /LSTraffic/main/TimingService >-- /LSTraffic/main/application/light2 internalTimeout
/LSTraffic/main/TimingService --> /LSTraffic/main/application/light2 internalTimeout
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >>> Off_Blinking_On
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/TimingService internalStartTimeout
+ /LSTraffic/main/TimingService >>> Operational
/LSTraffic/main/TimingService >-- /LSTraffic/main/application/light1 internalTimeout
/LSTraffic/main/TimingService --> /LSTraffic/main/application/light1 internalTimeout
+ /LSTraffic/main/application/light1 >-- /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1 >-- /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1 >>> Off_Blinking_On
+ /LSTraffic/main/application/light1 --> /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light1 --> /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light1 --> /LSTraffic/main/TimingService internalStartTimeout
+ /LSTraffic/main/TimingService >>> Operational
/LSTraffic/main/TimingService >-- /LSTraffic/main/application/light2 internalTimeout
+ /LSTraffic/main/TimingService --> /LSTraffic/main/application/light2 internalTimeout
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >>> Off_Blinking_Off
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/TimingService internalStartTimeout
+ /LSTraffic/main/TimingService >>> Operational
/LSTraffic/main/TimingService >-- /LSTraffic/main/application/light1 internalTimeout
+ /LSTraffic/main/TimingService --> /LSTraffic/main/application/light1 internalTimeout
+ /LSTraffic/main/application/light1 >-- /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1 >-- /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1 >>> Off_Blinking_Off
+ /LSTraffic/main/application/light1 --> /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light1 --> /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light1 --> /LSTraffic/main/TimingService internalStartTimeout
+ /LSTraffic/main/TimingService >>> Operational
+ /LSTraffic/main/TimingService >-- /LSTraffic/main/application/light2 internalTimeout
/LSTraffic/main/TimingService --> /LSTraffic/main/application/light2 internalTimeout
/LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
- /LSTraffic/main/application/light2 >>> CarRed
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >>> Off_Blinking_On
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/TimingService internalStartTimeout
+ /LSTraffic/main/TimingService >>> Operational
+ /LSTraffic/main/TimingService >-- /LSTraffic/main/application/light1 internalTimeout
/LSTraffic/main/TimingService --> /LSTraffic/main/application/light1 internalTimeout
/LSTraffic/main/application/light1 >-- /LSTraffic/main/application/light1/trafficLightSocket send
- /LSTraffic/main/application/light1 >>> CarYellow
+ /LSTraffic/main/application/light1 >-- /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1 >>> Off_Blinking_On
+ /LSTraffic/main/application/light1 --> /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light1 --> /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light1 --> /LSTraffic/main/TimingService internalStartTimeout
+ /LSTraffic/main/TimingService >>> Operational
+ /LSTraffic/main/TimingService >-- /LSTraffic/main/application/light2 internalTimeout
+ /LSTraffic/main/TimingService --> /LSTraffic/main/application/light2 internalTimeout
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >>> Off_Blinking_Off
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
/LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
/LSTraffic/main/application/light2/trafficLightSocket >>> opened
/LSTraffic/main/application/light2 --> /LSTraffic/main/TimingService internalStartTimeout
/LSTraffic/main/TimingService >>> Operational
+ /LSTraffic/main/TimingService >-- /LSTraffic/main/application/light1 internalTimeout
+ /LSTraffic/main/TimingService --> /LSTraffic/main/application/light1 internalTimeout
+ /LSTraffic/main/application/light1 >-- /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1 >-- /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1 >>> Off_Blinking_Off
+ /LSTraffic/main/application/light1 --> /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1/trafficLightSocket >>> opened
/LSTraffic/main/application/light1 --> /LSTraffic/main/application/light1/trafficLightSocket send
/LSTraffic/main/application/light1/trafficLightSocket >>> opened
/LSTraffic/main/application/light1 --> /LSTraffic/main/TimingService internalStartTimeout
/LSTraffic/main/TimingService >>> Operational
+ /LSTraffic/main/TimingService >-- /LSTraffic/main/application/light2 internalTimeout
+ /LSTraffic/main/TimingService --> /LSTraffic/main/application/light2 internalTimeout
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >>> Off_Blinking_On
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/TimingService internalStartTimeout
+ /LSTraffic/main/TimingService >>> Operational
+ /LSTraffic/main/TimingService >-- /LSTraffic/main/application/controller internalTimeout
+ /LSTraffic/main/TimingService --> /LSTraffic/main/application/controller internalTimeout
+ /LSTraffic/main/application/controller >-- /LSTraffic/main/application/light1 greenForPed
+ /LSTraffic/main/application/controller >-- /LSTraffic/main/application/light2 greenForCar
+ /LSTraffic/main/application/controller >>> SwitchToLight2GreenForCars
+ /LSTraffic/main/application/controller --> /LSTraffic/main/application/light1 greenForPed
+ /LSTraffic/main/application/light1 >-- /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1 >>> CarYellow2
+ /LSTraffic/main/application/controller --> /LSTraffic/main/application/light2 greenForCar
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >>> PedRed
+ /LSTraffic/main/application/light1 --> /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light1 --> /LSTraffic/main/TimingService internalStartTimeout
+ /LSTraffic/main/TimingService >>> Operational
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/TimingService internalStartTimeout
+ /LSTraffic/main/TimingService >>> Operational
+ /LSTraffic/main/TimingService >-- /LSTraffic/main/application/light1 internalTimeout
+ /LSTraffic/main/TimingService --> /LSTraffic/main/application/light1 internalTimeout
+ /LSTraffic/main/TimingService >-- /LSTraffic/main/application/light2 internalTimeout
+ /LSTraffic/main/TimingService --> /LSTraffic/main/application/light2 internalTimeout
+ /LSTraffic/main/TimingService >-- /LSTraffic/main/application/light1 internalTimeout
+ /LSTraffic/main/TimingService >-- /LSTraffic/main/application/light2 internalTimeout
+ /LSTraffic/main/TimingService --> /LSTraffic/main/application/light1 internalTimeout
+ /LSTraffic/main/application/light1 >-- /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1 >>> CarRed
+ /LSTraffic/main/application/light1 --> /LSTraffic/main/application/light1/trafficLightSocket send
+ /LSTraffic/main/application/light1/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light1 --> /LSTraffic/main/TimingService internalStartTimeout
+ /LSTraffic/main/TimingService >>> Operational
+ /LSTraffic/main/TimingService --> /LSTraffic/main/application/light2 internalTimeout
+ /LSTraffic/main/application/light2 >-- /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2 >>> CarYellow
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/application/light2/trafficLightSocket send
+ /LSTraffic/main/application/light2/trafficLightSocket >>> opened
+ /LSTraffic/main/application/light2 --> /LSTraffic/main/TimingService internalStartTimeout
+ /LSTraffic/main/TimingService >>> Operational
|