// public/CPL/SERVICE/knotenAuslesen.js

window.knotenData = {
  nodeIDs: [],
  linkIDs: [],
  linkLengths: [],
};

function leseKnotenpunkte(slotIndex) {
  try {
    for (let i = 0; i < 10; i++) {
      const node = window.kueNodeID?.[i] ?? "";
      window.knotenData.nodeIDs[i] = node;
    }

    for (let i = 0; i < 10; i++) {
      const link = window.kueLinkID?.[i] ?? "";
      window.knotenData.linkIDs[i] = link;
    }

    for (let i = 0; i < 10; i++) {
      const length = window.kueLinkLength?.[i] ?? "";
      window.knotenData.linkLengths[i] = length;
    }

    console.log("✅ Knotenpunkte geladen:", window.knotenData);
  } catch (error) {
    console.error("❌ Fehler beim Laden der Knotenpunkte:", error);
  }
}
