首次上传
This commit is contained in:
@@ -0,0 +1,274 @@
|
||||
<UserControl x:Class="MECF.Framework.UI.Client.CenterViews.Operations.FA.FAView"
|
||||
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:controls="clr-namespace:MECF.Framework.UI.Client.CenterViews.Controls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="900" d:DesignWidth="1920">
|
||||
<Grid IsEnabled="{Binding IsPermission}">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="360"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Top">
|
||||
<StackPanel Orientation="Vertical">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="200" />
|
||||
<ColumnDefinition Width="165" />
|
||||
<ColumnDefinition Width="165" />
|
||||
<ColumnDefinition Width="60" />
|
||||
</Grid.ColumnDefinitions>
|
||||
</Grid>
|
||||
<Label Content="HSMS Configuration" Style="{DynamicResource Table_TitleStyle}" Grid.Row="0" Grid.ColumnSpan="4" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
|
||||
<controls:ScStringRow ScName="Local IP Address"
|
||||
ScId="Fa.LocalIpAddress" ScFeedback="{Binding ConfigFeedback.Fa_LocalIpAddress}"
|
||||
ScSetPoint="{Binding ConfigSetPoint.Fa_LocalIpAddress}"
|
||||
Command="{Binding SetConfigCommand}" NameWidth="200" FeedbackWidth="165"
|
||||
SetPointWidth="165" CommandWidth="60" />
|
||||
<controls:ScDoubleRow ScName="Local Port Number"
|
||||
ScId="Fa.LocalPortNumber" ScFeedback="{Binding ConfigFeedback.Fa_LocalPortNumber}"
|
||||
ScSetPoint="{Binding ConfigSetPoint.Fa_LocalPortNumber}"
|
||||
Command="{Binding SetConfigCommand}" NameWidth="200" FeedbackWidth="165"
|
||||
SetPointWidth="165" CommandWidth="60" />
|
||||
<controls:ScStringRow ScName="Remote IP Address"
|
||||
ScId="Fa.RemoteIpAddress" ScFeedback="{Binding ConfigFeedback.Fa_RemoteIpAddress}"
|
||||
ScSetPoint="{Binding ConfigSetPoint.Fa_RemoteIpAddress}"
|
||||
Command="{Binding SetConfigCommand}" NameWidth="200" FeedbackWidth="165"
|
||||
SetPointWidth="165" CommandWidth="60" />
|
||||
<controls:ScDoubleRow ScName="Remote Port Number"
|
||||
ScId="Fa.RemotePortNumber" ScFeedback="{Binding ConfigFeedback.Fa_RemotePortNumber}"
|
||||
ScSetPoint="{Binding ConfigSetPoint.Fa_RemotePortNumber}"
|
||||
Command="{Binding SetConfigCommand}" NameWidth="200" FeedbackWidth="165"
|
||||
SetPointWidth="165" CommandWidth="60" />
|
||||
|
||||
<controls:ScDoubleRow ScName="T3 Timeout(s)"
|
||||
ScId="Fa.T3Timeout" ScFeedback="{Binding ConfigFeedback.Fa_T3Timeout}"
|
||||
ScSetPoint="{Binding ConfigSetPoint.Fa_T3Timeout}"
|
||||
Command="{Binding SetConfigCommand}" NameWidth="200" FeedbackWidth="165"
|
||||
SetPointWidth="165" CommandWidth="60" />
|
||||
<controls:ScDoubleRow ScName="T5 Timeout(s)"
|
||||
ScId="Fa.T5Timeout" ScFeedback="{Binding ConfigFeedback.Fa_T5Timeout}"
|
||||
ScSetPoint="{Binding ConfigSetPoint.Fa_T5Timeout}"
|
||||
Command="{Binding SetConfigCommand}" NameWidth="200" FeedbackWidth="165"
|
||||
SetPointWidth="165" CommandWidth="60" />
|
||||
<controls:ScDoubleRow ScName="T6 Timeout(s)"
|
||||
ScId="Fa.T6Timeout" ScFeedback="{Binding ConfigFeedback.Fa_T6Timeout}"
|
||||
ScSetPoint="{Binding ConfigSetPoint.Fa_T6Timeout}"
|
||||
Command="{Binding SetConfigCommand}" NameWidth="200" FeedbackWidth="165"
|
||||
SetPointWidth="165" CommandWidth="60" />
|
||||
<controls:ScDoubleRow ScName="T7 Timeout(s)"
|
||||
ScId="Fa.T7Timeout" ScFeedback="{Binding ConfigFeedback.Fa_T7Timeout}"
|
||||
ScSetPoint="{Binding ConfigSetPoint.Fa_T7Timeout}"
|
||||
Command="{Binding SetConfigCommand}" NameWidth="200" FeedbackWidth="165"
|
||||
SetPointWidth="165" CommandWidth="60" />
|
||||
<controls:ScDoubleRow ScName="T8 Timeout(s)"
|
||||
ScId="Fa.T8Timeout" ScFeedback="{Binding ConfigFeedback.Fa_T8Timeout}"
|
||||
ScSetPoint="{Binding ConfigSetPoint.Fa_T8Timeout}"
|
||||
Command="{Binding SetConfigCommand}" NameWidth="200" FeedbackWidth="165"
|
||||
SetPointWidth="165" CommandWidth="60" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Vertical" Margin="10,0,10,0" VerticalAlignment="Top">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="200" />
|
||||
<ColumnDefinition Width="165" />
|
||||
<ColumnDefinition Width="165" />
|
||||
<ColumnDefinition Width="60" />
|
||||
</Grid.ColumnDefinitions>
|
||||
</Grid>
|
||||
<Label Content="FA Configuration" Style="{DynamicResource Table_TitleStyle}" Grid.Row="0" Grid.ColumnSpan="4" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
|
||||
<controls:ScDoubleRow ScName="S1F1 to Host Interval"
|
||||
ScId="Fa.LinkTestInterval" ScFeedback="{Binding ConfigFeedback.Fa_LinkTestInterval}"
|
||||
ScSetPoint="{Binding ConfigSetPoint.Fa_LinkTestInterval}"
|
||||
Command="{Binding SetConfigCommand}" NameWidth="200" FeedbackWidth="165"
|
||||
SetPointWidth="165" CommandWidth="60" />
|
||||
|
||||
<controls:ScDoubleRow ScName="Device ID"
|
||||
ScId="Fa.DeviceId" ScFeedback="{Binding ConfigFeedback.Fa_DeviceId}"
|
||||
ScSetPoint="{Binding ConfigSetPoint.Fa_DeviceId}"
|
||||
Command="{Binding SetConfigCommand}" NameWidth="200" FeedbackWidth="165"
|
||||
SetPointWidth="165" CommandWidth="60" />
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="200" />
|
||||
<ColumnDefinition Width="165" />
|
||||
<ColumnDefinition Width="165" />
|
||||
<ColumnDefinition Width="60" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Border Grid.Row="0" Grid.Column="0" Background="{DynamicResource Table_BG_Title}" Margin="0" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1"></Border>
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" FontSize="13" Text="Default Communication State" Foreground="Black" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10,0,0,0" />
|
||||
<Border Grid.Row="0" Grid.Column="1" Background="{DynamicResource Table_BG_Content}" Margin="0" BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1"></Border>
|
||||
<TextBlock Grid.Row="0" Grid.Column="1" TextAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="13" Text="{Binding Path=ConfigFeedback.Fa_DefaultCommunicationState}" />
|
||||
<Border Grid.Row="0" Grid.Column="2" Background="{DynamicResource Table_BG_Content}" Margin="0" BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1"></Border>
|
||||
<ComboBox Grid.Row="0" Grid.Column="2" IsEditable="False" Text="{Binding Path=ConfigSetPoint.Fa_DefaultCommunicationState }" >
|
||||
<ComboBoxItem>Enable</ComboBoxItem>
|
||||
<ComboBoxItem>Disable</ComboBoxItem>
|
||||
</ComboBox>
|
||||
<Border Grid.Row="0" Grid.Column="3" Background="{DynamicResource Table_BG_Content}" Margin="0" BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1"></Border>
|
||||
<Button Content="Set" Grid.Row="0" Grid.Column="3" Command="{Binding SetConfig2Command}" CommandParameter="Fa.DefaultCommunicationState" FontSize="13" Width="50" Height="22" Margin="2" VerticalAlignment="Center"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="200" />
|
||||
<ColumnDefinition Width="165" />
|
||||
<ColumnDefinition Width="165" />
|
||||
<ColumnDefinition Width="60" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Border Grid.Row="0" Grid.Column="0" Background="{DynamicResource Table_BG_Title}" Margin="0" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1"></Border>
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" FontSize="13" Text="Default Control State" Foreground="Black" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10,0,0,0"/>
|
||||
<Border Grid.Row="0" Grid.Column="1" Background="{DynamicResource Table_BG_Content}" Margin="0" BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1"></Border>
|
||||
<TextBlock Grid.Row="0" Grid.Column="1" TextAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center" Text="{Binding Path=ConfigFeedback.Fa_DefaultControlState}" />
|
||||
<Border Grid.Row="0" Grid.Column="2" Background="{DynamicResource Table_BG_Content}" Margin="0" BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1"></Border>
|
||||
<ComboBox Grid.Row="0" Grid.Column="2" IsEditable="False" Text="{Binding Path=ConfigSetPoint.Fa_DefaultControlState }" >
|
||||
<ComboBoxItem>Online</ComboBoxItem>
|
||||
<ComboBoxItem>Offline</ComboBoxItem>
|
||||
</ComboBox>
|
||||
<Border Grid.Row="0" Grid.Column="3" Background="{DynamicResource Table_BG_Content}" Margin="0" BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1"></Border>
|
||||
<Button Content="Set" Grid.Row="0" Grid.Column="3" Command="{Binding SetConfig2Command}" CommandParameter="Fa.DefaultControlState" FontSize="13" Width="50" Height="22" Margin="2" VerticalAlignment="Center"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="200" />
|
||||
<ColumnDefinition Width="165" />
|
||||
<ColumnDefinition Width="165" />
|
||||
<ColumnDefinition Width="60" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Border Grid.Row="0" Grid.Column="0" Background="{DynamicResource Table_BG_Title}" Margin="0" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1"></Border>
|
||||
<TextBlock Grid.Row="0" Grid.Column="0" FontSize="13" Text="Default Control SubState" Foreground="Black" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10,0,0,0"/>
|
||||
<Border Grid.Row="0" Grid.Column="1" Background="{DynamicResource Table_BG_Content}" Margin="0" BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1"></Border>
|
||||
<TextBlock Grid.Row="0" Grid.Column="1" TextAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center" Text="{Binding Path=ConfigFeedback.Fa_DefaultControlSubState}" />
|
||||
<Border Grid.Row="0" Grid.Column="2" Background="{DynamicResource Table_BG_Content}" Margin="0" BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1"></Border>
|
||||
<ComboBox Grid.Row="0" Grid.Column="2" IsEditable="False" Text="{Binding Path=ConfigSetPoint.Fa_DefaultControlSubState }" >
|
||||
<ComboBoxItem>Local</ComboBoxItem>
|
||||
<ComboBoxItem>Remote</ComboBoxItem>
|
||||
</ComboBox>
|
||||
<Border Grid.Row="0" Grid.Column="3" Background="{DynamicResource Table_BG_Content}" Margin="0" BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1"></Border>
|
||||
<Button Content="Set" Grid.Row="0" Grid.Column="3" Command="{Binding SetConfig2Command}" CommandParameter="Fa.DefaultControlSubState" FontSize="13" Width="50" Height="22" Margin="2" VerticalAlignment="Center"/>
|
||||
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="-220,-80,0,0">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="25" />
|
||||
<RowDefinition Height="30" />
|
||||
<RowDefinition Height="30" />
|
||||
<RowDefinition Height="30" />
|
||||
<RowDefinition Height="30" />
|
||||
<RowDefinition Height="30" />
|
||||
<RowDefinition Height="35" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition Width="220" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Content="Spooling Status" Style="{DynamicResource Table_TitleStyle}" Grid.Row="0" Grid.ColumnSpan="2" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
|
||||
<Border Grid.Row="1" Grid.Column="0" Background="{DynamicResource Table_BG_Title}" Margin="0" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1"></Border>
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Text="State" FontSize="13" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10,0,0,0" />
|
||||
|
||||
<Border Grid.Row="1" Grid.Column="1" Background="{DynamicResource Table_BG_Content}" Margin="0" BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1"></Border>
|
||||
<TextBlock Grid.Row="1" Grid.Column="1" TextAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="13" Text="{Binding SpoolingState}" />
|
||||
|
||||
<Border Grid.Row="2" Grid.Column="0" Background="{DynamicResource Table_BG_Title}" Margin="0" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1"></Border>
|
||||
<TextBlock Grid.Row="2" Grid.Column="0" Text="Actual" FontSize="13" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10,0,0,0" />
|
||||
|
||||
<Border Grid.Row="2" Grid.Column="1" Background="{DynamicResource Table_BG_Content}" Margin="0" BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1"></Border>
|
||||
<TextBlock Grid.Row="2" Grid.Column="1" TextAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="13" Text="{Binding SpoolingActual}" />
|
||||
|
||||
<Border Grid.Row="3" Grid.Column="0" Background="{DynamicResource Table_BG_Title}" Margin="0" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1"></Border>
|
||||
<TextBlock Grid.Row="3" Grid.Column="0" Text="Total" FontSize="13" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10,0,0,0" />
|
||||
|
||||
<Border Grid.Row="3" Grid.Column="1" Background="{DynamicResource Table_BG_Content}" Margin="0" BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1"></Border>
|
||||
<TextBlock Grid.Row="3" Grid.Column="1" TextAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="13" Text="{Binding SpoolingTotal}" />
|
||||
|
||||
<Border Grid.Row="4" Grid.Column="0" Background="{DynamicResource Table_BG_Title}" Margin="0" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1"></Border>
|
||||
<TextBlock Grid.Row="4" Grid.Column="0" Text="Full Time" FontSize="13" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10,0,0,0"/>
|
||||
|
||||
<Border Grid.Row="4" Grid.Column="1" Background="{DynamicResource Table_BG_Content}" Margin="0" BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1"></Border>
|
||||
<TextBlock Grid.Row="4" Grid.Column="1" TextAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="13" Text="{Binding SpoolingFullTime}" />
|
||||
|
||||
<Border Grid.Row="5" Grid.Column="0" Background="{DynamicResource Table_BG_Title}" Margin="0" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1"></Border>
|
||||
<TextBlock Grid.Row="5" Grid.Column="0" Text="Start Time" FontSize="13" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10,0,0,0"/>
|
||||
|
||||
<Border Grid.Row="5" Grid.Column="1" Background="{DynamicResource Table_BG_Content}" Margin="0" BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1"></Border>
|
||||
<TextBlock Grid.Row="5" Grid.Column="1" TextAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="13" Text="{Binding SpoolingStartTime}" />
|
||||
|
||||
<Border Grid.Row="6" Grid.ColumnSpan="2" Background="{DynamicResource Table_BG_Content}" Margin="0" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1"></Border>
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="6" Grid.ColumnSpan="2" HorizontalAlignment="Center" Margin="2">
|
||||
<Button Content="Enable" Command="{Binding InvokeCommand}" IsEnabled="{Binding IsEnableSpoolingEnableButton}" CommandParameter="FACommand,FAEnableSpooling" Width="100" Margin="0,0,10,0"/>
|
||||
<Button Content="Disable" Command="{Binding InvokeCommand}" IsEnabled="{Binding IsEnableSpoolingDisableButton}" CommandParameter="FACommand,FADisableSpooling" Width="100" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<Grid Margin="10,0,10,0" VerticalAlignment="Top">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="25" />
|
||||
<RowDefinition Height="30" />
|
||||
<RowDefinition Height="30" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition Width="220" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Content="Host Communication State" Style="{DynamicResource Table_TitleStyle}" Grid.Row="0" Grid.ColumnSpan="2" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
|
||||
|
||||
<Border Grid.Row="1" Grid.Column="0" Background="{DynamicResource Table_BG_Title}" Margin="0" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1"></Border>
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Text="Status" FontSize="13" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10,0,0,0" />
|
||||
|
||||
<Border Grid.Row="1" Grid.Column="1" Background="{DynamicResource Table_BG_Content}" Margin="0" BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1"></Border>
|
||||
<TextBlock Grid.Row="1" Grid.Column="1" TextAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="13" Text="{Binding HostCommunicationStatus}" />
|
||||
|
||||
<Border Grid.Row="2" Grid.ColumnSpan="2" Background="{DynamicResource Table_BG_Content}" Margin="0" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1"></Border>
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Margin="2">
|
||||
<Button Content="Enable" Command="{Binding InvokeCommand}" IsEnabled="{Binding IsEnableEnableButton}" CommandParameter="FACommand,FAEnable" Width="100" Margin="0,0,10,0"/>
|
||||
<Button Content="Disable" Command="{Binding InvokeCommand}" IsEnabled="{Binding IsEnableDisableButton}" CommandParameter="FACommand,FADisable" Width="100" />
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
|
||||
<Grid VerticalAlignment="Top">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="25" />
|
||||
<RowDefinition Height="30" />
|
||||
<RowDefinition Height="30" />
|
||||
<RowDefinition Height="30" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition Width="220" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Content="Host Control State" Style="{DynamicResource Table_TitleStyle}" Grid.Row="0" Grid.ColumnSpan="2" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
|
||||
|
||||
<Border Grid.Row="1" Grid.Column="0" Background="{DynamicResource Table_BG_Title}" Margin="0" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1"></Border>
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Text="Status" FontSize="13" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10,0,0,0" />
|
||||
|
||||
<Border Grid.Row="1" Grid.Column="1" Background="{DynamicResource Table_BG_Content}" Margin="0" BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1"></Border>
|
||||
<TextBlock Grid.Row="1" Grid.Column="1" TextAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="13" Text="{Binding HostControlStatus}" />
|
||||
|
||||
<Border Grid.Row="2" Grid.ColumnSpan="2" Background="{DynamicResource Table_BG_Content}" Margin="0" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1"></Border>
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="2" Grid.ColumnSpan="2" HorizontalAlignment="Center" Margin="2">
|
||||
<Button Content="Online" Command="{Binding InvokeCommand}" CommandParameter="FACommand,FAOnline" IsEnabled="{Binding IsEnableOnlineButton}" Width="100" Margin="0,0,10,0"/>
|
||||
<Button Content="Offline" Command="{Binding InvokeCommand}" CommandParameter="FACommand,FAOffline" IsEnabled="{Binding IsEnableOfflineButton}" Width="100"/>
|
||||
</StackPanel>
|
||||
|
||||
<Border Grid.Row="3" Grid.ColumnSpan="2" Background="{DynamicResource Table_BG_Content}" Margin="0" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1"></Border>
|
||||
<StackPanel Orientation="Horizontal" Grid.Row="3" Grid.ColumnSpan="2" HorizontalAlignment="Center" Margin="2">
|
||||
<Button Content="Local" Command="{Binding InvokeCommand}" CommandParameter="FACommand,FALocal" IsEnabled="{Binding IsEnableLocalButton}" Width="100" Margin="0,0,10,0"/>
|
||||
<Button Content="Remote" Command="{Binding InvokeCommand}" CommandParameter="FACommand,FARemote" IsEnabled="{Binding IsEnableRemoteButton}" Width="100"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,15 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace MECF.Framework.UI.Client.CenterViews.Operations.FA
|
||||
{
|
||||
/// <summary>
|
||||
/// FAView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class FAView : UserControl
|
||||
{
|
||||
public FAView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,484 @@
|
||||
using Aitex.Core.UI.MVVM;
|
||||
using Aitex.Core.Util;
|
||||
using Aitex.Core.Utilities;
|
||||
using MECF.Framework.Common.DataCenter;
|
||||
using MECF.Framework.Common.Equipment;
|
||||
using MECF.Framework.Common.OperationCenter;
|
||||
using OpenSEMI.ClientBase;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using Aitex.Core.RT.Log;
|
||||
using MECF.Framework.UI.Client.ClientBase;
|
||||
using MessageBox = Xceed.Wpf.Toolkit.MessageBox;
|
||||
using PageSCValue = MECF.Framework.UI.Core.View.Common.PageSCValue;
|
||||
|
||||
namespace MECF.Framework.UI.Client.CenterViews.Operations.FA
|
||||
{
|
||||
|
||||
public enum FACommunicationState
|
||||
{
|
||||
Disabled,
|
||||
Enabled,
|
||||
EnabledNotCommunicating,
|
||||
EnabledCommunicating,
|
||||
WaitCRA,
|
||||
WaitDelay,
|
||||
WaitCRFromHost,
|
||||
}
|
||||
|
||||
public enum FAControlState
|
||||
{
|
||||
Unknown,
|
||||
EquipmentOffline,
|
||||
AttemptOnline,
|
||||
HostOffline,
|
||||
OnlineLocal,
|
||||
OnlineRemote,
|
||||
}
|
||||
|
||||
public enum FAControlSubState
|
||||
{
|
||||
Local,
|
||||
Remote,
|
||||
}
|
||||
|
||||
public enum FASpoolingState
|
||||
{
|
||||
Active = 1,
|
||||
|
||||
Inactive
|
||||
}
|
||||
|
||||
public class FACommandName
|
||||
{
|
||||
public const string FAEnable = "FAEnable";
|
||||
public const string FADisable = "FADisable";
|
||||
|
||||
public const string FAOnline = "FAOnline";
|
||||
public const string FAOffline = "FAOffline";
|
||||
|
||||
public const string FALocal = "FALocal";
|
||||
public const string FARemote = "FARemote";
|
||||
|
||||
public const string FAEnableSpooling = "FAEnableSpooling";
|
||||
public const string FADisableSpooling = "FADisableSpooling";
|
||||
|
||||
public const string FASendTerminalMessage = "FASendTerminalMessage";
|
||||
|
||||
}
|
||||
public class FAViewModel : UiViewModelBase
|
||||
{
|
||||
private class DataName
|
||||
{
|
||||
public const string CommunicationStatus = "CommunicationStatus";
|
||||
public const string ControlStatus = "ControlStatus";
|
||||
public const string ControlSubStatus = "ControlSubStatus";
|
||||
|
||||
public const string SpoolingState = "SpoolingState";
|
||||
public const string SpoolingActual = "SpoolingActual";
|
||||
public const string SpoolingTotal = "SpoolingTotal";
|
||||
public const string SpoolingFullTime = "SpoolingFullTime";
|
||||
public const string SpoolingStartTime = "SpoolingStartTime";
|
||||
public const string IsSpoolingEnable = "IsSpoolingEnable";
|
||||
|
||||
//EFEM
|
||||
|
||||
|
||||
}
|
||||
|
||||
public FAViewModel()
|
||||
{
|
||||
this.DisplayName = "FA";
|
||||
|
||||
ConfigFeedback = new PageSCFA();
|
||||
ConfigSetPoint = new PageSCFA();
|
||||
SetConfigCommand = new DelegateCommand<object>(SetConfig);
|
||||
SetConfig2Command = new DelegateCommand<object>(SetConfig2);
|
||||
InitializeCommand = new DelegateCommand<object>(InitializeFa);
|
||||
InvokeCommand = new DelegateCommand<object>(Invoke);
|
||||
}
|
||||
|
||||
protected override void OnInitialize()
|
||||
{
|
||||
base.OnInitialize();
|
||||
|
||||
_isSubscriptionAttribute = attribute => attribute is SubscriptionAttribute;
|
||||
_hasSubscriptionAttribute = mi => mi.GetCustomAttributes(false).Any(_isSubscriptionAttribute);
|
||||
|
||||
Parallel.ForEach(this.GetType().GetProperties().Where(_hasSubscriptionAttribute),
|
||||
property =>
|
||||
{
|
||||
SubscriptionAttribute subscription = property.GetCustomAttributes(false).First(_isSubscriptionAttribute) as SubscriptionAttribute;
|
||||
string key = subscription.ModuleKey;
|
||||
if (!_subscribedKeys.Contains(key))
|
||||
_subscribedKeys.Add(key);
|
||||
});
|
||||
|
||||
_timer = new PeriodicJob(1000, this.OnTimer, "UIUpdaterThread - " + GetType().Name, true);
|
||||
|
||||
}
|
||||
|
||||
#region subscrib
|
||||
[Subscription(DataName.IsSpoolingEnable, ModuleNameString.System)]
|
||||
public bool IsSpoolingEnable
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
[Subscription("System.SpoolingState")]
|
||||
public string SpoolingState
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
[Subscription(DataName.SpoolingActual, ModuleNameString.System)]
|
||||
public string SpoolingActual
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
[Subscription(DataName.SpoolingTotal, ModuleNameString.System)]
|
||||
public string SpoolingTotal
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
[Subscription(DataName.SpoolingFullTime, ModuleNameString.System)]
|
||||
public string SpoolingFullTime
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
[Subscription(DataName.SpoolingStartTime, ModuleNameString.System)]
|
||||
public string SpoolingStartTime
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
[Subscription(DataName.ControlStatus, ModuleNameString.System)]
|
||||
public string HostControlStatus
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
[Subscription(DataName.CommunicationStatus, ModuleNameString.System)]
|
||||
public string HostCommunicationStatus
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region logic
|
||||
|
||||
public FACommunicationState FACommunicationState
|
||||
{
|
||||
get
|
||||
{
|
||||
return string.IsNullOrEmpty(HostCommunicationStatus) ? FACommunicationState.Disabled
|
||||
: (FACommunicationState)Enum.Parse(typeof(FACommunicationState), HostCommunicationStatus);
|
||||
}
|
||||
}
|
||||
|
||||
public FAControlState FAControlState
|
||||
{
|
||||
get
|
||||
{
|
||||
return string.IsNullOrEmpty(HostControlStatus) ? FAControlState.Unknown
|
||||
: (FAControlState)Enum.Parse(typeof(FAControlState), HostControlStatus);
|
||||
}
|
||||
}
|
||||
|
||||
//Disabled,
|
||||
//Enabled,
|
||||
//EnabledNotCommunicating,
|
||||
//EnabledCommunicating,
|
||||
//WaitCRA,
|
||||
//WaitDelay,
|
||||
//WaitCRFromHost,
|
||||
|
||||
public bool IsEnableEnableButton
|
||||
{
|
||||
get { return FACommunicationState == FACommunicationState.Disabled; }
|
||||
}
|
||||
|
||||
public bool IsEnableDisableButton
|
||||
{
|
||||
get { return FACommunicationState != FACommunicationState.Disabled; }
|
||||
}
|
||||
|
||||
//Unknown,
|
||||
//EquipmentOffline,
|
||||
//AttemptOnline,
|
||||
//HostOffline,
|
||||
//OnlineLocal,
|
||||
//OnlineRemote,
|
||||
public bool IsEnableOnlineButton
|
||||
{
|
||||
get { return FACommunicationState == FACommunicationState.EnabledCommunicating && (FAControlState == FAControlState.Unknown || FAControlState == FAControlState.EquipmentOffline); }
|
||||
}
|
||||
|
||||
public bool IsEnableOfflineButton
|
||||
{
|
||||
get { return FACommunicationState == FACommunicationState.EnabledCommunicating && (FAControlState == FAControlState.Unknown || FAControlState != FAControlState.EquipmentOffline); }
|
||||
}
|
||||
|
||||
public bool IsEnableLocalButton
|
||||
{
|
||||
get { return FACommunicationState == FACommunicationState.EnabledCommunicating && (FAControlState == FAControlState.OnlineRemote); }
|
||||
}
|
||||
|
||||
public bool IsEnableRemoteButton
|
||||
{
|
||||
get { return FACommunicationState == FACommunicationState.EnabledCommunicating && (FAControlState == FAControlState.OnlineLocal); }
|
||||
}
|
||||
|
||||
public bool IsEnableSpoolingEnableButton
|
||||
{
|
||||
get
|
||||
{
|
||||
return !IsSpoolingEnable;//SpoolingState == FASpoolingState.Inactive.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsEnableSpoolingDisableButton
|
||||
{
|
||||
get
|
||||
{
|
||||
return IsSpoolingEnable;// SpoolingState == FASpoolingState.Active.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
[IgnorePropertyChange]
|
||||
public PageSCFA ConfigFeedback
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
[IgnorePropertyChange]
|
||||
public PageSCFA ConfigSetPoint
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
[IgnorePropertyChange]
|
||||
public ICommand SetConfigCommand
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
[IgnorePropertyChange]
|
||||
public ICommand SetConfig2Command
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
[IgnorePropertyChange]
|
||||
public ICommand InitializeCommand
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
[IgnorePropertyChange]
|
||||
public ICommand InvokeCommand
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
PeriodicJob _timer;
|
||||
//protected ConcurrentBag<string> _subscribedKeys = new ConcurrentBag<string>();
|
||||
|
||||
//protected Func<object, bool> _isSubscriptionAttribute;
|
||||
//protected Func<MemberInfo, bool> _hasSubscriptionAttribute;
|
||||
|
||||
private void Invoke(object param)
|
||||
{
|
||||
InvokeClient.Instance.Service.DoOperation("FACommand", ((string)param).Split(',')[1]);
|
||||
}
|
||||
|
||||
private void InitializeFa(object obj)
|
||||
{
|
||||
if (MessageBox.Show("Are you sure you want to re-initialize FA connection?",
|
||||
"Confirm", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
|
||||
{
|
||||
InvokeClient.Instance.Service.DoOperation("Fa.Initialize");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void SetConfig(object param)
|
||||
{
|
||||
object[] sc = (object[])param;
|
||||
|
||||
InvokeClient.Instance.Service.DoOperation("System.SetConfig", sc[0].ToString(), sc[1].ToString());
|
||||
|
||||
|
||||
UpdateConfig();
|
||||
}
|
||||
|
||||
void SetConfig2(object param)
|
||||
{
|
||||
string id = (string)param;
|
||||
string key = id.Replace("Fa.", "Fa_");
|
||||
|
||||
PropertyInfo[] property = typeof(PageSCFA).GetProperties();
|
||||
|
||||
foreach (PropertyInfo prop in property)
|
||||
{
|
||||
if (prop.Name == key)
|
||||
{
|
||||
|
||||
InvokeClient.Instance.Service.DoOperation("System.SetConfig", id, prop.GetValue(ConfigSetPoint, null).ToString());
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
UpdateConfig();
|
||||
}
|
||||
|
||||
public void UpdateConfig()
|
||||
{
|
||||
ConfigFeedback.Update(QueryDataClient.Instance.Service.PollConfig(ConfigFeedback.GetKeys()));
|
||||
NotifyOfPropertyChange("ConfigFeedback");
|
||||
ConfigSetPoint.Update(QueryDataClient.Instance.Service.PollConfig(ConfigSetPoint.GetKeys()));
|
||||
}
|
||||
|
||||
protected override bool OnTimer()
|
||||
{
|
||||
try
|
||||
{
|
||||
Poll();
|
||||
UpdateConfig();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LOG.Error(ex.Message);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
protected override void Poll()
|
||||
{
|
||||
if (_subscribedKeys.Count > 0)
|
||||
{
|
||||
Dictionary<string, object> result = QueryDataClient.Instance.Service.PollData(_subscribedKeys);
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
LOG.Error("获取RT数据失败");
|
||||
return;
|
||||
}
|
||||
|
||||
if (result.Count != _subscribedKeys.Count)
|
||||
{
|
||||
string unknowKeys = string.Empty;
|
||||
foreach (string key in _subscribedKeys)
|
||||
{
|
||||
if (!result.ContainsKey(key))
|
||||
{
|
||||
unknowKeys += key + "\r\n";
|
||||
}
|
||||
}
|
||||
//System.Diagnostics.Debug.Assert(false, unknowKeys);
|
||||
}
|
||||
|
||||
UpdateValue(result);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void UpdateValue(Dictionary<string, object> data)
|
||||
{
|
||||
if (data == null)
|
||||
return;
|
||||
|
||||
UpdateSubscribe(data, this);
|
||||
}
|
||||
|
||||
void UpdateSubscribe(Dictionary<string, object> data, object target, string module = null)
|
||||
{
|
||||
Parallel.ForEach(target.GetType().GetProperties().Where(_hasSubscriptionAttribute),
|
||||
property =>
|
||||
{
|
||||
PropertyInfo pi = (PropertyInfo)property;
|
||||
SubscriptionAttribute subscription = property.GetCustomAttributes(false).First(_isSubscriptionAttribute) as SubscriptionAttribute;
|
||||
string key = subscription.ModuleKey;
|
||||
key = module == null ? key : string.Format("{0}.{1}", module, key);
|
||||
|
||||
if (_subscribedKeys.Contains(key) && data.ContainsKey(key))
|
||||
{
|
||||
try
|
||||
{
|
||||
var convertedValue = Convert.ChangeType(data[key], pi.PropertyType);
|
||||
var originValue = Convert.ChangeType(pi.GetValue(target, null), pi.PropertyType);
|
||||
if (originValue != convertedValue)
|
||||
{
|
||||
pi.SetValue(target, convertedValue, null);
|
||||
NotifyOfPropertyChange(pi.Name);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LOG.Error("由RT返回的数据更新失败" + key, ex);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//protected override void InvokeBeforeUpdateProperty(Dictionary<string, object> data)
|
||||
//{
|
||||
|
||||
//}
|
||||
}
|
||||
|
||||
public class PageSCFA : PageSCValue
|
||||
{
|
||||
public string Fa_ConnectionMode { get; set; }
|
||||
|
||||
public string Fa_LocalIpAddress { get; set; }
|
||||
public int Fa_LocalPortNumber { get; set; }
|
||||
public string Fa_RemoteIpAddress { get; set; }
|
||||
public int Fa_RemotePortNumber { get; set; }
|
||||
|
||||
public int Fa_T3Timeout { get; set; }
|
||||
public int Fa_T5Timeout { get; set; }
|
||||
public int Fa_T6Timeout { get; set; }
|
||||
public int Fa_T7Timeout { get; set; }
|
||||
public int Fa_T8Timeout { get; set; }
|
||||
public bool Fa_EnableSpooling { get; set; }
|
||||
public int Fa_LinkTestInterval { get; set; }
|
||||
public string Fa_DefaultCommunicationState { get; set; }
|
||||
public string Fa_DefaultControlState { get; set; }
|
||||
public string Fa_DefaultControlSubState { get; set; }
|
||||
public string Fa_DeviceId { get; set; }
|
||||
|
||||
public PageSCFA()
|
||||
{
|
||||
UpdateKeys(typeof(PageSCFA).GetProperties());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user