333 lines
22 KiB
XML
333 lines
22 KiB
XML
<UserControl x:Class="JiangsuEarthquake.Views.BoosterStationStateDataView"
|
||
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:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
|
||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||
xmlns:CommonValueToBrushConvert="clr-namespace:JiangsuEarthquake.Common.ValueToBrushConvert"
|
||
mc:Ignorable="d"
|
||
FontFamily="{StaticResource DigitalDisplay}"
|
||
Name="BoosterStationStateDataPage"
|
||
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:ValueToBrushConvertBoosterStationVoltage x:Key="ValueToBrushConvertBoosterStationVoltage"/>
|
||
<CommonValueToBrushConvert:ValueToBrushConvertBoosterStationCurrent x:Key="ValueToBrushConvertBoosterStationCurrent"/>
|
||
</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}" BorderBrush="#FF63829B"
|
||
Foreground="#FF99B9D0" CaretBrush="#FF63829B" Height="40"
|
||
FontSize="14" Width="220" Margin="20,0,0,0" Background="Transparent"
|
||
HorizontalContentAlignment="Center"
|
||
SelectedDateTime="{Binding StartDateTime, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
|
||
<TextBlock Text="——" Foreground="#FF879AA9" HorizontalAlignment="Center"
|
||
VerticalAlignment="Center" Margin="20,0,0,0"/>
|
||
<hc:DateTimePicker hc:InfoElement.ShowClearButton="True" HorizontalContentAlignment="Center"
|
||
hc:InfoElement.TitleWidth="0" hc:InfoElement.TitlePlacement="Left"
|
||
Style="{StaticResource DateTimePickerPlus}" BorderBrush="#FF63829B"
|
||
Foreground="#FF99B9D0" CaretBrush="#FF63829B" Height="40"
|
||
FontSize="14" Width="220" Margin="20,0,0,0" Background="Transparent"
|
||
SelectedDateTime="{Binding EndDateTime, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
|
||
<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>
|
||
|
||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center"
|
||
HorizontalAlignment="Center" Margin="700,0,0,0">
|
||
<CheckBox Content="周期请求" Foreground="#FF63829B" FontSize="15" FontFamily="{StaticResource SourceHanSansCNRegular}"
|
||
IsChecked="{Binding CycleRequestIsChecked}" VerticalAlignment="Center" Margin="0,0,0,0"/>
|
||
<TextBlock Text="周期:" Foreground="#FF63829B" FontSize="14" Margin="10,0,0,0"
|
||
FontFamily="{StaticResource SourceHanSansCNRegular}"
|
||
HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||
<TextBox Name="CycleRequestCycleTextBox" BorderBrush="#FF63829B"
|
||
Text="{Binding CycleRequestCycle, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||
Foreground="#FF99B9D0" FontSize="14" Width="85" Height="40"
|
||
FontFamily="{StaticResource SourceHanSansCNRegular}"
|
||
TextAlignment="Left" VerticalContentAlignment="Center" Margin="15,0,0,0"
|
||
CaretBrush="#FF63829B" Background="#A6022038" HorizontalContentAlignment="Center"/>
|
||
<TextBlock Text="s" FontSize="14" Foreground="#FF63829B" VerticalAlignment="Center"
|
||
Margin="15,0,0,0"/>
|
||
<Button Name="AskDataBtn" Foreground="White" Background="#FF006FBE" BorderBrush="Transparent"
|
||
VerticalAlignment="Center" HorizontalAlignment="Center" BorderThickness="1" Width="110"
|
||
Height="40" Margin="15,0,0,0"
|
||
Command="{Binding AskDataCommand}" IsEnabled="{Binding AskDataBtnIsEnabled}">
|
||
<Button.Content>
|
||
<StackPanel Orientation="Horizontal">
|
||
<Image Source="/Assets/Images/ShoreBaseStationStatus/Request.png" Stretch="Fill" Width="15" Height="15"/>
|
||
<TextBlock Text="请求数据" Foreground="White" FontSize="14" Margin="10,0,0,0"
|
||
VerticalAlignment="Center" HorizontalAlignment="Center" FontFamily="{StaticResource SourceHanSansCNLight}"/>
|
||
</StackPanel>
|
||
</Button.Content>
|
||
<Button.Resources>
|
||
<Style TargetType="{x:Type Border}">
|
||
<Setter Property="CornerRadius" Value="4"/>
|
||
</Style>
|
||
</Button.Resources>
|
||
</Button>
|
||
<TextBlock Name="AskDataMsg" Text="{Binding AskDataMsg}" FontSize="12"
|
||
Foreground="{Binding AskDataMsgForeground}"
|
||
VerticalAlignment="Center" Margin="5,0,0,0"
|
||
Visibility="{Binding AskDataMsgVisibility}"
|
||
FontFamily="{StaticResource SourceHanSansCNLight}"/>
|
||
</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="BoosterStationStateDataGrid" ItemsSource="{Binding BoosterStationStateDataList}"
|
||
AutoGenerateColumns="False" Margin="10,0,10,0" CanUserSortColumns="False"
|
||
CanUserAddRows="False" CanUserDeleteRows="False" Background="Transparent"
|
||
CanUserReorderColumns="False" CanUserResizeColumns="False" IsHitTestVisible="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 In_Vol,StringFormat=F2}" Width="*" Header="输入电压 V"
|
||
CanUserSort="False" CellStyle="{StaticResource DataGridCellCenter}"/>-->
|
||
<!--升压站输入电压设置范围为:46-50-->
|
||
<DataGridTemplateColumn Width="*" Header="输入电压 V" CellStyle="{StaticResource DataGridCellCenter}">
|
||
<DataGridTemplateColumn.CellTemplate>
|
||
<DataTemplate>
|
||
<TextBlock HorizontalAlignment="Center" Text="{Binding In_Vol,StringFormat=F2}"
|
||
Foreground="{Binding Path=In_Vol, Converter={StaticResource ValueToBrushConvertBoosterStationVoltage},ConverterParameter=50}"/>
|
||
</DataTemplate>
|
||
</DataGridTemplateColumn.CellTemplate>
|
||
</DataGridTemplateColumn>
|
||
<!--<DataGridTextColumn Binding="{Binding In_Cur,StringFormat=F2}" Width="*" Header="输入电流 A"
|
||
CanUserSort="False" CellStyle="{StaticResource DataGridCellCenter}"/>-->
|
||
<!--升压站输入电流设置范围为:0-5-->
|
||
<DataGridTemplateColumn Width="*" Header="输入电流 A" CellStyle="{StaticResource DataGridCellCenter}">
|
||
<DataGridTemplateColumn.CellTemplate>
|
||
<DataTemplate>
|
||
<TextBlock HorizontalAlignment="Center" Text="{Binding In_Cur,StringFormat=F2}"
|
||
Foreground="{Binding Path=In_Cur, Converter={StaticResource ValueToBrushConvertBoosterStationCurrent},ConverterParameter=5}"/>
|
||
</DataTemplate>
|
||
</DataGridTemplateColumn.CellTemplate>
|
||
</DataGridTemplateColumn>
|
||
<DataGridTextColumn Binding="{Binding Power,StringFormat=F2}" Width="*" Header="功率 W"
|
||
CanUserSort="False" CellStyle="{StaticResource DataGridCellCenter}"/>
|
||
<!--<DataGridTextColumn Binding="{Binding RelayStatus}" Width="*" Header="继电器状态"
|
||
CanUserSort="False" CellStyle="{StaticResource DataGridCellCenter}"/>-->
|
||
<DataGridTemplateColumn Header="继电器状态" Width="*" CellStyle="{StaticResource DataGridCellCenter}">
|
||
<DataGridTemplateColumn.CellTemplate>
|
||
<DataTemplate>
|
||
<Image Source="{Binding RelayStatus}" Width="35" Height="35"/>
|
||
</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 BoosterStationStateTotalPage}"
|
||
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 BoosterStationStateNowPage}"
|
||
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 ForwordBoosterStationStateCommand}"
|
||
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="20,0,20,0" Foreground="White"
|
||
Command="{Binding NextBoosterStationStateCommand}" Width="35" Height="35"
|
||
Background="Transparent" BorderBrush="White" Style="{StaticResource ButtonStyle}">
|
||
<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>
|