Skip to content

Commit 19e086d

Browse files
Merge pull request #132 from Andreas-Kreuz/intersection-images
Frontend refresh
2 parents cabc40a + 27dfa11 commit 19e086d

File tree

72 files changed

+5521
-2002
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+5521
-2002
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ scratch.*
5757
# System files
5858
.DS_Store
5959
Thumbs.db
60+
desktop.ini
6061

6162
# Jekyll documentation files
6263
_site
@@ -106,3 +107,4 @@ luac.out
106107
*.hex
107108

108109

110+
web-app/src/app/client/modules/intersection/intersection-lane-display/example-svg.ts

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Änderungen an der Software
22

3+
## v0.12.0
4+
5+
- ⭐ Neu: Verbesserte Ansicht auf dem Smartphone
6+
- ⭐ Neu: Log-Ansicht: Verzicht auf doppelte Toolbar
7+
- ⭐ Neu: Einstellungen für Kreuzungen und Log sind in die Toolbar gewandert (Icon oben rechts)
8+
- ⭐ Neu: In der Toolbar (und im Browser-Tab) wird der Titel der aktuellen Seite angezeigt
9+
- ⭐ Neu: Geschwindigkeit für das Logging verbessert (Log-Ausgabe auf 10.000 Zeilen beschränkt)
10+
311
## v.0.11.1
412

513
### Lua (0.11.1)

lua/LUA/ak/road/CrossingJsonCollector.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ local function collect(allCrossings)
143143
waitingTrains = {},
144144
waitingForGreenCyclesCount = lane.waitCount,
145145
directions = lane.directions,
146-
switchings = laneSequences[lane] or {}
146+
switchings = laneSequences[lane] or {},
147+
tracks = lane.tracksForHighlighting or {}
147148
}
148149
for i, f in pairs(lane.queue:elements()) do o.waitingTrains[i] = f end
149150
table.insert(intersectionLanes, o)

lua/LUA/ak/road/Lane.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ local fmt = require("ak.core.eep.TippTextFormatter")
1111
---@field name string
1212
---@field private type string ("Lane")
1313
---@field trafficLight TrafficLight
14+
---@field tracksForHighlighting table
1415
---@field tracksForRequests table
1516
local Lane = {}
1617
Lane.debug = AkStartWithDebug or false
@@ -444,6 +445,13 @@ function Lane:switchTrafficLightTo(phase, grund)
444445
self.phase = phase
445446
end
446447

448+
function Lane:setHighLightingTracks(...)
449+
for _, track in ipairs({...}) do assert(type(track) == "number", "Provide tracks as numbers") end
450+
451+
self.tracksForHighlighting = {...} or {}
452+
return self
453+
end
454+
447455
function Lane:setDirections(...)
448456
for _, direction in pairs(...) do
449457
if not Lane.Directions[direction] then print("No such direction: " .. direction) end

scripts/README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,23 @@ Benutze danach das Skript `.\scripts\build-package.cmd` um das ganze Programm ei
8585

8686
Dabei werden App, Server und Lua in eine EEP-Installationsdatei zusammengepackt.
8787

88-
### Server im Entwicklungsmodus starten
88+
### Testmodus starten
8989

90-
Das Skript `.\scripts\start-web-server.cmd` startet den Server im Testmodus. Das erlaubt das lokale Verwenden des Servers, während Du die App entwickelst.
90+
Das Skript `.\scripts\start-developing.cmd` startet den Server und die Web-App im "Testmodus".
91+
Das erlaubt das automatische Ausführen von Test, während Du die App entwickelst.
92+
Der Testmodus zeigt unter <http://localhost:4200/> die Daten des aktuellen Tests an. Willst Du Deine Anlage in EEP sehen, kannst Du den Spielmodus starten.
9193

92-
### App im Entwicklungsmodus starten
94+
#### Von Hand testen
9395

94-
Das Skript `.\scripts\start-web-app.cmd` startet die Web-App. Du findest sie nach dem Start unter <http://localhost:4200/>. Der Web-Server kann dann genutzt werden, um die Web-App mit Daten zu versorgen. Er muss auf dem selben Rechner gestartet werden.
96+
Wenn Du vor dem Upload selbst testen willst, kannst Du
97+
98+
- Tests für Lua ausführen: `.\scripts\check-lua.cmd`
99+
- Web-App Tests ausführen: `.\scripts\check-web-app-e2e.cmd`
100+
101+
### Spielmodus starten
102+
103+
Das Skript `.\scripts\start-playing.cmd` starten den Server und die Web-App im "Spielmodus".
104+
Der Spielmodus zeigt unter <http://localhost:4200/> die aktuell in EEP geöffnete Anlage an.
95105

96106
## Sonstiges
97107

