feat: 添加大庆东站站台屏和哈尔滨西站站台屏

This commit is contained in:
wxl0430
2025-04-23 13:37:56 +08:00
committed by GitHub
parent a3a1898238
commit 9fe20dc87b
10 changed files with 388 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

View File

@@ -91,6 +91,7 @@
<Resource Include="Assets\ChengduMetro\ChengduMetro-Icon.png" />
<Resource Include="Assets\ChengduMetro\PlatformScreen.png" />
<Resource Include="Assets\DaqingDong\ConcourseBridgeScreen.png" />
<Resource Include="Assets\DaqingDong\PlatformScreen.png" />
<Resource Include="Assets\FuzhouNan\TicketCheckScreen.png" />
<Resource Include="Assets\Fuzhou\TicketCheckScreen.png" />
<Resource Include="Assets\GuangdongIntercity\SecondaryScreen.png" />
@@ -98,6 +99,7 @@
<Resource Include="Assets\Hanzhong\Image.png" />
<Resource Include="Assets\Hanzhong\PlatformScreen.png" />
<Resource Include="Assets\Harbin\PrimaryScreen.png" />
<Resource Include="Assets\HarbinXi\PlatformScreen.png" />
<Resource Include="Assets\Jinanxi\SmallScreen.png" />
<Resource Include="Assets\Mianyang\PlatformScreen.png" />
<Resource Include="Assets\Shanghai\OutsideScreen.png" />

View File

@@ -261,5 +261,30 @@
"Platform",
"Location"
]
},
{
"UniqueId": "DaqingDong.PlatformScreen",
"Title": "大庆东站站台看板",
"Station": "大庆东",
"Author": "wxl0430",
"Type": "站台屏",
"Parameters": [
"Station",
"Platform",
"Location"
]
},
{
"UniqueId": "HarbinXi.PlatformScreen",
"Title": "哈尔滨西站站台看板",
"Station": "哈尔滨西",
"Author": "wxl0430",
"Type": "站台屏",
"Parameters": [
"Station",
"Platform",
"Location",
"Text"
]
}
]

View File

@@ -0,0 +1,62 @@
using CRSim.Core.Services;
using CRSim.ScreenSimulator.Models;
using System.Collections.ObjectModel;
using System.Windows;
namespace CRSim.ScreenSimulator.ViewModels.DaqingDong
{
public class PlatformScreenViewModel : ScreenViewModel
{
private ITimeService _timeService;
public ObservableCollection<TrainInfo> Screen { get; set; } = [];
public PlatformScreenViewModel(ITimeService timeService, ISettingsService settingsService)
: base(timeService, settingsService)
{
_timeService = timeService;
timeService.RefreshSecondsElapsed += RefreshDisplay;
Text = $"请站在白色安全线以内排队候车";
Initialize();
}
private async void Initialize()
{
await WaitForDataLoadAsync();
RefreshDisplay(null,null);
}
private void RefreshDisplay(object? sender, EventArgs e)
{
Application.Current.Dispatcher.Invoke(() =>
{
Screen.Add(TrainInfo.Count > 0 ? TrainInfo[0] : new());
if (Screen.Count == 1) return;
Screen.RemoveAt(0);
});
}
public override void RefreshData(object? sender, EventArgs e)
{
if (CurrentPageIndex == 0)
{
List<TrainInfo> itemsToRemove = [];
foreach (TrainInfo trainInfo in TrainInfo)
{
if (trainInfo.DepartureTime == null)
{
if (trainInfo.ArrivalTime.Value.Add(_settings.StopDisplayFromArrivalDuration) < _timeService.GetDateTimeNow())
{
itemsToRemove.Add(trainInfo);
}
}
else
{
if (trainInfo.DepartureTime.Value < _timeService.GetDateTimeNow())
{
itemsToRemove.Add(trainInfo);
}
}
}
foreach (var item in itemsToRemove)
{
TrainInfo.Remove(item);
}
}
}
}
}

View File

