diff --git a/CRSim/App.xaml.cs b/CRSim/App.xaml.cs index 5e635c9..860e1ec 100644 --- a/CRSim/App.xaml.cs +++ b/CRSim/App.xaml.cs @@ -37,7 +37,7 @@ services.AddTransient(); services.AddTransient(); - services.AddTransient(); + services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddTransient(); @@ -61,6 +61,8 @@ services.AddTransient(); services.AddTransient(); services.AddTransient(); + services.AddTransient(); + services.AddTransient(); }).Build(); [STAThread] diff --git a/CRSim/Assets/StyleImages/Fuzhou/TicketCheckScreen.png b/CRSim/Assets/StyleImages/Fuzhou/TicketCheckScreen.png new file mode 100644 index 0000000..35a3994 Binary files /dev/null and b/CRSim/Assets/StyleImages/Fuzhou/TicketCheckScreen.png differ diff --git a/CRSim/CRSim.csproj b/CRSim/CRSim.csproj index bd4e5de..742eb44 100644 --- a/CRSim/CRSim.csproj +++ b/CRSim/CRSim.csproj @@ -14,6 +14,7 @@ + @@ -37,6 +38,7 @@ + diff --git a/CRSim/Models/StylesInfoData.json b/CRSim/Models/StylesInfoData.json index 3a7f133..edaf1f0 100644 --- a/CRSim/Models/StylesInfoData.json +++ b/CRSim/Models/StylesInfoData.json @@ -22,6 +22,18 @@ "Text" ] }, + { + "UniqueId": "Fuzhou TicketCheckScreen", + "Title": "福州站检票口看板", + "Station": "Fuzhou", + "StyleName": "TicketCheckScreenView", + "ImagePath": "Assets/StyleImages/Fuzhou/TicketCheckScreen.png", + "Parameters": [ + "Station", + "TicketCheck", + "Text" + ] + }, { "UniqueId": "BeijingXi PrimaryScreen", "Title": "北京西站主要看板", diff --git a/CRSim/ViewModels/Windows/ScreenViewModel.cs b/CRSim/ViewModels/Windows/ScreenViewModel.cs index 26a1ae3..7896819 100644 --- a/CRSim/ViewModels/Windows/ScreenViewModel.cs +++ b/CRSim/ViewModels/Windows/ScreenViewModel.cs @@ -19,6 +19,8 @@ namespace CRSim.ViewModels private Station _thisStation; [ObservableProperty] private string _thisPlatform; + [ObservableProperty] + private string _thisTicketCheck; public event PropertyChangedEventHandler PropertyChanged; public List TrainInfo { get; set; } = []; @@ -60,6 +62,7 @@ namespace CRSim.ViewModels { ThisStation = station; ThisPlatform = platform; + ThisTicketCheck = ticketCheck; var trains = station.StationStops; foreach (var trainNumber in trains) { diff --git a/CRSim/ViewModels/Windows/Stations/ChengduDong/PrimaryTicketCheckScreenViewModel.cs b/CRSim/ViewModels/Windows/Stations/ChengduDong/PrimaryTicketCheckScreenViewModel.cs index bb01d71..6cd0182 100644 --- a/CRSim/ViewModels/Windows/Stations/ChengduDong/PrimaryTicketCheckScreenViewModel.cs +++ b/CRSim/ViewModels/Windows/Stations/ChengduDong/PrimaryTicketCheckScreenViewModel.cs @@ -1,9 +1,9 @@ namespace CRSim.ViewModels.ChengduDong { - public class PlatformScreenViewModel : ScreenViewModel + public class PrimaryTicketCheckScreenViewModel : ScreenViewModel { public ObservableCollection Screen { get; set; } = []; - public PlatformScreenViewModel(ITimeService timeService, ISettingsService settingsService) + public PrimaryTicketCheckScreenViewModel(ITimeService timeService, ISettingsService settingsService) : base(timeService, settingsService) { Text = "持户口簿、护照、临时身份证的旅客,请在非居民身份证通道排队。请主动礼让老、弱、病、残、孕的旅客。"; diff --git a/CRSim/ViewModels/Windows/Stations/Fuzhou/TicketCheckScreenViewModel.cs b/CRSim/ViewModels/Windows/Stations/Fuzhou/TicketCheckScreenViewModel.cs new file mode 100644 index 0000000..b3148e8 --- /dev/null +++ b/CRSim/ViewModels/Windows/Stations/Fuzhou/TicketCheckScreenViewModel.cs @@ -0,0 +1,31 @@ +namespace CRSim.ViewModels.Fuzhou +{ + public class TicketCheckScreenViewModel : ScreenViewModel + { + public ObservableCollection Screen { get; set; } = []; + public TicketCheckScreenViewModel(ITimeService timeService, ISettingsService settingsService) + : base(timeService, settingsService) + { + Text = $"开车前{settingsService.GetSettings().StopCheckInAdvanceDuration.TotalMinutes}分钟停止检票"; + timeService.RefreshSecondsElapsed += RefreshDisplay; + Initialize(); + } + private async void Initialize() + { + ItemsPerPage = 4; + await WaitForDataLoadAsync(); + RefreshDisplay(null,null); + } + private void RefreshDisplay(object? sender, EventArgs e) + { + Application.Current.Dispatcher.Invoke(() => + { + Screen.Clear(); + for (int i = 0; i < ItemsPerPage; i++) + { + Screen.Add(TrainInfo.Count > i ? TrainInfo[i] : new()); + } + }); + } + } +} diff --git a/CRSim/Views/Windows/Stations/BeijingXi/PrimaryScreenView.xaml.cs b/CRSim/Views/Windows/Stations/BeijingXi/PrimaryScreenView.xaml.cs index 7765b08..8ac26fc 100644 --- a/CRSim/Views/Windows/Stations/BeijingXi/PrimaryScreenView.xaml.cs +++ b/CRSim/Views/Windows/Stations/BeijingXi/PrimaryScreenView.xaml.cs @@ -11,6 +11,7 @@ namespace CRSim.Views.BeijingXi public PrimaryScreenView(PrimaryScreenViewModel viewModel) { InitializeComponent(); + RenderOptions.SetEdgeMode(this, EdgeMode.Aliased); ViewModel = viewModel; DataContext = viewModel; } diff --git a/CRSim/Views/Windows/Stations/ChengduDong/PrimaryTicketCheckScreenView.xaml.cs b/CRSim/Views/Windows/Stations/ChengduDong/PrimaryTicketCheckScreenView.xaml.cs index 3441c4f..7d43eea 100644 --- a/CRSim/Views/Windows/Stations/ChengduDong/PrimaryTicketCheckScreenView.xaml.cs +++ b/CRSim/Views/Windows/Stations/ChengduDong/PrimaryTicketCheckScreenView.xaml.cs @@ -7,10 +7,11 @@ namespace CRSim.Views.ChengduDong /// public partial class PrimaryTicketCheckScreenView : Window { - public PlatformScreenViewModel ViewModel { get; } - public PrimaryTicketCheckScreenView(PlatformScreenViewModel viewModel) + public PrimaryTicketCheckScreenViewModel ViewModel { get; } + public PrimaryTicketCheckScreenView(PrimaryTicketCheckScreenViewModel viewModel) { InitializeComponent(); + RenderOptions.SetEdgeMode(this, EdgeMode.Aliased); ViewModel = viewModel; DataContext = viewModel; } diff --git a/CRSim/Views/Windows/Stations/ChengduDong/SecondaryScreenView.xaml.cs b/CRSim/Views/Windows/Stations/ChengduDong/SecondaryScreenView.xaml.cs index 57f9878..27df31f 100644 --- a/CRSim/Views/Windows/Stations/ChengduDong/SecondaryScreenView.xaml.cs +++ b/CRSim/Views/Windows/Stations/ChengduDong/SecondaryScreenView.xaml.cs @@ -11,6 +11,7 @@ namespace CRSim.Views.ChengduDong public SecondaryScreenView(SecondaryScreenViewModel viewModel) { InitializeComponent(); + RenderOptions.SetEdgeMode(this, EdgeMode.Aliased); ViewModel = viewModel; DataContext = viewModel; } diff --git a/CRSim/Views/Windows/Stations/ChengduMetro/PlatformScreenView.xaml.cs b/CRSim/Views/Windows/Stations/ChengduMetro/PlatformScreenView.xaml.cs index 6deeb45..ef86c25 100644 --- a/CRSim/Views/Windows/Stations/ChengduMetro/PlatformScreenView.xaml.cs +++ b/CRSim/Views/Windows/Stations/ChengduMetro/PlatformScreenView.xaml.cs @@ -14,6 +14,7 @@ namespace CRSim.Views.ChengduMetro { InitializeComponent(); ViewModel = viewModel; + RenderOptions.SetEdgeMode(this, EdgeMode.Aliased); DataContext = this; player.Source = new Uri("Assets\\Advertisement.mp4", UriKind.Relative); player.Play(); diff --git a/CRSim/Views/Windows/Stations/Fuzhou/TicketCheckScreenView.xaml b/CRSim/Views/Windows/Stations/Fuzhou/TicketCheckScreenView.xaml new file mode 100644 index 0000000..06fef71 --- /dev/null +++ b/CRSim/Views/Windows/Stations/Fuzhou/TicketCheckScreenView.xaml @@ -0,0 +1,248 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CRSim/Views/Windows/Stations/Fuzhou/TicketCheckScreenView.xaml.cs b/CRSim/Views/Windows/Stations/Fuzhou/TicketCheckScreenView.xaml.cs new file mode 100644 index 0000000..4f1ad2c --- /dev/null +++ b/CRSim/Views/Windows/Stations/Fuzhou/TicketCheckScreenView.xaml.cs @@ -0,0 +1,34 @@ +using CRSim.ViewModels.Fuzhou; + +namespace CRSim.Views.Fuzhou +{ + /// + /// SecondaryScreen.xaml 的交互逻辑 + /// + public partial class TicketCheckScreenView : Window + { + public TicketCheckScreenViewModel ViewModel { get; } + public TicketCheckScreenView(TicketCheckScreenViewModel viewModel) + { + InitializeComponent(); + RenderOptions.SetEdgeMode(this, EdgeMode.Aliased); + ViewModel = viewModel; + DataContext = viewModel; + } + private void Window_MouseDown(object sender, MouseButtonEventArgs e) + { + if (e.ChangedButton == MouseButton.Left) + { + DragMove(); + } + } + + private void Window_KeyDown(object sender, KeyEventArgs e) + { + if (e.Key == Key.Escape) + { + Close(); + } + } + } +} diff --git a/CRSim/Views/Windows/Stations/GuangdongIntercity/SecondaryScreenView.xaml.cs b/CRSim/Views/Windows/Stations/GuangdongIntercity/SecondaryScreenView.xaml.cs index c39b045..0a5df74 100644 --- a/CRSim/Views/Windows/Stations/GuangdongIntercity/SecondaryScreenView.xaml.cs +++ b/CRSim/Views/Windows/Stations/GuangdongIntercity/SecondaryScreenView.xaml.cs @@ -11,6 +11,7 @@ namespace CRSim.Views.GuangdongIntercity public SecondaryScreenView(SecondaryScreenViewModel viewModel) { InitializeComponent(); + RenderOptions.SetEdgeMode(this, EdgeMode.Aliased); ViewModel = viewModel; DataContext = viewModel; } diff --git a/CRSim/Views/Windows/Stations/Guangyuan/PrimaryScreenView.xaml.cs b/CRSim/Views/Windows/Stations/Guangyuan/PrimaryScreenView.xaml.cs index 8fe4333..ec166ec 100644 --- a/CRSim/Views/Windows/Stations/Guangyuan/PrimaryScreenView.xaml.cs +++ b/CRSim/Views/Windows/Stations/Guangyuan/PrimaryScreenView.xaml.cs @@ -11,6 +11,7 @@ namespace CRSim.Views.Guangyuan public PrimaryScreenView(OutsideScreenViewModel viewModel) { InitializeComponent(); + RenderOptions.SetEdgeMode(this, EdgeMode.Aliased); ViewModel = viewModel; DataContext = viewModel; } diff --git a/CRSim/Views/Windows/Stations/Hanzhong/PlatformScreenView.xaml.cs b/CRSim/Views/Windows/Stations/Hanzhong/PlatformScreenView.xaml.cs index 0e80d31..d559852 100644 --- a/CRSim/Views/Windows/Stations/Hanzhong/PlatformScreenView.xaml.cs +++ b/CRSim/Views/Windows/Stations/Hanzhong/PlatformScreenView.xaml.cs @@ -11,6 +11,7 @@ namespace CRSim.Views.Hanzhong public PlatformScreenView(PlatformScreenViewModel viewModel) { InitializeComponent(); + RenderOptions.SetEdgeMode(this, EdgeMode.Aliased); ViewModel = viewModel; DataContext = viewModel; } diff --git a/CRSim/Views/Windows/Stations/Harbin/PrimaryScreenView.xaml.cs b/CRSim/Views/Windows/Stations/Harbin/PrimaryScreenView.xaml.cs index bc69799..5436519 100644 --- a/CRSim/Views/Windows/Stations/Harbin/PrimaryScreenView.xaml.cs +++ b/CRSim/Views/Windows/Stations/Harbin/PrimaryScreenView.xaml.cs @@ -11,6 +11,7 @@ namespace CRSim.Views.Harbin public PrimaryScreenView(PrimaryScreenViewModel viewModel) { InitializeComponent(); + RenderOptions.SetEdgeMode(this, EdgeMode.Aliased); ViewModel = viewModel; DataContext = viewModel; } diff --git a/CRSim/Views/Windows/Stations/Jinanxi/SmallScreenView.xaml.cs b/CRSim/Views/Windows/Stations/Jinanxi/SmallScreenView.xaml.cs index f48da0d..001a4e5 100644 --- a/CRSim/Views/Windows/Stations/Jinanxi/SmallScreenView.xaml.cs +++ b/CRSim/Views/Windows/Stations/Jinanxi/SmallScreenView.xaml.cs @@ -11,6 +11,7 @@ namespace CRSim.Views.Jinanxi public SmallScreenView(SmallScreenViewModel viewModel) { InitializeComponent(); + RenderOptions.SetEdgeMode(this, EdgeMode.Aliased); ViewModel = viewModel; DataContext = viewModel; } diff --git a/CRSim/Views/Windows/Stations/Shanghai/OutsideScreenView.xaml.cs b/CRSim/Views/Windows/Stations/Shanghai/OutsideScreenView.xaml.cs index 889f22e..fc6b209 100644 --- a/CRSim/Views/Windows/Stations/Shanghai/OutsideScreenView.xaml.cs +++ b/CRSim/Views/Windows/Stations/Shanghai/OutsideScreenView.xaml.cs @@ -11,6 +11,7 @@ namespace CRSim.Views.Shanghai public OutsideScreenView(OutsideScreenViewModel viewModel) { InitializeComponent(); + RenderOptions.SetEdgeMode(this, EdgeMode.Aliased); ViewModel = viewModel; DataContext = viewModel; } diff --git a/CRSim/Views/Windows/Stations/Tianjin/PlatformScreenView.xaml b/CRSim/Views/Windows/Stations/Tianjin/PlatformScreenView.xaml index b49c1de..02da0dc 100644 --- a/CRSim/Views/Windows/Stations/Tianjin/PlatformScreenView.xaml +++ b/CRSim/Views/Windows/Stations/Tianjin/PlatformScreenView.xaml @@ -16,13 +16,13 @@ - + - + diff --git a/CRSim/Views/Windows/Stations/Tianjin/PlatformScreenView.xaml.cs b/CRSim/Views/Windows/Stations/Tianjin/PlatformScreenView.xaml.cs index 7c1c9ab..a015b0b 100644 --- a/CRSim/Views/Windows/Stations/Tianjin/PlatformScreenView.xaml.cs +++ b/CRSim/Views/Windows/Stations/Tianjin/PlatformScreenView.xaml.cs @@ -11,6 +11,7 @@ namespace CRSim.Views.Tianjin public PlatformScreenView(PlatformScreenViewModel viewModel) { InitializeComponent(); + RenderOptions.SetEdgeMode(this, EdgeMode.Aliased); ViewModel = viewModel; DataContext = viewModel; } diff --git a/CRSim/Views/Windows/Stations/Zibo/PrimaryScreenView.xaml.cs b/CRSim/Views/Windows/Stations/Zibo/PrimaryScreenView.xaml.cs index a276d94..a475193 100644 --- a/CRSim/Views/Windows/Stations/Zibo/PrimaryScreenView.xaml.cs +++ b/CRSim/Views/Windows/Stations/Zibo/PrimaryScreenView.xaml.cs @@ -11,6 +11,7 @@ namespace CRSim.Views.Zibo public PrimaryScreenView(PrimaryScreenViewModel viewModel) { InitializeComponent(); + RenderOptions.SetEdgeMode(this, EdgeMode.Aliased); ViewModel = viewModel; DataContext = viewModel; } diff --git a/CRSim/Views/Windows/Stations/Zibo/SecondaryScreenView.xaml.cs b/CRSim/Views/Windows/Stations/Zibo/SecondaryScreenView.xaml.cs index 52f9686..3aa7eda 100644 --- a/CRSim/Views/Windows/Stations/Zibo/SecondaryScreenView.xaml.cs +++ b/CRSim/Views/Windows/Stations/Zibo/SecondaryScreenView.xaml.cs @@ -11,6 +11,7 @@ namespace CRSim.Views.Zibo public SecondaryScreenView(SecondaryScreenViewModel viewModel) { InitializeComponent(); + RenderOptions.SetEdgeMode(this, EdgeMode.Aliased); ViewModel = viewModel; DataContext = viewModel; }