Copyright (C) Simon Wright <simon@pushface.org>
This package is free software; you can redistribute it and/or modify it under terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License distributed with this package; see file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
This domain represents an electronic household control system.
The first release only manages the stairwell lighting system.
This association class is required by ColdFrame to support the many-to-many association between Button and Lamp but has no other functionality in the present understanding of the problem domain.
A possible future enhancement such as having the "on" time of the lamp depend on which button was used to switch it on might lead to a practical role for this class.
This is an Association Class.
Button (1..n) Controls (1..n) Lamp
Lamp (1..n) Is_Controlled_By (1..n) Button
There is a pushbutton on each landing. Each pushbutton controls a number of Lamps; when the button is pushed, the lamps are activated.
Each Button is uniquely identified by its name. The name corresponds to the geographical location of the button.
The current state of the Button.
Acts as receiver of state changes from Digital IO, via Signal State Callback. If a Button has been pushed, posts Button_Pushed events to the Lamps which are controlled by that Button. Button releases are ignored.
Parameters:
Returns the Button's State.
There is a lamp beween each pair of landings.
When the lamp is activated, it comes on for a preset period.
If it is activated again while it is still on, the activation period is extended by the preset period.
Each Lamp is uniquely identified by its name. The name corresponds to the geographical location of the lamp.
This ColdFrame Timer is used to turn off the Lamp at the end of its activation period.
In this state, the Lamp is off.
It's assumed that it's acceptable to turn the Lamp off even if it is off already.
In this state, the Lamp is lit and the Timer is set.
State | Entry Action(s) | Event | Drop-through | |
---|---|---|---|---|
Button_Push | Timeout | |||
Initial | none | can't happen | can't happen | Idle |
Idle | Turn_Off | Lit | can't happen | none |
Lit | Turn_On Set_Timeout |
Lit/ Clear_Timeout |
Idle | none |
This operation initializes the Lamps and Buttons.
This state entry action unsets the instance Timeout.
Maps the Lamp to the corresponding Digital_IO output pin.
This state entry action sets the instance Timeout to the required activation period
This state entry action turns off the associated signal using Output_For_Lamp.
This state entry action turns on the associated signal using Output_For_Lamp.
There is a pushbutton on each landing. This type names the pushbuttons.
An enumeration, with literals:
This type is used by the supporting Digital IO domain to report input (switch) state changes.
Imported from Digital_IO.
There is a lamp beween each pair of landings. This type names the lamps; the name is that of the landing on whose ceiling the lamp is fixed.
An enumeration, with literals:
This type is used by the supporting Digital IO domain to name outputs (lamps).
Imported from Digital_IO.