@@ -0,0 +1,62 @@
using CRSim.Core.Services;
using CRSim.ScreenSimulator.Models;
using System.Collections.ObjectModel;
using System.Windows;
namespace CRSim.ScreenSimulator.ViewModels.HarbinXi
{
public class PlatformScreenViewModel : ScreenViewModel
{
private ITimeService _timeService;
public ObservableCollection<TrainInfo> Screen { get; set; } = [];
public PlatformScreenViewModel(ITimeService timeService, ISettingsService settingsService)
: base(timeService, settingsService)
{
_timeService = timeService;
timeService.RefreshSecondsElapsed += RefreshDisplay;
Text = $"请在白线内行走,乘降列车时注意脚下站台与列车之间的空隙,看护好老人和儿童。";
Initialize();
}
private async void Initialize()
{
await WaitForDataLoadAsync();
RefreshDisplay(null,null);
}
private void RefreshDisplay(object? sender, EventArgs e)
{
Application.Current.Dispatcher.Invoke(() =>
{
Screen.Add(TrainInfo.Count > 0 ? TrainInfo[0] : new());
if (Screen.Count == 1) return;
Screen.RemoveAt(0);
});
}
public override void RefreshData(object? sender, EventArgs e)
{
if (CurrentPageIndex == 0)
{
List<TrainInfo> itemsToRemove = [];
foreach (TrainInfo trainInfo in TrainInfo)
{
if (trainInfo.DepartureTime == null)
{
if (trainInfo.ArrivalTime.Value.Add(_settings.StopDisplayFromArrivalDuration) < _timeService.GetDateTimeNow())
{
itemsToRemove.Add(trainInfo);
}
}
else
{
if (trainInfo.DepartureTime.Value < _timeService.GetDateTimeNow())
{
itemsToRemove.Add(trainInfo);
}
}
}
foreach (var item in itemsToRemove)
{
TrainInfo.Remove(item);
}
}
}
}
}

View File

@@ -0,0 +1,79 @@
<Window x:Class="CRSim.ScreenSimulator.Views.DaqingDong.PlatformScreenView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:pp="https://www.cnblogs.com/pumbaa"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:CRSim.ScreenSimulator.Views.DaqingDong"
mc:Ignorable="d"
xmlns:converters="clr-namespace:CRSim.ScreenSimulator.Converters"
xmlns:converters1="clr-namespace:CRSim.Shared.Converters;assembly=CRSim.Shared"
FontFamily="黑体" FontSize="28" FontWeight="Bold"
Title="引导屏" SizeToContent="WidthAndHeight"
WindowStyle="None" AllowsTransparency="True" Background="Black"
KeyDown="Window_KeyDown"
ResizeMode="NoResize" MouseDown="Window_MouseDown">
<Window.Resources>
<converters1:DateTimeToStringConverter x:Key="DateTimeToStringConverter" Format="HH:mm" />
<converters:LocationToStringConverter x:Key="LocationToStringConverter" DisplayMode="normal" />
<converters1:EmptyToVisibilityConverter x:Key="EmptyToVisibilityConverter" />
</Window.Resources>
<StackPanel Orientation="Horizontal">
<Grid Background="#161e41">
<TextBlock Text="{Binding ThisPlatform}" Foreground="#c5d4e1" Background="#161e41" FontSize="110" MinWidth="100"
FontFamily="黑体" TextAlignment="Center" VerticalAlignment="Center">
<TextBlock.LayoutTransform>
<ScaleTransform ScaleX="1.25" ScaleY="1"/>
</TextBlock.LayoutTransform>
</TextBlock>
</Grid>
<Grid Margin="4" Background="Black" MinWidth="318">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0" Margin="0,10,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="{Binding Screen[0].TrainNumber}" Foreground="#fdf99d" Margin="15,0,0,0" FontSize="22" />
<TextBlock Grid.Column="1" Text="次" Foreground="#fdf99d" FontSize="22" Margin="4,0,0,0"/>
<TextBlock Grid.Column="3" Text="本站" Foreground="#de502b" HorizontalAlignment="Center" FontSize="22" Margin="10,0,0,0"/>
<TextBlock Grid.Column="5" Text="{Binding Screen[0].DepartureTime,Converter={StaticResource DateTimeToStringConverter}}" Foreground="#fdf99d" FontSize="22"/>
<TextBlock Grid.Column="6" Text="开" Foreground="#fdf99d" FontSize="22" Margin="4,0"/>
</Grid>
<Grid Grid.Row="1" Margin="0,10,0,10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="{Binding Screen[0].Origin}" Foreground="#fdf99d" FontSize="22" Margin="15,0,0,0"/>
<TextBlock Grid.Column="2" Text="开往" Foreground="#de502b" FontSize="22" HorizontalAlignment="Center"/>
<TextBlock Grid.Column="4" Text="{Binding Screen[0].Terminal}" Foreground="#fdf99d" FontSize="22" Margin="10,0"/>
</Grid>
<Grid Grid.Row="2">
<pp:RunningText Speed="20" Grid.Column="0" FontSize="22" Foreground="#fdf99d">
<pp:RunningText.Text>
<MultiBinding Mode="OneWay" Converter="{StaticResource LocationToStringConverter}">
<Binding Path="Screen[0].Length" />
<Binding Path="Location" />
</MultiBinding>
</pp:RunningText.Text>
</pp:RunningText>
</Grid>
</Grid>
</StackPanel>
</Window>

