| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609 |
- using Aitex.Core.Common.DeviceData;
- using Aitex.Core.Util;
- using Caliburn.Micro;
- using Caliburn.Micro.Core;
- using FurnaceUI.Common;
- using FurnaceUI.Models;
- using FurnaceUI.Views.Editors;
- using FurnaceUI.Views.Parameter;
- using MECF.Framework.Common.DataCenter;
- using MECF.Framework.Common.OperationCenter;
- using MECF.Framework.Common.RecipeCenter;
- using MECF.Framework.UI.Client.CenterViews.Configs.SystemConfig;
- using MECF.Framework.UI.Client.CenterViews.Dialogs;
- using MECF.Framework.UI.Client.CenterViews.Editors.Recipe;
- using MECF.Framework.UI.Client.ClientBase;
- using OpenSEMI.ClientBase;
- using RecipeEditorLib.RecipeModel.Params;
- using System;
- using System.Collections.Generic;
- using System.Collections.ObjectModel;
- using System.Linq;
- using System.Windows;
- using System.Windows.Controls;
- namespace FurnaceUI.Views.Recipes
- {
- public class ManualSetViewModel : FurnaceUIViewModelBase
- {
- #region MFCs
- [Subscription("CHM.MFC1.DeviceData")]
- public AITMfcData MFC1Data { get; set; }
- [Subscription("CHM.MFC2.DeviceData")]
- public AITMfcData MFC2Data { get; set; }
- [Subscription("CHM.MFC3.DeviceData")]
- public AITMfcData MFC3Data { get; set; }
- [Subscription("CHM.MFC4.DeviceData")]
- public AITMfcData MFC4Data { get; set; }
- [Subscription("CHM.MFC5.DeviceData")]
- public AITMfcData MFC5Data { get; set; }
- [Subscription("CHM.MFC6.DeviceData")]
- public AITMfcData MFC6Data { get; set; }
- [Subscription("CHM.MFC7.DeviceData")]
- public AITMfcData MFC7Data { get; set; }
- [Subscription("CHM.MFC8.DeviceData")]
- public AITMfcData MFC8Data { get; set; }
- [Subscription("CHM.MFC9.DeviceData")]
- public AITMfcData MFC9Data { get; set; }
- [Subscription("CHM.MFC10.DeviceData")]
- public AITMfcData MFC10Data { get; set; }
- [Subscription("CHM.MFC11.DeviceData")]
- public AITMfcData MFC11Data { get; set; }
- [Subscription("CHM.MFC12.DeviceData")]
- public AITMfcData MFC12Data { get; set; }
- [Subscription("CHM.MFC51.DeviceData")]
- public AITMfcData MFC51Data { get; set; }
- #endregion
- [Subscription("PM1.EditRecipeStepNo")]
- public int EditRecipeStepNo { get; set; }
- [Subscription("PM1.EditRecipeName")]
- public string EditRecipeName { get; set; }
- [Subscription("PM1.EditRecipeStepName")]
- public string EditRecipeStepName { get; set; }
- private int ControlMode = 1;
- private UIElement _parent;
- [Subscription("System.Heater1.DeviceData")]
- public AITHeaterData Heater1Data { get; set; }
- [Subscription("System.Heater2.DeviceData")]
- public AITHeaterData Heater2Data { get; set; }
- [Subscription("System.Heater3.DeviceData")]
- public AITHeaterData Heater3Data { get; set; }
- [Subscription("System.Heater4.DeviceData")]
- public AITHeaterData Heater4Data { get; set; }
- [Subscription("System.Heater5.DeviceData")]
- public AITHeaterData Heater5Data { get; set; }
- [Subscription("System.Heater6.DeviceData")]
- public AITHeaterData Heater6Data { get; set; }
- [Subscription("System.Heater7.DeviceData")]
- public AITHeaterData Heater7Data { get; set; }
- [Subscription("System.Heater8.DeviceData")]
- public AITHeaterData Heater8Data { get; set; }
- [Subscription("System.Heater9.DeviceData")]
- public AITHeaterData Heater9Data { get; set; }
- [Subscription("System.Heater10.DeviceData")]
- public AITHeaterData Heater10Data { get; set; }
- public AITHeaterData BottomHeaterData => ControlMode == 0 ? Heater9Data : Heater10Data;
- public AITHeaterData CenterBottomHeaterData => ControlMode == 0 ? Heater7Data : Heater8Data;
- public AITHeaterData CenterHeaterData => ControlMode == 0 ? Heater5Data : Heater6Data;
- public AITHeaterData TopCenterHeaterData => ControlMode == 0 ? Heater3Data : Heater4Data;
- public AITHeaterData TopHeaterData => ControlMode == 0 ? Heater1Data : Heater2Data;
- public void SetParent(UIElement parent)
- {
- _parent = parent;
- }
- #region"Loader Set Value"
- private Visibility _loaderSet3SpeedVisibility = Visibility.Hidden;
- public Visibility LoaderSet3SpeedVisibility
- {
- get => _loaderSet3SpeedVisibility;
- set
- {
- _loaderSet3SpeedVisibility = value;
- NotifyOfPropertyChange(nameof(LoaderSet3SpeedVisibility));
- }
- }
- private Visibility _loaderSetSpeedVisibility = Visibility.Hidden;
- public Visibility LoaderSetSpeedVisibility
- {
- get => _loaderSetSpeedVisibility;
- set
- {
- _loaderSetSpeedVisibility = value;
- NotifyOfPropertyChange(nameof(LoaderSetSpeedVisibility));
- }
- }
- private Visibility _loaderSetSpeedFloatVisibility = Visibility.Hidden;
- public Visibility LoaderSetSpeedFloatVisibility
- {
- get => _loaderSetSpeedFloatVisibility;
- set
- {
- _loaderSetSpeedFloatVisibility = value;
- NotifyOfPropertyChange(nameof(LoaderSetSpeedFloatVisibility));
- }
- }
- public void SetShowLoaderValuePanel(string selectedCmd)
- {
- switch (selectedCmd)
- {
- case "Boat Load":
- case "Boat Unload":
- LoaderSet3SpeedVisibility = Visibility.Visible;
- LoaderSetSpeedVisibility = Visibility.Hidden;
- LoaderSetSpeedFloatVisibility = Visibility.Hidden;
- break;
- case "Boat Rotate":
- LoaderSet3SpeedVisibility = Visibility.Hidden;
- LoaderSetSpeedVisibility = Visibility.Hidden;
- LoaderSetSpeedFloatVisibility = Visibility.Visible;
- break;
- case "Boat CAP2":
- LoaderSet3SpeedVisibility = Visibility.Hidden;
- LoaderSetSpeedVisibility = Visibility.Visible;
- LoaderSetSpeedFloatVisibility = Visibility.Hidden;
- break;
- case "Stop(Include R-axis)":
- case "Boat Rotate Stop":
- case "Boat Loader Home":
- case "None":
- case "NONE":
- LoaderSet3SpeedVisibility = Visibility.Hidden;
- LoaderSetSpeedVisibility = Visibility.Hidden;
- LoaderSetSpeedFloatVisibility = Visibility.Hidden;
- break;
- default:
- break;
- }
- }
- public void SetLoaderValue(string selectedCmd, string Values)
- {
- switch (selectedCmd)
- {
- case "Boat Load":
- case "Boat Unload":
- if (string.IsNullOrEmpty(Values)) return;
- string[] list = Values.Split(';');
- if (list.Length < 3) return;
- Loader3Speed1 = int.Parse(list[0]);
- Loader3Speed2 = int.Parse(list[1]);
- Loader3Speed3 = int.Parse(list[2]);
- break;
- case "Boat Rotate":
- if (string.IsNullOrEmpty(Values)) return;
- LoaderFloatRPM = double.Parse(Values);
- break;
- case "Boat CAP2":
- if (string.IsNullOrEmpty(Values)) return;
- LoaderSpeed = int.Parse(Values);
- break;
- case "Stop(Include R-axis)":
- case "Boat Rotate Stop":
- case "Boat Loader Home":
- case "None":
- break;
- default:
- break;
- }
- }
- public string GetSaveLoaderValue(string selectedCmd)
- {
- switch (selectedCmd)
- {
- case "Boat Load":
- case "Boat Unload":
- return $"{Loader3Speed1};{Loader3Speed2};{Loader3Speed3}";
- case "Boat Rotate":
- return LoaderFloatRPM.ToString();
- case "Boat CAP2":
- return LoaderSpeed.ToString();
- case "Stop(Include R-axis)":
- case "Boat Rotate Stop":
- case "Boat Loader Home":
- case "None":
- return "";
- default:
- return "";
- }
- }
- private int loader3Speed1 = 5;
- public int Loader3Speed1
- {
- get => loader3Speed1;
- set
- {
- loader3Speed1 = value;
- NotifyOfPropertyChange(nameof(Loader3Speed1));
- }
- }
- private int loader3Speed2 = 0;
- public int Loader3Speed2
- {
- get => loader3Speed2;
- set
- {
- loader3Speed2 = value;
- NotifyOfPropertyChange(nameof(Loader3Speed2));
- }
- }
- private int loader3Speed3 = 0;
- public int Loader3Speed3
- {
- get => loader3Speed3;
- set
- {
- loader3Speed3 = value;
- NotifyOfPropertyChange(nameof(Loader3Speed3));
- }
- }
- private double _loaderFloatRPM = 0;
- public double LoaderFloatRPM
- {
- get => _loaderFloatRPM;
- set
- {
- _loaderFloatRPM = value;
- NotifyOfPropertyChange(nameof(LoaderFloatRPM));
- }
- }
- private int loaderSpeed = 0;
- public int LoaderSpeed
- {
- get => loaderSpeed;
- set
- {
- loaderSpeed = value;
- NotifyOfPropertyChange(nameof(LoaderSpeed));
- }
- }
- private void ClearLoaderSetValue()
- {
- Loader3Speed1 = 0;
- Loader3Speed2 = 0;
- Loader3Speed3 = 0;
- LoaderFloatRPM = 0;
- LoaderSpeed = 0;
- }
- #endregion
- #region"PressVisibility"
- private Visibility _pressVisibility = Visibility.Hidden;
- public Visibility PressVisibility
- {
- get => _pressVisibility;
- set
- {
- _pressVisibility = value;
- NotifyOfPropertyChange(nameof(PressVisibility));
- }
- }
- private Visibility _pressSlowVacVisibility = Visibility.Hidden;
- public Visibility PressSlowVacVisibility
- {
- get => _pressSlowVacVisibility;
- set
- {
- _pressSlowVacVisibility = value;
- NotifyOfPropertyChange(nameof(PressSlowVacVisibility));
- }
- }
- private Visibility _pressValveAngleVisibility = Visibility.Hidden;
- public Visibility PressValveAngleVisibility
- {
- get => _pressValveAngleVisibility;
- set
- {
- _pressValveAngleVisibility = value;
- NotifyOfPropertyChange(nameof(PressValveAngleVisibility));
- }
- }
- private Visibility _pressWaitVisibility = Visibility.Hidden;
- public Visibility PressWaitVisibility
- {
- get => _pressWaitVisibility;
- set
- {
- _pressWaitVisibility = value;
- NotifyOfPropertyChange(nameof(PressWaitVisibility));
- }
- }
- public void SetShowPressPanel(string selectedCmd)
- {
- switch (selectedCmd)
- {
- case "Press":
- case "Press2":
- PressVisibility = Visibility.Visible;
- PressSlowVacVisibility = Visibility.Hidden;
- PressValveAngleVisibility = Visibility.Hidden;
- PressWaitVisibility = Visibility.Hidden;
- break;
- case "Slow Vac":
- PressVisibility = Visibility.Hidden;
- PressSlowVacVisibility = Visibility.Visible;
- PressValveAngleVisibility = Visibility.Hidden;
- PressWaitVisibility = Visibility.Hidden;
- break;
- case "Valve Angle":
- PressVisibility = Visibility.Hidden;
- PressSlowVacVisibility = Visibility.Hidden;
- PressValveAngleVisibility = Visibility.Visible;
- PressWaitVisibility = Visibility.Hidden;
- break;
- case "Full Open":
- case "Full Close":
- case "Hold":
- case "Zero Set":
- case "Cancel Zero":
- PressVisibility = Visibility.Hidden;
- PressSlowVacVisibility = Visibility.Hidden;
- PressValveAngleVisibility = Visibility.Hidden;
- PressWaitVisibility = Visibility.Hidden;
- break;
- case "WaitPressUp1":
- case "WaitPressDown1":
- case "WaitPressUp2":
- case "WaitPressDown2":
- PressVisibility = Visibility.Hidden;
- PressSlowVacVisibility = Visibility.Hidden;
- PressValveAngleVisibility = Visibility.Hidden;
- PressWaitVisibility = Visibility.Visible;
- break;
- default:
- break;
- }
- }
- public void SetPressValue(string selectedCmd, string Values)
- {
- switch (selectedCmd)
- {
- case "Press":
- case "Press2":
- if (string.IsNullOrEmpty(Values)) return;
- string[] list = Values.Split(';');
- if (list.Length < 2) return;
- PressPID = list[0];
- PressSet = double.Parse(list[1]);
- break;
- case "Slow Vac":
- if (string.IsNullOrEmpty(Values)) return;
- PressSlowVacSet = double.Parse(Values);
- break;
- case "Valve Angle":
- if (string.IsNullOrEmpty(Values)) return;
- PressValveAngleSet = double.Parse(Values);
- break;
- case "Full Open":
- case "Full Close":
- case "Hold":
- case "Zero Set":
- case "Cancel Zero":
- break;
- case "WaitPressUp1":
- case "WaitPressDown1":
- case "WaitPressUp2":
- case "WaitPressDown2":
- if (string.IsNullOrEmpty(Values)) return;
- PressWait = double.Parse(Values);
- break;
- default:
- break;
- }
- }
- public string GetSavePressValue(string selectedCmd)
- {
- switch (selectedCmd)
- {
- case "Press":
- case "Press2":
- return $"{PressPID};{PressSet}";
- case "Slow Vac":
- return PressSlowVacSet.ToString();
- case "Valve Angle":
- return PressValveAngleSet.ToString();
- case "Full Open":
- case "Full Close":
- case "Hold":
- case "Zero Set":
- case "Cancel Zero":
- return "";
- case "WaitPressUp1":
- case "WaitPressDown1":
- case "WaitPressUp2":
- case "WaitPressDown2":
- return PressWait.ToString();
- default:
- return "";
- }
- }
- private string _pressPID;
- public string PressPID
- {
- get => _pressPID;
- set
- {
- _pressPID = value;
- NotifyOfPropertyChange(nameof(PressPID));
- }
- }
- private double _pressSet;
- public double PressSet
- {
- get => _pressSet;
- set
- {
- _pressSet = value;
- NotifyOfPropertyChange(nameof(PressSet));
- }
- }
- private double _pressSlowVacSet;
- public double PressSlowVacSet
- {
- get => _pressSlowVacSet;
- set
- {
- _pressSlowVacSet = value;
- NotifyOfPropertyChange(nameof(PressSlowVacSet));
- }
- }
- private double _pressValveAngleSet;
- public double PressValveAngleSet
- {
- get => _pressValveAngleSet;
- set
- {
- _pressValveAngleSet = value;
- NotifyOfPropertyChange(nameof(PressValveAngleSet));
- }
- }
- private string _lowPressWait;
- public string LowPressWait
- {
- get => _lowPressWait;
- set
- {
- _lowPressWait = value;
- NotifyOfPropertyChange(nameof(LowPressWait));
- }
- }
- private double _pressWait;
- public double PressWait
- {
- get => _pressWait;
- set
- {
- _pressWait = value;
- NotifyOfPropertyChange(nameof(PressWait));
- }
- }
- private void ClearPressSetValue()
- {
- PressPID = "None";
- PressSet = 0;
- PressSlowVacSet = 0;
- PressValveAngleSet = 0;
- LowPressWait = "None";
- PressWait = 0;
- }
- #endregion
- #region AlarmRecipe Visibility
- public bool IsAlarmReicpe => RecipeType.ToLower() == "alarm";
- public bool IsAbortReicpe => RecipeType.ToLower() == "abort";
- public bool IsSubReicpe => RecipeType.ToLower() == "sub";
- public bool IsTableVisibility => IsAlarmReicpe || IsAbortReicpe || IsSubReicpe;
- public bool IsRecipeHeaderVisibility => !IsTableVisibility;
- public bool IsVPDataListVisibility => !IsTableVisibility;
- public bool IsCombinationVisibility => !IsTableVisibility;
- #endregion
- private bool _noStandbyIsEnabled = false;
- public bool NoStandbyIsEnabled
- {
- get => _noStandbyIsEnabled;
- set
- {
- _noStandbyIsEnabled = value;
- NotifyOfPropertyChange(nameof(NoStandbyIsEnabled));
- }
- }
- private Visibility _standbyIsVisibility = Visibility.Visible;
- public Visibility StandbyIsVisibility
- {
- get => _standbyIsVisibility;
- set
- {
- _standbyIsVisibility = value;
- NotifyOfPropertyChange(nameof(StandbyIsVisibility));
- }
- }
- private string _selectedGasSetting2;
- public string SelectedGasSetting2
- {
- get
- {
- return _selectedGasSetting2;
- }
- set
- {
- _selectedGasSetting2 = value;
- NotifyOfPropertyChange(nameof(SelectedGasSetting2));
- }
- }
- private string _selectedGasSetting3;
- public string SelectedGasSetting3
- {
- get
- {
- return _selectedGasSetting3;
- }
- set
- {
- _selectedGasSetting3 = value;
- NotifyOfPropertyChange(nameof(SelectedGasSetting3));
- }
- }
- private string _selectedGasSetting4;
- public string SelectedGasSetting4
- {
- get
- {
- return _selectedGasSetting4;
- }
- set
- {
- _selectedGasSetting4 = value;
- NotifyOfPropertyChange(nameof(SelectedGasSetting4));
- }
- }
- private string _selectedGasSetting5;
- public string SelectedGasSetting5
- {
- get
- {
- return _selectedGasSetting5;
- }
- set
- {
- _selectedGasSetting5 = value;
- NotifyOfPropertyChange(nameof(SelectedGasSetting5));
- }
- }
- private string _selectedGasSetting6;
- public string SelectedGasSetting6
- {
- get
- {
- return _selectedGasSetting6;
- }
- set
- {
- _selectedGasSetting6 = value;
- NotifyOfPropertyChange(nameof(SelectedGasSetting6));
- }
- }
- private List<ConfigNode> _ConfigNodes = new List<ConfigNode>();
- public List<ConfigNode> ConfigNodes
- {
- get { return _ConfigNodes; }
- set
- {
- _ConfigNodes = value;
- NotifyOfPropertyChange(nameof(ConfigNodes));
- }
- }
- private ObservableCollection<MFCGasData> _mFCDatas = new ObservableCollection<MFCGasData>();
- public ObservableCollection<TempManualSetData> TempList { get; set; } = new ObservableCollection<TempManualSetData>();
- public ObservableCollection<MFCGasData> MFCDataList
- {
- get => _mFCDatas;
- set
- {
- _mFCDatas = value;
- NotifyOfPropertyChange(nameof(MFCDataList));
- }
- }
- private string _pressureUnit;
- public string PressureUnit
- {
- get => _pressureUnit;
- set
- {
- _pressureUnit = value;
- NotifyOfPropertyChange(nameof(PressureUnit));
- }
- }
- public string RecipeType { get; set; }
- public ManualSetViewModel()
- {
- }
- protected override void OnViewLoaded(object view)
- {
- base.OnViewLoaded(view);
- }
- protected override void OnActivate()
- {
- base.OnActivate();
- //InvokeClient.Instance.Service.DoOperation($"PM1.SetSensorRecipeOK", "");
- }
- protected override void OnDeactivate(bool close)
- {
- base.OnDeactivate(close);
- //InvokeClient.Instance.Service.DoOperation($"PM1.SetSensorPROCManualOK", "");
- }
- protected override void OnInitialize()
- {
- base.OnInitialize();
- // GetHeaderConfig();
- LoadData();
- }
- private void LoadData()
- {
- }
- //撤销修改
- public void RecipeIsChangeClick(object cmdName, object value)
- {
- var windowManager = IoC.Get<IWindowManager>();
- switch ((string)cmdName)
- {
- case "Alarm":
- break;
- case "MFC":
- break;
- case "Gas":
- break;
- case "AUX":
- break;
- case "Press":
- break;
- case "Temp":
- break;
- default:
- break;
- }
- }
- public void TempSetClick(object sender)
- {
- string stSetValue = ShowNumberKeyboard(sender as Button, "");
- //foreach (var item in TempList)
- //{
- // item.Value= stSetValue;
- //}
- }
- public void RampSetClick(object sender)
- {
- string strSetRamp = ShowNumberKeyboard(sender as Button, "");
- //foreach (var item in TempList)
- //{
- // item.Rampng = strSetRamp;
- //}
- }
- private string ShowNumberKeyboard(Control control, string defaultValue)
- {
- NumberKeyboard numberKeyboard = new NumberKeyboard("", defaultValue);
- var point = control.PointFromScreen(new Point(0, 0));
- double wx = SystemParameters.WorkArea.Width;
- double hy = SystemParameters.WorkArea.Height;
- if (-point.Y + control.ActualHeight + 5 + numberKeyboard.Height < hy)
- {
- numberKeyboard.Top = -point.Y + control.ActualHeight + 5;
- }
- else
- {
- numberKeyboard.Top = -point.Y - numberKeyboard.Height - 5;
- }
- if (-point.X + numberKeyboard.Width < wx)
- {
- numberKeyboard.Left = -point.X;
- }
- else
- {
- numberKeyboard.Left = -point.X - (numberKeyboard.Width - control.ActualWidth);
- }
- if ((bool)numberKeyboard.ShowDialog())
- return numberKeyboard.ValueString;
- else
- return "Cancel";
- }
- //public void TempTextClick(string type, object sender)
- //{
- // var windowManager = IoC.Get<IWindowManager>();
- // switch (type)
- // {
- // case "Mode":
- // RecipeTempModeViewModel recipeTempModeViewModel = new RecipeTempModeViewModel();
- // var rtn = (windowManager as WindowManager)?.ShowDialogWithTitle(recipeTempModeViewModel, null, "Temp Mode");
- // if ((bool)rtn)
- // {
- // }
- // break;
- // case "Correct":
- // TempCorrectionEditViewModel tempCorrectionEditViewModel = new TempCorrectionEditViewModel();
- // //tempCorrectionEditViewModel.ResultString = SelectedRecipeStep.TemperatureCorrect;
- // //tempCorrectionEditViewModel.SelectedRecipeStep = CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault();
- // tempCorrectionEditViewModel.IsEnabledControl = false;
- // tempCorrectionEditViewModel.AutoSelectVisibility = Visibility.Visible;
- // // tempOffsetTableViewModel.SelectedRecipeStep = SelectedRecipeStep;
- // rtn = (windowManager as WindowManager)?.ShowDialogWithTitle(tempCorrectionEditViewModel, null, "Temp Correct Table");
- // if ((bool)rtn)
- // {
- // }
- // break;
- // case "PID":
- // TempOffsetTableViewModel tempOffsetTableViewModel1 = new TempOffsetTableViewModel();
- // //tempOffsetTableViewModel1.TempOffsetTableSelected = SelectedRecipeStep.TemperaturePID;
- // //tempOffsetTableViewModel1.SelectedRecipeStep = CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault();
- // rtn = (windowManager as WindowManager)?.ShowDialogWithTitle(tempOffsetTableViewModel1, null, "Temp PID Table");
- // if ((bool)rtn)
- // {
- // //SelectedRecipeStep.TemperaturePID = tempOffsetTableViewModel1.TempOffsetTableSelected;
- // //var foundStep = this.CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault();
- // //if (foundStep != null)
- // //{
- // // foundStep.TemperaturePID = tempOffsetTableViewModel1.TempOffsetTableSelected;
- // //}
- // }
- // break;
- // default:
- // break;
- // }
- //}
- public void StepEdit(object cmdName, object value)
- {
- var windowManager = IoC.Get<IWindowManager>();
- switch ((string)cmdName)
- {
- case "RecipeCommand":
- RecipeCommandViewModel recipeCommandViewModel = new RecipeCommandViewModel();
- //ObservableCollection<string> loopStepNames = new ObservableCollection<string>(CurrentRecipe.Steps.OrderBy(x => x.StepNo).Where(x => x.StepNo < SelectedRecipeStep.StepNo).Select(x => x.Name).ToList());
- //ObservableCollection<string> jumpStepNames = new ObservableCollection<string>(CurrentRecipe.Steps.OrderBy(x => x.StepNo).Where(x => x.StepNo != SelectedRecipeStep.StepNo).Select(x => x.Name).ToList());
- //recipeCommandViewModel.LoopStepNames = loopStepNames;
- //recipeCommandViewModel.JumpStepNames = jumpStepNames;
- //recipeCommandViewModel.SelectRecipeCommand = SelectedRecipeStep.Command;
- //recipeCommandViewModel.RecipeData = CurrentRecipe;
- //if ((bool)(windowManager as WindowManager)?.ShowDialogWithTitle(recipeCommandViewModel, null, "Recipe Command"))
- //{
- // SelectedRecipeStep.Command = recipeCommandViewModel.SelectRecipeCommand;
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().Command = SelectedRecipeStep.Command;
- //}
- break;
- case "ConditionCheck":
- RecipeConditionCheckSetViewModel recipeConditionCheckSetViewModel = new RecipeConditionCheckSetViewModel();
- //if (CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().ExternalSensor != null)
- //{
- // recipeConditionCheckSetViewModel.RecipeConditions.ExternalSensor = CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().ExternalSensor;
- //}
- //var step = CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault();
- //if (step != null)
- //{
- // recipeConditionCheckSetViewModel.RecipeConditions.TempStabizeSelected = step.TempStabilizeSelected;
- // recipeConditionCheckSetViewModel.RecipeConditions.FinishAutoProfile = step.FinishAutoProfile;
- // recipeConditionCheckSetViewModel.RecipeConditions.ReachTemp = step.ReachTemp;
- // recipeConditionCheckSetViewModel.RecipeConditions.ReachTempValue = step.ReachTempValue;
- // recipeConditionCheckSetViewModel.RecipeConditions.O2Density = step.O2Density;
- // recipeConditionCheckSetViewModel.RecipeConditions.O2DensityValue = step.O2DensityValue;
- // recipeConditionCheckSetViewModel.RecipeConditions.ReachPressure = step.ReachPressure;
- // recipeConditionCheckSetViewModel.RecipeConditions.ReachPressureVG = step.ReachPressureVG;
- // recipeConditionCheckSetViewModel.RecipeConditions.ReachPressureValue = step.ReachPressureValue;
- // recipeConditionCheckSetViewModel.RecipeConditions.PressureStabilizeVG = step.PressureStabilizeVG;
- // recipeConditionCheckSetViewModel.RecipeConditions.PressureStabilizeSelected = step.PressureStabilizeSelected;
- // recipeConditionCheckSetViewModel.RecipeConditions.ProcessTimeToEnd = step.ProcessTimeToEnd;
- //}
- //var result = (windowManager as WindowManager)?.ShowDialogWithTitle(recipeConditionCheckSetViewModel, null, "Condition Check");
- //if (recipeConditionCheckSetViewModel.IsSave)
- //{
- // if (recipeConditionCheckSetViewModel.IsNone)
- // {
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().IsnoneConditionCheck = true;
- // }
- // else
- // {
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().IsnoneConditionCheck = false;
- // }
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().ExternalSensor = recipeConditionCheckSetViewModel.RecipeConditions.ExternalSensor;
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().ExternalSensorName = recipeConditionCheckSetViewModel.RecipeConditions.ExternalSensorName;
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().TempStabilizeSelected = recipeConditionCheckSetViewModel.RecipeConditions.TempStabizeSelected;
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().FinishAutoProfile = recipeConditionCheckSetViewModel.RecipeConditions.FinishAutoProfile;
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().ReachTemp = recipeConditionCheckSetViewModel.RecipeConditions.ReachTemp;
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().ReachTempValue = recipeConditionCheckSetViewModel.RecipeConditions.ReachTempValue;
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().O2Density = recipeConditionCheckSetViewModel.RecipeConditions.O2Density;
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().O2DensityValue = recipeConditionCheckSetViewModel.RecipeConditions.O2DensityValue;
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().ReachPressure = recipeConditionCheckSetViewModel.RecipeConditions.ReachPressure;
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().ReachPressureVG = recipeConditionCheckSetViewModel.RecipeConditions.ReachPressureVG;
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().PressureStabilizeVG = recipeConditionCheckSetViewModel.RecipeConditions.PressureStabilizeVG;
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().ReachPressureValue = recipeConditionCheckSetViewModel.RecipeConditions.ReachPressureValue;
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().PressureStabilizeSelected = recipeConditionCheckSetViewModel.RecipeConditions.PressureStabilizeSelected;
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().ProcessTimeToEnd = recipeConditionCheckSetViewModel.RecipeConditions.ProcessTimeToEnd;
- //}
- if (recipeConditionCheckSetViewModel.IsNone)//不存数据处理
- { }
- break;
- case "AlarmAction":
- RecipeAlarmActionViewModel recipeAlarmActionViewModel = new RecipeAlarmActionViewModel
- {
- //CurrentRecipe = CurrentRecipe,
- //CurrentStepName = SelectedRecipeStep.Name,
- //TableIndex = CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().AlarmTableIndex,
- //AlarmActions = CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().AlarmActionSets
- };
- if ((bool)(windowManager as WindowManager)?.ShowDialogWithTitle(recipeAlarmActionViewModel, null, "Alarm Action"))
- {
- //CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().AlarmTableIndex = recipeAlarmActionViewModel.TableIndex;
- //CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().AlarmActionSets = recipeAlarmActionViewModel.AlarmActions;
- }
- break;
- case "TempSetting":
- //if (recipeTempSetViewModel is null)
- //{
- // recipeTempSetViewModel = new RecipeTempSetViewModel
- // {
- // RecipeTemplate = RecipeTemplate
- // };
- //}
- //if (CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().TemperatureSets != null)
- //{
- // var tempSets = CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault();
- // recipeTempSetViewModel.TemperatureValues.Clear();
- // foreach (var item in tempSets.TemperatureSets.Keys)
- // {
- // recipeTempSetViewModel.TemperatureValues[item] = tempSets.TemperatureSets[item];
- // }
- //}
- //recipeTempSetViewModel.StepType = SelectedRecipeStep.Name;
- //recipeTempSetViewModel.RecipeType = RecipeType;
- //if ((bool)(windowManager as WindowManager)?.ShowDialogWithTitle(recipeTempSetViewModel, null, "Temp Detail"))
- //{
- // if (recipeTempSetViewModel.TemperatureValues != null && recipeTempSetViewModel.TemperatureValues.Count > 0 && recipeTempSetViewModel.IsSave)
- // {
- // if (CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().TemperatureSets != null)
- // {
- // var tempSets = CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault();
- // foreach (var item in recipeTempSetViewModel.TempSetDataList)
- // {
- // if (tempSets.TemperatureSets.ContainsKey(item.Name))
- // {
- // tempSets.TemperatureSets[item.Name] = item;
- // }
- // }
- // }
- // }
- //}
- break;
- case "GASSetting":
- RecipeMFCSettingViewModel recipeMFCSettingViewModel = new RecipeMFCSettingViewModel();
- //InvokeClient.Instance.Service.DoOperation($"PM1.SetSensorRecipeOK", "");
- //var tempMFCSets = CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().MFCSets;
- //if (tempMFCSets != null && tempMFCSets.Count > 0)
- //{
- // foreach (var item in tempMFCSets.Keys)
- // {
- // if (recipeMFCSettingViewModel.MFCSets.ContainsKey(item))
- // {
- // recipeMFCSettingViewModel.MFCSets[item] = tempMFCSets[item];
- // }
- // else
- // {
- // //recipeGASSettingViewModel.MFCSets.Add(item, tempMFCSets[item]);
- // recipeMFCSettingViewModel.MFCSets.Add(item, new MFCValue() { AlarmValue = tempMFCSets[item].MinValue, IsNotifying = tempMFCSets[item].IsNotifying, MaxValue = tempMFCSets[item].MaxValue, MinValue = tempMFCSets[item].MinValue, IsCheck = tempMFCSets[item].IsCheck, Name = tempMFCSets[item].Name, Rampng = tempMFCSets[item].Rampng, Value = tempMFCSets[item].Value });
- // }
- // }
- //}
- ////recipeGASSettingViewModel.MFMSets = new MFMValue() { AlarmValue = tempMFMSets.AlarmValue, IsNotifying = tempMFMSets.IsNotifying, Name = tempMFMSets.Name, Value = tempMFMSets.Value };
- //recipeMFCSettingViewModel.RecipeType = RecipeType;
- //recipeMFCSettingViewModel.RecipeTemplate = RecipeTemplate;
- //if (!(bool)(windowManager as WindowManager)?.ShowDialogWithTitle(recipeMFCSettingViewModel, null, "MFC Detail"))
- //{
- // //InvokeClient.Instance.Service.DoOperation($"PM1.SetSensorPROCManualOK", "");
- // return;
- //}
- ////InvokeClient.Instance.Service.DoOperation($"PM1.SetSensorPROCManualOK", "");
- //if (CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().MFCSets != null)
- //{
- // if (recipeMFCSettingViewModel.MFCSets != null && recipeMFCSettingViewModel.MFCSets.Count > 0)
- // {
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().MFCSets = recipeMFCSettingViewModel.MFCSets;
- // }
- //}
- break;
- case "PressureSetting":
- RecipePressureSettingViewModel recipePressureSettingViewModel = new RecipePressureSettingViewModel();
- //var tempStep = CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault();
- //recipePressureSettingViewModel.PressureSonsorValue = tempStep.PressureSonserValue;
- //recipePressureSettingViewModel.PressureValveAngleValue = tempStep.PressureValveAngle;
- //recipePressureSettingViewModel.PressureSettingVG = tempStep.PressureSettingVG;
- //if (!string.IsNullOrEmpty(tempStep.PressureAlarmTableNo))
- //{
- // if (tempStep.PressureAlarmTableNo.ToLower() == "none")
- // recipePressureSettingViewModel.PressureAlarmWatchTable = "None";
- // else
- // recipePressureSettingViewModel.PressureAlarmWatchTable = tempStep.PressureAlarmTableNo;
- //}
- //if ((bool)(windowManager as WindowManager)?.ShowDialogWithTitle(recipePressureSettingViewModel, null, "Recipe Pressure Setting"))
- //{
- // if (CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault() != null)
- // {
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().PressureSonserValue = recipePressureSettingViewModel.PressureSonsorValue;
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().PressureValveAngle = recipePressureSettingViewModel.PressureValveAngleValue;
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().PressureAlarmTableNo = recipePressureSettingViewModel.PressureAlarmWatchTable;
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().PressureSettingVG = recipePressureSettingViewModel.PressureSettingVG;
- // SelectedRecipeStep.PressureSonserValue = $"{recipePressureSettingViewModel.PressureSonsorValue}";
- // }
- //}
- break;
- case "RFSetting":
- //RecipeRFPressureSettingViewModel recipeRFPressureSettingViewModel = new RecipeRFPressureSettingViewModel();
- //var tempRecipeStep = CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault();
- //recipeRFPressureSettingViewModel.RFSwitch = tempRecipeStep.RFSwitch;
- //recipeRFPressureSettingViewModel.RFSetPointValue = tempRecipeStep.RFSetpoint;
- //recipeRFPressureSettingViewModel.C1SetPointValue = tempRecipeStep.C1Setpoint;
- //recipeRFPressureSettingViewModel.C2SetPointValue = tempRecipeStep.C2Setpoint;
- //recipeRFPressureSettingViewModel.ForwardPowerAlarmWatchSetPointValue = tempRecipeStep.ForwardPowerAlarmWatchTable;
- //recipeRFPressureSettingViewModel.PrAlarmWatchSetPointValue = tempRecipeStep.PrAlarmWatchTable;
- //recipeRFPressureSettingViewModel.PIAlarmWatchSetPointValue = tempRecipeStep.PIAlarmWatchTable;
- //recipeRFPressureSettingViewModel.C1AlarmWatchSetPointValue = tempRecipeStep.C1AlarmWatchTable;
- //recipeRFPressureSettingViewModel.C2AlarmWatchSetPointValue = tempRecipeStep.C2AlarmWatchTable;
- //recipeRFPressureSettingViewModel.VppAlarmWatchSetPointValue = tempRecipeStep.VppAlarmWatchTable;
- //recipeRFPressureSettingViewModel.VdcAlarmWatchSetPointValue = tempRecipeStep.VdcAlarmWatchTable;
- //if ((bool)(windowManager as WindowManager)?.ShowDialogWithTitle(recipeRFPressureSettingViewModel, null, "Recipe RF Setting"))
- //{
- // if (CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault() != null)
- // {
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().RFSwitch = recipeRFPressureSettingViewModel.RFSwitch;
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().RFSetpoint = recipeRFPressureSettingViewModel.RFSetPointValue;
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().C1Setpoint = recipeRFPressureSettingViewModel.C1SetPointValue;
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().C2Setpoint = recipeRFPressureSettingViewModel.C2SetPointValue;
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().ForwardPowerAlarmWatchTable = recipeRFPressureSettingViewModel.ForwardPowerAlarmWatchSetPointValue;
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().PrAlarmWatchTable = recipeRFPressureSettingViewModel.PrAlarmWatchSetPointValue;
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().PIAlarmWatchTable = recipeRFPressureSettingViewModel.PIAlarmWatchSetPointValue;
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().C1AlarmWatchTable = recipeRFPressureSettingViewModel.C1AlarmWatchSetPointValue;
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().C2AlarmWatchTable = recipeRFPressureSettingViewModel.C2AlarmWatchSetPointValue;
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().VppAlarmWatchTable = recipeRFPressureSettingViewModel.VppAlarmWatchSetPointValue;
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().VdcAlarmWatchTable = recipeRFPressureSettingViewModel.VdcAlarmWatchSetPointValue;
- // // SelectedRecipeStep.RFSetting = $"{recipeRFPressureSettingViewModel.RFSetPointValue}";
- // }
- //}
- break;
- case "Loader":
- RecipeLoaderCommandViewModel recipeLoaderCommandViewModel = new RecipeLoaderCommandViewModel();
- //tempStep = CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault();
- //recipeLoaderCommandViewModel.SelectedCmd = tempStep.LoaderCommand;
- //if ((bool)(windowManager as WindowManager)?.ShowDialogWithTitle(recipeLoaderCommandViewModel, null, "Loader Command"))
- //{
- // if (tempStep.LoaderCommand != recipeLoaderCommandViewModel.ReturnString)
- // {
- // ClearLoaderSetValue();
- // }
- // tempStep.LoaderCommand = recipeLoaderCommandViewModel.ReturnString;
- // SelectedRecipeStep.LoaderCommand = recipeLoaderCommandViewModel.ReturnString;
- // SetShowLoaderValuePanel(recipeLoaderCommandViewModel.ReturnString);
- //}
- break;
- case "Pressure":
- RecipePressCommandViewModel recipePressCommandViewModel = new RecipePressCommandViewModel();
- //tempStep = CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault();
- //recipePressCommandViewModel.SelectedCmd = tempStep.PressCommand;
- //if ((bool)(windowManager as WindowManager)?.ShowDialogWithTitle(recipePressCommandViewModel, null, "Press Command"))
- //{
- // tempStep.PressCommand = recipePressCommandViewModel.ReturnString;
- // SelectedRecipeStep.PressCommand = recipePressCommandViewModel.ReturnString;
- // SetShowPressPanel(recipePressCommandViewModel.ReturnString);
- //}
- break;
- case "Pattern":
- RecipeGasPanelSettingViewModel recipeGasPanelSettingViewModel = new RecipeGasPanelSettingViewModel();
- //recipeGasPanelSettingViewModel.CurrentRecipe = CurrentRecipe;
- //recipeGasPanelSettingViewModel.SelectedStepName = $"{SelectedRecipeStep.StepNo}:{SelectedRecipeStep.Name}";
- //recipeGasPanelSettingViewModel.ChangedStepEvent += RecipeGasPanelSettingViewModel_ChangedStepEvent;
- //recipeGasPanelSettingViewModel.SelectedStep = CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault();
- //if ((bool)(windowManager as WindowManager)?.ShowDialogWithTitle(recipeGasPanelSettingViewModel, null, "Valve"))
- //{
- //}
- break;
- case "BoatElevatorSetting":
- BoatElevatorSettingViewModel boatElevatorSettingViewModel = new BoatElevatorSettingViewModel();
- //boatElevatorSettingViewModel.SelectedRecipeStep = SelectedRecipeStep;
- //if ((bool)(windowManager as WindowManager)?.ShowDialogWithTitle(boatElevatorSettingViewModel, null, "BoatElevator Setting"))
- //{
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().ZAxisPosition = boatElevatorSettingViewModel.SelectedRecipeStep.ZAxisPosition;
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().ZAxisSpeed = boatElevatorSettingViewModel.SelectedRecipeStep.ZAxisSpeed;
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().RotatePosition = boatElevatorSettingViewModel.SelectedRecipeStep.RotatePosition;
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().RotateSpeed = boatElevatorSettingViewModel.SelectedRecipeStep.RotateSpeed;
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().RotateInterval = boatElevatorSettingViewModel.SelectedRecipeStep.RotateInterval;
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().RotateDirection = boatElevatorSettingViewModel.SelectedRecipeStep.RotateDirection;
- //}
- break;
- case "AUX":
- RecipeAUXSetViewModel recipeAUXSetViewModel = new RecipeAUXSetViewModel();
- if ((bool)(windowManager as WindowManager)?.ShowDialogWithTitle(recipeAUXSetViewModel, null, "AUX Set"))
- {
- }
- break;
- case "RecipeHeader":
- RecipeHeaderViewModel recipeHeaderViewModel = new RecipeHeaderViewModel();
- if ((bool)(windowManager as WindowManager)?.ShowDialogWithTitle(recipeHeaderViewModel, null, "Recipe Header"))
- {
- }
- break;
- case "Combination":
- //StringParam strCombination = CurrentRecipe.ConfigItems.FirstOrDefault(x => x.Name == "Combination") as StringParam;
- //RecipeCombinationViewModel recipeCombinationViewModel = new RecipeCombinationViewModel();
- //recipeCombinationViewModel.CombinationStr = strCombination.Value;
- //if ((bool)(windowManager as WindowManager)?.ShowDialogWithTitle(recipeCombinationViewModel, null, "Combination"))
- //{
- // strCombination.Value = recipeCombinationViewModel.Combination.ToString();
- //}
- break;
- case "VPDataList":
- RecipeVPItemSelectViewModel recipeVPItemSelectViewModel = new RecipeVPItemSelectViewModel();
- if ((bool)(windowManager as WindowManager)?.ShowDialogWithTitle(recipeVPItemSelectViewModel, null, "VP Item Select"))
- {
- }
- break;
- case "AbortRecipe":
- //Step currentStep = CurrentRecipe.Steps.FirstOrDefault(x => x.StepNo == SelectedRecipeStep.StepNo);
- //StringParam abortCombination = CurrentRecipe.ConfigItems.FirstOrDefault(x => x.Name == "Combination") as StringParam;
- //Combination combination = new Combination(abortCombination.Value);
- //if (string.IsNullOrEmpty(combination.AbortRecipePath))
- //{
- // DialogBox.ShowError("Please select abort recipe first!");
- //}
- //var retRecipe = RecipeTableSelect.ShowDialog($"Furnace\\abort", combination.AbortRecipePath, false);
- //if (!string.IsNullOrEmpty(retRecipe))
- //{
- // currentStep.AbortRecipeTableIndex = retRecipe;
- // SelectedRecipeStep.AbortRecipeTableIndex = retRecipe;
- //}
- break;
- case "SkipOrWait":
- RecipeSkipWaitCommandViewModel recipeSkipWaitCommandViewModel = new RecipeSkipWaitCommandViewModel();
- //recipeSkipWaitCommandViewModel.SkipWait = CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().SkipWait;
- //if ((bool)(windowManager as WindowManager)?.ShowDialogWithTitle(recipeSkipWaitCommandViewModel, null, "Skip or wait command"))
- //{
- // CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault().SkipWait = recipeSkipWaitCommandViewModel.RtnString;
- // SelectedRecipeStep.SkipWait = recipeSkipWaitCommandViewModel.RtnString;
- //}
- break;
- default:
- break;
- }
- }
- public void RecipeSave()
- {
- //if (!string.IsNullOrEmpty(type) && item != null && sender != null)
- //{
- // MFCData mFCData = (MFCData)item;
- // string value = ((TextBox)sender).Text;
- // switch (type)
- // {
- // case "Value":
- // InvokeClient.Instance.Service.DoOperation($"CHM.{mFCData.DisplayName}.SetMfcVirtualValue", $"{value};{mFCData.Rampng};{mFCData.AlarmValue}");
- // break;
- // case "Rampng":
- // InvokeClient.Instance.Service.DoOperation($"CHM.{mFCData.DisplayName}.SetMfcVirtualValue", $"{mFCData.Value};{value};{mFCData.AlarmValue}");
- // SetRampngValue(mFCData.DisplayName, value);
- // break;
- // default:
- // break;
- // }
- //}
- //var result = this._recipeProvider.SaveRecipe(CurrentRecipe.PrefixPath, CurrentRecipe.Name, CurrentRecipe.GetXmlString());
- //if (result)
- ((Window)GetView()).Close();
- }
- public List<ConfigNode> GetMfcItem()
- {
- this.SystemName = "System";
- ConfigNodes = SystemConfigProvider.Instance.GetConfigTree(SystemName).SubNodes;
- var MfcItems = ConfigNodes.Where(x => x.Display == "Parameter").FirstOrDefault().SubNodes.Where(y => y.Name == "MFC").FirstOrDefault().SubNodes;
- return MfcItems;
- }
- public void RecipeCancel()
- {
- if (DialogBox.ShowDialog(DialogButton.Yes | DialogButton.No, DialogType.CONFIRM, " You confirm that you want to unsave the recipe and exit the interface?") == DialogButton.No)
- return;
- ((Window)GetView()).Close();
- }
- public void PressPIDChick()
- {
- var windowManager = IoC.Get<IWindowManager>();
- TempOffsetTableViewModel tempOffsetTableViewModel1 = new TempOffsetTableViewModel();
- // tempOffsetTableViewModel1.TempOffsetTableSelected = SelectedRecipeStep.TemperaturePID;
- var rtn = (windowManager as WindowManager)?.ShowDialogWithTitle(tempOffsetTableViewModel1, null, "Temp Correct Table");
- if ((bool)rtn)
- {
- PressPID = tempOffsetTableViewModel1.TempOffsetTableSelected;
- }
- }
- protected override void InvokeAfterUpdateProperty(Dictionary<string, object> data)
- {
- base.InvokeAfterUpdateProperty(data);
- UpdateGASSetting();
- UpdateHeaterSetting();
- oldresult = data;
- }
- Dictionary<string, object> oldresult;
- private void UpdateGASSetting()
- {
- List<AITMfcData> mfcDatas = new List<AITMfcData>()
- {
- MFC1Data,
- MFC2Data,
- MFC3Data,
- MFC4Data,
- MFC5Data,
- MFC6Data,
- MFC7Data,
- MFC8Data,
- MFC9Data,
- MFC10Data,
- MFC11Data,
- MFC12Data,
- MFC51Data,
- };
- if (MFCDataList.Count == 0)
- {
- for (int i = 0; i < mfcDatas.Count; i++)
- {
- if (mfcDatas[i] == null)
- continue;
- MFCDataList.Add(new MFCGasData()
- {
- Name = mfcDatas[i].DeviceName,
- DisplayName = mfcDatas[i].DisplayName,
- ActualValue = mfcDatas[i].FeedBack,
- Value = mfcDatas[i].VirtualFeedBack,
- ActualRampng = mfcDatas[i].Ramping,
- Rampng = mfcDatas[i].VirtualRamping,
- Unit = mfcDatas[i].Unit,
- }); ;
- }
- }
- else
- {
- for (int i = 0; i < MFCDataList.Count; i++)
- {
- var findMFC = mfcDatas.FirstOrDefault(x => x.DeviceName == MFCDataList[i].Name);
- if (findMFC != null)
- {
- MFCDataList[i].ActualValue = findMFC.FeedBack;
- MFCDataList[i].ActualRampng = findMFC.Ramping;
- }
- };
- }
- }
- private void UpdateHeaterSetting()
- {
- if (Heater2Data != null && Heater4Data != null && Heater6Data != null && Heater8Data != null && Heater10Data != null)
- {
- List<AITHeaterData> heaterDatas = new List<AITHeaterData>()
- {
- BottomHeaterData,
- CenterBottomHeaterData,
- CenterHeaterData,
- TopCenterHeaterData,
- TopHeaterData
- };
- if (TempList.Count == 0)
- {
- for (int i = 0; i < heaterDatas.Count; i++)
- {
- TempList.Add(new TempManualSetData()
- {
- Name = heaterDatas[i].DeviceName,
- DisplayName = heaterDatas[i].DisplayName,
- ActualValue = heaterDatas[i].FeedBack,
- Value = heaterDatas[i].SetPoint,
- ActualRampng = heaterDatas[i].Ramping,
- Rampng = heaterDatas[i].RampSetPoint,
- Unit = heaterDatas[i].Unit,
- });
- }
- }
- else
- {
- for (int i = 0; i < TempList.Count; i++)
- {
- var findHeater = heaterDatas.FirstOrDefault(x => x.DeviceName == TempList[i].Name);
- if (findHeater != null)
- {
- TempList[i].ActualValue = findHeater.FeedBack;
- TempList[i].ActualRampng = findHeater.Ramping;
- }
- };
- }
- }
- }
- }
- public class MFCGasData : PropertyChangedBase
- {
- private int _no;
- public int No
- {
- get => _no;
- set
- {
- _no = value;
- NotifyOfPropertyChange(nameof(No));
- }
- }
- private string _name;
- public string Name
- {
- get => _name;
- set
- {
- _name = value;
- NotifyOfPropertyChange(nameof(Name));
- }
- }
- public string _unit;
- public string Unit
- {
- get => _unit;
- set
- {
- _unit = value;
- NotifyOfPropertyChange(nameof(Unit));
- }
- }
- private string _displayName;
- public string DisplayName
- {
- get => _displayName;
- set
- {
- _displayName = value;
- NotifyOfPropertyChange(nameof(DisplayName));
- }
- }
- private string _controlName;
- public string ControlName
- {
- get => _controlName;
- set
- {
- _controlName = value;
- NotifyOfPropertyChange(nameof(ControlName));
- }
- }
- private double _actualValue;
- public double ActualValue
- {
- get => _actualValue;
- set
- {
- _actualValue = value;
- NotifyOfPropertyChange(nameof(ActualValue));
- }
- }
- private double _value;
- public double Value
- {
- get => _value;
- set
- {
- _value = value;
- NotifyOfPropertyChange(nameof(Value));
- }
- }
- private double _actualRampng;
- public double ActualRampng
- {
- get => _actualRampng; set
- {
- _actualRampng = value;
- NotifyOfPropertyChange(nameof(ActualRampng));
- }
- }
- private double _rampng;
- public double Rampng
- {
- get => _rampng; set
- {
- _rampng = value;
- NotifyOfPropertyChange(nameof(Rampng));
- }
- }
- private string _maxValue;
- public string MaxValue
- {
- get => _maxValue; set
- {
- _maxValue = value;
- NotifyOfPropertyChange(nameof(MaxValue));
- }
- }
- private string _minValue;
- public string MinValue
- {
- get => _minValue; set
- {
- _minValue = value;
- NotifyOfPropertyChange(nameof(MinValue));
- }
- }
- private bool _isChanged = true;
- public bool IsChanged
- {
- get => _isChanged;
- set
- {
- _isChanged = value;
- NotifyOfPropertyChange(nameof(IsChanged));
- }
- }
- }
- public class TempManualSetData : PropertyChangedBase
- {
- private int _no;
- public int No
- {
- get => _no;
- set
- {
- _no = value;
- NotifyOfPropertyChange("No");
- }
- }
- private string _name;
- public string Name
- {
- get => _name;
- set
- {
- _name = value;
- NotifyOfPropertyChange("Name");
- }
- }
- private string _displayName;
- public string DisplayName
- {
- get => _displayName;
- set
- {
- _displayName = value;
- NotifyOfPropertyChange(nameof(DisplayName));
- }
- }
- private string _controlName;
- public string ControlName
- {
- get => _controlName;
- set
- {
- _controlName = value;
- NotifyOfPropertyChange(nameof(ControlName));
- }
- }
- private double _actualValue;
- public double ActualValue
- {
- get => _actualValue;
- set
- {
- _actualValue = value;
- NotifyOfPropertyChange(nameof(ActualValue));
- }
- }
- private double _value;
- public double Value
- {
- get => _value;
- set
- {
- _value = value;
- NotifyOfPropertyChange(nameof(Value));
- }
- }
- private double _actualRampng;
- public double ActualRampng
- {
- get => _actualRampng; set
- {
- _actualRampng = value;
- NotifyOfPropertyChange(nameof(ActualRampng));
- }
- }
- private double _rampng;
- public double Rampng
- {
- get => _rampng; set
- {
- _rampng = value;
- NotifyOfPropertyChange(nameof(Rampng));
- }
- }
- private string _maxValue;
- public string MaxValue
- {
- get => _maxValue; set
- {
- _maxValue = value;
- NotifyOfPropertyChange(nameof(MaxValue));
- }
- }
- private string _minValue;
- public string MinValue
- {
- get => _minValue; set
- {
- _minValue = value;
- NotifyOfPropertyChange(nameof(MinValue));
- }
- }
- private bool _isChanged = true;
- public bool IsChanged
- {
- get => _isChanged;
- set
- {
- _isChanged = value;
- NotifyOfPropertyChange(nameof(IsChanged));
- }
- }
- private string _unit;
- public string Unit
- {
- get => _unit;
- set
- {
- _unit = value;
- NotifyOfPropertyChange("Unit");
- }
- }
- }
- }
|