Skip to content
Snippets Groups Projects
Commit 2582a4b9 authored by Jack Holdsworth's avatar Jack Holdsworth
Browse files

UML

parent 809dc5c0
Branches
No related tags found
No related merge requests found
......@@ -11,7 +11,7 @@
- [Description](#description)
- [Task 1: a RPN calculator in Python.](#task-1--a-rpn-calculator-in-python)
- [Task 2: Hardware interface.](#task-2-hardware-interface)
- [Task 3: Server UDP time.](#task-3-server-udp-time)
- [Task 3: Documentation.](#task-3-documentation)
- [Demos](#demos)
- [Getting Started](#getting-started)
- [Dependencies](#dependencies)
......@@ -60,26 +60,18 @@ FEATURES OF CALCULATOR
* **On-Off** Located on the side of the calculator lies a push button with a On-Off icon. Pressing this button toggles a toggle switch connected between the negative leg of the batery and the raspberry pi.
* **LED** As the rapsberry pi is located within the case, I have added a LED status light that indicates that the device is powered and working.
* **Battery** The battery is a small LIPO Cell connected to the usb-c charging port. It charges relatively slow but due to the low power consumption of the raspberry pi this is not an issue.
* **USB-C**
* **Case**
* **USB-C** The adafruit usb-c board is responsible for charging the battery. It charges the battery at 100ma.
* **Case** I designed the case to house all the components. I used fusion 360 and my 3d printer. Everything is securely mounted with cap hex bolts and nuts that are recessed into the case.
___
### Task 3: Server UDP time.
* This takes builds upon **task 1** and **task 2** we need to send and receive packets from the sever with the correct checksum. This means encoding and decoding UDP.
* ***mainSendandReceive()*** This function is a controller for smaller functions. It simply connects to server and tells the program to send and get packets from the server.![image](src/screenshot10.PNG)
* ***recv_and_decode_packet(websocket)*** We are taking a websocket connecting to it and printing the packet all it one. This take doesnt require us todo much else with the packet so it can just be called in a function. ![image](src/screenshot11.PNG)
### Task 3: Documentation.
* This task involves building UML diagrams for the calculator.
* ***Wiring Diagram*** This diagram demonstrates how the calculator is wired up.
* ***UML Class Diagram*** We are taking a websocket connecting to it and printing the packet all it one. This take doesnt require us todo much else with the packet so it can just be called in a function. ![image](src/screenshot11.PNG)
* ***send_packet(websocket, sourcePort, deskPort, payLoad)*** To send packets to the server they need to be in UDP format in base64. This function will create a header for the payload including the correct checksum so the server can confirm the packet has arrived valid. ![image](src/screenshot12.PNG)
* ***unittest.py*** unittest is an inbuilt Python library. Its a test runner and is specially design for running tests and debugging. This one contains a few useful tools that we are going to use. It works similarly to the assert function. Task 3 doesn't have any output other than to the terminal. I could alter the output but this is out of my scope for the project. Here I am just checking if the program runs correctly. All the tests were successful.![image](src/screenshot15.PNG)![image](src/screenshot16.PNG)
___
## Demos
* ***Task 1:***
**https://www.youtube.com/embed/_whlYriiWjs**
![video](src/demo1.mp4)
* ***Task 2:***
**https://www.youtube.com/embed/1Am2Eauk4dY**
![video](src/demo2.mp4)
* ***Task 3:***
**https://www.youtube.com/embed/wndZ8pPSINo**
![video](src/demo3.mp4)
* Completed demo in class
___
## Getting Started
......
src/UML.PNG

31.1 KiB

src/Wiring-Diagram.PNG

96 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment