TDR Distance auf Display anzeigen

This commit is contained in:
ISA
2025-03-25 15:10:45 +01:00
parent d59027dc17
commit 289b9a8f77
5 changed files with 3029 additions and 1288 deletions

View File

@@ -147,12 +147,24 @@ const Kue705FO: React.FC<Kue705FOProps> = ({
slotIndex, slotIndex,
modulName modulName
); );
//---------------------------------
//---------------------------------
const tdmChartData = useSelector((state: RootState) => state.tdmChart.data);
const latestTdrDistanceMeters =
Array.isArray(tdmChartData?.[slotIndex]) &&
tdmChartData[slotIndex].length > 0 &&
typeof tdmChartData[slotIndex][0].d === "number"
? tdmChartData[slotIndex][0].d
: 0;
const latestTdrDistance = Number((latestTdrDistanceMeters / 1000).toFixed(3));
//setLoopDisplayValue(latestTdrDistance);
//---------------------------------
const loopValue = const loopValue =
activeButton === "TDR" activeButton === "TDR"
? Array.isArray(tdrLocation) && typeof tdrLocation[slotIndex] === "number" ? latestTdrDistance
? tdrLocation[slotIndex]
: 0
: typeof schleifenwiderstand === "number" : typeof schleifenwiderstand === "number"
? schleifenwiderstand ? schleifenwiderstand
: Number(schleifenwiderstand); : Number(schleifenwiderstand);
@@ -166,6 +178,7 @@ const Kue705FO: React.FC<Kue705FOProps> = ({
const { chartInstance } = useTDRChart(selectedChartData); const { chartInstance } = useTDRChart(selectedChartData);
//--------------------------------- //---------------------------------
return ( return (
<div <div
className="relative bg-gray-300 w-[7.25rem] h-[24.375rem] border border-gray-400 transform laptop:-translate-y-12 2xl:-translate-y-0 className="relative bg-gray-300 w-[7.25rem] h-[24.375rem] border border-gray-400 transform laptop:-translate-y-12 2xl:-translate-y-0
@@ -310,21 +323,22 @@ const Kue705FO: React.FC<Kue705FOProps> = ({
Schleife Schleife
</button> </button>
<button <button
onClick={() => onClick={() => {
handleButtonClick( setActiveButton("TDR");
"TDR", setloopTitleText("Entfernung [Km]");
setActiveButton,
setloopTitleText, const latestTdrDistanceMeters =
(value) => Array.isArray(tdmChartData?.[slotIndex]) &&
setLoopDisplayValue( tdmChartData[slotIndex].length > 0 &&
typeof value === "number" ? value : Number(value) typeof tdmChartData[slotIndex][0].d === "number"
), // Hier sicherstellen, dass nur number übergeben wird ? tdmChartData[slotIndex][0].d
Number(schleifenwiderstand), // <- Stelle sicher, dass es eine Zahl ist : 0;
tdrLocation,
slotIndex, const latestTdrDistance = Number(
dispatch (latestTdrDistanceMeters / 1000).toFixed(3)
) );
} setLoopDisplayValue(latestTdrDistance);
}}
className={`w-[50%] h-[1.563rem] text-white text-[0.625rem] flex items-center justify-center ${ className={`w-[50%] h-[1.563rem] text-white text-[0.625rem] flex items-center justify-center ${
Array.isArray(tdrActive) && tdrActive[slotIndex] === 0 Array.isArray(tdrActive) && tdrActive[slotIndex] === 0
? "bg-gray-200 cursor-not-allowed" // Deaktiviert: Hellgrau ? "bg-gray-200 cursor-not-allowed" // Deaktiviert: Hellgrau

View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,13 @@
[
{ "id": 99, "t": "2025-03-25 12:31:38", "d": 430, "p": 49, "s": 100, "a": 2 },
{ "id": 98, "t": "2025-03-25 12:27:34", "d": 430, "p": 49, "s": 100, "a": 2 },
{ "id": 97, "t": "2025-03-25 11:00:11", "d": 430, "p": 49, "s": 100, "a": 2 },
{ "id": 93, "t": "2025-03-25 10:25:33", "d": 430, "p": 49, "s": 100, "a": 2 },
{ "id": 92, "t": "2025-03-25 10:21:19", "d": 430, "p": 49, "s": 100, "a": 2 },
{ "id": 91, "t": "2025-03-25 10:12:59", "d": 430, "p": 49, "s": 100, "a": 2 },
{ "id": 90, "t": "2025-03-25 10:05:45", "d": 472, "p": 22, "s": 100, "a": 4 },
{ "id": 89, "t": "2025-03-25 10:01:09", "d": 472, "p": 22, "s": 100, "a": 4 },
{ "id": 88, "t": "2025-03-25 09:42:36", "d": 472, "p": 22, "s": 100, "a": 4 },
{ "id": 87, "t": "2025-03-25 09:38:02", "d": 472, "p": 22, "s": 100, "a": 4 },
{ "id": 86, "t": "2025-03-25 09:34:58", "d": 388, "p": 109, "s": 100, "a": 2 }
]

View File

@@ -1,6 +1,9 @@
// redux/types/tdmEntryTypes.ts // redux/types/tdmEntryTypes.ts
export interface TDMEntry { export interface TDMEntry {
id: number; id: number; // ID der Messung
t: string; t: string; // Zeitstempel
// ggf. weitere Felder wie m, p usw. d: number; // Entfernung (Distance)
p: number; // Pulsweite
s: number; // Kabelgeschwindigkeit
a: number; // Amplitude
} }