Version 2 (modified by 3 months ago) ( diff ) | ,
---|
Старт на инстанца на линија
Инстанца на линија може да стартува само Возач.
Симулација на real-time сигнал од автобус
При старт на инстанца се испалува евент:
return instancaNaLinijaRepository .save(instanca) .let { publisher.publishEvent(StartRouteEvent(it)) dtoMapper.toRouteInstanceResponse(it) }
Евентот се слуша овде:
@Async @EventListener fun startRouteEvent(event: StartRouteEvent) { println(event) println(event) val instance = event.source as InstancaNaLinija val line = instance.linija val direction = instance.pravec val stations = stationService.findStationsByLineIdAndDirectionId(line.id, direction.id) simulator.simulate(instance, stations) } @Async @EventListener fun routeInstanceOnStation(event: RouteInstanceOnStationEvent) { println("------------------------------------------------") println(event) val source = event.source as RouteInstanceOnStation routeInstanceOnStationService.create(source.instance.id, source.station.id, source.timestamp) // todo: publish event to the websocket so that the user gets notified webSocketService.sendMessage("routes", "Updated routes") } @EventListener fun stopRouteEvent(event: StopRouteInstanceEvent) { val instance = event.source as InstancaNaLinija routeInstanceService.stop(instance.id) }
Се стартува симулатор кој симулира пингови од GPS на автобус.
Attachments (2)
- старт-рута.png (73.0 KB ) - added by 3 months ago.
- старт-рута-2.png (70.5 KB ) - added by 3 months ago.
Download all attachments as: .zip
Note:
See TracWiki
for help on using the wiki.