|
@@ -12,6 +12,8 @@ using Venus_MainPages.Views;
|
|
|
using System.Linq;
|
|
|
using System.Threading;
|
|
|
using System.Threading.Tasks;
|
|
|
+using Microsoft.Win32;
|
|
|
+using System.IO;
|
|
|
|
|
|
namespace Venus_MainPages.ViewModels
|
|
|
{
|
|
@@ -96,6 +98,11 @@ namespace Venus_MainPages.ViewModels
|
|
|
|
|
|
private int m_ESCVoltage;
|
|
|
|
|
|
+ private bool m_GasIsFlowing;
|
|
|
+
|
|
|
+ private bool m_IsAutoMode;
|
|
|
+ private string m_SelectedRecipe;
|
|
|
+
|
|
|
#endregion
|
|
|
|
|
|
#region 属性
|
|
@@ -386,6 +393,21 @@ namespace Venus_MainPages.ViewModels
|
|
|
get { return m_BRFMatchC2; }
|
|
|
set { SetProperty(ref m_BRFMatchC2, value); }
|
|
|
}
|
|
|
+ public bool GasIsFlowing
|
|
|
+ {
|
|
|
+ get { return m_GasIsFlowing; }
|
|
|
+ set { SetProperty(ref m_GasIsFlowing, value); }
|
|
|
+ }
|
|
|
+ public bool IsAutoMode
|
|
|
+ {
|
|
|
+ get { return m_IsAutoMode; }
|
|
|
+ set { SetProperty(ref m_IsAutoMode, value); }
|
|
|
+ }
|
|
|
+ public string SelectedRecipe
|
|
|
+ {
|
|
|
+ get { return m_SelectedRecipe; }
|
|
|
+ set { SetProperty(ref m_SelectedRecipe, value); }
|
|
|
+ }
|
|
|
#endregion
|
|
|
|
|
|
#region 命令
|
|
@@ -451,9 +473,9 @@ namespace Venus_MainPages.ViewModels
|
|
|
public DelegateCommand OpenButterflyValveViewCommand =>
|
|
|
_OpenButterflyValveViewCommand ?? (_OpenButterflyValveViewCommand = new DelegateCommand(OnOpenButterflyValveView));
|
|
|
|
|
|
- private DelegateCommand _GasSetPointCommand;
|
|
|
- public DelegateCommand GasSetPointCommand =>
|
|
|
- _GasSetPointCommand ?? (_GasSetPointCommand = new DelegateCommand(OnGasSetPoint));
|
|
|
+ //private DelegateCommand _GasCommand;
|
|
|
+ //public DelegateCommand GasCommand =>
|
|
|
+ // _GasCommand ?? (_GasCommand = new DelegateCommand(OnGas));
|
|
|
|
|
|
private DelegateCommand _HVCommand;
|
|
|
public DelegateCommand HVCommand =>
|
|
@@ -466,6 +488,10 @@ namespace Venus_MainPages.ViewModels
|
|
|
private DelegateCommand<object> _SetMatchModeCommand;
|
|
|
public DelegateCommand<object> SetMatchModeCommand =>
|
|
|
_SetMatchModeCommand ?? (_SetMatchModeCommand = new DelegateCommand<object>(OnSetMatchMode));
|
|
|
+
|
|
|
+ private DelegateCommand _LoadRecipeCommand;
|
|
|
+ public DelegateCommand LoadRecipeCommand =>
|
|
|
+ _LoadRecipeCommand ?? (_LoadRecipeCommand = new DelegateCommand(OnLoadRecipe));
|
|
|
#endregion
|
|
|
|
|
|
#region 构造函数
|
|
@@ -502,28 +528,50 @@ namespace Venus_MainPages.ViewModels
|
|
|
{
|
|
|
InvokeClient.Instance.Service.DoOperation($"{ModuleName}.Home");
|
|
|
}
|
|
|
- private void OnGas()
|
|
|
+ private async void OnGas()
|
|
|
{
|
|
|
- object[] mfc = new object[8];
|
|
|
- string[] mfcSetPoint = new string[8];
|
|
|
- for (int index = 0; index < mfc.Length; index++)
|
|
|
+ await Task.Run(async () =>
|
|
|
{
|
|
|
- mfc[index] = RtDataValues[$"{ModuleName}.MfcGas{index + 1}.SetPoint"];
|
|
|
- }
|
|
|
- //if (((Math.Abs((double)mfc[0] - (double)_oldmfc[0]) < 0.01) && (Math.Abs((double)mfc[1] - (double)_oldmfc[1]) < 0.01) && (Math.Abs((double)mfc[2] - (double)_oldmfc[2])) < 0.01)
|
|
|
- // || ((Math.Abs((double)mfc[0]) <= 0.01 && Math.Abs((double)mfc[1]) <= 0.01 && Math.Abs((double)mfc[2]) <= 0.01)))
|
|
|
- //{
|
|
|
- // InvokeClient.Instance.Service.DoOperation($"{ModuleName}.{RtOperation.Abort}");
|
|
|
- // return;
|
|
|
- //}
|
|
|
-
|
|
|
- _oldmfc = mfc;
|
|
|
- InvokeClient.Instance.Service.DoOperation($"{ModuleName}.{RtOperation.GasFlow}", mfc);
|
|
|
+ if (GasIsFlowing == true)
|
|
|
+ {
|
|
|
+ InvokeClient.Instance.Service.DoOperation($"{ModuleName}.{RtOperation.Abort}");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ InvokeClient.Instance.Service.DoOperation($"{ModuleName}.MfcGas1.SetPoint", MfcGas1Setpoint);
|
|
|
+ InvokeClient.Instance.Service.DoOperation($"{ModuleName}.MfcGas2.SetPoint", MfcGas2Setpoint);
|
|
|
+ InvokeClient.Instance.Service.DoOperation($"{ModuleName}.MfcGas3.SetPoint", MfcGas3Setpoint);
|
|
|
+ InvokeClient.Instance.Service.DoOperation($"{ModuleName}.MfcGas4.SetPoint", MfcGas4Setpoint);
|
|
|
+ InvokeClient.Instance.Service.DoOperation($"{ModuleName}.MfcGas5.SetPoint", MfcGas5Setpoint);
|
|
|
+ InvokeClient.Instance.Service.DoOperation($"{ModuleName}.MfcGas6.SetPoint", MfcGas6Setpoint);
|
|
|
+ InvokeClient.Instance.Service.DoOperation($"{ModuleName}.MfcGas7.SetPoint", MfcGas7Setpoint);
|
|
|
+ InvokeClient.Instance.Service.DoOperation($"{ModuleName}.MfcGas8.SetPoint", MfcGas8Setpoint);
|
|
|
+
|
|
|
+ await Task.Delay(5000);
|
|
|
+ object[] mfc = new object[8];
|
|
|
+ string[] mfcSetPoint = new string[8];
|
|
|
+ for (int index = 0; index < mfc.Length; index++)
|
|
|
+ {
|
|
|
+ mfc[index] = RtDataValues[$"{ModuleName}.MfcGas{index + 1}.SetPoint"];
|
|
|
+ }
|
|
|
+ //if (((Math.Abs((double)mfc[0] - (double)_oldmfc[0]) < 0.01) && (Math.Abs((double)mfc[1] - (double)_oldmfc[1]) < 0.01) && (Math.Abs((double)mfc[2] - (double)_oldmfc[2])) < 0.01)
|
|
|
+ // || ((Math.Abs((double)mfc[0]) <= 0.01 && Math.Abs((double)mfc[1]) <= 0.01 && Math.Abs((double)mfc[2]) <= 0.01)))
|
|
|
+ //{
|
|
|
+ // InvokeClient.Instance.Service.DoOperation($"{ModuleName}.{RtOperation.Abort}");
|
|
|
+ // return;
|
|
|
+ //}
|
|
|
+
|
|
|
+ _oldmfc = mfc;
|
|
|
+ InvokeClient.Instance.Service.DoOperation($"{ModuleName}.{RtOperation.GasFlow}", mfc);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
private void OnRf()
|
|
|
{
|
|
|
- if (RtDataValues[$"{ModuleName}.FsmState"].ToString() == "RfPowering")
|
|
|
+ if (RtDataValues[$"{ModuleName}.FsmState"].ToString() == PMState.RfPowering.ToString())
|
|
|
{
|
|
|
InvokeClient.Instance.Service.DoOperation($"{ModuleName}.{RtOperation.Abort}");
|
|
|
}
|
|
@@ -532,7 +580,7 @@ namespace Venus_MainPages.ViewModels
|
|
|
|
|
|
private void OnPurge()
|
|
|
{
|
|
|
- if (RtDataValues[$"{ModuleName}.FsmState"].ToString() == "Purge")
|
|
|
+ if (RtDataValues[$"{ModuleName}.FsmState"].ToString() ==PMState.Purge.ToString())
|
|
|
{
|
|
|
//InvokeClient.Instance.Service.DoOperation($"{ModuleName}.StopPurge");
|
|
|
}
|
|
@@ -544,7 +592,7 @@ namespace Venus_MainPages.ViewModels
|
|
|
|
|
|
private void OnVent()
|
|
|
{
|
|
|
- if (RtDataValues[$"{ModuleName}.FsmState"].ToString() == "Venting")
|
|
|
+ if (RtDataValues[$"{ModuleName}.FsmState"].ToString()==PMState.Venting.ToString())
|
|
|
{
|
|
|
//InvokeClient.Instance.Service.DoOperation($"{ModuleName}.StopVent");
|
|
|
}
|
|
@@ -557,7 +605,7 @@ namespace Venus_MainPages.ViewModels
|
|
|
|
|
|
private void OnPump()
|
|
|
{
|
|
|
- if (RtDataValues[$"{ModuleName}.FsmState"].ToString() == "Pumping")
|
|
|
+ if (RtDataValues[$"{ModuleName}.FsmState"].ToString() == PMState.Pumping.ToString())
|
|
|
{
|
|
|
InvokeClient.Instance.Service.DoOperation($"{ModuleName}.{RtOperation.Abort}");
|
|
|
return;
|
|
@@ -636,28 +684,6 @@ namespace Venus_MainPages.ViewModels
|
|
|
|
|
|
private async void OnSetSRf()
|
|
|
{
|
|
|
- //await Task.Run(async () =>
|
|
|
- //{
|
|
|
- // if (SRFIsOn == true)
|
|
|
- // {
|
|
|
- // InvokeClient.Instance.Service.DoOperation($"{ModuleName}.SetSRf", SRFFwdPowerSetpoint, false);
|
|
|
-
|
|
|
- // }
|
|
|
- // else
|
|
|
- // {
|
|
|
- // InvokeClient.Instance.Service.DoOperation($"{ModuleName}.{VenusDevice.Match}.{AITRfOperation.SetMatchPosition}", SRFMatchC1, SRFMatchC2);
|
|
|
- // //InvokeClient.Instance.Service.DoOperation($"{ModuleName}.{VenusDevice.Match}.{AITRfOperation.SetMatchPositionC2}", SRFMatchC2);
|
|
|
- // //var t = Task.Run(async delegate
|
|
|
- // //{
|
|
|
- // // await Task.Delay(20000);
|
|
|
- // // return 42;
|
|
|
- // //});
|
|
|
- // //t.Wait();
|
|
|
- // await Task.Delay(20000);
|
|
|
- // InvokeClient.Instance.Service.DoOperation($"{ModuleName}.SetSRf", SRFFwdPowerSetpoint, true);
|
|
|
-
|
|
|
- // }
|
|
|
- //});
|
|
|
|
|
|
if (SRFIsOn == true)
|
|
|
{
|
|
@@ -675,11 +701,7 @@ namespace Venus_MainPages.ViewModels
|
|
|
});
|
|
|
await t;
|
|
|
InvokeClient.Instance.Service.DoOperation($"{ModuleName}.SetSRf", SRFFwdPowerSetpoint, true);
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
private async void OnSetBRf()
|
|
|
{
|
|
@@ -718,17 +740,17 @@ namespace Venus_MainPages.ViewModels
|
|
|
butterflyValveMessageBox.Show();
|
|
|
butterflyValveMessageBox.Owner = _mainWindow;
|
|
|
}
|
|
|
-
|
|
|
+ private void OnLoadRecipe()
|
|
|
+ {
|
|
|
+ OpenFileDialog dialog = new OpenFileDialog();
|
|
|
+ dialog.Filter = ".rcp|*.rcp";
|
|
|
+ dialog.InitialDirectory = Path.Combine(QueryDataClient.Instance.Service.GetData("GetRTPath").ToString(), "Recipes");
|
|
|
+ if (dialog.ShowDialog() == false) return;
|
|
|
+ SelectedRecipe = dialog.SafeFileName.Split('.')[0];
|
|
|
+ }
|
|
|
private void OnGasSetPoint()
|
|
|
{
|
|
|
- InvokeClient.Instance.Service.DoOperation($"{ModuleName}.MfcGas1.SetPoint", MfcGas1Setpoint);
|
|
|
- InvokeClient.Instance.Service.DoOperation($"{ModuleName}.MfcGas2.SetPoint", MfcGas2Setpoint);
|
|
|
- InvokeClient.Instance.Service.DoOperation($"{ModuleName}.MfcGas3.SetPoint", MfcGas3Setpoint);
|
|
|
- InvokeClient.Instance.Service.DoOperation($"{ModuleName}.MfcGas4.SetPoint", MfcGas4Setpoint);
|
|
|
- InvokeClient.Instance.Service.DoOperation($"{ModuleName}.MfcGas5.SetPoint", MfcGas5Setpoint);
|
|
|
- InvokeClient.Instance.Service.DoOperation($"{ModuleName}.MfcGas6.SetPoint", MfcGas6Setpoint);
|
|
|
- InvokeClient.Instance.Service.DoOperation($"{ModuleName}.MfcGas7.SetPoint", MfcGas7Setpoint);
|
|
|
- InvokeClient.Instance.Service.DoOperation($"{ModuleName}.MfcGas8.SetPoint", MfcGas8Setpoint);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
private void OnHV()
|
|
@@ -810,6 +832,8 @@ namespace Venus_MainPages.ViewModels
|
|
|
|
|
|
PositionValue = -((int)(((int)RtDataValues[$"{ModuleName}.GetPVPosition"]) * 0.09));
|
|
|
|
|
|
+ GasIsFlowing = RtDataValues[$"{ModuleName}.FsmState"].ToString() == PMState.GasFlowing.ToString() ? true : false;
|
|
|
+
|
|
|
|
|
|
|
|
|
}
|