refactor: 将Framework库和RT、UI放在同一个解决方案中。

This commit is contained in:
SL
2026-06-01 17:48:28 +08:00
parent 1948f4290d
commit b73d39a6b1
4331 changed files with 506148 additions and 49363 deletions
@@ -0,0 +1,23 @@
<UserControl x:Class="MECF.Framework.UI.Client.CenterViews.Operations.E84.E84View"
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="300" d:DesignWidth="300">
<TabControl x:Name="root" Background="#91b0cd">
<TabItem Header="LP1" Width="100" Height="35" FontSize="14">
<controls:E84Info LoadPortName="LP1" E84Data="{Binding E84InfoDataLp1}" IsEnabled="{Binding IsPermission}"/>
</TabItem>
<TabItem Header="LP2" Width="100" Height="35" FontSize="14">
<controls:E84Info LoadPortName="LP2" E84Data="{Binding E84InfoDataLp2}" IsEnabled="{Binding IsPermission}"/>
</TabItem>
<TabItem Header="LP3" Width="100" Height="35" FontSize="14">
<controls:E84Info LoadPortName="LP3" E84Data="{Binding E84InfoDataLp3}" IsEnabled="{Binding IsPermission}"/>
</TabItem>
<TabItem Header="LP4" Width="100" Height="35" FontSize="14">
<controls:E84Info LoadPortName="LP4" E84Data="{Binding E84InfoDataLp4}" IsEnabled="{Binding IsPermission}"/>
</TabItem>
</TabControl>
</UserControl>
@@ -0,0 +1,25 @@
using System.Windows;
using System.Windows.Controls;
namespace MECF.Framework.UI.Client.CenterViews.Operations.E84
{
public partial class E84View : UserControl
{
public E84ViewModel _e84ViewModel;
public E84View()
{
InitializeComponent();
_e84ViewModel = new E84ViewModel();
DataContext = _e84ViewModel;
IsVisibleChanged += E84View_IsVisibleChanged;
}
private void E84View_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
{
(DataContext as E84ViewModel)?.EnableTimer(IsVisible);
}
}
}
@@ -0,0 +1,733 @@
using Aitex.Core.Util;
using MECF.Framework.UI.Client.CenterViews.Controls;
using MECF.Framework.UI.Client.ClientBase;
namespace MECF.Framework.UI.Client.CenterViews.Operations.E84
{
public class E84ViewModel : UiViewModelBase
{
public E84ViewModel()
{
E84InfoDataLp1 = new E84InfoData();
E84InfoDataLp2 = new E84InfoData();
E84InfoDataLp3 = new E84InfoData();
E84InfoDataLp4 = new E84InfoData();
}
public E84InfoData E84InfoDataLp1 { get; set; }
public E84InfoData E84InfoDataLp2 { get; set; }
public E84InfoData E84InfoDataLp3 { get; set; }
public E84InfoData E84InfoDataLp4 { get; set; }
[Subscription("LP1.IsPresent")]
public bool PodPresentLp1
{
get => E84InfoDataLp1.PodPresent;
set => E84InfoDataLp1.PodPresent = value;
}
[Subscription("LP2.IsPresent")]
public bool PodPresentLp2
{
get => E84InfoDataLp2.PodPresent;
set => E84InfoDataLp2.PodPresent = value;
}
[Subscription("LP3.IsPresent")]
public bool PodPresentLp3
{
get => E84InfoDataLp3.PodPresent;
set => E84InfoDataLp3.PodPresent = value;
}
[Subscription("LP4.IsPresent")]
public bool PodPresentLp4
{
get => E84InfoDataLp4.PodPresent;
set => E84InfoDataLp4.PodPresent = value;
}
[Subscription("IsPlaced", "LP1")]
public bool PodPlacedLp1
{
get => E84InfoDataLp1.PodPlaced;
set => E84InfoDataLp1.PodPlaced = value;
}
[Subscription("IsPlaced", "LP2")]
public bool PodPlacedLp2
{
get => E84InfoDataLp2.PodPlaced;
set => E84InfoDataLp2.PodPlaced = value;
}
[Subscription("IsPlaced", "LP3")]
public bool PodPlacedLp3
{
get => E84InfoDataLp3.PodPlaced;
set => E84InfoDataLp3.PodPlaced = value;
}
[Subscription("IsPlaced", "LP4")]
public bool PodPlacedLp4
{
get => E84InfoDataLp4.PodPlaced;
set => E84InfoDataLp4.PodPlaced = value;
}
[Subscription("IsClamped", "LP1")]
public bool PodLatchedLp1
{
get => E84InfoDataLp1.PodLatched;
set => E84InfoDataLp1.PodLatched = value;
}
[Subscription("IsClamped", "LP2")]
public bool PodLatchedLp2
{
get => E84InfoDataLp2.PodLatched;
set => E84InfoDataLp2.PodLatched = value;
}
[Subscription("IsClamped", "LP3")]
public bool PodLatchedLp3
{
get => E84InfoDataLp3.PodLatched;
set => E84InfoDataLp3.PodLatched = value;
}
[Subscription("IsClamped", "LP4")]
public bool PodLatchedLp4
{
get => E84InfoDataLp4.PodLatched;
set => E84InfoDataLp4.PodLatched = value;
}
[Subscription("IsDocked", "LP1")]
public bool PodDockedLp1
{
get => E84InfoDataLp1.PodDocked;
set => E84InfoDataLp1.PodDocked = value;
}
[Subscription("IsDocked", "LP2")]
public bool PodDockedLp2
{
get => E84InfoDataLp2.PodDocked;
set => E84InfoDataLp2.PodDocked = value;
}
[Subscription("IsDocked", "LP3")]
public bool PodDockedLp3
{
get => E84InfoDataLp3.PodDocked;
set => E84InfoDataLp3.PodDocked = value;
}
[Subscription("IsDocked", "LP4")]
public bool PodDockedLp4
{
get => E84InfoDataLp4.PodDocked;
set => E84InfoDataLp4.PodDocked = value;
}
[Subscription("LoadportState", "LP1")]
public string LoadPortStateLp1
{
get => E84InfoDataLp1.LoadPortState;
set => E84InfoDataLp1.LoadPortState = value;
}
[Subscription("LoadportState", "LP2")]
public string LoadPortStateLp2
{
get => E84InfoDataLp2.LoadPortState;
set => E84InfoDataLp2.LoadPortState = value;
}
[Subscription("LoadportState", "LP3")]
public string LoadPortStateLp3
{
get => E84InfoDataLp3.LoadPortState;
set => E84InfoDataLp3.LoadPortState = value;
}
[Subscription("LoadportState", "LP4")]
public string LoadPortStateLp4
{
get => E84InfoDataLp4.LoadPortState;
set => E84InfoDataLp4.LoadPortState = value;
}
[Subscription("TransferState", "LP1")]
public string PortStateLp1
{
get => E84InfoDataLp1.PortState;
set => E84InfoDataLp1.PortState = value;
}
[Subscription("TransferState", "LP2")]
public string PortStateLp2
{
get => E84InfoDataLp2.PortState;
set => E84InfoDataLp2.PortState = value;
}
[Subscription("TransferState", "LP3")]
public string PortStateLp3
{
get => E84InfoDataLp3.PortState;
set => E84InfoDataLp3.PortState = value;
}
[Subscription("TransferState", "LP4")]
public string PortStateLp4
{
get => E84InfoDataLp4.PortState;
set => E84InfoDataLp4.PortState = value;
}
[Subscription("AccessMode", "LP1")]
public string AccessModeLp1
{
get => E84InfoDataLp1.AccessMode;
set => E84InfoDataLp1.AccessMode = value;
}
[Subscription("AccessMode", "LP2")]
public string AccessModeLp2
{
get => E84InfoDataLp2.AccessMode;
set => E84InfoDataLp2.AccessMode = value;
}
[Subscription("AccessMode", "LP3")]
public string AccessModeLp3
{
get => E84InfoDataLp3.AccessMode;
set => E84InfoDataLp3.AccessMode = value;
}
[Subscription("AccessMode", "LP4")]
public string AccessModeLp4
{
get => E84InfoDataLp4.AccessMode;
set => E84InfoDataLp4.AccessMode = value;
}
[Subscription("CarrierIDStatus", "LP1")]
public string CarrierIDStatusLP1
{
get => E84InfoDataLp1.CarrierIDStatus;
set => E84InfoDataLp1.CarrierIDStatus = value;
}
[Subscription("CarrierIDStatus", "LP2")]
public string CarrierIDStatusLP2
{
get => E84InfoDataLp2.CarrierIDStatus;
set => E84InfoDataLp2.CarrierIDStatus = value;
}
[Subscription("CarrierIDStatus", "LP3")]
public string CarrierIDStatusLP3
{
get => E84InfoDataLp3.CarrierIDStatus;
set => E84InfoDataLp3.CarrierIDStatus = value;
}
[Subscription("CarrierIDStatus", "LP4")]
public string CarrierIDStatusLP4
{
get => E84InfoDataLp4.CarrierIDStatus;
set => E84InfoDataLp4.CarrierIDStatus = value;
}
[Subscription("SlotMapStatus", "LP1")]
public string SlotMapStatusLP1
{
get => E84InfoDataLp1.SlotMapStatus;
set => E84InfoDataLp1.SlotMapStatus = value;
}
[Subscription("SlotMapStatus", "LP2")]
public string SlotMapStatusLP2
{
get => E84InfoDataLp2.SlotMapStatus;
set => E84InfoDataLp2.SlotMapStatus = value;
}
[Subscription("SlotMapStatus", "LP3")]
public string SlotMapStatusLP3
{
get => E84InfoDataLp3.SlotMapStatus;
set => E84InfoDataLp3.SlotMapStatus = value;
}
[Subscription("SlotMapStatus", "LP4")]
public string SlotMapStatusLP4
{
get => E84InfoDataLp4.SlotMapStatus;
set => E84InfoDataLp4.SlotMapStatus = value;
}
[Subscription("AccessStatus", "LP1")]
public string AccessStatusLP1
{
get => E84InfoDataLp1.AccessStatus;
set => E84InfoDataLp1.AccessStatus = value;
}
[Subscription("AccessStatus", "LP2")]
public string AccessStatusLP2
{
get => E84InfoDataLp2.AccessStatus;
set => E84InfoDataLp2.AccessStatus = value;
}
[Subscription("AccessStatus", "LP3")]
public string AccessStatusLP3
{
get => E84InfoDataLp3.AccessStatus;
set => E84InfoDataLp3.AccessStatus = value;
}
[Subscription("AccessStatus", "LP4")]
public string AccessStatusLP4
{
get => E84InfoDataLp4.AccessStatus;
set => E84InfoDataLp4.AccessStatus = value;
}
[Subscription("CarrierId", "LP1")]
public string CarrierIdLp1
{
get => E84InfoDataLp1.CarrierID;
set => E84InfoDataLp1.CarrierID = value;
}
[Subscription("CarrierId", "LP2")]
public string CarrierIdLp2
{
get => E84InfoDataLp2.CarrierID;
set => E84InfoDataLp2.CarrierID = value;
}
[Subscription("CarrierId", "LP3")]
public string CarrierIdLp3
{
get => E84InfoDataLp3.CarrierID;
set => E84InfoDataLp3.CarrierID = value;
}
[Subscription("CarrierId", "LP4")]
public string CarrierIdLp4
{
get => E84InfoDataLp4.CarrierID;
set => E84InfoDataLp4.CarrierID = value;
}
[Subscription("SlotMap", "LP1")]
public string SlotMapLp1
{
get => E84InfoDataLp1.SlotMap;
set => E84InfoDataLp1.SlotMap = value;
}
[Subscription("SlotMap", "LP2")]
public string SlotMapLp2
{
get => E84InfoDataLp2.SlotMap;
set => E84InfoDataLp2.SlotMap = value;
}
[Subscription("SlotMap", "LP3")]
public string SlotMapLp3
{
get => E84InfoDataLp3.SlotMap;
set => E84InfoDataLp3.SlotMap = value;
}
[Subscription("SlotMap", "LP4")]
public string SlotMapLp4
{
get => E84InfoDataLp4.SlotMap;
set => E84InfoDataLp4.SlotMap = value;
}
[Subscription("Valid", "LP1")]
public bool ValidLp1
{
get => E84InfoDataLp1.Valid;
set => E84InfoDataLp1.Valid = value;
}
[Subscription("Valid", "LP2")]
public bool ValidLp2
{
get => E84InfoDataLp2.Valid;
set => E84InfoDataLp2.Valid = value;
}
[Subscription("Valid", "LP3")]
public bool ValidLp3
{
get => E84InfoDataLp3.Valid;
set => E84InfoDataLp3.Valid = value;
}
[Subscription("Valid", "LP4")]
public bool ValidLp4
{
get => E84InfoDataLp4.Valid;
set => E84InfoDataLp4.Valid = value;
}
[Subscription("TransferRequest", "LP1")]
public bool TransferRequestLp1
{
get => E84InfoDataLp1.TransferRequest;
set => E84InfoDataLp1.TransferRequest = value;
}
[Subscription("TransferRequest", "LP2")]
public bool TransferRequestLp2
{
get => E84InfoDataLp2.TransferRequest;
set => E84InfoDataLp2.TransferRequest = value;
}
[Subscription("TransferRequest", "LP3")]
public bool TransferRequestLp3
{
get => E84InfoDataLp3.TransferRequest;
set => E84InfoDataLp3.TransferRequest = value;
}
[Subscription("TransferRequest", "LP4")]
public bool TransferRequestLp4
{
get => E84InfoDataLp4.TransferRequest;
set => E84InfoDataLp4.TransferRequest = value;
}
[Subscription("Busy", "LP1")]
public bool BusyLp1
{
get => E84InfoDataLp1.Busy;
set => E84InfoDataLp1.Busy = value;
}
[Subscription("Busy", "LP2")]
public bool BusyLp2
{
get => E84InfoDataLp2.Busy;
set => E84InfoDataLp2.Busy = value;
}
[Subscription("Busy", "LP3")]
public bool BusyLp3
{
get => E84InfoDataLp3.Busy;
set => E84InfoDataLp3.Busy = value;
}
[Subscription("Busy", "LP4")]
public bool BusyLp4
{
get => E84InfoDataLp4.Busy;
set => E84InfoDataLp4.Busy = value;
}
[Subscription("TransferComplete", "LP1")]
public bool TransferCompleteLp1
{
get => E84InfoDataLp1.TransferComplete;
set => E84InfoDataLp1.TransferComplete = value;
}
[Subscription("TransferComplete", "LP2")]
public bool TransferCompleteLp2
{
get => E84InfoDataLp2.TransferComplete;
set => E84InfoDataLp2.TransferComplete = value;
}
[Subscription("TransferComplete", "LP3")]
public bool TransferCompleteLp3
{
get => E84InfoDataLp3.TransferComplete;
set => E84InfoDataLp3.TransferComplete = value;
}
[Subscription("TransferComplete", "LP4")]
public bool TransferCompleteLp4
{
get => E84InfoDataLp4.TransferComplete;
set => E84InfoDataLp4.TransferComplete = value;
}
[Subscription("CS0", "LP1")]
public bool CS0Lp1
{
get => E84InfoDataLp1.CS0;
set => E84InfoDataLp1.CS0 = value;
}
[Subscription("CS0", "LP2")]
public bool CS0Lp2
{
get => E84InfoDataLp2.CS0;
set => E84InfoDataLp2.CS0 = value;
}
[Subscription("CS0", "LP3")]
public bool CS0Lp3
{
get => E84InfoDataLp3.CS0;
set => E84InfoDataLp3.CS0 = value;
}
[Subscription("CS0", "LP4")]
public bool CS0Lp4
{
get => E84InfoDataLp4.CS0;
set => E84InfoDataLp4.CS0 = value;
}
[Subscription("CS1", "LP1")]
public bool CS1Lp1
{
get => E84InfoDataLp1.CS1;
set => E84InfoDataLp1.CS1 = value;
}
[Subscription("CS1", "LP2")]
public bool CS1Lp2
{
get => E84InfoDataLp2.CS1;
set => E84InfoDataLp2.CS1 = value;
}
[Subscription("CS1", "LP3")]
public bool CS1Lp3
{
get => E84InfoDataLp3.CS1;
set => E84InfoDataLp3.CS1 = value;
}
[Subscription("CS1", "LP4")]
public bool CS1Lp4
{
get => E84InfoDataLp4.CS1;
set => E84InfoDataLp4.CS1 = value;
}
[Subscription("CONT", "LP1")]
public bool ContinuousTransferLp1
{
get => E84InfoDataLp1.ContinuousTransfer;
set => E84InfoDataLp1.ContinuousTransfer = value;
}
[Subscription("CONT", "LP2")]
public bool ContinuousTransferLp2
{
get => E84InfoDataLp2.ContinuousTransfer;
set => E84InfoDataLp2.ContinuousTransfer = value;
}
[Subscription("CONT", "LP3")]
public bool ContinuousTransferLp3
{
get => E84InfoDataLp3.ContinuousTransfer;
set => E84InfoDataLp3.ContinuousTransfer = value;
}
[Subscription("CONT", "LP4")]
public bool ContinuousTransferLp4
{
get => E84InfoDataLp4.ContinuousTransfer;
set => E84InfoDataLp4.ContinuousTransfer = value;
}
[Subscription("LoadRequest", "LP1")]
public bool LoadRequestLp1
{
get => E84InfoDataLp1.LoadRequest;
set => E84InfoDataLp1.LoadRequest = value;
}
[Subscription("LoadRequest", "LP2")]
public bool LoadRequestLp2
{
get => E84InfoDataLp2.LoadRequest;
set => E84InfoDataLp2.LoadRequest = value;
}
[Subscription("LoadRequest", "LP3")]
public bool LoadRequestLp3
{
get => E84InfoDataLp3.LoadRequest;
set => E84InfoDataLp3.LoadRequest = value;
}
[Subscription("LoadRequest", "LP4")]
public bool LoadRequestLp4
{
get => E84InfoDataLp4.LoadRequest;
set => E84InfoDataLp4.LoadRequest = value;
}
[Subscription("UnloadRequest", "LP1")]
public bool UnloadRequestLp1
{
get => E84InfoDataLp1.UnloadRequest;
set => E84InfoDataLp1.UnloadRequest = value;
}
[Subscription("UnloadRequest", "LP2")]
public bool UnloadRequestLp2
{
get => E84InfoDataLp2.UnloadRequest;
set => E84InfoDataLp2.UnloadRequest = value;
}
[Subscription("UnloadRequest", "LP3")]
public bool UnloadRequestLp3
{
get => E84InfoDataLp3.UnloadRequest;
set => E84InfoDataLp3.UnloadRequest = value;
}
[Subscription("UnloadRequest", "LP4")]
public bool UnloadRequestLp4
{
get => E84InfoDataLp4.UnloadRequest;
set => E84InfoDataLp4.UnloadRequest = value;
}
[Subscription("ReadyToTransfer", "LP1")]
public bool ReadyToTransferLp1
{
get => E84InfoDataLp1.ReadyToTransfer;
set => E84InfoDataLp1.ReadyToTransfer = value;
}
[Subscription("ReadyToTransfer", "LP2")]
public bool ReadyToTransferLp2
{
get => E84InfoDataLp2.ReadyToTransfer;
set => E84InfoDataLp2.ReadyToTransfer = value;
}
[Subscription("ReadyToTransfer", "LP3")]
public bool ReadyToTransferLp3
{
get => E84InfoDataLp3.ReadyToTransfer;
set => E84InfoDataLp3.ReadyToTransfer = value;
}
[Subscription("ReadyToTransfer", "LP4")]
public bool ReadyToTransferLp4
{
get => E84InfoDataLp4.ReadyToTransfer;
set => E84InfoDataLp4.ReadyToTransfer = value;
}
[Subscription("HandoffAvailable", "LP1")]
public bool HandoffAvailableLp1
{
get => E84InfoDataLp1.HandoffAvailable;
set => E84InfoDataLp1.HandoffAvailable = value;
}
[Subscription("HandoffAvailable", "LP2")]
public bool HandoffAvailableLp2
{
get => E84InfoDataLp2.HandoffAvailable;
set => E84InfoDataLp2.HandoffAvailable = value;
}
[Subscription("HandoffAvailable", "LP3")]
public bool HandoffAvailableLp3
{
get => E84InfoDataLp3.HandoffAvailable;
set => E84InfoDataLp3.HandoffAvailable = value;
}
[Subscription("HandoffAvailable", "LP4")]
public bool HandoffAvailableLp4
{
get => E84InfoDataLp4.HandoffAvailable;
set => E84InfoDataLp4.HandoffAvailable = value;
}
[Subscription("ES", "LP1")]
public bool EmergencyOkLp1
{
get => E84InfoDataLp1.EmergencyOk;
set => E84InfoDataLp1.EmergencyOk = value;
}
[Subscription("ES", "LP2")]
public bool EmergencyOkLp2
{
get => E84InfoDataLp2.EmergencyOk;
set => E84InfoDataLp2.EmergencyOk = value;
}
[Subscription("ES", "LP3")]
public bool EmergencyOkLp3
{
get => E84InfoDataLp3.EmergencyOk;
set => E84InfoDataLp3.EmergencyOk = value;
}
[Subscription("ES", "LP4")]
public bool EmergencyOkLp4
{
get => E84InfoDataLp4.EmergencyOk;
set => E84InfoDataLp4.EmergencyOk = value;
}
[Subscription("E84State", "LP1")]
public string E84StateLp1
{
get => E84InfoDataLp1.E84State;
set => E84InfoDataLp1.E84State = value;
}
[Subscription("E84State", "LP2")]
public string E84StateLp2
{
get => E84InfoDataLp2.E84State;
set => E84InfoDataLp2.E84State = value;
}
[Subscription("E84State", "LP3")]
public string E84StateLp3
{
get => E84InfoDataLp3.E84State;
set => E84InfoDataLp3.E84State = value;
}
[Subscription("E84State", "LP4")]
public string E84StateLp4
{
get => E84InfoDataLp4.E84State;
set => E84InfoDataLp4.E84State = value;
}
}
}
@@ -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());
}
}
}
@@ -0,0 +1,404 @@
<UserControl x:Class="MECF.Framework.UI.Client.CenterViews.Operations.LotHistory.LotHistoryView"
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:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:toolkit="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:micro="clr-namespace:Caliburn.Micro"
mc:Ignorable="d"
d:DesignHeight="750" d:DesignWidth="1800">
<Grid Margin="10,0,0,0" IsEnabled="{Binding IsPermission}">
<Grid.RowDefinitions>
<RowDefinition Height="300"/>
<RowDefinition Height="300"/>
<RowDefinition Height="170"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0" HorizontalAlignment="Left" Width="1024">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="600"/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" Orientation="Vertical">
<DataGrid AutoGenerateColumns="False" Name="datagridRunningJobs" ItemsSource="{Binding RunningJobs}"
SelectedItem="{Binding SelectedRunLot}"
CanUserAddRows="False" CanUserResizeColumns="True" CanUserResizeRows="False" HorizontalAlignment="Left"
FontFamily="Arial" Height="100" FontSize="12" Width="550" Margin="5">
<DataGrid.Columns>
<DataGridTextColumn Width="300" Binding="{Binding Name, Mode=OneWay}" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
<DataGridTextColumn.HeaderTemplate >
<DataTemplate>
<TextBlock Text="Lot In Process" />
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="ToolTip" Value="{Binding Name}" />
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="180" Binding="{Binding StartTime, Mode=OneWay}" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
<DataGridTextColumn.HeaderTemplate >
<DataTemplate>
<TextBlock Text="Start Time" />
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="ToolTip" Value="{Binding StartTime}" />
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
</DataGrid.Columns>
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<micro:ActionMessage MethodName="WaferRunningChanged">
<micro:Parameter Value="{Binding ElementName=datagridRunningJobs, Path=SelectedItem}"/>
</micro:ActionMessage>
</i:EventTrigger>
<i:EventTrigger EventName="PreviewMouseDown">
<micro:ActionMessage MethodName="WaferRunningChanged">
<micro:Parameter Value="{Binding ElementName=datagridRunningJobs, Path=SelectedItem}"/>
</micro:ActionMessage>
</i:EventTrigger>
</i:Interaction.Triggers>
</DataGrid>
<StackPanel Orientation="Horizontal">
<toolkit:DateTimePicker Format="ShortDate" FontSize="14"
FormatString="yyyy/MM/dd"
TimeFormat="Custom"
AutoCloseCalendar="True"
Grid.Row="0" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="3"
Value="{Binding Path=HistoryJobDate, Mode=TwoWay }" Height="30" Width="200" />
<Button Content="Filter" Width="120" Height="30" Margin="3" Command="{Binding FilterHistoryCommand}"></Button>
</StackPanel>
<DataGrid AutoGenerateColumns="False" Name="gridHistoryLot" ItemsSource="{Binding HistoryJobs}"
CanUserAddRows="False" CanUserResizeColumns="True" CanUserResizeRows="False" HorizontalAlignment="Left"
SelectedItem="{Binding SelectedHistoryLot}"
FontFamily="Arial" FontSize="12" Width="550" Height="150" Margin="5">
<DataGrid.Columns>
<DataGridTextColumn Width="300" Binding="{Binding Name, Mode=OneWay}" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
<DataGridTextColumn.HeaderTemplate >
<DataTemplate>
<TextBlock Text="Completed Lot" />
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="ToolTip" Value="{Binding Name}" />
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="180" Binding="{Binding StartTime, Mode=OneWay}" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
<DataGridTextColumn.HeaderTemplate >
<DataTemplate>
<TextBlock Text="Start Time" />
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="ToolTip" Value="{Binding StartTime}" />
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
</DataGrid.Columns>
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<micro:ActionMessage MethodName="HistoryLotChanged">
<micro:Parameter Value="{Binding ElementName=gridHistoryLot, Path=SelectedItem}"/>
</micro:ActionMessage>
</i:EventTrigger>
<i:EventTrigger EventName="PreviewMouseDown">
<micro:ActionMessage MethodName="HistoryLotChanged">
<micro:Parameter Value="{Binding ElementName=gridHistoryLot, Path=SelectedItem}"/>
</micro:ActionMessage>
</i:EventTrigger>
</i:Interaction.Triggers>
</DataGrid>
</StackPanel>
<Grid Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="380"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid Margin="20, 0,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="35"/>
<RowDefinition Height="35"/>
<RowDefinition Height="35"/>
<RowDefinition Height="35"/>
<RowDefinition Height="35"/>
<RowDefinition Height="35"/>
<RowDefinition Height="35"/>
<RowDefinition Height="35"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="160"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Grid.Row="0" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,1,1,1" Background="{DynamicResource Table_BG_Title}" Padding="5,1">
<TextBlock Text="Lot Name" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="15" FontFamily="Arial" VerticalAlignment="Center"/>
</Border>
<Border Grid.Row="0" Grid.Column="1" BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Content}" Padding="5,1">
<TextBlock Text="{Binding Current.Name}" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="15" FontFamily="Arial" VerticalAlignment="Center"/>
</Border>
<Border Grid.Row="1" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Title}" Padding="5,1">
<TextBlock Text="Start Time" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="15" FontFamily="Arial" VerticalAlignment="Center"/>
</Border>
<Border Grid.Row="1" Grid.Column="1" BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{DynamicResource Table_BG_Content}" Padding="5,1">
<TextBlock Text="{Binding Current.StartTime}" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="15" FontFamily="Arial" VerticalAlignment="Center"/>
</Border>
<Border Grid.Row="2" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Title}" Padding="5,1">
<TextBlock Text="End Time" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="15" FontFamily="Arial" VerticalAlignment="Center"/>
</Border>
<Border Grid.Row="2" Grid.Column="1" BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{DynamicResource Table_BG_Content}" Padding="5,1">
<TextBlock Text="{Binding Current.EndTime}" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="15" FontFamily="Arial" VerticalAlignment="Center"/>
</Border>
<Border Grid.Row="3" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Title}" Padding="5,1">
<TextBlock Text="Input Port" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="15" FontFamily="Arial" VerticalAlignment="Center"/>
</Border>
<Border Grid.Row="3" Grid.Column="1" BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{DynamicResource Table_BG_Content}" Padding="5,1">
<TextBlock Text="{Binding Current.PortIn}" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="15" FontFamily="Arial" VerticalAlignment="Center"/>
</Border>
<Border Grid.Row="4" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Title}" Padding="5,1">
<TextBlock Text="Output Port" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="15" FontFamily="Arial" VerticalAlignment="Center"/>
</Border>
<Border Grid.Row="4" Grid.Column="1" BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{DynamicResource Table_BG_Content}" Padding="5,1">
<TextBlock Text="{Binding Current.PortOut}" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="15" FontFamily="Arial" VerticalAlignment="Center"/>
</Border>
<Border Grid.Row="5" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Title}" Padding="5,1">
<TextBlock Text="Total Wafer" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="15" FontFamily="Arial" VerticalAlignment="Center"/>
</Border>
<Border Grid.Row="5" Grid.Column="1" BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{DynamicResource Table_BG_Content}" Padding="5,1">
<TextBlock Text="{Binding Current.TotalWafer}" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="15" FontFamily="Arial" VerticalAlignment="Center"/>
</Border>
<Border Grid.Row="6" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Title}" Padding="5,1">
<TextBlock Text="Unprocessed Wafer " TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="15" FontFamily="Arial" VerticalAlignment="Center"/>
</Border>
<Border Grid.Row="6" Grid.Column="1" BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{DynamicResource Table_BG_Content}" Padding="5,1">
<TextBlock Text="{Binding Current.UnprocessedWafer}" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="15" FontFamily="Arial" VerticalAlignment="Center"/>
</Border>
<Border Grid.Row="7" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Title}" Padding="5,1">
<TextBlock Text="Aborted Wafer " TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="15" FontFamily="Arial" VerticalAlignment="Center"/>
</Border>
<Border Grid.Row="7" Grid.Column="1" BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,0,1,1" Background="{DynamicResource Table_BG_Content}" Padding="5,1">
<TextBlock Text="{Binding Current.AbortWafer}" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="15" FontFamily="Arial" VerticalAlignment="Center"/>
</Border>
</Grid>
</Grid>
</Grid>
<GridSplitter HorizontalAlignment="Left" Margin="5,0,0,0" Height="4" ResizeDirection="Rows" Grid.Row="1" VerticalAlignment="Top" Background="DarkGray" Width="1300">
</GridSplitter>
<DataGrid Grid.Row="1" AutoGenerateColumns="False" Name="dataGrid_LotList" ItemsSource="{Binding Wafers}"
SelectedItem="{Binding CurrentWafer}"
CanUserAddRows="False" CanUserResizeColumns="True" CanUserResizeRows="False" HorizontalAlignment="Left"
FontFamily="Arial" FontSize="12" Margin="5,5,0,0" Width="1300">
<DataGrid.Columns>
<DataGridTextColumn Width="250" CanUserSort="True" Binding="{Binding WaferID, Mode=OneWay}" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
<DataGridTextColumn.HeaderTemplate >
<DataTemplate>
<TextBlock Text="Wafer ID" />
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="ToolTip" Value="{Binding WaferID}" />
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="80" CanUserSort="True" Binding="{Binding Slot, Mode=OneWay}" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
<DataGridTextColumn.HeaderTemplate >
<DataTemplate>
<TextBlock Text="Slot#" />
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="ToolTip" Value="{Binding Slot}" />
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="120" CanUserSort="True" Binding="{Binding Status, Mode=OneWay}" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
<DataGridTextColumn.HeaderTemplate >
<DataTemplate>
<TextBlock Text="Status" />
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="ToolTip" Value="{Binding Status}" />
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="300" Binding="{Binding SequenceName, Mode=OneWay}" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
<DataGridTextColumn.HeaderTemplate >
<DataTemplate>
<TextBlock Text="Sequence Name" />
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="ToolTip" Value="{Binding SequenceName}" />
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="120" CanUserSort="True" Binding="{Binding LotID, Mode=OneWay}" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
<DataGridTextColumn.HeaderTemplate >
<DataTemplate>
<TextBlock Text="Lot ID" />
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="ToolTip" Value="{Binding LotID}" />
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="120" CanUserSort="True" Binding="{Binding NotchAngle, Mode=OneWay}" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
<DataGridTextColumn.HeaderTemplate >
<DataTemplate>
<TextBlock Text="Notch Angle" />
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="ToolTip" Value="{Binding NotchAngle}" />
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="120" CanUserSort="True" Binding="{Binding CarrierID, Mode=OneWay}" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
<DataGridTextColumn.HeaderTemplate >
<DataTemplate>
<TextBlock Text="Carrier ID" />
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="ToolTip" Value="{Binding CarrierID}" />
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
</DataGrid.Columns>
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<micro:ActionMessage MethodName="WaferHistoryChanged">
<micro:Parameter Value="{Binding ElementName=dataGrid_LotList, Path=SelectedItem}"/>
</micro:ActionMessage>
</i:EventTrigger>
</i:Interaction.Triggers>
</DataGrid>
<GridSplitter HorizontalAlignment="Left" Height="4" ResizeDirection="Rows" Grid.Row="2" VerticalAlignment="Top" Background="DarkGray" Width="1300">
</GridSplitter>
<Grid Grid.Row="2" Margin="5,6,0,0" HorizontalAlignment="Left" Width="1300">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1300"/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<DataGrid AutoGenerateColumns="False" CanUserAddRows="False" CanUserResizeRows="False" CanUserResizeColumns="True" ItemsSource="{Binding Movements}"
FontFamily="Arial" FontSize="12">
<DataGrid.Columns>
<DataGridTextColumn Width="100" Binding="{Binding Time, Mode=OneWay}" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
<DataGridTextColumn.HeaderTemplate >
<DataTemplate>
<TextBlock Text="Time" />
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="ToolTip" Value="{Binding Time}" />
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="100" Binding="{Binding Station, Mode=OneWay}" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
<DataGridTextColumn.HeaderTemplate >
<DataTemplate>
<TextBlock Text="Station" />
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="ToolTip" Value="{Binding Station}" />
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="100" Binding="{Binding Slot, Mode=OneWay}" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
<DataGridTextColumn.HeaderTemplate >
<DataTemplate>
<TextBlock Text="Slot" />
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="ToolTip" Value="{Binding Slot}" />
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="100" Binding="{Binding Status, Mode=OneWay}" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
<DataGridTextColumn.HeaderTemplate >
<DataTemplate>
<TextBlock Text="Status" />
</DataTemplate>
</DataGridTextColumn.HeaderTemplate>
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="ToolTip" Value="{Binding Status}" />
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
<!--<s:SciChartSurface x:Name="sciChart" BorderBrush="Gray" Grid.Column="1" Width="500"
s:ThemeManager.Theme="ExpressionLight"
RenderableSeries="{Binding RenderableSeries}" Annotations="{Binding Annotations}">
<s:SciChartSurface.XAxis>
<s:NumericAxis AxisTitle="Number of Samples (per Series)" AutoRange="Always"/>
</s:SciChartSurface.XAxis>
<s:SciChartSurface.YAxis>
<s:NumericAxis AxisTitle="Value" AutoRange="Never" AxisAlignment="Left" VisibleRange="0,8" LabelProvider="{Binding YLabelProvider}" />
</s:SciChartSurface.YAxis>
<s:SciChartSurface.ChartModifier>
<s:ModifierGroup ExecuteOn="MouseDoubleClick">
<s:CursorModifier IsEnabled="True" ShowTooltipOn="MouseOver" ShowAxisLabels="True" SourceMode="AllSeries" ShowTooltip="False" />
</s:ModifierGroup>
</s:SciChartSurface.ChartModifier>
</s:SciChartSurface>-->
</Grid>
</Grid>
</UserControl>
@@ -0,0 +1,15 @@
using System.Windows.Controls;
namespace MECF.Framework.UI.Client.CenterViews.Operations.LotHistory
{
/// <summary>
/// WaferHistoryView.xaml 的交互逻辑
/// </summary>
public partial class LotHistoryView : UserControl
{
public LotHistoryView()
{
InitializeComponent();
}
}
}
@@ -0,0 +1,471 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Data;
using System.Linq;
using System.Windows;
using System.Windows.Input;
using Aitex.Core.RT.Log;
using Aitex.Core.UI.MVVM;
using Aitex.Core.Util;
using MECF.Framework.Common.CommonData;
using MECF.Framework.Common.DataCenter;
using MECF.Framework.UI.Client.CenterViews.DataLogs.WaferHistory;
using MECF.Framework.UI.Client.ClientBase;
using SciChart.Core.Extensions;
namespace MECF.Framework.UI.Client.CenterViews.Operations.LotHistory
{
//public class WaferHistoryDetail
//{
// public string Guid { get; set; }
// public string CreateTime { get; set; }
// public string DeleteTime { get; set; }
// public string LoadPort { get; set; }
// public string Slot { get; set; }
// public string CarrierID { get; set; }
// public string LotID { get; set; }
// public string WaferID { get; set; }
// public string Status { get; set; }
//}
//public class WaferMovement
//{
// public string Time { get; set; }
// public string Station { get; set; }
// public string Slot { get; set; }
// public string Status { get; set; }
//}
/*
*
* start_time timestamp without time zone,
end_time timestamp without time zone,
carrier_data_guid text,
name text,
input_port text,
output_port text,
total_wafer_count integer,
abort_wafer_count integer,
unprocessed_wafer_count integer,
CONSTRAINT pj_data_pkey PRIMARY KEY (guid)
*/
public class CJItem:NotifiableItem
{
public string Guid { get; set; }
public string Name { get; set; }
public string StartTime { get; set; }
public string EndTime { get; set; }
public string CarrierId { get; set; }
public string TotalWafer { get; set; }
public string PortIn { get; set; }
public string PortOut { get; set; }
public string AbortedWafer { get; set; }
public string UnprocessedWafer { get; set; }
}
public class LotHistoryViewModel : UiViewModelBase
{
private DateTime _historyDate;
public DateTime HistoryJobDate
{
get { return _historyDate; }
set
{
_historyDate = value;
UpdateHistoryList(value);
}
}
private CJItem _selectedHistoryLot;
public CJItem SelectedHistoryLot
{
get { return _selectedHistoryLot; }
set
{
if (_selectedHistoryLot != value)
{
_selectedHistoryLot = value;
HistoryLotChanged(value);
}
}
}
public CJItem Current { get; set; }
private WaferHistoryDetail _currentWafer;
public WaferHistoryDetail CurrentWafer
{
get { return _currentWafer; }
set
{
if (_currentWafer != value)
{
_currentWafer = value;
WaferHistoryChanged(value);
}
}
}
private CJItem _selectedRunningLot;
public CJItem SelectedRunLot
{
get { return _selectedRunningLot; }
set
{
if (_selectedRunningLot != value)
{
_selectedRunningLot = value;
RunLotChanged(value);
}
}
}
public CJItem RunningJob { get; set; }
public ObservableCollection<WaferHistoryDetail> Wafers { get; set; }
public ObservableCollection<WaferMovement> Movements { get; set; }
public ObservableCollection<CJItem> RunningJobs { get; set; }
public ObservableCollection<CJItem> HistoryJobs { get; set; }
public ICommand FilterHistoryCommand { get; set; }
[Subscription("Scheduler.CjIdList")]
public List<string> RunningCjIdList { get; set; }
public LotHistoryViewModel()
{
this.DisplayName = "Lot History";
var now = DateTime.Now;
this.HistoryJobDate = new DateTime(now.Year, now.Month, now.Day, 0, 0, 0, 0);
this.Wafers = new ObservableCollection<WaferHistoryDetail>();
this.Movements = new ObservableCollection<WaferMovement>();
RunningJobs = new ObservableCollection<CJItem>();
HistoryJobs = new ObservableCollection<CJItem>();
FilterHistoryCommand = new DelegateCommand<object>(PerformFilter);
}
private void PerformFilter(object obj)
{
UpdateHistoryList(HistoryJobDate);
}
protected override void OnInitialize()
{
base.OnInitialize();
}
protected override void InvokeBeforeUpdateProperty(Dictionary<string, object> data)
{
base.InvokeBeforeUpdateProperty(data);
//foreach (var pj in RunningPjIdList)
{
}
}
protected override void InvokeAfterUpdateProperty(Dictionary<string, object> data)
{
base.InvokeAfterUpdateProperty(data);
try
{
List<string> alreadyExistList = Array.ConvertAll(RunningJobs.ToArray(), x => x.Guid).ToList();
foreach (var o in RunningCjIdList)
{
if (!alreadyExistList.Contains(o))
{
RunningJobs.Add(GetCJ(o));
}
else
{
alreadyExistList.Remove(o);
}
}
foreach (var id in alreadyExistList)
{
RunningJobs.RemoveWhere(x => x.Guid == id);
}
}
catch (Exception ex)
{
LOG.Write(ex);
}
}
public void WaferRunningChanged(CJItem date)
{
Current = date;
NotifyOfPropertyChange(nameof(Current));
if (Current != null)
{
Current.InvokePropertyChanged();
Query(Current.Guid);
}
else
{
Wafers.Clear();
Movements.Clear();
}
}
public void HistoryLotChanged(CJItem date)
{
Current = date;
NotifyOfPropertyChange(nameof(Current));
if (Current != null)
{
Current.InvokePropertyChanged();
Query(Current.Guid);
}
else
{
Wafers.Clear();
Movements.Clear();
}
}
public void RunLotChanged(CJItem date)
{
HistoryLotChanged(date);
}
public void UpdateHistoryList(DateTime date)
{
try
{
var from = new DateTime(date.Year, date.Month, date.Day, 0,0,0);
var to = new DateTime(date.Year, date.Month, date.Day, 23, 59,59);
string sql = string.Format(
"SELECT * FROM \"cj_data\" where \"start_time\" >= '{0}' and \"start_time\" <= '{1}' order by \"start_time\" ASC;",
from.ToString("yyyy/MM/dd HH:mm:ss.fff"), to.ToString("yyyy/MM/dd HH:mm:ss.fff"));
DataTable dbData = QueryDataClient.Instance.Service.QueryData(sql);
Application.Current.Dispatcher.BeginInvoke(new Action(() =>
{
HistoryJobs.Clear();
if (dbData == null || dbData.Rows.Count == 0)
return;
for (int i = 0; i < dbData.Rows.Count; i++)
{
var cjItem = new CJItem();
cjItem.Guid = dbData.Rows[i]["guid"].ToString();
cjItem.Name = dbData.Rows[i]["name"].ToString();
cjItem.PortIn = dbData.Rows[i]["input_port"].ToString();
cjItem.PortOut = dbData.Rows[i]["output_port"].ToString();
cjItem.TotalWafer = dbData.Rows[i]["total_wafer_count"].ToString();
cjItem.AbortedWafer = dbData.Rows[i]["abort_wafer_count"].ToString();
cjItem.UnprocessedWafer = dbData.Rows[i]["unprocessed_wafer_count"].ToString();
if (!dbData.Rows[i]["start_time"].Equals(DBNull.Value))
cjItem.StartTime = ((DateTime)dbData.Rows[i]["start_time"]).ToString("HH:mm:ss");
if (!dbData.Rows[i]["end_time"].Equals(DBNull.Value))
cjItem.EndTime = ((DateTime)dbData.Rows[i]["end_time"]).ToString("HH:mm:ss");
HistoryJobs.Add(cjItem);
}
}));
}
catch (Exception e)
{
LOG.Write(e);
}
}
public CJItem GetCJ(string guid)
{
CJItem cjItem = new CJItem();
try
{
string sql = string.Format(
"SELECT * FROM \"cj_data\" where \"guid\" = '{0}' order by \"start_time\" ASC;",
guid);
DataTable dbData = QueryDataClient.Instance.Service.QueryData(sql);
Application.Current.Dispatcher.BeginInvoke(new Action(() =>
{
if (dbData == null || dbData.Rows.Count == 0)
return;
for (int i = 0; i < dbData.Rows.Count; i++)
{
//pjItem = new PJItem();
cjItem.Guid = dbData.Rows[i]["guid"].ToString();
cjItem.Name = dbData.Rows[i]["name"].ToString();
cjItem.PortIn = dbData.Rows[i]["input_port"].ToString();
cjItem.PortOut = dbData.Rows[i]["output_port"].ToString();
cjItem.TotalWafer = dbData.Rows[i]["total_wafer_count"].ToString();
cjItem.AbortedWafer = dbData.Rows[i]["abort_wafer_count"].ToString();
cjItem.UnprocessedWafer = dbData.Rows[i]["unprocessed_wafer_count"].ToString();
if (!dbData.Rows[i]["start_time"].Equals(DBNull.Value))
cjItem.StartTime = ((DateTime)dbData.Rows[i]["start_time"]).ToString("HH:mm:ss");
if (!dbData.Rows[i]["end_time"].Equals(DBNull.Value))
cjItem.EndTime = ((DateTime)dbData.Rows[i]["end_time"]).ToString("HH:mm:ss");
}
}));
}
catch (Exception e)
{
LOG.Write(e);
}
return cjItem;
}
public void Query(string cjID)
{
try
{
string sql = string.Format(
"SELECT * FROM \"wafer_data\",\"carrier_data\" where \"lot_data_guid\" = '{0}' and \"wafer_data\".\"carrier_data_guid\"=\"carrier_data\".\"guid\" order by \"create_time\" ASC, \"create_station\" ASC,\"create_slot\" ASC;",
cjID);
DataTable dbData = QueryDataClient.Instance.Service.QueryData(sql);
Application.Current.Dispatcher.BeginInvoke(new Action(() =>
{
Wafers.Clear();
try
{
if (dbData == null || dbData.Rows.Count == 0)
return;
for (int i = 0; i < dbData.Rows.Count; i++)
{
WaferHistoryDetail item = new WaferHistoryDetail();
item.Guid = dbData.Rows[i]["guid"].ToString();
item.LoadPort = dbData.Rows[i]["create_station"].ToString();
item.Slot = dbData.Rows[i]["create_slot"].ToString();
item.CarrierID = dbData.Rows[i]["rfid"].ToString();
item.LotID = dbData.Rows[i]["lot_id"].ToString();
item.WaferID = dbData.Rows[i]["wafer_id"].ToString();
item.Status = dbData.Rows[i]["process_status"].ToString();
item.NotchAngle = dbData.Rows[i]["notch_angle"].ToString();
item.SequenceName = dbData.Rows[i]["sequence_name"].ToString();
item.LotId = dbData.Rows[i]["lot_id"].ToString();
if (!dbData.Rows[i]["create_time"].Equals(DBNull.Value))
item.CreateTime = ((DateTime)dbData.Rows[i]["create_time"]).ToString("HH:mm:ss.fff");
if (!dbData.Rows[i]["delete_time"].Equals(DBNull.Value))
item.DeleteTime = ((DateTime)dbData.Rows[i]["delete_time"]).ToString("HH:mm:ss.fff");
Wafers.Add(item);
}
}
catch (Exception ex)
{
LOG.Write(ex);
}
}));
}
catch (Exception e)
{
LOG.Write(e);
}
}
public void WaferHistoryChanged( WaferHistoryDetail detail)
{
try
{
if (detail == null)
{
Application.Current.Dispatcher.BeginInvoke(new Action(() =>
{
Movements.Clear();
}));
return;
}
string sql = string.Format(
"SELECT * FROM \"wafer_move_history\" where \"wafer_data_guid\" = '{0}' order by \"arrive_time\" ASC;",
detail.Guid);
DataTable dbData = QueryDataClient.Instance.Service.QueryData(sql);
Application.Current.Dispatcher.BeginInvoke(new Action(() =>
{
Movements.Clear();
if (dbData == null || dbData.Rows.Count == 0)
return;
for (int i = 0; i < dbData.Rows.Count; i++)
{
WaferMovement item = new WaferMovement();
item.Station = dbData.Rows[i]["station"].ToString();
item.Slot = dbData.Rows[i]["slot"].ToString();
item.Status = dbData.Rows[i]["status"].ToString();
if (!dbData.Rows[i]["arrive_time"].Equals(DBNull.Value))
item.Time = ((DateTime)dbData.Rows[i]["arrive_time"]).ToString("HH:mm:ss.fff");
Movements.Add(item);
}
}));
}
catch (Exception e)
{
LOG.Write(e);
}
}
}
}
@@ -0,0 +1,185 @@
<UserControl x:Class="MECF.Framework.UI.Client.CenterViews.Operations.MonitorJob.MonitorJobView"
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"
mc:Ignorable="d"
d:DesignHeight="900" d:DesignWidth="1920" >
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TabControl Background="Transparent" Padding="0" BorderThickness="0">
<TabItem Header="Control Jobs" >
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="60"/>
</Grid.RowDefinitions>
<DataGrid Grid.Row="0" AutoGenerateColumns="False" Name="GridControlJobsList"
ItemsSource="{Binding ControlJobsData,Mode=OneWay}" SelectionUnit="FullRow"
VerticalAlignment="Stretch" VerticalContentAlignment="Stretch"
HorizontalGridLinesBrush="Gray" VerticalGridLinesBrush="#A0808080"
AlternatingRowBackground="#74C7F7FF" BorderThickness="1" SelectionMode="Single"
CanUserReorderColumns="False" CanUserAddRows="False" BorderBrush="#5C000000"
ColumnHeaderHeight="25" ClipboardCopyMode="IncludeHeader" CanUserSortColumns="False"
IsReadOnly="True" RowBackground="#FFAFD5D5" SelectedItem="{Binding SelectedControlJob}"
>
<DataGrid.Columns>
<DataGridTextColumn Width="110" Binding="{Binding Num,Mode=OneWay}" Header="#" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False">
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="ToolTip" Value="{Binding Num}" />
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="200" Binding="{Binding ObjtID,Mode=OneWay}" Header="ID" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False">
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="ToolTip" Value="{Binding ObjtID}" />
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="220" Binding="{Binding State,Mode=OneWay}" Header="State" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="ToolTip" Value="{Binding State}" />
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="120" Binding="{Binding Auto,Mode=OneWay}" Header="Is Auto Start" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False">
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="ToolTip" Value="{Binding Auto}" />
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="220" Binding="{Binding CreateTime,Mode=OneWay}" Header="Create Time" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="ToolTip" Value="{Binding CreateTime}" />
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="220" Binding="{Binding CompleteTime,Mode=OneWay}" Header="Complete Time" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False">
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="ToolTip" Value="{Binding CompleteTime}" />
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
<StackPanel Grid.Row="1" VerticalAlignment="Top" Orientation="Horizontal" Height="55">
<!--<Button Content="Resume" Height="30" VerticalAlignment="Center" Width="119" Command="{Binding ControlJobsCommand}" CommandParameter="Resume" IsDefault="True" Canvas.Left="382" Margin="20,0,0,0" Canvas.Top="15" IsEnabled="{Binding IsPermission}"/>
<Button Content="Pause" Height="30" VerticalAlignment="Center" Width="119" Command="{Binding ControlJobsCommand}" CommandParameter="Pause" IsDefault="True" Canvas.Left="382" Margin="20,0,0,0" Canvas.Top="15" IsEnabled="{Binding IsPermission}"/>
<Button Content="Start" Height="30" VerticalAlignment="Center" Width="119" Command="{Binding ControlJobsCommand}" CommandParameter="Start" IsDefault="True" Canvas.Left="382" Margin="20,0,0,0" Canvas.Top="15" IsEnabled="{Binding IsPermission}"/>
<Button Content="Stop" Height="30" VerticalAlignment="Center" Width="119" Command="{Binding ControlJobsCommand}" CommandParameter="Stop" IsDefault="True" Canvas.Left="382" Margin="20,0,0,0" Canvas.Top="15" IsEnabled="{Binding IsPermission}"/>-->
<Button Content="Abort" Height="30" VerticalAlignment="Center" Width="119" Command="{Binding ControlJobsCommand}" CommandParameter="Abort" IsDefault="True" Canvas.Left="382" Margin="20,0,0,0" Canvas.Top="15" IsEnabled="{Binding IsPermission}"/>
<Button Content="Cancel" Height="30" VerticalAlignment="Center" Width="119" Command="{Binding ControlJobsCommand}" CommandParameter="Cancel" IsDefault="True" Canvas.Left="382" Margin="20,0,0,0" Canvas.Top="15" IsEnabled="{Binding IsPermission}"/>
<!--<Button Content="DeSelect" Height="30" VerticalAlignment="Center" Width="119" Command="{Binding ControlJobsCommand}" CommandParameter="DeSelect" IsDefault="True" Canvas.Left="382" Margin="20,0,0,0" Canvas.Top="15" IsEnabled="{Binding IsPermission}"/>
<Button Content="Head of Queue" Height="30" VerticalAlignment="Center" Width="182" Command="{Binding ControlJobsCommand}" CommandParameter="Queue" IsDefault="True" Canvas.Left="382" Margin="20,2,0,3" Canvas.Top="15" IsEnabled="{Binding IsPermission}"/>-->
<!--<TextBox Height="30" FontSize="20" VerticalAlignment="Center" Width="272" Margin="20,2,0,3"></TextBox>-->
</StackPanel>
</Grid>
</TabItem>
</TabControl>
<TabControl Margin="0,10,0,0" Grid.Row="1" Background="Transparent" BorderThickness="0" Padding="0">
<TabItem Header="Process Jobs" >
<Grid Margin="0" >
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="60"/>
</Grid.RowDefinitions>
<DataGrid Margin="0" Padding="0" Grid.Row="0" AutoGenerateColumns="False" Name="GridProcessList"
ItemsSource="{Binding ProcessJobsData,Mode=OneWay}" SelectionUnit="FullRow"
VerticalAlignment="Stretch"
HorizontalGridLinesBrush="Gray" VerticalGridLinesBrush="#A0808080"
AlternatingRowBackground="#74C7F7FF" BorderThickness="1" SelectionMode="Single"
CanUserReorderColumns="False" CanUserAddRows="False" BorderBrush="#5C000000"
ColumnHeaderHeight="25" ClipboardCopyMode="IncludeHeader" CanUserSortColumns="False"
IsReadOnly="True" RowBackground="#FFAFD5D5" SelectedItem="{Binding SelectedProcessJob}"
>
<DataGrid.Columns>
<DataGridTextColumn Width="200" Binding="{Binding ObjtID,Mode=OneWay}" Header="ID" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False">
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="ToolTip" Value="{Binding ObjtID}" />
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="220" Binding="{Binding State,Mode=OneWay}" Header="State" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="ToolTip" Value="{Binding State}" />
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="110" Binding="{Binding Auto,Mode=OneWay}" Header="Is Auto Start" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False">
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="ToolTip" Value="{Binding Auto}" />
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="220" Binding="{Binding RecID,Mode=OneWay}" Header="Recipe ID" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False">
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="ToolTip" Value="{Binding RecID}" />
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="220" Binding="{Binding CreateTime,Mode=OneWay}" Header="Create Time" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False" >
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="ToolTip" Value="{Binding CreateTime}" />
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
<DataGridTextColumn Width="220" Binding="{Binding CompleteTime,Mode=OneWay}" Header="Complete Time" CanUserSort="True" CanUserReorder="False" IsReadOnly="True" CanUserResize="False">
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="ToolTip" Value="{Binding CompleteTime}" />
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
<StackPanel Grid.Row="1" VerticalAlignment="Top" Orientation="Horizontal" Height="55">
<!--<Button Content="Resume" Height="30" VerticalAlignment="Center" Width="119" Command="{Binding ProcessJobsCommand}" CommandParameter="Resume" IsDefault="True" Canvas.Left="382" Margin="20,0,0,0" Canvas.Top="15" IsEnabled="{Binding IsPermission}"/>
<Button Content="Pause" Height="30" VerticalAlignment="Center" Width="119" Command="{Binding ProcessJobsCommand}" CommandParameter="Pause" IsDefault="True" Canvas.Left="382" Margin="20,0,0,0" Canvas.Top="15" IsEnabled="{Binding IsPermission}"/>
<Button Content="Start" Height="30" VerticalAlignment="Center" Width="119" Command="{Binding ProcessJobsCommand}" CommandParameter="Start" IsDefault="True" Canvas.Left="382" Margin="20,0,0,0" Canvas.Top="15" IsEnabled="{Binding IsPermission}"/>
<Button Content="Stop" Height="30" VerticalAlignment="Center" Width="119" Command="{Binding ProcessJobsCommand}" CommandParameter="Stop" IsDefault="True" Canvas.Left="382" Margin="20,0,0,0" Canvas.Top="15" IsEnabled="{Binding IsPermission}"/>-->
<Button Content="Abort" Height="30" VerticalAlignment="Center" Width="119" Command="{Binding ProcessJobsCommand}" CommandParameter="Abort" IsDefault="True" Canvas.Left="382" Margin="20,0,0,0" Canvas.Top="15" IsEnabled="{Binding IsPermission}"/>
<!--<Button Content="Cancel" Height="30" VerticalAlignment="Center" Width="119" Command="{Binding ProcessJobsCommand}" CommandParameter="Cancel" IsDefault="True" Canvas.Left="382" Margin="20,0,0,0" Canvas.Top="15" IsEnabled="{Binding IsPermission}"/>-->
<!--<Button Content="Display Turning" Height="30" FontSize="20" VerticalAlignment="Center" Width="155" Click="buttonExportProcess_Click" IsDefault="True" Canvas.Left="382" Margin="500,0,0,0" Canvas.Top="15" IsEnabled="{Binding IsPermission}"/>-->
</StackPanel>
</Grid>
</TabItem>
</TabControl>
</Grid>
</UserControl>
@@ -0,0 +1,15 @@
using System.Windows.Controls;
namespace MECF.Framework.UI.Client.CenterViews.Operations.MonitorJob
{
/// <summary>
/// MonitorJobView.xaml 的交互逻辑
/// </summary>
public partial class MonitorJobView : UserControl
{
public MonitorJobView()
{
InitializeComponent();
}
}
}
@@ -0,0 +1,234 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Runtime.Serialization;
using System.Windows;
using System.Windows.Input;
using Aitex.Core.RT.Log;
using Aitex.Core.UI.MVVM;
using Aitex.Core.Util;
using Aitex.Sorter.Common;
using MECF.Framework.Common.CommonData;
using MECF.Framework.Common.DataCenter;
using MECF.Framework.Common.FAServices.E40s;
using MECF.Framework.Common.FAServices.E94s;
using MECF.Framework.Common.Utilities;
using MECF.Framework.UI.Client.ClientBase;
//using Aitex.Sorter.UI.ViewModel;
namespace MECF.Framework.UI.Client.CenterViews.Operations.MonitorJob
{
public class MonitorJobViewModel : UiViewModelBase
{
public class ProcessJobData : NotifiableItem
{
[DataMember]
public string ObjtID { get; set; }
[DataMember]
public string State { get; set; }
[DataMember]
public bool Auto { get; set; }
[DataMember]
public string RecID { get; set; }
[DataMember]
public DateTime CreateTime { get; set; }
[DataMember]
public DateTime CompleteTime { get; set; }
}
public class ControlJobData : NotifiableItem
{
[DataMember]
public int Num { get; set; }
[DataMember]
public string ObjtID { get; set; }
[DataMember]
public string State { get; set; }
[DataMember]
public bool Auto { get; set; }
[DataMember]
public DateTime CreateTime { get; set; }
[DataMember]
public DateTime CompleteTime { get; set; }
}
public ObservableCollection<ProcessJobData> ProcessJobsData { get; set; }
public ObservableCollection<ControlJobData> ControlJobsData { get; set; }
public ICommand ControlJobsCommand { get; set; }
public ICommand ProcessJobsCommand { get; set; }
public MonitorJobViewModel()/* : base("MonitorJobViewModel")*/
{
ControlJobsData = new ObservableCollection<ControlJobData>();
ProcessJobsData = new ObservableCollection<ProcessJobData>();
ControlJobsCommand = new DelegateCommand<object>(DoControlJobsCommand);
ProcessJobsCommand = new DelegateCommand<object>(DoProcessJobsCommand);
}
[Subscription("ProcessJobs")]
public List<WCFProcessJobInterface> ProcessJobs
{
get;
set;
}
[Subscription("ControlJobs")]
public List<WCFControlJobInterface> ControlJobs
{
get;
set;
}
public string SelectedControlJobsObjtID
{
get
{
return SelectedControlJob != null ? SelectedControlJob.ObjtID : "";
}
}
public ControlJobData SelectedControlJob { get; set; }
public string SelectedProcessJobsObjtID
{
get
{
return SelectedProcessJob!=null?SelectedProcessJob.ObjtID:"";
}
}
public ProcessJobData SelectedProcessJob { get; set; }
private void DoProcessJobsCommand(object obj)
{
if (string.IsNullOrEmpty(SelectedProcessJobsObjtID))
{
MessageBox.Show("No process job selected.");
return;
}
var objList = new object[] { obj, SelectedProcessJobsObjtID };
Common.OperationCenter.InvokeClient.Instance.Service.DoOperation("FAProcessJobsOperation", objList);
}
private void DoControlJobsCommand(object obj)
{
if (string.IsNullOrEmpty(SelectedControlJobsObjtID))
{
MessageBox.Show("No control job selected.");
return;
}
var objList = new object[] { obj, SelectedControlJobsObjtID };
Common.OperationCenter.InvokeClient.Instance.Service.DoOperation("FAControlJobsOperation", objList);
}
protected override void InvokeAfterUpdateProperty(Dictionary<string, object> data)
{
base.InvokeAfterUpdateProperty(data);
if (ProcessJobs == null || ProcessJobs.Count == 0)
{
ProcessJobsData.Clear();
}
else
{
foreach (var item in ProcessJobs)
{
var match = ProcessJobsData.ToList().Find(x => x.ObjtID == item.ObjtID);
if (match == null)
{
ProcessJobData pj = new ProcessJobData();
pj.ObjtID = item.ObjtID;
pj.State = item.PJstate.ToString();
pj.Auto = item.PRProcessStart;
pj.RecID = item.RecID;
pj.CreateTime = item.CreateTime;
pj.CompleteTime = item.CompleteTime;
ProcessJobsData.Add(pj);
}
else
{
match.ObjtID = item.ObjtID;
match.State = item.PJstate.ToString();
match.Auto = item.PRProcessStart;
match.RecID = item.RecID;
match.CreateTime = item.CreateTime;
match.CompleteTime = item.CompleteTime;
match.InvokePropertyChanged();
}
}
List<ProcessJobData> tobeRemove = new List<ProcessJobData>();
foreach (var processJobData in ProcessJobsData)
{
if (ProcessJobs.FirstOrDefault(x=>x.ObjtID==processJobData.ObjtID) == null)
tobeRemove.Add(processJobData);
}
foreach (var processJobData in tobeRemove)
{
ProcessJobsData.Remove(processJobData);
}
}
if (ControlJobs == null || ControlJobs.Count == 0)
{
ControlJobsData.Clear();
}
else
{
foreach (var item in ControlJobs)
{
var match = ControlJobsData.ToList().Find(x => x.ObjtID == item.ObjtID);
if (match == null)
{
ControlJobData cj = new ControlJobData();
cj.Num = ControlJobsData.Count + 1;
cj.ObjtID = item.ObjtID;
cj.State = item.state.ToString();
cj.Auto = item.StartMethod;
cj.CreateTime = item.CreateTime;
cj.CompleteTime = item.CompleteTime;
ControlJobsData.Add(cj);
}
else
{
match.State = item.state.ToString();
match.Auto = item.StartMethod;
match.CreateTime = match.CreateTime;
match.CompleteTime = match.CompleteTime;
match.InvokePropertyChanged();
}
}
List<ControlJobData> tobeRemove = new List<ControlJobData>();
foreach (var cj in ControlJobsData)
{
if (ControlJobs.FirstOrDefault(x => x.ObjtID == cj.ObjtID) == null)
tobeRemove.Add(cj);
}
foreach (var cj in tobeRemove)
{
ControlJobsData.Remove(cj);
}
}
}
}
}
@@ -0,0 +1,408 @@
<UserControl
x:Class="MECF.Framework.UI.Client.CenterViews.Operations.RealTime.RealtimeView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:OpenSEMI.Ctrlib.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:micro="clr-namespace:Caliburn.Micro"
xmlns:s="http://schemas.abtsoftware.co.uk/scichart"
xmlns:userControls="clr-namespace:MECF.Framework.UI.Client.CenterViews.Core.UserControls"
xmlns:userControls1="clr-namespace:Sicentury.Core.UserControls;assembly=Sicentury.Core"
xmlns:cv="clr-namespace:MECF.Framework.UI.Core.Converters;assembly=MECF.Framework.UI.Core"
xmlns:lex="http://wpflocalizeextension.codeplex.com"
xmlns:realTime="clr-namespace:MECF.Framework.UI.Client.CenterViews.Operations.RealTime"
d:DesignHeight="450"
d:DesignWidth="1800"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=realTime:RealtimeViewModel, IsDesignTimeCreatable=False}"
lex:LocalizeDictionary.DesignCulture="en"
lex:ResxLocalizationProvider.DefaultAssembly="Sicentury.Localization"
lex:ResxLocalizationProvider.DefaultDictionary="lang_common">
<UserControl.Resources>
<cv:BoolReverseConverter x:Key="boolReverseConverter" />
<cv:BoolVisibilityConverter x:Key="BoolVisibilityConverter" />
</UserControl.Resources>
<Grid IsEnabled="{Binding IsPermission}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="400" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="200" />
</Grid.RowDefinitions>
<Grid Grid.RowSpan="2" Grid.Column="0">
<Border
Padding="5"
Background="{DynamicResource Tab_BG}"
BorderBrush="{DynamicResource Tab_BD}"
BorderThickness="1"
SnapsToDevicePixels="True">
<Grid>
<userControls1:ParameterNodeTreeViewControl
x:Name="tvParameterNodes"
IsEnabled="{Binding IsBusy, Converter={StaticResource boolReverseConverter}}"
TreeRoot="{Binding ParameterNodes}"
PresetGroupsFolderName="RealTimeView"/>
</Grid>
</Border>
</Grid>
<GridSplitter
Grid.Row="0"
Grid.RowSpan="2"
Grid.Column="1"
Width="10"
HorizontalAlignment="Left"
VerticalAlignment="Stretch"
Background="Transparent"
Style="{DynamicResource VerticalGridSplitterStyle}" />
<!-- data chart -->
<StackPanel
Grid.Row="1"
Grid.Column="2"
Orientation="Horizontal" Margin="0,5,0,0">
<userControls:DataViewDataGrid
x:Name="dataGrid"
Width="1000"
IsShowStatisticColumn="False"
IsEnabled="{Binding IsBusy, Converter={StaticResource boolReverseConverter}}"
ItemsSource="{Binding Path=SelectedData}">
<i:Interaction.Behaviors>
<userControls:PhotoShotBehavior Target="{Binding ElementName=sciChart}"/>
</i:Interaction.Behaviors>
<i:Interaction.Triggers>
<i:EventTrigger EventName="Deleted">
<micro:ActionMessage MethodName="Deleted">
<micro:Parameter Value="$source" />
<micro:Parameter Value="$eventargs" />
</micro:ActionMessage>
</i:EventTrigger>
<i:EventTrigger EventName="Exporting">
<micro:ActionMessage MethodName="Exporting">
<micro:Parameter Value="$source" />
<micro:Parameter Value="$eventargs" />
</micro:ActionMessage>
</i:EventTrigger>
<i:EventTrigger EventName="Exported">
<micro:ActionMessage MethodName="Exported">
<micro:Parameter Value="$source" />
<micro:Parameter Value="$eventargs" />
</micro:ActionMessage>
</i:EventTrigger>
<i:EventTrigger EventName="ProgressMessageUpdating">
<micro:ActionMessage MethodName="ProgressUpdating">
<micro:Parameter Value="$source" />
<micro:Parameter Value="$eventargs" />
</micro:ActionMessage>
</i:EventTrigger>
</i:Interaction.Triggers>
</userControls:DataViewDataGrid>
<Grid Margin="15,10,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="26" />
<RowDefinition Height="35" />
<RowDefinition Height="35" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100" />
<ColumnDefinition Width="49" />
<ColumnDefinition Width="61" />
<ColumnDefinition Width="120" />
</Grid.ColumnDefinitions>
<Label
lex:ResxLocalizationProvider.DefaultDictionary="lang_datalogviews"
Grid.Row="0"
Grid.ColumnSpan="4"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Content="{lex:Loc ID_TXT_TrendChartSetting}"
Style="{DynamicResource Table_TitleStyle}" />
<Border
Grid.Row="1"
Padding="5,1"
Background="{DynamicResource Table_BG_Title}"
BorderBrush="{DynamicResource Table_BD}"
BorderThickness="1,0,1,1">
<TextBlock
lex:ResxLocalizationProvider.DefaultDictionary="lang_datalogviews"
VerticalAlignment="Center"
FontFamily="Arial"
FontSize="12"
Foreground="{DynamicResource FG_Black}"
Text="{lex:Loc ID_TXT_Interval}"
TextWrapping="Wrap" />
</Border>
<Border
Grid.Row="1"
Grid.Column="1"
Grid.ColumnSpan="2"
Padding="5,1"
Background="{Binding AlignerStatusBackground}"
BorderBrush="{DynamicResource Table_BD}"
BorderThickness="0,0,1,1">
<controls:TextBoxEx
Width="100"
Height="25"
EditBoxMode="UnSignInteger"
MaxValue="60000"
MinValue="100"
Text="{Binding TrendInterval, Mode=TwoWay}"
TextSaved="{Binding IntervalSaved, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Validation.ErrorTemplate="{x:Null}" />
</Border>
<Border
Grid.Row="1"
Grid.Column="3"
Padding="5,1"
Background="{DynamicResource Table_BG_Content}"
BorderBrush="{DynamicResource Table_BD}"
BorderThickness="0,0,1,1">
<Button
Width="70"
Height="25"
Margin="5,0,0,0"
Content="{lex:Loc ID_BTN_Set_Content}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<micro:ActionMessage MethodName="SetInterval" />
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
</Border>
<Border
Grid.Row="2"
Padding="5,1"
Background="{DynamicResource Table_BG_Title}"
BorderBrush="{DynamicResource Table_BD}"
BorderThickness="1,0,1,1">
<TextBlock
lex:ResxLocalizationProvider.DefaultDictionary="lang_datalogviews"
VerticalAlignment="Center"
FontFamily="Arial"
FontSize="12"
Foreground="{DynamicResource FG_Black}"
Text="{lex:Loc ID_TXT_TimeSpan}"
TextWrapping="Wrap" />
</Border>
<Border
Grid.Row="2"
Grid.Column="1"
Grid.ColumnSpan="2"
Padding="5,1"
Background="{Binding AlignerStatusBackground}"
BorderBrush="{DynamicResource Table_BD}"
BorderThickness="0,0,1,1">
<controls:TextBoxEx
Width="100"
Height="25"
EditBoxMode="UnSignInteger"
MaxValue="3600"
MinValue="1"
Text="{Binding TrendTimeSpan, Mode=TwoWay}"
TextSaved="{Binding TimeSpanSaved, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Validation.ErrorTemplate="{x:Null}" />
</Border>
<Border
Grid.Row="2"
Grid.Column="3"
Padding="5,1"
Background="{DynamicResource Table_BG_Content}"
BorderBrush="{DynamicResource Table_BD}"
BorderThickness="0,0,1,1">
<Button
Width="70"
Height="25"
Margin="5,0,0,0"
Content="{lex:Loc ID_BTN_Set_Content}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<micro:ActionMessage MethodName="SetTimeSpan" />
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
</Border>
</Grid>
</StackPanel>
<Grid
Grid.Row="0"
Grid.Column="2"
Margin="0,0,0,0">
<s:SciChartSurface
Name="sciChart"
Padding="2"
s:ThemeManager.Theme="ExpressionLight"
BorderBrush="Gray"
DebugWhyDoesntSciChartRender="False"
Focusable="False"
IsTabStop="False"
RenderableSeries="{Binding SelectedData}">
<!-- Create an X Axis -->
<s:SciChartSurface.XAxis>
<s:DateTimeAxis
Margin="0,0,0,0"
AutoRange="{Binding ChartAutoRange}"
DrawMinorGridLines="False"
DrawMinorTicks="False"
FontSize="14"
Id="DefaultAxisId"
SubDayTextFormatting="HH:mm:ss"
TextFormatting="HH:mm:ss"
TitleFontSize="15"
TitleFontWeight="Normal" />
</s:SciChartSurface.XAxis>
<!-- Create a Y Axis -->
<s:SciChartSurface.YAxis>
<s:NumericAxis
HorizontalAlignment="Center"
AutoRange="{Binding ChartAutoRange}"
AxisAlignment="Right"
BorderThickness="0"
CursorTextFormatting="0.######"
DrawLabels="True"
DrawMajorBands="False"
DrawMajorGridLines="True"
DrawMajorTicks="False"
DrawMinorGridLines="False"
DrawMinorTicks="False"
Focusable="False"
Id="DefaultAxisId"
MajorDelta="0.001"
MinorDelta="0.001">
<s:NumericAxis.GrowBy>
<s:DoubleRange Max="0.001" Min="0.001" />
</s:NumericAxis.GrowBy>
</s:NumericAxis>
</s:SciChartSurface.YAxis>
<s:SciChartSurface.ChartModifier>
<s:ModifierGroup>
<s:RubberBandXyZoomModifier
x:Name="rubberBandZoomModifier"
ExecuteOn="MouseLeftButton"
IsAnimated="True"
IsEnabled="True"
IsXAxisOnly="False"
ReceiveHandledEvents="True"
ZoomExtentsY="True" />
<s:CursorModifier
IsEnabled="True"
ShowAxisLabels="True"
ShowTooltip="False"
ShowTooltipOn="Never"
SourceMode="AllSeries" />
<s:LegendModifier
x:Name="legendModifier"
GetLegendDataFor="AllSeries"
ShowLegend="False" />
<s:ZoomExtentsModifier
x:Name="zoomExtentsModifier"
ExecuteOn="MouseDoubleClick"
XyDirection="XYDirection" />
<s:ZoomPanModifier
x:Name="zoomPanModifier"
ClipModeX="None"
ExecuteOn="MouseRightButton"
IsEnabled="True"
XyDirection="XYDirection"
ZoomExtentsY="False" />
<s:RolloverModifier
x:Name="rolloverModifier"
DrawVerticalLine="False"
FontFamily="Arial,SimSun"
FontSize="9"
IsEnabled="True"
ShowAxisLabels="False"
SnapsToDevicePixels="False"
UseInterpolation="False" />
<s:MouseWheelZoomModifier x:Name="mouseWheelZoomModifier" XyDirection="XYDirection" />
<s:SeriesValueModifier />
</s:ModifierGroup>
</s:SciChartSurface.ChartModifier>
</s:SciChartSurface>
<CheckBox
Margin="0,10,1208,0"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Content="Auto Zoom"
IsChecked="{Binding EnableAutoZoom, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
<Border
x:Name="btnScreenShot"
Margin="5,5,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Background="Transparent"
Cursor="Hand"
Opacity="0.4"
ToolTip="Fit to Screen">
<Button Width="35" Height="35" HorizontalAlignment="Center" VerticalAlignment="Center" BorderThickness="0">
<i:Interaction.Behaviors>
<userControls:PhotoShotBehavior Target="{Binding ElementName=sciChart}"/>
</i:Interaction.Behaviors>
<Button.Background>
<ImageBrush ImageSource="pack://application:,,,/Resources/Images/screenshot.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Border.Style>
<Style>
<Setter Property="Border.Opacity" Value="0.8" />
<Style.Triggers>
<Trigger Property="Border.IsMouseOver" Value="True">
<Setter Property="Border.Opacity" Value="1" />
</Trigger>
</Style.Triggers>
</Style>
</Border.Style>
</Border>
</Grid>
<userControls1:BusyIndicator
Grid.Row="1" Grid.Column="2"
Width="Auto"
Height="Auto"
HorizontalAlignment="Left"
VerticalAlignment="Center"
BorderBrush="Gray"
BorderThickness="3"
Padding="20 10"
Background="{StaticResource Tab_BG}"
Visibility="{Binding IsBusy, Converter={StaticResource BoolVisibilityConverter}}"
Message="{Binding BusyIndicatorContent}" Margin="350,0,0,0">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Canceled">
<micro:ActionMessage MethodName="Cancel" />
</i:EventTrigger>
</i:Interaction.Triggers>
</userControls1:BusyIndicator>
</Grid>
</UserControl>
@@ -0,0 +1,19 @@
using System;
using System.IO;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media.Imaging;
namespace MECF.Framework.UI.Client.CenterViews.Operations.RealTime
{
/// <summary>
/// RealtimeView.xaml 的交互逻辑
/// </summary>
public partial class RealtimeView : UserControl
{
public RealtimeView()
{
InitializeComponent();
}
}
}
@@ -0,0 +1,292 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using Aitex.Core.RT.Log;
using Aitex.Core.Util;
using Aitex.Core.Utilities;
using MECF.Framework.Common.DataCenter;
using MECF.Framework.UI.Client.CenterViews.Core;
using MECF.Framework.UI.Client.CenterViews.Core.Charting;
using MECF.Framework.UI.Client.CenterViews.Core.EventArgs;
using SciChart.Charting.Visuals.Axes;
using Sicentury.Core.EventArgs;
using Sicentury.Core.Tree;
namespace MECF.Framework.UI.Client.CenterViews.Operations.RealTime
{
public sealed class RealtimeViewModel : BusyIndicateableUiViewModelBase
{
#region Variables
/// <summary>
/// 允许监控的最大曲线数量
/// </summary>
private const int MAX_PARAMETERS_ALLOWED = 200;
private readonly RealtimeProvider _provider = new RealtimeProvider();
private bool _enableAutoZoom = true;
private int _pointCount;
private readonly PeriodicJob _thread;
/// <summary>
/// Monitor中添加数据点时直接向DataSeries对象添加,已实现跨线程操作。
/// </summary>
private readonly List<SicFastLineDataSeries> _dataSeriesList;
/// <summary>
/// 更新报告导出信息。
/// </summary>
private readonly IProgress<ProgressUpdatingEventArgs> _exportingProgressReporter;
#endregion
#region Constructors
public RealtimeViewModel()
{
DisplayName = "Realtime";
SelectedData = new ChartingLineSeriesCollection(DisplayName);
ParameterNodes = new TreeNode(DisplayName)
{
MaxTerminalSelectionAllowed = MAX_PARAMETERS_ALLOWED
};
ParameterNodes.ChildNodes.AddRange(_provider.GetParameters());
ParameterNodes.TerminalNodeSelectionChanged += OnNodeSelectionChanged;
IntervalSaved = true;
TrendInterval = 500;
TimeSpanSaved = true;
TrendTimeSpan = 60 * 5;
_thread = new PeriodicJob(TrendInterval, MonitorData, "RealTime", true);
_pointCount = Math.Max(TrendTimeSpan * 1000 / TrendInterval, 10);
_dataSeriesList = new List<SicFastLineDataSeries>();
_exportingProgressReporter = new Progress<ProgressUpdatingEventArgs>(e =>
{
BusyIndicatorContent = e.Message;
});
}
#endregion
#region Properties
public TreeNode ParameterNodes { get; }
public ChartingLineSeriesCollection SelectedData { get; set; }
public AutoRange ChartAutoRange => EnableAutoZoom ? AutoRange.Always : AutoRange.Never;
public bool EnableAutoZoom
{
get => _enableAutoZoom;
set
{
_enableAutoZoom = value;
NotifyOfPropertyChange(nameof(EnableAutoZoom));
NotifyOfPropertyChange(nameof(ChartAutoRange));
}
}
[IgnorePropertyChange]
public int TrendInterval { get; set; }
public bool IntervalSaved { get; set; }
[IgnorePropertyChange]
public int TrendTimeSpan { get; set; }
public bool TimeSpanSaved { get; set; }
#endregion
#region Methods
protected bool MonitorData()
{
try
{
Dictionary<string, object> data = null;
if (SelectedData.Count > 0)
{
data = QueryDataClient.Instance.Service.PollData(Array.ConvertAll(SelectedData.ToArray(), x => (x as SicFastLineSeries).DataName));
}
AppendData(data);
for (var j = 0; j < ParameterNodes.ChildNodes.Count; j++)
{
var par = ParameterNodes.ChildNodes[j];
par.IsVisibilityParentNode = Visibility.Hidden;
}
}
catch (Exception ex)
{
LOG.Error(ex.Message);
}
return true;
}
public void AppendData(Dictionary<string, object> data)
{
if (data == null)
return;
var dt = DateTime.Now;
foreach (var ds in _dataSeriesList)
{
if (ds == null || !data.ContainsKey(ds.SeriesName))
continue;
if (data[ds.SeriesName] is bool)
{
ds.Append(dt, ((bool)data[ds.SeriesName] ? 1 : 0) * ds.Factor + ds.Offset, new ParameterNodePoint(dt, ((bool)data[ds.SeriesName] ? 1 : 0)));
continue;
}
if (!double.TryParse(data[ds.SeriesName].ToString(), out var value))
continue;
ds.Append(dt, value * ds.Factor + ds.Offset, new ParameterNodePoint(dt, value));
}
}
private void UpdateFifoCapacity(int capacity)
{
foreach (var renderableSeries in SelectedData)
{
if (renderableSeries is SicFastLineSeries line)
{
var ds = line.GetDataSeries();
var copyMetaData = ds.Metadata.Where(x => x != null && ((ParameterNodePoint)x).Time > DateTime.Now.AddSeconds(-TrendTimeSpan)).ToList();
ds.FifoCapacity = capacity;
foreach (ParameterNodePoint item in copyMetaData)
{
ds.Append(item.Time, item.Value);
}
}
}
}
public void SetInterval()
{
_thread.ChangeInterval(TrendInterval);
_pointCount = Math.Max(10, TrendTimeSpan * 1000 / TrendInterval);
IntervalSaved = true;
NotifyOfPropertyChange(nameof(IntervalSaved));
UpdateFifoCapacity(_pointCount);
}
public void SetTimeSpan()
{
_pointCount = Math.Max(10, TrendTimeSpan * 1000 / TrendInterval);
TimeSpanSaved = true;
NotifyOfPropertyChange(nameof(TimeSpanSaved));
UpdateFifoCapacity(_pointCount);
}
#endregion
#region Events
public void OnNodeSelectionChanged(object sender, TreeNodeSelectionChangedEventArgs e)
{
if (e.NewValue == true && SelectedData.Count >= MAX_PARAMETERS_ALLOWED)
{
e.Cancel = true;
return;
}
var line = SelectedData.Cast<SicFastLineSeries>().FirstOrDefault(x => x.DataName == e.Source.FullName);
switch (e.NewValue)
{
case false:
{
if (line != null)
{
_dataSeriesList.Remove(line.GetDataSeries());
SelectedData.Remove(line);
}
break;
}
case true:
{
if (line == null)
{
var series = new SicFastLineSeries(e.Source.FullName)
{
BackendParameterNode = e.Source
};
series.GetDataSeries().FifoCapacity = _pointCount;
SelectedData.Add(series);
_dataSeriesList.Add(series.GetDataSeries());
SelectedData.ResetColors();
}
break;
}
default:
break;
}
}
public void Deleted(object sender, RenderableSeriesDeletingEventArgs e)
{
var list = e.Source.Cast<SicFastLineSeries>().ToList();
//var total = SelectedData.Count;
for (var i = list.Count - 1; i >= 0; i--)
{
// 清除左侧Tree中的选中状态
list[i].BackendParameterNode.IsSelected = false;
_dataSeriesList.Remove(list[i].GetDataSeries());
}
((RealtimeView)View).tvParameterNodes.ClearPresetGroupSelectionOnly();
}
public void Exporting(object sender, EventArgs e)
{
BusyIndicatorContent = "Exporting ...";
IsBusy = true;
}
public void Exported(object sender, EventArgs e)
{
IsBusy = false;
}
public void ProgressUpdating(object sender, ProgressUpdatingEventArgs e)
{
_exportingProgressReporter.Report(e);
}
public override void Cancel()
{
if (View is RealtimeView view)
{
view.dataGrid.CancelOperation();
}
}
#endregion
}
}
@@ -0,0 +1,116 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Aitex.Core.RT.Log;
using MECF.Framework.Common.DataCenter;
using MECF.Framework.UI.Client.CenterViews.Core;
using OpenSEMI.ClientBase.ServiceProvider;
using Sicentury.Core.Tree;
namespace MECF.Framework.UI.Client.CenterViews.Operations.RealTime
{
public class RealtimeProvider : IProvider
{
/// <summary>
/// 使用字符串队列创建树结构的分支。
/// </summary>
/// <param name="branchString"></param>
/// <param name="node"></param>
private static TreeNode CreateTreeBranch(Queue<string> branchString, TreeNode node)
{
var rootNode = node;
while (true)
{
if (branchString.Count <= 0)
return rootNode;
var name = branchString.Dequeue();
if (node == null)
{
// 根节点
node = new TreeNode(name);
rootNode = node;
}
else
{
if(node.Name == name)
continue;
// 向ChildNode插入
var subNode = node.ChildNodes.FirstOrDefault(x => x.Name == name);
if (subNode == null)
{
subNode = new TreeNode(name);
node.ChildNodes.Add(subNode);
}
node = subNode;
}
}
}
public void Create()
{
}
public List<string> GetUserDefineParameters()
{
var typedContents = ((string)QueryDataClient.Instance.Service.GetTypedConfigContent("UserDefine", ""));
var dataList = new List<string>();
if (typedContents != null)
{
var contentList = typedContents.Split(',').ToList();
contentList.ForEach(x => { if (!string.IsNullOrEmpty(x)) dataList.Add($"{x}"); });
}
return dataList;
}
public List<TreeNode> GetParameters()
{
var root = new List<TreeNode>();
try
{
var dataList = (List<string>)QueryDataClient.Instance.Service.GetConfig("System.NumericDataList");
//var typedContents = QueryDataClient.Instance.Service.GetTypedConfigContent("UserDefine", "");
//if (string.IsNullOrEmpty(typedContents))
//{
// dataList.Add($"UserDefine");
//}
//else
//{
// var contentList = typedContents.Split(',').ToList();
// contentList.ForEach(x =>
// {
// if (!string.IsNullOrEmpty(x)) dataList.Add($"UserDefine.{x}");
// });
//}
dataList.Sort();
foreach (var dataName in dataList)
{
var nodeName = new Queue<string>(dataName.Split('.'));
if (nodeName.Count <= 0)
continue;
// 开始创建Tree分支
var rootNode = root.FirstOrDefault(x => x.Name == nodeName.Peek());
var node = CreateTreeBranch(nodeName, rootNode);
if(rootNode == null)
root.Add(node);
}
}
catch (Exception ex)
{
LOG.Write(ex);
}
return root;
}
}
}
@@ -0,0 +1,69 @@
<UserControl x:Class="MECF.Framework.UI.Client.CenterViews.Operations.WaferAssociation.SequenceDialogView"
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"
mc:Ignorable="d"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:micro="clr-namespace:Caliburn.Micro"
Width="350"
Height="500">
<UserControl.Resources>
<HierarchicalDataTemplate x:Key="FileTemplate" ItemsSource="{Binding Files}">
<StackPanel>
<TextBlock Text="{Binding Name}" />
</StackPanel>
</HierarchicalDataTemplate>
</UserControl.Resources>
<Border BorderBrush="Gray" BorderThickness="0,1,0,0" Background="{DynamicResource Tab_BG}">
<Grid Margin="20,30">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1" Background="{DynamicResource Table_BG_Content_Highlight}">
<TreeView x:Name="PART_TREE" Margin="5" ItemsSource="{Binding Files[0].Files}" ItemTemplate="{StaticResource FileTemplate}"
VirtualizingPanel.IsVirtualizing="True" VirtualizingPanel.VirtualizationMode="Recycling"
Height="{Binding Path=ActualHeight,ElementName=PART_BORDER, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}">
<!--Height should add for VirtualizingPanel, otherwise the App will be slow-->
<TreeView.ItemContainerStyle>
<Style TargetType="{x:Type TreeViewItem}" BasedOn="{StaticResource ResourceKey={x:Type TreeViewItem}}">
<Setter Property="IsExpanded" Value="True"></Setter>
</Style>
</TreeView.ItemContainerStyle>
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectedItemChanged">
<micro:ActionMessage MethodName="TreeSelectChanged">
<micro:Parameter Value="{Binding SelectedItem, ElementName=PART_TREE}" />
</micro:ActionMessage>
</i:EventTrigger>
<i:EventTrigger EventName="MouseDoubleClick">
<micro:ActionMessage MethodName="TreeMouseDoubleClick">
<micro:Parameter Value="{Binding SelectedItem, ElementName=PART_TREE}" />
</micro:ActionMessage>
</i:EventTrigger>
</i:Interaction.Triggers>
</TreeView>
</Border>
<StackPanel Grid.Row="1" Margin="0,10,0,0" Orientation="Horizontal" HorizontalAlignment="Center">
<Button Content="OK" Width="90" Height="30">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<micro:ActionMessage MethodName="OK">
</micro:ActionMessage>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
<Button Content="Cancel" Margin="10,0,0,0" Width="90" Height="30">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<micro:ActionMessage MethodName="Cancel">
</micro:ActionMessage>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
</StackPanel>
</Grid>
</Border>
</UserControl>
@@ -0,0 +1,15 @@
using System.Windows.Controls;
namespace MECF.Framework.UI.Client.CenterViews.Operations.WaferAssociation
{
/// <summary>
/// Interaction logic for SequenceDialogView.xaml
/// </summary>
public partial class SequenceDialogView : UserControl
{
public SequenceDialogView()
{
InitializeComponent();
}
}
}
@@ -0,0 +1,42 @@
using System.Collections.ObjectModel;
using MECF.Framework.UI.Client.CenterViews.Editors.Sequence;
using OpenSEMI.ClientBase;
namespace MECF.Framework.UI.Client.CenterViews.Operations.WaferAssociation
{
public class SequenceDialogViewModel : DialogViewModel<string>
{
public void TreeSelectChanged(FileNode file)
{
this.currentFileNode = file;
}
public void TreeMouseDoubleClick(FileNode file)
{
this.currentFileNode = file;
OK();
}
public void OK()
{
if (this.currentFileNode != null)
{
if (this.currentFileNode.IsFile)
{
this.DialogResult = this.currentFileNode.FullPath;
IsCancel = false;
TryClose(true);
}
}
}
public void Cancel()
{
IsCancel = true;
TryClose(false);
}
public ObservableCollection<FileNode> Files { get; set; }
private FileNode currentFileNode;
}
}
@@ -0,0 +1,133 @@
using Caliburn.Micro.Core;
using MECF.Framework.UI.Client.ClientBase;
using OpenSEMI.ClientBase;
namespace MECF.Framework.UI.Client.CenterViews.Operations.WaferAssociation
{
public class WaferAssociationInfo : PropertyChangedBase
{
private int _slotFrom = 1;
public int SlotFrom
{
get { return _slotFrom; }
set { _slotFrom = value; NotifyOfPropertyChange("SlotFrom"); }
}
private int _slotTo = 25;
public int SlotTo
{
get { return _slotTo; }
set { _slotTo = value; NotifyOfPropertyChange("SlotTo"); }
}
private string _sequenceName = string.Empty;
public string SequenceName
{
get { return _sequenceName; }
set { _sequenceName = value; NotifyOfPropertyChange("SequenceName"); }
}
private string _lotId = string.Empty;
public string LotId
{
get { return _lotId; }
set { _lotId = value; NotifyOfPropertyChange("LotId"); }
}
private bool _LotIdSaved = true;
public bool LotIdSaved
{
get { return _LotIdSaved; }
set { _LotIdSaved = value; NotifyOfPropertyChange("LotIdSaved"); }
}
private string _JobID = string.Empty;
public string JobID
{
get { return _JobID; }
set { _JobID = value; NotifyOfPropertyChange("JobID"); }
}
private ModuleInfo _ModuleData;
public ModuleInfo ModuleData
{
get { return _ModuleData; }
set { _ModuleData = value; NotifyOfPropertyChange("ModuleData"); }
}
private string _JobStatus = string.Empty;
public string JobStatus
{
get { return _JobStatus; }
set { _JobStatus = value;
NotifyOfPropertyChange("JobStatus");
NotifyOfPropertyChange("IsEnableSelect");
NotifyOfPropertyChange("IsEnableCreate");
NotifyOfPropertyChange("IsEnableAbort");
NotifyOfPropertyChange("IsEnableStart");
NotifyOfPropertyChange("IsEnablePause");
NotifyOfPropertyChange("IsEnableResume");
NotifyOfPropertyChange("IsEnableStop");
}
}
public bool IsEnableSelect
{
//get { return !IsCreated; }
get { return true; }
}
public bool IsEnableCreate
{
get { return true; }
}
public bool IsEnableAbort
{
get { return IsCreated; }
}
public bool IsEnableStart
{
get { return IsCreated /*&& IsWaitingForStart*/; }
}
public bool IsEnablePause
{
get { return IsExecuting; }
}
public bool IsEnableResume
{
get { return IsPaused; }
}
public bool IsEnableStop
{
get { return IsExecuting || IsPaused; }
}
private bool IsCreated
{
get { return !string.IsNullOrEmpty(JobStatus); }
}
private bool IsExecuting
{
get { return JobStatus== "Executing"; }
}
private bool IsWaitingForStart
{
get { return JobStatus == "WaitingForStart"; }
}
private bool IsPaused
{
get { return JobStatus == "Paused"; }
}
private bool IsCompleted
{
get { return JobStatus == "Completed"; }
}
//Queued,Selected,WaitingForStart,Executing,Paused,Completed,
}
}
@@ -0,0 +1,88 @@
using System.Collections.Generic;
using MECF.Framework.Common.OperationCenter;
using OpenSEMI.ClientBase.ServiceProvider;
namespace MECF.Framework.UI.Client.CenterViews.Operations.WaferAssociation
{
public class WaferAssociationProvider : IProvider
{
private static WaferAssociationProvider _Instance = null;
public static WaferAssociationProvider Instance
{
get
{
if (_Instance == null)
_Instance = new WaferAssociationProvider();
return _Instance;
}
}
public void Create()
{
}
public void CreateJob(string jobId, string module, List<string> slotSequence, bool autoStart, bool isCycleMode, int waferCount)
{
Dictionary<string, object> param = new Dictionary<string, object>()
{
{"JobId", jobId},
{"Module", module},
{"SlotSequence", slotSequence.ToArray()},
{"AutoStart", autoStart},
{"IsCycleMode", isCycleMode},
{"WaferCount", waferCount},
};
InvokeClient.Instance.Service.DoOperation("System.CreateJob", param);
}
public void CreateJob(string jobId, string module, List<string> slotSequence, string lotId, bool autoStart )
{
Dictionary<string, object> param = new Dictionary<string, object>()
{
{"JobId", jobId},
{"Module", module},
{"SlotSequence", slotSequence.ToArray()},
{"LotId", lotId},
{"AutoStart", autoStart},
};
InvokeClient.Instance.Service.DoOperation("System.CreateJob", param);
}
public void AbortJob(string jobID)
{
var param = new object[] { jobID };
InvokeClient.Instance.Service.DoOperation("System.AbortJob", param);
}
public void AbortSingleJob(string jobName, string waferID)
{
InvokeClient.Instance.Service.DoOperation("System.AbortSingleJob", jobName, waferID);
}
public void Start(string jobID)
{
var param = new object[] { jobID };
InvokeClient.Instance.Service.DoOperation("System.StartJob", param);
}
public void Pause(string jobID)
{
var param = new object[] { jobID };
InvokeClient.Instance.Service.DoOperation("System.PauseJob", param);
}
public void Resume(string jobID)
{
var param = new object[] { jobID };
InvokeClient.Instance.Service.DoOperation("System.ResumeJob", param);
}
public void Stop(string jobID)
{
var param = new object[] { jobID };
InvokeClient.Instance.Service.DoOperation("System.StopJob", param);
}
}
}
@@ -0,0 +1,439 @@
<UserControl
x:Class="MECF.Framework.UI.Client.CenterViews.Operations.WaferAssociation.WaferAssociationUnit"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:OpenSEMI.Ctrlib.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:micro="clr-namespace:Caliburn.Micro"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:lex="http://wpflocalizeextension.codeplex.com"
lex:LocalizeDictionary.DesignCulture="zh"
lex:ResxLocalizationProvider.DefaultAssembly="Sicentury.Localization"
lex:ResxLocalizationProvider.DefaultDictionary="lang_overview"
mc:Ignorable="d"
d:Background="White">
<UserControl.Resources>
<Style TargetType="ToolTip">
<Style.Triggers>
<Trigger Property="Content" Value="{x:Static sys:String.Empty}">
<Setter Property="Visibility" Value="Collapsed" />
</Trigger>
</Style.Triggers>
</Style>
</UserControl.Resources>
<Grid VerticalAlignment="Top">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="24" />
<RowDefinition Height="24" />
<RowDefinition Height="Auto" />
<RowDefinition Height="24" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal">
<Border
Width="90"
Padding="5,1"
Background="{DynamicResource Table_BG_Title}"
BorderBrush="{DynamicResource Table_BD}"
BorderThickness="1">
<TextBlock
VerticalAlignment="Center"
FontFamily="Arial"
FontSize="12"
Foreground="{DynamicResource FG_Black}"
Text="{lex:Loc ID_TXT_JobAssign_LotID}"
TextWrapping="Wrap" />
</Border>
<Border
Width="235"
Padding="5,1"
Background="{DynamicResource Table_BG_Content}"
BorderBrush="{DynamicResource Table_BD}"
BorderThickness="0,1,1,1">
<StackPanel Orientation="Horizontal">
<controls:TextBoxEx
Width="138"
Text="{Binding WAInfo.LotId, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"
TextSaved="{Binding WAInfo.LotIdSaved, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Mode=TwoWay}" />
</StackPanel>
</Border>
</StackPanel>
<StackPanel Grid.Row="1" Orientation="Horizontal">
<Border
Width="90"
Padding="5,1"
Background="{DynamicResource Table_BG_Title}"
BorderBrush="{DynamicResource Table_BD}"
BorderThickness="1,0,1,1">
<TextBlock
VerticalAlignment="Center"
FontFamily="Arial"
FontSize="12"
Foreground="{DynamicResource FG_Black}"
Text="{lex:Loc ID_TXT_JobAssign_Sequence}"
TextWrapping="Wrap" />
</Border>
<Border
Width="235"
Padding="5,1"
Background="{DynamicResource Table_BG_Content}"
BorderBrush="{DynamicResource Table_BD}"
BorderThickness="0,0,1,1">
<StackPanel Orientation="Horizontal">
<TextBox
Width="138"
IsReadOnly="True"
Text="{Binding WAInfo.SequenceName, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" />
<Button
Name="ID_BTN_JobAssign_SelectSequence"
Width="80"
Margin="5,0,0,0"
Padding="0"
Content="{lex:Loc}"
IsEnabled="{Binding WAInfo.IsEnableSelect, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<micro:ActionMessage MethodName="SelectSequence">
<micro:Parameter Value="{Binding WAInfo, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" />
</micro:ActionMessage>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
</StackPanel>
</Border>
</StackPanel>
<StackPanel
Grid.Row="2"
Margin="0,2"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Orientation="Horizontal">
<Button
Name="ID_BTN_JobAssign_SetAll"
Width="160"
Height="25"
Content="{lex:Loc}"
IsEnabled="{Binding WAInfo.IsEnableSelect, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<micro:ActionMessage MethodName="SetAll">
<micro:Parameter Value="{Binding WAInfo, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" />
</micro:ActionMessage>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
<Button
Name="ID_BTN_JobAssign_ResetAll"
Width="160"
Height="25"
Margin="5,0,0,0"
Content="{lex:Loc}"
IsEnabled="{Binding WAInfo.IsEnableSelect, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<micro:ActionMessage MethodName="DeselectAll">
<micro:Parameter Value="{Binding WAInfo, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" />
</micro:ActionMessage>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
</StackPanel>
<StackPanel Grid.Row="3" Orientation="Horizontal">
<Border
Width="60"
Background="{DynamicResource Table_BG_Title}"
BorderBrush="{DynamicResource Table_BD}"
BorderThickness="1">
<TextBlock
VerticalAlignment="Center"
FontFamily="Arial"
FontSize="12"
TextAlignment="Center"
Foreground="{DynamicResource FG_Black}"
Text="{lex:Loc ID_TXT_JobAssign_Name}"
d:Text="Job Name"
TextWrapping="Wrap" />
</Border>
<Border
Width="103"
Padding="5,1"
Background="{DynamicResource Table_BG_Content}"
BorderBrush="{DynamicResource Table_BD}"
BorderThickness="0,1,1,1">
<TextBlock
x:Name="txtJobID"
Width="Auto"
Height="20"
VerticalAlignment="Center"
FontFamily="Arial"
FontSize="12"
Foreground="{DynamicResource FG_Black}"
Text="{Binding WAInfo.JobID, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" />
</Border>
<Border
Width="60"
Background="{DynamicResource Table_BG_Title}"
BorderBrush="{DynamicResource Table_BD}"
BorderThickness="0,1,1,1">
<TextBlock
VerticalAlignment="Center"
FontFamily="Arial"
FontSize="12"
TextAlignment="Center"
Foreground="{DynamicResource FG_Black}"
Text="{lex:Loc ID_TXT_JobAssign_Status}"
d:Text="Job Status"
TextWrapping="Wrap" />
</Border>
<Border
Width="102"
Padding="5,1"
Background="{DynamicResource Table_BG_Content}"
BorderBrush="{DynamicResource Table_BD}"
BorderThickness="0,1,1,1">
<TextBlock
Width="Auto"
Height="20"
VerticalAlignment="Center"
FontFamily="Arial"
FontSize="12"
Foreground="{DynamicResource FG_Black}"
Text="{Binding WAInfo.JobStatus, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" />
</Border>
</StackPanel>
<StackPanel
Grid.Row="4"
Margin="0,2"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Orientation="Horizontal">
<Button
Name="ID_BTN_JobAssign_Create"
Width="160"
Height="25"
Content="{lex:Loc}"
IsEnabled="{Binding WAInfo.IsEnableCreate, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<micro:ActionMessage MethodName="CreateJob">
<micro:Parameter Value="{Binding WAInfo, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" />
</micro:ActionMessage>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
<Button
Name="ID_BTN_JobAssign_Abort"
Width="160"
Height="25"
Margin="5,0,0,0"
Content="{lex:Loc}"
IsEnabled="{Binding WAInfo.IsEnableAbort, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<micro:ActionMessage MethodName="AbortJob">
<micro:Parameter Value="{Binding ElementName=txtJobID, Path=Text}" />
</micro:ActionMessage>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
</StackPanel>
<StackPanel
Grid.Row="5"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Orientation="Horizontal">
<Button
Name="ID_BTN_JobAssign_Start"
Width="78"
Height="25"
Content="{lex:Loc}"
IsEnabled="{Binding WAInfo.IsEnableStart, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<micro:ActionMessage MethodName="Start">
<micro:Parameter Value="{Binding ElementName=txtJobID, Path=Text}" />
</micro:ActionMessage>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
<Button
Name="ID_BTN_JobAssign_Pause"
Width="78"
Height="25"
Margin="5,0,0,0"
Content="{lex:Loc}"
IsEnabled="{Binding WAInfo.IsEnablePause, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<micro:ActionMessage MethodName="Pause">
<micro:Parameter Value="{Binding ElementName=txtJobID, Path=Text}" />
</micro:ActionMessage>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
<Button
Name="ID_BTN_JobAssign_Resume"
Width="78"
Height="25"
Margin="5,0,0,0"
Content="{lex:Loc}"
IsEnabled="{Binding WAInfo.IsEnableResume, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<micro:ActionMessage MethodName="Resume">
<micro:Parameter Value="{Binding ElementName=txtJobID, Path=Text}" />
</micro:ActionMessage>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
<Button
Name="ID_BTN_JobAssign_Stop"
Width="77"
Height="25"
Margin="5,0,0,0"
Content="{lex:Loc}"
IsEnabled="{Binding WAInfo.IsEnableStop, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<micro:ActionMessage MethodName="Stop">
<micro:Parameter Value="{Binding ElementName=txtJobID, Path=Text}" />
</micro:ActionMessage>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
</StackPanel>
</Grid>
<ListBox
Grid.Row="1"
Margin="0,0"
Focusable="False"
ItemsSource="{Binding WAInfo.ModuleData.WaferManager.Wafers, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}">
<ListBox.Resources>
<Style BasedOn="{StaticResource ResourceKey={x:Type ListBoxItem}}" TargetType="ListBoxItem">
<Setter Property="Rectangle.StrokeThickness" Value="0" />
</Style>
</ListBox.Resources>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Height="22"
lex:LocalizeDictionary.DesignCulture="zh"
lex:ResxLocalizationProvider.DefaultAssembly="Sicentury.Localization"
lex:ResxLocalizationProvider.DefaultDictionary="lang_overview">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<!--<ColumnDefinition Width="Auto"></ColumnDefinition>-->
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Border
Width="40"
Padding="5,1"
Background="{DynamicResource Table_BG_Content_Highlight}"
BorderBrush="{DynamicResource Table_BD}"
BorderThickness="1">
<TextBlock
Name="txtSlotIndex"
VerticalAlignment="Center"
FontFamily="Arial"
FontSize="12"
Foreground="{DynamicResource FG_Black}"
Text="{Binding SlotIndex}" />
</Border>
<!--<Border Grid.Column="1" BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Title}" Width="50" Padding="5,1">
<TextBlock Text="{Binding WaferID}" ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Text}" Foreground="{DynamicResource FG_Black}" FontSize="12" FontFamily="Arial" VerticalAlignment="Center"></TextBlock>
</Border>-->
<Border
Grid.Column="1"
Width="190"
Padding="5,1"
BorderBrush="{DynamicResource Table_BD}"
BorderThickness="0,1,1,1">
<Border.Style>
<Style>
<Style.Triggers>
<DataTrigger Binding="{Binding WaferStatus}" Value="0">
<Setter Property="Border.Background" Value="{DynamicResource Table_BG_Content_Highlight}" />
</DataTrigger>
<DataTrigger Binding="{Binding WaferStatus}" Value="1">
<Setter Property="Border.Background" Value="SkyBlue" />
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
<TextBlock
Name="txtSeqName"
VerticalAlignment="Center"
FontFamily="Arial"
FontSize="12"
Foreground="{DynamicResource FG_Black}"
Text="{Binding SequenceName}"
ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Text}" />
</Border>
<Border
Grid.Column="2"
Width="95"
Padding="5,1"
Background="{DynamicResource Table_BG_Content_Highlight}"
BorderBrush="{DynamicResource Table_BD}"
BorderThickness="0,1,1,1">
<Button
Width="80"
Margin="0,-2"
FontSize="11"
IsEnabled="{Binding WAInfo.IsEnableCreate, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<micro:ActionMessage MethodName="SetSequence">
<micro:Parameter Value="{Binding WAInfo, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" />
<micro:Parameter Value="{Binding SlotIndex}" />
<micro:Parameter Value="{Binding SequenceName}" />
</micro:ActionMessage>
</i:EventTrigger>
</i:Interaction.Triggers>
<Button.Style>
<Style BasedOn="{StaticResource ResourceKey={x:Type Button}}" TargetType="{x:Type Button}">
<Setter Property="Content" Value="{lex:Loc ID_BTN_JobAssign_Remove_Content}" />
<Setter Property="ToolTip" Value="{lex:Loc ID_BTN_JobAssign_Remove_ToolTip}" />
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=txtSeqName, Path=Text}" Value="{x:Static sys:String.Empty}">
<Setter Property="Content" Value="{lex:Loc ID_BTN_JobAssign_Set_Content}" />
<Setter Property="ToolTip" Value="{lex:Loc ID_BTN_JobAssign_Set_ToolTip}" />
</DataTrigger>
<DataTrigger Binding="{Binding WaferStatus}" Value="0">
<Setter Property="IsEnabled" Value="False" />
</DataTrigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
</Border>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Grid>
<Grid.Style>
<Style>
<Style.Triggers>
<DataTrigger Binding="{Binding WAInfo.ModuleData.IsInstalled, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" Value="false">
<Setter Property="Grid.Visibility" Value="Collapsed" />
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Style>
</Grid>
</Grid>
</UserControl>
@@ -0,0 +1,23 @@
using System.Windows;
using System.Windows.Controls;
namespace MECF.Framework.UI.Client.CenterViews.Operations.WaferAssociation
{
/// <summary>
/// Interaction logic for WaferAssociationUnit.xaml
/// </summary>
public partial class WaferAssociationUnit : UserControl
{
public WaferAssociationUnit()
{
InitializeComponent();
}
public WaferAssociationInfo WAInfo
{
get { return (WaferAssociationInfo)GetValue(WAInfoProperty); }
set { SetValue(WAInfoProperty, value); }
}
public static readonly DependencyProperty WAInfoProperty = DependencyProperty.Register("WAInfo", typeof(WaferAssociationInfo), typeof(WaferAssociationUnit), new UIPropertyMetadata(null));
}
}
@@ -0,0 +1,30 @@
<UserControl x:Class="StripUI.Client.Models.Operate.WaferAssociationView"
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:wa="clr-namespace:StripUI.Client.Models.Operate"
xmlns:waferAssociation="clr-namespace:MECF.Framework.UI.Client.CenterViews.Operations.WaferAssociation">
<Grid HorizontalAlignment="Left" VerticalAlignment="Top">
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<TabControl>
<TabItem Header="{Binding LP1.ModuleData.ModuleID}">
<waferAssociation:WaferAssociationUnit x:Name="LP1" WAInfo="{Binding LP1}"></waferAssociation:WaferAssociationUnit>
</TabItem>
</TabControl>
<TabControl Grid.Column="1" Margin="10,0,0,0">
<TabItem Header="{Binding LP2.ModuleData.ModuleID}">
<waferAssociation:WaferAssociationUnit x:Name="LP2" Margin="10,0,0,0" WAInfo="{Binding LP2}" ></waferAssociation:WaferAssociationUnit>
</TabItem>
</TabControl>
<TabControl Grid.Column="2" Margin="10,0,0,0">
<TabItem Header="{Binding LP2.ModuleData.ModuleID}">
<waferAssociation:WaferAssociationUnit x:Name="LP3" Margin="10,0,0,0" WAInfo="{Binding LP3}" ></waferAssociation:WaferAssociationUnit>
</TabItem>
</TabControl>
</Grid>
</UserControl>
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace StripUI.Client.Models.Operate
{
/// <summary>
/// Interaction logic for WaferAssociationView.xaml
/// </summary>
public partial class WaferAssociationView : UserControl
{
public WaferAssociationView()
{
InitializeComponent();
}
}
}
@@ -0,0 +1,210 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using Caliburn.Micro;
using MECF.Framework.Common.RecipeCenter;
using MECF.Framework.UI.Client.CenterViews.Editors.Sequence;
using MECF.Framework.UI.Client.ClientBase;
using OpenSEMI.ClientBase;
namespace MECF.Framework.UI.Client.CenterViews.Operations.WaferAssociation
{
public class WaferAssociationViewModel : BaseModel
{
private WaferAssociationInfo _LP1;
public WaferAssociationInfo LP1
{
get { return _LP1; }
set { _LP1 = value; }
}
private WaferAssociationInfo _LP2;
public WaferAssociationInfo LP2
{
get { return _LP2; }
set { _LP2 = value; }
}
private WaferAssociationInfo _LP3;
public WaferAssociationInfo LP3
{
get { return _LP3; }
set { _LP3 = value; }
}
protected override void OnInitialize()
{
base.OnInitialize();
#region test data
LP1 = new WaferAssociationInfo();
LP1.ModuleData = ModuleManager.ModuleInfos["LP1"];
LP2 = new WaferAssociationInfo();
LP2.ModuleData = ModuleManager.ModuleInfos["LP2"];
LP3 = new WaferAssociationInfo();
LP3.ModuleData = ModuleManager.ModuleInfos["LP3"];
#endregion
}
#region functions
#region Sequence operation
public void SelectSequence(WaferAssociationInfo info)
{
SequenceDialogViewModel dialog = new SequenceDialogViewModel();
dialog.DisplayName = "Select Sequence";
dialog.Files = new ObservableCollection<FileNode>(RecipeSequenceTreeBuilder.GetFiles("",
RecipeClient.Instance.Service.GetSequenceNameList()
));
WindowManager wm = new WindowManager();
bool? bret = wm.ShowDialog(dialog);
if ((bool)bret)
{
info.SequenceName = dialog.DialogResult;
}
}
public void SetSlot(WaferAssociationInfo info)
{
if (InputSlotCheck(info.SlotFrom, info.SlotTo))
AssociateSequence(info, true);
}
public void SkipSlot(WaferAssociationInfo info)
{
if (InputSlotCheck(info.SlotFrom, info.SlotTo))
AssociateSequence(info, false);
}
public void SetAll(WaferAssociationInfo info)
{
info.SlotFrom = 1;
info.SlotTo = 25;
AssociateSequence(info, true);
}
public void DeselectAll(WaferAssociationInfo info)
{
info.SlotFrom = 1;
info.SlotTo = 25;
AssociateSequence(info, false);
}
public void SetSequence(WaferAssociationInfo info, int slotIndex, string seqName)
{
bool flag = string.IsNullOrEmpty(seqName);
AssociateSequence(info, flag, slotIndex - 1);
}
private bool InputSlotCheck(int from, int to)
{
if (from > to)
{
DialogBox.ShowInfo("This index of from slot should be large than the index of to slot.");
return false;
}
if (from < 1 || to > 25)
{
DialogBox.ShowInfo("This input value for from should be between 1 and 25.");
return false;
}
return true;
}
private void AssociateSequence(WaferAssociationInfo info, bool flag, int slot = -1)
{
ObservableCollection<WaferInfo> wafers = info.ModuleData.WaferManager.Wafers;
if (slot >= 0) //by wafer
{
int index = wafers.Count - slot - 1;
if (index < wafers.Count)
{
if (flag && HasWaferOnSlot(wafers.ToList(), index))
wafers[index].SequenceName = info.SequenceName;
else
wafers[index].SequenceName = string.Empty;
}
}
else //by from-to
{
for (int i = info.SlotFrom - 1; i < info.SlotTo; i++)
{
int index = wafers.Count - i - 1;
if (index < wafers.Count)
{
if (flag && HasWaferOnSlot(wafers.ToList(), index))
wafers[index].SequenceName = info.SequenceName;
else
wafers[index].SequenceName = string.Empty;
}
}
}
}
private bool HasWaferOnSlot(List<WaferInfo> wafers, int index)
{
if (wafers[index].WaferStatus == 0)
return false;
return true;
}
#endregion
#region Job operation
private bool JobCheck(string jobID)
{
if (jobID.Length == 0)
{
DialogBox.ShowWarning("Please create job first.");
return false;
}
else
return true;
}
public void CreateJob(WaferAssociationInfo info)
{
List<object> param = new List<object>();
param.Add(info.ModuleData.ModuleID);
foreach (var wafer in info.ModuleData.WaferManager.Wafers)
{
param.Add(wafer.SequenceName);
}
param.Add(false); //auto start
//WaferAssociationProvider.Instance.CreateJob(param.ToArray());
}
public void AbortJob(string jobID)
{
if (JobCheck(jobID))
WaferAssociationProvider.Instance.AbortJob(jobID);
}
public void Start(string jobID)
{
if (JobCheck(jobID))
WaferAssociationProvider.Instance.Start(jobID);
}
public void Pause(string jobID)
{
if (JobCheck(jobID))
WaferAssociationProvider.Instance.Pause(jobID);
}
public void Resume(string jobID)
{
if (JobCheck(jobID))
WaferAssociationProvider.Instance.Resume(jobID);
}
public void Stop(string jobID)
{
if (JobCheck(jobID))
WaferAssociationProvider.Instance.Stop(jobID);
}
#endregion
#endregion
}
}