SoftwarePractice.org: Home | Courseware | Wiki | Archive

T3

From SoftwarePractice.org

Contents

Inception

Group Members

Daniel Delgado Pinillos

Alan Dinevan [1]

Philip Ngo's Logbook (User: Cm34448)

Meeting Times

The group will meet during the lecture and tutorial times and any other time if needed. Main method of communication would be via email and MSN.

Introduction

The medical profession are interested in a wearable device that can measure and record physiological parameters of the human body. They hope that data collected in this way can be useful for medical diagnosis.

This wearable physiological sensor can provide data readings of a person's skin temperature, pulse and galvanic skin response. The collected data is to be stored onto an external storage medium, such as a SD memory card.

Proposed Requirements

  • Measure and record physiological parameters of the human body
  • Allow a user to enter their personal data
  • Allow different user profiles to be selected
  • Temporarily store data on the device
  • Pressing the start / stop timer button would also erase the previous session’s readings as well as starting a new timer session
  • Allow data to be saved onto an external storage medium; in this case it’s a mini SD card
  • Display graphs of the sensor readings
  • Will allow the user to select which readings that would be taken (i.e. Taking pulse only or taking both pulse and skin temperature only)
  • Timestamp all readings
  • The function which collects readings will behave like a stop watch, however readings are collected at regular intervals, most likely every 5 seconds
  • The display / GUI must be at a size which is easily visible to the user
  • The display / GUI must be user friendly as much as possible

Stakeholders

This physiological sensor would be primarily used by medical professionals to monitor and collect data on their patients' physiological states.

The primary beneficiaries are patients with health problems such as high blood pressure or are recovering from an operation or injury. People of other professions who may also benefit from this produuct are:

  • Fitness instructors
  • Manufacturers

Elaboration

Usage Scenarios

- Uza Aiks used the device during his gym sessions the last couple of weeks and is satisfied of the results since he can notice an improvement in the results; thus he knows he's becoming fit.

- Seekeun Yousa was not feeling well and used the device before seeing the doctor. The information recorded by the device helped alot in determining what was the problem.

Use Cases

User Action System responsibility
1- Turn on the device
2- offer choices (skin temperature, pulse, galvanic skin response)
3- Make choice
4- Start timer
5- Start recording
6- Stop timer
7- Stop recording
8- Store data in memory card
9- Display results
10- turn off
11- Take memory card

Use Case Diagram

Use-Casediagram.jpg

CRC

Class Input:
Responsibilities Collaboration
Takes commands from the user Provides inputs to class Skintemp, Pulse and Galvanic skin response


Class DisplayUnit:
Responsibilities Collaboration
Displays the GUI, graphs and timer Gets data from class Output


Class SkinTemp:
Responsibilities Collaboration
Skin temperature Start/Stop recording depending on the class input
Provide data to the class output


Class Pulse:
Responsibilities Collaboration
Pulse Start/Stop recording depending on the class input
Pulse Provide data to the class output


Class GSR:
Responsibilities Collaboration
Galvanic Skin Response Start/Stop recording depending on the class input
Provide data to the class output


Class Output:
Responsibilities Collaboration
Copies the reading data to mini SD Gets the data from class Skintemp, Pulse and Galvanic skin response
Output Provides data to class display unit

Sequence Diagram

This sequence diagram shows a new user entering their new details in and then selecting the skin temperature option to start getting readings. As all these actions are initiated, it would also trigger the stopwatch to start as well.

seq1.jpg


This shows a user stopping the device. When the user stops it, the data from the readings are sent to the graph class, the graph is then created and shown on the display along with the times and the stopwatch time elapsed.

stop_seq.jpg

Initial Class Diagrams

class.jpg

Initial GUI design

This is our hand-drawn initial GUI design. The specifications of our final product may differ a lot from. The sequence of menus are as follows:

1. Device starts up and presents the user with 3 options: New Session, Load User and Turn off.

2. Selecting Load user would bring the user to a new window where the user can load/delete saved data.

2. Selecting new session will bring the user to the next screen, which prompts the user for a name, the window would prompt user for an age, then weight and finally height.

3. Once all the details are entered, the system would ask the user whether the details are correct. By clicking confirm, the system would bring the user to the next screen.

4. The next screen allows the user to select ONE test of the user's choice and after the test selection, the user would be brought to a screen showing only the elapsed time of the test as well as an option for stopping the reading.

