123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547 |
- using Aitex.Core.Common.DeviceData;
- using Aitex.Core.RT.IOCore;
- using Aitex.Core.RT.Log;
- using Aitex.Core.Util;
- using Caliburn.Micro;
- using Caliburn.Micro.Core;
- using FurnaceUI.Client;
- using FurnaceUI.Common;
- using FurnaceUI.Models;
- using FurnaceUI.Views.Editors;
- using FurnaceUI.Views.Operations;
- using FurnaceUI.Views.Parameter;
- using FurnaceUI.Views.Status;
- 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.Reflection;
- using System.Windows;
- using System.Windows.Controls;
- namespace FurnaceUI.Views.Recipes
- {
- public class ManualSetViewModel : FurnaceUIViewModelBase
- {
- [Subscription("PM1.CurrentAuxData")]
- public List<AITAuxData> AUXDetailDatas { get; set; }
- public string DefaultUnit { get; set; }
- #region MFCs
- [Subscription("PM1.MFC1.DeviceData")]
- public AITMfcData MFC1Data { get; set; }
- [Subscription("PM1.MFC2.DeviceData")]
- public AITMfcData MFC2Data { get; set; }
- [Subscription("PM1.MFC3.DeviceData")]
- public AITMfcData MFC3Data { get; set; }
- [Subscription("PM1.MFC4.DeviceData")]
- public AITMfcData MFC4Data { get; set; }
- [Subscription("PM1.MFC5.DeviceData")]
- public AITMfcData MFC5Data { get; set; }
- [Subscription("PM1.MFC6.DeviceData")]
- public AITMfcData MFC6Data { get; set; }
- [Subscription("PM1.MFC7.DeviceData")]
- public AITMfcData MFC7Data { get; set; }
- [Subscription("PM1.MFC8.DeviceData")]
- public AITMfcData MFC8Data { get; set; }
- [Subscription("PM1.MFC9.DeviceData")]
- public AITMfcData MFC9Data { get; set; }
- [Subscription("PM1.MFC10.DeviceData")]
- public AITMfcData MFC10Data { get; set; }
- [Subscription("PM1.MFC11.DeviceData")]
- public AITMfcData MFC11Data { get; set; }
- [Subscription("PM1.MFC12.DeviceData")]
- public AITMfcData MFC12Data { get; set; }
- [Subscription("PM1.MFC13.DeviceData")]
- public AITMfcData MFC13Data { get; set; }
- [Subscription("PM1.MFC14.DeviceData")]
- public AITMfcData MFC14Data { get; set; }
- [Subscription("PM1.MFC15.DeviceData")]
- public AITMfcData MFC15Data { get; set; }
- [Subscription("PM1.MFC16.DeviceData")]
- public AITMfcData MFC16Data { get; set; }
- [Subscription("PM1.MFC17.DeviceData")]
- public AITMfcData MFC17Data { get; set; }
- [Subscription("PM1.MFC31.DeviceData")]
- public AITMfcData MFC31Data { get; set; }
- [Subscription("PM1.MFC32.DeviceData")]
- public AITMfcData MFC32Data { get; set; }
- [Subscription("PM1.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.HeaterU.DeviceData")]
- public AITHeaterData HeaterUData { get; set; }
- [Subscription("System.HeaterCU.DeviceData")]
- public AITHeaterData HeaterCUData { get; set; }
- [Subscription("System.HeaterC.DeviceData")]
- public AITHeaterData HeaterCData { get; set; }
- [Subscription("System.HeaterCL.DeviceData")]
- public AITHeaterData HeaterCLData { get; set; }
- [Subscription("System.HeaterL.DeviceData")]
- public AITHeaterData HeaterLData { get; set; }
- public AITHeaterData BottomHeaterData => HeaterLData;
- public AITHeaterData CenterBottomHeaterData => HeaterCLData;
- public AITHeaterData CenterHeaterData => HeaterCData;
- public AITHeaterData TopCenterHeaterData => HeaterCUData;
- public AITHeaterData TopHeaterData => HeaterUData;
- [Subscription("PM1.APC.DeviceData")]
- public AITAPCData APCData { get; set; }
- IWindowManager wm = IoC.Get<IWindowManager>();
- private string _selectBtnName;
- public string SelectBtnName
- {
- get { return _selectBtnName; }
- set { _selectBtnName = value; this.NotifyOfPropertyChange(nameof(SelectBtnName)); }
- }
- private string _temperatureControlMode;
- public string TemperatureControlMode
- {
- get => _temperatureControlMode;
- set
- {
- _temperatureControlMode = value;
- NotifyOfPropertyChange(nameof(TemperatureControlMode));
- }
- }
- private string _temperatureCorrect;
- public string TemperatureCorrect
- {
- get => _temperatureCorrect;
- set
- {
- _temperatureCorrect = value;
- NotifyOfPropertyChange(nameof(TemperatureCorrect));
- }
- }
- private string _temperaturePID;
- public string TemperaturePID
- {
- get => _temperaturePID;
- set
- {
- _temperaturePID = value;
- NotifyOfPropertyChange(nameof(TemperaturePID));
- }
- }
- private string _loaderCommand = "";
- public string LoaderCommand
- {
- get => _loaderCommand;
- set
- {
- _loaderCommand = value;
- NotifyOfPropertyChange(nameof(LoaderCommand));
- NotifyOfPropertyChange(nameof(LoaderCommandIsSaved));
- }
- }
- public string OldLoaderCommand { get; set; } = "";
- public void SetParent(UIElement parent)
- {
- _parent = parent;
- }
- public bool LoaderCommandIsSaved
- {
- get => LoaderCommand == OldLoaderCommand;
- }
- #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));
- }
- }
- private string _pressCommand = "";
- public string PressCommand
- {
- get => _pressCommand;
- set
- {
- _pressCommand = value;
- NotifyOfPropertyChange(nameof(PressCommand));
- NotifyOfPropertyChange(nameof(PressCommandIsSaved));
- }
- }
- public string OldPressCommand { get; set; } = "";
- public bool PressCommandIsSaved
- {
- get => _pressCommand == OldPressCommand;
- }
- 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;
- LoaderRPM = 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 $"{selectedCmd};{Loader3Speed1};{Loader3Speed2};{Loader3Speed3}";
- case "Boat Rotate":
- return $"{selectedCmd};{LoaderRPM.ToString()}";
- case "Boat CAP2":
- return $"{selectedCmd};{LoaderSpeed.ToString()}";
- case "Stop(Include R-axis)":
- case "Boat Rotate Stop":
- case "Boat Loader Home":
- case "None":
- return $"{selectedCmd};";
- 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 _loaderRPM = 0;
- public double LoaderRPM
- {
- get => _loaderRPM;
- set
- {
- _loaderRPM = value;
- NotifyOfPropertyChange(nameof(LoaderRPM));
- }
- }
- private int loaderSpeed = 0;
- public int LoaderSpeed
- {
- get => loaderSpeed;
- set
- {
- loaderSpeed = value;
- NotifyOfPropertyChange(nameof(LoaderSpeed));
- }
- }
- private void ClearLoaderSetValue()
- {
- Loader3Speed1 = 0;
- Loader3Speed2 = 0;
- Loader3Speed3 = 0;
- LoaderRPM = 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));
- }
- }
- private string _pressureCommand;
- public string PressureCommand
- {
- get => _pressureCommand;
- set
- {
- _pressureCommand = value;
- }
- }
- 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":
- case "Home":
- case "None":
- 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 = "None";
- 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));
- }
- }
- public ObservableCollection<TempManualSetData> TempList { get; set; } = new ObservableCollection<TempManualSetData>();
- private ObservableCollection<MFCGasData> _mFCDatas = new ObservableCollection<MFCGasData>();
- 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", "");
- LoadData();
- }
- protected override void OnDeactivate(bool close)
- {
- base.OnDeactivate(close);
- //InvokeClient.Instance.Service.DoOperation($"PM1.SetSensorPROCManualOK", "");
- }
- protected override void OnInitialize()
- {
- base.OnInitialize();
- // GetHeaderConfig();
- }
- private void LoadData()
- {
- firstUpdate = true;
- }
- //撤销修改
- 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, "", 1);
- foreach (var item in TempList)
- {
- item.Value = stSetValue;
- item.IsSetChanged = false;
- }
- }
- public Dictionary<string, bool> DictValve { get; set; } = new Dictionary<string, bool>();
- public Dictionary<string, string> DictMFC { get; set; } = new Dictionary<string, string>();
- public Dictionary<string, string> DictMFCRamp { get; set; } = new Dictionary<string, string>();
- public Dictionary<string, bool> PumpSetValues { get; set; } = new Dictionary<string, bool>();
- public Dictionary<string, bool> F2HFClnOrHFCl2Values { get; set; } = new Dictionary<string, bool>();
- private Dictionary<string, string> ChangedDictMFC(Dictionary<string, double> oldDict)
- {
- Dictionary<string, string> rtnKeyValue = new Dictionary<string, string>();
- foreach (var item in oldDict.Keys)
- {
- rtnKeyValue.Add(item, oldDict[item].ToString());
- }
- return rtnKeyValue;
- }
- public void PatternCmd()
- {
- string toolType = (string)QueryDataClient.Instance.Service.GetConfig("System.SetUp.ToolType");
- if (!string.IsNullOrEmpty(toolType) && toolType.Equals(ConstantsCommon.ELK))
- {
- FurnaceUI.Views.Maintenances.Maintenances.ELK.GasPanelViewModel gasPanelTwoView = new Maintenances.Maintenances.ELK.GasPanelViewModel();
- gasPanelTwoView.MFCDataList = MFCDataList;
- var rtn = (wm as WindowManager)?.ShowDialogWithTitle(gasPanelTwoView, null, " Gas Panel");
- if ((bool)rtn)
- {
- DictValve = gasPanelTwoView.DictChangedValve;
- DictMFC = ChangedDictMFC(gasPanelTwoView.DictChangedMFC);
- DictMFCRamp = ChangedDictMFC(gasPanelTwoView.DictChangedMFCRamp);
- foreach (var item in DictMFC)
- {
- var tempMFC = MFCDataList.FirstOrDefault(x => x.Name == item.Key);
- if (tempMFC != null)
- {
- tempMFC.IsSetChanged = false;
- tempMFC.Value = item.Value;
- }
- }
- foreach (var item in DictMFCRamp)
- {
- var tempMFC = MFCDataList.FirstOrDefault(x => x.Name == item.Key);
- if (tempMFC != null)
- {
- tempMFC.IsRampngChanged = false;
- tempMFC.Rampng = item.Value;
- }
- }
- if (DictMFC.Count == 0 && DictMFCRamp.Count == 0)
- {
- for (int i = 0; i < MFCDataList.Count; i++)
- {
- double setLastPoint = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{MFCDataList[i].DisplayName}.SetLastPoint");
- double setLastRamping = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{MFCDataList[i].DisplayName}.SetLastRamping");
- MFCDataList[i].Value = setLastPoint.ToString("f3");
- MFCDataList[i].Rampng = setLastRamping.ToString("f3");
- MFCDataList[i].IsSetChanged = true;
- MFCDataList[i].IsRampngChanged = true;
- };
- }
- if (gasPanelTwoView.DictChangedPumpValve.Count > 0)
- {
- PumpSetValues.Clear();
- if (gasPanelTwoView.AGVPumpData != null && gasPanelTwoView.AGVPumpData.DefaultValue != gasPanelTwoView.AGVPumpData.Feedback)
- {
- PumpSetValues.Add(gasPanelTwoView.AGVPumpData.UniqueName, gasPanelTwoView.AGVPumpData.Feedback);
- // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.AGVPumpData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.AGVPumpData.Feedback);
- }
- if (gasPanelTwoView.AGV2PumpData != null && gasPanelTwoView.AGV2PumpData.DefaultValue != gasPanelTwoView.AGV2PumpData.Feedback)
- {
- PumpSetValues.Add(gasPanelTwoView.AGV2PumpData.UniqueName, gasPanelTwoView.AGV2PumpData.Feedback);
- }
- if (gasPanelTwoView.AUCPumpData != null && gasPanelTwoView.AUCPumpData.DefaultValue != gasPanelTwoView.AUCPumpData.Feedback)
- {
- PumpSetValues.Add(gasPanelTwoView.AUCPumpData.UniqueName, gasPanelTwoView.AUCPumpData.Feedback);
- // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.AUCPumpData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.AUCPumpData.Feedback);
- }
- if (gasPanelTwoView.BothPump1Data != null && gasPanelTwoView.BothPump1Data.DefaultValue != gasPanelTwoView.BothPump1Data.Feedback)
- {
- PumpSetValues.Add(gasPanelTwoView.BothPump1Data.UniqueName, gasPanelTwoView.BothPump1Data.Feedback);
- // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.BothPumpData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.BothPumpData.Feedback);
- }
- if (gasPanelTwoView.BothPump2Data != null && gasPanelTwoView.BothPump2Data.DefaultValue != gasPanelTwoView.BothPump2Data.Feedback)
- {
- PumpSetValues.Add(gasPanelTwoView.BothPump2Data.UniqueName, gasPanelTwoView.BothPump2Data.Feedback);
- // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.BothPumpData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.BothPumpData.Feedback);
- }
- if (gasPanelTwoView.ValveBWRData != null && gasPanelTwoView.ValveBWRData.DefaultValue != gasPanelTwoView.ValveBWRData.Feedback)
- {
- PumpSetValues.Add(gasPanelTwoView.ValveBWRData.UniqueName, gasPanelTwoView.ValveBWRData.Feedback);
- // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.ValveBWRData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.ValveBWRData.Feedback);
- }
- if (gasPanelTwoView.ValveDPRData != null && gasPanelTwoView.ValveDPRData.DefaultValue != gasPanelTwoView.ValveDPRData.Feedback)
- {
- PumpSetValues.Add(gasPanelTwoView.ValveDPRData.UniqueName, gasPanelTwoView.ValveDPRData.Feedback);
- // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.ValveDPRData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.ValveDPRData.Feedback);
- }
- if (gasPanelTwoView.HREFData != null && gasPanelTwoView.HREFData.DefaultValue != gasPanelTwoView.HREFData.Feedback)
- {
- PumpSetValues.Add(gasPanelTwoView.HREFData.UniqueName, gasPanelTwoView.HREFData.Feedback);
- }
- if (gasPanelTwoView.CREF2Data != null && gasPanelTwoView.CREF2Data.DefaultValue != gasPanelTwoView.CREF2Data.Feedback)
- {
- PumpSetValues.Add(gasPanelTwoView.CREF2Data.UniqueName, gasPanelTwoView.CREF2Data.Feedback);
-
- }
- if (gasPanelTwoView.HZEROData != null && gasPanelTwoView.HZEROData.DefaultValue != gasPanelTwoView.HZEROData.Feedback)
- {
- PumpSetValues.Add(gasPanelTwoView.HZEROData.UniqueName, gasPanelTwoView.HZEROData.Feedback);
- }
- if (gasPanelTwoView.HMNTData != null && gasPanelTwoView.HMNTData.DefaultValue != gasPanelTwoView.HMNTData.Feedback)
- {
- PumpSetValues.Add(gasPanelTwoView.HMNTData.UniqueName, gasPanelTwoView.HMNTData.Feedback);
- }
- if (gasPanelTwoView.CMNTData != null && gasPanelTwoView.CMNTData.DefaultValue != gasPanelTwoView.CMNTData.Feedback)
- {
- PumpSetValues.Add(gasPanelTwoView.CMNTData.UniqueName, gasPanelTwoView.CMNTData.Feedback);
- }
- if (gasPanelTwoView.CZEROData != null && gasPanelTwoView.CZEROData.DefaultValue != gasPanelTwoView.CZEROData.Feedback)
- {
- PumpSetValues.Add(gasPanelTwoView.CZEROData.UniqueName, gasPanelTwoView.CZEROData.Feedback);
- }
- F2HFClnOrHFCl2Values.Clear();
- if (gasPanelTwoView.IsDEPOOn != gasPanelTwoView.IsOldDEPOOn)
- {
- F2HFClnOrHFCl2Values.Add("PM1.SetDEPOEnable", gasPanelTwoView.IsDEPOOn);
- // InvokeClient.Instance.Service.DoOperation($"PM1.SetF2ClnEnable", gasPanelTwoView.IsF2ClnOn);
- }
- if (gasPanelTwoView.IsF2ClnOn != gasPanelTwoView.IsOldF2ClnOn)
- {
- F2HFClnOrHFCl2Values.Add("PM1.SetF2ClnEnable", gasPanelTwoView.IsF2ClnOn);
- // InvokeClient.Instance.Service.DoOperation($"PM1.SetF2ClnEnable", gasPanelTwoView.IsF2ClnOn);
- }
- if (gasPanelTwoView.IsHFClnOn != gasPanelTwoView.IsOldHFClnOn)
- {
- F2HFClnOrHFCl2Values.Add("PM1.SetHFClnEnable", gasPanelTwoView.IsHFClnOn);
- //InvokeClient.Instance.Service.DoOperation($"PM1.SetHFClnEnable", gasPanelTwoView.IsHFClnOn);
- }
- if (gasPanelTwoView.IsHTR1Enable != gasPanelTwoView.IsOldHTR1Enable)
- {
- F2HFClnOrHFCl2Values.Add("PM1.SetHTR1Enable", gasPanelTwoView.IsHTR1Enable);
- // InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR1Enable", gasPanelTwoView.IsHTR1Enable);
- }
- if (gasPanelTwoView.IsHTR2Enable != gasPanelTwoView.IsOldHTR2Enable)
- {
- F2HFClnOrHFCl2Values.Add("PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
- //InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
- }
- if (gasPanelTwoView.IsHTR3Enable != gasPanelTwoView.IsOldHTR3Enable)
- {
- F2HFClnOrHFCl2Values.Add("PM1.SetHTR3Enable", gasPanelTwoView.IsHTR3Enable);
- //InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
- }
- if (gasPanelTwoView.IsCEXHOn != gasPanelTwoView.IsOldCEXHOn)
- {
- F2HFClnOrHFCl2Values.Add("PM1.SetCEXHEnable", gasPanelTwoView.IsCEXHOn);
- //InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
- }
- if (gasPanelTwoView.IsCREFOn != gasPanelTwoView.IsOldCREFOn)
- {
- F2HFClnOrHFCl2Values.Add("PM1.SetCREFEnable", gasPanelTwoView.IsCREFOn);
- //InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
- }
- if (gasPanelTwoView.IsSIREFOn != gasPanelTwoView.IsOldSIREFOn)
- {
- F2HFClnOrHFCl2Values.Add("PM1.SetSIREFEnable", gasPanelTwoView.IsSIREFOn);
- //InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
- }
- }
- }
- }
- else if (!string.IsNullOrEmpty(toolType) && toolType.Equals(ConstantsCommon.SIBCN))
- {
- FurnaceUI.Views.Maintenances.Maintenances.SiBCN.GasPanelViewModel gasPanelTwoView = new Maintenances.Maintenances.SiBCN.GasPanelViewModel();
- gasPanelTwoView.MFCDataList = MFCDataList;
- var rtn = (wm as WindowManager)?.ShowDialogWithTitle(gasPanelTwoView, null, " Gas Panel");
- if ((bool)rtn)
- {
- DictValve = gasPanelTwoView.DictChangedValve;
- DictMFC = ChangedDictMFC(gasPanelTwoView.DictChangedMFC);
- foreach (var item in DictMFC)
- {
- var tempMFC = MFCDataList.FirstOrDefault(x => x.Name == item.Key);
- if (tempMFC != null)
- {
- tempMFC.IsSetChanged = false;
- tempMFC.Value = item.Value;
- }
- }
- if (DictMFC.Count == 0)
- {
- for (int i = 0; i < MFCDataList.Count; i++)
- {
- double setLastPoint = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{MFCDataList[i].DisplayName}.SetLastPoint");
- double setLastRamping = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{MFCDataList[i].DisplayName}.SetLastRamping");
- MFCDataList[i].Value = setLastPoint.ToString("f3");
- MFCDataList[i].Rampng = setLastRamping.ToString("f3");
- MFCDataList[i].IsSetChanged = true;
- };
- }
- if (gasPanelTwoView.DictChangedPumpValve.Count > 0)
- {
- PumpSetValues.Clear();
- if (gasPanelTwoView.AGVPumpData != null && gasPanelTwoView.AGVPumpData.DefaultValue != gasPanelTwoView.AGVPumpData.Feedback)
- {
- PumpSetValues.Add(gasPanelTwoView.AGVPumpData.UniqueName, gasPanelTwoView.AGVPumpData.Feedback);
- // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.AGVPumpData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.AGVPumpData.Feedback);
- }
- if (gasPanelTwoView.AUCPumpData != null && gasPanelTwoView.AUCPumpData.DefaultValue != gasPanelTwoView.AUCPumpData.Feedback)
- {
- PumpSetValues.Add(gasPanelTwoView.AUCPumpData.UniqueName, gasPanelTwoView.AUCPumpData.Feedback);
- // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.AUCPumpData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.AUCPumpData.Feedback);
- }
- if (gasPanelTwoView.BothPumpData != null && gasPanelTwoView.BothPumpData.DefaultValue != gasPanelTwoView.BothPumpData.Feedback)
- {
- PumpSetValues.Add(gasPanelTwoView.BothPumpData.UniqueName, gasPanelTwoView.BothPumpData.Feedback);
- // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.BothPumpData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.BothPumpData.Feedback);
- }
- if (gasPanelTwoView.ValveBWRData != null && gasPanelTwoView.ValveBWRData.DefaultValue != gasPanelTwoView.ValveBWRData.Feedback)
- {
- PumpSetValues.Add(gasPanelTwoView.ValveBWRData.UniqueName, gasPanelTwoView.ValveBWRData.Feedback);
- // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.ValveBWRData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.ValveBWRData.Feedback);
- }
- if (gasPanelTwoView.ValveDPRData != null && gasPanelTwoView.ValveDPRData.DefaultValue != gasPanelTwoView.ValveDPRData.Feedback)
- {
- PumpSetValues.Add(gasPanelTwoView.ValveDPRData.UniqueName, gasPanelTwoView.ValveDPRData.Feedback);
- // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.ValveDPRData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.ValveDPRData.Feedback);
- }
- F2HFClnOrHFCl2Values.Clear();
- if (gasPanelTwoView.IsDEPOOn != gasPanelTwoView.IsOldDEPOOn)
- {
- F2HFClnOrHFCl2Values.Add("PM1.SetDEPOEnable", gasPanelTwoView.IsDEPOOn);
- // InvokeClient.Instance.Service.DoOperation($"PM1.SetF2ClnEnable", gasPanelTwoView.IsF2ClnOn);
- }
- if (gasPanelTwoView.IsF2ClnOn != gasPanelTwoView.IsOldF2ClnOn)
- {
- F2HFClnOrHFCl2Values.Add("PM1.SetF2ClnEnable", gasPanelTwoView.IsF2ClnOn);
- // InvokeClient.Instance.Service.DoOperation($"PM1.SetF2ClnEnable", gasPanelTwoView.IsF2ClnOn);
- }
- if (gasPanelTwoView.IsHFClnOn != gasPanelTwoView.IsOldHFClnOn)
- {
- F2HFClnOrHFCl2Values.Add("PM1.SetHFClnEnable", gasPanelTwoView.IsHFClnOn);
- //InvokeClient.Instance.Service.DoOperation($"PM1.SetHFClnEnable", gasPanelTwoView.IsHFClnOn);
- }
- if (gasPanelTwoView.IsHTR1Enable != gasPanelTwoView.IsOldHTR1Enable)
- {
- F2HFClnOrHFCl2Values.Add("PM1.SetHTR1Enable", gasPanelTwoView.IsHTR1Enable);
- // InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR1Enable", gasPanelTwoView.IsHTR1Enable);
- }
- if (gasPanelTwoView.IsHTR2Enable != gasPanelTwoView.IsOldHTR2Enable)
- {
- F2HFClnOrHFCl2Values.Add("PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
- //InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
- }
- if (gasPanelTwoView.IsHTR3Enable != gasPanelTwoView.IsOldHTR3Enable)
- {
- F2HFClnOrHFCl2Values.Add("PM1.SetHTR3Enable", gasPanelTwoView.IsHTR3Enable);
- //InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
- }
- if (gasPanelTwoView.IsCEXHOn != gasPanelTwoView.IsOldCEXHOn)
- {
- F2HFClnOrHFCl2Values.Add("PM1.SetCEXHEnable", gasPanelTwoView.IsCEXHOn);
- //InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
- }
- }
- }
- }
- else if (!string.IsNullOrEmpty(toolType) && toolType.Equals(ConstantsCommon.TiN))
- {
- FurnaceUI.Views.Maintenances.Maintenances.TiN.GasPanelViewModel gasPanelTwoView = new Maintenances.Maintenances.TiN.GasPanelViewModel();
- gasPanelTwoView.MFCDataList = MFCDataList;
- var rtn = (wm as WindowManager)?.ShowDialogWithTitle(gasPanelTwoView, null, " Gas Panel");
- if ((bool)rtn)
- {
- DictValve = gasPanelTwoView.DictChangedValve;
- DictMFC = ChangedDictMFC(gasPanelTwoView.DictChangedMFC);
- foreach (var item in DictMFC)
- {
- var tempMFC = MFCDataList.FirstOrDefault(x => x.Name == item.Key);
- if (tempMFC != null)
- {
- tempMFC.IsSetChanged = false;
- tempMFC.Value = item.Value;
- }
- }
- if (DictMFC.Count == 0)
- {
- for (int i = 0; i < MFCDataList.Count; i++)
- {
- double setLastPoint = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{MFCDataList[i].DisplayName}.SetLastPoint");
- double setLastRamping = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{MFCDataList[i].DisplayName}.SetLastRamping");
- MFCDataList[i].Value = setLastPoint.ToString("f3");
- MFCDataList[i].Rampng = setLastRamping.ToString("f3");
- MFCDataList[i].IsSetChanged = true;
- };
- }
- if (gasPanelTwoView.DictChangedPumpValve.Count > 0)
- {
- PumpSetValues.Clear();
- if (gasPanelTwoView.AGVPumpData != null && gasPanelTwoView.AGVPumpData.DefaultValue != gasPanelTwoView.AGVPumpData.Feedback)
- {
- PumpSetValues.Add(gasPanelTwoView.AGVPumpData.UniqueName, gasPanelTwoView.AGVPumpData.Feedback);
- // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.AGVPumpData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.AGVPumpData.Feedback);
- }
- if (gasPanelTwoView.AUCPumpData != null && gasPanelTwoView.AUCPumpData.DefaultValue != gasPanelTwoView.AUCPumpData.Feedback)
- {
- PumpSetValues.Add(gasPanelTwoView.AUCPumpData.UniqueName, gasPanelTwoView.AUCPumpData.Feedback);
- // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.AUCPumpData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.AUCPumpData.Feedback);
- }
- if (gasPanelTwoView.BothPumpData != null && gasPanelTwoView.BothPumpData.DefaultValue != gasPanelTwoView.BothPumpData.Feedback)
- {
- PumpSetValues.Add(gasPanelTwoView.BothPumpData.UniqueName, gasPanelTwoView.BothPumpData.Feedback);
- // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.BothPumpData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.BothPumpData.Feedback);
- }
- if (gasPanelTwoView.ValveBWRData != null && gasPanelTwoView.ValveBWRData.DefaultValue != gasPanelTwoView.ValveBWRData.Feedback)
- {
- PumpSetValues.Add(gasPanelTwoView.ValveBWRData.UniqueName, gasPanelTwoView.ValveBWRData.Feedback);
- // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.ValveBWRData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.ValveBWRData.Feedback);
- }
- if (gasPanelTwoView.ValveDPRData != null && gasPanelTwoView.ValveDPRData.DefaultValue != gasPanelTwoView.ValveDPRData.Feedback)
- {
- PumpSetValues.Add(gasPanelTwoView.ValveDPRData.UniqueName, gasPanelTwoView.ValveDPRData.Feedback);
- // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.ValveDPRData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.ValveDPRData.Feedback);
- }
- F2HFClnOrHFCl2Values.Clear();
- if (gasPanelTwoView.IsDEPOOn != gasPanelTwoView.IsOldDEPOOn)
- {
- F2HFClnOrHFCl2Values.Add("PM1.SetDEPOEnable", gasPanelTwoView.IsDEPOOn);
- // InvokeClient.Instance.Service.DoOperation($"PM1.SetF2ClnEnable", gasPanelTwoView.IsF2ClnOn);
- }
- if (gasPanelTwoView.IsF2ClnOn != gasPanelTwoView.IsOldF2ClnOn)
- {
- F2HFClnOrHFCl2Values.Add("PM1.SetF2ClnEnable", gasPanelTwoView.IsF2ClnOn);
- // InvokeClient.Instance.Service.DoOperation($"PM1.SetF2ClnEnable", gasPanelTwoView.IsF2ClnOn);
- }
- if (gasPanelTwoView.IsHFClnOn != gasPanelTwoView.IsOldHFClnOn)
- {
- F2HFClnOrHFCl2Values.Add("PM1.SetHFClnEnable", gasPanelTwoView.IsHFClnOn);
- //InvokeClient.Instance.Service.DoOperation($"PM1.SetHFClnEnable", gasPanelTwoView.IsHFClnOn);
- }
- if (gasPanelTwoView.IsHTR1Enable != gasPanelTwoView.IsOldHTR1Enable)
- {
- F2HFClnOrHFCl2Values.Add("PM1.SetHTR1Enable", gasPanelTwoView.IsHTR1Enable);
- // InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR1Enable", gasPanelTwoView.IsHTR1Enable);
- }
- if (gasPanelTwoView.IsHTR2Enable != gasPanelTwoView.IsOldHTR2Enable)
- {
- F2HFClnOrHFCl2Values.Add("PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
- //InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
- }
- if (gasPanelTwoView.IsHTR3Enable != gasPanelTwoView.IsOldHTR3Enable)
- {
- F2HFClnOrHFCl2Values.Add("PM1.SetHTR3Enable", gasPanelTwoView.IsHTR3Enable);
- //InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
- }
- if (gasPanelTwoView.IsCEXHOn != gasPanelTwoView.IsOldCEXHOn)
- {
- F2HFClnOrHFCl2Values.Add("PM1.SetCEXHEnable", gasPanelTwoView.IsCEXHOn);
- //InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
- }
- }
- }
- }
- else
- {
- FurnaceUI.Views.Maintenances.GasPanelTwoViewModel gasPanelTwoView = new FurnaceUI.Views.Maintenances.GasPanelTwoViewModel();
- gasPanelTwoView.MFCDataList = MFCDataList;
- var rtn = (wm as WindowManager)?.ShowDialogWithTitle(gasPanelTwoView, null, " Gas Panel");
- if ((bool)rtn)
- {
- DictValve = gasPanelTwoView.DictChangedValve;
- DictMFC = ChangedDictMFC(gasPanelTwoView.DictChangedMFC);
- foreach (var item in DictMFC)
- {
- var tempMFC = MFCDataList.FirstOrDefault(x => x.Name == item.Key);
- if (tempMFC != null)
- {
- tempMFC.IsSetChanged = false;
- tempMFC.Value = item.Value;
- }
- }
- if (DictMFC.Count == 0)
- {
- for (int i = 0; i < MFCDataList.Count; i++)
- {
- double setLastPoint = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{MFCDataList[i].DisplayName}.SetLastPoint");
- double setLastRamping = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{MFCDataList[i].DisplayName}.SetLastRamping");
- MFCDataList[i].Value = setLastPoint.ToString("f3");
- MFCDataList[i].Rampng = setLastRamping.ToString("f3");
- MFCDataList[i].IsSetChanged = true;
- };
- }
- if (gasPanelTwoView.DictChangedPumpValve.Count > 0)
- {
- PumpSetValues.Clear();
- if (gasPanelTwoView.AGVPumpData != null && gasPanelTwoView.AGVPumpData.DefaultValue != gasPanelTwoView.AGVPumpData.Feedback)
- {
- PumpSetValues.Add(gasPanelTwoView.AGVPumpData.UniqueName, gasPanelTwoView.AGVPumpData.Feedback);
- // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.AGVPumpData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.AGVPumpData.Feedback);
- }
- if (gasPanelTwoView.AUCPumpData != null && gasPanelTwoView.AUCPumpData.DefaultValue != gasPanelTwoView.AUCPumpData.Feedback)
- {
- PumpSetValues.Add(gasPanelTwoView.AUCPumpData.UniqueName, gasPanelTwoView.AUCPumpData.Feedback);
- // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.AUCPumpData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.AUCPumpData.Feedback);
- }
- if (gasPanelTwoView.BothPumpData != null && gasPanelTwoView.BothPumpData.DefaultValue != gasPanelTwoView.BothPumpData.Feedback)
- {
- PumpSetValues.Add(gasPanelTwoView.BothPumpData.UniqueName, gasPanelTwoView.BothPumpData.Feedback);
- // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.BothPumpData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.BothPumpData.Feedback);
- }
- if (gasPanelTwoView.ValveBWRData != null && gasPanelTwoView.ValveBWRData.DefaultValue != gasPanelTwoView.ValveBWRData.Feedback)
- {
- PumpSetValues.Add(gasPanelTwoView.ValveBWRData.UniqueName, gasPanelTwoView.ValveBWRData.Feedback);
- // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.ValveBWRData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.ValveBWRData.Feedback);
- }
- if (gasPanelTwoView.ValveDPRData != null && gasPanelTwoView.ValveDPRData.DefaultValue != gasPanelTwoView.ValveDPRData.Feedback)
- {
- PumpSetValues.Add(gasPanelTwoView.ValveDPRData.UniqueName, gasPanelTwoView.ValveDPRData.Feedback);
- // InvokeClient.Instance.Service.DoOperation($"{gasPanelTwoView.ValveDPRData.UniqueName}.{AITValveOperation.GVTurnValve}", gasPanelTwoView.ValveDPRData.Feedback);
- }
- F2HFClnOrHFCl2Values.Clear();
- if (gasPanelTwoView.IsF2ClnOn != gasPanelTwoView.IsOldF2ClnOn)
- {
- F2HFClnOrHFCl2Values.Add("PM1.SetF2ClnEnable", gasPanelTwoView.IsF2ClnOn);
- // InvokeClient.Instance.Service.DoOperation($"PM1.SetF2ClnEnable", gasPanelTwoView.IsF2ClnOn);
- }
- if (gasPanelTwoView.IsHFClnOn != gasPanelTwoView.IsOldHFClnOn)
- {
- F2HFClnOrHFCl2Values.Add("PM1.SetHFClnEnable", gasPanelTwoView.IsHFClnOn);
- //InvokeClient.Instance.Service.DoOperation($"PM1.SetHFClnEnable", gasPanelTwoView.IsHFClnOn);
- }
- if (gasPanelTwoView.IsHTR1Enable != gasPanelTwoView.IsOldHTR1Enable)
- {
- F2HFClnOrHFCl2Values.Add("PM1.SetHTR1Enable", gasPanelTwoView.IsHTR1Enable);
- // InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR1Enable", gasPanelTwoView.IsHTR1Enable);
- }
- if (gasPanelTwoView.IsHTR2Enable != gasPanelTwoView.IsOldHTR2Enable)
- {
- F2HFClnOrHFCl2Values.Add("PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
- //InvokeClient.Instance.Service.DoOperation($"PM1.SetHTR2Enable", gasPanelTwoView.IsHTR2Enable);
- }
- }
- }
- }
- }
- public void SwitchPage(string page)
- {
- switch (page)
- {
- case "Pressure":
- {
- ClientApp.Instance.SwitchPage("maintenance", "GasPanel", null);
- }
- break;
- }
- }
- public void RampSetClick(object sender)
- {
- string strSetRamp = ShowNumberKeyboard(sender as Button, "", 1);
- foreach (var item in TempList)
- {
- item.Rampng = strSetRamp;
- item.IsRampngChanged = false;
- }
- }
- private string ShowNumberKeyboard(Control control, string defaultValue, int keepDecimals = -1)
- {
- NumberKeyboard numberKeyboard = new NumberKeyboard("", defaultValue);
- numberKeyboard.KeepDecimals = keepDecimals;
- 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";
- }
- private string SplitTemperatureControlMode(string str)
- {
- if (string.IsNullOrEmpty(str))
- {
- return str;
- }
- if (str.Contains("Profile("))
- {
- return str.Replace("Profile(", "").Replace(")", "").Replace(",", ":");
- }
- return str;
- }
- public void TempTextClick(string type, object sender)
- {
- switch (type)
- {
- case "Mode":
- RecipeTempModeViewModel recipeTempModeViewModel = new RecipeTempModeViewModel();
- recipeTempModeViewModel.SelectBtnName = SelectBtnName;
- recipeTempModeViewModel.IsManualSet = true;
- recipeTempModeViewModel.SelectProfileTable = SplitTemperatureControlMode(TemperatureControlMode);
- var rtn = (wm as WindowManager)?.ShowDialogWithTitle(recipeTempModeViewModel, null, "Temp Mode");
- if ((bool)rtn)
- {
- SelectBtnName = recipeTempModeViewModel.SelectBtnName;
- if (null != recipeTempModeViewModel && !string.IsNullOrEmpty(recipeTempModeViewModel.ResultString) && recipeTempModeViewModel.ResultString.Contains("Profile"))
- {
- SelectBtnName = "Profile";
- }
- if (!string.IsNullOrEmpty(recipeTempModeViewModel.ResultString) && recipeTempModeViewModel.ResultString.Contains("Profile(,"))
- {
- recipeTempModeViewModel.ResultString = recipeTempModeViewModel.ResultString.Replace("Profile(,", "Profile(");
- }
- TemperatureControlMode = recipeTempModeViewModel.ResultString;
- }
- break;
- case "Correct":
- TempCorrectionEditViewModel tempCorrectionEditViewModel = new TempCorrectionEditViewModel();
- tempCorrectionEditViewModel.ResultString = TemperatureCorrect;
- tempCorrectionEditViewModel.IsManualSet = true;
- //tempCorrectionEditViewModel.SelectedRecipeStep = CurrentRecipe.Steps.Where(x => x.StepNo == SelectedRecipeStep.StepNo).FirstOrDefault();
- tempCorrectionEditViewModel.IsEnabledControl = false;
- tempCorrectionEditViewModel.AutoSelectVisibility = Visibility.Visible;
- // tempOffsetTableViewModel.SelectedRecipeStep = SelectedRecipeStep;
- rtn = (wm as WindowManager)?.ShowDialogWithTitle(tempCorrectionEditViewModel, null, "Temp Correct Table");
- if ((bool)rtn)
- {
- TemperatureCorrect = tempCorrectionEditViewModel.ResultString;
- }
- break;
- case "PID":
- TempOffsetTableViewModel tempOffsetTableViewModel1 = new TempOffsetTableViewModel();
- tempOffsetTableViewModel1.CboAutoSelectChecked = false;
- tempOffsetTableViewModel1.IsEnabledControl = false;
- tempOffsetTableViewModel1.IsManualSet = true;
- tempOffsetTableViewModel1.TempOffsetTableSelected = TemperaturePID;
- rtn = (wm as WindowManager)?.ShowDialogWithTitle(tempOffsetTableViewModel1, null, "Temp PID Table");
- if ((bool)rtn)
- {
- TemperaturePID = tempOffsetTableViewModel1.TempOffsetTableSelected;
- }
- break;
- default:
- break;
- }
- }
- private ObservableCollection<AUXData> _aUXDatas;
- public void StepEdit(object cmdName, object value)
- {
- switch ((string)cmdName)
- {
- 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();
- recipeLoaderCommandViewModel.SetRecipeProcessEditViewEnable = false;
- if ((bool)(wm as WindowManager)?.ShowDialogWithTitle(recipeLoaderCommandViewModel, null, "Loader Command"))
- {
- ClearLoaderSetValue();
- LoaderCommand = recipeLoaderCommandViewModel.ReturnString;
- SetShowLoaderValuePanel(recipeLoaderCommandViewModel.ReturnString);
- }
- break;
- case "Pressure":
- ManualPressCommandViewModel recipePressCommandViewModel = new ManualPressCommandViewModel();
- recipePressCommandViewModel.SetRecipeProcessEditViewEnable = false;
- recipePressCommandViewModel.SelectedCmd = PressCommand;
- if ((bool)(wm as WindowManager)?.ShowDialogWithTitle(recipePressCommandViewModel, null, "Press Command"))
- {
- DefaultUnit = recipePressCommandViewModel.DefaultUnit;
- string returnString = recipePressCommandViewModel.ReturnString;
- PressCommand = returnString;
- SetShowPressPanel(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)(wm 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 (_aUXDatas != null && _aUXDatas.Count > 0)
- {
- recipeAUXSetViewModel.AUXDataList.Clear();
- _aUXDatas.ToList().ForEach(x => recipeAUXSetViewModel.AUXDataList.Add(x));
- }
- else
- {
- int i = 1;
- recipeAUXSetViewModel.AUXDataList.Clear();
- foreach (var item in AUXDetailDatas)
- {
- var tempAux = new AUXData();
- tempAux.No = i;
- tempAux.ControlName = i.ToString();
- tempAux.DisplayName = item.DisplayName;
- tempAux.SetValue = new DoubleParam() { Name = "SetValue", Value = item.SetPoint.ToString() };
- tempAux.IsCheck = new BoolParam() { Name = "IsCheck", Value = false };
- tempAux.MaxValue = new DoubleParam() { Name = "MaxValue", Value = item.WarningHighLimit.ToString() };
- tempAux.MinValue = new DoubleParam() { Name = "MinValue", Value = item.WarningLowLimit.ToString() };
- tempAux.SetUnit = new StringParam() { Name = "SetUnit", Value = item.Unit };
- recipeAUXSetViewModel.AUXDataList.Add(tempAux);
- i++;
- }
- }
- if ((bool)(wm as WindowManager)?.ShowDialogWithTitle(recipeAUXSetViewModel, null, "AUX Set"))
- {
- _aUXDatas = recipeAUXSetViewModel.AUXDataList;
- }
- break;
- case "RecipeHeader":
- RecipeHeaderViewModel recipeHeaderViewModel = new RecipeHeaderViewModel();
- if ((bool)(wm 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)(wm as WindowManager)?.ShowDialogWithTitle(recipeVPItemSelectViewModel, null, "VP Item Select"))
- {
- }
- 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 MFCTextChanged(string type, object sender, object item)
- {
- try
- {
- if (!string.IsNullOrEmpty(type) && item != null && sender != null)
- {
- MFCGasData mFCData = (MFCGasData)item;
- string value = ((TextBox)sender).Text;
- string proStr = $"{mFCData.Name}Data";
- Type type1 = typeof(ManualSetViewModel);
- PropertyInfo property = type1.GetProperty(proStr);
- if (property == null) return;
- AITMfcData aITMfcData = (AITMfcData)property.GetValue(this);
- double setValue = 0;
- double.TryParse(value, out setValue);
- switch (type)
- {
- case "Value":
- mFCData.Value = value;
- if (setValue != aITMfcData.SetPoint)
- {
- mFCData.IsSetChanged = false;
- }
- else
- {
- // mFCData.IsSetChanged = true;
- }
- break;
- case "Rampng":
- mFCData.Rampng = value;
- if (setValue != aITMfcData.Ramping)
- {
- mFCData.IsRampngChanged = false;
- }
- else
- {
- // mFCData.IsRampngChanged = true;
- }
- break;
- default:
- break;
- }
- }
- }
- catch (Exception ex)
- {
- LOG.Write(ex);
- }
- }
- public void TempTextChanged(string type, object sender, object item)
- {
- try
- {
- if (!string.IsNullOrEmpty(type) && item != null && sender != null)
- {
- TempManualSetData tempData = (TempManualSetData)item;
- string value = ((TextBox)sender).Text;
- string proStr = tempData.ControlName;
- Type type1 = typeof(ManualSetViewModel);
- PropertyInfo property = type1.GetProperty(proStr);
- if (property == null) return;
- AITHeaterData aITHeaterData = (AITHeaterData)property.GetValue(this);
- double setValue = 0;
- double.TryParse(value, out setValue);
- switch (type)
- {
- case "Value":
- tempData.Value = value;
- if (setValue != aITHeaterData.SetPoint)
- {
- tempData.IsSetChanged = false;
- }
- else
- {
- // tempData.IsSetChanged = false;
- }
- break;
- case "Ramp":
- tempData.Rampng = value;
- if (setValue != aITHeaterData.RampSetPoint)
- {
- tempData.IsRampngChanged = false;
- }
- else
- {
- // tempData.IsRampngChanged = false;
- }
- break;
- default:
- break;
- }
- }
- }
- catch (Exception ex)
- {
- LOG.Write(ex);
- }
- }
- private string oldPressStr = "";
- public void Exec()
- {
- if (!DialogBox.Confirm("Are you sure to execute?"))
- return;
- if (DictValve != null && DictValve.Count > 0)
- {
- InvokeClient.Instance.Service.DoOperation($"PM1.SetAll{AITValveOperation.GVTurnValve}", DictValve);
- }
- if (MFCDataList != null && MFCDataList.Count() > 0)
- {
- Dictionary<string, string> setChangedMFC = new Dictionary<string, string>();
- var changedList = MFCDataList.ToList().Where(x => !x.IsSetChanged);
- foreach (var item in changedList)
- {
- setChangedMFC.Add(item.Name, item.Value);
- }
- InvokeClient.Instance.Service.DoOperation($"PM1.SetAllMfcValue", setChangedMFC);
- MFCDataList.ToList().ForEach(x =>
- {
- if (!x.IsSetChanged)
- {
- // InvokeClient.Instance.Service.DoOperation($"PM1.{x.DisplayName}.SetMfcValue", $"{x.Value};{x.Rampng};{x.AlarmValue}");
- InvokeClient.Instance.Service.DoOperation($"System.SetConfig", $"PM1.MFC.{x.DisplayName}.SetLastPoint", x.Value);
- x.IsSetChanged = true;
- }
- if (!x.IsRampngChanged)
- {
- InvokeClient.Instance.Service.DoOperation($"PM1.{x.DisplayName}.SetMfcValue", $"{x.Value};{x.Rampng};{x.AlarmValue}");
- InvokeClient.Instance.Service.DoOperation($"System.SetConfig", $"PM1.MFC.{x.DisplayName}.SetLastRamping", x.Rampng);
- x.IsRampngChanged = true;
- }
- });
- }
- var pressStr = GetPressString();
- if (oldPressStr != pressStr || (DictValve != null && DictValve.ContainsKey("ValveAV71")))
- {
- if ((CheckIsChanged(pressStr) && pressStr != ";;;") || (DictValve != null && DictValve.ContainsKey("ValveAV71")))
- {
- if (DictValve != null && DictValve.ContainsKey("ValveAV71"))
- InvokeClient.Instance.Service.DoOperation($"PM1.APC.SetManualParameters", $"{pressStr};{DictValve["ValveAV71"]}");
- else
- InvokeClient.Instance.Service.DoOperation($"PM1.APC.SetManualParameters", $"{pressStr}");
- }
- }
- OldPressCommand = PressCommand;
- oldPressStr = pressStr;
- if (HeaterUData.CorrectTable != TemperatureCorrect || HeaterUData.PIDTable != TemperaturePID || HeaterUData.ControlModeSetpoint != TemperatureControlMode)
- {
- string[] tempPra = new string[] { TemperatureControlMode, TemperatureCorrect, TemperaturePID };
- InvokeClient.Instance.Service.DoOperation("PM1.Heater.SetParameters", string.Join(";", tempPra));
- }
- if (TempList != null && TempList.Count() > 0)
- {
- TempList.ToList().ForEach(x =>
- {
- if (!x.IsRampngChanged || !x.IsSetChanged)
- {
- InvokeClient.Instance.Service.DoOperation($"System.{x.Name}.SetManualParameters", $"{x.Value};{x.Rampng}");
- if (!x.IsSetChanged)
- {
- InvokeClient.Instance.Service.DoOperation($"System.SetConfig", $"PM1.Heater.{x.Name}.SetLastPoint", x.Value);
- }
- if (!x.IsRampngChanged)
- {
- InvokeClient.Instance.Service.DoOperation($"System.SetConfig", $"PM1.Heater.{x.Name}.SetLastRamping", x.Rampng);
- }
- x.IsSetChanged = true;
- x.IsRampngChanged = true;
- }
- });
- }
- if (!string.IsNullOrEmpty(LoaderCommand))
- {
- if (OldLoaderCommand != LoaderCommand)
- {
- InvokeClient.Instance.Service.DoOperation("PM1.SetBoatManualMotion", GetSaveLoaderValue(LoaderCommand));
- }
- OldLoaderCommand = LoaderCommand;
- }
- if (PumpSetValues.Count > 0)
- {
- PumpSetValues.ToList().ForEach(x => InvokeClient.Instance.Service.DoOperation($"{x.Key}.{AITValveOperation.GVTurnValve}", x.Value));
- }
- if (F2HFClnOrHFCl2Values.Count > 0)
- {
- F2HFClnOrHFCl2Values.ToList().ForEach(x => InvokeClient.Instance.Service.DoOperation(x.Key, x.Value));
- }
- }
- private bool CheckIsChanged(string value)
- {
- string[] strList = value.Split(';');
- if (APCData.CommandSetPoint != strList[0])
- {
- return true;
- }
- if (APCData.PIDTable != strList[1])
- {
- return true;
- }
- float.TryParse(strList[2], out float set);
- if (APCData.SetPoint != set)
- {
- return true;
- }
- if (APCData.LowPressWaitSetPoint != strList[3])
- {
- return true;
- }
- return false;
- }
- 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;
- }
- else
- {
- UpdateGASSetting(true);
- UpdateHeaterSetting();
- ClearSetValue();
- }
- // ((Window)GetView()).Close();
- }
- public void PressPIDChick()
- {
- var windowManager = IoC.Get<IWindowManager>();
- var defaultAPCPID = SystemConfigProvider.Instance.GetValueByName("PM1.APCPID");
- if (string.IsNullOrEmpty(defaultAPCPID))
- {
- DialogBox.ShowDialog(DialogButton.Cancel, DialogType.INFO, "Please set the default file first");
- return;
- }
- int last = defaultAPCPID.LastIndexOf('\\');
- var pix = defaultAPCPID.Substring(0, last);
- var file = defaultAPCPID.Substring(last + 1, defaultAPCPID.Length - last - 1);
- APCPIDEditViewModel aPCPIDEditViewModel = new APCPIDEditViewModel(pix, file);
- aPCPIDEditViewModel.IsEditEnabled = false;
- var rtn = (windowManager as WindowManager)?.ShowDialogWithTitle(aPCPIDEditViewModel, null, "APC PID Table");
- if ((bool)rtn)
- {
- PressPID = aPCPIDEditViewModel.RetrunString;
- }
- }
- private bool firstUpdate = true;
- private void ClearSetValue()
- {
- TemperatureControlMode = "";
- TemperatureCorrect = "";
- TemperaturePID = "";
- ClearLoaderSetValue();
- LoaderCommand = "";
- SetShowLoaderValuePanel("None");
- PressCommand = "";
- SetShowPressPanel("None");
- }
- protected override void InvokeAfterUpdateProperty(Dictionary<string, object> data)
- {
- base.InvokeAfterUpdateProperty(data);
- if (firstUpdate)
- {
- UpdateGASSetting(false);
- UpdateHeaterSetting();
- firstUpdate = false;
- }
- }
- private void UpdateGASSetting(bool upDataMfcSetPoint)
- {
- List<AITMfcData> allmfcDatas = new List<AITMfcData>()
- {
- MFC1Data,
- MFC2Data,
- MFC3Data,
- MFC4Data,
- MFC5Data,
- MFC6Data,
- MFC7Data,
- MFC8Data,
- MFC9Data,
- MFC10Data,
- MFC11Data,
- MFC12Data,
- MFC13Data,
- MFC14Data,
- MFC15Data,
- MFC16Data,
- MFC17Data,
- MFC31Data,
- MFC32Data,
- MFC51Data,
- };
- List<AITMfcData> mfcDatas = new List<AITMfcData>()
- {
- };
- foreach (var item in allmfcDatas)
- {
- if (item != null)
- {
- mfcDatas.Add(item);
- }
- }
- if (MFCDataList.Count == 0)
- {
- for (int i = 0; i < mfcDatas.Count; i++)
- {
- if (mfcDatas[i] == null)
- continue;
- double setLastPoint = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{mfcDatas[i].DeviceName}.SetLastPoint");
- double setLastRamping = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{mfcDatas[i].DeviceName}.SetLastRamping");
- //MFCDataList.Add(new MFCGasData()
- //{
- // Name = mfcDatas[i].DeviceName,
- // DisplayName = mfcDatas[i].DisplayName,
- // ActualValue = mfcDatas[i].FeedBack,
- // Value = mfcDatas[i].SetPoint,
- // ActualRampng = mfcDatas[i].Ramping,
- // Rampng = mfcDatas[i].VirtualRamping,
- // Unit = mfcDatas[i].Unit,
- // AlarmValue = mfcDatas[i].AlarmWatchTable
- //});
- MFCDataList.Add(new MFCGasData()
- {
- Name = mfcDatas[i].DeviceName,
- DisplayName = mfcDatas[i].DisplayName,
- //ActualValue = mfcDatas[i].FeedBack,
- Value = setLastPoint.ToString("f3"),
- //ActualRampng = mfcDatas[i].Ramping,
- Rampng = setLastRamping.ToString("f3"),
- IsSetChanged = true,
- Unit = mfcDatas[i].Unit,
- AlarmValue = mfcDatas[i].AlarmWatchTable
- });
- }
- }
- else
- {
- for (int i = 0; i < MFCDataList.Count; i++)
- {
- var findMFC = mfcDatas.FirstOrDefault(x => x.DeviceName == MFCDataList[i].Name);
- if (findMFC != null)
- {
- double setLastPoint = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{findMFC.DeviceName}.SetLastPoint");
- double setLastRamping = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{findMFC.DeviceName}.SetLastRamping");
- MFCDataList[i].Value = setLastPoint.ToString("f3");
- MFCDataList[i].IsSetChanged = true;
- MFCDataList[i].Rampng = setLastRamping.ToString("f3");
- }
- };
- }
- if (MFCDataList != null && MFCDataList.Count > 0)
- {
- if (upDataMfcSetPoint)
- {
- Dictionary<string, string> setChangedMFC = new Dictionary<string, string>();
- foreach (var item in MFCDataList)
- {
- setChangedMFC.Add(item.Name, item.Value);
- }
- InvokeClient.Instance.Service.DoOperation($"PM1.SetAllMfcSetPoint", setChangedMFC);
- }
- }
- }
- private void UpdateHeaterSetting()
- {
- if ((HeaterUData != null && HeaterCUData != null && HeaterCData != null && HeaterCLData != null && HeaterLData != null))
- {
- List<AITHeaterData> heaterDatas = new List<AITHeaterData>()
- {
- HeaterUData,
- HeaterCUData,
- HeaterCData,
- HeaterCLData,
- HeaterLData,
- };
- if (TempList.Count == 0)
- {
- string[] strList = new string[5] { "BottomHeaterData", "CenterBottomHeaterData", "CenterHeaterData", "TopCenterHeaterData", "HeaterUData" };
- for (int i = 0; i < heaterDatas.Count; i++)
- {
- double setLastPoint = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.Heater.{heaterDatas[i].DeviceName}.SetLastPoint");
- double setLastRamping = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.Heater.{heaterDatas[i].DeviceName}.SetLastRamping");
- //TempList.Add(new TempManualSetData()
- //{
- // DisplayName = heaterDatas[i].DisplayName,
- // Name = heaterDatas[i].DeviceName,
- // ControlName = strList[i],
- // ActualValue = heaterDatas[i].FeedBack,
- // Value = heaterDatas[i].SetPoint,
- // ActualRampng = heaterDatas[i].Ramping,
- // Rampng = heaterDatas[i].UpRateSetPoint,
- // Unit = heaterDatas[i].Unit,
- //});
- TempList.Add(new TempManualSetData()
- {
- DisplayName = heaterDatas[i].DisplayName,
- Name = heaterDatas[i].DeviceName,
- ControlName = strList[i],
- Value = setLastPoint.ToString("f1"),
- Rampng = setLastRamping.ToString("f1"),
- Unit = heaterDatas[i].Unit,
- });
- }
- }
- else
- {
- for (int i = 0; i < TempList.Count; i++)
- {
- var findHeater = heaterDatas.FirstOrDefault(x => x.DeviceName == TempList[i].Name);
- double setLastPoint = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.Heater.{findHeater.DeviceName}.SetLastPoint");
- double setLastRamping = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.Heater.{findHeater.DeviceName}.SetLastRamping");
- if (findHeater != null)
- {
- TempList[i].Value = setLastPoint.ToString("f1");
- TempList[i].Rampng = setLastRamping.ToString("f1");
- TempList[i].IsSetChanged = true;
- TempList[i].IsRampngChanged = true;
- }
- };
- }
- }
- }
- public void SetValue(object sender, string isFullKeyboard = "")
- {
- string value = ((TextBox)sender).Text;
- if (!string.IsNullOrEmpty(isFullKeyboard))
- {
- FullKeyboard fullKeyboard1 = new FullKeyboard("", value);
- if ((bool)fullKeyboard1.ShowDialog())
- {
- ((TextBox)sender).Text = fullKeyboard1.ValueString;
- }
- }
- else
- {
- NumberKeyboard fullKeyboard = new NumberKeyboard("", value);
- if ((bool)fullKeyboard.ShowDialog())
- {
- ((TextBox)sender).Text = fullKeyboard.ValueString;
- }
- }
- }
- private string GetPressString()
- {
- string[] pressStringList = new string[4] { "", "", "", "" };
- pressStringList[0] = PressCommand;
- if (!string.IsNullOrEmpty(PressCommand))
- {
- switch (PressCommand)
- {
- case "Press":
- case "Press2":
- PressVisibility = Visibility.Visible;
- pressStringList[1] = PressPID;
- pressStringList[2] = PressSet.ToString();
- break;
- case "Slow Vac":
- var defaultAPCPID = SystemConfigProvider.Instance.GetValueByName("PM1.APCPID");
- pressStringList[1] = defaultAPCPID;
- pressStringList[2] = PressSlowVacSet.ToString();
- break;
- case "Valve Angle":
- pressStringList[2] = PressValveAngleSet.ToString();
- pressStringList[3] = LowPressWait;
- break;
- case "Full Open":
- case "Full Close":
- case "Hold":
- case "Zero Set":
- case "Cancel Zero":
- pressStringList[1] = "";
- pressStringList[2] = "";
- pressStringList[3] = "";
- break;
- case "WaitPressUp1":
- case "WaitPressDown1":
- case "WaitPressUp2":
- case "WaitPressDown2":
- pressStringList[2] = PressWait.ToString();
- break;
- default:
- break;
- }
- }
- return string.Join(";", pressStringList);
- }
- }
- 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 string _value;
- public string Value
- {
- get => _value;
- set
- {
- _value = value;
- NotifyOfPropertyChange(nameof(Value));
- }
- }
- private double _actualRampng;
- public double ActualRampng
- {
- get => _actualRampng; set
- {
- _actualRampng = value;
- NotifyOfPropertyChange(nameof(ActualRampng));
- }
- }
- private string _rampng;
- public string 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 _isSetChanged = true;
- public bool IsSetChanged
- {
- get => _isSetChanged;
- set
- {
- _isSetChanged = value;
- NotifyOfPropertyChange(nameof(IsSetChanged));
- }
- }
- private bool _isRampngChanged = true;
- public bool IsRampngChanged
- {
- get => _isRampngChanged;
- set
- {
- _isRampngChanged = value;
- NotifyOfPropertyChange(nameof(IsRampngChanged));
- }
- }
- private string _alarmValue;
- public string AlarmValue
- {
- get => _alarmValue;
- set
- {
- _alarmValue = value;
- NotifyOfPropertyChange(nameof(AlarmValue));
- }
- }
- }
- 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 string _value;
- public string Value
- {
- get => _value;
- set
- {
- _value = value;
- NotifyOfPropertyChange(nameof(Value));
- }
- }
- private string _actualRampng;
- public string ActualRampng
- {
- get => _actualRampng;
- set
- {
- _actualRampng = value;
- NotifyOfPropertyChange(nameof(ActualRampng));
- }
- }
- private string _rampng;
- public string 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");
- }
- }
- private bool _isSetChanged = true;
- public bool IsSetChanged
- {
- get => _isSetChanged;
- set
- {
- _isSetChanged = value;
- NotifyOfPropertyChange(nameof(IsSetChanged));
- }
- }
- private bool _isRampngChanged = true;
- public bool IsRampngChanged
- {
- get => _isRampngChanged;
- set
- {
- _isRampngChanged = value;
- NotifyOfPropertyChange(nameof(IsRampngChanged));
- }
- }
- private string _alarmValue;
- public string AlarmValue
- {
- get => _alarmValue;
- set
- {
- _alarmValue = value;
- NotifyOfPropertyChange(nameof(AlarmValue));
- }
- }
- }
- }
|