diff --git a/Leibit.BLL/LiveDataBLL.cs b/Leibit.BLL/LiveDataBLL.cs index d709e59b..c417757f 100644 --- a/Leibit.BLL/LiveDataBLL.cs +++ b/Leibit.BLL/LiveDataBLL.cs @@ -231,6 +231,8 @@ public OperationResult SetExpectedDelay(LiveSchedule schedule, int? expect if (expectedDelayDeparture.HasValue) schedule.ExpectedDelayDeparture = expectedDelayDeparture; + schedule.IsManuallyModified = true; + var calculationResult = CalculationBLL.CalculateExpectedTimes(schedule.Train, schedule.Schedule.Station.ESTW); ValidateResult(calculationResult); @@ -290,6 +292,8 @@ public OperationResult ChangeTrack(LiveSchedule schedule, Track track) else schedule.LiveTrack = track; + schedule.IsManuallyModified = true; + __SynchronizeTwinSchedules(schedule.Train, schedule.Schedule.Station.ESTW); var result = new OperationResult(); diff --git a/Leibit.BLL/SerializationBLL.cs b/Leibit.BLL/SerializationBLL.cs index e7cc0019..ead22c4f 100644 --- a/Leibit.BLL/SerializationBLL.cs +++ b/Leibit.BLL/SerializationBLL.cs @@ -141,6 +141,7 @@ public OperationResult Save(string Filename, SerializationContai SerializedSchedule.IsComposed = Schedule.IsComposed; SerializedSchedule.IsPrepared = Schedule.IsPrepared; SerializedSchedule.IsCancelled = Schedule.IsCancelled; + SerializedSchedule.IsManuallyModified = Schedule.IsManuallyModified; if (Schedule.LiveTrack != null) SerializedSchedule.LiveTrack = Schedule.LiveTrack.Name; @@ -236,7 +237,7 @@ public OperationResult Open(string Filename) { var Estw = Area.ESTWs.SingleOrDefault(e => e.Id == SerializedTrain.CurrentEstwId); - if (Estw == null || !Estw.IsLoaded || !Area.Trains.ContainsKey(SerializedTrain.TrainNumber)) + if (Estw?.IsLoaded == false || !Area.Trains.ContainsKey(SerializedTrain.TrainNumber)) continue; var Train = Area.Trains[SerializedTrain.TrainNumber]; @@ -260,10 +261,10 @@ public OperationResult Open(string Filename) } } - if (Estw.Blocks.ContainsKey(SerializedTrain.Block)) + if (SerializedTrain.Block != null && Estw.Blocks.ContainsKey(SerializedTrain.Block)) LiveTrain.Block = Estw.Blocks[SerializedTrain.Block].FirstOrDefault(b => b.Direction == SerializedTrain.BlockDirection); - var SchedulesResult = CalculationBll.GetSchedulesByTime(Train.Schedules, Estw.Time); + var SchedulesResult = CalculationBll.GetSchedulesByTime(Train.Schedules, Estw?.Time ?? SerializedTrain.LastModified); ValidateResult(SchedulesResult); foreach (var SerializedSchedule in SerializedTrain.Schedules) @@ -285,6 +286,7 @@ public OperationResult Open(string Filename) LiveSchedule.IsComposed = SerializedSchedule.IsComposed; LiveSchedule.IsPrepared = SerializedSchedule.IsPrepared; LiveSchedule.IsCancelled = SerializedSchedule.IsCancelled; + LiveSchedule.IsManuallyModified = SerializedSchedule.IsManuallyModified; if (SerializedSchedule.ExpectedDelay.HasValue) { @@ -316,14 +318,17 @@ public OperationResult Open(string Filename) LiveTrain.AddSchedule(LiveSchedule); } - // Don't validate result here. When this fails, it's not so dramatic... - var prevResult = CalculationBll.GetPreviousService(Train, Estw); - if (prevResult.Succeeded) - LiveTrain.PreviousService = prevResult.Result; - - var followUpResult = CalculationBll.GetFollowUpService(Train, Estw); - if (followUpResult.Succeeded) - LiveTrain.FollowUpService = followUpResult.Result; + if (Estw != null) + { + // Don't validate result here. When this fails, it's not so dramatic... + var prevResult = CalculationBll.GetPreviousService(Train, Estw); + if (prevResult.Succeeded) + LiveTrain.PreviousService = prevResult.Result; + + var followUpResult = CalculationBll.GetFollowUpService(Train, Estw); + if (followUpResult.Succeeded) + LiveTrain.FollowUpService = followUpResult.Result; + } if (LiveTrain.Schedules.Any()) Area.LiveTrains.TryAdd(Train.Number, LiveTrain); diff --git a/Leibit.Client.WPF/Leibit.Client.WPF.csproj b/Leibit.Client.WPF/Leibit.Client.WPF.csproj index 35481e4c..e5ef575b 100644 --- a/Leibit.Client.WPF/Leibit.Client.WPF.csproj +++ b/Leibit.Client.WPF/Leibit.Client.WPF.csproj @@ -24,7 +24,7 @@ icon.ico - 0.5.2 + 0.5.3 https://github.com/jannikbecker/leibit https://github.com/jannikbecker/leibit diff --git a/Leibit.Client.WPF/Windows/Display/ViewModels/DisplayViewModelBase.cs b/Leibit.Client.WPF/Windows/Display/ViewModels/DisplayViewModelBase.cs index 41fa3f3d..94dc8a08 100644 --- a/Leibit.Client.WPF/Windows/Display/ViewModels/DisplayViewModelBase.cs +++ b/Leibit.Client.WPF/Windows/Display/ViewModels/DisplayViewModelBase.cs @@ -117,7 +117,7 @@ protected List GetScheduleCandidates(Area area, int leadMinutes, b if (referenceTime > currentTime.AddMinutes(leadMinutes)) continue; - if (liveSchedule.Train.Schedules.All(s => !s.IsArrived) && liveSchedule.Train.LastModified < schedule.Station.ESTW.Time) + if (referenceTime < currentTime && liveSchedule.Train.LastModified < currentTime) continue; candidates.Add(new ScheduleItem(referenceTime, schedule, liveSchedule)); diff --git a/Leibit.Client.WPF/Windows/Display/ViewModels/PlatformDisplayViewModel.cs b/Leibit.Client.WPF/Windows/Display/ViewModels/PlatformDisplayViewModel.cs index fac1ea71..b624f738 100644 --- a/Leibit.Client.WPF/Windows/Display/ViewModels/PlatformDisplayViewModel.cs +++ b/Leibit.Client.WPF/Windows/Display/ViewModels/PlatformDisplayViewModel.cs @@ -356,9 +356,8 @@ internal override void Refresh(Area area) { int? followUpService = __GetFollowUpService(currentItem); - if (followUpService.HasValue && area.Trains.ContainsKey(followUpService.Value) && !IsInTwinTrainMode) + if (followUpService.HasValue && area.Trains.TryGetValue(followUpService.Value, out var followUpTrain) && followUpTrain.Type.IsPassengerTrain() && !IsInTwinTrainMode) { - var followUpTrain = area.Trains[followUpService.Value]; infoTexts.Add($"Dieser Zug endet hier und fährt weiter als {followUpTrain.Type} {followUpTrain.Number} nach {followUpTrain.Destination}"); Via = string.Empty; CurrentTrainDestination = $"von {currentItem.Schedule.Start}"; diff --git a/Leibit.Client.WPF/Windows/TrainProgressInformation/ViewModels/TrainProgressInformationViewModel.cs b/Leibit.Client.WPF/Windows/TrainProgressInformation/ViewModels/TrainProgressInformationViewModel.cs index 2e730cfd..68702d49 100644 --- a/Leibit.Client.WPF/Windows/TrainProgressInformation/ViewModels/TrainProgressInformationViewModel.cs +++ b/Leibit.Client.WPF/Windows/TrainProgressInformation/ViewModels/TrainProgressInformationViewModel.cs @@ -546,7 +546,7 @@ Scheduled time | Visible | Reason return false; } - if (liveSchedule.Train.Schedules.All(s => !s.IsArrived) && liveSchedule.Train.LastModified < schedule.Station.ESTW.Time) + if (liveSchedule.Train.Schedules.All(s => !s.IsArrived) && liveSchedule.Train.LastModified < schedule.Station.ESTW.Time && !liveSchedule.IsManuallyModified) return false; return true; diff --git a/Leibit.Core/Data/berlin/B-Stadtbahn.xml b/Leibit.Core/Data/berlin/B-Stadtbahn.xml index 2be62783..753c6e5a 100644 --- a/Leibit.Core/Data/berlin/B-Stadtbahn.xml +++ b/Leibit.Core/Data/berlin/B-Stadtbahn.xml @@ -78,7 +78,7 @@ - + diff --git a/Leibit.Core/Data/passenger_trains.json b/Leibit.Core/Data/passenger_trains.json index 3c7c4db6..5c7246cb 100644 --- a/Leibit.Core/Data/passenger_trains.json +++ b/Leibit.Core/Data/passenger_trains.json @@ -1,8 +1,11 @@ { "trainTypes": [ + "CIS", "CNL", "D", "DNR", + "DPV", + "DRV", "DZ", "E", "EC", @@ -14,15 +17,27 @@ "IR", "IRE", "MET", + "NJ", "NWB", "NZ", "NZT", + "OEC", + "OIC", "R", "RB", "RE", + "REX", + "RGJ", + "RJ", + "RSB", "S", + "SB", + "SD", + "SDZ", "SE", + "SR", "STB", - "UEX" + "UEX", + "WB" ] } diff --git a/Leibit.Core/Data/sued/MKP.xml b/Leibit.Core/Data/sued/MKP.xml index be907a83..5264f3c2 100644 --- a/Leibit.Core/Data/sued/MKP.xml +++ b/Leibit.Core/Data/sued/MKP.xml @@ -273,11 +273,11 @@ - - + + - - + + @@ -294,17 +294,17 @@ - - + + - - + + - - + + - - + + diff --git a/Leibit.Entities/LiveData/LiveSchedule.cs b/Leibit.Entities/LiveData/LiveSchedule.cs index 0b51381a..e5dbd362 100644 --- a/Leibit.Entities/LiveData/LiveSchedule.cs +++ b/Leibit.Entities/LiveData/LiveSchedule.cs @@ -112,6 +112,8 @@ public LeibitTime ExpectedDeparture public bool IsCancelled { get; set; } + public bool IsManuallyModified { get; set; } + public ReadOnlyCollection Delays { get diff --git a/Leibit.Entities/Serialization/SerializedSchedule.cs b/Leibit.Entities/Serialization/SerializedSchedule.cs index 303a2c71..ff456b2b 100644 --- a/Leibit.Entities/Serialization/SerializedSchedule.cs +++ b/Leibit.Entities/Serialization/SerializedSchedule.cs @@ -29,5 +29,6 @@ public SerializedSchedule() public bool IsComposed { get; set; } public bool IsPrepared { get; set; } public bool IsCancelled { get; set; } + public bool IsManuallyModified { get; set; } } } diff --git a/assets/ESTWonline.zip b/assets/ESTWonline.zip index 349e88a8..b26227ba 100644 Binary files a/assets/ESTWonline.zip and b/assets/ESTWonline.zip differ diff --git a/assets/release_notes.md b/assets/release_notes.md index 06c0a229..cb46055a 100644 --- a/assets/release_notes.md +++ b/assets/release_notes.md @@ -2,9 +2,10 @@ Die Datei *Setup.exe* herunterladen und ausführen. Nach wenigen Sekunden startet LeiBIT. # Neue Funktionen in dieser Version -- Das ESTW Berlin-Stadtbahn steht nun zur Verfügung (#54). -- LeiBIT zeigt nun Vorgänger- und Folgeleistungen im Zuglauf und auf den Zugzielanzeigern an (#151). -- Die Fahrgastinformationsdisplays zeigen nun keine Güterzüge und Leerfahrten mehr an (#146). -- Es können nun auch Gleiswechsel und voraussichtliche Verspätungen für Züge eingegeben werden, die noch nicht im Stellbereich sind (#145). -- Im Zuglauf können Zugausfälle und Teilausfälle eingegeben werden (#147). -- Korrekturen und Verbesserungen in kleinerem Umfang \ No newline at end of file +In dieser Version wurden diverse Fehler korrigiert. +- Fehlerhafte Fahrplandatei in Berlin Alexanderplatz korrigiert (#167) +- Gleisbezeichnungen in Vils und Reutte korrigiert (#166) +- Österreichische und schweizerische Personenzuggattungen ergänzt (#161, #169) +- Darstellung von Wenden auf Leerfahrten verbessert (#163) +- Züge verschwinden nicht mehr aus der ZFI, wenn man einen Gleiswechsel oder eine voraussichtliche Verspätung eingegeben hat. (#162) +- ESTWonline auf Version 2.6.5 aktualisiert (#168) \ No newline at end of file