DBFahrerKaterchen3 commited on
Commit
f30b148
·
verified ·
1 Parent(s): 6c3c53f

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +222 -72
index.html CHANGED
@@ -3,7 +3,7 @@
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>GSM-R Bediengerät (Mesa 23)</title>
7
  <style>
8
  body {
9
  background-color: #1a1a1a;
@@ -12,16 +12,37 @@
12
  display: flex;
13
  justify-content: center;
14
  align-items: center;
15
- height: 100vh;
16
  margin: 0;
 
 
 
 
 
 
 
 
 
 
 
17
  }
18
- .gsmr-container {
19
  background-color: #333333;
20
  border: 6px solid #444444;
21
  border-radius: 12px;
22
  padding: 20px;
23
  width: 380px;
24
- box-shadow: 0 10px 25px rgba(0,0,0,0.7);
 
 
 
 
 
 
 
 
 
 
25
  }
26
  .display {
27
  background-color: #7fa375;
@@ -37,6 +58,28 @@
37
  font-size: 14px;
38
  white-space: pre-wrap;
39
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  .row {
41
  display: flex;
42
  gap: 10px;
@@ -55,110 +98,150 @@
55
  user-select: none;
56
  }
57
  .btn:active { background-color: #444; }
58
- .btn-notruf {
59
- background-color: #b30000;
60
- color: white;
61
- border-color: #660000;
62
- }
63
  .btn-notruf:active { background-color: #8b0000; }
64
- .btn-wechsel {
65
- background-color: #d4a373;
66
- color: #222;
67
- border-color: #a37c54;
68
- }
69
- .btn-wechsel:active { background-color: #bfa07a; }
70
  input, select {
71
  width: 100%;
72
  padding: 8px;
73
  margin-bottom: 10px;
74
- background-color: #222;
75
  color: #fff;
76
  border: 1px solid #555;
77
  border-radius: 4px;
78
  box-sizing: border-box;
79
  }
80
- .form-group { margin-bottom: 15px; }
81
  .hidden { display: none; }
82
  </style>
83
  </head>
84
  <body>
85
 
86
- <div class="gsmr-container">
87
- <div id="display" class="display">🔒 GERÄT GESPERRT&#10;&#10;Bitte System-PIN eingeben, um das Funkgerät zu starten.</div>
 
 
 
88
 
89
- <div id="pin-section">
90
- <div class="form-group">
91
- <label>GSM-R System-PIN:</label>
92
- <input type="password" id="input-pin" placeholder="****" maxlength="8">
 
 
93
  </div>
94
- <div class="btn" onclick="verifyPin()">🔓 Gerät freischalten</div>
95
- </div>
96
 
97
- <div id="register-section" class="hidden">
98
- <div class="form-group">
99
- <label>Betriebliche Zugnummer:</label>
100
- <input type="text" id="input-zugnr" placeholder="z.B. 4711">
 
 
 
 
 
 
 
 
 
101
  </div>
102
- <div class="form-group">
103
- <label>Rolle:</label>
104
- <select id="input-rolle">
105
- <option>Triebfahrzeugführer (Tf)</option>
106
- <option>Rangierleiter</option>
107
- </select>
 
 
 
 
 
 
 
 
 
 
 
 
 
108
  </div>
109
- <div class="btn" onclick="registerTrain()">📡 Im Netz registrieren</div>
110
  </div>
111
 
112
- <div id="control-section" class="hidden">
113
- <div class="form-group">
114
- <label>Zuständiges Stellwerk wählen:</label>
115
- <select id="input-fdl">
116
- <option>Fdl Bonn Hbf</option>
117
- <option>Fdl Lindau Hbf</option>
118
- <option>Fdl Neukirchen Hbf</option>
119
- <option>Zentraler Fdl (Strecke)</option>
120
- </select>
121
  </div>
122
- <div class="row">
123
- <div class="btn" onclick="triggerCall('FDL_ANRUF')">📞 Fdl rufen</div>
124
- <div class="btn" onclick="triggerCall('TRENNEN')">❌ Trennen</div>
 
 
 
 
 
 
 
125
  </div>
126
- <div class="row">
127
- <div class="btn btn-wechsel" onclick="changeZugnummer()">🔄 Nr. wechseln</div>
128
- <div class="btn btn-notruf" onclick="triggerCall('NOTRUF')">🚨 NOTRUF</div>
 
 
 
 
129
  </div>
130
  </div>
 
131
  </div>
132
 
133
  <script>
 
134
  let currentPin = "";
135
  let currentZug = "";
136
  let currentRolle = "";
137
 
 
 
 
 
 
 
 
 
 
 
 
138
  const display = document.getElementById("display");
 
 
 
139
 
 
140
  function verifyPin() {
141
  const pin = document.getElementById("input-pin").value;
142
  if (!pin) return alert("Bitte PIN eingeben!");
143
 
144
  currentPin = pin;
145
- showRegisterSection();
146
- }
147
-
148
- function showRegisterSection() {
149
  display.innerHTML = "📡 DB Netz GSM-R\n📶 [|||||]\n\nGerät bereit.\nBitte Zugfunkregistrierung durchführen.";
150
  document.getElementById("pin-section").classList.add("hidden");
151
- document.getElementById("control-section").classList.add("hidden");
152
  document.getElementById("register-section").classList.remove("hidden");
153
-
154
- // Input-Feld leeren für die neue Nummer
155
- document.getElementById("input-zugnr").value = "";
 
156
  }
157
 
 
158
  async function registerTrain() {
159
  const zugnr = document.getElementById("input-zugnr").value;
160
  const rolle = document.getElementById("input-rolle").value;
161
-
162
  if (!zugnr) return alert("Bitte eine Zugnummer eingeben!");
163
 
164
  currentZug = zugnr;
@@ -170,19 +253,17 @@
170
  document.getElementById("register-section").classList.add("hidden");
171
  document.getElementById("control-section").classList.remove("hidden");
172
  } else {
173
- alert("Fehler bei Registrierung. PIN eventuell falsch?");
174
  location.reload();
175
  }
176
  }
177
 
178
- async function changeZugnummer() {
179
- // Schicke erst eine Abmeldung für die alte Nummer an Discord
180
- display.innerHTML = "🔄 Melde Zugnummer ab...";
181
- await sendEvent("TRENNEN");
182
-
183
- // Setze Zug-Kontext zurück und springe zur Auswahl
184
  currentZug = "";
185
- showRegisterSection();
 
 
186
  }
187
 
188
  function updateDisplayStatus(statusText) {
@@ -190,17 +271,86 @@
190
  display.innerHTML = `📡 DB Netz GSM-R | 📶 [|||||]\n---------------------------\nZugnummer: ${currentZug}\nFKA: ${prefix}${currentZug}\nStatus: ${statusText}`;
191
  }
192
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
193
  async function triggerCall(eventType) {
194
  const fdl = document.getElementById("input-fdl").value;
195
-
196
  if (eventType === "NOTRUF") {
197
- display.innerHTML = `🚨🚨 NOTRUF AKTIV 🚨🚨\n---------------------------\nGruppe 200 (Streckenfunk)\nSende Notrufsignal...`;
198
  } else if (eventType === "FDL_ANRUF") {
199
  display.innerHTML = `📞 Verbindung aufbauen...\n---------------------------\nAnruf bei:\n${fdl}`;
200
  } else if (eventType === "TRENNEN") {
201
  updateDisplayStatus("Verbindung beendet");
202
  }
203
-
204
  await sendEvent(eventType, fdl);
205
  }
206
 
@@ -219,7 +369,7 @@
219
  });
220
  return response.ok;
221
  } catch (error) {
222
- console.error("Netzwerkfehler:", error);
223
  return false;
224
  }
