House_Management

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.

Contents

All classes

Class diagram for House_Management

Private Classes

Types


Private Classes

A1

Context class diagram for A1

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.

Roles

Button (1..n) Controls (1..n) Lamp

Lamp (1..n) Is_Controlled_By (1..n) Button

Button

Context class diagram for Button

There is a pushbutton on each landing. Each pushbutton controls a number of Lamps; when the button is pushed, the lamps are activated.

Identifying attributes

Name : Button_Name

Each Button is uniquely identified by its name. The name corresponds to the geographical location of the button.

Normal attributes

State : Boolean, initial value False

The current state of the Button.

Private class operations

Changed

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:

S : in Input_Signal_State

Public instance operations

Get_State, accessor returns Boolean

Returns the Button's State.

Associations

Lamp

Context class diagram for Lamp

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.

Identifying attributes

Name : Lamp_Name

Each Lamp is uniquely identified by its name. The name corresponds to the geographical location of the lamp.

Normal attributes

Timeout : Timer

This ColdFrame Timer is used to turn off the Lamp at the end of its activation period.

States

Initial
Idle

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.

Lit

In this state, the Lamp is lit and the Timer is set.

Events

Button_Push
Timeout

State-Event Matrix

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

State Diagram

State diagram for House_Management.Lamp

Private class operations

Initialize, class initialization

This operation initializes the Lamps and Buttons.

Private instance operations

Clear_Timeout

This state entry action unsets the instance Timeout.

Output_For_Lamp returns Output_Signal

Maps the Lamp to the corresponding Digital_IO output pin.

Set_Timeout

This state entry action sets the instance Timeout to the required activation period

Turn_Off

This state entry action turns off the associated signal using Output_For_Lamp.

Turn_On

This state entry action turns on the associated signal using Output_For_Lamp.

Associations

Types

Button_Name

There is a pushbutton on each landing. This type names the pushbuttons.

An enumeration, with literals:

Input_Signal_State

This type is used by the supporting Digital IO domain to report input (switch) state changes.

Imported from Digital_IO.

Lamp_Name

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:

Output_Signal

This type is used by the supporting Digital IO domain to name outputs (lamps).

Imported from Digital_IO.