TDR Messung in Chart.js implementieren
This commit is contained in:
1
LastTDR/slot0.json
Normal file
1
LastTDR/slot0.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ0%>
|
||||||
1
LastTDR/slot1.json
Normal file
1
LastTDR/slot1.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ1%>
|
||||||
1
LastTDR/slot10.json
Normal file
1
LastTDR/slot10.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ10%>
|
||||||
1
LastTDR/slot11.json
Normal file
1
LastTDR/slot11.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ11%>
|
||||||
1
LastTDR/slot12.json
Normal file
1
LastTDR/slot12.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ12%>
|
||||||
1
LastTDR/slot13.json
Normal file
1
LastTDR/slot13.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ13%>
|
||||||
1
LastTDR/slot14.json
Normal file
1
LastTDR/slot14.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ14%>
|
||||||
1
LastTDR/slot15.json
Normal file
1
LastTDR/slot15.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ15%>
|
||||||
1
LastTDR/slot16.json
Normal file
1
LastTDR/slot16.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ16%>
|
||||||
1
LastTDR/slot17.json
Normal file
1
LastTDR/slot17.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ17%>
|
||||||
1
LastTDR/slot18.json
Normal file
1
LastTDR/slot18.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ18%>
|
||||||
1
LastTDR/slot19.json
Normal file
1
LastTDR/slot19.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ19%>
|
||||||
1
LastTDR/slot2.json
Normal file
1
LastTDR/slot2.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ1%>
|
||||||
1
LastTDR/slot20.json
Normal file
1
LastTDR/slot20.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ20%>
|
||||||
1
LastTDR/slot21.json
Normal file
1
LastTDR/slot21.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ21%>
|
||||||
1
LastTDR/slot22.json
Normal file
1
LastTDR/slot22.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ22%>
|
||||||
1
LastTDR/slot23.json
Normal file
1
LastTDR/slot23.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ23%>
|
||||||
1
LastTDR/slot24.json
Normal file
1
LastTDR/slot24.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ24%>
|
||||||
1
LastTDR/slot25.json
Normal file
1
LastTDR/slot25.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ25%>
|
||||||
1
LastTDR/slot26.json
Normal file
1
LastTDR/slot26.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ26%>
|
||||||
1
LastTDR/slot27.json
Normal file
1
LastTDR/slot27.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ27%>
|
||||||
1
LastTDR/slot28.json
Normal file
1
LastTDR/slot28.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ28%>
|
||||||
1
LastTDR/slot29.json
Normal file
1
LastTDR/slot29.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ29%>
|
||||||
1
LastTDR/slot3.json
Normal file
1
LastTDR/slot3.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ3%>
|
||||||
1
LastTDR/slot30.json
Normal file
1
LastTDR/slot30.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ30%>
|
||||||
1
LastTDR/slot31.json
Normal file
1
LastTDR/slot31.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ31%>
|
||||||
1
LastTDR/slot4.json
Normal file
1
LastTDR/slot4.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ4%>
|
||||||
1
LastTDR/slot5.json
Normal file
1
LastTDR/slot5.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ5%>
|
||||||
1
LastTDR/slot6.json
Normal file
1
LastTDR/slot6.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ6%>
|
||||||
1
LastTDR/slot7.json
Normal file
1
LastTDR/slot7.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ7%>
|
||||||
1
LastTDR/slot8.json
Normal file
1
LastTDR/slot8.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ8%>
|
||||||
1
LastTDR/slot9.json
Normal file
1
LastTDR/slot9.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ9%>
|
||||||
@@ -36,27 +36,46 @@ function Kue705FO({
|
|||||||
// Funktion zum Anzeigen des Chart-Modals
|
// Funktion zum Anzeigen des Chart-Modals
|
||||||
const handleOpenChartModal = () => {
|
const handleOpenChartModal = () => {
|
||||||
setShowChartModal(true);
|
setShowChartModal(true);
|
||||||
loadChartData(); // Lade die Daten, wenn das Modal geöffnet wird
|
if (activeButton === "TDR") {
|
||||||
|
loadTDRChartData(); // Lade TDR-Daten, wenn der TDR-Button aktiv ist
|
||||||
|
} else {
|
||||||
|
loadLoopChartData(); // Andernfalls lade die Schleifenmessdaten
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleCloseChartModal = () => {
|
const handleCloseChartModal = () => {
|
||||||
setShowChartModal(false);
|
setShowChartModal(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Daten laden und den Chart erstellen
|
// Daten laden und den TDR-Chart erstellen
|
||||||
const loadChartData = () => {
|
const loadTDRChartData = () => {
|
||||||
const slot = slotIndex;
|
const slot = slotIndex;
|
||||||
const fileData = `../cpl?4000values/slot${slot}.json`; // Je nach Slot wird die entsprechende Datei geladen
|
const fileData = `../cpl?lastTDR/slot${slot}.json`; // TDR-Daten je nach Slot laden
|
||||||
|
|
||||||
fetch(fileData)
|
fetch(fileData)
|
||||||
.then((response) => response.json())
|
.then((response) => response.json())
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
setChartData(data); // Daten setzen
|
setChartData(data); // Daten setzen
|
||||||
createChart(data);
|
createTDRChart(data); // Chart für TDR-Messung erstellen
|
||||||
console.log("Messkurvendaten geladen:", data);
|
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error("Fehler beim Laden der Messkurvendaten:", error);
|
console.error("Fehler beim Laden der TDR-Messkurvendaten:", error);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// Daten laden und den Schleifenmessungs-Chart erstellen
|
||||||
|
const loadLoopChartData = () => {
|
||||||
|
const slot = slotIndex;
|
||||||
|
const fileData = `../cpl?4000values/slot${slot}.json`; // Schleifenmessdaten je nach Slot laden
|
||||||
|
|
||||||
|
fetch(fileData)
|
||||||
|
.then((response) => response.json())
|
||||||
|
.then((data) => {
|
||||||
|
setChartData(data); // Daten setzen
|
||||||
|
createChart(data, "Schleifenmesskurve"); // Chart für Schleifenmessung erstellen
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error("Fehler beim Laden der Schleifenmesskurvendaten:", error);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -112,6 +131,36 @@ function Kue705FO({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
// Funktion zum Erstellen des TDR-Charts
|
||||||
|
const createTDRChart = (dataTDR) => {
|
||||||
|
const ctx = document.getElementById("myChart").getContext("2d");
|
||||||
|
|
||||||
|
new Chart(ctx, {
|
||||||
|
type: "line",
|
||||||
|
data: {
|
||||||
|
labels: dataTDR.map((row) => row.t), // Entfernung oder Zeit auf der x-Achse
|
||||||
|
datasets: [
|
||||||
|
{
|
||||||
|
label: "Pegel",
|
||||||
|
data: dataTDR.map((row) => row.m), // Nur Pegel auf der y-Achse
|
||||||
|
borderColor: "#00AEEF",
|
||||||
|
borderWidth: 1,
|
||||||
|
pointBorderWidth: 0,
|
||||||
|
pointStyle: false,
|
||||||
|
fill: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
options: {
|
||||||
|
scales: {
|
||||||
|
y: {
|
||||||
|
type: "linear",
|
||||||
|
position: "left",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// Funktion für die TDR-Messung
|
// Funktion für die TDR-Messung
|
||||||
const goTDR = () => {
|
const goTDR = () => {
|
||||||
|
|||||||
1
public/LastTDR/slot0.json
Normal file
1
public/LastTDR/slot0.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ0%>
|
||||||
1
public/LastTDR/slot1.json
Normal file
1
public/LastTDR/slot1.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ1%>
|
||||||
1
public/LastTDR/slot10.json
Normal file
1
public/LastTDR/slot10.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ10%>
|
||||||
1
public/LastTDR/slot11.json
Normal file
1
public/LastTDR/slot11.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ11%>
|
||||||
1
public/LastTDR/slot12.json
Normal file
1
public/LastTDR/slot12.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ12%>
|
||||||
1
public/LastTDR/slot13.json
Normal file
1
public/LastTDR/slot13.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ13%>
|
||||||
1
public/LastTDR/slot14.json
Normal file
1
public/LastTDR/slot14.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ14%>
|
||||||
1
public/LastTDR/slot15.json
Normal file
1
public/LastTDR/slot15.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ15%>
|
||||||
1
public/LastTDR/slot16.json
Normal file
1
public/LastTDR/slot16.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ16%>
|
||||||
1
public/LastTDR/slot17.json
Normal file
1
public/LastTDR/slot17.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ17%>
|
||||||
1
public/LastTDR/slot18.json
Normal file
1
public/LastTDR/slot18.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ18%>
|
||||||
1
public/LastTDR/slot19.json
Normal file
1
public/LastTDR/slot19.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ19%>
|
||||||
1
public/LastTDR/slot2.json
Normal file
1
public/LastTDR/slot2.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ1%>
|
||||||
1
public/LastTDR/slot20.json
Normal file
1
public/LastTDR/slot20.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ20%>
|
||||||
1
public/LastTDR/slot21.json
Normal file
1
public/LastTDR/slot21.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ21%>
|
||||||
1
public/LastTDR/slot22.json
Normal file
1
public/LastTDR/slot22.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ22%>
|
||||||
1
public/LastTDR/slot23.json
Normal file
1
public/LastTDR/slot23.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ23%>
|
||||||
1
public/LastTDR/slot24.json
Normal file
1
public/LastTDR/slot24.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ24%>
|
||||||
1
public/LastTDR/slot25.json
Normal file
1
public/LastTDR/slot25.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ25%>
|
||||||
1
public/LastTDR/slot26.json
Normal file
1
public/LastTDR/slot26.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ26%>
|
||||||
1
public/LastTDR/slot27.json
Normal file
1
public/LastTDR/slot27.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ27%>
|
||||||
1
public/LastTDR/slot28.json
Normal file
1
public/LastTDR/slot28.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ28%>
|
||||||
1
public/LastTDR/slot29.json
Normal file
1
public/LastTDR/slot29.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ29%>
|
||||||
1
public/LastTDR/slot3.json
Normal file
1
public/LastTDR/slot3.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ3%>
|
||||||
1
public/LastTDR/slot30.json
Normal file
1
public/LastTDR/slot30.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ30%>
|
||||||
1
public/LastTDR/slot31.json
Normal file
1
public/LastTDR/slot31.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ31%>
|
||||||
1
public/LastTDR/slot4.json
Normal file
1
public/LastTDR/slot4.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ4%>
|
||||||
1
public/LastTDR/slot5.json
Normal file
1
public/LastTDR/slot5.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ5%>
|
||||||
1
public/LastTDR/slot6.json
Normal file
1
public/LastTDR/slot6.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ6%>
|
||||||
1
public/LastTDR/slot7.json
Normal file
1
public/LastTDR/slot7.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ7%>
|
||||||
1
public/LastTDR/slot8.json
Normal file
1
public/LastTDR/slot8.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ8%>
|
||||||
1
public/LastTDR/slot9.json
Normal file
1
public/LastTDR/slot9.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<%=KTZ9%>
|
||||||
Reference in New Issue
Block a user