diff --git a/CRSim.ScreenSimulator/Assets/BeijingNan/PrimaryScreen.png b/CRSim.ScreenSimulator/Assets/BeijingNan/PrimaryScreen.png new file mode 100644 index 0000000..287bf34 Binary files /dev/null and b/CRSim.ScreenSimulator/Assets/BeijingNan/PrimaryScreen.png differ diff --git a/CRSim.ScreenSimulator/CRSim.ScreenSimulator.csproj b/CRSim.ScreenSimulator/CRSim.ScreenSimulator.csproj index d926b28..a36e0e1 100644 --- a/CRSim.ScreenSimulator/CRSim.ScreenSimulator.csproj +++ b/CRSim.ScreenSimulator/CRSim.ScreenSimulator.csproj @@ -94,6 +94,7 @@ + @@ -131,4 +132,4 @@ - + \ No newline at end of file diff --git a/CRSim.ScreenSimulator/Converters/TrainStateColorConverter.cs b/CRSim.ScreenSimulator/Converters/TrainStateColorConverter.cs index dc2f02a..2c80362 100644 --- a/CRSim.ScreenSimulator/Converters/TrainStateColorConverter.cs +++ b/CRSim.ScreenSimulator/Converters/TrainStateColorConverter.cs @@ -11,10 +11,18 @@ namespace CRSim.ScreenSimulator.Converters { private ITimeService _timeService; private Settings _settings; + public string DisplayMode { get; set; } = "Normal"; + + /* + Normal: 标准显示。 + Alternating_Row_Colors: 候车状态隔行异色显示(第4个参数控制行号)。 + */ + + public List WaitingColorList { get; set; } = []; public SolidColorBrush WaitingColor { get; set; } = new(Colors.White); public SolidColorBrush CheckingTicketsColor { get; set; } = new(Colors.LightGreen); public SolidColorBrush StopCheckingTicketsColor { get; set; } = new(Colors.Red); - object IMultiValueConverter.Convert(object[] values, System.Type targetType, object parameter, System.Globalization.CultureInfo culture) + object IMultiValueConverter.Convert(object[] values, Type targetType, object parameter, CultureInfo culture) { var serviceProvider = (IServiceProvider)Application.Current.Resources["ServiceProvider"]; _timeService = serviceProvider.GetRequiredService(); @@ -49,6 +57,9 @@ namespace CRSim.ScreenSimulator.Converters { return StopCheckingTicketsColor; } + if (DisplayMode == "Alternating_Row_Colors" && values.Length > 3 && values[3] is int rowNumber){ + return WaitingColorList[rowNumber % WaitingColorList.Count]; + } return WaitingColor; } return new SolidColorBrush(Colors.Transparent); diff --git a/CRSim.ScreenSimulator/Models/StylesInfoData.json b/CRSim.ScreenSimulator/Models/StylesInfoData.json index f7dff61..9bdfc6b 100644 --- a/CRSim.ScreenSimulator/Models/StylesInfoData.json +++ b/CRSim.ScreenSimulator/Models/StylesInfoData.json @@ -321,5 +321,15 @@ "Location", "Text" ] + }, + { + "UniqueId": "BeijingNan.PrimaryScreen", + "Title": "北京南站主要看板", + "Region": "北京", + "Author": "wxl0430", + "Type": "车站大屏", + "Parameters": [ + "Station" + ] } ] \ No newline at end of file diff --git a/CRSim.ScreenSimulator/ViewModels/BeijingNan/PrimaryScreenViewModel.cs b/CRSim.ScreenSimulator/ViewModels/BeijingNan/PrimaryScreenViewModel.cs new file mode 100644 index 0000000..821d463 --- /dev/null +++ b/CRSim.ScreenSimulator/ViewModels/BeijingNan/PrimaryScreenViewModel.cs @@ -0,0 +1,15 @@ +using CRSim.Core.Models; +using CRSim.Core.Services; +namespace CRSim.ScreenSimulator.ViewModels.BeijingNan +{ + public class PrimaryScreenViewModel : ScreenViewModel + { + public PrimaryScreenViewModel(ITimeService timeService, ISettingsService settingsService) + : base(timeService, settingsService) + { + ItemsPerPage = 10; + PageCount = 1; + StationType = StationType.Departure; + } + } +} diff --git a/CRSim.ScreenSimulator/Views/BeijingNan/PrimaryScreenView.xaml b/CRSim.ScreenSimulator/Views/BeijingNan/PrimaryScreenView.xaml new file mode 100644 index 0000000..a45ee01 --- /dev/null +++ b/CRSim.ScreenSimulator/Views/BeijingNan/PrimaryScreenView.xaml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CRSim.ScreenSimulator/Views/BeijingNan/PrimaryScreenView.xaml.cs b/CRSim.ScreenSimulator/Views/BeijingNan/PrimaryScreenView.xaml.cs new file mode 100644 index 0000000..2144160 --- /dev/null +++ b/CRSim.ScreenSimulator/Views/BeijingNan/PrimaryScreenView.xaml.cs @@ -0,0 +1,14 @@ +using CRSim.ScreenSimulator.ViewModels.BeijingNan; +namespace CRSim.ScreenSimulator.Views.BeijingNan +{ + public partial class PrimaryScreenView : BaseScreenView + { + public PrimaryScreenViewModel ViewModel { get; } + public PrimaryScreenView(PrimaryScreenViewModel viewModel) + { + InitializeComponent(); + ViewModel = viewModel; + DataContext = viewModel; + } + } +}