Commit 110b5aa
Refactor SimulationController to callback-based lifecycle API and move EDT UI updates into Frame (#488)
* refactor: decouple SimulationController from Swing components
Agent-Logs-Url: https://github.com/bedaHovorka/interlockSim/sessions/01419796-a691-46e1-ae10-8c1373a9ee18
Co-authored-by: bedaHovorka <5263405+bedaHovorka@users.noreply.github.com>
* test: adapt SimulationController tests to callback-based UI wiring
Agent-Logs-Url: https://github.com/bedaHovorka/interlockSim/sessions/01419796-a691-46e1-ae10-8c1373a9ee18
Co-authored-by: bedaHovorka <5263405+bedaHovorka@users.noreply.github.com>
* fix: handle stopped runner detachment and initial speed callback
Agent-Logs-Url: https://github.com/bedaHovorka/interlockSim/sessions/e88ff78a-7a85-4ecd-9542-da0b8e356164
Co-authored-by: bedaHovorka <5263405+bedaHovorka@users.noreply.github.com>
* fix: resolve four Important issues from code review
- StatusBar.propertyChange: dispatch label update via invokeLater when
called from non-EDT thread (EDT violation now always reachable since
StatusBar stays visible during simulation)
- SimulationControlPanel: add onSpeedChanged callback wired to
SimulationController.setSpeed() so desiredSpeed stays in sync; speed
selected via slider/preset is now honoured after stop+start
- Frame.setContext: close previous SimulationContext after new wiring to
prevent Koin scope leak on repeated Simulation > Start... invocations
- SimulationControllerTest: replace Thread.sleep(100) with flushEDT(times=3)
to eliminate timing-dependent flakiness in stale-monitor test
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: bedaHovorka <5263405+bedaHovorka@users.noreply.github.com>
Co-authored-by: Bedrich Hovorka <bedrich.hovorka@gmail.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 3f30b97 commit 110b5aa
9 files changed
Lines changed: 293 additions & 102 deletions
File tree
- core-test/src/commonMain/kotlin/cz/vutbr/fit/interlockSim/testutil
- desktop-ui/src
- main/kotlin/cz/vutbr/fit/interlockSim/gui
- test/kotlin/cz/vutbr/fit/interlockSim/gui
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
51 | 55 | | |
52 | 56 | | |
53 | 57 | | |
| |||
104 | 108 | | |
105 | 109 | | |
106 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
107 | 115 | | |
108 | 116 | | |
109 | 117 | | |
| |||
Lines changed: 47 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
116 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
117 | 141 | | |
118 | 142 | | |
119 | 143 | | |
| |||
141 | 165 | | |
142 | 166 | | |
143 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
144 | 172 | | |
145 | 173 | | |
146 | 174 | | |
| |||
256 | 284 | | |
257 | 285 | | |
258 | 286 | | |
| 287 | + | |
| 288 | + | |
259 | 289 | | |
260 | 290 | | |
261 | 291 | | |
| |||
291 | 321 | | |
292 | 322 | | |
293 | 323 | | |
| 324 | + | |
| 325 | + | |
294 | 326 | | |
295 | 327 | | |
296 | 328 | | |
| |||
397 | 429 | | |
398 | 430 | | |
399 | 431 | | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
400 | 446 | | |
401 | 447 | | |
402 | 448 | | |
| |||
Lines changed: 15 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
89 | 101 | | |
90 | 102 | | |
91 | 103 | | |
| |||
110 | 122 | | |
111 | 123 | | |
112 | 124 | | |
| 125 | + | |
113 | 126 | | |
114 | 127 | | |
115 | 128 | | |
| |||
141 | 154 | | |
142 | 155 | | |
143 | 156 | | |
144 | | - | |
| 157 | + | |
145 | 158 | | |
146 | 159 | | |
147 | 160 | | |
| 161 | + | |
148 | 162 | | |
149 | 163 | | |
150 | 164 | | |
| |||
Lines changed: 41 additions & 49 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
17 | | - | |
18 | 16 | | |
19 | 17 | | |
20 | 18 | | |
| |||
27 | 25 | | |
28 | 26 | | |
29 | 27 | | |
30 | | - | |
31 | | - | |
| 28 | + | |
32 | 29 | | |
33 | 30 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
38 | 34 | | |
39 | 35 | | |
40 | | - | |
| 36 | + | |
41 | 37 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
47 | 45 | | |
48 | 46 | | |
49 | 47 | | |
50 | 48 | | |
51 | | - | |
52 | | - | |
53 | | - | |
| 49 | + | |
| 50 | + | |
54 | 51 | | |
55 | 52 | | |
56 | 53 | | |
| |||
82 | 79 | | |
83 | 80 | | |
84 | 81 | | |
85 | | - | |
| 82 | + | |
86 | 83 | | |
87 | | - | |
| 84 | + | |
88 | 85 | | |
89 | 86 | | |
90 | 87 | | |
| |||
103 | 100 | | |
104 | 101 | | |
105 | 102 | | |
106 | | - | |
| 103 | + | |
107 | 104 | | |
108 | 105 | | |
109 | 106 | | |
110 | 107 | | |
111 | 108 | | |
112 | 109 | | |
113 | 110 | | |
114 | | - | |
| 111 | + | |
115 | 112 | | |
116 | 113 | | |
117 | 114 | | |
| 115 | + | |
118 | 116 | | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
| 117 | + | |
124 | 118 | | |
125 | 119 | | |
126 | 120 | | |
127 | 121 | | |
128 | 122 | | |
129 | 123 | | |
130 | | - | |
| 124 | + | |
131 | 125 | | |
132 | | - | |
133 | | - | |
134 | | - | |
| 126 | + | |
| 127 | + | |
135 | 128 | | |
136 | 129 | | |
137 | 130 | | |
| |||
144 | 137 | | |
145 | 138 | | |
146 | 139 | | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
161 | 149 | | |
162 | 150 | | |
163 | 151 | | |
| |||
168 | 156 | | |
169 | 157 | | |
170 | 158 | | |
171 | | - | |
| 159 | + | |
172 | 160 | | |
173 | 161 | | |
174 | 162 | | |
| |||
177 | 165 | | |
178 | 166 | | |
179 | 167 | | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
| 168 | + | |
| 169 | + | |
184 | 170 | | |
185 | 171 | | |
186 | 172 | | |
| |||
215 | 201 | | |
216 | 202 | | |
217 | 203 | | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
218 | 210 | | |
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
93 | 95 | | |
94 | 96 | | |
95 | 97 | | |
| |||
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
288 | 307 | | |
0 commit comments