test
This commit is contained in:
63
app.js
63
app.js
@@ -1,7 +1,7 @@
|
|||||||
const { app, BrowserWindow,ipcMain } = require('electron'); /* TYPE IN TERMINAL: "npm install electron" */
|
const { app, BrowserWindow, ipcMain } = require('electron');
|
||||||
const express = require('express'); /* TYPE IN TERMINAL: "npm install express" */
|
const express = require('express');
|
||||||
const bodyParser = require('body-parser'); /* TYPE IN TERMINAL: "npm install body-parser" */
|
const bodyParser = require('body-parser');
|
||||||
const { PythonShell } = require('python-shell'); /* TYPE IN TERMINAL: "npm install python-shell" */
|
const { PythonShell } = require('python-shell');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const urlElectron = path.join(__dirname, "src/index.html");
|
const urlElectron = path.join(__dirname, "src/index.html");
|
||||||
|
|
||||||
@@ -16,31 +16,19 @@ server.post('/submit-form', (req, res) => {
|
|||||||
|
|
||||||
let options = {
|
let options = {
|
||||||
mode: 'text',
|
mode: 'text',
|
||||||
args: [plant_naam, plantensoort, plant_geteelt], // Zet hier een variable bij om de data toe te voegen aan de databas
|
args: [plant_naam, plantensoort, plant_geteelt] // Zet hier een variable bij om de data toe te voegen aan de database
|
||||||
};
|
};
|
||||||
|
|
||||||
/*Om python te gebruiken*/
|
// Voer Python script uit met de plant_naam als argument
|
||||||
// ipcMain.on('request-update-temp', (event, args) => {
|
PythonShell.run('./script/db_connect_form.py', options, (err, results) => {
|
||||||
// let options = {
|
if (err) {
|
||||||
// mode: 'text',
|
console.error(err);
|
||||||
// scriptPath: 'path/to/your/python/script',
|
res.send('Er is een fout opgetreden');
|
||||||
// args: args
|
} else {
|
||||||
// };
|
console.log('Python script uitvoering resultaten:', results);
|
||||||
|
res.send('Formulier succesvol verwerkt');
|
||||||
// PythonShell.run('calculate.py', options, (err, results) => {
|
}
|
||||||
// if (err) {
|
});
|
||||||
// console.error('Error running python script', err);
|
|
||||||
// event.reply('update-temp-result', 'error');
|
|
||||||
// } else {
|
|
||||||
// console.log('Python script results:', results);
|
|
||||||
// event.reply('update-temp-result', results[0]); // Verstuur het resultaat terug naar de renderer proces
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
|
|
||||||
// En dan in je renderer proces, stuur je een bericht om de update te verzoeken
|
|
||||||
ipcRenderer.send('request-update-temp', [/* hier kunnen argumenten komen die je Python script nodig heeft */]);
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Start de server voor verbinding met de database
|
// Start de server voor verbinding met de database
|
||||||
@@ -62,27 +50,6 @@ function createWindow() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
mainWindow.loadURL(urlElectron);
|
mainWindow.loadURL(urlElectron);
|
||||||
|
|
||||||
/*Is om het Python script te kunnen gebruiken*/
|
|
||||||
ipcMain.on('run-python-script', (event, args) => {
|
|
||||||
let options = {
|
|
||||||
mode: 'text',
|
|
||||||
args: args
|
|
||||||
};
|
|
||||||
|
|
||||||
PythonShell.run('../src/py/calculate.py', options, (err, results) => {
|
|
||||||
if (err)
|
|
||||||
{
|
|
||||||
console.error('Error running python script', err);
|
|
||||||
event.reply('python-script-response', 'error');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
console.log('Python script results:', results);
|
|
||||||
event.reply('python-script-response', results);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
app.whenReady().then(createWindow);
|
app.whenReady().then(createWindow);
|
||||||
|
|||||||
@@ -181,6 +181,9 @@ import mysql.connector
|
|||||||
import requests
|
import requests
|
||||||
from datetime import datetime, timezone, timedelta
|
from datetime import datetime, timezone, timedelta
|
||||||
import time
|
import time
|
||||||
|
import os
|
||||||
|
# import paho.mqtt.client as mqtt
|
||||||
|
# from dotenv import load_dotenv
|
||||||
|
|
||||||
# Functie om verbinding te maken met de database
|
# Functie om verbinding te maken met de database
|
||||||
def database_connect():
|
def database_connect():
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/*default colors*/
|
|
||||||
@import url("https://fonts.googleapis.com/css2?family=Akaya+Kanadaka&display=swap");
|
@import url("https://fonts.googleapis.com/css2?family=Akaya+Kanadaka&display=swap");
|
||||||
@import url("https://fonts.googleapis.com/css2?family=Afacad:ital,wght@0,400..700;1,400..700&display=swap");
|
@import url("https://fonts.googleapis.com/css2?family=Afacad:ital,wght@0,400..700;1,400..700&display=swap");
|
||||||
h1, h2, h3, h4, h5 {
|
h1, h2, h3, h4, h5 {
|
||||||
@@ -15,6 +14,7 @@ body {
|
|||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
|
font-family: "Afacad", sans-serif;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -41,6 +41,7 @@ body .mainContainer .informatie-kas-main-container {
|
|||||||
}
|
}
|
||||||
body .mainContainer .mainBorder {
|
body .mainContainer .mainBorder {
|
||||||
padding: 1.25rem 1.5rem;
|
padding: 1.25rem 1.5rem;
|
||||||
|
padding: 1rem 0;
|
||||||
height: 35rem;
|
height: 35rem;
|
||||||
border: solid 5px rgb(171, 211, 174);
|
border: solid 5px rgb(171, 211, 174);
|
||||||
border-radius: 40px;
|
border-radius: 40px;
|
||||||
@@ -56,6 +57,9 @@ body .mainContainer .mainBorder #sectie-1 {
|
|||||||
padding: 0 2.5rem 0 1rem;
|
padding: 0 2.5rem 0 1rem;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
body .mainContainer .mainBorder #sectie-1 h1 {
|
||||||
|
background-color: green;
|
||||||
|
}
|
||||||
body .mainContainer .mainBorder #sectie-1 .parent-algemeen-overzicht {
|
body .mainContainer .mainBorder #sectie-1 .parent-algemeen-overzicht {
|
||||||
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
|
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
|
||||||
border-radius: 40px;
|
border-radius: 40px;
|
||||||
@@ -88,6 +92,7 @@ body .mainContainer .mainBorder #sectie-1 .grafiek .grafiek-innerbox {
|
|||||||
font-size: 1.25rem;
|
font-size: 1.25rem;
|
||||||
padding: 0 1rem 2.5rem;
|
padding: 0 1rem 2.5rem;
|
||||||
height: 225px;
|
height: 225px;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
body .mainContainer .mainBorder #sectie-1 .grafiek .grafiek-innerbox h2 {
|
body .mainContainer .mainBorder #sectie-1 .grafiek .grafiek-innerbox h2 {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@@ -100,19 +105,19 @@ body .mainContainer .mainBorder #sectie-1 .grafiek .grafiek-innerbox canvas {
|
|||||||
left: 50%;
|
left: 50%;
|
||||||
transform: translate(-50%, -50%);
|
transform: translate(-50%, -50%);
|
||||||
}
|
}
|
||||||
body .mainContainer .mainBorder #sectie-1 .content {
|
body .mainContainer .mainBorder .content {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 3fr 1fr 3fr;
|
grid-template-columns: 3fr 1fr 3fr;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
body .mainContainer .mainBorder #sectie-1 .content .kant-links {
|
body .mainContainer .mainBorder .content .kant-links {
|
||||||
grid-column: 1;
|
grid-column: 1;
|
||||||
}
|
}
|
||||||
body .mainContainer .mainBorder #sectie-1 .content .kant-links #planten {
|
body .mainContainer .mainBorder .content .kant-links #planten {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
}
|
}
|
||||||
body .mainContainer .mainBorder #sectie-1 .content .kant-links #planten td article {
|
body .mainContainer .mainBorder .content .kant-links #planten td article {
|
||||||
height: 7rem;
|
height: 7rem;
|
||||||
width: 10rem;
|
width: 10rem;
|
||||||
padding: 0.6rem;
|
padding: 0.6rem;
|
||||||
@@ -126,33 +131,35 @@ body .mainContainer .mainBorder #sectie-1 .content .kant-links #planten td artic
|
|||||||
border-radius: 40px;
|
border-radius: 40px;
|
||||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
||||||
}
|
}
|
||||||
body .mainContainer .mainBorder #sectie-1 .content .kant-links #planten td article #toevoegen {
|
body .mainContainer .mainBorder .content .kant-links #planten td article #toevoegen {
|
||||||
height: 5rem;
|
height: 5rem;
|
||||||
width: 5rem;
|
width: 5rem;
|
||||||
}
|
}
|
||||||
body .mainContainer .mainBorder #sectie-1 .content .kant-links #planten td article h2 {
|
body .mainContainer .mainBorder .content .kant-links #planten td article h2 {
|
||||||
color: gray;
|
color: gray;
|
||||||
}
|
}
|
||||||
body .mainContainer .mainBorder #sectie-1 .content .kant-links #planten td article:hover {
|
body .mainContainer .mainBorder .content .kant-links #planten td article:hover {
|
||||||
background-color: lightgray;
|
background-color: lightgray;
|
||||||
}
|
}
|
||||||
body .mainContainer .mainBorder #sectie-1 .content .kant-rechts {
|
body .mainContainer .mainBorder .content .kant-rechts {
|
||||||
grid-column: 3;
|
grid-column: 3;
|
||||||
|
margin-right: 2rem;
|
||||||
}
|
}
|
||||||
body .mainContainer .mainBorder #sectie-1 .content .kant-rechts #metingen {
|
body .mainContainer .mainBorder .content .kant-rechts #metingen {
|
||||||
border: solid 3px rgb(171, 211, 174);
|
border: solid 3px rgb(171, 211, 174);
|
||||||
border-radius: 40px;
|
border-radius: 40px;
|
||||||
}
|
}
|
||||||
body .mainContainer .mainBorder #sectie-1 .content .kant-rechts #metingen #main-waardes {
|
body .mainContainer .mainBorder .content .kant-rechts #metingen #main-waardes {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-evenly;
|
justify-content: space-between;
|
||||||
padding: 0.5rem;
|
padding: 0.5rem;
|
||||||
padding-bottom: 0;
|
padding-bottom: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
body .mainContainer .mainBorder #sectie-1 .content .kant-rechts #metingen #main-waardes table {
|
body .mainContainer .mainBorder .content .kant-rechts #metingen #main-waardes table {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-around;
|
justify-content: space-between;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
body .mainContainer .mainBorder .grid-column-2 {
|
body .mainContainer .mainBorder .grid-column-2 {
|
||||||
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
|
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
|
||||||
@@ -172,12 +179,6 @@ body .mainContainer .mainBorder .grid-column-2 .grid-2-child .parent-table {
|
|||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
height: 90%;
|
height: 90%;
|
||||||
}
|
}
|
||||||
body .mainContainer .mainBorder .grid-column-2 .grid-2-child .parent-table table tr td {
|
|
||||||
font-size: 1.05rem;
|
|
||||||
}
|
|
||||||
body .mainContainer .mainBorder .grid-column-2 .grid-2-child .parent-table .kas-table-1 tr td {
|
|
||||||
font-size: 1.25rem;
|
|
||||||
}
|
|
||||||
body .mainContainer .mainBorder .grid-column-2 .grid-2-child .parent-table .kas-table-2 {
|
body .mainContainer .mainBorder .grid-column-2 .grid-2-child .parent-table .kas-table-2 {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"sources":["style.scss","style.css"],"names":[],"mappings":"AAAA,iBAAA;AAKQ,mFAAA;AACA,2GAAA;AAgCR;EAEI,wCAhCU;EAiCV,SAAA;ACnCJ;;ADsCA;EAEI,iCApCQ;ACAZ;;ADuCA;EAEI,kDAAA;EACA,4BAAA;EACA,sBAAA;EACA,2BAAA;EAEA,aAAA;EACA,uBAAA;EACA,mBAAA;EACA,aAAA;EACA,SAAA;ACtCJ;ADwCI;EAEI,WAAA;EACA,aAAA;EACA,2CAAA;EACA,mBAAA;EACA,aAAA;ACvCR;ADyCQ;EAGI,kBAAA;EACA,WAAA;EACA,SAAA;EACA,WAAA;EACA,2BA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BAAA;AC/ExC;ADwFoB;EAEI,cAAA;EACA,kBAAA;ACvFxB;ADyFwB;EAGI,oCAAA;EACA,mBAAA;ACzF5B;AD2F4B;EAEA,aAAA;EACA,8BAAA;EACA,eAAA;EACA,iBAAA;EACA,WAAA;AC1F5B;AD4FgC;EAEI,aAAA;EACA,8BAAA;EACA,WAAA;AC3FpC;ADmGY;EA9OR,2CAAA;EAKA,mBAAA;EA6OY,aAAA;EACA,iCAAA;AClGhB;ADoGgB;EA1PZ,oCAAA;EAeA,mBAAA;EA+OgB,YAAA;ACnGpB;ADsGoB;EAEI,oBAAA;EACA,aAAA;EACA,sBAAA;EAGA,6BAAA;EACA,WAAA;ACvGxB;AD+HwB;EAEI,kBAAA;AC9H5B;ADgI4B;EAGI,WAAA;EACA,kBAAA;EACA,OAAA;EACA,QAAA;EACA,WAAA;EACA,UAAA;EACA,iBAAA;AChIhC;ADmI4B;EAEI,aAAA;AClIhC;ADqI4B;EAEI,UAAA;ACpIhC;;ADgJI,YAAA;AACJ;EACI,aAAA;EACA,uBAAA;EACA,oCAAA;EACA,kBAAA;EACA,UAAA;EACA,cAAA;AC7IJ;;ADgJA,2BAAA;AAEA;EAEI,aAAA;EACA,eAAA;EACA,YAAA;EACA,SAAA;EACA,QAAA;EACA,gCAAA;EACA,iBAAA;EACA,gBAAA;EACA,wCAAA;EACA,WAAA;EACA,YAAA;EACA,uBAAA;EACA,mBAAA;AC/IJ;ADiJI;EAEI,WAAA;EACA,YAAA;EACA,kBAAA;EACA,iBAAA;AChJR;ADkJQ;EAGI,YAAA;EACA,qBAAA;EACA,eAAA;AClJZ","file":"style.css"}
|
||||||
@@ -1,5 +1,3 @@
|
|||||||
/*default colors*/
|
|
||||||
|
|
||||||
$primary-color: rgb(171, 211, 174);
|
$primary-color: rgb(171, 211, 174);
|
||||||
$secondary-color: rgb(143, 188, 143);
|
$secondary-color: rgb(143, 188, 143);
|
||||||
|
|
||||||
@@ -53,7 +51,7 @@ body
|
|||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
// font-family: $font-text;
|
font-family: $font-text;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -70,7 +68,6 @@ body
|
|||||||
|
|
||||||
.goodgarden-logo
|
.goodgarden-logo
|
||||||
{
|
{
|
||||||
// z-index: inherit;
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 10vw;
|
width: 10vw;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
@@ -87,6 +84,7 @@ body
|
|||||||
.mainBorder
|
.mainBorder
|
||||||
{
|
{
|
||||||
padding: 1.25rem 1.5rem;
|
padding: 1.25rem 1.5rem;
|
||||||
|
padding: 1rem 0;
|
||||||
height: 35rem;
|
height: 35rem;
|
||||||
border: solid 5px $primary-color;
|
border: solid 5px $primary-color;
|
||||||
border-radius: 40px;
|
border-radius: 40px;
|
||||||
@@ -105,6 +103,11 @@ body
|
|||||||
padding: 0 2.5rem 0 1rem;
|
padding: 0 2.5rem 0 1rem;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
|
h1
|
||||||
|
{
|
||||||
|
background-color: green;
|
||||||
|
}
|
||||||
|
|
||||||
.parent-algemeen-overzicht
|
.parent-algemeen-overzicht
|
||||||
{
|
{
|
||||||
@include box-shadow;
|
@include box-shadow;
|
||||||
@@ -119,7 +122,6 @@ body
|
|||||||
@include inner-border-radius;
|
@include inner-border-radius;
|
||||||
font-size: 1.25rem;
|
font-size: 1.25rem;
|
||||||
padding: .5rem 1rem;
|
padding: .5rem 1rem;
|
||||||
// background-color: red;
|
|
||||||
|
|
||||||
.table-informatie-kas
|
.table-informatie-kas
|
||||||
{
|
{
|
||||||
@@ -131,8 +133,6 @@ body
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -151,7 +151,7 @@ body
|
|||||||
font-size: 1.25rem;
|
font-size: 1.25rem;
|
||||||
padding: 0 1rem 2.5rem;
|
padding: 0 1rem 2.5rem;
|
||||||
height: 225px;
|
height: 225px;
|
||||||
// position: relative;
|
position: relative;
|
||||||
|
|
||||||
h2
|
h2
|
||||||
{
|
{
|
||||||
@@ -171,6 +171,7 @@ body
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
.content
|
.content
|
||||||
{
|
{
|
||||||
display: grid;
|
display: grid;
|
||||||
@@ -230,7 +231,7 @@ body
|
|||||||
&-rechts
|
&-rechts
|
||||||
{
|
{
|
||||||
grid-column: 3;
|
grid-column: 3;
|
||||||
// margin-right: 2rem;
|
margin-right: 2rem;
|
||||||
|
|
||||||
#metingen
|
#metingen
|
||||||
{
|
{
|
||||||
@@ -241,7 +242,7 @@ body
|
|||||||
#main-waardes
|
#main-waardes
|
||||||
{
|
{
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-evenly;
|
justify-content: space-between;
|
||||||
padding: .5rem;
|
padding: .5rem;
|
||||||
padding-bottom: 0;
|
padding-bottom: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -249,9 +250,8 @@ body
|
|||||||
table
|
table
|
||||||
{
|
{
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-around;
|
justify-content: space-between;
|
||||||
// width: 100%;
|
width: 100%;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -289,7 +289,7 @@ body
|
|||||||
{
|
{
|
||||||
td
|
td
|
||||||
{
|
{
|
||||||
font-size: 1.05rem;
|
// font-size: 1.05rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -300,7 +300,7 @@ body
|
|||||||
{
|
{
|
||||||
td
|
td
|
||||||
{
|
{
|
||||||
font-size: 1.25rem;
|
// font-size: 1.25rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,12 +4,14 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Document</title>
|
<title>Document</title>
|
||||||
<link rel="stylesheet" href="./css/style.css">
|
<link rel="stylesheet" href="../src/css/style.css">
|
||||||
<script src="../script/main.js" defer></script>
|
<script src="../src/js/main.js" defer></script>
|
||||||
<!-- <script src="../script/main.py"></script> -->
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<section class="mainContainer">
|
<section class="mainContainer">
|
||||||
|
<article>
|
||||||
|
<img src="../src/images/logo.png" class="goodgarden-logo">
|
||||||
|
</article>
|
||||||
<section class="mainBorder">
|
<section class="mainBorder">
|
||||||
<section class="content">
|
<section class="content">
|
||||||
<section class="kant-links">
|
<section class="kant-links">
|
||||||
@@ -76,11 +78,24 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<div id="myModal" class="modal">
|
<div id="myModal" class="modal">
|
||||||
<!-- Modal content -->
|
|
||||||
<span class="close">×</span>
|
<span class="close">×</span>
|
||||||
<form action="http://localhost:3000/submit-form" method="post">
|
<form action="http://localhost:3000/submit-form" method="post">
|
||||||
<!-- Form content -->
|
|
||||||
|
<input type="text" name="plant_naam" id="plantNaam">
|
||||||
|
<label for="plantNaam">Naam van de plant</label>
|
||||||
|
|
||||||
|
<input type="text" name="plantensoort" id="plantensoort">
|
||||||
|
<label for="plantensoort">Soort van de plant</label>
|
||||||
|
|
||||||
|
<input type="radio" name="plant_geteelt" id="aanwezig" value="true">
|
||||||
|
<label for="aanwezig">Aanwezig</label>
|
||||||
|
|
||||||
|
<input type="radio" name="plant_geteelt" id="afwezig" value="false">
|
||||||
|
<label for="afwezig">Afwezig</label>
|
||||||
|
|
||||||
|
<input type="submit" value="Submit">
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<!-- White space -->
|
<!-- White space -->
|
||||||
@@ -88,26 +103,35 @@
|
|||||||
<p>a</p>
|
<p>a</p>
|
||||||
</section>
|
</section>
|
||||||
<section class="kant-rechts">
|
<section class="kant-rechts">
|
||||||
<section id="metingen">
|
<section id="sectie-1">
|
||||||
<article id="main-waardes">
|
<article class="parent-algemeen-overzicht">
|
||||||
<table>
|
<article class="algemeen-overzicht">
|
||||||
<tr>
|
<table class="table-informatie-kas">
|
||||||
<td>
|
<tr class="tr-informatie-kas">
|
||||||
<p>Waardes</p>
|
<td>Dagen tot Oogst</td>
|
||||||
</td>
|
<td>12</td>
|
||||||
<td>
|
</tr>
|
||||||
<p>Huidig</p>
|
<tr class="tr-informatie-kas">
|
||||||
</td>
|
<td>Dagen in Kas</td>
|
||||||
<td>
|
<td>2</td>
|
||||||
<p>24u gemiddelde</p>
|
</tr>
|
||||||
</td>
|
<tr class="tr-informatie-kas">
|
||||||
|
<td>Tevredenheid</td>
|
||||||
|
<td>80%</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="tr-informatie-kas">
|
||||||
|
<td>Aandachtspunten</td>
|
||||||
|
<td>1</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</article>
|
</article>
|
||||||
<div class="divider">
|
</article>
|
||||||
</div>
|
<article class="grafiek">
|
||||||
<article>
|
<article class="grafiek-innerbox">
|
||||||
|
<h2>Zonlicht</h2>
|
||||||
|
<canvas
|
||||||
|
id="myCanvas" class="canvas-informatie-kas" width="275" height="275"></canvas>
|
||||||
|
</article>
|
||||||
</article>
|
</article>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -2,8 +2,6 @@ const { ipcRenderer } = require("electron");
|
|||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', () =>
|
document.addEventListener('DOMContentLoaded', () =>
|
||||||
{
|
{
|
||||||
// Stuur een bericht naar de main process om het Python script uit te voeren
|
|
||||||
// In je renderer.js (geladen met defer in je HTML)
|
|
||||||
ipcRenderer.send('request-update-temp', ['some', 'arguments']);
|
ipcRenderer.send('request-update-temp', ['some', 'arguments']);
|
||||||
|
|
||||||
ipcRenderer.on('update-temp-result', (event, newTemperature) => {
|
ipcRenderer.on('update-temp-result', (event, newTemperature) => {
|
||||||
@@ -16,11 +14,6 @@ document.addEventListener('DOMContentLoaded', () =>
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// function dataTablePython()
|
|
||||||
// {
|
|
||||||
// document.getElementById("")
|
|
||||||
// }
|
|
||||||
|
|
||||||
function openModal()
|
function openModal()
|
||||||
{
|
{
|
||||||
const modal = document.getElementById("myModal");
|
const modal = document.getElementById("myModal");
|
||||||
@@ -58,19 +51,17 @@ function drawLineChart()
|
|||||||
const data = [20, 50, 60, 45, 50, 100, 70, 60, 65, 0, 85, 0];
|
const data = [20, 50, 60, 45, 50, 100, 70, 60, 65, 0, 85, 0];
|
||||||
const xLabels = ["", "", "", "", "", 6, "", "", "", "", "", 12];
|
const xLabels = ["", "", "", "", "", 6, "", "", "", "", "", 12];
|
||||||
|
|
||||||
// Define Y-axis labels here. The number of labels should match your scale.
|
|
||||||
const yLabels = ["", 20, "", 40, "", 60, "", 80, "", 100]; /*NIET VERANDEREN!!!*/
|
const yLabels = ["", 20, "", 40, "", 60, "", 80, "", 100]; /*NIET VERANDEREN!!!*/
|
||||||
|
|
||||||
const canvas = document.getElementById("myCanvas");
|
const canvas = document.getElementById("myCanvas");
|
||||||
const ctx = canvas.getContext("2d");
|
const ctx = canvas.getContext("2d");
|
||||||
|
|
||||||
ctx.clearRect(0, 0, canvas.width, canvas.height); // Clear the canvas
|
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
||||||
|
|
||||||
const padding = 35; // Increased padding for Y labels
|
const padding = 35; // Increased padding for Y labels
|
||||||
const graphWidth = canvas.width - padding * 2;
|
const graphWidth = canvas.width - padding * 2;
|
||||||
const graphHeight = canvas.height - padding * 2;
|
const graphHeight = canvas.height - padding * 2;
|
||||||
|
|
||||||
// Draw the axes
|
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
ctx.moveTo(padding, padding);
|
ctx.moveTo(padding, padding);
|
||||||
ctx.lineTo(padding, canvas.height - padding);
|
ctx.lineTo(padding, canvas.height - padding);
|
||||||
@@ -78,10 +69,10 @@ function drawLineChart()
|
|||||||
ctx.stroke();
|
ctx.stroke();
|
||||||
|
|
||||||
// Set the color of the line
|
// Set the color of the line
|
||||||
ctx.strokeStyle = "#008000"; // This sets the line color to green
|
ctx.strokeStyle = "rgb(143, 188, 143)";
|
||||||
|
|
||||||
const xIncrement = graphWidth / (xLabels.length - 1);
|
const xIncrement = graphWidth / (xLabels.length - 1);
|
||||||
const yIncrement = graphHeight / (yLabels.length - 1); // Assuming you have labels for each increment
|
const yIncrement = graphHeight / (yLabels.length - 1);
|
||||||
|
|
||||||
// Plot the data
|
// Plot the data
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
@@ -93,7 +84,7 @@ function drawLineChart()
|
|||||||
const yPos = canvas.height - padding - (data[i] / 100) * graphHeight;
|
const yPos = canvas.height - padding - (data[i] / 100) * graphHeight;
|
||||||
ctx.lineTo(xPos, yPos);
|
ctx.lineTo(xPos, yPos);
|
||||||
}
|
}
|
||||||
ctx.stroke(); // Apply the stroke to the line
|
ctx.stroke();
|
||||||
|
|
||||||
// Draw Y labels
|
// Draw Y labels
|
||||||
ctx.fillStyle = "black";
|
ctx.fillStyle = "black";
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<link rel="stylesheet" href="../src/css/style.css" />
|
<link rel="stylesheet" href="../src/css/style.css" />
|
||||||
<!-- <script src="https://cdn.jsdelivr.net/npm/chart.js"></script> -->
|
|
||||||
<script src="../src/js/main.js" defer></script>
|
<script src="../src/js/main.js" defer></script>
|
||||||
<title>Informatie Kas</title>
|
<title>Informatie Kas</title>
|
||||||
</head>
|
</head>
|
||||||
@@ -47,7 +46,6 @@
|
|||||||
</article>
|
</article>
|
||||||
</article>
|
</article>
|
||||||
</section>
|
</section>
|
||||||
<!-- <section id="sectie-2"></section> -->
|
|
||||||
</article>
|
</article>
|
||||||
<article class="grid-column-2">
|
<article class="grid-column-2">
|
||||||
<article class="grid-2-child">
|
<article class="grid-2-child">
|
||||||
@@ -81,7 +79,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Gemiddelde Uren Zonlicht:</td>
|
<td>Gemiddelde Uren Zonlicht:</td>
|
||||||
<td>2u</td>
|
<td id="battery_voltage">2u</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<table class="kas-table-3">
|
<table class="kas-table-3">
|
||||||
|
|||||||
Reference in New Issue
Block a user