spelling mistakes updated
This commit is contained in:
@@ -73,7 +73,7 @@ async def main():
|
||||
The following function is made to set the different node types appart, this is done by putting down these global variables.
|
||||
These variables are doen this way because the python-scope could not reach inside some parts of the files.
|
||||
|
||||
A bit further a array is made to holde the node info. this is so the information of the node can be sepperated and held.
|
||||
A bit further a array is made to holde the node info. this is done so the information of the node can be sepperated and held.
|
||||
|
||||
After the array, a type tuple is made. (A tuple is a type of info which acts in a way like a array. For more info visit https://www.w3schools.com/python/python_tuples.asp)
|
||||
|
||||
@@ -81,7 +81,7 @@ Then another connection to the database is made to gather all existing mac-addre
|
||||
|
||||
Then a for-loop is made to see if the incomming MAC is existing, if this isn't the case, add it to the array.
|
||||
|
||||
After, if the given type from the previous function is a sensor-, or questionaire-node
|
||||
After, if the given type from the previous function is a sensor- or questionaire-node it sends the infromation to the given function. These are located inside of the classes.
|
||||
```py
|
||||
#By python's scuffed we had to use global variables.
|
||||
async def getNodeInfo(type):
|
||||
@@ -120,7 +120,7 @@ async def getNodeInfo(type):
|
||||
```
|
||||
The next function acts as a node ID fetcher, it searches the database for information regarding the nodeID's.
|
||||
|
||||
Like the previous function, It adds the new ID id this is not yet existent.
|
||||
Like the previous function, It adds the new ID id if this is not yet existent.
|
||||
```py
|
||||
async def getNodeID(macAdress):
|
||||
id = (macAdress,)
|
||||
|
@@ -4,11 +4,10 @@ This File and class are dedicated to storing/using data that is related to the q
|
||||
By doing this a lot of space is saved on the main file and the readability wil increase.
|
||||
|
||||
By doing this, it also solves the issues with the very precise naming and the often similar types of names.
|
||||
This way it ensures no confusion on what the purpous of each segement is.
|
||||
|
||||
First up this page imports different types of information, like the library's and the needed files and/or Node.
|
||||
|
||||
This way it ensures that there is no confusion on what the
|
||||
purpose of each segement is.
|
||||
|
||||
First up on this page it imports different types of information, like the library's and the needed files and/or Node.
|
||||
```py
|
||||
#Importing different librarys.
|
||||
import mysql.connector
|
||||
@@ -49,7 +48,7 @@ It then creates variables with the data to put it in an array.
|
||||
|
||||
This array then gets sorted and pushed thogether with the query to correctly sort it and push it to the database.
|
||||
|
||||
In case of an error, it also asks for errors and prints it.
|
||||
In case of an error, it also asks for the error and prints it for more clear fixing.
|
||||
```py
|
||||
#making a database connection to then load in the processed data.
|
||||
async def processEnqueteNodeData(data, nodeID):
|
||||
@@ -76,6 +75,5 @@ In case of an error, it also asks for errors and prints it.
|
||||
cursor.close()
|
||||
mydb.close()
|
||||
```
|
||||
|
||||
### code
|
||||
https://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-3/qaajeeqiinii59/-/blob/main/server/web-data-connection/enqueteNodeClass.py
|
||||
|
@@ -1,6 +1,6 @@
|
||||
## General node file.
|
||||
This File includes several main (verry important) components:
|
||||
The Node parent class and the database log- function.
|
||||
The Node parent class and the database log-in function.
|
||||
|
||||
The database funcion is used in almost every class and almost every function, so I put it here in a centeral location.
|
||||
|
||||
|
Reference in New Issue
Block a user