/* Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration) Date: Tue Aug 09 09:35:53 2016 Model author: Glenn De Jonghe Model name: TestOuterFirst Model description: Testing outer first.*/ // package "TestOuterFirst" var TestOuterFirst = {}; (function() { var Class1 = function(controller) { RuntimeClassBase.call(this, controller); this.semantics.big_step_maximality = StatechartSemantics.TakeMany; this.semantics.internal_event_lifeline = StatechartSemantics.Queue; this.semantics.input_event_lifeline = StatechartSemantics.FirstComboStep; this.semantics.priority = StatechartSemantics.SourceParent; this.semantics.concurrency = StatechartSemantics.Single; // build Statechart structure this.build_statechart_structure(); // call user defined constructor Class1.prototype.user_defined_constructor.call(this); }; Class1.prototype = new Object(); (function() { var proto = new RuntimeClassBase(); for (prop in proto) { Class1.prototype[prop] = proto[prop]; } })(); Class1.prototype.user_defined_constructor = function() { }; Class1.prototype.user_defined_destructor = function() { }; // builds Statechart structure Class1.prototype.build_statechart_structure = function() { // state this.states[""] = new State(0, this); // state /state1 this.states["/state1"] = new State(1, this); // state /state1/state1 this.states["/state1/state1"] = new State(2, this); // state /state1/statea this.states["/state1/statea"] = new State(3, this); this.states["/state1/statea"].setEnter(this._state1_statea_enter); // state /stateb this.states["/stateb"] = new State(4, this); this.states["/stateb"].setEnter(this._stateb_enter); // add children this.states[""].addChild(this.states["/state1"]); this.states[""].addChild(this.states["/stateb"]); this.states["/state1"].addChild(this.states["/state1/state1"]); this.states["/state1"].addChild(this.states["/state1/statea"]); this.states[""].fixTree(); this.states[""].default_state = this.states["/state1"]; this.states["/state1"].default_state = this.states["/state1/state1"]; // transition /state1/state1 var _state1_state1_0 = new Transition(this, this.states["/state1/state1"], [this.states["/state1/statea"]]); _state1_state1_0.setTrigger(new Event("event", "test_input")); this.states["/state1/state1"].addTransition(_state1_state1_0); // transition /state1 var _state1_0 = new Transition(this, this.states["/state1"], [this.states["/stateb"]]); _state1_0.setTrigger(new Event("event", "test_input")); this.states["/state1"].addTransition(_state1_0); }; Class1.prototype._state1_statea_enter = function() { this.big_step.outputEvent(new Event("in_a", "test_output", new Array())); }; Class1.prototype._stateb_enter = function() { this.big_step.outputEvent(new Event("in_b", "test_output", new Array())); }; Class1.prototype.initializeStatechart = function() { // enter default state this.default_targets = this.states["/state1"].getEffectiveTargetStates(); RuntimeClassBase.prototype.initializeStatechart.call(this); }; // add symbol 'Class1' to package 'TestOuterFirst' TestOuterFirst.Class1 = Class1; var ObjectManager = function(controller) { ObjectManagerBase.call(this, controller); }; ObjectManager.prototype = new Object(); (function() { var proto = new ObjectManagerBase(); for (prop in proto) { ObjectManager.prototype[prop] = proto[prop]; } })(); ObjectManager.prototype.instantiate = function(class_name, construct_params) { if (class_name === "Class1") { var instance = new Class1(this.controller); instance.associations = new Object(); } else { throw new Error("Cannot instantiate class " + class_name); } return instance; }; // add symbol 'ObjectManager' to package 'TestOuterFirst' TestOuterFirst.ObjectManager = ObjectManager; var Controller = function(event_loop_callbacks, finished_callback, behind_schedule_callback) { if (finished_callback === undefined) finished_callback = null; if (behind_schedule_callback === undefined) behind_schedule_callback = null; EventLoopControllerBase.call(this, new ObjectManager(this), event_loop_callbacks, finished_callback, behind_schedule_callback); this.addInputPort("test_input"); this.addOutputPort("test_output"); this.object_manager.createInstance("Class1", new Array()); }; Controller.prototype = new Object(); (function() { var proto = new EventLoopControllerBase(); for (prop in proto) { Controller.prototype[prop] = proto[prop]; } })(); // add symbol 'Controller' to package 'TestOuterFirst' TestOuterFirst.Controller = Controller; var InputEvent = function(name, port, parameters, time_offset) { this.name = name; this.port = port; this.parameters = parameters; this.time_offset = time_offset; }; // add symbol 'InputEvent' to package 'TestOuterFirst' TestOuterFirst.InputEvent = InputEvent; var Test = function() { }; Test.prototype.input_events = [new InputEvent("event", "test_input", new Array(), 0.0)]; Test.prototype.expected_events = [[new Event("in_b", "test_output", new Array())]]; // add symbol 'Test' to package 'TestOuterFirst' TestOuterFirst.Test = Test; })();