View File

@@ -0,0 +1,38 @@
using CRSim.ScreenSimulator.ViewModels.DaqingDong;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
namespace CRSim.ScreenSimulator.Views.DaqingDong
{
/// <summary>
/// SecondaryScreen.xaml 的交互逻辑
/// </summary>
public partial class PlatformScreenView : Window
{
public PlatformScreenViewModel ViewModel { get; }
public PlatformScreenView(PlatformScreenViewModel 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();
}
}
}
}

View File

@@ -0,0 +1,82 @@
<Window x:Class="CRSim.ScreenSimulator.Views.HarbinXi.PlatformScreenView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:pp="https://www.cnblogs.com/pumbaa"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:CRSim.ScreenSimulator.Views.HarbinXi"
mc:Ignorable="d"
xmlns:converters="clr-namespace:CRSim.ScreenSimulator.Converters"
xmlns:converters1="clr-namespace:CRSim.Shared.Converters;assembly=CRSim.Shared"
FontFamily="黑体" FontSize="28" FontWeight="Bold"
Title="引导屏" SizeToContent="WidthAndHeight"
WindowStyle="None" AllowsTransparency="True" Background="Black"
KeyDown="Window_KeyDown"
ResizeMode="NoResize" MouseDown="Window_MouseDown">
<Window.Resources>
<converters1:DateTimeToStringConverter x:Key="DateTimeToStringConverter" Format="HH:mm" />
<converters:LocationToStringConverter x:Key="LocationToStringConverter" DisplayMode="normal" />
<converters1:EmptyToVisibilityConverter x:Key="EmptyToVisibilityConverter" />
</Window.Resources>
<StackPanel Orientation="Horizontal">
<Grid Background="#4273aa">
<TextBlock Text="{Binding ThisPlatform}" Foreground="#e69137" Background="#4273aa" FontSize="110" MinWidth="100"
FontFamily="黑体" TextAlignment="Center" VerticalAlignment="Center">
<TextBlock.LayoutTransform>
<ScaleTransform ScaleX="1.25" ScaleY="1"/>
</TextBlock.LayoutTransform>
</TextBlock>
</Grid>
<Grid Margin="4" Background="Black" MinWidth="318">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0" Margin="0,10,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="{Binding Screen[0].TrainNumber}" Foreground="#fde163" Margin="15,0,0,0" FontSize="22" />
<TextBlock Grid.Column="1" Text="次" Foreground="#fde163" FontSize="22" Margin="4,0,0,0"/>
<TextBlock Grid.Column="3" Text="本站" Foreground="#de502b" HorizontalAlignment="Center" FontSize="22" Margin="10,0,0,0"/>
<TextBlock Grid.Column="5" Text="{Binding Screen[0].DepartureTime,Converter={StaticResource DateTimeToStringConverter}}" Foreground="#fde163" FontSize="22"/>
<TextBlock Grid.Column="6" Text="开" Foreground="#fde163" FontSize="22" Margin="4,0"/>
</Grid>
<Grid Grid.Row="1" Margin="0,10,0,10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="{Binding Screen[0].Origin}" Foreground="#fde163" FontSize="22" Margin="15,0,0,0"/>
<TextBlock Grid.Column="2" Text="开往" Foreground="#de502b" FontSize="22" HorizontalAlignment="Center"/>
<TextBlock Grid.Column="4" Text="{Binding Screen[0].Terminal}" Foreground="#fde163" FontSize="22" Margin="10,0"/>
</Grid>
<Grid Grid.Row="2">
<pp:RunningText Speed="20" Grid.Column="0" FontSize="22" Foreground="#fde163">
<pp:RunningText.Text>
<MultiBinding Mode="OneWay" Converter="{StaticResource LocationToStringConverter}">
<Binding Path="Screen[0].Length" />
<Binding Path="Location" />
</MultiBinding>
</pp:RunningText.Text>
</pp:RunningText>
</Grid>
<Grid Grid.Row="3">
<pp:RunningText Speed="20" Grid.Column="0" FontSize="22" Foreground="#60c984" Text="{Binding Text}"/>
</Grid>
</Grid>
</StackPanel>
</Window>

View File

@@ -0,0 +1,38 @@
using CRSim.ScreenSimulator.ViewModels.HarbinXi;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
namespace CRSim.ScreenSimulator.Views.HarbinXi
{
/// <summary>
/// SecondaryScreen.xaml 的交互逻辑
/// </summary>
public partial class PlatformScreenView : Window
{
public PlatformScreenViewModel ViewModel { get; }
public PlatformScreenView(PlatformScreenViewModel 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();
}
}
}
}