增加ENG模式。

This commit is contained in:
DESKTOP-GPE37UV\THINKAPD 2023-03-03 16:45:39 +08:00
parent 944ebc9e0e
commit fd5cfeabb9
10 changed files with 158 additions and 141 deletions

1
.gitignore vendored
View File

@ -362,3 +362,4 @@ MigrationBackup/
# Fody - auto-generated XML schema
FodyWeavers.xsd
/.svn
FrameworkLocal/output/

View File

@ -18,11 +18,12 @@
<config default="1000" name="DataCollectionInterval" description="Data Collection Interval" max="10000" min="20" paramter="" tag="" unit="ms" type="Integer" />
<config default="180" name="LogsSaveDays" description="Logs Save Days" max="10000" min="0" paramter="" tag="" unit="" type="Integer" />
<config default="true" name="IsIgnoreSaveDB" description="IO不存储到数据库" max="" min="" paramter="" tag="" unit="" type="Bool" />
<config default="false" name="BypassInterlock" description="Bypass Interlock" max="" min="" paramter="" tag="" unit="" type="Bool" />
<config default="false" name="BypassEnableTable" description="Bypass EnableTable" max="" min="" paramter="" tag="" unit="" type="Bool" />
<config default="1" name="RecipePasswordReset" description="Recipe编辑的密码重置设置0重置其他数忽略" max="100" min="0" paramter="" tag="" unit="" type="Integer" />
<config default="false" name="BypassInterlock" description="Bypass Interlock" max="" min="" paramter="" tag="" unit="" type="Bool" />
<config default="false" name="BypassEnableTable" description="Bypass EnableTable" max="" min="" paramter="" tag="" unit="" type="Bool" />
<config default="1" name="RecipePasswordReset" description="Recipe编辑的密码重置设置0重置其他数忽略" max="100" min="0" paramter="" tag="" unit="" type="Integer" />
<config default="true" name="RecipeCascadeLoading" description="启用瀑布流方式加载Recipe" max="" min="" paramter="" tag="" unit="" type="Bool" />
<config default="true" name="RecipeHideParamValueAfterLoading" description="加载Recipe后是否自动隐藏参数值" max="" min="" paramter="" tag="" unit="" type="Bool" />
<config default="600" name="BypassInterlockTimeout" description="旁路互锁的超时时间,超过此时间后互锁自动恢复" max="3600" min="5" paramter="" tag="" unit="s" type="Integer" />
<configs name="Scheduler">
<config default="15" name="WaitLoadTimeOut" description="Wait Load TimeOut" max="1000" min="1" paramter="" tag="" unit="s" type="Double" visible="false" />

View File

@ -421,6 +421,7 @@ namespace SicRT.Equipments.Systems
DATA.Subscribe("System.IsAutoRunning", () => IsRunning);
DATA.Subscribe("System.Modules", () => _modules);
DATA.Subscribe("System.LiveAlarmEvent", () => EV.GetAlarmEvent());
DATA.Subscribe("System.IsEngMode", () => _isEngMode);
}
void SubscribeOperation()
@ -1256,23 +1257,50 @@ namespace SicRT.Equipments.Systems
MonitorPmTmInfo();
MonitorUPSAlarm();
//MonitorAETemp();
MonitorEngMode();
return true;
}
//public void MonitorModuleAlarm()
//{
// var alarms = EV.GetAlarmEvent();
// if (alarms != null && StringFsmStatus != "Initializing")
// {
// foreach (var modulesNa in Modules.Keys)
// {
// if (alarms.FindAll(a => a.Level == EventLevel.Alarm && a.Source == modulesNa.ToString()).Count > 0 && Modules[modulesNa].StringFsmStatus.ToLower() != "error")
// {
// Modules[modulesNa].PostMsg(MSG.ERROR);
// }
// }
// }
//}
private bool _isEngMode;
private readonly DeviceTimer _timEngModeTimeout = new DeviceTimer();
private readonly R_TRIG _trigEngModeEntered = new R_TRIG();
private readonly R_TRIG _trigEngModeLeft = new R_TRIG();
private void MonitorEngMode()
{
var isBypassInterlock = SC.GetValue<bool>("System.BypassInterlock");
_trigEngModeEntered.CLK = isBypassInterlock;
_trigEngModeLeft.CLK = isBypassInterlock == false;
// InterlockBypass 变为 true
if (_trigEngModeEntered.Q)
{
// 获取互锁旁路超时最小值限定5s
var timeout = SC.GetValue<int>("System.BypassInterlockTimeout");
if (timeout <= 5)
timeout = 5;
_isEngMode = true;
_timEngModeTimeout.Restart(timeout * 1000);
EV.PostInfoLog(Name, "Interlock is bypassed");
}
// InterlockBypass 变为 false
if (_trigEngModeLeft.Q)
{
_isEngMode = false;
EV.PostInfoLog(Name, "Interlock is resumed");
}
// Eng Mode 超时
if (_timEngModeTimeout.IsTimeout())
{
_timEngModeTimeout.Stop();
SC.SetItemValue("System.BypassInterlock", false);
EV.PostInfoLog(Name, "Interlock bypass timeout");
}
}
private void MonitorPmTmInfo()