5. By stopping the test, the user would be presented with a screen showing the low, high and average ranges of the readings and by pressing the 'Save' option, the details are stored temporarily. This also brings the user to the next screen which would show the graph of the readings and by pressing the 'Save' button this screen, the graph is also stored on the device temporarily.

6. The final screen would prompt the user to save the data onto an output storage file.

point7.jpg

Construction

Prototype Screenshots

Screenshots taken in Windows XP

Protoype Menu Screen
Enlarge
Protoype Menu Screen
Protoype User Entry Screen
Enlarge
Protoype User Entry Screen
Protoype Test SelectionScreen
Enlarge
Protoype Test SelectionScreen

Final UML diagram

Final UML diagram showing all classes and associations.

Image:C final.jpg

Class Specification


Class Name Start Application
Purpose of Class Starts the application
Data Attributes
Operation Signatures void main(String[] args)
Class Invariant
Pre-Conditions
Post-Conditions


Class Name MainMenuFrame
Purpose of Class Displays a menu which allows the user to either load data, record new data or exit.
Data Attributes JButton
Operation Signatures 1-loginButton
2-loadButton
3-aboutButton
4-exitbutton
Class Invariant
Pre-Conditions
Post-Conditions 1-return true and goes to LoginFrame otherwise return false
2-return a value to LiveDisplayFrame to open a file
3-display a window 'about'
4-return true and exit


Class Name LoginFrame
Purpose of Class Allows a user to enter their information so that they can begin

the data collection process. Also sets up the sensor simulation data.

Data Attributes String
Double
JButton
Operation Signatures 1-doBack()
2-doOk()
Class Invariant Sensor name must be a string, lower bound, upper bound and deltaMax must be a double.
Pre-Conditions
Post-Conditions 1-returns true and goes back to MainMenuFrame otherwise return false
2-does personPanel.getValidPerson() and goes to LiveDataDisplayFrame.


Class Name PersonPanel
Purpose of Class Allows entry of user details and also sets up a read only panel for LiveDataDisplayFrame and LoadedDataDisplayFrame
Data Attributes String
int
JTextField
Operation Signatures 1-SetReadOnlyPerson()
2-getValidPerson()
Class Invariant Name must be a string, age, height and weight must be a valid integer.
Pre-Conditions
Post-Conditions 1-Set nameField, ageField,weightField, heightField
2-return new Person(nameField.getText(), age, height, wight)


Class Name Person
Purpose of Class Stores a person's details
Data Attributes String
Int
Operation Signatures 1-getName()
2-getAge()
3-getHeight()
4-getWeight()
Class Invariant Name must be a string, Age, Height and Weight must be a valid integer
Pre-Conditions PersonPanel.getValidPerson() returned true
Post-Conditions return name, age, height, weight


Class Name SensorManager
Purpose of Class This class handles sensor data input and stores it for later analysis. It can also save and load data.
Data Attributes String
Int
Double
Date
Operation Signatures 1-saveData()
2-loadData()
3-addSensor()
4-SensorExists()
5-getStartingTime()
6-getEndingTime()
7-finSensor()
8-addSensorInputData()
9-getSensorInputData()
10-getPerson()
Class Invariant No existing person, no existing sensor, no date and value
Pre-Conditions Person exists, sensor exists, timestamp and value exists.
Post-Conditions 1-outputs a file with a user's information and sensor data
2-loads a .dat file with previous senso data in it
3-adds a new named sensor
4-returns null if the sensor name already exist
5-returns the smallest timestamp or returns null if no data
6-returns largest timestamp or returns null if no data
7- return sensor name
8-adds input data to a sensor
9-returns a single sensor's input data
10-returns the user's information


Class Name SensorDisplayPanel
Purpose of Class This is a panel which will display information on a particular sensor. Every time this is repainted, the graph is redrawn.
Data Attributes String
Double
Color
Date
Operation Signatures setTimeFrame()
Class Invariant Invalid sensor name
Pre-Conditions
Post-Conditions returns smallest and largest timestamp


Class Name LiveDataDisplayFrame
Purpose of Class This displays sensor readings for a person who is currently using this device
Data Attributes Int
ArrayList
Timer
JButton
Operation Signatures 1-exitLiveData()
2-saveData()
3-updateGraphs()
Class Invariant Invalid file type
Pre-Conditions Person with details exist, sensor with simulation data exists
Post-Conditions 1-returns true and goes back to MainMenuFrame
2-returns JFILEChooser.APPROVE_OPTION
3-returns new endTime


