Fehlerstelle in TDR-Messung in Chart anzeigen

This commit is contained in:
ISA
2025-03-25 15:52:22 +01:00
parent 289b9a8f77
commit dffc252bbe
2 changed files with 29 additions and 8 deletions

View File

@@ -43,7 +43,15 @@ const TDRChart: React.FC<{ isFullScreen: boolean }> = ({ isFullScreen }) => {
? state.tdrReferenceChart.referenceData[selectedSlot] || []
: []
);
//--------------------------------
const tdmChartData = useSelector((state: RootState) => state.tdmChart.data);
const pinDistance =
Array.isArray(tdmChartData?.[selectedSlot ?? -1]) &&
tdmChartData[selectedSlot!]?.length > 0 &&
typeof tdmChartData[selectedSlot!][0].d === "number"
? tdmChartData[selectedSlot!][0].d
: null;
//--------------------------------
useEffect(() => {
import("chartjs-plugin-zoom").then((zoomPlugin) => {
Chart.register(...registerables, zoomPlugin.default);
@@ -68,18 +76,18 @@ const TDRChart: React.FC<{ isFullScreen: boolean }> = ({ isFullScreen }) => {
borderWidth: 1,
tension: 0.1,
parsing: {
xAxisKey: "d", // Entfernung/distance // statt "t"
yAxisKey: "p", // Pegel // statt "m"
xAxisKey: "d",
yAxisKey: "p",
},
},
{
label: "Referenzkurve",
data: referenceChartData,
borderColor: "black", // Schwarz für Referenzkurve
borderColor: "black",
borderWidth: 1,
borderDash: [5, 5], // Gepunktete Linie
pointRadius: 3, // Punkte für Tooltip sichtbar machen
pointHoverRadius: 5, // Größere Punkte beim Hover
borderDash: [5, 5],
pointRadius: 3,
pointHoverRadius: 5,
pointBackgroundColor: "black",
tension: 0.1,
parsing: {
@@ -87,6 +95,19 @@ const TDRChart: React.FC<{ isFullScreen: boolean }> = ({ isFullScreen }) => {
yAxisKey: "p",
},
},
{
label: "Fehlerstelle",
data: pinDistance !== null ? [{ d: pinDistance, p: 0 }] : [],
borderColor: "red",
backgroundColor: "red",
pointRadius: 5,
pointStyle: "circle",
showLine: false,
parsing: {
xAxisKey: "d",
yAxisKey: "p",
},
},
],
},
options: {

View File

@@ -6,5 +6,5 @@
2: Patch oder Hotfix (Bugfixes oder kleine Änderungen).
*/
const webVersion = "1.6.161";
const webVersion = "1.6.162";
export default webVersion;