web-app/cypress/integration/modules/trains/trains_spec.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,59 +8,59 @@ before(() => {
88

99
describe('Trains generally', () => {
1010
it('should contain an expand button which toggles the expansion', () => {
11-
cy.visit('/trains/road');
12-
cy.get('#expand-btn0').contains('expand_more').click();
13-
cy.get('#expand-btn0').contains('expand_less').click();
11+
cy.visit('/trains/rail');
12+
cy.get('#expand-btn1').contains('expand_more').click();
13+
cy.get('#expand-btn1').contains('expand_less').click();
1414
});
1515

1616
describe('have a cam button', () => {
1717
it('click 1 on cam will change to rolling stock camera', () => {
18-
cy.visit('/trains/road');
19-
cy.get('#expand-btn0').contains('expand_more').click();
18+
cy.visit('/trains/rail');
19+
cy.get('#expand-btn1').contains('expand_more').click();
2020
cy.get('#cam-btn0').contains('videocam').click();
2121
cy.readFile(simulator.fileNames.serverOutCommands, 'latin1').should(
2222
'eq',
23-
'EEPRollingstockSetActive|6MGT Wagen 1 DVBAG\nEEPRollingstockSetUserCamera|6MGT Wagen 1 DVBAG|14.55|-3|5|15|80\n'
23+
'EEPRollingstockSetActive|DBAG_Regio-424-023-EpVI\nEEPRollingstockSetUserCamera|DBAG_Regio-424-023-EpVI|21.04|-3|5|15|80\n'
2424
);
2525
});
2626
it('click 2 on cam will change to perspective 3', () => {
2727
cy.writeFile(simulator.fileNames.serverOutCommands, '');
2828
cy.get('#cam-btn0').contains('videocam').click();
2929
cy.readFile(simulator.fileNames.serverOutCommands, 'latin1').should(
3030
'eq',
31-
'EEPSetPerspectiveCamera|3|#6MGT Wagen 1 DVBAG;001\n'
31+
'EEPSetPerspectiveCamera|3|#DBAG_Regio-424-023-EpVI\n'
3232
);
3333
});
3434
it('click 3 on cam will change to perspective 4', () => {
3535
cy.writeFile(simulator.fileNames.serverOutCommands, '');
3636
cy.get('#cam-btn0').contains('videocam').click();
3737
cy.readFile(simulator.fileNames.serverOutCommands, 'latin1').should(
3838
'eq',
39-
'EEPSetPerspectiveCamera|4|#6MGT Wagen 1 DVBAG;001\n'
39+
'EEPSetPerspectiveCamera|4|#DBAG_Regio-424-023-EpVI\n'
4040
);
4141
});
4242
it('click 4 on cam will change to perspective 10', () => {
4343
cy.writeFile(simulator.fileNames.serverOutCommands, '');
4444
cy.get('#cam-btn0').contains('videocam').click();
4545
cy.readFile(simulator.fileNames.serverOutCommands, 'latin1').should(
4646
'eq',
47-
'EEPSetPerspectiveCamera|10|#6MGT Wagen 1 DVBAG;001\n'
47+
'EEPSetPerspectiveCamera|10|#DBAG_Regio-424-023-EpVI\n'
4848
);
4949
});
5050
it('click 5 on cam will change to perspective 9', () => {
5151
cy.writeFile(simulator.fileNames.serverOutCommands, '');
5252
cy.get('#cam-btn0').contains('videocam').click();
5353
cy.readFile(simulator.fileNames.serverOutCommands, 'latin1').should(
5454
'eq',
55-
'EEPSetPerspectiveCamera|9|#6MGT Wagen 1 DVBAG;001\n'
55+
'EEPSetPerspectiveCamera|9|#DBAG_Regio-424-023-EpVI\n'
5656
);
5757
});
5858
it('click 6 on cam will back to rollingstock camera', () => {
5959
cy.writeFile(simulator.fileNames.serverOutCommands, '');
6060
cy.get('#cam-btn0').contains('videocam').click();
6161
cy.readFile(simulator.fileNames.serverOutCommands, 'latin1').should(
6262
'eq',
63-
'EEPRollingstockSetActive|6MGT Wagen 1 DVBAG\nEEPRollingstockSetUserCamera|6MGT Wagen 1 DVBAG|14.55|-3|5|15|80\n'
63+
'EEPRollingstockSetActive|DBAG_Regio-424-023-EpVI\nEEPRollingstockSetUserCamera|DBAG_Regio-424-023-EpVI|21.04|-3|5|15|80\n'
6464
);
6565
});
6666
});

web-app/e2e/tsconfig.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"compileOnSave": false,
3+
"compilerOptions": {
4+
"baseUrl": "/",
5+
"downlevelIteration": true,
6+
"outDir": "./dist/out-tsc",
7+
"sourceMap": true,
8+
"declaration": false,
9+
"module": "es2020",
10+
"moduleResolution": "node",
11+
"experimentalDecorators": true,
12+
"target": "es2015",
13+
"typeRoots": ["node_modules/@types"],
14+
"lib": ["es2018", "dom"]
15+
},
16+
"angularCompilerOptions": {
17+
"strictTemplates": true
18+
}
19+
}

0 commit comments

Comments
 (0)