20240301_JSEQ_upperpc/JiangsuEarthquakeNowUI/JiangsuEarthquake/Views/SystemEnvironDataView.xaml
2024-11-01 15:54:08 +08:00

357 lines
25 KiB
XML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<UserControl x:Class="JiangsuEarthquake.Views.SystemEnvironDataView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:JiangsuEarthquake.Views"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:CommonValueToBrushConvert="clr-namespace:JiangsuEarthquake.Common.ValueToBrushConvert"
mc:Ignorable="d"
FontFamily="{StaticResource DigitalDisplay}"
Name="SystemStateDataPage"
d:DesignHeight="850" d:DesignWidth="1550">
<UserControl.Resources>
<Style TargetType="DataGridColumnHeader">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="Background" Value="#FF003562"/>
<Setter Property="FontFamily" Value="{StaticResource SourceHanSansCNBold}"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="Foreground" Value="#FF00BAFF"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridColumnHeader}">
<Grid>
<Border x:Name="columnHeaderBorder" BorderThickness="0"
BorderBrush="#EEE"
Background="{TemplateBinding Background}">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
TextBlock.TextAlignment="Center"
TextBlock.FontSize="14"
TextBlock.Foreground="#FF00BAFF"/>
</Border>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border CornerRadius="8" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<LinearGradientBrush x:Key="AlternatingBackgroundBrush" StartPoint="0,0" EndPoint="1,0">
<GradientStop Color="#330D6EFF" Offset="0"/>
<GradientStop Color="#33094895" Offset="1"/>
</LinearGradientBrush>
<CommonValueToBrushConvert:ValueToBrushConvert x:Key="ValueToBrushConvert"/>
<CommonValueToBrushConvert:ValueToBrushConvertAttitude x:Key="ValueToBrushConvertAttitude"/>
</UserControl.Resources>
<Grid Margin="10,0,18,18">
<Grid.Background>
<ImageBrush ImageSource="../Assets/Images/JunctionBoxEnviron/Background.png"/>
</Grid.Background>
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition Height="0.13*"/>
<RowDefinition Height="10"/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock Text="接驳盒环境数据展示" FontSize="16" FontFamily="{StaticResource SourceHanSansCNBold}"
Foreground="White" HorizontalAlignment="Left" VerticalAlignment="Top"
Margin="20,7,0,0"/>
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="0.2*"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid Grid.Row="1">
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Left"
Orientation="Horizontal" Margin="40,0,0,0">
<TextBlock Text="选择时间" Foreground="#FF63829B" FontSize="14"
FontFamily="{StaticResource SourceHanSansCNRegular}"
HorizontalAlignment="Center" VerticalAlignment="Center"/>
<hc:DateTimePicker hc:InfoElement.ShowClearButton="True"
hc:InfoElement.TitleWidth="0" hc:InfoElement.TitlePlacement="Left"
Style="{StaticResource DateTimePickerPlus}" HorizontalContentAlignment="Center"
Foreground="#FF99B9D0" CaretBrush="#FF63829B" Height="40"
FontSize="14" Width="220" Margin="20,0,0,0" Background="Transparent"
BorderBrush="#FF63829B" SelectedDateTime="{Binding StartDateTime}"/>
<TextBlock Text="——" Foreground="#FF879AA9" HorizontalAlignment="Center"
VerticalAlignment="Center" Margin="20,0,0,0"/>
<hc:DateTimePicker hc:InfoElement.ShowClearButton="True"
hc:InfoElement.TitleWidth="0" hc:InfoElement.TitlePlacement="Left"
Style="{StaticResource DateTimePickerPlus}" HorizontalContentAlignment="Center"
Foreground="#FF99B9D0" CaretBrush="#FF63829B" Height="40"
FontSize="14" Width="220" Margin="20,0,0,0" Background="Transparent"
BorderBrush="#FF63829B" SelectedDateTime="{Binding EndDateTime}"/>
<Button Width="90" Height="40" Background="#FF006FBE" Margin="30,0,0,0"
Command="{Binding SearchEnvironDataCommand}" BorderThickness="0">
<Button.Content>
<StackPanel Orientation="Horizontal">
<Image Source="/Assets/Images/JunctionBoxEnviron/Search.png" Stretch="Fill" Width="15" Height="15"/>
<TextBlock Text="查询" HorizontalAlignment="Center" VerticalAlignment="Center"
Margin="10,0,0,0" FontSize="14" Foreground="White"
FontFamily="{StaticResource SourceHanSansCNLight}"/>
</StackPanel>
</Button.Content>
</Button>
<Button Width="90" Height="40" Background="Transparent" Margin="20,0,0,0"
BorderBrush="#FF006FBE" Command="{Binding ResetSearchCommand}">
<Button.Content>
<StackPanel Orientation="Horizontal">
<Image Source="/Assets/Images/JunctionBoxEnviron/Reset.png" Stretch="Fill" Width="15" Height="15"/>
<TextBlock Text="重置" HorizontalAlignment="Center" VerticalAlignment="Center"
Margin="10,0,0,0" FontSize="14" Foreground="#FF006FBE"
FontFamily="{StaticResource SourceHanSansCNLight}"/>
</StackPanel>
</Button.Content>
</Button>
</StackPanel>
</Grid>
</Grid>
<Border Grid.Row="2" BorderThickness="1" BorderBrush="#FF4282B8" Height="0.6"
Width="1580" Margin="10,0,0,0"/>
<Grid Grid.Row="3">
<Grid.RowDefinitions>
<RowDefinition Height="0.9*"/>
<RowDefinition Height="9*"/>
<RowDefinition Height="0.9*"/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" VerticalAlignment="Bottom" HorizontalAlignment="Right"
Margin="0,0,40,4">
<Button Width="110" Height="40" Background="#55052945"
BorderBrush="#FF10CAFF" Command="{Binding RefreshDataCommand}">
<Button.Content>
<StackPanel Orientation="Horizontal">
<Image Source="/Assets/Images/JunctionBoxEnviron/Refresh.png" Stretch="Fill" Width="18" Height="18"/>
<TextBlock Text="刷新数据" HorizontalAlignment="Center" VerticalAlignment="Center"
Margin="10,0,0,0" FontSize="14" Foreground="#FF00AEFF"
FontFamily="{StaticResource SourceHanSansCNLight}"/>
</StackPanel>
</Button.Content>
</Button>
<!--<Button Width="110" Height="40" Background="#55052945" Margin="30,0,0,0"
IsEnabled="{Binding DownloadDataBtnIsEnabled}"
BorderBrush="#FF10CAFF" Command="{Binding DownloadDataCommand}">
<Button.Content>
<StackPanel Orientation="Horizontal">
<Image Source="/Assets/Images/JunctionBoxEnviron/Down.png" Stretch="Fill" Width="18" Height="18"/>
<TextBlock Text="下载数据" HorizontalAlignment="Center" VerticalAlignment="Center"
Margin="10,0,0,0" FontSize="14" Foreground="#FF00AEFF"
FontFamily="{StaticResource SourceHanSansCNLight}"/>
</StackPanel>
</Button.Content>
</Button>-->
</StackPanel>
<Grid Margin="10,0,10,10" Grid.Row="1">
<DataGrid x:Name="SystemStateDataGrid" ItemsSource="{Binding SystemStateDataList,Mode=TwoWay}"
AutoGenerateColumns="False" Margin="10,0,10,0" CanUserSortColumns="False"
CanUserAddRows="False" CanUserDeleteRows="False" Background="Transparent"
CanUserReorderColumns="False" CanUserResizeColumns="False"
CanUserResizeRows="False" BorderThickness="0" Grid.RowSpan="2">
<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
<Setter Property="Background" Value="Transparent"/>
<Style.Triggers>
<Trigger Property="ItemsControl.AlternationIndex" Value="0">
<Setter Property="Background" Value="Transparent"/>
</Trigger>
<Trigger Property="ItemsControl.AlternationIndex" Value="1">
<Setter Property="Background" Value="{StaticResource AlternatingBackgroundBrush}"/>
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.Resources>
<Style TargetType="DataGridCell" x:Key="DataGridCellCenter">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="FontFamily" Value="{StaticResource SourceHanSansCNRegular}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridCell">
<Border x:Name="border" BorderBrush="#A0A0A0" BorderThickness="0"
Background="{TemplateBinding Background}">
<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</DataGrid.Resources>
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Index}" Width="0.5*" Header="编号"
CanUserSort="False" CellStyle="{StaticResource DataGridCellCenter}"/>
<DataGridTextColumn Binding="{Binding RecordTime, StringFormat='yyyy/MM/dd HH:mm:ss'}" Width="1.8*" Header="记录时间"
CanUserSort="False" CellStyle="{StaticResource DataGridCellCenter}"/>
<!--<DataGridTextColumn Binding="{Binding Temperature,StringFormat=F2}" Width="0.7*" Header="温度 ℃"
CanUserSort="False" CellStyle="{StaticResource DataGridCellCenter}"/>-->
<!--接驳盒内部温度设置范围为0-50-->
<DataGridTemplateColumn Width="0.7*" Header="温度 ℃" CellStyle="{StaticResource DataGridCellCenter}">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock HorizontalAlignment="Center" Text="{Binding Temperature,StringFormat=F2}"
Foreground="{Binding Path=Temperature, Converter={StaticResource ValueToBrushConvert},ConverterParameter=50}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--<DataGridTextColumn Binding="{Binding Humidity,StringFormat=F2}" Width="0.7*" Header="湿度 %"
CanUserSort="False" CellStyle="{StaticResource DataGridCellCenter}"/>-->
<!--接驳盒内部湿度设置范围为0-80-->
<DataGridTemplateColumn Width="0.7*" Header="湿度 %" CellStyle="{StaticResource DataGridCellCenter}">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock HorizontalAlignment="Center" Text="{Binding Humidity,StringFormat=F2}"
Foreground="{Binding Path=Humidity, Converter={StaticResource ValueToBrushConvert},ConverterParameter=80}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--<DataGridTemplateColumn Header="舱门状态" Width="0.9*" CellStyle="{StaticResource DataGridCellCenter}">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Image Source="{Binding Hatch_State}" Width="20" Height="20"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>-->
<!--<DataGridTemplateColumn Header="漏水情况" Width="0.9*" CellStyle="{StaticResource DataGridCellCenter}">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Image Source="{Binding Leakage}" Width="20" Height="20"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>-->
<DataGridTextColumn Header="漏水情况" Width="0.9*" Binding="{Binding Leakage}">
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Style.Triggers>
<DataTrigger Binding="{Binding Leakage}" Value="未漏水">
<Setter Property="Foreground" Value="#FF01DF70"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="FontFamily" Value="{StaticResource SourceHanSansCNRegular}"/>
</DataTrigger>
<DataTrigger Binding="{Binding Leakage}" Value="漏水">
<Setter Property="Foreground" Value="#FFFF6A6A"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="FontFamily" Value="{StaticResource SourceHanSansCNRegular}"/>
</DataTrigger>
<DataTrigger Binding="{Binding Leakage}" Value="未知">
<Setter Property="Foreground" Value="Gray"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="FontFamily" Value="{StaticResource SourceHanSansCNRegular}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<!--<DataGridTextColumn Binding="{Binding AttitudeX,StringFormat=F2}" Width="0.8*" Header="横滚角 °"
CanUserSort="False" CellStyle="{StaticResource DataGridCellCenter}"/>-->
<!--接驳盒横滚角设置范围为:-20-20-->
<DataGridTemplateColumn Width="0.8*" Header="横滚角 °" CellStyle="{StaticResource DataGridCellCenter}">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock HorizontalAlignment="Center" Text="{Binding AttitudeX,StringFormat=F2}"
Foreground="{Binding Path=AttitudeX, Converter={StaticResource ValueToBrushConvertAttitude},ConverterParameter=20}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--<DataGridTextColumn Binding="{Binding AttitudeY,StringFormat=F2}" Width="0.8*" Header="俯仰角 °"
CanUserSort="False" CellStyle="{StaticResource DataGridCellCenter}"/>-->
<!--接驳盒俯仰角设置范围为:-20-20-->
<DataGridTemplateColumn Width="0.8*" Header="俯仰角 °" CellStyle="{StaticResource DataGridCellCenter}">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock HorizontalAlignment="Center" Text="{Binding AttitudeY,StringFormat=F2}"
Foreground="{Binding Path=AttitudeY, Converter={StaticResource ValueToBrushConvertAttitude},ConverterParameter=20}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!--<DataGridTextColumn Binding="{Binding AttitudeZ,StringFormat=F2}" Width="0.8*" Header="偏航角 °"
CanUserSort="False" CellStyle="{StaticResource DataGridCellCenter}"/>-->
<!--接驳盒偏航角设置范围为:-20-20-->
<DataGridTemplateColumn Width="0.8*" Header="偏航角 °" CellStyle="{StaticResource DataGridCellCenter}">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock HorizontalAlignment="Center" Text="{Binding AttitudeZ,StringFormat=F2}"
Foreground="{Binding Path=AttitudeZ, Converter={StaticResource ValueToBrushConvertAttitude},ConverterParameter=20}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
</Grid>
<StackPanel Orientation="Horizontal" Grid.Row="2" VerticalAlignment="Top"
HorizontalAlignment="Right" Margin="0,0,10,0">
<TextBlock Text="共计" FontSize="14" Foreground="White" HorizontalAlignment="Center"
VerticalAlignment="Center" FontFamily="{StaticResource SourceHanSansCNRegular}"/>
<TextBlock VerticalAlignment="Center" FontSize="14" Foreground="#FF2A97CA"
Margin="5,0,5,0" Text="{Binding SystemStateTotalPage}"
FontFamily="{StaticResource SourceHanSansCNBold}"/>
<TextBlock Text="页 , 当前第" FontSize="14" Foreground="White" HorizontalAlignment="Center"
VerticalAlignment="Center" FontFamily="{StaticResource SourceHanSansCNRegular}"/>
<TextBlock VerticalAlignment="Center" FontSize="14" Foreground="#FF2A97CA"
Margin="5,0,5,0" Text="{Binding SystemStateNowPage}"
FontFamily="{StaticResource SourceHanSansCNBold}"/>
<TextBlock Text="页" FontSize="14" Foreground="White" HorizontalAlignment="Center" Margin="0,0,20,0"
VerticalAlignment="Center" FontFamily="{StaticResource SourceHanSansCNRegular}"/>
<Button FontSize="16" Command="{Binding ForwordSystemStateCommand}"
Background="Transparent" BorderBrush="White" Style="{StaticResource ButtonStyle}"
Foreground="White" Width="35" Height="35">
<Button.Content>
<Image Source="../Assets/Images/JunctionBoxEnviron/Left.png" Height="15" Width="15"/>
</Button.Content>
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="4"/>
</Style>
</Button.Resources>
</Button>
<Button FontSize="16" Margin="10,0,20,0" Background="Transparent"
Command="{Binding NextSystemStateCommand}" BorderBrush="White"
Style="{StaticResource ButtonStyle}"
Foreground="White" Width="35" Height="35">
<Button.Content>
<Image Source="../Assets/Images/JunctionBoxEnviron/Right.png" Height="15" Width="15"/>
</Button.Content>
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="4"/>
</Style>
</Button.Resources>
</Button>
</StackPanel>
</Grid>
</Grid>
</UserControl>