View File

@ -0,0 +1,28 @@
using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Media;
namespace SicUI.Converter
{
/// <summary>
/// EngMode转换为主界面边框颜色
/// </summary>
internal class EngModeToBdColorConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is bool isEngMode)
{
return isEngMode ? new SolidColorBrush(Colors.OrangeRed) : new SolidColorBrush(Colors.LightCyan);
}
return new SolidColorBrush(Colors.Red);
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

View File

@ -0,0 +1,31 @@
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
namespace SicUI.Converter
{
/// <summary>
/// EngMode转换为主界面边框宽度
/// </summary>
internal class EngModeToBdThicknessConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
/*
if (value is bool isEngMode)
{
return isEngMode ? new Thickness(5) : new Thickness(2);
}
*/
return new Thickness(2);
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

View File

@ -0,0 +1,28 @@
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
namespace SicUI.Converter
{
/// <summary>
/// EngMode转换为主界面背景水印显示状态
/// </summary>
internal class EngModeToBgWatermarkVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is bool isEngMode)
{
return isEngMode ? Visibility.Visible : Visibility.Hidden;
}
return Visibility.Visible;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

View File

@ -8,6 +8,7 @@
xmlns:deviceControl="clr-namespace:Aitex.Core.UI.DeviceControl;assembly=MECF.Framework.UI.Core"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:wnd="http://OpenSEMI.Ctrlib.com/presentation"
xmlns:converter1="clr-namespace:SicUI.Converter"
Title="MainView"
Width="1900"
Height="980"
@ -18,6 +19,10 @@
<client:CollectionLastIndexConverter x:Key="collectionLastIndexConverter" />
<converter:UnitOnlineBorderColorConverter x:Key="UnitOnlineBorderColorConverter" />
<converter:BoolReverseConverter x:Key="BoolReverseConverter" />
<converter1:EngModeToBdThicknessConverter x:Key="BdThicknessConverter"/>
<converter1:EngModeToBdColorConverter x:Key="BdColorConverter"/>
<converter1:EngModeToBgWatermarkVisibilityConverter x:Key="WatermarkVisibilityConverter"/>
</Window.Resources>
<Grid Background="{DynamicResource MainArea_BG}">
@ -327,8 +332,8 @@
<Border
Margin="3,1"
Padding="1"
BorderBrush="LightCyan"
BorderThickness="2"
BorderBrush="{Binding IsEngMode, Converter={StaticResource BdColorConverter}}"
BorderThickness="{Binding IsEngMode, Converter={StaticResource BdThicknessConverter}}"
CornerRadius="4">
<Grid x:Name="MainPage">
<Grid.RowDefinitions>
@ -1147,128 +1152,14 @@
</Border>
</Grid>
<Grid Grid.Row="1" Background="{DynamicResource MainArea_BG}">
<Rectangle
Margin="20,8"
Fill="{DynamicResource MainArea_InnerBG}"
RadiusX="5"
RadiusY="5">
<Rectangle.Effect>
<BlurEffect Radius="40" />
</Rectangle.Effect>
</Rectangle>
<Border Visibility="{Binding IsEngMode, Converter={StaticResource WatermarkVisibilityConverter}}">
<Border.Background>
<ImageBrush ImageSource="/Resources/Images/eng_mode_watermark.png"
TileMode="Tile" Opacity="0.15" ViewportUnits="Absolute"
Viewport="0,-20,250,200" Viewbox="0,0,1.5,1.5" Stretch="Fill"
ViewboxUnits="RelativeToBoundingBox" />
</Border.Background>
</Border>
<ContentControl
x:Name="ActiveItem"
Margin="10"

View File

@ -407,6 +407,9 @@ namespace SicUI.Client
public Visibility WarnEventsVisibility { get; set; }
[Subscription("System.IsEngMode")]
public bool IsEngMode { get; set; }
[Subscription("Rt.Status")]
public string RtStatus { get; set; }
public string RtStatusBackground => ModuleStatusBackground.GetStatusBackground(RtStatus);

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

View File

@ -245,6 +245,9 @@ if exist "$(ProjectDir)..\SicSetup\Packages\SicUI\PresetGroups" rd "$(ProjectDir
<DependentUpon>WaferAssociationUnitLite.xaml</DependentUpon>
</Compile>
<Compile Include="Converter\BoolVisibilityConverter.cs" />
<Compile Include="Converter\EngModeToBdColorConverter.cs" />
<Compile Include="Converter\EngModeToBdThicknessConverter.cs" />
<Compile Include="Converter\EngModeToBgWatermarkVisibilityConverter.cs" />
<Compile Include="Models\Maintenances\RuntimeView.xaml.cs">
<DependentUpon>RuntimeView.xaml</DependentUpon>
</Compile>
@ -989,6 +992,9 @@ if exist "$(ProjectDir)..\SicSetup\Packages\SicUI\PresetGroups" rd "$(ProjectDir
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Images\eng_mode_watermark.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>