|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242 |
- <UserControl
- x:Class="BPASmartClient.MorkSUpgradedVer.View.Monitor"
- 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:local="clr-namespace:BPASmartClient.MorkSUpgradedVer.View"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:vm="clr-namespace:BPASmartClient.MorkSUpgradedVer.ViewModel"
- Name="监控画面"
- d:DesignHeight="450"
- d:DesignWidth="800"
- mc:Ignorable="d">
-
- <UserControl.DataContext>
- <vm:MonitorViewModel />
- </UserControl.DataContext>
-
- <UserControl.Resources>
- <ResourceDictionary>
- <ResourceDictionary.MergedDictionaries>
- <ResourceDictionary>
- <!--<convert:TextDisplayConvert x:Key="textDisplayConvert" />
- <convert:IsEnableConvert x:Key="isEnableConvert" />
- <convert:AnalogAlarmConvert x:Key="analogAlarmConvert" />
- <convert:DiscreteAlarmConvert x:Key="discreteAlarmConvert" />
- <convert:AlarmTypeTextConvert x:Key="alarmTypeTextConvert" />-->
- <SolidColorBrush x:Key="BorderSolid" Color="#5523CACA" />
- <SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" />
- <SolidColorBrush x:Key="TitleFontColor" Color="#ddd" />
- <SolidColorBrush x:Key="CursorColor" Color="Aqua" />
- <SolidColorBrush x:Key="TitleBorderColor" Color="#FF2AB2E7" />
-
- <Style x:Key="TextBlockStyle" TargetType="TextBlock">
- <Setter Property="FontFamily" Value="楷体" />
- <Setter Property="FontSize" Value="18" />
- <Setter Property="Foreground" Value="{StaticResource TextBlockForeground}" />
- <Setter Property="VerticalAlignment" Value="Center" />
- <Setter Property="HorizontalAlignment" Value="Center" />
- </Style>
-
- <Style x:Key="TextBoxStyle" TargetType="TextBox">
- <Setter Property="FontFamily" Value="楷体" />
- <Setter Property="FontSize" Value="22" />
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="Foreground" Value="{StaticResource TextBlockForeground}" />
- <Setter Property="BorderBrush" Value="#FF23CACA" />
- <Setter Property="CaretBrush" Value="Aqua" />
- <Setter Property="VerticalAlignment" Value="Center" />
- </Style>
-
- </ResourceDictionary>
- </ResourceDictionary.MergedDictionaries>
- </ResourceDictionary>
- </UserControl.Resources>
-
- <Grid Margin="10">
- <Grid.RowDefinitions>
- <RowDefinition Height="30" />
- <RowDefinition />
- </Grid.RowDefinitions>
-
- <!--#region 表格标题栏设置-->
- <Grid Background="#dd2AB2E7">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="0.3*" />
- <ColumnDefinition />
- <ColumnDefinition />
- <ColumnDefinition />
- <ColumnDefinition Width="0.7*" />
- <ColumnDefinition Width="0.7*" />
- </Grid.ColumnDefinitions>
- <TextBlock
- Grid.Column="0"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="{StaticResource TitleFontColor}"
- Text="ID" />
-
- <Grid Grid.Column="1">
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="{StaticResource TitleFontColor}"
- Text="变量名" />
- <Border
- BorderBrush="{StaticResource TitleBorderColor}"
- BorderThickness="1,0,1,0"
- Cursor="SizeWE" />
- </Grid>
-
- <TextBlock
- Grid.Column="2"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="{StaticResource TitleFontColor}"
- Text="PLC 地址" />
-
-
- <Grid Grid.Column="3">
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="{StaticResource TitleFontColor}"
- Text="注释" />
- <Border
- BorderBrush="{StaticResource TitleBorderColor}"
- BorderThickness="1,0,0,0"
- Cursor="SizeWE" />
- </Grid>
-
-
-
- <Grid Grid.Column="4">
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="{StaticResource TitleFontColor}"
- Text="Modbus TCP 地址" />
- <Border
- BorderBrush="{StaticResource TitleBorderColor}"
- BorderThickness="1,0,1,0"
- Cursor="SizeWE" />
- </Grid>
-
- <TextBlock
- Grid.Column="5"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="{StaticResource TitleFontColor}"
- Text="当前值" />
-
- </Grid>
- <!--#endregion-->
-
- <!--#region 表格数据显示-->
- <ScrollViewer
- Grid.Row="1"
- HorizontalScrollBarVisibility="Hidden"
- VerticalScrollBarVisibility="Hidden">
- <ItemsControl ItemsSource="{Binding variableMonitors}">
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <Grid x:Name="gr" Height="30">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="0.3*" />
- <ColumnDefinition />
- <ColumnDefinition />
- <ColumnDefinition />
- <ColumnDefinition Width="0.7*" />
- <ColumnDefinition Width="0.7*" />
- </Grid.ColumnDefinitions>
-
- <TextBlock
- Grid.Column="0"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Background="Transparent"
- FontSize="14"
- Foreground="{StaticResource FontColor}"
- Text="{Binding Id}" />
-
- <Grid Grid.Column="1">
- <TextBlock
- Margin="5,0,0,0"
- VerticalAlignment="Center"
- Background="Transparent"
- FontSize="14"
- Foreground="{StaticResource FontColor}"
- Text="{Binding VarName}" />
- <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
- </Grid>
-
-
- <TextBlock
- Grid.Column="2"
- Margin="5,0,0,0"
- VerticalAlignment="Center"
- Background="Transparent"
- FontSize="14"
- Foreground="{StaticResource FontColor}"
- Text="{Binding PLCAddress}" />
-
- <Grid Grid.Column="3">
- <TextBlock
- Margin="5,0,0,0"
- VerticalAlignment="Center"
- Background="Transparent"
- FontSize="14"
- Foreground="{StaticResource FontColor}"
- Text="{Binding Notes}" />
- <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,0,0" />
- </Grid>
-
- <Grid Grid.Column="4">
- <TextBlock
- Margin="5,0,0,0"
- VerticalAlignment="Center"
- Background="Transparent"
- FontSize="14"
- Foreground="{StaticResource FontColor}"
- Text="{Binding ModbusTcpAddress}" />
- <Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
- </Grid>
-
- <TextBlock
- Grid.Column="5"
- Margin="5,0,0,0"
- VerticalAlignment="Center"
- Background="Transparent"
- FontSize="14"
- Foreground="{StaticResource FontColor}"
- Text="{Binding CurrentValue}" />
-
- <Border
- Grid.ColumnSpan="8"
- BorderBrush="{StaticResource BorderSolid}"
- BorderThickness="1" />
-
- </Grid>
-
- <DataTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter TargetName="gr" Property="Background" Value="#112AB2E7" />
- </Trigger>
- </DataTemplate.Triggers>
-
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- </ScrollViewer>
- <!--#endregion-->
-
-
- </Grid>
-
- </UserControl>
|