feat: 新增成都东站检票口立柱看板

This commit is contained in:
denglihong2007
2025-05-01 02:12:43 +08:00
parent cf207e5b48
commit 7761d08528
9 changed files with 177 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 KiB

View File

@@ -7,6 +7,12 @@
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<None Remove="Assets\ChengduDong\cdcz.png" />
<None Remove="Assets\ChengduDong\PillarTicketCheckScreen.png" />
<None Remove="Assets\ChengduDong\TicketCheck.png" />
</ItemGroup>
<ItemGroup>
<Content Include="Assets\Advertisement-1.mp4">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@@ -38,6 +44,9 @@
<Compile Update="Views\BeijingXi\PrimaryScreenView.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Views\ChengduDong\PillarTicketCheckScreenView.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Views\ChengduDong\PrimaryTicketCheckScreenView.xaml.cs">
<SubType>Code</SubType>
</Compile>
@@ -86,8 +95,11 @@
<Resource Include="Assets\Ankang\ExitScreen.png" />
<Resource Include="Assets\BeijingXi\PrimaryScreen.png" />
<Resource Include="Assets\Beijing\ArrivalScreen.png" />
<Resource Include="Assets\ChengduDong\cdcz.png" />
<Resource Include="Assets\ChengduDong\PillarTicketCheckScreen.png" />
<Resource Include="Assets\ChengduDong\PrimaryTicketCheckScreen.png" />
<Resource Include="Assets\ChengduDong\SecondaryScreen.png" />
<Resource Include="Assets\ChengduDong\TicketCheck.png" />
<Resource Include="Assets\ChengduMetro\ChengduMetro-Icon.png" />
<Resource Include="Assets\ChengduMetro\PlatformScreen.png" />
<Resource Include="Assets\DaqingDong\ConcourseBridgeScreen.png" />

View File