225
  }
 
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Zug-Führerstand: GSM-R & FiS</title>
7
  <style>
8
  body {
9
  background-color: #1a1a1a;
 
12
  display: flex;
13
  justify-content: center;
14
  align-items: center;
15
+ min-height: 100vh;
16
  margin: 0;
17
+ padding: 20px;
18
+ box-sizing: border-box;
19
+ }
20
+ .cab-setup {
21
+ display: flex;
22
+ gap: 30px;
23
+ background-color: #222222;
24
+ padding: 30px;
25
+ border-radius: 16px;
26
+ box-shadow: 0 15px 35px rgba(0,0,0,0.8);
27
+ border: 2px solid #333;
28
  }
29
+ .panel {
30
  background-color: #333333;
31
  border: 6px solid #444444;
32
  border-radius: 12px;
33
  padding: 20px;
34
  width: 380px;
35
+ box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
36
+ }
37
+ h3 {
38
+ margin-top: 0;
39
+ text-align: center;
40
+ text-transform: uppercase;
41
+ font-size: 14px;
42
+ letter-spacing: 1px;
43
+ color: #aaa;
44
+ border-bottom: 1px solid #444;
45
+ padding-bottom: 8px;
46
  }
47
  .display {
48
  background-color: #7fa375;
 
58
  font-size: 14px;
59
  white-space: pre-wrap;
60
  }
