refactor: 将Framework库和RT、UI放在同一个解决方案中。
This commit is contained in:
+207
@@ -0,0 +1,207 @@
|
||||
<UserControl x:Class="MECF.Framework.UI.Client.CenterViews.Editors.Recipe.PopSettingDialogView"
|
||||
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:micro="clr-namespace:Caliburn.Micro"
|
||||
xmlns:editors="clr-namespace:MECF.Framework.UI.Client.CenterViews.Editors"
|
||||
xmlns:controls="clr-namespace:OpenSEMI.Ctrlib.Controls"
|
||||
xmlns:local="clr-namespace:MECF.Framework.UI.Client.CenterViews.Editors.Recipe"
|
||||
mc:Ignorable="d"
|
||||
Width="600"
|
||||
Height="800">
|
||||
<UserControl.Resources>
|
||||
<HierarchicalDataTemplate x:Key="FolderTemplate" ItemsSource="{Binding Files}" >
|
||||
<StackPanel Orientation="Horizontal" Tag="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UserControl}, Path=DataContext}">
|
||||
<Image x:Name="ExpandImage" Source="/MECF.Framework.UI.Client;component/Resources/Images/Folder_Close.png" Width="14" Height="12" Margin="2,0,0,0" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="{Binding Name}" Margin="5,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left"/>
|
||||
</StackPanel>
|
||||
<HierarchicalDataTemplate.Triggers>
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
<Setter Property="Image.Source" TargetName="ExpandImage" Value="/MECF.Framework.UI.Client;component/Resources/Images/Folder_Unable.png"/>
|
||||
</Trigger>
|
||||
</HierarchicalDataTemplate.Triggers>
|
||||
</HierarchicalDataTemplate>
|
||||
<HierarchicalDataTemplate x:Key="FileTemplate" ItemsSource="{Binding Files}">
|
||||
<StackPanel Orientation="Horizontal" Tag="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UserControl}, Path=DataContext}">
|
||||
<Path Data="M0.5,5.125 L5.125,5.125 5.125,0.5 M5.1,0.5 L15.5,0.5 15.5,19.5 0.5,19.5 C0.5,14.7 0.5,10 0.5,5.1 2,3.6 3.6,2 5.1,0.5 z M8.1,8.5 L8.2,8.5 z M8.1,11.5 L8.2,11.5 z M8.1,14.5 L8.2,14.5 z" Fill="#FFF3F3F3" HorizontalAlignment="Left" Stretch="Fill" Stroke="#FF454545" Width="13" Height="16"/>
|
||||
<TextBlock Text="{Binding Name}" Margin="5,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Left"/>
|
||||
</StackPanel>
|
||||
</HierarchicalDataTemplate>
|
||||
<editors:FolderOrFileTemplateSelector x:Key="FolderFileTemplateSelector" FolderTemplate="{StaticResource FolderTemplate}" FileTemplate="{StaticResource FileTemplate}"/>
|
||||
|
||||
<DataTemplate x:Key="template_TextBox">
|
||||
<controls:TextBoxEx Text="{Binding Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Validation.ErrorTemplate="{x:Null}"
|
||||
EditBoxMode="Decimal"
|
||||
TextSaved="{Binding IsSaved,
|
||||
Mode=TwoWay,
|
||||
UpdateSourceTrigger=PropertyChanged}"
|
||||
TextWrapping="Wrap"
|
||||
FontSize="14"
|
||||
FontFamily="Arial"
|
||||
Width="300"
|
||||
IsEnabled="{Binding EnableDefaultValue}"/>
|
||||
</DataTemplate >
|
||||
<DataTemplate x:Key="template_TextBoxString">
|
||||
<controls:TextBoxEx Text="{Binding Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Validation.ErrorTemplate="{x:Null}"
|
||||
EditBoxMode="Default"
|
||||
TextSaved="{Binding IsSaved,
|
||||
Mode=TwoWay,
|
||||
UpdateSourceTrigger=PropertyChanged}"
|
||||
TextWrapping="Wrap"
|
||||
FontSize="14"
|
||||
FontFamily="Arial"
|
||||
Width="300"
|
||||
IsEnabled="{Binding EnableDefaultValue}"/>
|
||||
</DataTemplate >
|
||||
|
||||
<DataTemplate x:Key="template_ComboBox">
|
||||
<controls:ComboBoxExt Style="{StaticResource ResourceKey={x:Type ComboBox}}"
|
||||
Visibility="{Binding Visible}"
|
||||
ComboBoxSaved="{Binding IsSaved, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsEnabled="{Binding IsEnabled}"
|
||||
DisplayMemberPath="DisplayName"
|
||||
SelectedValuePath="ControlName"
|
||||
SelectedValue="{Binding Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
ItemsSource="{Binding Options}"/>
|
||||
</DataTemplate>
|
||||
|
||||
<local:TemplateSelector x:Key="Template"
|
||||
TextBoxTemplate="{StaticResource template_TextBox}"
|
||||
TextBoxTemplateString="{StaticResource template_TextBoxString}"
|
||||
ComboBoxTemplate="{StaticResource template_ComboBox}"
|
||||
/>
|
||||
</UserControl.Resources>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="30"></RowDefinition>
|
||||
<RowDefinition Height="Auto" ></RowDefinition>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
<RowDefinition Height="Auto" ></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto" ></ColumnDefinition>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Background="CadetBlue" >
|
||||
<TextBlock Text="Endpoint Control Parameters" HorizontalAlignment="Center" Height="18" Width="210"></TextBlock>
|
||||
</StackPanel>
|
||||
|
||||
|
||||
<Border Grid.Row="1" Grid.ColumnSpan="2">
|
||||
<DataGrid ItemsSource="{Binding Path=ControlParameters}"
|
||||
CanUserAddRows="False"
|
||||
AutoGenerateColumns="False"
|
||||
RowHeaderWidth="0"
|
||||
VirtualizingPanel.IsVirtualizing="True"
|
||||
VirtualizingPanel.VirtualizationMode="Recycling"
|
||||
Width="591"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Top" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2" >
|
||||
<DataGrid.Columns>
|
||||
|
||||
<DataGridTemplateColumn Width="289" Header="Parameters" >
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DisplayName}"
|
||||
FontFamily="Arial" FontSize="14"
|
||||
Foreground="{DynamicResource FG_Black}"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
ToolTip="{Binding RelativeSource={RelativeSource Self},
|
||||
Path=Text}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Header="setting" CellTemplateSelector="{StaticResource Template}" Width="300"/>
|
||||
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Border>
|
||||
<Border Grid.Row="2" Grid.ColumnSpan="2" Margin="0,5" Visibility="{Binding BandVisibility}">
|
||||
<DataGrid ItemsSource="{Binding Path=BandParameters}"
|
||||
CanUserAddRows="False"
|
||||
AutoGenerateColumns="False"
|
||||
RowHeaderWidth="0"
|
||||
VirtualizingPanel.IsVirtualizing="True"
|
||||
VirtualizingPanel.VirtualizationMode="Recycling"
|
||||
Width="590"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Top" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="2" >
|
||||
<DataGrid.Columns>
|
||||
|
||||
<DataGridTemplateColumn Width="228" Header="Parameters" >
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DisplayName}"
|
||||
FontFamily="Arial" FontSize="14"
|
||||
Foreground="{DynamicResource FG_Black}"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
ToolTip="{Binding RelativeSource={RelativeSource Self},
|
||||
Path=Text}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Width="180" Header="Wavelength (nm)">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<controls:TextBoxEx Text="{Binding WavelengthDoubleParam.Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Validation.ErrorTemplate="{x:Null}"
|
||||
EditBoxMode="Decimal"
|
||||
TextSaved="{Binding IsSaved,
|
||||
Mode=TwoWay,
|
||||
UpdateSourceTrigger=PropertyChanged}"
|
||||
TextWrapping="Wrap"
|
||||
FontSize="14"
|
||||
FontFamily="Arial"
|
||||
Width="300"
|
||||
IsEnabled="{Binding EnableDefaultValue}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTemplateColumn Width="180" Header="Bandwidth (nm)">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<controls:TextBoxEx Text="{Binding BandwidthDoubleParam.Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Validation.ErrorTemplate="{x:Null}"
|
||||
EditBoxMode="Decimal"
|
||||
TextSaved="{Binding IsSaved,
|
||||
Mode=TwoWay,
|
||||
UpdateSourceTrigger=PropertyChanged}"
|
||||
TextWrapping="Wrap"
|
||||
FontSize="14"
|
||||
FontFamily="Arial"
|
||||
Width="300"
|
||||
IsEnabled="{Binding EnableDefaultValue}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</Border>
|
||||
<StackPanel Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Center" Margin="-4,10,10,10" Width="190">
|
||||
<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>
|
||||
|
||||
</UserControl>
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace MECF.Framework.UI.Client.CenterViews.Editors.Recipe
|
||||
{
|
||||
/// <summary>
|
||||
/// PopSettingDialogView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class PopSettingDialogView : UserControl
|
||||
{
|
||||
public PopSettingDialogView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
using OpenSEMI.ClientBase;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using MECF.Framework.UI.Client.RecipeEditorLib.RecipeModel;
|
||||
using MECF.Framework.UI.Client.RecipeEditorLib.RecipeModel.Params;
|
||||
|
||||
namespace MECF.Framework.UI.Client.CenterViews.Editors.Recipe
|
||||
{
|
||||
public class TemplateSelector : DataTemplateSelector
|
||||
{
|
||||
private DataTemplate _textBoxTemplate = null;
|
||||
|
||||
public DataTemplate TextBoxTemplate
|
||||
{
|
||||
get { return _textBoxTemplate; }
|
||||
set { _textBoxTemplate = value; }
|
||||
}
|
||||
|
||||
private DataTemplate _textBoxTemplateString = null;
|
||||
|
||||
public DataTemplate TextBoxTemplateString
|
||||
{
|
||||
get { return _textBoxTemplateString; }
|
||||
set { _textBoxTemplateString = value; }
|
||||
}
|
||||
|
||||
private DataTemplate _comboBoxTemplate = null;
|
||||
public DataTemplate ComboBoxTemplate
|
||||
{
|
||||
get { return _comboBoxTemplate; }
|
||||
set { _comboBoxTemplate = value; }
|
||||
}
|
||||
|
||||
public override DataTemplate SelectTemplate(object item, DependencyObject container)
|
||||
{
|
||||
if (item is Param)
|
||||
{
|
||||
return (item as Param).GetType().Name == "ComboxParam" ? _comboBoxTemplate : ((item as Param).GetType().Name == "StringParam" ? _textBoxTemplateString : _textBoxTemplate);
|
||||
}
|
||||
|
||||
return base.SelectTemplate(item, container);
|
||||
}
|
||||
}
|
||||
|
||||
public class BandParam : Param
|
||||
{
|
||||
public Param WavelengthDoubleParam
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public Param BandwidthDoubleParam
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class PublicPopSettingDialogViewModel : DialogViewModel<RecipeStep>
|
||||
{
|
||||
|
||||
public RecipeStep Parameters
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public RecipeStep ControlParameters
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public ObservableCollection<BandParam> BandParameters
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public Visibility BandVisibility => BandParameters == null || BandParameters.Count == 0 ? Visibility.Collapsed : Visibility.Visible;
|
||||
|
||||
|
||||
public void OK()
|
||||
{
|
||||
this.DialogResult = Parameters;
|
||||
|
||||
IsCancel = false;
|
||||
TryClose(true);
|
||||
}
|
||||
|
||||
public void Cancel()
|
||||
{
|
||||
IsCancel = true;
|
||||
TryClose(false);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
|
||||
namespace MECF.Framework.UI.Client.CenterViews.Editors.Recipe
|
||||
{
|
||||
internal class RecipeCellAccessPermissionWhitelistInfo
|
||||
{
|
||||
|
||||
public RecipeCellAccessPermissionWhitelistInfo(string recipeName, string stepUid, string controlName, DateTime whenSet, string whoSet = "")
|
||||
{
|
||||
RecipeName = recipeName;
|
||||
StepUid = stepUid;
|
||||
ControlName = controlName;
|
||||
WhenSet = whenSet;
|
||||
WhoSet = whoSet;
|
||||
Uuid = Guid.NewGuid().ToString("N");
|
||||
}
|
||||
|
||||
public string Uuid { get; }
|
||||
|
||||
public string RecipeName { get; }
|
||||
|
||||
public string StepUid { get; }
|
||||
|
||||
public string ControlName { get; }
|
||||
|
||||
public string WhoSet { get; }
|
||||
|
||||
public DateTime WhenSet { get; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"'{Uuid}', '{RecipeName}', '{StepUid}', '{ControlName}', '{WhoSet}', '{WhenSet}'";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,352 @@
|
||||
<UserControl
|
||||
x:Class="MECF.Framework.UI.Client.CenterViews.Editors.Recipe.RecipeCompareView"
|
||||
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:converters="clr-namespace:MECF.Framework.UI.Client.RecipeEditorLib.Converters"
|
||||
xmlns:cv="clr-namespace:MECF.Framework.UI.Core.Converters;assembly=MECF.Framework.UI.Core"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:dgExtension="clr-namespace:MECF.Framework.UI.Client.RecipeEditorLib.DGExtension"
|
||||
xmlns:dgExtension1="clr-namespace:MECF.Framework.UI.Client.RecipeEditorLib.DGExtension"
|
||||
xmlns:editors="clr-namespace:MECF.Framework.UI.Client.CenterViews.Editors"
|
||||
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
|
||||
xmlns:lex="http://wpflocalizeextension.codeplex.com"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:micro="clr-namespace:Caliburn.Micro"
|
||||
xmlns:uiClientCtrl="clr-namespace:MECF.Framework.UI.Client.Ctrlib.Controls"
|
||||
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||
d:DesignHeight="1000"
|
||||
d:DesignWidth="1900"
|
||||
lex:LocalizeDictionary.DesignCulture="en"
|
||||
lex:ResxLocalizationProvider.DefaultAssembly="Sicentury.Localization"
|
||||
lex:ResxLocalizationProvider.DefaultDictionary="lang_recipeview"
|
||||
mc:Ignorable="d">
|
||||
<UserControl.Resources>
|
||||
<HierarchicalDataTemplate x:Key="FolderTemplate" ItemsSource="{Binding Files}">
|
||||
<StackPanel Orientation="Horizontal" Tag="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}, Path=DataContext}">
|
||||
<Image
|
||||
x:Name="ExpandImage"
|
||||
Width="14"
|
||||
Height="12"
|
||||
Margin="2,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Source="/MECF.Framework.UI.Client;component/Resources/Images/Folder_Close.png" />
|
||||
<TextBlock
|
||||
Margin="5,0,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Name}" />
|
||||
</StackPanel>
|
||||
<HierarchicalDataTemplate.Triggers>
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
<Setter TargetName="ExpandImage" Property="Image.Source" Value="/MECF.Framework.UI.Client;component/Resources/Images/Folder_Unable.png" />
|
||||
</Trigger>
|
||||
</HierarchicalDataTemplate.Triggers>
|
||||
</HierarchicalDataTemplate>
|
||||
<HierarchicalDataTemplate x:Key="FileTemplate" ItemsSource="{Binding Files}">
|
||||
<StackPanel Orientation="Horizontal" Tag="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}, Path=DataContext}">
|
||||
<CheckBox IsChecked="{Binding IsSelected, Mode=TwoWay, Delay=10}" />
|
||||
<TextBlock
|
||||
Margin="5,0,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Name}" />
|
||||
</StackPanel>
|
||||
</HierarchicalDataTemplate>
|
||||
<editors:FolderOrFileTemplateSelector
|
||||
x:Key="FolderFileTemplateSelector"
|
||||
FileTemplate="{StaticResource FileTemplate}"
|
||||
FolderTemplate="{StaticResource FolderTemplate}" />
|
||||
|
||||
|
||||
<Storyboard
|
||||
x:Key="MenuOpen"
|
||||
Storyboard.TargetName="border"
|
||||
Storyboard.TargetProperty="RenderTransform.X">
|
||||
<DoubleAnimation
|
||||
From="-370"
|
||||
To="0"
|
||||
Duration="0:0:1">
|
||||
<DoubleAnimation.EasingFunction>
|
||||
<!-- 设置缓动模式和振荡次数 -->
|
||||
<BackEase Amplitude="0.5" EasingMode="EaseOut" />
|
||||
</DoubleAnimation.EasingFunction>
|
||||
</DoubleAnimation>
|
||||
</Storyboard>
|
||||
|
||||
<Storyboard
|
||||
x:Key="MenuClose"
|
||||
Storyboard.TargetName="border"
|
||||
Storyboard.TargetProperty="RenderTransform.X">
|
||||
<DoubleAnimation
|
||||
From="0"
|
||||
To="-370"
|
||||
Duration="0:0:0.6" />
|
||||
</Storyboard>
|
||||
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid>
|
||||
<Grid Name="rootGrid">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- 顶层按钮和Lab标签 Content="Show Menu" -->
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Image
|
||||
Width="40"
|
||||
Height="40"
|
||||
Margin="10,0,0,0"
|
||||
ToolTip="显示菜单">
|
||||
<Image.Triggers>
|
||||
<EventTrigger RoutedEvent="PreviewMouseLeftButtonDown">
|
||||
<BeginStoryboard Storyboard="{StaticResource MenuOpen}" />
|
||||
</EventTrigger>
|
||||
</Image.Triggers>
|
||||
<Image.Style>
|
||||
<Style TargetType="{x:Type Image}">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="False">
|
||||
<Setter Property="Source" Value="/MECF.Framework.UI.Client;component/Resources/Images/menu1.png" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Source" Value="/MECF.Framework.UI.Client;component/Resources/Images/menu2.png" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Image.Style>
|
||||
</Image>
|
||||
|
||||
<TextBlock
|
||||
Margin="20,0"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="16">
|
||||
<Run FontSize="12" Text="{lex:Loc ID_TXT_SelectRecipeName}" /><Run FontSize="12" Text="{Binding LabSelectRecipeNames}" />
|
||||
</TextBlock>
|
||||
|
||||
</StackPanel>
|
||||
|
||||
<!-- 侧边栏 -->
|
||||
<Border
|
||||
x:Name="border"
|
||||
Grid.Row="1"
|
||||
Width="335"
|
||||
Margin="10"
|
||||
HorizontalAlignment="Left"
|
||||
Panel.ZIndex="1000"
|
||||
Background="#FF9FBEDE">
|
||||
<!-- 位移效果 -->
|
||||
<Border.RenderTransform>
|
||||
<TranslateTransform X="-370" />
|
||||
</Border.RenderTransform>
|
||||
<Border.Effect>
|
||||
<DropShadowEffect
|
||||
Direction="300"
|
||||
Opacity="0.6"
|
||||
ShadowDepth="1"
|
||||
Color="Black" />
|
||||
</Border.Effect>
|
||||
<Border.Triggers>
|
||||
<!-- 鼠标的左键按下事件来触发退出动画 -->
|
||||
<EventTrigger RoutedEvent="MouseLeave">
|
||||
<BeginStoryboard>
|
||||
<!-- 退出动画 -->
|
||||
<Storyboard Storyboard.TargetProperty="X">
|
||||
<DoubleAnimation
|
||||
From="0"
|
||||
To="-370"
|
||||
Duration="0:0:1" />
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</EventTrigger>
|
||||
</Border.Triggers>
|
||||
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
Width="330"
|
||||
HorizontalAlignment="Left">
|
||||
<Image
|
||||
Width="40"
|
||||
Height="40"
|
||||
Margin="10,0,0,0"
|
||||
HorizontalAlignment="Right"
|
||||
ToolTip="隐藏">
|
||||
<Image.Triggers>
|
||||
<EventTrigger RoutedEvent="PreviewMouseLeftButtonDown">
|
||||
<BeginStoryboard Storyboard="{StaticResource MenuClose}" />
|
||||
</EventTrigger>
|
||||
</Image.Triggers>
|
||||
<Image.Style>
|
||||
<Style TargetType="{x:Type Image}">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="False">
|
||||
<Setter Property="Source" Value="/MECF.Framework.UI.Client;component/Resources/Images/return1.png" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Source" Value="/MECF.Framework.UI.Client;component/Resources/Images/return2.png" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Image.Style>
|
||||
</Image>
|
||||
|
||||
<Border
|
||||
Height="500"
|
||||
Background="{DynamicResource Tab_BG}"
|
||||
BorderBrush="Gray"
|
||||
BorderThickness="0,1,0,0">
|
||||
<Grid Margin="10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Border
|
||||
Background="Transparent"
|
||||
BorderBrush="{DynamicResource Table_BD}"
|
||||
BorderThickness="0">
|
||||
<TabControl
|
||||
Padding="0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
ItemsSource="{Binding ProcessTypeFileList}"
|
||||
SelectedIndex="{Binding ProcessTypeIndexSelection, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
|
||||
<TabControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding ProcessType}" />
|
||||
</DataTemplate>
|
||||
</TabControl.ItemTemplate>
|
||||
<TabControl.ContentTemplate>
|
||||
<DataTemplate>
|
||||
<TreeView
|
||||
x:Name="RecipeTree1"
|
||||
Height="{Binding Path=ActualHeight, ElementName=PART_BORDER, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="0"
|
||||
VerticalAlignment="Stretch"
|
||||
ItemTemplateSelector="{StaticResource FolderFileTemplateSelector}"
|
||||
ItemsSource="{Binding FileListByProcessType}"
|
||||
Tag="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}, Path=DataContext}"
|
||||
VirtualizingPanel.IsVirtualizing="True"
|
||||
VirtualizingPanel.VirtualizationMode="Recycling">
|
||||
<TreeView.ItemContainerStyle>
|
||||
<Style BasedOn="{StaticResource TreeViewItemExtend}" TargetType="{x:Type TreeViewItem}">
|
||||
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />
|
||||
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
|
||||
</Style>
|
||||
</TreeView.ItemContainerStyle>
|
||||
<i:Interaction.Triggers>
|
||||
<!--<i:EventTrigger EventName="SelectedItemChanged">
|
||||
<micro:ActionMessage MethodName="TreeSelectChanged">
|
||||
<micro:Parameter Value="{Binding SelectedItem, ElementName=RecipeTree1}" />
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>-->
|
||||
<!--<i:EventTrigger EventName="MouseRightButtonDown">
|
||||
<micro:ActionMessage MethodName="TreeRightMouseDown">
|
||||
<micro:Parameter Value="$eventargs" />
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>-->
|
||||
<i:EventTrigger EventName="MouseDoubleClick">
|
||||
<micro:ActionMessage MethodName="TreeSelectChanged">
|
||||
<micro:Parameter Value="{Binding SelectedItem, ElementName=RecipeTree1}" />
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
<!--<TreeView.ContextMenu>
|
||||
<ContextMenu DataContext="{Binding Path=PlacementTarget.Tag, RelativeSource={RelativeSource Self}}">
|
||||
<MenuItem Command="{Binding RecipeHistoryCommand}" Header="RecipeHistory" />
|
||||
</ContextMenu>
|
||||
</TreeView.ContextMenu>-->
|
||||
</TreeView>
|
||||
</DataTemplate>
|
||||
</TabControl.ContentTemplate>
|
||||
|
||||
</TabControl>
|
||||
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
<Grid>
|
||||
<Button
|
||||
Width="80"
|
||||
Height="35"
|
||||
Margin="10"
|
||||
HorizontalAlignment="Left"
|
||||
lex:ResxLocalizationProvider.DefaultDictionary="lang_common"
|
||||
micro:Message.Attach="RefreshRecipe()"
|
||||
Content="{lex:Loc ID_BTN_Refresh_Content}"
|
||||
FontSize="13"
|
||||
IsEnabled="{Binding IsSelectButtonEnable}" />
|
||||
|
||||
<Button
|
||||
Width="80"
|
||||
Height="35"
|
||||
Margin="10"
|
||||
HorizontalAlignment="Right"
|
||||
micro:Message.Attach="ComperSelectRecipe()"
|
||||
Content="{lex:Loc ID_BTN_Compare_Content}"
|
||||
FontSize="13"
|
||||
IsEnabled="{Binding IsSelectButtonEnable}">
|
||||
<!--<Button.Triggers>
|
||||
-->
|
||||
<!-- 用按钮的鼠标进入事件来触发进入动画 -->
|
||||
<!--
|
||||
<EventTrigger RoutedEvent="PreviewMouseLeftButtonDown">
|
||||
<BeginStoryboard Storyboard="{StaticResource MenuClose}" />
|
||||
</EventTrigger>
|
||||
</Button.Triggers>-->
|
||||
</Button>
|
||||
</Grid>
|
||||
|
||||
|
||||
</StackPanel>
|
||||
|
||||
</Border>
|
||||
|
||||
<!-- 对比内容展示 -->
|
||||
<Grid Grid.Row="1" Margin="10">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="335" />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<dgExtension1:DataGridRecipe
|
||||
AllowDragToFill="False"
|
||||
FrozenColumnCount="6"
|
||||
IsEnabled="{Binding IsPermission}"
|
||||
Recipe="{Binding ComparRecipeHeader, Mode=OneWay}"
|
||||
ScrollViewerOffset="{Binding ScrollViewerOffset, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" />
|
||||
|
||||
<dgExtension1:DataGridRecipe
|
||||
Grid.Column="1"
|
||||
AllowDragToFill="False"
|
||||
ComperHeadersVisibility="None"
|
||||
FrozenColumnCount="6"
|
||||
IsEnabled="{Binding IsPermission}"
|
||||
Recipe="{Binding ComparRecipe1, Mode=OneWay}"
|
||||
ScrollViewerOffset="{Binding ScrollViewerOffset, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" />
|
||||
|
||||
<dgExtension1:DataGridRecipe
|
||||
Grid.Column="2"
|
||||
AllowDragToFill="False"
|
||||
ComperHeadersVisibility="None"
|
||||
FrozenColumnCount="6"
|
||||
IsEnabled="{Binding IsPermission}"
|
||||
Recipe="{Binding ComparRecipe2, Mode=OneWay}"
|
||||
ScrollViewerOffset="{Binding ScrollViewerOffset, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" />
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
<uiClientCtrl:PanelLocker
|
||||
x:Name="editorLocker"
|
||||
Grid.RowSpan="2"
|
||||
LockTarget="{Binding ElementName=rootGrid}"
|
||||
Visibility="Collapsed" />
|
||||
</Grid>
|
||||
|
||||
</UserControl>
|
||||
+28
@@ -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 MECF.Framework.UI.Client.CenterViews.Editors.Recipe
|
||||
{
|
||||
/// <summary>
|
||||
/// RecipeComparisonView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class RecipeCompareView : UserControl
|
||||
{
|
||||
public RecipeCompareView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
+514
@@ -0,0 +1,514 @@
|
||||
using Aitex.Core.RT.Log;
|
||||
using Caliburn.Micro;
|
||||
using DocumentFormat.OpenXml.EMMA;
|
||||
using MECF.Framework.Common.DataCenter;
|
||||
using MECF.Framework.UI.Client.CenterViews.Configs.Roles;
|
||||
using MECF.Framework.UI.Client.CenterViews.Editors.Sequence;
|
||||
using MECF.Framework.UI.Client.ClientBase;
|
||||
using MECF.Framework.UI.Client.RecipeEditorLib.RecipeModel;
|
||||
using MECF.Framework.UI.Client.RecipeEditorLib.RecipeModel.Params;
|
||||
using MECF.Framework.UI.Core.Accounts;
|
||||
using OpenSEMI.ClientBase;
|
||||
using OpenSEMI.ClientBase.Command;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Dynamic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Animation;
|
||||
using System.Windows.Threading;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Window;
|
||||
|
||||
namespace MECF.Framework.UI.Client.CenterViews.Editors.Recipe
|
||||
{
|
||||
public class RecipeCompareViewModel : UiViewModelBase, ISupportMultipleSystem
|
||||
{
|
||||
private readonly RecipeType _fileTypes;
|
||||
private readonly bool _isFolderOnly;
|
||||
private readonly bool _isShowRootNode;
|
||||
private FileNode _currentFileNode;
|
||||
private readonly RecipeProvider _recipeProvider;
|
||||
|
||||
public object View { get; set; }
|
||||
|
||||
public ObservableCollection<string> Chambers { get; set; }
|
||||
|
||||
private string labSelectRecipeNames;
|
||||
|
||||
public string LabSelectRecipeNames
|
||||
{
|
||||
get => labSelectRecipeNames;
|
||||
set
|
||||
{
|
||||
labSelectRecipeNames = value;
|
||||
NotifyOfPropertyChange();
|
||||
}
|
||||
}
|
||||
|
||||
private RecipeData _recipeHeaders;
|
||||
|
||||
/// <summary>
|
||||
/// Recipe表头
|
||||
/// </summary>
|
||||
public RecipeData RecipeHeaders
|
||||
{
|
||||
get => _recipeHeaders;
|
||||
set
|
||||
{
|
||||
_recipeHeaders = value;
|
||||
NotifyOfPropertyChange();
|
||||
}
|
||||
}
|
||||
|
||||
private RecipeData _comparRecipeHeader;
|
||||
|
||||
/// <summary>
|
||||
/// Recipe表头
|
||||
/// </summary>
|
||||
public RecipeData ComparRecipeHeader
|
||||
{
|
||||
get => _comparRecipeHeader;
|
||||
set
|
||||
{
|
||||
_comparRecipeHeader = value;
|
||||
NotifyOfPropertyChange();
|
||||
}
|
||||
}
|
||||
|
||||
private RecipeData _comparRecipe1;
|
||||
|
||||
/// <summary>
|
||||
/// 选择要Recipe-1
|
||||
/// </summary>
|
||||
public RecipeData ComparRecipe1
|
||||
{
|
||||
get => _comparRecipe1;
|
||||
set
|
||||
{
|
||||
_comparRecipe1 = value;
|
||||
NotifyOfPropertyChange();
|
||||
}
|
||||
}
|
||||
|
||||
private RecipeData _comparRecipe2;
|
||||
|
||||
/// <summary>
|
||||
/// 选择要Recipe-2
|
||||
/// </summary>
|
||||
public RecipeData ComparRecipe2
|
||||
{
|
||||
get => _comparRecipe2;
|
||||
set
|
||||
{
|
||||
_comparRecipe2 = value;
|
||||
NotifyOfPropertyChange();
|
||||
}
|
||||
}
|
||||
|
||||
private double[] _scrollViewerOffset;
|
||||
|
||||
/// <summary>
|
||||
/// ScrollViewer滑动偏移
|
||||
/// </summary>
|
||||
public double[] ScrollViewerOffset
|
||||
{
|
||||
get => _scrollViewerOffset;
|
||||
set
|
||||
{
|
||||
_scrollViewerOffset = value;
|
||||
NotifyOfPropertyChange();
|
||||
}
|
||||
}
|
||||
|
||||
public RecipeHistory RecipeHistory { get; set; }
|
||||
|
||||
private ICommand _recipeHistoryCommand;
|
||||
|
||||
public ICommand RecipeHistoryCommand
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_recipeHistoryCommand == null)
|
||||
_recipeHistoryCommand = new BaseCommand(() => RecipeHistoryViewShow());
|
||||
return _recipeHistoryCommand;
|
||||
}
|
||||
}
|
||||
|
||||
public int ProcessTypeIndexSelection { get; set; }
|
||||
public RecipeType CurrentProcessType => ProcessTypeFileList[ProcessTypeIndexSelection].ProcessType;
|
||||
|
||||
public string CurrentChamberType { get; set; }
|
||||
|
||||
public string SelectedChamber { get; set; }
|
||||
|
||||
public ObservableCollection<FileNode> SelectRecipeNameList { get; set; } = new ObservableCollection<FileNode>();
|
||||
|
||||
public FileNode DGSelectRecipeName { get; set; }
|
||||
|
||||
public List<ProcessTypeFileItem> ProcessTypeFileList { get; set; }
|
||||
|
||||
public RecipeCompareViewModel()
|
||||
{
|
||||
_fileTypes = RecipeType.Process | RecipeType.Routine;
|
||||
_isFolderOnly = false;
|
||||
_isShowRootNode = false;
|
||||
|
||||
_recipeProvider = new RecipeProvider();
|
||||
}
|
||||
|
||||
protected override void OnViewLoaded(object view)
|
||||
{
|
||||
View = view;
|
||||
|
||||
base.OnViewLoaded(view);
|
||||
}
|
||||
|
||||
protected override void OnActivate()
|
||||
{
|
||||
base.OnActivate();
|
||||
RefreshRecipe();
|
||||
}
|
||||
|
||||
protected override void OnDeactivate(bool close)
|
||||
{
|
||||
base.OnDeactivate(close);
|
||||
|
||||
// 锁定编辑器
|
||||
((RecipeCompareView)View).editorLocker.Lock();
|
||||
}
|
||||
|
||||
protected override void OnInitialize()
|
||||
{
|
||||
base.OnInitialize();
|
||||
|
||||
CurrentChamberType = (string)QueryDataClient.Instance.Service.GetConfig("System.Recipe.SupportedChamberType");
|
||||
|
||||
BuildFileTree(_isShowRootNode, _isFolderOnly, _fileTypes);
|
||||
UpdateRecipeFormat();
|
||||
}
|
||||
|
||||
public void RefreshRecipe()
|
||||
{
|
||||
ReloadRecipeFileList(CurrentChamberType, CurrentProcessType, "", false);
|
||||
}
|
||||
|
||||
private void ReloadRecipeFileList(string chamberType, RecipeType processType, string selectedFile,
|
||||
bool selectionIsFolder)
|
||||
{
|
||||
var item = ProcessTypeFileList.FirstOrDefault(x => x.ProcessType == processType);
|
||||
if (item == null)
|
||||
{
|
||||
LOG.Write("error reload recipe file list, type = " + processType);
|
||||
}
|
||||
|
||||
var prefix = $"{CurrentChamberType}\\{SystemName}\\{item.ProcessType}";
|
||||
var recipes = _recipeProvider.GetXmlRecipeList(prefix);
|
||||
|
||||
item.FileListByProcessType =
|
||||
RecipeSequenceTreeBuilder.BuildFileNode(prefix, selectedFile, selectionIsFolder, recipes)[0].Files;
|
||||
|
||||
item.InvokePropertyChanged();
|
||||
}
|
||||
|
||||
private void StoryboardClose()
|
||||
{
|
||||
var getString = (Storyboard)((RecipeCompareView)View).FindResource("MenuClose");
|
||||
getString.Begin();
|
||||
}
|
||||
|
||||
private void RecipeHistoryViewShow()
|
||||
{
|
||||
if (_currentFileNode == null)
|
||||
return;
|
||||
var dialog = new RecipeHistoryViewModel(_currentFileNode.FullPath.Replace("\\", "-"));
|
||||
var wm = new WindowManager();
|
||||
|
||||
dynamic settings = new ExpandoObject();
|
||||
settings.WindowStartupLocation = WindowStartupLocation.CenterOwner;
|
||||
settings.Title = "Recipe历史数据对比,选择一个(选择项和当前使用项对比),选择两个(两个选择项对比)";
|
||||
settings.ResizeMode = ResizeMode.NoResize;
|
||||
settings.ShowInTaskbar = false;
|
||||
StoryboardClose();
|
||||
var bret = wm.ShowDialog(dialog, null, settings);
|
||||
if ((bool)bret)
|
||||
{
|
||||
if (dialog.SelectRecipeMemorieList.Count == 1)
|
||||
RecipeSelectAndHistory(dialog.SelectRecipeMemorieList[0]);
|
||||
else if (dialog.SelectRecipeMemorieList.Count == 2)
|
||||
RecipeBothHistory(dialog.SelectRecipeMemorieList);
|
||||
}
|
||||
}
|
||||
|
||||
private async void RecipeSelectAndHistory(RecipeHistory recipeHistory)
|
||||
{
|
||||
RecipeHistory = recipeHistory;
|
||||
LabSelectRecipeNames = _currentFileNode.FullPath + " / " + RecipeHistory.RecipeName + ": " + RecipeHistory.CreateTime;
|
||||
await LoadRecipe(ComparRecipe1, _currentFileNode.PrefixPath, _currentFileNode.FullPath);
|
||||
await LoadRecipe(ComparRecipe2, RecipeHistory);
|
||||
StartComper(ComparRecipe1, ComparRecipe2);
|
||||
}
|
||||
|
||||
private async void RecipeBothHistory(List<RecipeHistory> recipeHistoryList)
|
||||
{
|
||||
LabSelectRecipeNames = recipeHistoryList[0].RecipeName + ": " + recipeHistoryList[0].CreateTime + " / " + recipeHistoryList[1].RecipeName + ": " + recipeHistoryList[1].CreateTime;
|
||||
await LoadRecipe(ComparRecipe1, recipeHistoryList[0]);
|
||||
await LoadRecipe(ComparRecipe2, recipeHistoryList[1]);
|
||||
StartComper(ComparRecipe1, ComparRecipe2);
|
||||
}
|
||||
|
||||
public void TreeSelectChanged(FileNode file)
|
||||
{
|
||||
_currentFileNode = file;
|
||||
RecipeHistoryViewShow();
|
||||
}
|
||||
|
||||
public void TreeRightMouseDown(MouseButtonEventArgs e)
|
||||
{
|
||||
var item = GetParentObjectEx<TreeViewItem>(e.OriginalSource as DependencyObject) as TreeViewItem;
|
||||
if (item != null)
|
||||
{
|
||||
item.Focus();
|
||||
}
|
||||
}
|
||||
|
||||
private TreeViewItem GetParentObjectEx<TreeViewItem>(DependencyObject obj) where TreeViewItem : FrameworkElement
|
||||
{
|
||||
var parent = VisualTreeHelper.GetParent(obj);
|
||||
while (parent != null)
|
||||
{
|
||||
if (parent is TreeViewItem)
|
||||
{
|
||||
return (TreeViewItem)parent;
|
||||
}
|
||||
|
||||
parent = VisualTreeHelper.GetParent(parent);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private void BuildFileTree(bool isShowRootNode, bool isFolderOnly, RecipeType fileType)
|
||||
{
|
||||
var recipeProvider = new RecipeProvider();
|
||||
|
||||
var scProcessType = QueryDataClient.Instance.Service.GetConfig("System.Recipe.SupportedProcessType").ToString();
|
||||
var ProcessType = new ObservableCollection<string>(((string)(scProcessType)).Split(','));
|
||||
|
||||
var processTypeFileList = new List<ProcessTypeFileItem>();
|
||||
|
||||
for (var i = 0; i < ProcessType.Count; i++)
|
||||
{
|
||||
Enum.TryParse(ProcessType[i], true, out RecipeType rType);
|
||||
var type = new ProcessTypeFileItem
|
||||
{
|
||||
ProcessType = rType
|
||||
};
|
||||
var prefix = $"{CurrentChamberType}\\{SystemName}\\{ProcessType[i]}";
|
||||
var recipes = recipeProvider.GetXmlRecipeList(prefix);
|
||||
type.FileListByProcessType = RecipeSequenceTreeBuilder.BuildFileNode(prefix, "", false, recipes, isFolderOnly, isShowRootNode)[0].Files;
|
||||
processTypeFileList.Add(type);
|
||||
}
|
||||
|
||||
this.ProcessTypeFileList = processTypeFileList;
|
||||
}
|
||||
|
||||
public void UpdateRecipeFormat()
|
||||
{
|
||||
var chamber = QueryDataClient.Instance.Service.GetConfig("System.Recipe.ChamberModules");
|
||||
if (chamber == null)
|
||||
{
|
||||
chamber = "PM1";
|
||||
}
|
||||
|
||||
Chambers = new ObservableCollection<string>(((string)chamber).Split(','));
|
||||
if (Chambers.Count > 1)
|
||||
{
|
||||
for (var i = 0; i < Chambers.Count; i++)
|
||||
{
|
||||
var isPmInstall =
|
||||
(bool)QueryDataClient.Instance.Service.GetConfig(
|
||||
$"System.SetUp.Is{Chambers[i].ToString()}Installed");
|
||||
{
|
||||
if (!isPmInstall)
|
||||
{
|
||||
Chambers.RemoveAt(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (Chambers.Count == 0)
|
||||
{
|
||||
Chambers = new ObservableCollection<string>(new string[] { "PM1" });
|
||||
}
|
||||
|
||||
SelectedChamber = Chambers[0];
|
||||
|
||||
#region Create RecipeData
|
||||
|
||||
ComparRecipeHeader = CreateRecipe();
|
||||
ComparRecipeHeader.AddStep();
|
||||
|
||||
ComparRecipe1 = CreateRecipe();
|
||||
ComparRecipe2 = CreateRecipe();
|
||||
|
||||
#endregion Create RecipeData
|
||||
}
|
||||
|
||||
private RecipeData CreateRecipe()
|
||||
{
|
||||
var role = AccountClient.Instance.Service.GetRoleByID(BaseApp.Instance.UserContext.Role.RoleId);
|
||||
|
||||
var recipeData = new RecipeData(null, CurrentProcessType);
|
||||
recipeData.BuildFormat($"{CurrentChamberType}\\{CurrentProcessType}", SystemName, role);
|
||||
|
||||
//得到当前登录的RoleItem
|
||||
//var role = _roleManager.GetRoleByName(BaseApp.Instance.UserContext.RoleName);
|
||||
|
||||
return recipeData;
|
||||
}
|
||||
|
||||
private async Task LoadRecipe(RecipeData recipeData, string prefixPath, string recipeName)
|
||||
{
|
||||
recipeData.Clear();
|
||||
recipeData.Steps.Save(); // 重置为已保存状态
|
||||
|
||||
var recipeContent = _recipeProvider.ReadRecipeFile(prefixPath, recipeName);
|
||||
|
||||
if (string.IsNullOrEmpty(recipeContent))
|
||||
{
|
||||
MessageBox.Show($"{prefixPath}\\{recipeName} is empty, please confirm the file is valid.",
|
||||
"Error",
|
||||
MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
return;
|
||||
}
|
||||
var role = AccountClient.Instance.Service.GetRoleByID(BaseApp.Instance.UserContext.Role.RoleId);
|
||||
await recipeData.LoadFile(prefixPath, recipeName, recipeContent, SelectedChamber, role,
|
||||
GetLoadingDispatcher());
|
||||
}
|
||||
|
||||
private async Task LoadRecipe(RecipeData recipeData, RecipeHistory recipeHistory)
|
||||
{
|
||||
recipeData.Clear();
|
||||
recipeData.Steps.Save(); // 重置为已保存状态
|
||||
|
||||
var role = AccountClient.Instance.Service.GetRoleByID(BaseApp.Instance.UserContext.Role.RoleId);
|
||||
await recipeData.LoadFile(recipeHistory, SelectedChamber, role,
|
||||
GetLoadingDispatcher());
|
||||
}
|
||||
|
||||
private static Dispatcher GetLoadingDispatcher()
|
||||
{
|
||||
// 判断Step呈现方式
|
||||
var isCascadeLoading = (bool)QueryDataClient.Instance.Service.GetConfig("System.RecipeCascadeLoading");
|
||||
var dispatcher = isCascadeLoading ? Dispatcher.CurrentDispatcher : null;
|
||||
return dispatcher;
|
||||
}
|
||||
|
||||
public async void ComperSelectRecipe()
|
||||
{
|
||||
SelectRecipeNameList.Clear();
|
||||
|
||||
foreach (var ProcessTypeFile in ProcessTypeFileList)
|
||||
{
|
||||
GetSelectRecipeName(ProcessTypeFile.FileListByProcessType);
|
||||
}
|
||||
|
||||
if (SelectRecipeNameList.Count != 2)
|
||||
{
|
||||
DialogBox.ShowError("Only 2 comparisons are supported");
|
||||
return;
|
||||
}
|
||||
StoryboardClose();
|
||||
LabSelectRecipeNames = SelectRecipeNameList[0].Name + " / " + SelectRecipeNameList[1].Name;
|
||||
|
||||
await LoadRecipe(ComparRecipe1, GetRecipeFullPath(SelectRecipeNameList[0]), SelectRecipeNameList[0].Name);
|
||||
|
||||
await LoadRecipe(ComparRecipe2, GetRecipeFullPath(SelectRecipeNameList[1]), SelectRecipeNameList[1].Name);
|
||||
|
||||
StartComper(ComparRecipe1, ComparRecipe2);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 递归获取选择的Recipe
|
||||
/// </summary>
|
||||
/// <param name="fileNodes"></param>
|
||||
private void GetSelectRecipeName(ObservableCollection<FileNode> fileNodes)
|
||||
{
|
||||
foreach (var item in fileNodes)
|
||||
{
|
||||
if (item.Files != null && item.Files.Count > 0)
|
||||
GetSelectRecipeName(item.Files);
|
||||
|
||||
if (item.IsSelected)
|
||||
SelectRecipeNameList.Add(item);
|
||||
}
|
||||
}
|
||||
|
||||
private string GetRecipeFullPath(FileNode fileNodes)
|
||||
{
|
||||
return fileNodes.PrefixPath + (fileNodes.Parent.FullPath == "" ? "" : "\\" + fileNodes.Parent.FullPath);
|
||||
}
|
||||
|
||||
public void StartComper(RecipeData recipeData1, RecipeData recipeData2)
|
||||
{
|
||||
int stepsCount = 0;//缓存较短Recipe步数
|
||||
RecipeData recipeDataExcess;//缓存较长步数Recipe
|
||||
if (recipeData1.Steps.Count <= recipeData2.Steps.Count)
|
||||
{
|
||||
stepsCount = recipeData1.Steps.Count;
|
||||
recipeDataExcess = recipeData2;
|
||||
}
|
||||
else
|
||||
{
|
||||
stepsCount = recipeData2.Steps.Count;
|
||||
recipeDataExcess = recipeData1;
|
||||
}
|
||||
|
||||
for (int i = 0; i < stepsCount; i++)
|
||||
{
|
||||
RecipeStep recipe1step = recipeData1.Steps[i];
|
||||
RecipeStep recipe2step = recipeData2.Steps[i];
|
||||
|
||||
for (int j = 0; j < recipe1step.Count; j++)
|
||||
{
|
||||
object obj1 = GetValue(recipe1step[j]);//获取单元格中的数值,object类型
|
||||
object obj2 = GetValue(recipe2step[j]);
|
||||
|
||||
if (!(Object.Equals(obj1, obj2)))
|
||||
{
|
||||
//recipe1step[j].Highlight();//不同部分高亮
|
||||
//recipe2step[j].Highlight();
|
||||
|
||||
recipe1step[j].CompareDifferent();
|
||||
recipe2step[j].CompareDifferent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//步数多余部分高亮显示 使用缓存步数和缓存Recipe
|
||||
for (int i = stepsCount; i < recipeDataExcess.Steps.Count; i++)
|
||||
{
|
||||
for (int j = 0; j < recipeDataExcess.Steps[i].Count; j++)
|
||||
{
|
||||
recipeDataExcess.Steps[i][j].CompareDifferent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private object GetValue(Param param)
|
||||
{
|
||||
object Value = null;
|
||||
if (param is IValueParam vp)
|
||||
Value = vp.GetValue();
|
||||
|
||||
return Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
<Window x:Class="MECF.Framework.UI.Client.CenterViews.Editors.Recipe.RecipeEditorValidationDetailWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d"
|
||||
Title="Recipe Validation Overview"
|
||||
Height="450" Width="800"
|
||||
Topmost="{Binding ElementName=cbxTopMost, Path=IsChecked, FallbackValue=False}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="35"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.Resources>
|
||||
<Style TargetType="StackPanel">
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="Orientation" Value="Horizontal"/>
|
||||
<Setter Property="Margin" Value="5 0"/>
|
||||
</Style>
|
||||
</Grid.Resources>
|
||||
<StackPanel HorizontalAlignment="Left">
|
||||
<StackPanel.Resources>
|
||||
<Style TargetType="RadioButton">
|
||||
<Setter Property="Margin" Value="0 0 10 0"/>
|
||||
<Setter Property="GroupName" Value="InfoCategory"/>
|
||||
</Style>
|
||||
</StackPanel.Resources>
|
||||
|
||||
<RadioButton Content="All"/>
|
||||
<RadioButton Content="Errors" IsChecked="True">
|
||||
<RadioButton.ContentTemplate>
|
||||
<DataTemplate DataType="{x:Type RadioButton}">
|
||||
<Border CornerRadius="2" Background="#FFDC6262" Padding="5 0">
|
||||
<TextBlock Text="{TemplateBinding Content}" Foreground="#FF980000"/>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</RadioButton.ContentTemplate>
|
||||
</RadioButton>
|
||||
<RadioButton Content="Changed">
|
||||
<RadioButton.ContentTemplate>
|
||||
<DataTemplate DataType="{x:Type RadioButton}">
|
||||
<Border CornerRadius="2" Background="#FFBDFFB4" Padding="5 0">
|
||||
<TextBlock Text="{TemplateBinding Content}" Foreground="#FF1A7F1C"/>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</RadioButton.ContentTemplate>
|
||||
</RadioButton>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Row="0" HorizontalAlignment="Right">
|
||||
<CheckBox x:Name="cbxTopMost" Content="Always On Top"/>
|
||||
</StackPanel>
|
||||
|
||||
<ListView
|
||||
Grid.Row="1"
|
||||
x:Name="listView">
|
||||
<ListView.ItemContainerStyle>
|
||||
<Style TargetType="ListViewItem">
|
||||
<EventSetter Event="MouseDoubleClick" Handler="EventSetter_OnHandler"/>
|
||||
</Style>
|
||||
</ListView.ItemContainerStyle>
|
||||
<ListView.View>
|
||||
<GridView>
|
||||
<GridViewColumn Header="#" Width="35" >
|
||||
<GridViewColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Image
|
||||
Source="/MECF.Framework.UI.Core;component/Resources/SystemLog/Alarm.png"
|
||||
Width="16"
|
||||
Height="16"/>
|
||||
</DataTemplate>
|
||||
</GridViewColumn.CellTemplate>
|
||||
</GridViewColumn>
|
||||
<GridViewColumn Header="Step No." DisplayMemberBinding="{Binding StepNo}"/>
|
||||
<GridViewColumn Header="Param" DisplayMemberBinding="{Binding ParamCaption}"/>
|
||||
<GridViewColumn Header="Value" DisplayMemberBinding="{Binding Value}" Width="100"/>
|
||||
<GridViewColumn Header="Error" Width="350" DisplayMemberBinding="{Binding Message}"/>
|
||||
</GridView>
|
||||
</ListView.View>
|
||||
|
||||
</ListView>
|
||||
</Grid>
|
||||
</Window>
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using MECF.Framework.UI.Client.RecipeEditorLib.RecipeModel;
|
||||
using Sicentury.Core.Collections;
|
||||
|
||||
namespace MECF.Framework.UI.Client.CenterViews.Editors.Recipe
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for RecipeEditorValidationDetailWindow.xaml
|
||||
/// </summary>
|
||||
public partial class RecipeEditorValidationDetailWindow : Window
|
||||
{
|
||||
#region Variables
|
||||
|
||||
/// <summary>
|
||||
/// 窗口加载时在屏幕中的位置。
|
||||
/// </summary>
|
||||
private readonly Point? _location = null;
|
||||
|
||||
#endregion
|
||||
|
||||
public RecipeEditorValidationDetailWindow(ObservableRangeCollection<RecipeStepValidationInfo> errorInfo, Point? location = null)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
_location = location;
|
||||
listView.ItemsSource = errorInfo;
|
||||
SourceInitialized += OnSourceInitialized;
|
||||
}
|
||||
|
||||
private void OnSourceInitialized(object sender, EventArgs e)
|
||||
{
|
||||
if (!_location.HasValue)
|
||||
{
|
||||
// 如果未指定显示位置,则默认显示在右下角。
|
||||
var desktopWorkingArea = SystemParameters.WorkArea;
|
||||
Left = desktopWorkingArea.Right - Width - 20;
|
||||
Top = desktopWorkingArea.Bottom - Height - 30;
|
||||
}
|
||||
else
|
||||
{
|
||||
Left = _location.Value.X;
|
||||
Top = _location.Value.Y;
|
||||
}
|
||||
}
|
||||
|
||||
private void EventSetter_OnHandler(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (!(DataContext is RecipeEditorViewModel vm))
|
||||
return;
|
||||
|
||||
if(listView.SelectedItem is RecipeStepValidationInfo info && info.Param != null)
|
||||
vm.FocusToParam(info.Param);
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
+29
@@ -0,0 +1,29 @@
|
||||
using System.Windows;
|
||||
using MECF.Framework.UI.Client.Ctrlib.Controls;
|
||||
using MECF.Framework.UI.Client.RecipeEditorLib.DGExtension.CustomColumn;
|
||||
|
||||
namespace MECF.Framework.UI.Client.CenterViews.Editors.Recipe
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for RecipePM1View.xaml
|
||||
/// </summary>
|
||||
public partial class RecipeEditorView
|
||||
{
|
||||
public RecipeEditorView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
EditorDataGridTemplateColumnBase _PreColumn = null;
|
||||
|
||||
private void btnLock_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
editorLocker.Lock();
|
||||
}
|
||||
|
||||
private void btnChangePassword_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var dlg = new PanelLockerPasswordChanger();
|
||||
dlg.ShowDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
+2023
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,114 @@
|
||||
<UserControl
|
||||
x:Class="MECF.Framework.UI.Client.CenterViews.Editors.Recipe.RecipeHistoryView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
|
||||
xmlns:local="clr-namespace:MECF.Framework.UI.Client.CenterViews.Editors.Recipe"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:micro="clr-namespace:Caliburn.Micro"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<local:RowToIndexConverter x:Key="rowToIndexConverter" />
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
<Grid Margin="5">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="40" />
|
||||
</Grid.RowDefinitions>
|
||||
<DataGrid
|
||||
Grid.Column="3"
|
||||
AlternationCount="2"
|
||||
AutoGenerateColumns="False"
|
||||
CanUserAddRows="False"
|
||||
FontSize="13"
|
||||
IsReadOnly="True"
|
||||
ItemsSource="{Binding RecipeMemorieList}"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Visible"
|
||||
SelectedItem="{Binding SelectRecipeHistory}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTemplateColumn Width="20">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox>
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="SelChanged">
|
||||
<micro:Parameter Value="{Binding Path=IsChecked, RelativeSource={RelativeSource AncestorType={x:Type CheckBox}}}" />
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</CheckBox>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTextColumn
|
||||
Width="30"
|
||||
Binding="{Binding RelativeSource={RelativeSource AncestorType=DataGridRow}, Converter={StaticResource rowToIndexConverter}}"
|
||||
Header="ID" />
|
||||
<DataGridTextColumn
|
||||
Width="100"
|
||||
Binding="{Binding RoleName}"
|
||||
Header="RoleName" />
|
||||
<DataGridTextColumn
|
||||
Width="Auto"
|
||||
Binding="{Binding RecipeName}"
|
||||
Header="RecipeName" />
|
||||
<DataGridTextColumn
|
||||
Width="100"
|
||||
Binding="{Binding ProcessType}"
|
||||
Header="ProcessType" />
|
||||
<DataGridTextColumn
|
||||
Width="200"
|
||||
Binding="{Binding CreateTime}"
|
||||
Header="Time" />
|
||||
<!--<DataGridTemplateColumn Width="100" Header="Compare">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Button Margin="10,0" Content="Statr">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="StatrCompare" />
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>-->
|
||||
|
||||
</DataGrid.Columns>
|
||||
|
||||
</DataGrid>
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
Margin="0,10,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
Width="90"
|
||||
Height="30"
|
||||
Content="OK">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="OK" />
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
<Button
|
||||
Width="90"
|
||||
Height="30"
|
||||
Margin="10,0,0,0"
|
||||
Content="Cancel">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="Cancel" />
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
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 MECF.Framework.UI.Client.CenterViews.Editors.Recipe
|
||||
{
|
||||
public partial class RecipeHistoryView : UserControl
|
||||
{
|
||||
public RecipeHistoryView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
+99
@@ -0,0 +1,99 @@
|
||||
using Caliburn.Micro;
|
||||
using DocumentFormat.OpenXml.Drawing.Diagrams;
|
||||
using MECF.Framework.UI.Client.RecipeEditorLib.RecipeModel;
|
||||
using OpenSEMI.ClientBase;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using Xceed.Wpf.Toolkit;
|
||||
|
||||
namespace MECF.Framework.UI.Client.CenterViews.Editors.Recipe
|
||||
{
|
||||
public class RecipeHistoryViewModel : DialogViewModel<string>
|
||||
{
|
||||
private RecipeHistory recipeMemory;
|
||||
|
||||
public bool isCompare;
|
||||
|
||||
public List<RecipeHistory> RecipeMemorieList { get; set; }
|
||||
|
||||
public List<RecipeHistory> SelectRecipeMemorieList { get; set; }
|
||||
|
||||
public RecipeHistory SelectRecipeHistory { get; set; }
|
||||
|
||||
public RecipeHistoryViewModel(string recipeName)
|
||||
{
|
||||
recipeMemory = new RecipeHistory();
|
||||
RecipeMemorieList = recipeMemory.QueryDB(recipeName);
|
||||
SelectRecipeMemorieList = new List<RecipeHistory>() ;
|
||||
}
|
||||
|
||||
public RecipeHistory GetXML(RecipeHistory recipeHistory)
|
||||
{
|
||||
return recipeHistory.QueryDB(recipeHistory) ?? null;
|
||||
}
|
||||
|
||||
public void SelChanged(bool selItems)
|
||||
{
|
||||
if (selItems)
|
||||
{
|
||||
SelectRecipeMemorieList.Add(SelectRecipeHistory);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (SelectRecipeMemorieList.Contains(SelectRecipeHistory))
|
||||
SelectRecipeMemorieList.Remove(SelectRecipeHistory);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void OK()
|
||||
{
|
||||
if (SelectRecipeMemorieList.Count > 2)
|
||||
{
|
||||
MessageBox.Show("Only 2 comparisons are supported");
|
||||
return;
|
||||
}
|
||||
if (SelectRecipeMemorieList.Count>0)
|
||||
{
|
||||
for (int i = 0; i < SelectRecipeMemorieList.Count; i++)
|
||||
{
|
||||
SelectRecipeMemorieList[i] = GetXML(SelectRecipeMemorieList[i]);
|
||||
}
|
||||
}
|
||||
IsCancel = false;
|
||||
TryClose(true);
|
||||
}
|
||||
|
||||
public void Cancel()
|
||||
{
|
||||
//SelectRecipeMemorieList.Clear();
|
||||
IsCancel = true;
|
||||
TryClose(false);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// datagrid 自动生成行号
|
||||
/// </summary>
|
||||
public class RowToIndexConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
DataGridRow row = value as DataGridRow;
|
||||
if (row != null)
|
||||
return row.GetIndex() + 1;
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
+208
@@ -0,0 +1,208 @@
|
||||
<UserControl
|
||||
x:Class="MECF.Framework.UI.Client.CenterViews.Editors.Recipe.RecipeSelectDialogView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:editors="clr-namespace:MECF.Framework.UI.Client.CenterViews.Editors"
|
||||
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
|
||||
xmlns:lex="http://wpflocalizeextension.codeplex.com"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:micro="clr-namespace:Caliburn.Micro"
|
||||
Width="350"
|
||||
Height="500"
|
||||
lex:LocalizeDictionary.DesignCulture="en"
|
||||
lex:ResxLocalizationProvider.DefaultAssembly="Sicentury.Localization"
|
||||
lex:ResxLocalizationProvider.DefaultDictionary="lang_common"
|
||||
mc:Ignorable="d">
|
||||
<UserControl.Resources>
|
||||
<HierarchicalDataTemplate x:Key="FolderTemplate" ItemsSource="{Binding Files}">
|
||||
<StackPanel Orientation="Horizontal" Tag="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}, Path=DataContext}">
|
||||
<Image
|
||||
x:Name="ExpandImage"
|
||||
Width="14"
|
||||
Height="12"
|
||||
Margin="2,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Source="/MECF.Framework.UI.Client;component/Resources/Images/Folder_Close.png" />
|
||||
<TextBlock
|
||||
Margin="5,0,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Name}" />
|
||||
</StackPanel>
|
||||
<HierarchicalDataTemplate.Triggers>
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
<Setter TargetName="ExpandImage" Property="Image.Source" Value="/MECF.Framework.UI.Client;component/Resources/Images/Folder_Unable.png" />
|
||||
</Trigger>
|
||||
</HierarchicalDataTemplate.Triggers>
|
||||
</HierarchicalDataTemplate>
|
||||
<HierarchicalDataTemplate x:Key="FileTemplate" ItemsSource="{Binding Files}">
|
||||
<StackPanel Orientation="Horizontal" Tag="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}, Path=DataContext}">
|
||||
<Path
|
||||
Width="13"
|
||||
Height="16"
|
||||
HorizontalAlignment="Left"
|
||||
Data="M0.5,5.125 L5.125,5.125 5.125,0.5 M5.1,0.5 L15.5,0.5 15.5,19.5 0.5,19.5 C0.5,14.7 0.5,10 0.5,5.1 2,3.6 3.6,2 5.1,0.5 z M8.1,8.5 L8.2,8.5 z M8.1,11.5 L8.2,11.5 z M8.1,14.5 L8.2,14.5 z"
|
||||
Fill="#FFF3F3F3"
|
||||
Stretch="Fill"
|
||||
Stroke="#FF454545" />
|
||||
<TextBlock
|
||||
Margin="5,0,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Name}" />
|
||||
</StackPanel>
|
||||
</HierarchicalDataTemplate>
|
||||
<editors:FolderOrFileTemplateSelector
|
||||
x:Key="FolderFileTemplateSelector"
|
||||
FileTemplate="{StaticResource FileTemplate}"
|
||||
FolderTemplate="{StaticResource FolderTemplate}" />
|
||||
|
||||
</UserControl.Resources>
|
||||
|
||||
<Border
|
||||
Background="{DynamicResource Tab_BG}"
|
||||
BorderBrush="Gray"
|
||||
BorderThickness="0,1,0,0">
|
||||
<Grid Margin="10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40" />
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<StackPanel Grid.Row="0" Orientation="Horizontal" Margin="0 0 0 3">
|
||||
<Label
|
||||
Margin="5,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Content="{lex:Loc ID_TXT_Filter}"
|
||||
FontSize="16" />
|
||||
<TextBox
|
||||
Width="226"
|
||||
Height="26"
|
||||
Margin="0,0,5,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding CurrentCriteria, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<Button
|
||||
Width="30"
|
||||
Height="30"
|
||||
Margin="0,0,5,0"
|
||||
Padding="0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center">
|
||||
<Button.Content>
|
||||
<Path
|
||||
Width="15"
|
||||
Height="15"
|
||||
Margin="0,3"
|
||||
Data="M5.5,0 L8.5,0 8.5,5.5 14,5.5 14,8.5 8.5,8.5 8.5,14 5.5,14 5.5,8.5 0,8.5 0,5.5 5.5,5.5 z"
|
||||
Fill="Black"
|
||||
RenderTransformOrigin="0.5,0.5"
|
||||
Stretch="Fill"
|
||||
StrokeThickness="3">
|
||||
<Path.RenderTransform>
|
||||
<TransformGroup>
|
||||
<ScaleTransform />
|
||||
<SkewTransform />
|
||||
<RotateTransform Angle="45" />
|
||||
<TranslateTransform />
|
||||
</TransformGroup>
|
||||
</Path.RenderTransform>
|
||||
</Path>
|
||||
</Button.Content>
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="ClearFilter" />
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
|
||||
<Border
|
||||
Grid.Row="1"
|
||||
Background="Transparent"
|
||||
BorderBrush="{DynamicResource Table_BD}"
|
||||
BorderThickness="0">
|
||||
<TabControl
|
||||
Padding="0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
ItemsSource="{Binding ProcessTypeFileList}"
|
||||
SelectedIndex="{Binding ProcessTypeIndexSelection, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
|
||||
<TabControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding ProcessType}" />
|
||||
</DataTemplate>
|
||||
</TabControl.ItemTemplate>
|
||||
<TabControl.ContentTemplate>
|
||||
<DataTemplate>
|
||||
<TreeView
|
||||
x:Name="RecipeTree1"
|
||||
Height="{Binding Path=ActualHeight, ElementName=PART_BORDER, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="0"
|
||||
VerticalAlignment="Stretch"
|
||||
ItemTemplateSelector="{StaticResource FolderFileTemplateSelector}"
|
||||
ItemsSource="{Binding FileListByProcessType}"
|
||||
Tag="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}, Path=DataContext}"
|
||||
VirtualizingPanel.IsVirtualizing="True"
|
||||
VirtualizingPanel.VirtualizationMode="Recycling">
|
||||
<TreeView.ItemContainerStyle>
|
||||
<Style BasedOn="{StaticResource TreeViewItemExtend}" TargetType="{x:Type TreeViewItem}">
|
||||
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />
|
||||
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
|
||||
<Setter Property="Visibility" Value="{Binding IsMatch, Mode=TwoWay}" />
|
||||
</Style>
|
||||
</TreeView.ItemContainerStyle>
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="SelectedItemChanged">
|
||||
<micro:ActionMessage MethodName="TreeSelectChanged">
|
||||
<micro:Parameter Value="{Binding SelectedItem, ElementName=RecipeTree1}" />
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
<i:EventTrigger EventName="MouseDoubleClick">
|
||||
<micro:ActionMessage MethodName="TreeMouseDoubleClick">
|
||||
<micro:Parameter Value="{Binding SelectedItem, ElementName=RecipeTree1}" />
|
||||
</micro:ActionMessage>
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
|
||||
</TreeView>
|
||||
</DataTemplate>
|
||||
</TabControl.ContentTemplate>
|
||||
|
||||
</TabControl>
|
||||
|
||||
</Border>
|
||||
<StackPanel
|
||||
Grid.Row="2"
|
||||
Margin="0,10,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
Width="90"
|
||||
Height="30"
|
||||
Content="OK">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="OK" />
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
<Button
|
||||
Width="90"
|
||||
Height="30"
|
||||
Margin="10,0,0,0"
|
||||
Content="Cancel">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="Cancel" />
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
</UserControl>
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace MECF.Framework.UI.Client.CenterViews.Editors.Recipe
|
||||
{
|
||||
/// <summary>
|
||||
/// RecipeSequenceSelectDialogView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class RecipeSelectDialogView : UserControl
|
||||
{
|
||||
public RecipeSelectDialogView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
+180
@@ -0,0 +1,180 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Windows.Data;
|
||||
using MECF.Framework.Common.DataCenter;
|
||||
using MECF.Framework.UI.Client.CenterViews.Editors.Sequence;
|
||||
using MECF.Framework.UI.Client.RecipeEditorLib.RecipeModel;
|
||||
using OpenSEMI.ClientBase;
|
||||
|
||||
namespace MECF.Framework.UI.Client.CenterViews.Editors.Recipe
|
||||
{
|
||||
public class RecipeSelectDialogViewModel : DialogViewModel<string>
|
||||
{
|
||||
|
||||
#region Variables
|
||||
|
||||
private readonly RecipeType _fileTypes;
|
||||
private readonly bool _isFolderOnly;
|
||||
private readonly bool _isShowRootNode;
|
||||
private FileNode _currentFileNode;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
public RecipeSelectDialogViewModel(string model = null)
|
||||
{
|
||||
_fileTypes = RecipeType.Process | RecipeType.Routine | RecipeType.Clean;
|
||||
_isFolderOnly = false;
|
||||
_isShowRootNode = false;
|
||||
|
||||
BuildFileTree(_isShowRootNode, _isFolderOnly, _fileTypes, model);
|
||||
}
|
||||
|
||||
public RecipeSelectDialogViewModel(bool isShowRootNode, bool isFolderOnly, RecipeType fileType, string model=null)
|
||||
{
|
||||
_fileTypes = fileType;
|
||||
_isFolderOnly = isFolderOnly;
|
||||
_isShowRootNode = isShowRootNode;
|
||||
|
||||
BuildFileTree(isShowRootNode, isFolderOnly, fileType, model);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
|
||||
public List<ProcessTypeFileItem> ProcessTypeFileList { get; set; }
|
||||
|
||||
public FileNode CurrentFileNode { get; set; }
|
||||
|
||||
public int ProcessTypeIndexSelection { get; set; }
|
||||
|
||||
public ObservableCollection<FileNode> Files { get; set; }
|
||||
|
||||
public ListCollectionView FileView { get; set; }
|
||||
|
||||
private string _currentCriteria = string.Empty;
|
||||
|
||||
public string CurrentCriteria
|
||||
{
|
||||
get => _currentCriteria;
|
||||
set
|
||||
{
|
||||
if (value == _currentCriteria)
|
||||
return;
|
||||
|
||||
_currentCriteria = value;
|
||||
NotifyOfPropertyChange(nameof(CurrentCriteria));
|
||||
|
||||
ApplyFilter();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void BuildFileTree(bool isShowRootNode, bool isFolderOnly, RecipeType fileType, string model=null)
|
||||
{
|
||||
string modelName = model == null ? "" : "\\" + model;
|
||||
|
||||
var recipeProvider = new RecipeProvider();
|
||||
var scProcessType = QueryDataClient.Instance.Service.GetConfig("System.Recipe.SupportedProcessType").ToString();
|
||||
var supportedRecipeType = new List<RecipeType>(new[] { RecipeType.Process, RecipeType.Routine });
|
||||
|
||||
if (!string.IsNullOrEmpty(scProcessType))
|
||||
{
|
||||
supportedRecipeType.Clear();
|
||||
|
||||
if (fileType.HasFlag(RecipeType.Process) && scProcessType.Contains(RecipeType.Process.ToString()))
|
||||
supportedRecipeType.Add(RecipeType.Process);
|
||||
|
||||
if (fileType.HasFlag(RecipeType.Routine) && scProcessType.Contains(RecipeType.Routine.ToString()))
|
||||
supportedRecipeType.Add(RecipeType.Routine);
|
||||
|
||||
if (fileType.HasFlag(RecipeType.Clean) && scProcessType.Contains(RecipeType.Clean.ToString()))
|
||||
supportedRecipeType.Add(RecipeType.Clean);
|
||||
}
|
||||
|
||||
var processTypeFileList = new List<ProcessTypeFileItem>();
|
||||
|
||||
for (var i = 0; i < supportedRecipeType.Count; i++)
|
||||
{
|
||||
var type = new ProcessTypeFileItem
|
||||
{
|
||||
ProcessType = supportedRecipeType[i]
|
||||
};
|
||||
var prefix = $"Sic{modelName}\\{supportedRecipeType[i]}";
|
||||
var recipes = recipeProvider.GetXmlRecipeList(prefix);
|
||||
type.FileListByProcessType = RecipeSequenceTreeBuilder.BuildFileNode(prefix, "", false, recipes, isFolderOnly, isShowRootNode)[0].Files;
|
||||
processTypeFileList.Add(type);
|
||||
}
|
||||
|
||||
this.ProcessTypeFileList = processTypeFileList;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
private void ApplyFilter()
|
||||
{
|
||||
foreach (var node in ProcessTypeFileList[ProcessTypeIndexSelection].FileListByProcessType)
|
||||
node.ApplyCriteria(CurrentCriteria, new Stack<FileNode>());
|
||||
}
|
||||
|
||||
public void ClearFilter()
|
||||
{
|
||||
CurrentCriteria = "";
|
||||
}
|
||||
|
||||
public void TreeSelectChanged(FileNode file)
|
||||
{
|
||||
_currentFileNode = file;
|
||||
}
|
||||
|
||||
public void TreeMouseDoubleClick(FileNode file)
|
||||
{
|
||||
_currentFileNode = file;
|
||||
OK();
|
||||
}
|
||||
|
||||
public void OK()
|
||||
{
|
||||
if (this._currentFileNode == null)
|
||||
return;
|
||||
|
||||
if (_isFolderOnly)
|
||||
{
|
||||
if (this._currentFileNode.IsFile)
|
||||
return;
|
||||
|
||||
this.DialogResult = _currentFileNode.PrefixPath + "\\" + _currentFileNode.FullPath;
|
||||
IsCancel = false;
|
||||
TryClose(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!this._currentFileNode.IsFile)
|
||||
return;
|
||||
|
||||
this.DialogResult = _currentFileNode.PrefixPath + "\\" + _currentFileNode.FullPath;
|
||||
IsCancel = false;
|
||||
TryClose(true);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void Cancel()
|
||||
{
|
||||
IsCancel = true;
|
||||
TryClose(false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
<UserControl
|
||||
x:Class="MECF.Framework.UI.Client.CenterViews.Editors.Recipe.SaveToDialogView"
|
||||
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="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:micro="clr-namespace:Caliburn.Micro"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<UserControl.Resources>
|
||||
<DataTemplate x:Key="ChamberSelectTemplate">
|
||||
<Grid Height="23" Margin="-1,-1,0,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="180" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border
|
||||
Padding="5,1"
|
||||
BorderBrush="{DynamicResource DataGrid_Cell_BD}"
|
||||
BorderThickness="1">
|
||||
<CheckBox
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Content="{Binding Name}"
|
||||
IsChecked="{Binding Path=IsChecked, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsEnabled="{Binding IsEnabled}" />
|
||||
</Border>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</UserControl.Resources>
|
||||
<Border
|
||||
Background="{DynamicResource Tab_BG}"
|
||||
BorderBrush="Gray"
|
||||
BorderThickness="0,1,0,0">
|
||||
<Grid
|
||||
Margin="50"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="160" />
|
||||
<ColumnDefinition Width="220" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="150" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Border
|
||||
Padding="5,1"
|
||||
Background="{DynamicResource Table_BG_Title}"
|
||||
BorderBrush="{DynamicResource Table_BD}"
|
||||
BorderThickness="1">
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="Arial"
|
||||
FontSize="16"
|
||||
Foreground="{DynamicResource FG_Black}"
|
||||
Text="Copy To Chamber"
|
||||
TextWrapping="Wrap" />
|
||||
</Border>
|
||||
<Border
|
||||
Grid.Column="1"
|
||||
Padding="5,1"
|
||||
VerticalAlignment="Stretch"
|
||||
Background="{DynamicResource Table_BG_Content}"
|
||||
BorderBrush="{DynamicResource Table_BD}"
|
||||
BorderThickness="0,1,1,1">
|
||||
<ListBox
|
||||
x:Name="ListBoxChamber"
|
||||
Margin="5,0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
BorderThickness="0"
|
||||
ItemContainerStyle="{DynamicResource Sepcial_ListBoxItem}"
|
||||
ItemTemplate="{StaticResource ChamberSelectTemplate}"
|
||||
ItemsSource="{Binding Chambers}"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Disabled">
|
||||
<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel
|
||||
Margin="1,1,0,0"
|
||||
IsItemsHost="True"
|
||||
Orientation="Vertical" />
|
||||
</ItemsPanelTemplate>
|
||||
</ListBox.ItemsPanel>
|
||||
</ListBox>
|
||||
</Border>
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
Grid.ColumnSpan="2"
|
||||
Margin="0,10"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
Width="90"
|
||||
Height="30"
|
||||
Content="OK">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="OK" />
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
<Button
|
||||
Width="90"
|
||||
Height="30"
|
||||
Margin="10,0,0,0"
|
||||
Content="Cancel">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="Click">
|
||||
<micro:ActionMessage MethodName="Cancel" />
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
</UserControl>
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace MECF.Framework.UI.Client.CenterViews.Editors.Recipe
|
||||
{
|
||||
/// <summary>
|
||||
/// InputFileNameDialogView.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class SaveToDialogView : UserControl
|
||||
{
|
||||
public SaveToDialogView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Windows.Input;
|
||||
using DocumentFormat.OpenXml.Office2010.ExcelAc;
|
||||
using MECF.Framework.Common.CommonData;
|
||||
using OpenSEMI.ClientBase;
|
||||
|
||||
namespace MECF.Framework.UI.Client.CenterViews.Editors.Recipe
|
||||
{
|
||||
public class ChamberItem : NotifiableItem
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public bool IsChecked { get; set; }
|
||||
public bool IsEnabled { get; set; }
|
||||
}
|
||||
public class SaveToDialogViewModel : DialogViewModel<string>
|
||||
{
|
||||
public string Chamber { get; set; }
|
||||
|
||||
public ObservableCollection<ChamberItem> Chambers { get; set; }
|
||||
|
||||
public SaveToDialogViewModel(string dialogName, string chamber, List<string> chambers)
|
||||
{
|
||||
this.DisplayName = dialogName;
|
||||
|
||||
Chambers = new ObservableCollection<ChamberItem>();
|
||||
foreach (var chamber1 in chambers)
|
||||
{
|
||||
Chambers.Add(new ChamberItem()
|
||||
{
|
||||
IsChecked = false,
|
||||
IsEnabled = chamber1!=chamber,
|
||||
Name = chamber1,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void Cancel()
|
||||
{
|
||||
IsCancel = true;
|
||||
TryClose(false);
|
||||
}
|
||||
protected override void OnViewLoaded(object view)
|
||||
{
|
||||
base.OnViewLoaded(view);
|
||||
SaveToDialogView v = (SaveToDialogView)view;
|
||||
FocusManager.SetFocusedElement(v, v.ListBoxChamber);
|
||||
}
|
||||
|
||||
public void OK()
|
||||
{
|
||||
this.DialogResult = Chamber;
|
||||
IsCancel = false;
|
||||
TryClose(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user