demos.powerwindow.models
Class WindowController

java.lang.Object
  extended by modhelxs.abstractsemantics.NamedEntity
      extended by modhelxs.abstractsemantics.ObservableEntity
          extended by modhelxs.abstractsemantics.Model<java.lang.Double>
              extended by demos.powerwindow.models.WindowController
All Implemented Interfaces:
Model, NamedEntity, ObservableEntity

public class WindowController
extends Model<java.lang.Double>

The controller of the power window. This is a TFSM model, whose inputs and outputs are: - win_openend: the window reached the low end stop (it is fully opened) - win_closed: the window reached the high end stop (it is fully closed) - win_obstacle: the window detected an obstacle - cmd_up: the user pressed the up button - cmd_down: the user pressed the down button - cmd_stop: the user released the button - motor_up: start the motor to raise the window - motor_down: start the motor to lower the window - motor_stop: stop the motor This controller has automatic impulse mode: if the user presses the up or down button and releases it before one unit of time in TFSM, the window will automatically close or open until it reaches an end stop. When in automatic closing mode, if an obstacle is detected, the window is lowered during 4 TFSM unit of time and then stopped.

Author:
boulange

Field Summary
private  Pin cmd_down
           
private  Pin cmd_stop
           
private  Pin cmd_up
           
private  Pin motor_down
           
private  Pin motor_stop
           
private  Pin motor_up
           
private  Pin win_closed
           
private  Pin win_obstacle
           
private  Pin win_opened
           
 
Constructor Summary
WindowController(java.lang.String name, java.lang.Object... properties)
           
 
Method Summary
 Pin cmd_down()
           
 Pin cmd_stop()
           
 Pin cmd_up()
           
 Pin motor_down()
           
 Pin motor_stop()
           
 Pin motor_up()
           
 Pin win_closed()
           
 Pin win_obstacle()
           
 Pin win_opened()
           
 
Methods inherited from class modhelxs.abstractsemantics.Model
add, connect, connectFromInterfaceBlock, connectFromModel, connectFromRegularBlock, createRelation, emitObservationRequests, endOfSnapshot, endOfUpdate, getEngine, getInputPins, getMoC, getOutputPins, getParent, getStructure, prep, reset, sanityCheck, setEngine, setParent, setup, startOfSnapshot, startOfUpdate, update, validate, wrapup
 
Methods inherited from class modhelxs.abstractsemantics.ObservableEntity
addPin, getInterface, getPin
 
Methods inherited from class modhelxs.abstractsemantics.NamedEntity
getName, getProperties, getProperty, hasProperty, removeProperty, setName, setProperties, setProperty, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface modhelxs.ecore.ObservableEntity
getInterface
 
Methods inherited from interface modhelxs.ecore.NamedEntity
getName, getProperties, setName
 

Field Detail

win_opened

private final Pin win_opened

win_closed

private final Pin win_closed

win_obstacle

private final Pin win_obstacle

cmd_up

private final Pin cmd_up

cmd_stop

private final Pin cmd_stop

cmd_down

private final Pin cmd_down

motor_up

private final Pin motor_up

motor_stop

private final Pin motor_stop

motor_down

private final Pin motor_down
Constructor Detail

WindowController

public WindowController(java.lang.String name,
                        java.lang.Object... properties)
Method Detail

win_opened

public Pin win_opened()

win_closed

public Pin win_closed()

win_obstacle

public Pin win_obstacle()

cmd_up

public Pin cmd_up()

cmd_stop

public Pin cmd_stop()

cmd_down

public Pin cmd_down()

motor_up

public Pin motor_up()

motor_stop

public Pin motor_stop()

motor_down

public Pin motor_down()