20240301_JSEQ_upperpc/JiangsuEarthquakeJM/JiangsuEarthquake/Views/BoosterStationStateDataView.xaml
春风过客 d7f51483a7 新增功能:
1 将地震仪数据读取功能单独成一个页面;
2024-05-13 18:51:05 +08:00

488 lines
32 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"
mc:Ignorable="d"
FontFamily="{StaticResource DigitalDisplay}"
Name="BoosterStationStateDataPage"
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>
</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 Width="0.1*"/>
<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" BorderBrush="White"
FontSize="14" Width="260" Margin="10,0,0,0" Background="Transparent"
SelectedDateTime="{Binding StartDateTime, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
<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" BorderBrush="White"
FontSize="14" Width="260" Margin="10,0,0,0" Background="Transparent"
SelectedDateTime="{Binding EndDateTime, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
</StackPanel>
<Grid Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="0.4*"/>
<RowDefinition/>
</Grid.RowDefinitions>
<!--<TextBlock Grid.Row="0" Text="排序方式:" Foreground="White" FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Bottom"/>
<ListBox Grid.Row="1" x:Name="RadioButtonGroupChoiceChipPrimary" VerticalAlignment="Center"
HorizontalAlignment="Center"
Style="{StaticResource MaterialDesignChoiceChipPrimaryListBox}">
<ListBoxItem Content="时间正序" FontSize="14"/>
<ListBoxItem Content="时间倒序" IsSelected="True" FontSize="14" Margin="20,0,0,0"/>
</ListBox>-->
</Grid>
<!--<Grid Grid.Column="2">
<Grid.RowDefinitions>
<RowDefinition Height="0.4*"/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="显示字段:" VerticalAlignment="Bottom" HorizontalAlignment="Center"
Foreground="White" FontSize="16"/>
<ListBox Grid.Row="1" Style="{StaticResource MaterialDesignFilterChipPrimaryListBox}"
VerticalAlignment="Center" HorizontalAlignment="Center">
<ListBoxItem Content="输入电压" IsSelected="True" FontSize="14"/>
<ListBoxItem Content="输入电流" IsSelected="True" FontSize="14" Margin="20,0,0,0"/>
</ListBox>
</Grid>-->
<!--<StackPanel Grid.Column="2" Orientation="Horizontal">
<TextBlock Text="显示曲线:" VerticalAlignment="Center" HorizontalAlignment="Center"
Foreground="White" FontSize="16"/>
<ListBox Style="{StaticResource MaterialDesignFilterChipPrimaryListBox}"
VerticalAlignment="Center" HorizontalAlignment="Center">
<ListBoxItem Content=" 输入电压 " IsSelected="{Binding IsSelectedVol,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="14" Margin="20,0,0,0"/>
<ListBoxItem Content=" 输入电流 " IsSelected="{Binding IsSelectedCur,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="14" Margin="20,0,0,0"/>
</ListBox>
</StackPanel>-->
</Grid>
</Grid>
</GroupBox>
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.7*"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<GroupBox Grid.Column="0" Header="升压站状态数据展示">
<hc:TransitioningContentControl>
<Grid Margin="10,35,10,10">
<Grid.RowDefinitions>
<RowDefinition Height="12*"/>
<RowDefinition/>
</Grid.RowDefinitions>
<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.Resources>
<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="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 DataTime, 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}"/>
<DataGridTextColumn Binding="{Binding In_Cur,StringFormat=F2}" Width="*" Header="输入电流 A"
CanUserSort="False" CellStyle="{StaticResource DataGridCellCenter}"/>
</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 BoosterStationStateMsg}"/>
<Button Content="上一页" FontSize="16" Command="{Binding ForwordBoosterStationStateCommand}"
Background="Transparent" BorderBrush="White"/>
<Button Content="下一页" FontSize="16" Margin="20,0,20,0"
Command="{Binding NextBoosterStationStateCommand}"
Background="Transparent" BorderBrush="White"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Row="1" Margin="30,0,0,0"
HorizontalAlignment="Left" VerticalAlignment="Center">
<Button Name="DownloadDataBtn" HorizontalAlignment="Left" VerticalAlignment="Center" Height="40"
BorderThickness="0" Command="{Binding DownloadDataCommand}"
Style="{StaticResource ButtonBaseStyle}" Background="Transparent"
IsEnabled="{Binding DownloadDataBtnIsEnabled}">
<Button.Content>
<Image Source="/Assets/Images/Download.png" Height="25"
HorizontalAlignment="Left" VerticalAlignment="Center"/>
</Button.Content>
<Button.ToolTip>
<ToolTip Content="下载数据"/>
</Button.ToolTip>
</Button>
<TextBlock Name="DownloadDataMsg" Text="{Binding DownloadDataMsg}"
Foreground="{Binding DownloadDataMsgForeground}" FontSize="12" HorizontalAlignment="Left"
VerticalAlignment="Bottom" Margin="5,0,0,5"
Visibility="{Binding DownloadDataMsgVisibility}"/>
</StackPanel>
</Grid>
</hc:TransitioningContentControl>
</GroupBox>
<Grid Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="4.5*"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<GroupBox Header="升压站状态数据折线图">
<Grid>
<lvc:CartesianChart Margin="20,35,20,10" LegendLocation="Bottom" Name="CartesianChart"
DisableAnimations="True" ContentStringFormat="F2"
Series="{Binding SeriesCollection}" Zoom="X">
<lvc:CartesianChart.ChartLegend>
<lvc:DefaultLegend Foreground="#A0A0A0"/>
</lvc:CartesianChart.ChartLegend>
<!--提示-->
<lvc:CartesianChart.DataTooltip>
<lvc:DefaultTooltip BulletSize="20" ContentStringFormat="F2"
SelectionMode="SharedXValues" IsEnabled="False"/>
</lvc:CartesianChart.DataTooltip>
<!--X轴-->
<lvc:CartesianChart.AxisX>
<lvc:Axis LabelFormatter="{Binding XFormatter}">
<lvc:Axis.Separator>
<lvc:Separator StrokeThickness="0"/>
</lvc:Axis.Separator>
</lvc:Axis>
</lvc:CartesianChart.AxisX>
<!--Y轴-->
<lvc:CartesianChart.AxisY>
<lvc:Axis Position="LeftBottom" Title="输入电压"
ShowLabels="True" Foreground="#D82BEDF1"
LabelFormatter="{Binding YFormatter1}">
<lvc:Axis.Separator>
<lvc:Separator Step="0.2" Stroke="#11FFFFFF"/>
</lvc:Axis.Separator>
</lvc:Axis>
<lvc:Axis Position="RightTop" Title="输入电流"
ShowLabels="True" Foreground="#D8FFA500"
LabelFormatter="{Binding YFormatter2}">
<lvc:Axis.Separator>
<lvc:Separator Step="0.2" Stroke="#11FFFFFF" IsEnabled="False"/>
</lvc:Axis.Separator>
</lvc:Axis>
</lvc:CartesianChart.AxisY>
<!--X轴-->
<!--
<lvc:CartesianChart.AxisX>
<lvc:Axis Labels="{Binding X_Time}">
<lvc:Axis.Separator>
<lvc:Separator Step="1" StrokeThickness="0"/>
</lvc:Axis.Separator>
</lvc:Axis>
</lvc:CartesianChart.AxisX>
-->
<!--Y轴-->
<!--
<lvc:CartesianChart.AxisY>
<lvc:Axis MinValue="{Binding Y_MinValue1}"
MaxValue="{Binding Y_MaxValue1}"
Title="{Binding Value_Name1}" Position="LeftBottom"
ShowLabels="True" Foreground="#D82BEDF1"
LabelFormatter="{Binding YFormatter}">
<lvc:Axis.Separator>
<lvc:Separator Step="{Binding Step1}" Stroke="#11FFFFFF"/>
</lvc:Axis.Separator>
</lvc:Axis>
<lvc:Axis MinValue="{Binding Y_MinValue2}" MaxValue="{Binding Y_MaxValue2}"
Title="{Binding Value_Name2}" Position="RightTop"
ShowLabels="True" Foreground="#D8FFA500"
LabelFormatter="{Binding YFormatter}">
<lvc:Axis.Separator>
<lvc:Separator Step="0.25" Stroke="#11FFFFFF" IsEnabled="False"/>
</lvc:Axis.Separator>
</lvc:Axis>
</lvc:CartesianChart.AxisY>-->
<!--曲线-->
<!--
<lvc:CartesianChart.Series>
<lvc:LineSeries Values="{Binding Values1, StringFormat=F2}"
Title="{Binding Value_Name1}"
Stroke="#FF2BEDF1"
StrokeThickness="1" ScalesYAt="0">
<lvc:LineSeries.Fill>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Color="#552BEDF1" Offset="0"/>
<GradientStop Color="Transparent" Offset="1"/>
</LinearGradientBrush>
</lvc:LineSeries.Fill>
<lvc:LineSeries.PointGeometry>
<EllipseGeometry RadiusX="2" RadiusY="2" />
</lvc:LineSeries.PointGeometry>
<lvc:LineSeries.PointForeground>
<SolidColorBrush Color="White" />
</lvc:LineSeries.PointForeground>
</lvc:LineSeries>
<lvc:LineSeries Values="{Binding Values2, StringFormat=F2}"
Title="{Binding Value_Name2}"
Stroke="#FFFFA500"
StrokeThickness="1" ScalesYAt="1">
<lvc:LineSeries.Fill>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Color="#55FFA500" Offset="0"/>
<GradientStop Color="Transparent" Offset="1"/>
</LinearGradientBrush>
</lvc:LineSeries.Fill>
<lvc:LineSeries.PointGeometry>
<EllipseGeometry RadiusX="2" RadiusY="2" />
</lvc:LineSeries.PointGeometry>
<lvc:LineSeries.PointForeground>
<SolidColorBrush Color="White" />
</lvc:LineSeries.PointForeground>
</lvc:LineSeries>
</lvc:CartesianChart.Series>-->
</lvc:CartesianChart>
<!--右上角图例 采集时间-->
<StackPanel Orientation="Horizontal" VerticalAlignment="Top"
HorizontalAlignment="Right" Margin="10">
<!--<Border Width="6" Height="6" Background="#552BEDF1" Margin="5,0"/>
<TextBlock Text="{Binding baseStationStatusModel.RecordTime,StringFormat=yyyy/MM/dd HH:mm:ss}"
FontSize="11" Foreground="#44FFFFFF"/>-->
</StackPanel>
</Grid>
</GroupBox>
</Grid>
<Grid Grid.Row="1">
<GroupBox Header="升压站状态数据请求">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="0.3*"/>
<RowDefinition Height="0.6*"/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock Name="AskDataMsg" Grid.Row="1" Text="{Binding AskDataMsg}" FontSize="12"
Foreground="{Binding AskDataMsgForeground}"
VerticalAlignment="Center" Margin="120,5,0,0"
Visibility="{Binding AskDataMsgVisibility}"/>
<StackPanel Grid.Row="2" Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Center">
<Button Name="AskDataBtn" Foreground="White" Background="Transparent" BorderBrush="White"
VerticalAlignment="Center" HorizontalAlignment="Center" BorderThickness="1" Width="150"
Height="45" Style="{StaticResource ButtonStyle}"
Command="{Binding AskDataCommand}" IsEnabled="{Binding AskDataBtnIsEnabled}">
<Button.Content>
<StackPanel Orientation="Horizontal">
<Image Source="/Assets/Images/AskData.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="RefreshDataBtn" Foreground="White" Background="Transparent" BorderBrush="White"
VerticalAlignment="Center" HorizontalAlignment="Center" BorderThickness="1" Width="150"
Height="45" Margin="60,0,0,0" 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="AlarmSettingBtn" Foreground="White" Background="Transparent" BorderBrush="White"
VerticalAlignment="Center" HorizontalAlignment="Center" BorderThickness="1" Width="150"
Height="45" Margin="60,0,0,0" Style="{StaticResource ButtonStyle}"
Command="{Binding AlarmSettingCommand}">
<Button.Content>
<StackPanel Orientation="Horizontal">
<Image Source="/Assets/Images/AlarmWhite.png" Width="20"/>
<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="OtherSettingBtn" Foreground="White" Background="Transparent" BorderBrush="White"
VerticalAlignment="Center" HorizontalAlignment="Center" BorderThickness="1" Width="150"
Height="45" Margin="60,0,0,0" Style="{StaticResource ButtonStyle}"
Command="{Binding OtherSettingCommand}">
<Button.Content>
<StackPanel Orientation="Horizontal">
<Image Source="/Assets/Images/Set.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>
</Grid>
</GroupBox>
</Grid>
</Grid>
</Grid>
</Grid>
</UserControl>