61
+ /* DB Innenanzeiger Stil (Schriftart nachempfunden) */
62
+ .db-fis-display {
63
+ background-color: #000000;
64
+ color: #ff3c00; /* Typisches DB-ZID Orange */
65
+ font-family: 'Courier New', monospace;
66
+ text-transform: uppercase;
67
+ font-weight: bold;
68
+ padding: 10px;
69
+ border: 4px solid #111;
70
+ border-radius: 4px;
71
+ height: 45px;
72
+ display: flex;
73
+ align-items: center;
74
+ justify-content: space-between;
75
+ box-shadow: 0 0 15px rgba(255, 60, 0, 0.4);
76
+ margin-bottom: 15px;
77
+ font-size: 16px;
78
+ letter-spacing: 1px;
79
+ }
80
+ .db-fis-display .next-station {
81
+ animation: blink 1.5s infinite steps(1, start);
82
+ }
83
  .row {
84
  display: flex;
85
  gap: 10px;
 
98
  user-select: none;
99
  }
100
  .btn:active { background-color: #444; }
101
+ .btn-notruf { background-color: #b30000; color: white; border-color: #660000; }
 
 
 
 
102
  .btn-notruf:active { background-color: #8b0000; }
103
+ .btn-pfeil { background-color: #3b6285; border-color: #1f374d; font-size: 18px; }
104
+ .btn-pfeil:active { background-color: #29455e; }
105
+
 
 
 
106
  input, select {
107
  width: 100%;
108
  padding: 8px;
109
  margin-bottom: 10px;
110
+ background-color: #111;
111
  color: #fff;
112
  border: 1px solid #555;
113
  border-radius: 4px;
114
  box-sizing: border-box;
115
  }
116
+ .form-group { margin-bottom: 12px; }
117
  .hidden { display: none; }
118
  </style>
119
  </head>
120
  <body>
121
 
122
+ <div class="cab-setup">
123
+
124
+ <div class="panel">
125
+ <h3>📟 Zugfunk (GSM-R MESA 23)</h3>
126
+ <div id="display" class="display">🔒 GERÄT GESPERRT&#10;&#10;Bitte System-PIN eingeben, um Führerstand freizuschalten.</div>
127
 
128
+ <div id="pin-section">
129
+ <div class="form-group">
130
+ <label>System-PIN:</label>
131
+ <input type="password" id="input-pin" placeholder="****" maxlength="8">
132
+ </div>
133
+ <div class="btn" onclick="verifyPin()">🔓 Systeme hochfahren</div>
134
  </div>
 
 
135
 
136
+ <div id="register-section" class="hidden">
137
+ <div class="form-group">
138
+ <label>Betriebliche Zugnummer:</label>
139
+ <input type="text" id="input-zugnr" placeholder="z.B. 81023">
140
+ </div>
141
+ <div class="form-group">
142
+ <label>Rolle:</label>
143
+ <select id="input-rolle">
144
+ <option>Triebfahrzeugführer (Tf)</option>
145
+ <option>Rangierleiter</option>
146
+ </select>
147
+ </div>
148
+ <div class="btn" onclick="registerTrain()">📡 Im Funknetz registrieren</div>
149
  </div>
150
+
151
+ <div id="control-section" class="hidden">
152
+ <div class="form-group">
153
+ <label>Zuständiges Stellwerk:</label>
154
+ <select id="input-fdl">
155
+ <option>Fdl Bonn Hbf</option>
156
+ <option>Fdl Lindau Hbf</option>
157
+ <option>Fdl Neukirchen Hbf</option>
158
+ <option>Zentraler Fdl (Strecke)</option>
159
+ </select>
160
+ </div>
161
+ <div class="row">
162
+ <div class="btn" onclick="triggerCall('FDL_ANRUF')">📞 Fdl rufen</div>
163
+ <div class="btn" onclick="triggerCall('TRENNEN')">❌ Trennen</div>
164
+ </div>
165
+ <div class="row">
166
+ <div class="btn" style="background-color:#d4a373; color:#222;" onclick="changeZugnummer()">🔄 Nr. wechseln</div>
167
+ <div class="btn btn-notruf" onclick="triggerCall('NOTRUF')">🚨 NOTRUF</div>
168
+ </div>
169
  </div>
 
170
  </div>
171
 
172
+
173
+ <div class="panel">
174
+ <h3>📺 Fahrgastraum-Anzeige (ZID)</h3>
175
+ <div class="db-fis-display">
176
+ <span id="zid-line">---</span>
177
+ <span id="zid-station">ZID INAKTIV</span>
 
 
 
178
  </div>
179
+
180
+ <h3>🎛️ FiS-Steuergerät</h3>
181
+ <div id="fis-display" class="display" style="background-color: #2c3e50; color: #ecf0f1; height: 100px;">🔒 FiS gesperrt.<br>Wartet auf Systemfreischaltung...</div>
182
+
183
+ <div id="fis-setup-section" class="hidden">
184
+ <div class="form-group">
185
+ <label>Fis-Zielcode eintippen (z.B. 101, 102):</label>
186
+ <input type="text" id="input-zielcode" placeholder="Code eingeben...">
187
+ </div>
188
+ <div class="btn" onclick="loadRoute()">📥 Route in FiS laden</div>
189
  </div>
190
+
191
+ <div id="fis-active-section" class="hidden">
192
+ <div class="row">
193
+ <div class="btn btn-pfeil" onclick="prevStation()">◀ Zurück</div>
194
+ <div class="btn btn-pfeil" onclick="nextStation()">Weiter ▶</div>
195
+ </div>
196
+ <div class="btn" style="background-color: #7f8c8d;" onclick="resetFis()">🔄 Route wechseln</div>
197
  </div>
198
  </div>
199
+
200
  </div>
201
 
202
  <script>
203
+ // System Variablen
204
  let currentPin = "";
205
  let currentZug = "";
206
  let currentRolle = "";
207
 
208
+ // FiS Strecken-Datenbank (Beispielrouten passend zu deinen Stellwerken)
209
+ const routes = {
210
+ "101": { line: "RE5", stations: ["Bonn Hbf", "Köln Hbf", "Düsseldorf Hbf"] },
211
+ "102": { line: "S23", stations: ["Bonn Hbf", "Alfter", "Meckenheim", "Euskirchen"] },
212
+ "201": { line: "RB99", stations: ["Lindau Hbf", "Friedrichshafen", "Ulm Hbf"] },
213
+ "004": { line: "ZUG", stations: ["Dienstfahrt", "Nicht einsteigen"] }
214
+ };
215
+
216
+ let activeRoute = null;
217
+ let stationIndex = 0;
218
+
219
  const display = document.getElementById("display");
220
+ const fisDisplay = document.getElementById("fis-display");
221
+ const zidLine = document.getElementById("zid-line");
222
+ const zidStation = document.getElementById("zid-station");
223
 
224
+ // 1. PIN FREISCHALTUNG
225
  function verifyPin() {
226
  const pin = document.getElementById("input-pin").value;
227
  if (!pin) return alert("Bitte PIN eingeben!");
228
 
229
  currentPin = pin;
230
+
231
+ // GSM-R bereit machen
 
 
232
  display.innerHTML = "📡 DB Netz GSM-R\n📶 [|||||]\n\nGerät bereit.\nBitte Zugfunkregistrierung durchführen.";
233
  document.getElementById("pin-section").classList.add("hidden");
 
234
  document.getElementById("register-section").classList.remove("hidden");
235
+
236
+ // FiS bereit machen
237
+ fisDisplay.innerHTML = "FiS Terminal V2.4\nBitte Route über Zielcode laden.";
238
+ document.getElementById("fis-setup-section").classList.remove("hidden");
239
  }
240
 
241
+ // 2. GSM-R REGISTRIERUNG
242
  async function registerTrain() {
243
  const zugnr = document.getElementById("input-zugnr").value;
244
  const rolle = document.getElementById("input-rolle").value;
 
245
  if (!zugnr) return alert("Bitte eine Zugnummer eingeben!");
246
 
247
  currentZug = zugnr;
 
253
  document.getElementById("register-section").classList.add("hidden");
254
  document.getElementById("control-section").classList.remove("hidden");
255
  } else {
256
+ alert("Fehler bei Registrierung. PIN falsch?");
257
  location.reload();
258
  }
259
  }
260
 
261
+ function changeZugnummer() {
262
+ sendEvent("TRENNEN");
 
 
 
 
263
  currentZug = "";
264
+ display.innerHTML = "📡 DB Netz GSM-R\n\nBitte neue Zugnummer registrieren.";
265
+ document.getElementById("control-section").classList.add("hidden");
266
+ document.getElementById("register-section").classList.remove("hidden");
267
  }
268
 
269
  function updateDisplayStatus(statusText) {
 
271
  display.innerHTML = `📡 DB Netz GSM-R | 📶 [|||||]\n---------------------------\nZugnummer: ${currentZug}\nFKA: ${prefix}${currentZug}\nStatus: ${statusText}`;
272
  }
273
 
274
+ // 3. FiS STEUERUNG & INNENANZEIGER LOGIK
275
+ function loadRoute() {
276
+ const code = document.getElementById("input-zielcode").value;
277
+ if (!routes[code]) {
278
+ fisDisplay.innerHTML = `❌ Code [${code}] unbekannt!\nBitte gültigen FiS-Code eingeben.`;
279
+ return;
280
+ }
281
+
282
+ activeRoute = routes[code];
283
+ stationIndex = 0;
284
+
285
+ document.getElementById("fis-setup-section").classList.add("hidden");
286
+ document.getElementById("fis-active-section").classList.remove("hidden");
287
+
288
+ updateFisTerminal();
289
+ updateZidDisplay();
290
+ }
291
+
292
+ function updateFisTerminal() {
293
+ if (!activeRoute) return;
294
+ const current = activeRoute.stations[stationIndex];
295
+ const next = activeRoute.stations[stationIndex + 1] || "-- Endstation --";
296
+
297
+ fisDisplay.innerHTML = `Linie: ${activeRoute.line} | Code: Active\nAktuell: ${current}\nNächster Halt: ${next}`;
298
+ }
299
+
300
+ function updateZidDisplay() {
301
+ if (!activeRoute) return;
302
+ zidLine.innerHTML = activeRoute.line;
303
+
304
+ const current = activeRoute.stations[stationIndex];
305
+ const isEndstation = stationIndex === activeRoute.stations.length - 1;
306
+
307
+ if (current === "Dienstfahrt" || current === "Pause") {
308
+ zidStation.innerHTML = current;
309
+ } else if (isEndstation) {
310
+ zidStation.innerHTML = `Ziel: ${current}`;
311
+ } else {
312
+ zidStation.innerHTML = `Nächster Halt: ${current}`;
313
+ }
314
+ }
315
+
316
+ function nextStation() {
317
+ if (!activeRoute) return;
318
+ if (stationIndex < activeRoute.stations.length - 1) {
319
+ stationIndex++;
320
+ updateFisTerminal();
321
+ updateZidDisplay();
322
+ }
323
+ }
324
+
325
+ function prevStation() {
326
+ if (!activeRoute) return;
327
+ if (stationIndex > 0) {
328
+ stationIndex--;
329
+ updateFisTerminal();
330
+ updateZidDisplay();
331
+ }
332
+ }
333
+
334
+ function resetFis() {
335
+ activeRoute = null;
336
+ zidLine.innerHTML = "---";
337
+ zidStation.innerHTML = "FIS BEREIT";
338
+ fisDisplay.innerHTML = "FiS Terminal V2.4\nBitte Route über Zielcode laden.";
339
+ document.getElementById("input-zielcode").value = "";
340
+ document.getElementById("fis-active-section").classList.add("hidden");
341
+ document.getElementById("fis-setup-section").classList.remove("hidden");
342
+ }
343
+
344
+ // 4. NETWORK COMM (FASTAPI -> DISCORD)
345
  async function triggerCall(eventType) {
346
  const fdl = document.getElementById("input-fdl").value;
 
347
  if (eventType === "NOTRUF") {
348
+ display.innerHTML = `🚨🚨 NOTRUF AKTIV 🚨🚨\n---------------------------\nSende Notrufsignal...`;
349
  } else if (eventType === "FDL_ANRUF") {
350
  display.innerHTML = `📞 Verbindung aufbauen...\n---------------------------\nAnruf bei:\n${fdl}`;
351
  } else if (eventType === "TRENNEN") {
352
  updateDisplayStatus("Verbindung beendet");
353
  }
 
354
  await sendEvent(eventType, fdl);
355
  }
356
 
 
369
  });
370
  return response.ok;
371
  } catch (error) {
372
+ console.error(error);
373
  return false;
374
  }
375
  }