Transcript
Creating an AM/FM Digital Alarm Clock CSCI 360 – Dr. Jim Bowring
Team Redundancy Team Bobby Strickland Jordan Homan Kyle Hagan Carlynn Carter Timothy Griesemer
Table of Contents Vision Requirements Use Cases Fully Dressed Use Cases Supplementary Specs Domain Model Sequence System Diagrams Operation Contracts Glossary
Vision Our goal is to develop a fully functioning alarm clock with no bugs. Our vision is to have a properly working device that keeps an accurate track of time and allows the user to set a desired wake up time. We were assigned to design an AM/FM alarm clock for our CSCI 360 class. This is a low cost project, but it could prove to be profitable since alarm clocks are a standard household item.
Requirements • • • • • • • • • •
Electrical power supply (battery or wall) Electronic gearing mechanism also known as a counter Display with LED’s Tuner for AM/FM radio Setting the alarm Snooze function Setting the time Alarm functions (radio mode, beeping mode) Volume control Speaker
Use Cases 1. Setting the Time The user wants to set the clock to the appropriate time. The user holds down the time button, until the time display screen is flashing. The user then presses hour or minute repeatedly to adjust the hours and minutes respectively. The user then is asked to choose AM/PM, and selects the appropriate choice. Once the time flashing is correct, the user then presses the time button to confirm and set the correct setting. 2. Setting the Alarm The user holds down either Alarm 1 or Alarm 2 button for 3 seconds. The user presses the hour button until they reach the desired hour, and then they press the minute button until they reach the desired minute. Once complete, the user presses the alarm button to confirm and set the alarm time setting. The user then selects which mode to be awakened to by moving the alarm switch to radio or buzzer. The alarm is then set to the users wake up time and their desired wake up sound. 3. Setting the Volume The user wants to set the volume to their desired decibel level. The user wants to turn the volume up. The user presses the volume up button, and as it is pressed, the volume will gradually go up until it reaches the desired loudness. The user then presses the volume down button. As the button is pressed, the volume will go down until it reaches the desired level, or until it is completely mute. 4. Selecting AM/FM Radio Station The user wants to listen to an AM or FM radio channel. The user presses the AM/FM button on the top of the alarm clock to choose the AM or FM waveband. Once their choice is made, they then decide which station to listen to by pressing previous. It will go through the frequencies, higher to lower, until it reaches one in tune. The user continues to press this button until he finds the correct station. The user presses next to go through the frequencies from lower to higher, until it reaches the correct station. The user then presses scan, which goes through each radio station, lower to higher, and pauses for a few seconds on each one, and then continues. The user then presses scan to stop when he hears the station he wishes to listen to.
5. Snooze Function The user’s alarm setting goes off at his scheduled time, and he selects the snooze option. The alarm then goes mute for 10 minutes, until going off again. 6. Turning off the Alarm The user wants to turn the alarm off completely. The user presses the alarm button until it reaches the off position. The alarm is now off.
Fully Dressed Use Cases 1. Setting the Time Scope: Alarm Clock Level: Setting the Time Primary Actor: User Stakeholders & Interests: User – They want to be woken up at a certain time and have an easy to use product. Company – They want to build a successful, reliable product that will be profitable. Preconditions: The clock needs to be powered on. Success Guarantee: -‐ Once the time has been set, the clock displays it and keeps it updated. Main Success Scenario: 1. The user presses and holds the time button until the time display screen is flashing. 2. The user presses the hour button until they reach the desired hour. Pressing the hour button when the hour is at 12 will move it to 1 and switch between AM and PM. 3. The user presses the minute button until they reach the desired minute. Pressing the minute button when the minute is at 59 will reset it to 0. 4. The user pushes the time button to set the clock to the selected time. 5. The display screen stops flashing, and the clock displays the time. Extensions: 1. The user sets the wrong time, and the clock therefore displays the wrong time. 2. The user selects a time, but forgets to hit the time button to set it.
Special Requirements: -‐ Numbers on alarm should be visible from 10ft away -‐ A button user interface Technology & Data Variations List: -‐ input is done from the buttons -‐ output is shown on the screen Frequency of Occurrence: once every few months Open Issues: Are you using an American standard power system?
2. Setting the Alarm Scope: Alarm Clock Level: Setting the Alarm Primary Actor: User Stakeholders & Interests: User – they want to be woken up at a certain time and have an easy to use product Company – they want to build a successful, reliable product that will be profitable Preconditions: the clock needs to be set to the correct time and it needs to be powered on Success Guarantee: -‐the alarm is correctly set and goes off at the set time -‐goes off with the set alarm mode Main Success Scenario: 1. The user holds down either Alarm 1 or Alarm 2 button for 3 seconds. 2. The user presses the hour button until they reach the desired hour, and then they press the minute button until they reach the desired minute. 3. Once complete, the user presses the alarm button to confirm and set the alarm time setting. 4. The user then selects which mode to be awakened to by moving the alarm switch to radio or buzzer. 5. The alarm is then set to the users wake up time and their desired wake up sound. 6. The user is woken up at the correct time. Extensions: 1. User sets the wrong time, and is therefore awakened at the wrong time.
2. User sets the time, and forgets to hit the alarm button again to confirm. 3. The user sets the clock to use both alarms, and one goes off but the other does not. 4. The user expects both alarms to go off, but only sets it to alarm 1 or alarm 2. 5. User forgets to press Alarm button to confirm the desired wake up time. 5b. Alarm will automatically save the input time after 3 seconds of not confirming. Special Requirements: -‐ Numbers on alarm should be visible from 10ft away -‐ A button user interface Technology & Data Variations List: -‐ input is done from the buttons -‐ output is shown on the screen Frequency of Occurrence: one to two times per day Open Issues: Are you using an American standard power system? Is the time correct that is being given from the external source? 3. Setting the Volume Scope: Alarm Clock Level: Setting the Volume Primary Actor: User Stakeholders & Interests: User – they want to be able to select the level of volume while listening to radio or alarm Company – they want to build a successful, reliable product that will be profitable, and that works as specified Preconditions: -‐ the radio is turned on -‐ the AM/FM selection is on -‐ the alarm is turned on Success Guarantee: -‐ the volume is set to the users desired level -‐ the radio plays at the last set volume -‐ the alarm plays at the last set volume Main Success Scenario:
1. The user wants to set the volume to their desired decibel level. 2. The user wants to turn the volume up. 3. The user presses the volume up button, and as it is pressed, the volume will gradually go up until it reaches the desired loudness. 4. The user then presses the volume down button. 5. As the button is pressed, the volume will go down until it reaches the desired level, or until it is completely mute. 6. The volume is then set to the users desired level. Extensions: 1. User turns the volume all the way down, and then turns it off. 1b. User turns the radio on, and no sound is heard. 2. User turns the volume down until mute, and then sets the alarm. 2b. The alarm does not make noise when it goes off. Special Requirements: -‐ a button user interface -‐ must have volume set Frequency of Occurrence: at the users discretion Open Issues: Are you using an American standard power system?
4. Selecting AM/FM Radio Station Scope: Alarm Clock Level: Setting the Radio Station Primary Actor: User Stakeholders & Interests: User – they want to be able to tune in to a different radio station and have an easy to use product Company – they want to build a successful, reliable product that will be profitable Preconditions: -‐ the clock is on -‐ the AM/FM selection is on Success Guarantee: -‐ the radio turns on and plays the users selected frequency -‐ the radio plays at the last set volume Main Success Scenario: 1. The user wants to listen to an AM or FM radio channel. 2. The user presses the AM/FM button on the top of the alarm clock to choose the AM or FM waveband.
3. Once their choice is made, they then decide which station to listen to by pressing previous. 4. It will go through the frequencies, higher to lower, until it reaches one in tune. 5. The user continues to press this button until he finds the correct station. 6. The user presses next to go through the frequencies from lower to higher, until it reaches the correct station. 7. The user is then listening to his desired station. Extensions: 1a. The user presses scan, which goes through each radio station, lower to higher, and pauses for a few seconds on each one, and then continues. 1b. The user presses scan to stop when he hears the station he wishes to listen to. 2. User is looking for an FM station but has it set on AM. 3. User is looking for an AM station but has it set on FM. 4. User turns radio on but they do not hear any sound because the volume is set all the way down. Special Requirements: -‐ a button user interface -‐ must be in range of a radio frequency Frequency of Occurrence: at the users discretion Open Issues: -‐ Where is your location in regards to radio frequencies?
5. Snooze Function Scope: Alarm Clock Level: Snooze Function Primary Actor: User Stakeholders & Interests: User – they want to delay the alarm ten more minutes every time they push the snooze button Company – they want to build a successful, reliable product that will be profitable Preconditions: the clock needs to be set to the correct time, the alarm needs to be set, and it needs to be powered on Success Guarantee: -the alarm is stopped and will go off in ten minutes from when the snooze button is pushed Main Success Scenario:
1. The alarm goes off at the set time, the user presses the snooze button and the alarm turns off. 2. Ten minutes later the alarm goes off with the set mode and volume. 3. The user continues to push the snooze button and the alarm will go off every ten minutes after the button is pushed until they turn the alarm off. Extensions: 1. User pushes the snooze button several times but the alarm goes off ten minutes from the first time they pushed the snooze button. 2. User pushed the snooze button when the first alarm goes off, the second alarm goes off and they push the snooze button again. The first alarm goes off ten minutes from when they pushed the snooze button and the second alarm goes off when they pushed the snooze button the second time Special Requirements: - Numbers on alarm should be visible from 10ft away - A button user interface Technology & Data Variations List: - input is done from the buttons - output is shown on the screen Frequency of Occurrence: one to two times per day Open Issues: Are you using an American standard power system?
6. Turning Off the Alarm Scope: Alarm Clock Level: user goal Primary Actor: User Stakeholders & Interests: User – they want to be able to switch the alarm off once it goes off at the specified time or before it goes off. Company – they want to build a successful, reliable product that will be profitable Preconditions: the clock needs to be powered on and an alarm needs to be set Success Guarantee: -‐the specified alarm toggles off once the user presses the appropriate button -‐the alarm volume is appropriate given the current setting of the volume Main Success Scenario: 1. One of the two alarms begins to go off.
2. The user sees which alarm is going off by noting if the alarm one LED is lighted or if the alarm two LED is lighted. 3. The user decides to turn off the alarm and does so by pressing either the alarm one button or the alarm two button depending on which alarm is going off. 4. The alarm stops. Extensions: 1. Alarm one begins to go off, but the user mistakenly attempts to turn it off by pressing the alarm two button. The alarm continues to go off for sixty seconds and then automatically shuts off. 2. Alarm two begins to go off, but the user mistakenly attempts to turn it off by pressing the alarm one button. The alarm continues to go off for sixty seconds and then automatically shuts off. 3. One of the alarms goes off but the user does not press any button to try to turn it off. The alarm goes off for sixty seconds and then the alarm automatically turns off. 4. Alarm one begins to go off. The user does not press the appropriate button to turn it off. After sixty seconds it shuts off. Alarm two (which is set to go off one minute after alarm one) goes off. The user does not press the appropriate button to turn it off. After sixty seconds it shuts off. 5. Before alarm one or alarm two goes off , the user decides to turn it off. The user presses the alarm one button or the alarm two button to do this depending on which alarm he/she wants to turn off. Special Requirements: -‐ LED lights over the alarm one and alarm two buttons are clearly visible from 7ft away Technology & Data Variations List: -‐ input is done from the buttons -‐ output is shown on the screen Frequency of Occurrence: one to two times per day Open Issues: Can seconds be specified when setting the alarm? If so then there is a possible issue of overlapping alarms.
DomainModel
Alarm: Controls settings for an individual alarm. • AlarmTime: Contains the set time that the Alarm will go off. • AlarmOn: Contains whether or not the Alarm is set to go off. • Time: Maintains the current time. • AlarmControl: Maintains both alarms, and the type of Alarm that will sound. • Alarm 1: The first Alarm that exists on the Alarm Clock. • Alarm 2: The second Alarm that exists on the Alarm Clock. • AlarmType: The type of alarm that will go off (Either Buzz or Radio). • Machine: The running instance of the Dual Alarm Clock and Radio. • VolumeLevel: The Machine's current volume level. • Radio: Instance of the Machine's radio and its controls. • ALControl: Instance of the Machine's Alarms and its controls. • CurrentTime: The Alarm Clock's current Time. • Radio: Controls settings for the Alarm Clock's radio. • FreqType: Contains the Radio's current Frequency Type (AM or FM). • CurrentStation: Instance of the Radio's current Station. • Station: Contains a name and frequency for each Radio station. • StationName: Contains the name for this Station's instance. • StationFrequency: Contains the frequency for this Station's instance.
System Sequence Diagrams 1. Setting the Time MAIN SUCCESS & ALTERNATE
2. Setting the Alarm MAINSUCCESSALTERNATE
3. Setting the Volume MAIN SUCCESS & ALTERNATE
4. Selecting an AM/FM Radio Station MAIN SUCCESS
ALTERNATE
5. Snooze Function MAIN & ALTERNATE
6. Turning Off the Alarm MAIN SUCCESS
ALTERNATE
Operation Contracts Name: setHour() Cross Reference: Use Case 1 (Main & Alternate Success Scenarios), Use Case 2 (Main & Alternate Success Scenarios). Precondition: The user first presses the Time, Alarm 1, or Alarm 2 button to begin setting the hour. Postcondition: The minute for Alarm 1, Alarm 2, or the Clock has changed. Name: setMin() Cross Reference: Use Case 1 (Main & Alternate Success Scenarios), Use Case 2 (Main & Alternate Success Scenarios). Precondition: The user first presses the Time, Alarm 1, or Alarm 2 button to begin setting the minute. Postcondition: The minute for Alarm 1, Alarm 2, or the Clock has changed. Name: setMode() Cross Reference: Use Case 2 (Main & Alternate Success Scenarios). Precondition: The user first presses the Time, Alarm 1, or Alarm 2 button to begin setting the minute. Postcondition: The Alarm Mode has been changed to the desired selection. Name: volumeUp() Cross Reference: Use Case : setting AM/FM radio Precondition: radio is turned on Postcondition: volume is turned up Name: volumeDown() Cross Reference: Use Case: setting AM/FM radio Precondition: radio is turned on Postcondition: volume is turned down Name: selectStation(FreqType : String, CurrentStation : Station) Cross Reference: Use Cases: none Preconditions: The alarm clock has power. Postconditions: -‐ FreqType is set to AM or FM -‐ The current station is set.
Name: selectStationAlternate(CurrentStation : Station) Cross References: Use Cases: Select Station Preconditions: The alarm clock has power. Postconditions: The current station is set. Name: snooze(alarm : Alarm) Cross References: Use Cases: Setting the Alarm Preconditions: Power supply is on and at least one alarm is set Postconditions: snooze(alarm) is set to snooze for 10 minutes and alarm goes off Name: toggleAlarm(alarm : Alarm) Cross References: Use Cases: Turning the Alarm off Preconditions: Power supply is on and at least one alarm is set Postconditions: Alarm.AlarmOn was set to off
Supplementary Specs • Maintainability – it will be a very maintainable product because it will be well documented • Reliability – it is also a very reliable product because if there is a power outage, there is a lithium battery installed that will allow for it to still function • Platform -‐ this product is a standard American flat blade plug
Glossary AM/FM – type of radio frequency which determines which radio stations will be available Buzz – a loud beeping sound that the alarm is set to in order to wake the user up Cross References – other use cases that affect the specified operation Extensions – alternate scenarios for use cases Flat Blade Plug – 120v outlet used in the United States of America Maintainability -‐ the ease with which a software product can be modified in order to: correct defects, meet new requirements, make future maintenance easier, or cope with a changed environment; these activities are known as software maintenance
Platform -‐ special requirements needed to run the machine Postconditons – result of the action placed on the machine Precondtions – conditions set in place that allow the product to work selectStation(FreqType : String, CurrentStation : Station) – operation that selects AM/FM station selectStationAlternate(CurrentStation : Station)– operation that selects an alternate AM/FM station setHour() – operation that sets the hour on the clock setMin() -‐ operation that sets the minute on the clock setMode() – operation that sets the mode of the alarm to radio or buzz Reliability – the product works as described and is reliable to the user Snooze – a button selection that when pressed, it allows the user 10 more minutes of sleep until the alarm goes off again snooze(alarm : Alarm) – operation that sets the snooze to the specified alarm toggleAlarm(alarm : Alarm) – operation that allows the snooze to be applied to the alarm Toggle – switch used to set the alarm to alarm 1 or alarm 2 volumeDown() – operation that turns the volume down volumeUp() – operation that turns the volume up