20240801_FJEQ_upperpc/FujianEarthquake_seabed/FujianEarthquake/Views/JunctionBoxEnvironDataView.xaml
XuMin 2f88b96460 1 完成接驳盒环境数据展示页面的编写;
2 完成接驳盒状态数据展示页面的编写;
2024-08-27 17:39:30 +08:00

446 lines
31 KiB
XML
Raw 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="FujianEarthquake.Views.JunctionBoxEnvironDataView"
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:FujianEarthquake.Views"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:CommonValueToBrushConvert="clr-namespace:FujianEarthquake.Common.ValueToBrushConvert"
mc:Ignorable="d"
FontFamily="{StaticResource DigitalDisplay}"
Name="JunctionBoxEnvironDataPage"
d:DesignHeight="850" d:DesignWidth="1550">
<UserControl.Resources>
<Style TargetType="GroupBox">
<Setter Property="Margin" Value="10,5"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="GroupBox">
<Grid>
<!--左上角-->
<Polyline HorizontalAlignment="Left" VerticalAlignment="Top"
Points="0 30,0 10,10 0,30 0" Stroke="#9918AABD" StrokeThickness="1"/>
<!--左上角点-->
<Ellipse Width="4" Height="4" VerticalAlignment="Top" HorizontalAlignment="Left"
Fill="#9918AABD" Margin="24,-2,0,0"/>
<Ellipse Width="4" Height="4" VerticalAlignment="Top" HorizontalAlignment="Left"
Fill="#9918AABD" Margin="-2,24,0,0"/>
<!--右上角-->
<Path Data="M0 0, 3 3, 30 3, 33 0, 68 0, 73 7,78 7, 78 10M8 0, 25 0"
Stroke="#5518AABD" VerticalAlignment="Top" HorizontalAlignment="Right"/>
<!--左下角-->
<Polyline Points="0,0 0,15 10,15" Stroke="#5518AABD" VerticalAlignment="Bottom"
HorizontalAlignment="Left"/>
<!--右下角-->
<Polyline Points="10,0 0,10" Stroke="#5518AABD" VerticalAlignment="Bottom"
HorizontalAlignment="Right"/>
<!--右下角图表-->
<Polyline Points="0,7 7 7 7 0" Fill="#9918AABD" VerticalAlignment="Bottom"
HorizontalAlignment="Right"/>
<Border BorderBrush="#5518AABD" BorderThickness="0,1,0,0" VerticalAlignment="Top"
Margin="30,-0.5,78,0"/>
<Border BorderBrush="#5518AABD" BorderThickness="0,0,1,0" HorizontalAlignment="Right"
Margin="0,10"/>
<Border BorderBrush="#5518AABD" BorderThickness="0,1,0,0" VerticalAlignment="Bottom"
Margin="10,0"/>
<Border BorderBrush="#5518AABD" BorderThickness="0,0,1,0" HorizontalAlignment="Left"
Margin="-0.5,15"/>
<!--箭头-->
<Path Data="M0 0,3 0,5 4,3 8,0 8,3 4" Fill="#9918AABD" VerticalAlignment="Top"
HorizontalAlignment="Left" Margin="10,13"/>
<Path Data="M0 0,3 0,5 4,3 8,0 8,3 4" Fill="#5518AABD" VerticalAlignment="Top"
HorizontalAlignment="Left" Margin="16,13"/>
<!--字体-->
<TextBlock Text="{TemplateBinding Header}" Foreground="#18AABD"
VerticalAlignment="Top" HorizontalAlignment="Left" Margin="25,12"/>
<!-- 占位对象 -->
<ContentPresenter />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="DataGridColumnHeader">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridColumnHeader}">
<Grid>
<Border x:Name="columnHeaderBorder" BorderThickness="0,0,0,1"
BorderBrush="#EEE"
Background="{TemplateBinding Background}">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
TextBlock.TextAlignment="Center"
TextBlock.FontSize="18"
TextBlock.Foreground="White"/>
</Border>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<CommonValueToBrushConvert:ValueToBrushConvert x:Key="ValueToBrushConvert"/>
<CommonValueToBrushConvert:ValueToBrushConvertAttitude x:Key="ValueToBrushConvertAttitude"/>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="0.15*"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<GroupBox Header="接驳盒环境数据查询条件">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="0.2*"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2.5*"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left"
Orientation="Horizontal" Margin="40,0,0,0">
<CheckBox Content="时间筛选:" Foreground="White" FontSize="18"
IsChecked="{Binding IsChecked}" VerticalAlignment="Center"/>
<hc:DateTimePicker hc:InfoElement.ShowClearButton="True"
hc:InfoElement.TitleWidth="80" hc:InfoElement.TitlePlacement="Left"
Style="{StaticResource DateTimePickerPlus}" hc:InfoElement.Title="起始时间:"
Foreground="White" CaretBrush="White"
FontSize="14" Width="260" Margin="10,0,0,0" Background="Transparent"
BorderBrush="White" SelectedDateTime="{Binding StartDateTime}"/>
<TextBlock Text="-" Foreground="White" HorizontalAlignment="Center"
VerticalAlignment="Center" Margin="10,0,0,0"/>
<hc:DateTimePicker hc:InfoElement.ShowClearButton="True"
hc:InfoElement.TitleWidth="80" hc:InfoElement.TitlePlacement="Left"
Style="{StaticResource DateTimePickerPlus}" hc:InfoElement.Title="结束时间:"
Foreground="White" CaretBrush="White"
FontSize="14" Width="260" Margin="10,0,0,0" Background="Transparent"
BorderBrush="White" SelectedDateTime="{Binding EndDateTime}"/>
</StackPanel>
<StackPanel Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Right"
Orientation="Horizontal" Margin="0,0,40,0">
</StackPanel>
</Grid>
</Grid>
</GroupBox>
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="0.3*"/>
</Grid.ColumnDefinitions>
<Grid Grid.Column="0">
<GroupBox Header="接驳盒环境数据展示">
<hc:TransitioningContentControl>
<Grid Margin="10,35,10,10">
<Grid.RowDefinitions>
<RowDefinition Height="12*"/>
<RowDefinition/>
</Grid.RowDefinitions>
<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.Resources>
<Style TargetType="DataGridCell" x:Key="DataGridCellCenter">
<Setter Property="Background" Value="#FF14273A"/>
<Setter Property="BorderBrush" Value="#A0A0A0"/>
<Setter Property="FontSize" Value="16"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridCell">
<Border x:Name="border" BorderBrush="#A0A0A0" BorderThickness="0,0,0,1"
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}"/>
<!--接驳盒内部温度设置范围为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>
<!--接驳盒内部湿度设置范围为0-60-->
<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=60}"/>
</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>
<!--接驳盒横滚角设置范围为:-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>
<!--接驳盒俯仰角设置范围为:-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>
<!--接驳盒偏航角设置范围为:-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>
<StackPanel Orientation="Horizontal" Grid.Row="1" VerticalAlignment="Center"
HorizontalAlignment="Right" Margin="0,0,10,0">
<TextBlock VerticalAlignment="Center" FontSize="17" Foreground="White"
Margin="0,0,20,0" Text="{Binding SystemStateMsg}"/>
<Button Content="上一页" FontSize="16" Command="{Binding ForwordSystemStateCommand}"
Background="Transparent" BorderBrush="White" Style="{StaticResource ButtonStyle}"
Foreground="White" Width="85" Height="35">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="8"/>
</Style>
</Button.Resources>
</Button>
<Button Content="下一页" FontSize="16" Margin="20,0,20,0" Background="Transparent"
Command="{Binding NextSystemStateCommand}" BorderBrush="White"
Style="{StaticResource ButtonStyle}"
Foreground="White" Width="85" Height="35">
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="8"/>
</Style>
</Button.Resources>
</Button>
</StackPanel>
</Grid>
</hc:TransitioningContentControl>
</GroupBox>
</Grid>
<Grid Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="1.8*"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<GroupBox Header="接驳盒状态数据文件列表">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="0.06*"/>
<RowDefinition/>
<RowDefinition Height="0.22*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="1">
<DataGrid x:Name="BoosterStationStateDataGrid" ItemsSource="{Binding ftpList.FTPList}"
CanUserSortColumns="True" Margin="15,0,15,0" AutoGenerateColumns="False"
Background="Transparent" BorderThickness="0" Grid.RowSpan="2" IsReadOnly="True">
<DataGrid.Resources>
<Style TargetType="DataGridColumnHeader">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridColumnHeader}">
<Grid>
<Border x:Name="columnHeaderBorder" BorderThickness="0,0,0,0.4"
BorderBrush="#EEE"
Background="{TemplateBinding Background}">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
TextBlock.TextAlignment="Center"
TextBlock.FontSize="16"
TextBlock.Foreground="White"/>
</Border>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="DataGridCell" x:Key="DataGridCellCenter">
<Setter Property="Background" Value="#FF14273A"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="BorderBrush" Value="#A0A0A0"/>
<Setter Property="FontSize" Value="15"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridCell">
<Border x:Name="border" BorderBrush="#A0A0A0" BorderThickness="0,0,0,0.6"
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.4*" Header="编号"
CanUserSort="False" CellStyle="{StaticResource DataGridCellCenter}"/>
<DataGridTextColumn Binding="{Binding FileName}" Width="*" Header="文件名称"
CanUserSort="False" CellStyle="{StaticResource DataGridCellCenter}"/>
<DataGridTextColumn Binding="{Binding CreateTime, StringFormat='yyyy/MM/dd'}" Width="*" Header="修改日期"
CanUserSort="False" CellStyle="{StaticResource DataGridCellCenter}"/>
</DataGrid.Columns>
</DataGrid>
</Grid>
<StackPanel Grid.Row="2" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
<Button Name="RefreshFileBtn" Foreground="White" Background="Transparent" BorderBrush="White"
VerticalAlignment="Center" HorizontalAlignment="Center" BorderThickness="1" Width="100"
Height="35" Style="{StaticResource ButtonStyle}" Command="{Binding RefreshFileCommand}">
<Button.Content>
<StackPanel Orientation="Horizontal">
<Image Source="/Assets/Images/Refresh.png" Width="18"/>
<TextBlock Text="刷新" Foreground="White" FontSize="14" Margin="10,0"
VerticalAlignment="Center" HorizontalAlignment="Center"/>
</StackPanel>
</Button.Content>
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="8"/>
</Style>
</Button.Resources>
</Button>
<Button Name="FTPSettingBtn" Foreground="White" Background="Transparent" BorderBrush="White"
VerticalAlignment="Center" HorizontalAlignment="Center" BorderThickness="1" Width="100"
Height="35" Margin="40,0,0,0" Style="{StaticResource ButtonStyle}"
Command="{Binding FTPSettingCommand}">
<Button.Content>
<StackPanel Orientation="Horizontal">
<Image Source="/Assets/Images/Set.png" Width="18"/>
<TextBlock Text="设置" Foreground="White" FontSize="14" Margin="10,0"
VerticalAlignment="Center" HorizontalAlignment="Center"/>
</StackPanel>
</Button.Content>
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="8"/>
</Style>
</Button.Resources>
</Button>
</StackPanel>
</Grid>
</GroupBox>
</Grid>
<Grid Grid.Row="1">
<GroupBox Header="接驳盒状态数据请求">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="0.1*"/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="1" Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">
<Button Name="RefreshDataBtn" Foreground="White" Background="Transparent" BorderBrush="White"
VerticalAlignment="Center" HorizontalAlignment="Center" BorderThickness="1" Width="150"
Height="45" Margin="0,0,0,35" Style="{StaticResource ButtonStyle}"
Command="{Binding RefreshDataCommand}">
<Button.Content>
<StackPanel Orientation="Horizontal">
<Image Source="/Assets/Images/Refresh.png" Width="18"/>
<TextBlock Text="刷新数据" Foreground="White" FontSize="16" Margin="15,0"
VerticalAlignment="Center" HorizontalAlignment="Center"/>
</StackPanel>
</Button.Content>
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="8"/>
</Style>
</Button.Resources>
</Button>
<Button Name="DownloadDataBtn" Foreground="White" Background="Transparent" BorderBrush="White"
VerticalAlignment="Center" HorizontalAlignment="Center" BorderThickness="1" Width="150"
Height="45" Style="{StaticResource ButtonStyle}"
Command="{Binding DownloadDataCommand}"
IsEnabled="{Binding DownloadDataBtnIsEnabled}">
<Button.Content>
<StackPanel Orientation="Horizontal">
<Image Source="/Assets/Images/Download.png" Width="18"/>
<TextBlock Text="下载数据" Foreground="White" FontSize="16" Margin="15,0"
VerticalAlignment="Center" HorizontalAlignment="Center"/>
</StackPanel>
</Button.Content>
<Button.Resources>
<Style TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="8"/>
</Style>
</Button.Resources>
</Button>
</StackPanel>
<TextBlock Name="DownloadDataMsg" Grid.Row="1" Text="{Binding DownloadDataMsg}"
FontSize="12" Foreground="{Binding DownloadDataMsgForeground}"
HorizontalAlignment="Right" VerticalAlignment="Bottom"
Margin="0,0,80,20" Visibility="{Binding DownloadDataMsgVisibility}"/>
</Grid>
</GroupBox>
</Grid>
</Grid>
</Grid>
</Grid>
</UserControl>