Class Name LoadedDataDisplayFrame
Purpose of Class Displays loaded data
Data Attributes JLabel
JButton
JSlider
ArrayList
Date
Long
Int
Operation Signatures 1-changeStart()
2-changeEnd()
3-syncTime()
4-exitLoadedData()
5-updateGraphs
Class Invariant
Pre-Conditions Valid data(.dat) file
Post-Conditions 1-returns new value for starting time
2- returns new value for ending time
3-synchronises times to sliders
4- returns true and goes back to MainMenuFrame
5-returns new end time


Class Name SensorInputSimulator
Purpose of Class This allows you to provide a SensorManager with random input data
Data Attributes ArrayList
Operation Signatures addRandomDataInput()
Class Invariant Sensor name not a string, lower bounds, upper bounds, deltMax not double and incorrect time format
Pre-Conditions
Post-Conditions returns data inputs


Class Name RandomDataInput
Purpose of Class Performs actual random inputs
Data Attributes String
Double
Timer
Operation Signatures actionPerformed()
Class Invariant
Pre-Conditions Existing sensor with name, lower bound, upper bound, time and deltaMax
Post-Conditions returns data inputs


Class Name DataRecording
Purpose of Class Stores a single point of data with a timestamp
Data Attributes Double, Date
Operation Signatures 1-getValue()
2-getTimeStamp
Class Invariant
Pre-Conditions
Post-Conditions 1- return value
2-return timestamp


Class Name Sensor
Purpose of Class Allows easy storage of sensor-specific information
Data Attributes String
ArrayList
Operation Signatures
Class Invariant
Pre-Conditions
Post-Conditions


Class Name GraphPanel
Purpose of Class Draws a graph for the current timeframe
Data Attributes
Operation Signatures paintComponent(Graphics g)
Class Invariant
Pre-Conditions
Post-Conditions redraw the graph

Final Sequence Diagrams

Save Data Sequence Diagram
The Save Data Sequence Diagram
Enlarge
The Save Data Sequence Diagram
Load Data Sequence Diagram
The Load Data Sequence Diagram
Enlarge
The Load Data Sequence Diagram

Final Collaboration Diagrams

Loading
Enlarge
Loading
Exiting
Enlarge
Exiting
Login and save
Enlarge
Login and save

For some reason, the last link does not work (probably problems with the name of the file), this is the diagram. Login%26datashow.jpg

System Test Cases

1- Logging in and saving details and data

Data Recording: the user wants to record his/her skin temperature, pulse and galvanic pulse response before an appointment with a doctor or other medical professionals.

User Action System Response
1. Start device
2. Load main menu
3. Select "Log in to record data"
4. Load personal details screen
5. User enters his/her details
6. Confirm by clicking Ok
7. Loads live data collection screen
8. User selects "Save Data""
9. Loads save window
10. User gives the save data a name
11. Confirm by clicking Ok
12. Save data onto user named file

2- Load user's details and data

Data Review: The user wants to load the data recorded to show to the doctor or for other medical purposes.

User Action System Response
1. Start device
2. Load main menu
3. Select "Load data from disk"
4. Load window for the user to locate the saved file
5. User browse to find the file
6. Open the file by clicking open
7. Displays Window with loaded data

Unit Testing

By unit testing certain components of our system, we can find out if its requirements have been met. This is achieved by simulating the conditions of the operation in order to be sure it does what it is meant to do. The bulk of our tests are focused on the SensorManager class.


Specifying getPerson

Method getPerson()
Purpose To return a person in SensorManager
Input Person's details(Name, Age, Height, Weight)
Output None
Precondition Peron's details must be available
Postcondition Person in SensorManager has been returned


Specifying addSensor

Method addSensor()
Purpose Adds a new named sensor
Input Sensor name
Output None
Precondition Existing sensor not the same as the new entry
Postcondition Adds named sensor to SensorManager. If sensor exists with that name, throws IllegalArgumentException


Specifying findSensor

Method findSensor()
Purpose Finds a sensor by its name
Input Sensor name
Output None
Precondition Named sensor must exist
Postcondition Returns if sensor exists, if it doesn't exist, null is returned.


Specifying addRandomDataInput

