Date post: | 21-Mar-2019 |
Category: |
Documents |
Upload: | duongxuyen |
View: | 223 times |
Download: | 0 times |
Prototype Report
Smart Locks Control
Team 5
Vaibhav Vishal: Project Manager, Life Cycle Planner, Trainer
Diego Brandao: IV&V, Software Architect, Developer
Zhe Wang: Feasibility Analyst, NDI/NCS Acquirer, Developer
Mohammadreza Barazesh: Software Architect, Developer
Alejandro Monroy: Prototyper, Evaluator, Tester, Developer
Hao-Yun Yang: Requirements Engineer
Katarzyna Ruszowska: Quality Focal Point, UML Modeler, Developer
November 24, 2017
Version History
Date Author Version Changes made Rationale
10/05/17 Alejandro Monroy 1.0
Updated with midterm prototype progress.
To fulfill Midterm presentation.
11/24/17 Alejandro Monroy 2.0
Added prototype 4 based on client's feedback after midterm presentation and CCD
To meet client's requirements.
Table of Contents
Prototype Report............................................................................................................................................................iVersion History.............................................................................................................................................................iiTable of Contents.........................................................................................................................................................iiiTable of Tables.............................................................................................................................................................ivTable of Figures.............................................................................................................................................................v
1. Introduction..............................................................................................................Error! Bookmark not defined.
1.1.Purpose of the prototype Report....................................................................................................................1
1.2. Status of the prototype...................................................................................................................................2
2. Navigation Flow.....................................................................................................................................................3
3. Prototype................................................................................................................................................................4
3.1.Test Lock Connectivity and API...................................................................................................................4
3.2.RESTful API....................................................................................................................................................5
3.3.System integration and UI..............................................................................................................................6
3.4.UI code refactoring........................................................................................................................................10
3.4.1.Login component....................................................................................................................................11
3.4.2.Navigation bar component....................................................................................................................11
3.4.3.Side bar component...............................................................................................................................12
3.4.4.Locks component...................................................................................................................................12
3.4.5.Hubs component.....................................................................................................................................13
3.4.6.Logs component.....................................................................................................................................14
3.4.7.Users component....................................................................................................................................15
3.4.8.My profile component............................................................................................................................16
3.4.9.Configuration component.....................................................................................................................16
3.4.10 Alerts component.................................................................................................................................17
iii
Table of Tables
Table 1. Risks and prototypes.........................................................................................................................................1
Table 2. Components functionality...............................................................................................................................10
Table of Figures
Figure 1: Navigation Flow of Smart Locks Control......................................................................................................3
Figure 2 SmartApp.........................................................................................................................................................4
Figure 3. Prototype of RESTful API and Postman.........................................................................................................5
Figure 4. Login Screen...................................................................................................................................................6
Figure 5. Administrator Dashboard, Lock information for all Locks............................................................................7
Figure 6. Administrator Dashboard, Assign slots to users............................................................................................7
Figure 7. Administrator Dashboard, Manage and edit users........................................................................................8
Figure 8. Administrator Dashboard, view Lock status..................................................................................................8
Figure 9. House Manager Dashboard, Lock Information for specific locks.................................................................9
Figure 10. House Staff, Lock Information view assigned locks slots.............................................................................9
Figure 11. Login component........................................................................................................................................11
Figure 12. Navigation bar component.........................................................................................................................11
Figure 13. Side bar component....................................................................................................................................12
Figure 14. Locks component........................................................................................................................................13
Figure 15. Hubs component.........................................................................................................................................13
Figure 16. Logs component..........................................................................................................................................14
Figure 17. Users component........................................................................................................................................15
Figure 18. My profile component.................................................................................................................................16
Figure 19. Configuration component...........................................................................................................................16
Figure 20. Error alert...................................................................................................................................................17
Figure 21. Success alert...............................................................................................................................................17
v
1. Introduction
1.1. Purpose of the prototype Report
The prototype report shows the prototypes that the team performed to mitigate the top risks of the project. Prototyping helped us at the beginning to test the viability of the project and then to tests the difficulty of the most complex requirements to implement. Moreover, prototype enabled us to show the client a big picture of how the project is looking and show the progress of the same to get feedback from him.
The following table shows the different prototypes that we developed for the project.
Table 1. Risks and prototypes
Risk Prototype1. No experience on using SmartThings
API and not sure if lock will be able to connect to SmartThings Hub.
Prototype 1: Developed simple application on SmartThings to test lock connectivity and API.
2. Device handler may be not compatible with the Lock and will not be able to change slots on the lock.
Prototype 2: Developed a RESTful API to send commands to locks from an external source using postman.
3. Integration of front end, backend may not be compatible and UI may not be intuitive enough.
Prototype 3: Integrated the system and created a simple web application to show to the client.
4. UI may not be intuitive enough and difficult or confusing to use for final user.
Prototype 4: UI was rebuilt to meet client's requirements.
1
1.2. Status of the prototype
Prototype 1. The prototype was complete successfully we were able to develop a simple application using SmartThings API, connect the lock and lock, unlock using the app.
Prototype 2. We developed a simple RESTful API using SmartThings API, and we were able to send requests using POSTMAN to Lock, Unlock, set slots and delete slots to the lock. We were able to test the basic functionality of the locks and the most critical requirement of the client.
Prototype 3. The team developed an integrates all of the different parts of the application. Restful API, back-end, and front-end to create a web application. Integration was built successfully, and the main functionality of the project worked correctly. UI was shown to the client, and we got feedback on how to improve it.
Prototype 4. After midterm presentation, the team evaluated the software architecture and started to perform code refactoring. The team decided to restructure the app and rebuilt the UI based on the client's feedback from midterm presentation and CCD.
2
3. Prototype
3.1. Test Lock Connectivity and API
The first prototype developed by the team was to mitigate one of the most important risks. We developed a SmartApp using Samsung SmartThings API. The app allows us to connect to a Lock and control it remotely. We could Lock, unlock view battery status among other capabilities.
Figure 2 SmartApp
4
3.2. RESTful API
For the prototype, a RESTful API was developed and main characteristics:A. Functional lock features (No UI for user to interact)
a. Lock. b. Unlock.c. Set slots.
B. Send requests using Postman. • C. No User Hierarchy implemented before.
Figure 3. Prototype of RESTful API and Postman
5
3.3. System integration and UI
The features implemented in the prototype included the following significant capabilities: A. Login page implemented. B. Functional user hierarchy with three levels:
a. Administrator.b. House manager c. House staff
C. Users can monitor locks from different locations and view information such as status and battery.
D. Functional lock actions such as:a. Lockb. Unlock.c. Set slot.d. Delete slot. e. Assign slots to users.
Figure 4. Login Screen
6
Figure 5. Administrator Dashboard, Lock information for all Locks.
Figure 6. Administrator Dashboard, Assign slots to users.
7
Figure 7. Administrator Dashboard, Manage and edit users.
Figure 8. Administrator Dashboard, view Lock status.
8
Figure 9. House Manager Dashboard, Lock Information for specific locks.
Figure 10. House Staff, Lock Information view assigned locks slots.
9
3.4. UI code refactoring
After midterm presentation UI was completely rebuilt using Agular 4.0 to make code reusable, modular and easy to modify. It was separated in the following components. Components and the functionality provided by such component is shown in table 2.
Table 2. Components functionality.
Component Functionality
1. Login Component Manages all functionality related to user login screen, validation of username and password.
2. Navigation bar component Navigation bar showed at the top of the screen. Shows user logged in name and logout button.
3. Side bar component Side bar that shows all the components the user can interact with.
4. Locks component Manages all the functionality related to control locks remotely. Actions such as add, modify and update slot codes are supported.
5. Hubs component Shows information related to hub status (online and offline) and information related to all locks in the hub (status, battery).
6. Logs component Show a LOG of all the actions that have been performed in locks.
7. Users component Manage functionality related to users. Can handle actions such as add, delete and update users.
8. My profile component Allows user to modify their password. 9. Configuration component Allows user to give permissions to the app to
hubs and locks on Samsung smarting's account.
10. Alerts component Manages success and error alerts.
10
3.4.1. Login component
Login component manages all functionality related to user login. Communcation with backend for username and password validation. It also shows the login screen to user. Final login screen is shown in following image.
Figure 11. Login component.
3.4.2. Navigation bar component
Navigation bar component shows the current tab being used by the user, shows the current user and displays a log out button to exit the system .
Figure 12. Navigation bar component.
11
3.4.3. Side bar component
Side bar component shows all the tabs that the user is able to interact with, the tabs are related to locks, hubs, logs, users, profile and configuration components. By separating sidebar in a new component, it is easier to add new tabs to the system. E.g. the user wants to add a different device such lightbulbs, a lightbulbs tab can be added to turn on/off lightbulbs.
Figure 13. Side bar component.
3.4.4. Locks component
Locks component provide functionality to control physical devices remotely. Different roles have different access to this component. Admin is available to modify all the locks in the system. House Manager is only able to modify the locks that he has been assigned by the admin. And house staff is only able to view (not modify) the codes of the locks he has been assigned.
Functionalities include: Add new slot: Add a new code to a specific lock. Update single slot: Update a single slot code. Update multiple slots: Update all selected slots code. Delete slots: Delete one or multiple selected slots. Random codes: Generates a random code to all selected slots.
12
Figure 14. Locks component.
3.4.5. Hubs component
Hubs component show the status of a HUB such as online or offline, it also shows all the information of locks in the hub such as room name, lock status (active or inactive), door status (locked or unlocked), battery status and the last modify date. Different roles have different access to this component. Admin is available to view information of all the hubs in the system. House Manager is only able to view the hubs that he has been assigned by the admin. And house staff has no access to view any information.
Figure 15. Hubs component.
13
3.4.6. Logs component
Logs component shows all the actions that have been performed to a lock such as add slot, delete slot or update the code of a slot. This can be filtered by user, by date or range of dates. Different roles have different access to this component. Admin is available to view information of all the locks in the system. House Manager is only able to view the information of locks that he has been assigned by the admin. And house staff has no access to view any information.
Figure 16. Logs component.
14
3.4.7. Users component
Users component allows the admin of the system to view and manage all registered users in the system. Only the admin has access to this component. Functionality includes:
Add user: Allows to add a new user to the system and assign a specific role. Update user: Allows to update specific information of a user such as name,
username, password, role or activate/deactivate a user.
Figure 17. Users component.
15
3.4.8. My profile component
Allows user to change their password and view basic information such as username and password. All roles in the system have access to this feature.
Figure 18. My profile component.
3.4.9. Configuration component
Configuration component allows the admin to give permission to the application to access devices registered in Samsung Smarting's account. Admin is able to select which hubs and locks the application will be able to control. Only the admin has access to this component.
Figure 19. Configuration component.
16
3.4.10. Alerts component
Alerts component is a component that manages all the error and success alerts that are shown in the application. This component is used by all the components in the app. For example, when user inserts wrong login information the error in figure 20 is shown. Also, when a user adds a new slot to a lock the success message in picture 21 is displayed.
Figure 20. Error alert.
Figure 21. Success alert.
17