Interim Project I Report - The University of Texas at Dallas

advertisement
Object-Oriented Analysis & Design
Home Appliance Control System
(HACS)- Project Phase I
Dr. Lawrence Chung
CS6359.001: Object-Oriented Analysis & Design
University of Texas at Dallas
Submitted by:
Kunal Patel
Arun maneni
Sourabh Kapoor
Meghna Atluri
Akila Muthuveeraganapathy
2
Table of Contents
1). INTRODUCTION
3
2). REQUIREMENT SPECIFICATION
4
3). SYSTEM OVERVIEW
6
4). USE CASE DIAGRAMS
7
5). INTERACTION DIAGRAMS
9
6). CLASS DIAGRAMS
29
3
Introduction
1.1 Purpose
This document is the First Phase project report. It contains the complete design for the Home
Appliance Control System (HACS). It encompasses all the main UML diagrams such as Use
Case Diagrams, Sequence and Collaboration Diagrams, Class Diagrams, , in carrying out an
analysis and design of a home appliance control system (HACS).
The HACS is a centralized, remotely accessed, intelligent system reponsible to act as an
intermediary between the user and his home appliances. The user access to HACS is
provided thorough mobile/stationary devices such as PDAs, Mobiles and Desktop/Laptop
environment. The HACS system is modular and scalable. Devices interfaced to the HACS
provide an interface for remote operation.
1.2 Scope
This project will focus on three types of home appliances—Temperature control system,
Microwave and the Security system. The system has functionality where the user can add
new devices to the system.
1.3 Assumptions
The project is constrained by the following assumptions:
This project will provide only a virtual simulation of the HACS system.
Only three types of appliances will be considered for the project at this stage— Temperature
control system, Microwave and the Security system
New devices can be added to the centralized system
The underlying hardware is beyond the scope of discussion
4
2. Requirements Specifications
General System Requirements:
1). In case of the failure of any of the home appliances controlled by the HACS, an
individual or an organization capable of handling the failure shall be notified with
appropriate information
2). The HACS shall have a Remote database containing the information about all the
appliances it controls.
3). The remote database contains the information about the date and the time of the user’s
log in information. It only stores the information of the current session.
Temperature Control Sub-System Requirements:
The house shall have a temperature control mechanism
The temperature control mechanism shall be activated either manually or remotely
The system shall “memorize” the desired temperature set by the user
The system shall detect the current temperature of the house
The system shall activate the air-conditioning unit or the heating unit of the temperature
control device in order to achieve the desired temperature
The system shall stop the temperature control function once the desired temperature is
reached in order to avoid electricity wastage
The system shall resume the heating/cooling function in order to maintain the desired
temperature
The system shall have a provision where the user can change the desired temperature
The system then cancels the old memorized temperature and shall regard the new
temperature as the desired temperature
The system shall stop the temperature control function when the user shuts down the function
either manually or remotely
The system shall keep the last desired temperature memorized till the user switches off the
temperature control device
Security system Sub-System Requirements:
The house does have a Garage control system
The garage control system may be activated and configured manually or remotely
The system does receive the open/close command given by the user
The system should respond to the commands given by the user
System should return a sound to user to inform the successful closure
System should invoke light controller device to turn the lights on/off if the garage door is
opened/closed
System should message user if door is opened and last state was a successful close and user
did not commanded it to open.
System should call 911 and should inform user about this
System should keep messaging user until either the system is disabled or problem is rectified
System should inform the user, if it is disabled.
If the door is closed then the system should inform the user about the successful close of the
door
5
System should inform the user about the duration for which the door was opened and the
series of actions taken
Microwave Sub-System Requirements:
The house has a microwave oven.
The system should respond to the commands given by the user.
If the temperature is too high, the system should switch off the microwave, call 911 and also
inform the user.
System should inform the user, if it is turned off.
6
3. System Overview
Cellphone,
Laptop, PDA
Temp Controller
Microwave
Server or HACS
System
Security System
Database
Interaction with HACS
The user can interact through any input device such as the Laptop, Palmtop, Cell phone etc.
It allows the user to enter the user name and password. The system then transfers the details
to the authentication server and the authentication server allows or denies the user according
to the information provided in the remote database. After Authentication, the user is allowed
to access the system and perform the desired operations.
System Design
HACS is a system which is controlled by a remote system such as a cell phone, and controls
home appliances. In case of emergency such as fire, the concerned Department and the user
should be notified. Also, HACS should have a remote database consisting of the information
about users and their appliances.
7
The following documentation explains the functionality of the system and serves as a manual
on the software aspects of the system. The document has used UML 1.1 notation to show the
various aspects of the system.
4. Use Cases Diagram
A use case diagram is one which shows a set of use cases and actors and their relationships.
In case of f ire,user and
the Fire Department
are notif ied
FireDepartment
Options of the
HACS Sy stem
Alarm Alert
Database
User is an authenticated
user checked by HACS
while login process.
Operate Microwave
Manage Appliances
<<uses>>
CommonUser
Monitor Appliances
Operate Temperature
Controller
Operate Doors
HACS Appliance Controller
reports
Security System
Log Out
User
Administrator
Operate Garage Doors
<<uses>>
In case of a break-in,
the Police Department
& user are notif ied
Security Sy stem includes
all doors, windows and
garage door
Break Entry
Manage Accounts
Police
Department
Description:
The Use Case Diagram gives a description of the various actions the user can perform using
the HACS. The HACS, gives a functionality menu to the user from which the user selects his
options to perform the required action. The various options are Manage Appliances, Monitor
Appliances, Logout and manage Account. The login mode authenticates each user by the
password and the user name stored in the database. Once the user logins successfully, all the
options are made available by the system. After completing the desired operations, the user
can logout from the system, which will be notified to the HACS.
In this system, the administrator has the privilege to manage the accounts of different users
apart from the operations of the Common User. Both Administrator and User are inherited
from Common User.
The Appliance controller controls the user’s options for the various appliances like
Microwave, Temperature control and Security System. The various options for the appliance
are explained in the following sections for each appliance. Remember the user control to
each appliance is done through the appliance controller as shown in the diagram.
The Database (remote) is connected to the HACS Controller. In case of an emergency (fire or
break-in) the concerned department will be notified by the system.
8
Primary User Diagram
Description:
There are 2 users for the HCAS System. One is the System administrator and the other is the
primary user. The function of the System administrator is to manage the account, manage the
appliances to which the HACS system controls, monitors the Appliances and the security of
the system. The user or the home owner has access to monitoring the appliance, modifying
his account like password, logging out and monitoring the appliance. All the data of the user
and the appliances is stored in a database.
9
5. Interaction Diagram: An interaction diagram shows an interaction, consisting of a set of
objects and their relationships, including the messages that may be dispatched among them.
The two types of interaction diagrams are:
Sequence Diagram: A sequence diagram is an interaction diagram that emphasizes the time
ordering of messages.
Collaboration Diagram: A collaboration diagram is an interaction diagram that emphasizes
the structural organization of the objects that send and receive messages.
Login Sequence Diagram:
Description:
10
The diagram shows the sequence of steps for logging into a system. The user first selects the
login mode in the HCAS functionality menu and the system prompts a form in which the user
fills its name and password as provided by the system administrator. The form is queried in
the database and if its successful the user is logged into the system. The status of being
logged in successfully or not is displayed to the user. With a successful login the user can use
the other options of the HCAS menu.
Login Collaboration Diagram
1: SelectLogin()
aUserInterface :
UserInterface
aUser : User
3: login()
2: CreateForm()
6: SetAccStatus()
7: DisplayResult()
4: Query(username,password)
aLoginForm :
LoginForm
5: GetResult()
aDatabase :
Database
The collaboration diagram is isomorphic to the login sequence diagram.
Manage Account – Sequence Diagram
11
Description:
The diagram shows the different steps of which the system administrator manages the HCAS
system. The diagram shows the different steps the administrator takes to make changes to the
database. This is done through the HCAS functionality menu Manage Account. Once the
administrator logs into the system the Account Form enables the administrator to select the
operations to the database like add user, change password or add appliance so on.
12
Manage Account - Collaboration Diagram
The collaboration diagram is isomorphic to the manage account sequence diagram.
13
Manage Appliance – Sequence Diagram
Description:
The user manages the appliances through the Appliance Form upon successful login into the
system. The Appliance Form is under the Manage Appliance in the functionality menu of the
HCAS system. The user selects the Manage Appliance menu option and logins into the
system. The Appliance Form gives various options for the user on the system like adding an
appliance, adding more controls to a specific appliance. All the changes take place to the
database through the Appliance Form.
14
Manage Appliance - Collaboration Diagram
The collaboration diagram is isomorphic to the manage appliance sequence diagram.
15
Microwave – Sequence Diagram
User
HACS
Microwave
1: login
A user can check
the status and
change the
mode,temp,time at
any poi nt of tim e
2: acknowledge and display operations
3: select microwave
4: retrive available options
5: display available options
6: check status
7: show status
8: set mode(cook,warm,defrost)
9: update mode
10: set temperature
11: update temperature
12: set time
13: update time
turni ng off the
mi crowave oven can
be done anytim e
14: turn off
15: turning off
16
Description:
The diagram shows the operations that the HACS can perform on the microwave. The status
of the microwave can be checked by the user. The microwave can be set in one of the any
three modes (cook, warm, defrost) using the setMode() operation. The setTemperatue()
operation can be used to set the temperature of the microwave to any desired value below the
safe temperature level. The setTime() operation can be used to set the time of the microwave.
HACS can also turnoff the microwave oven at the request of the user at any point of time.
Microwave - Collaboration Diagram
1: login
3: select microwave
6: check status
8: set mode(cook,warm,defrost)
10: set temperature
12: set time
14: turn off
4: retrive available options
User
HACS
2: acknowledge and display operations
5: display available options
7: show status
9: update mode
11: update temperature
13: update time
15: turning off
Microwave
The collaboration diagram is isomorphic to the microwave sequence diagram.
17
Fire Alarm Alert – Sequence Diagram
:FireAlarm
:HACS
:Oven
The system maintains the
information about the users
phone number and Fire
Department's number.
1: detect fire
2: fire alert
3: call fire dept
The Fire Alarm is reset
once the situation is
under control.
4: call owner
5: switch off the oven
Description:
The Fire alarm continuously checks for any outbreak of fire in the residence. On detecting a
fire outbreak, the system notifies the user and the Fire Department, and switches off the
microwave oven. The system stores the phone numbers of the user and the Fire Department
and uses them in case of emergency. Once the situation is under control the alarm is reset by
the HACS system.
18
Fire Alarm Alert - Collaboration Diagram
3: call fire dept
4: call owner
1: detect fire
2: fire alert
:FireAlarm
:HACS
5: switch off the oven
:Oven
The collaboration diagram is isomorphic to the fire alarm alert sequence diagram.
19
Security System (Doors) – Sequence Diagram
User is an
authenticated
user.
: HACS
: User
: Controller
check status()
checkStatus()
return results()
openDoor()
openDoor()
opens door()
closeDoor()
closeDoor()
closes door()
Description:
The sequence diagram shows the various functionalities of the security system for Doors.
Here the user is assumed to be an authenticated user i.e. the session of the user is intact. The
user can check the status of the door through HACS. The three possible outcomes are a) open
b) close or c) break-entry. The status of the door is then returned to the user. In case of a
break entry, the status is reported to the user. The openDoor() operation can be used to open
the door, using the Controller. Similarly the closeDoor() operation can be used to close the
door using the Controller.
20
Security system ( Doors) - Collaboration Diagram
1: check status()
4: openDoor()
7: closeDoor()
: HACS
: User
3: return results()
6: opens door()
9: closes door()
2: checkStatus()
5: openDoor()
8: closeDoor()
: Controller
The collaboration diagram is isomorphic to the security system (Doors) sequence diagram.
21
Security System (Garage Door) – Sequence Diagram
hacs : HACS
: GarageDoor
: GarageLight
: User
User is an
authenticated User
select garage system
checkStatus()
checkStatus()
returnResults()
openGarage()
openGarage( )
lightOn()
closeGarage()
closeGarage( )
lightsOff()
Description:
When the authenticated user selects the garage system from the available options, the user
can perform any of the following operations. The checkStatus() operation can be employed to
check the status of the garage door as either open or close. The openGarage() operation can
be used open the Garage door; on performing this operation the Garage lights are also turnedon by the HACS. The closeGarage() operation can be used to close the Garage door, also the
Garage lights are turned-off by the HACS.
22
Security System (Garage Door) - Collaboration Diagram
1: select garage system
2: checkStatus()
5: openGarage()
8: closeGarage()
hacs : HACS
: User
User is an
authenticated User
4: returnResults()
3: checkStatus()
6: openGarage( )
9: closeGarage( )
: GarageDoor
7: lightOn()
10: lightsOff()
: GarageLight
The collaboration diagram is isomorphic to the Security system (Garage Door) sequence
diagram.
23
Security System (Motion Sensor) – Sequence Diagram
: MotionSensor
hacs : HACS
User is an
authenticated
user.
: User
select garage system
switchOnSensor()
switchSensorOn()
sensorOn
returnResults
switchOffSensor()
switchSensorOff()
sensorOff
returnResults
Description:
The HACS controls the Motion Sensor similar to the Garage System. When the
switchOnSensor() operation is selected by the authenticated user, HACS switches on the
motion sensor and returns the result to the user. On selecting the switchOffSensor()
operation, HACS switches off the motion sensor.
24
Security system (MotionSensor) - Collaboration Diagram
1: select garage system
2: switchOnSensor()
6: switchOffSensor()
hacs :
HACS
: User
5: returnResults
9: returnResults
4: sensorOn
8: sensorOff
3: switchSensorOn()
7: switchSensorOff()
: MotionSensor
The collaboration diagram is isomorphic to the Security system(Motion sensor) sequence
diagram.
25
Security System (BreakEntry) – Sequence Diagram
:BreakEntryDetector
: DetectorHandling
: HouseBreakEntry
: BreakEntryNotice
: PoliceDepartment
: user
User is an
authenticated user
detectHouseBreakEntry()
Emergency ie Police
departments phone number
and users number are stored
in the devices
Once the situation is under
control, the detector is reset
createControl()
setEmergencyStatus()
createBreakNotice()
notify(Police Department)
notify(user)
Description:
The BreakEntryDetector continuously checks for any break-in entries. In case of detecting a
break-in, the detector creates a control and sets the emergency status and notifies the user and
the Police Department. The emergency phone numbers are stored in the devices. Once the
situation is under control, the detector is reset by the HACS system.
26
Break Entry - Collaboration Diagram
1: detectHouseBreakEntry()
:BreakEntryDetector
: DetectorHandling
2: createControl()
3: setEmergencyStatus()
: BreakEntryNotice
: HouseBreakEntry
4: createBreakNotice()
5: notify(Police Department)
6: notify(user)
: PoliceDepartment
: user
The collaboration diagram is isomorphic to the BreakEntry sequence diagram.
27
Temperature Controller – Sequence Diagram
HACS is the controller class which will
handle the UI events
oHACS : HACS
oTempratureController :
CTempratureController
oUser : User
1: IssueCommand ( TempratureDevice, setTemprature, desire_temp )
2: Command(SetTemprature, desire_temp)
3: SetTemprature(desire_temp)
Description
The HACS, controls the Temperature controller as per the user’s request. On accepting a
request from the user the HACS issues a command to the Temperature controller which inturn sets the temperature of the residence to the desired value. Here the user is assumed to be
an authenticated user.
28
Temperature Controller - Collaboration Diagram
1: IssueCommand ( TempratureDevice, setTemprature, desire_temp )
oUser : User
oHACS :
HACS
2: Command(SetTemprature, desire_temp)
3: SetTemprature(desire_temp)
oTempratureController :
CTempratureController
The collaboration diagram is isomorphic to the Temperature Controller sequence diagram.
29
6. Class Diagram
A class diagram is one which shows a set of classes, interfaces, collaborations and
relationships.
30
Description
The class diagram for the HACS application shows the significant classes of the system, their
relationships and the attributes and the operation of the classes. They explore the domain
concepts, analyze the requirements and depict the design of the object-oriented software.
HACS class has various operations such as, login(), logoff(), selectAppliance() etc to carry
out the specific functionalities. This class is under development, so additional operations can
be added to the class when the need arises.
The class diagram shows the CommonUser as the super class, SystemAdmin and User are
the sub classes. The CommonUser has two attributes namely, username and password. These
two attributes are in turn used by the AuthenticationProcess class for the authenticating the
user. The SystemAdmin is a specialization class of the CommonUser and can perform two
special operations, they are createUser() and deleteUser()
The different appliances involved in the HACS system like TemperatureController, Oven,
GarageLight, MotionSensor, GarageDoor, Controller are depicted as the subclasses for the
Appliance class. The generalization relationship is shown in the diagram to denote the same.
The individual appliances have specific operations for carrying out the various functions that
are requested by the user. The TemperatureController uses the setmode() and settemp()
operations, GarageDoor class has openGarage(), closeGarage(), checkGarageState() and
other operations.
A significant advantage is using Appliance as the super class is that, HACS can be extended
to incorporate more appliances by simple adding the new appliances to the Appliance super
class.
Download