Method addRandomDataInput()
Purpose Adds random input for a particular sensor. The range is specified by a lower and upper bound.
Input Sensor name, lower bound, upper bound, time period and maximum delta.
Output Random number in the specified bounds
Precondition Sensor name must exist
Postcondition Random numbers are generated but if sensor doesn't exist an IllegalArgumentException is thrown

List of Changes from Initial Prototype

  • User can no longer select specific tests. Once logged in, all three readings must be taken. This is because it would over complicate our code.
  • The data saving function in our final product will prompt the user to specify a filename. Our initial plan was to have the output file method to save without prompting the user. Once again, this plan was scrapped because it would over complicate the code.
  • Since user can no longer select specific tests, the screen is much bigger than we had initially planned. This was unavoidable
  • There is no longer a stop watch function. So it doesn't show elapsed time anymore
  • The final product takes advantage of a grid layout, for ease of positioning of the buttons, text fields and graphs. This was both good and bad; even though it reduced the size of some windows, it increased the size of others.
  • Radio buttons for tests selections have been removed.
  • Final product makes use of sliders to display graph data over certain time frames

Transition

Final Product

Here are some screenshots of the physiological sensor simulation running in Windows XP:

Menu Screen
Enlarge
Menu Screen
User Entry Screen
Enlarge
User Entry Screen
Live Data
Enlarge
Live Data
Loaded Data
Enlarge
Loaded Data

Design and Implementation Issues

Problems Encountered

  • We initially started off with a team of four, however one of our members dropped out of the subject when we started working on the coding.
  • Pretty much all of the team have not had contact with java coding for at least two years. Although not too much of a major problem, we just had to revise all our OOP material, ask for assistance from both friends and tutors as well as work off coding examples from the internet.
  • Putting the entire code together. Once again not a major issue but it was fairly time consuming, since we worked on the code mostly at our own homes, thus not being able to properly make use of the SVN.

Objectives Met

Our sensor simulation has met the following of our initial objectives:

  • Measure and record physiological parameters of the human body
  • Allow a user to enter their personal data
  • Allow different user profiles to be selected
  • Temporarily store data
  • Allow data to be saved onto an external storage medium
  • Display graphs of the sensor readings

We have attained most of our objectives, however we were not able to meet the size constraints as well as a user friendly GUI.


Improvements and Future Development

We have met most of the requirements that we have proposed and also the official requirements of the project. However the screen size could be improved on, since we had initially hoped for it to be a bit smaller. Other improvements that could be made include:

  • A 'one-click' save function. This means that the software would not prompt the user for a file name but rather automatically create a save file based on the user's details.
  • The user should be given the option to select or display the tests want, rather than having all 3 displayed and taking up too much room.
  • The live data display should show how much time has elapsed, since the readings were started.
  • A smaller and more user friendly interface.

References

Abanty Farzana 2001, Temperature of a Healthy Human (Skin Temperature), viewed 3rd OCT 2008 <http://hypertextbook.com/facts/2001/AbantyFarzana.shtml>

Comunidades de wiki libres para aprender, viewed 10th OCT 2008 <http://www.wikilearning.com/tutorial/tutorial_de_java-la_clase_double/3938-57>

Curiosidad, la extraña implementación de NaN, viewed 9th OCT 2008 <http://xnoccio.com/357-curiosidad-la-extrana-impelentacion-de-nan/>

Java Forums, viewed 9th OCT 2008, <http://forums.sun.com/forum.jspa?forumID=31>

La clase ArrayList en Java, viewed 9th OCT 2008 <http://www.webtaller.com/construccion/lenguajes/java/lecciones/clase-arraylist-java.php>

Los números aleatorios, viewed 9th OCT 2008 <http://www.sc.ehu.es/sbweb/fisica/cursoJava/fundamentos/clases1/azar.htm>

Massachusetts Institute of Technology, Research on Sensing Human Affect, viewed 10th OCT 2008 <http://affect.media.mit.edu/areas.php?id=sensing>

Wikipedia 2008, Galvanic Skin Reponse, viewed 3rd OCT 2008 <http://en.wikipedia.org/wiki/Pulse>

Wikipedia 2008, Pulse, viewed 3rd OCT 2008 <http://en.wikipedia.org/wiki/Galvanic_skin_response>

Wu C.T., 2004, An Introduction to Object-Orientated Programming with Java, McGraw Hill, New York

Source Code

Our source code can be accessed here:

https://swordfish.eng.uts.edu.au/projects/ood08spr_03/svn/ood_project/

Personal tools