mirror of
https://github.com/denglihong2007/CRSim
synced 2026-08-09 19:15:59 +08:00
@@ -13,11 +13,9 @@ namespace CRSim.ScreenSimulator.Converters
|
||||
*/
|
||||
object IMultiValueConverter.Convert(object[] values, System.Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
// return $"{values[0]},{values[1]},{values[2]}";
|
||||
if (values[0] is int Length && values[1] is int Location)
|
||||
{
|
||||
if(DisplayMode == "least" && values[2] is string Direction){
|
||||
// return Direction;
|
||||
if(Direction == "left")
|
||||
{
|
||||
if(Location <= Length)
|
||||
|
||||
@@ -22,12 +22,13 @@ namespace CRSim.ScreenSimulator.Converters
|
||||
var serviceProvider = (IServiceProvider)Application.Current.Resources["ServiceProvider"];
|
||||
_timeService = serviceProvider.GetRequiredService<ITimeService>();
|
||||
_settings = serviceProvider.GetRequiredService<ISettingsService>().GetSettings();
|
||||
if (DisplayMode == "Arrive" || values[1] == null)
|
||||
if (DisplayMode == "Arrive" || ( values.Length > 1 && values[1] == null))
|
||||
{
|
||||
if (values[0] is DateTime arriveTime)
|
||||
{
|
||||
return _timeService.GetDateTimeNow() > arriveTime ? ArrivedText : ArrivingText;
|
||||
}
|
||||
return string.Empty;
|
||||
}
|
||||
if (values[1] is DateTime departureTime && departureTime != new DateTime())
|
||||
{
|
||||
@@ -66,4 +67,4 @@ namespace CRSim.ScreenSimulator.Converters
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
using CRSim.Core.Models;
|
||||
using CRSim.Core.Services;
|
||||
using CRSim.ScreenSimulator.Models;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Windows;
|
||||
namespace CRSim.ScreenSimulator.ViewModels.Beijing
|
||||
{
|
||||
public class ArrivalScreenViewModel : ScreenViewModel
|
||||
{
|
||||
private ITimeService _timeService;
|
||||
public ObservableCollection<TrainInfo> Screen { get; set; } = [];
|
||||
public ArrivalScreenViewModel(ITimeService timeService, ISettingsService settingsService)
|
||||
: base(timeService, settingsService)
|
||||
{
|
||||
_timeService = timeService;
|
||||
StationType = StationType.Arrival;
|
||||
timeService.RefreshSecondsElapsed += RefreshDisplay;
|
||||
Initialize();
|
||||
}
|
||||
private async void Initialize()
|
||||
{
|
||||
ItemsPerPage = 2;
|
||||
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());
|
||||
}
|
||||
});
|
||||
}
|
||||
public override void RefreshData(object? sender, EventArgs e)
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using CRSim.Core.Models;
|
||||
using CRSim.Core.Services;
|
||||
using CRSim.ScreenSimulator.Models;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Windows;
|
||||
namespace CRSim.ScreenSimulator.ViewModels.DaqingDong
|
||||
{
|
||||
public class ConcourseBridgeScreenViewModel : ScreenViewModel
|
||||
{
|
||||
public ObservableCollection<TrainInfo> Screen { get; set; } = [];
|
||||
public ConcourseBridgeScreenViewModel(ITimeService timeService, ISettingsService settingsService)
|
||||
: base(timeService, settingsService)
|
||||
{
|
||||
StationType = StationType.Departure;
|
||||
timeService.RefreshSecondsElapsed += RefreshDisplay;
|
||||
Initialize();
|
||||
}
|
||||
private async void Initialize()
|
||||
{
|
||||
ItemsPerPage = 3;
|
||||
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());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
143
CRSim.ScreenSimulator/Views/Beijing/ArrivalScreenView.xaml
Normal file
143
CRSim.ScreenSimulator/Views/Beijing/ArrivalScreenView.xaml
Normal file
@@ -0,0 +1,143 @@
|
||||
<Window x:Class="CRSim.ScreenSimulator.Views.Beijing.ArrivalScreenView"
|
||||
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.Beijing"
|
||||
mc:Ignorable="d"
|
||||
xmlns:converters="clr-namespace:CRSim.ScreenSimulator.Converters"
|
||||
xmlns:converters1="clr-namespace:CRSim.Shared.Converters;assembly=CRSim.Shared"
|
||||
FontFamily="等线" FontSize="25" FontWeight="Bold"
|
||||
Title="引导屏" SizeToContent="WidthAndHeight"
|
||||
WindowStyle="None" AllowsTransparency="True" Background="Black"
|
||||
KeyDown="Window_KeyDown"
|
||||
ResizeMode="NoResize" MouseDown="Window_MouseDown">
|
||||
<Window.Resources>
|
||||
<Style TargetType="DataGridColumnHeader">
|
||||
<!-- 去除列头的间距 -->
|
||||
<Setter Property="Padding" Value="0"/>
|
||||
<Setter Property="Margin" Value="0"/>
|
||||
<Setter Property="BorderBrush" Value="Black"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
</Style>
|
||||
<converters:TrainStateColorConverter x:Key="TrainStateColorConverter"/>
|
||||
<converters:LandmarkToStringConverter x:Key="LandmarkToStringConverter"/>
|
||||
<converters1:EmptyToVisibilityConverter x:Key="EmptyToVisibilityConverter" />
|
||||
<converters:LocationToStringConverter x:Key="LocationToStringConverter" DisplayMode="least" />
|
||||
<converters:TrainStateConverter x:Key="TrainStateConverter" ArrivingText="正点到达" DisplayMode="Arrive" />
|
||||
<converters:NumberToStringConverter x:Key="NumberToStringConverter"/>
|
||||
<converters1:DateTimeToStringConverter x:Key="DateTimeToStringConverter" Format="HH:mm" />
|
||||
</Window.Resources>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<StackPanel Orientation="Vertical" Background="Black" VerticalAlignment="Center">
|
||||
<TextBlock Text="{Binding ThisPlatform}" FontSize="64" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="#ffffff">
|
||||
<TextBlock.LayoutTransform>
|
||||
<ScaleTransform ScaleX="1.2" ScaleY="1"/>
|
||||
</TextBlock.LayoutTransform>
|
||||
</TextBlock>
|
||||
<StackPanel Orientation="Horizontal" Margin="10,0">
|
||||
<TextBlock Text="站台" FontSize="18" VerticalAlignment="Center" Foreground="#ffffff" Margin="0,0,15,0"/>
|
||||
<TextBlock Text="platform" FontSize="16" VerticalAlignment="Center" Foreground="#ffffff" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<DataGrid ItemsSource="{Binding Screen}" AutoGenerateColumns="False" BorderThickness="0"
|
||||
CanUserResizeColumns="False" CanUserSortColumns="False" CanUserAddRows="False"
|
||||
CanUserResizeRows="False" CanUserReorderColumns="False"
|
||||
IsReadOnly="True" GridLinesVisibility="None" RowHeight="34" Foreground="White"
|
||||
HeadersVisibility="Column" IsEnabled="False">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Binding="{Binding TrainNumber}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="车次" Padding="2" HorizontalAlignment="Stretch" TextAlignment="Center" Background="Black" Width="110"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="TextAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding Origin}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="始发站" Padding="2" HorizontalAlignment="Stretch" TextAlignment="Center" Background="Black" Width="110"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="TextAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding Terminal}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="终到站" Padding="2" HorizontalAlignment="Stretch" TextAlignment="Center" Background="Black" Width="110"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="TextAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding ArrivalTime, Converter={StaticResource DateTimeToStringConverter}}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="到点" Padding="2" HorizontalAlignment="Stretch" TextAlignment="Center" Background="Black" Width="100"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="TextAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding Platform}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="站台" Padding="2" HorizontalAlignment="Stretch" TextAlignment="Center" Background="Black" Width="80"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="TextAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn>
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="状态" Padding="2" HorizontalAlignment="Stretch" TextAlignment="Center" Background="Black" Width="130"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="TextAlignment" Value="Center"/>
|
||||
<Setter Property="Visibility" Value="{Binding TrainNumber,Converter={StaticResource EmptyToVisibilityConverter}}"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
<DataGridTextColumn.Binding>
|
||||
<MultiBinding Converter="{StaticResource TrainStateConverter}">
|
||||
<Binding Path="ArrivalTime" />
|
||||
</MultiBinding>
|
||||
</DataGridTextColumn.Binding>
|
||||
</DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
<DataGrid.RowStyle>
|
||||
<Style TargetType="DataGridRow">
|
||||
<Setter Property="Background" Value="Black"/>
|
||||
</Style>
|
||||
</DataGrid.RowStyle>
|
||||
</DataGrid>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Window>
|
||||
@@ -0,0 +1,36 @@
|
||||
using CRSim.ScreenSimulator.ViewModels.Beijing;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
namespace CRSim.ScreenSimulator.Views.Beijing
|
||||
{
|
||||
/// <summary>
|
||||
/// SecondaryScreen.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class ArrivalScreenView : Window
|
||||
{
|
||||
public ArrivalScreenViewModel ViewModel { get; }
|
||||
public ArrivalScreenView(ArrivalScreenViewModel 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
<Window x:Class="CRSim.ScreenSimulator.Views.DaqingDong.ConcourseBridgeScreenView"
|
||||
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"
|
||||
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||
mc:Ignorable="d"
|
||||
xmlns:converters="clr-namespace:CRSim.ScreenSimulator.Converters"
|
||||
xmlns:converters1="clr-namespace:CRSim.Shared.Converters;assembly=CRSim.Shared"
|
||||
FontFamily="等线" FontSize="25" FontWeight="Bold"
|
||||
Title="引导屏" SizeToContent="WidthAndHeight"
|
||||
WindowStyle="None" AllowsTransparency="True" Background="#201921" Foreground="#fdfce5"
|
||||
KeyDown="Window_KeyDown"
|
||||
ResizeMode="NoResize" MouseDown="Window_MouseDown">
|
||||
<Window.Resources>
|
||||
<Style TargetType="DataGridColumnHeader">
|
||||
<!-- 去除列头的间距 -->
|
||||
<Setter Property="Padding" Value="0"/>
|
||||
<Setter Property="Margin" Value="0"/>
|
||||
<Setter Property="BorderBrush" Value="#201921"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
</Style>
|
||||
<converters:TrainStateConverter x:Key="TrainStateConverter"/>
|
||||
<converters:TrainStateColorConverter x:Key="TrainStateColorConverter"/>
|
||||
<converters:LandmarkToStringConverter x:Key="LandmarkToStringConverter"/>
|
||||
<converters1:EmptyToVisibilityConverter x:Key="EmptyToVisibilityConverter" />
|
||||
<converters:LocationToStringConverter x:Key="LocationToStringConverter" DisplayMode="least" />
|
||||
<converters:NumberToStringConverter x:Key="NumberToStringConverter"/>
|
||||
<converters1:DateTimeToStringConverter x:Key="DateTimeToStringConverter" Format="HH:mm" />
|
||||
</Window.Resources>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<StackPanel Background="#2556ff" Orientation="Horizontal">
|
||||
<TextBlock Text="{Binding ThisPlatform}" FontSize="82" VerticalAlignment="Center" Foreground="#ffffff" Margin="6,0,0,0"/>
|
||||
<StackPanel Orientation="Vertical" VerticalAlignment="Center" Margin="0,0,6,0">
|
||||
<TextBlock Text="站 台" FontSize="35" VerticalAlignment="Center" Foreground="#ffffff" Margin="0,0,0,4"/>
|
||||
<TextBlock Text="Platfrom" FontSize="22" VerticalAlignment="Center" Foreground="#ffffff"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<DataGrid ItemsSource="{Binding Screen}" AutoGenerateColumns="False" BorderThickness="0"
|
||||
CanUserResizeColumns="False" CanUserSortColumns="False" CanUserAddRows="False"
|
||||
CanUserResizeRows="False" CanUserReorderColumns="False" ClipToBounds="False"
|
||||
IsReadOnly="True" GridLinesVisibility="None" RowHeight="34" Foreground="White"
|
||||
HeadersVisibility="Column" IsEnabled="False">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn>
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="车厢" Padding="2" HorizontalAlignment="Stretch" TextAlignment="Center" Background="#201921" Foreground="#ff1111" Width="120"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="TextAlignment" Value="Center"/>
|
||||
<Setter Property="Visibility" Value="{Binding TrainNumber,Converter={StaticResource EmptyToVisibilityConverter}}"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
<DataGridTextColumn.Binding>
|
||||
<MultiBinding Converter="{StaticResource LocationToStringConverter}">
|
||||
<Binding Path="Length" />
|
||||
<Binding Path="DataContext.Location" RelativeSource="{RelativeSource AncestorType={x:Type DataGrid}}" />
|
||||
<Binding Source="left" />
|
||||
</MultiBinding>
|
||||
</DataGridTextColumn.Binding>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding TrainNumber}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="车次" Padding="2" HorizontalAlignment="Stretch" TextAlignment="Center" Background="#201921" Foreground="#ff1111" Width="120"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="TextAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding Origin}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="始发站" Padding="2" HorizontalAlignment="Stretch" TextAlignment="Center" Background="#201921" Foreground="#ff1111" Width="140"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="TextAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding Terminal}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="终到站" Padding="2" HorizontalAlignment="Stretch" TextAlignment="Center" Background="#201921" Foreground="#ff1111" Width="140"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="TextAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding Platform}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="站台" Padding="2" HorizontalAlignment="Stretch" TextAlignment="Center" Background="#201921" Foreground="#ff1111" Width="80"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="TextAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding DepartureTime, Converter={StaticResource DateTimeToStringConverter}}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="开点" Padding="2" HorizontalAlignment="Stretch" TextAlignment="Center" Background="#201921" Foreground="#ff1111" Width="120"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="TextAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn>
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="车厢" Padding="2" HorizontalAlignment="Stretch" TextAlignment="Center" Background="#201921" Foreground="#ff1111" Width="120"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="TextAlignment" Value="Center"/>
|
||||
<Setter Property="Visibility" Value="{Binding TrainNumber,Converter={StaticResource EmptyToVisibilityConverter}}"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
<DataGridTextColumn.Binding>
|
||||
<MultiBinding Converter="{StaticResource LocationToStringConverter}">
|
||||
<Binding Path="Length" />
|
||||
<Binding Path="DataContext.Location" RelativeSource="{RelativeSource AncestorType={x:Type DataGrid}}" />
|
||||
<Binding Source="right" />
|
||||
</MultiBinding>
|
||||
</DataGridTextColumn.Binding>
|
||||
</DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
<DataGrid.RowStyle>
|
||||
<Style TargetType="DataGridRow">
|
||||
<Setter Property="Background" Value="#201921"/>
|
||||
<Setter Property="Foreground" Value="#eedd82"/>
|
||||
</Style>
|
||||
</DataGrid.RowStyle>
|
||||
<DataGrid.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="Foreground" Value="#eedd82"/>
|
||||
</Style>
|
||||
</DataGrid.CellStyle>
|
||||
</DataGrid>
|
||||
</StackPanel>
|
||||
<StackPanel Background="#2556ff" Orientation="Horizontal">
|
||||
<TextBlock Text="{Binding ThisPlatform}" FontSize="82" VerticalAlignment="Center" Foreground="#ffffff" Margin="6,0,0,0"/>
|
||||
<StackPanel Orientation="Vertical" VerticalAlignment="Center" Margin="0,0,6,0">
|
||||
<TextBlock Text="站 台" FontSize="35" VerticalAlignment="Center" Foreground="#ffffff" Margin="0,0,0,4"/>
|
||||
<TextBlock Text="Platfrom" FontSize="22" VerticalAlignment="Center" Foreground="#ffffff"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Window>
|
||||
@@ -0,0 +1,36 @@
|
||||
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 ConcourseBridgeScreenView : Window
|
||||
{
|
||||
public ConcourseBridgeScreenViewModel ViewModel { get; }
|
||||
public ConcourseBridgeScreenView(ConcourseBridgeScreenViewModel 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -31,27 +31,25 @@
|
||||
<converters1:DateTimeToStringConverter x:Key="DateTimeToStringConverter" Format="HH:mm" />
|
||||
</Window.Resources>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Grid Background="#000000" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" MinWidth="220">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Width="40" Height="30" Margin="-70,0,30,0">
|
||||
<Path Data="M1221 2752 c-470 -449 -856 -822 -858 -828 -2 -6 329 -338 735 -737 l740 -726 692 -31 c381 -17 694 -29 695 -28 1 2 -208 275 -465 608 l-467 605 1453 3 1454 2 0 375 0 375 -1477 0 -1478 0 580 580 c472 472 575 580 555 580 -14 0 -304 9 -645 20 -341 11 -629 19 -640 19 -12 0 -343 -310 -874 -817z" Stroke="White" Fill="White" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Stretch="Uniform"/>
|
||||
</Grid>
|
||||
<TextBlock Text="{Binding ThisPlatform}" FontSize="60" TextAlignment="Center" VerticalAlignment="Center" FontFamily="黑体" FontWeight="Black" Foreground="#ffffff" Margin="10,0,0,0">
|
||||
<StackPanel Orientation="Horizontal" Background="#000000" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
|
||||
<Path Height="30" Width="40" Stroke="White" Fill="White" Stretch="Uniform" Margin="20,0,10,0"
|
||||
Data="M1221 2752 c-470 -449 -856 -822 -858 -828 -2 -6 329 -338 735 -737 l740 -726 692 -31 c381 -17 694 -29 695 -28 1 2 -208 275 -465 608 l-467 605 1453 3 1454 2 0 375 0 375 -1477 0 -1478 0 580 580 c472 472 575 580 555 580 -14 0 -304 9 -645 20 -341 11 -629 19 -640 19 -12 0 -343 -310 -874 -817z"/>
|
||||
<TextBlock Text="{Binding ThisPlatform}" FontSize="60" VerticalAlignment="Center" FontFamily="黑体" Foreground="#ffffff" FontWeight="Normal">
|
||||
<TextBlock.LayoutTransform>
|
||||
<ScaleTransform ScaleX="1.25" ScaleY="1"/>
|
||||
<ScaleTransform ScaleX="1.2" ScaleY="1"/>
|
||||
</TextBlock.LayoutTransform>
|
||||
</TextBlock>
|
||||
<TextBlock Text="站台" FontSize="23" TextAlignment="Left" VerticalAlignment="Center" FontFamily="黑体" FontWeight="Black" Foreground="#ffffff" Margin="140,0,0,12" />
|
||||
<TextBlock Text="Platfrom" FontSize="16" TextAlignment="Left" VerticalAlignment="Center" FontFamily="黑体" FontWeight="Black" Foreground="#ffffff" Margin="140,23,0,0" />
|
||||
</Grid>
|
||||
<StackPanel Orientation="Vertical" VerticalAlignment="Center">
|
||||
<TextBlock Text="站台" FontSize="23" VerticalAlignment="Center" FontFamily="黑体" Foreground="#ffffff" />
|
||||
<TextBlock Text="Platfrom" FontSize="16" VerticalAlignment="Center" FontFamily="Arial" Foreground="#ffffff" Margin="0,0,20,0"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<DataGrid ItemsSource="{Binding Screen}" AutoGenerateColumns="False"
|
||||
<DataGrid ItemsSource="{Binding Screen}" AutoGenerateColumns="False" BorderThickness="0"
|
||||
CanUserResizeColumns="False" CanUserSortColumns="False" CanUserAddRows="False"
|
||||
CanUserResizeRows="False" CanUserReorderColumns="False" ClipToBounds="False"
|
||||
IsReadOnly="True" GridLinesVisibility="None" RowHeight="28" Foreground="White"
|
||||
HeadersVisibility="Column" IsEnabled="False">
|
||||
IsReadOnly="True" GridLinesVisibility="None" RowHeight="34" Foreground="White"
|
||||
HeadersVisibility="Column" IsEnabled="False" Margin="0,4">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn>
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
@@ -155,20 +153,18 @@
|
||||
</DataGrid.RowStyle>
|
||||
</DataGrid>
|
||||
</StackPanel>
|
||||
<Grid Background="#000000" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" MinWidth="220">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Text="{Binding ThisPlatform}" FontSize="60" TextAlignment="Center" VerticalAlignment="Center" FontFamily="黑体" FontWeight="Black" Foreground="#ffffff" Margin="-100,0,0,0">
|
||||
<StackPanel Orientation="Horizontal" Background="#000000" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
|
||||
<TextBlock Text="{Binding ThisPlatform}" FontSize="60" VerticalAlignment="Center" FontFamily="黑体" Foreground="#ffffff" FontWeight="Normal" Margin="20,0,0,0">
|
||||
<TextBlock.LayoutTransform>
|
||||
<ScaleTransform ScaleX="1.25" ScaleY="1"/>
|
||||
<ScaleTransform ScaleX="1.2" ScaleY="1"/>
|
||||
</TextBlock.LayoutTransform>
|
||||
</TextBlock>
|
||||
<TextBlock Text="站台" FontSize="23" TextAlignment="Right" VerticalAlignment="Center" FontFamily="黑体" FontWeight="Black" Foreground="#ffffff" Margin="0,0,70,12" />
|
||||
<TextBlock Text="Platfrom" FontSize="16" TextAlignment="Right" VerticalAlignment="Center" FontFamily="黑体" FontWeight="Black" Foreground="#ffffff" Margin="0,23,70,0" />
|
||||
<Grid Width="40" Height="30" Margin="130,0,0,0">
|
||||
<Path Data="M3235 3549 c-291 -9 -555 -18 -585 -18 l-55 -1 580 -580 580 -580 -1478 0 -1477 0 0 -375 0 -375 1454 -2 1453 -3 -467 -605 c-257 -333 -466 -606 -465 -608 1 -1 314 11 695 28 l692 31 739 725 c407 399 739 730 739 734 0 5 -387 378 -860 830 l-860 820 -77 -1 c-43 -1 -316 -10 -608 -20z" Stroke="White" Fill="White" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Stretch="Uniform"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<StackPanel Orientation="Vertical" VerticalAlignment="Center">
|
||||
<TextBlock Text="站台" FontSize="23" VerticalAlignment="Center" FontFamily="黑体" Foreground="#ffffff" />
|
||||
<TextBlock Text="Platfrom" FontSize="16" VerticalAlignment="Center" FontFamily="Arial" Foreground="#ffffff"/>
|
||||
</StackPanel>
|
||||
<Path Height="30" Width="40" Stroke="White" Fill="White" Stretch="Uniform" Margin="10,0,20,0"
|
||||
Data="M3235 3549 c-291 -9 -555 -18 -585 -18 l-55 -1 580 -580 580 -580 -1478 0 -1477 0 0 -375 0 -375 1454 -2 1453 -3 -467 -605 c-257 -333 -466 -606 -465 -608 1 -1 314 11 695 28 l692 31 739 725 c407 399 739 730 739 734 0 5 -387 378 -860 830 l-860 820 -77 -1 c-43 -1 -316 -10 -608 -20z"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Window>
|
||||
|
||||
@@ -81,6 +81,10 @@
|
||||
services.AddTransient<ScreenSimulator.Views.FuzhouNan.TicketCheckScreenView>();
|
||||
services.AddTransient<ScreenSimulator.ViewModels.Ankang.ExitScreenViewModel>();
|
||||
services.AddTransient<ScreenSimulator.Views.Ankang.ExitScreenView>();
|
||||
services.AddTransient<ScreenSimulator.Views.Beijing.ArrivalScreenView>();
|
||||
services.AddTransient<ScreenSimulator.ViewModels.Beijing.ArrivalScreenViewModel>();
|
||||
services.AddTransient<ScreenSimulator.Views.DaqingDong.ConcourseBridgeScreenView>();
|
||||
services.AddTransient<ScreenSimulator.ViewModels.DaqingDong.ConcourseBridgeScreenViewModel>();
|
||||
}).Build();
|
||||
|
||||
[STAThread]
|
||||
|
||||
BIN
CRSim/Assets/StyleImages/Beijing/ArrivalScreen.png
Normal file
BIN
CRSim/Assets/StyleImages/Beijing/ArrivalScreen.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.7 KiB |
BIN
CRSim/Assets/StyleImages/DaqingDong/ConcourseBridgeScreen.png
Normal file
BIN
CRSim/Assets/StyleImages/DaqingDong/ConcourseBridgeScreen.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.1 KiB |
@@ -72,6 +72,8 @@
|
||||
<Resource Include="Assets\StyleImages\Zibo\TicketCheckScreen.png" />
|
||||
<Resource Include="Assets\StyleImages\Zibo\PlatformScreen.png" />
|
||||
<Resource Include="Assets\StyleImages\Zibo\ConcourseBridgeScreen.png" />
|
||||
<Resource Include="Assets\StyleImages\Beijing\ArrivalScreen.png" />
|
||||
<Resource Include="Assets\StyleImages\DaqingDong\ConcourseBridgeScreen.png" />
|
||||
<Resource Include="Assets\win11-dashboard.dark.png" />
|
||||
<Resource Include="Assets\win11-dashboard.light.png" />
|
||||
<EmbeddedResource Include="Models\StylesInfoData.json" />
|
||||
|
||||
@@ -217,7 +217,7 @@
|
||||
"Title": "淄博站廊桥看板",
|
||||
"Station": "淄博",
|
||||
"Author": "wxl0430",
|
||||
"Type": "站台屏",
|
||||
"Type": "走廊出发屏",
|
||||
"ImagePath": "Assets/StyleImages/Zibo/ConcourseBridgeScreen.png",
|
||||
"Parameters": [
|
||||
"Station",
|
||||
@@ -259,5 +259,30 @@
|
||||
"Station",
|
||||
"Text"
|
||||
]
|
||||
},
|
||||
{
|
||||
"UniqueId": "Beijing.ArrivalScreen",
|
||||
"Title": "北京站地道到达看板",
|
||||
"Station": "北京",
|
||||
"Author": "wxl0430",
|
||||
"Type": "走廊到达屏",
|
||||
"ImagePath": "Assets/StyleImages/Beijing/ArrivalScreen.png",
|
||||
"Parameters": [
|
||||
"Station",
|
||||
"Platform"
|
||||
]
|
||||
},
|
||||
{
|
||||
"UniqueId": "DaqingDong.ConcourseBridgeScreen",
|
||||
"Title": "大庆东站廊桥看板",
|
||||
"Station": "大庆东",
|
||||
"Author": "wxl0430",
|
||||
"Type": "走廊出发屏",
|
||||
"ImagePath": "Assets/StyleImages/DaqingDong/ConcourseBridgeScreen.png",
|
||||
"Parameters": [
|
||||
"Station",
|
||||
"Platform",
|
||||
"Location"
|
||||
]
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user