Add Node and Graph classes for website functionality
This commit is contained in:
@@ -22,30 +22,24 @@ The nodes are the devices that are placed in the rooms. The nodes are used to co
|
||||
|
||||
```mermaid
|
||||
classDiagram
|
||||
|
||||
Node <-- SensorNode : extends
|
||||
Node <-- FeedbackNode : extends
|
||||
|
||||
class Node {
|
||||
+nodeID
|
||||
+processNodeData()
|
||||
+updateNodeData()
|
||||
}
|
||||
```
|
||||
|
||||
#### Sensornode
|
||||
|
||||
```mermaid
|
||||
classDiagram
|
||||
class SensorNode extends Node {
|
||||
class SensorNode {
|
||||
+tempArray
|
||||
+humiArray
|
||||
+eco2Array
|
||||
+tvocArray
|
||||
}
|
||||
```
|
||||
|
||||
#### Feedbacknode
|
||||
|
||||
```mermaid
|
||||
classDiagram
|
||||
class FeedbackNode extends Node {
|
||||
class FeedbackNode {
|
||||
+feedbackArray
|
||||
}
|
||||
```
|
||||
@@ -68,19 +62,16 @@ The graphs are used to display the data from the sensors. The data is collected
|
||||
|
||||
### Graphs
|
||||
|
||||
```mermaid
|
||||
```mermaid
|
||||
classDiagram
|
||||
|
||||
liveGraph --> graph: extends
|
||||
class graph {
|
||||
+nodeId
|
||||
makeGraph()
|
||||
}
|
||||
```
|
||||
|
||||
### Live graphs
|
||||
|
||||
```mermaid
|
||||
classDiagram
|
||||
class liveGraph extends graph {
|
||||
class liveGraph {
|
||||
+cnt
|
||||
+timeArray
|
||||
+tempArray
|
||||
@@ -91,8 +82,8 @@ classDiagram
|
||||
updateGraph()
|
||||
updateData()
|
||||
}
|
||||
```
|
||||
|
||||
```
|
||||
## Order of operations
|
||||
|
||||
### Live graphs
|
||||
@@ -114,4 +105,16 @@ sequenceDiagram
|
||||
3. The website updates the data coming from the raspberry pi on its own variables and arrays
|
||||
4. The website updates the live graphs every time new data is received from the websocket
|
||||
|
||||
### Node
|
||||
|
||||
```mermaid
|
||||
sequenceDiagram
|
||||
participant Node
|
||||
participant Raspberry pi
|
||||
participant Website
|
||||
|
||||
Node->>Raspberry pi: node data via websocket every 5 seconds
|
||||
Raspberry pi->>Website: Make a new object depending on what node it is
|
||||
Website->>Website: updateNodeData()
|
||||
Website->>Website: processNodeData()
|
||||
```
|
@@ -38,7 +38,7 @@ class feedbackNode extends node {
|
||||
}
|
||||
}
|
||||
|
||||
class liveGraph extends node {
|
||||
class liveGraph extends graph {
|
||||
// Constructor to initialize the graph
|
||||
constructor(id) {
|
||||
super(id);
|
||||
|
Reference in New Issue
Block a user