@@ -22,6 +22,17 @@
"Text"
]
},
{
"UniqueId": "ChengduDong.PillarTicketCheckScreen",
"Title": "成都东站检票口立柱看板",
"Station": "成都东",
"Author": "电排骨",
"Type": "检票口屏",
"Parameters": [
"Station",
"TicketCheck"
]
},
{
"UniqueId": "Fuzhou.TicketCheckScreen",
"Title": "福州站检票口看板",

View File

@@ -0,0 +1,56 @@
using CommunityToolkit.Mvvm.ComponentModel;
using CRSim.Core.Models;
using CRSim.Core.Services;
using CRSim.ScreenSimulator.Models;
using System.Windows;
namespace CRSim.ScreenSimulator.ViewModels.ChengduDong
{
public partial class PillarTicketCheckScreenViewModel : ScreenViewModel
{
[ObservableProperty]
private TrainInfo _firstTrain = new();
[ObservableProperty]
private TrainInfo _secondTrain = new();
[ObservableProperty]
private TrainInfo _checkingTrain = new();
public PillarTicketCheckScreenViewModel(ITimeService timeService, ISettingsService settingsService)
: base(timeService, settingsService)
{
StationType = StationType.Departure;
timeService.RefreshSecondsElapsed += RefreshDisplay;
Initialize();
}
private async void Initialize()
{
await WaitForDataLoadAsync();
RefreshDisplay(null, null);
}
private void RefreshDisplay(object? sender, EventArgs e)
{
Application.Current.Dispatcher.Invoke(() =>
{
var now = _timeService.GetDateTimeNow();
var departureTime = TrainInfo[0].DepartureTime!.Value;
TimeSpan checkInStartOffset = TrainInfo[0].ArrivalTime is DateTime
? _settings.PassingCheckInAdvanceDuration // 过路站
: _settings.DepartureCheckInAdvanceDuration; // 始发站
bool checking = now > departureTime - checkInStartOffset && now < departureTime - _settings.StopCheckInAdvanceDuration;
if (checking)
{
CheckingTrain = TrainInfo[0];
FirstTrain = TrainInfo.ElementAtOrDefault(1);
SecondTrain = TrainInfo.ElementAtOrDefault(2);
}
else
{
CheckingTrain = null;
FirstTrain = TrainInfo.ElementAtOrDefault(0);
SecondTrain = TrainInfo.ElementAtOrDefault(1);
}
});
}
}
}

View File

@@ -8,7 +8,7 @@ namespace CRSim.ScreenSimulator.ViewModels
{
public partial class ScreenViewModel : ObservableObject
{
private readonly ITimeService _timeService;
public readonly ITimeService _timeService;
public readonly Settings _settings;
private readonly TaskCompletionSource<bool> _dataLoaded = new();
[ObservableProperty]

View File

@@ -0,0 +1,60 @@
<Window x:Class="CRSim.ScreenSimulator.Views.ChengduDong.PillarTicketCheckScreenView"
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:CRSim.ScreenSimulator.Views.ChengduDong"
xmlns:pp="https://www.cnblogs.com/pumbaa"
mc:Ignorable="d"
xmlns:converters="clr-namespace:CRSim.ScreenSimulator.Converters"
xmlns:converters1="clr-namespace:CRSim.Shared.Converters;assembly=CRSim.Shared"
Title="引导屏" SizeToContent="WidthAndHeight"
WindowStyle="None" AllowsTransparency="True" Background="Transparent"
KeyDown="Window_KeyDown" FontFamily="宋体" FontSize="28"
ResizeMode="NoResize" MouseDown="Window_MouseDown">
<Window.Resources>
<converters1:DateTimeToStringConverter x:Key="DateTimeToTimeConverter" Format="HH:mm" />
</Window.Resources>
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Vertical" Background="#68696B">
<Image Height="74" Width="74" Margin="0,20,0,10"
Source="/CRSim.ScreenSimulator;component/Assets/ChengduDong/TicketCheck.png"/>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="46,0">
<TextBlock Text="检" FontSize="32" FontFamily="微软雅黑" Foreground="White"/>
<TextBlock Text="票" FontSize="32" FontFamily="微软雅黑" Foreground="White" Margin="6,0"/>
<TextBlock Text="口" FontSize="32" FontFamily="微软雅黑" Foreground="White"/>
</StackPanel>
<TextBlock Text="Ticket Check" FontSize="19" FontFamily="Arial" TextAlignment="Center" Foreground="White" Margin="0,0,0,20"/>
</StackPanel>
<TextBlock Margin="0,4,0,0" Background="#68696B" Foreground="#D4DB02" TextAlignment="Center"
FontSize="90" FontFamily="微软雅黑" Text="{Binding ViewModel.ThisTicketCheck}"/>
<StackPanel Margin="0,4,0,0" Background="#68696B" Orientation="Vertical">
<Image Height="90" Width="90" Margin="0,20,0,0"
Source="/CRSim.ScreenSimulator;component/Assets/ChengduDong/cdcz.png"/>
<Border Background="Black" Margin="12,60,12,30">
<StackPanel Orientation="Vertical">
<TextBlock Text="正在检票车次" Foreground="White" TextAlignment="Center" FontSize="22" Margin="0,10,0,0"/>
<TextBlock Text="{Binding ViewModel.CheckingTrain.TrainNumber}" Foreground="LawnGreen" TextAlignment="Center" FontSize="40" Margin="0,20,0,0"/>
<TextBlock Text="{Binding ViewModel.CheckingTrain.DepartureTime,Converter={StaticResource DateTimeToTimeConverter}, StringFormat='{}{0}开'}" Foreground="LawnGreen" TextAlignment="Center" FontSize="22" Margin="0,20,0,0"/>
<TextBlock Text="即将检票车次" Foreground="White" TextAlignment="Center" FontSize="22" Margin="0,20,0,0"/>
<TextBlock Foreground="Yellow" TextAlignment="Center" FontSize="22" Margin="0,20,0,0">
<TextBlock.Text>
<MultiBinding StringFormat=" {0} {1}开 ">
<Binding Path="ViewModel.FirstTrain.TrainNumber"/>
<Binding Path="ViewModel.FirstTrain.DepartureTime" Converter="{StaticResource DateTimeToTimeConverter}"/>
</MultiBinding>
</TextBlock.Text>
</TextBlock>
<TextBlock Foreground="Yellow" TextAlignment="Center" FontSize="22" Margin="0,5,0,30">
<TextBlock.Text>
<MultiBinding StringFormat=" {0} {1}开 ">
<Binding Path="ViewModel.SecondTrain.TrainNumber"/>
<Binding Path="ViewModel.SecondTrain.DepartureTime" Converter="{StaticResource DateTimeToTimeConverter}"/>
</MultiBinding>
</TextBlock.Text>
</TextBlock>
</StackPanel>
</Border>
</StackPanel>
</StackPanel>
</Window>

View File

@@ -0,0 +1,37 @@
using CRSim.ScreenSimulator.ViewModels.ChengduDong;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
namespace CRSim.ScreenSimulator.Views.ChengduDong
{
/// <summary>
/// SecondaryScreen.xaml 的交互逻辑
/// </summary>
public partial class PillarTicketCheckScreenView : Window
{
public PillarTicketCheckScreenViewModel ViewModel { get; }
public PillarTicketCheckScreenView(PillarTicketCheckScreenViewModel viewModel)
{
InitializeComponent();
ViewModel = viewModel;
RenderOptions.SetEdgeMode(this, EdgeMode.Aliased);
DataContext = this;
}
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();
}
}
}
}