Data Acquisition - Weather Monitoring System
Data Acquisition - Weather Monitoring System
11.1 Inception
Our Weather Monitoring System is a simple application, encompassing only a
handful of classes. Indeed, at first glance, the object-oriented novice might be
tempted to tackle this problem in an inherently non-object-oriented manner by
considering the flow of data and the various input/output mappings involved.
Requirements for the Weather Monitoring
Station
This system shall provide automatic monitoring of various weather conditions.
Specifically, it must measure the following:
■ Wind speed and direction
■ Temperature
■ Barometric pressure
■ Humidity
The system shall also provide these derived measurements:
■ Wind chill
■ Dew point temperature
■ Temperature trend
■ Barometric pressure trend
The system shall have a means of determining the current time and date, so that it
can report the highest and lowest values of any of the four primary measurements
during the previous 24-hour period.
Defining the Boundaries of the Problem
We begin our analysis by considering the hardware on which our software must
execute. This is inherently a problem of systems analysis, involving manufacturability
and cost issues that are far beyond the scope of this text. To bound our problem and
thus allow us to expose the issues of its software analysis and design, we will make
the following strategic assumptions.
■ The processor (i.e., CPU) may take the form of a PC or a handheld device.
■ Time and date are supplied by a clock.
■ Temperature, barometric pressure, and humidity are measured via remote
sensors.
■ Wind direction and speed are measured from a boom encompassing a wind vane
(capable of sensing wind from any of 16 directions) and cups (which advance a
counter for each revolution).
■ User input is provided through a keypad.
■ The display is an off-the-shelf LCD graphic device.
■ A timer interrupts the computer every 1/60 second.
The Deployment Diagram for the Weather Monitoring System
One responsibility of our time and date class must therefore include setting the date
and time. Carrying out this responsibility requires a new set of services to set the
time and date, which we provide via the operations setHour, setMinute,
setSecond, setDay, setMonth, and setYear.
We may summarize our abstraction of a time/date class as follows.
Class name:
TimeDate
Responsibility: Keep track of the current time and date.
Operations:
currentTime
currentDate
setFormat
setHour
setMinute
setSecond
setMonth
setDay
setYear
Attributes:
time
date
The TimeDate LifeCycle