diff --git a/CRSim.ScreenSimulator/Assets/ChengduShuangliuAirport/SecondaryScreen.png b/CRSim.ScreenSimulator/Assets/ChengduShuangliuAirport/SecondaryScreen.png
new file mode 100644
index 0000000..795032a
Binary files /dev/null and b/CRSim.ScreenSimulator/Assets/ChengduShuangliuAirport/SecondaryScreen.png differ
diff --git a/CRSim.ScreenSimulator/Assets/ChengduShuangliuAirport/logo-CR.png b/CRSim.ScreenSimulator/Assets/ChengduShuangliuAirport/logo-CR.png
new file mode 100644
index 0000000..b7d7b20
Binary files /dev/null and b/CRSim.ScreenSimulator/Assets/ChengduShuangliuAirport/logo-CR.png differ
diff --git a/CRSim.ScreenSimulator/Assets/ChengduShuangliuAirport/logo-CRH.png b/CRSim.ScreenSimulator/Assets/ChengduShuangliuAirport/logo-CRH.png
new file mode 100644
index 0000000..5e5e8db
Binary files /dev/null and b/CRSim.ScreenSimulator/Assets/ChengduShuangliuAirport/logo-CRH.png differ
diff --git a/CRSim.ScreenSimulator/Assets/ChengduShuangliuAirport/logo-GTJT.png b/CRSim.ScreenSimulator/Assets/ChengduShuangliuAirport/logo-GTJT.png
new file mode 100644
index 0000000..ffc2848
Binary files /dev/null and b/CRSim.ScreenSimulator/Assets/ChengduShuangliuAirport/logo-GTJT.png differ
diff --git a/CRSim.ScreenSimulator/Assets/ChengduShuangliuAirport/planetakingoff.png b/CRSim.ScreenSimulator/Assets/ChengduShuangliuAirport/planetakingoff.png
new file mode 100644
index 0000000..0c82085
Binary files /dev/null and b/CRSim.ScreenSimulator/Assets/ChengduShuangliuAirport/planetakingoff.png differ
diff --git a/CRSim.ScreenSimulator/CRSim.ScreenSimulator.csproj b/CRSim.ScreenSimulator/CRSim.ScreenSimulator.csproj
index d40ee6b..8e92410 100644
--- a/CRSim.ScreenSimulator/CRSim.ScreenSimulator.csproj
+++ b/CRSim.ScreenSimulator/CRSim.ScreenSimulator.csproj
@@ -12,6 +12,11 @@
+
+
+
+
+
@@ -50,6 +55,9 @@
Code
+
+ Code
+
Code
@@ -109,6 +117,11 @@
+
+
+
+
+
diff --git a/CRSim.ScreenSimulator/Converters/ChineseToPinyinConverter.cs b/CRSim.ScreenSimulator/Converters/ChineseToPinyinConverter.cs
index b3286c9..50d7298 100644
--- a/CRSim.ScreenSimulator/Converters/ChineseToPinyinConverter.cs
+++ b/CRSim.ScreenSimulator/Converters/ChineseToPinyinConverter.cs
@@ -7,11 +7,7 @@ namespace CRSim.ScreenSimulator.Converters
{
public class ChineseToPinyinConverter : IValueConverter
{
- ///
- /// 将中文字符串转换为拼音(带声调或不带声调)
- ///
- /// 要转换的中文字符串
- /// 拼音字符串
+ public bool Upper { get; set; } = false;
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null) return string.Empty;
@@ -42,7 +38,7 @@ namespace CRSim.ScreenSimulator.Converters
}
}
var result = sb.ToString().ToLower();
- return char.ToUpper(result[0], culture) + result[1..];
+ return Upper ? result.ToUpper() : char.ToUpper(result[0], culture) + result[1..];
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
diff --git a/CRSim.ScreenSimulator/Converters/IntAddOneConverter.cs b/CRSim.ScreenSimulator/Converters/IntAddOneConverter.cs
new file mode 100644
index 0000000..3741405
--- /dev/null
+++ b/CRSim.ScreenSimulator/Converters/IntAddOneConverter.cs
@@ -0,0 +1,22 @@
+using System.Globalization;
+using System.Windows.Data;
+
+namespace CRSim.ScreenSimulator.Converters
+{
+ public class IntAddOneConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value is int intValue)
+ return intValue + 1;
+ return value;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value is int intValue)
+ return intValue - 1;
+ return value;
+ }
+ }
+}
\ No newline at end of file
diff --git a/CRSim.ScreenSimulator/Converters/TrainNumberToImageConverter.cs b/CRSim.ScreenSimulator/Converters/TrainNumberToImageConverter.cs
new file mode 100644
index 0000000..2940fde
--- /dev/null
+++ b/CRSim.ScreenSimulator/Converters/TrainNumberToImageConverter.cs
@@ -0,0 +1,39 @@
+using System.Globalization;
+using System.Windows.Data;
+
+namespace CRSim.ScreenSimulator.Converters
+{
+ public class TrainNumberToImageConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value == null)
+ return null;
+ string trainNumber = value.ToString();
+ string imageName = "pack://application:,,,/CRSim.ScreenSimulator;component/Assets/ChengduShuangliuAirport/logo-GTJT.png";
+ if (!string.IsNullOrEmpty(trainNumber) && (trainNumber.StartsWith('G') || trainNumber.StartsWith('C') || trainNumber.StartsWith('D')))
+ {
+ int probability = trainNumber.GetHashCode() % 2;
+ if (probability == 1)
+ {
+ imageName = "pack://application:,,,/CRSim.ScreenSimulator;component/Assets/ChengduShuangliuAirport/logo-CR.png";
+ }
+ else
+ {
+ imageName = "pack://application:,,,/CRSim.ScreenSimulator;component/Assets/ChengduShuangliuAirport/logo-CRH.png";
+ }
+ }
+ var image = new System.Windows.Media.Imaging.BitmapImage();
+ image.BeginInit();
+ image.UriSource = new Uri(imageName, UriKind.Absolute);
+ image.CacheOption = System.Windows.Media.Imaging.BitmapCacheOption.OnLoad;
+ image.EndInit();
+ return image;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/CRSim.ScreenSimulator/Models/StylesInfoData.json b/CRSim.ScreenSimulator/Models/StylesInfoData.json
index bd01782..135c559 100644
--- a/CRSim.ScreenSimulator/Models/StylesInfoData.json
+++ b/CRSim.ScreenSimulator/Models/StylesInfoData.json
@@ -128,6 +128,17 @@
"Text"
]
},
+ {
+ "UniqueId": "ChengduShuangliuAirport.SecondaryScreen",
+ "Title": "成都双流机场次要看板",
+ "Region": "成都",
+ "Author": "电排骨",
+ "Type": "车站大屏",
+ "Parameters": [
+ "Station",
+ "Text"
+ ]
+ },
{
"UniqueId": "Shanghai.OutsideScreen",
"Title": "上海站站外看板",
diff --git a/CRSim.ScreenSimulator/ViewModels/ChengduShuangliuAirport/SecondaryScreenViewModel.cs b/CRSim.ScreenSimulator/ViewModels/ChengduShuangliuAirport/SecondaryScreenViewModel.cs
new file mode 100644
index 0000000..aec86a7
--- /dev/null
+++ b/CRSim.ScreenSimulator/ViewModels/ChengduShuangliuAirport/SecondaryScreenViewModel.cs
@@ -0,0 +1,16 @@
+using CRSim.Core.Models;
+using CRSim.Core.Services;
+namespace CRSim.ScreenSimulator.ViewModels.ChengduShuangliuAirport
+{
+ public class SecondaryScreenViewModel : ScreenViewModel
+ {
+ public SecondaryScreenViewModel(ITimeService timeService, ISettingsService settingsService)
+ : base(timeService, settingsService)
+ {
+ Text = $"国内航班截载时间为起飞前{settingsService.GetSettings().StopCheckInAdvanceDuration.TotalMinutes}分钟。";
+ ItemsPerPage = 7;
+ PageCount = 1;
+ StationType = StationType.Departure;
+ }
+ }
+}
diff --git a/CRSim.ScreenSimulator/ViewModels/ScreenViewModel.cs b/CRSim.ScreenSimulator/ViewModels/ScreenViewModel.cs
index 10f99ea..6d5f194 100644
--- a/CRSim.ScreenSimulator/ViewModels/ScreenViewModel.cs
+++ b/CRSim.ScreenSimulator/ViewModels/ScreenViewModel.cs
@@ -43,7 +43,15 @@ namespace CRSim.ScreenSimulator.ViewModels
_timeService.RefreshSecondsElapsed += RefreshDisplay;
Initialize();
}
- public int CurrentPageIndex = 0;
+ [ObservableProperty]
+ private int _currentPageIndex = 0;
+ public int PagesCount
+ {
+ get
+ {
+ return Math.Min((int)Math.Ceiling((double)TrainInfo.Count / ItemsPerPage * PageCount.Value),_settings.MaxPages);
+ }
+ }
public int ItemsPerPage = 1;
//
diff --git a/CRSim.ScreenSimulator/Views/ChengduShuangliuAirport/SecondaryScreenView.xaml b/CRSim.ScreenSimulator/Views/ChengduShuangliuAirport/SecondaryScreenView.xaml
new file mode 100644
index 0000000..d55ce1e
--- /dev/null
+++ b/CRSim.ScreenSimulator/Views/ChengduShuangliuAirport/SecondaryScreenView.xaml
@@ -0,0 +1,300 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/CRSim.ScreenSimulator/Views/ChengduShuangliuAirport/SecondaryScreenView.xaml.cs b/CRSim.ScreenSimulator/Views/ChengduShuangliuAirport/SecondaryScreenView.xaml.cs
new file mode 100644
index 0000000..63e12da
--- /dev/null
+++ b/CRSim.ScreenSimulator/Views/ChengduShuangliuAirport/SecondaryScreenView.xaml.cs
@@ -0,0 +1,15 @@
+using CRSim.ScreenSimulator.ViewModels.ChengduShuangliuAirport;
+
+namespace CRSim.ScreenSimulator.Views.ChengduShuangliuAirport
+{
+ public partial class SecondaryScreenView : BaseScreenView
+ {
+ public SecondaryScreenViewModel ViewModel { get; }
+ public SecondaryScreenView(SecondaryScreenViewModel viewModel)
+ {
+ InitializeComponent();
+ ViewModel = viewModel;
+ DataContext = viewModel;
+ }
+ }
+}