12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585 |
- 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 OpenSEMI.Ctrlib.Controls;
- 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;
- using System.Windows.Media;
- 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>();
- public bool IsPermission { get => this.Permission == 3; }
- 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 double _boatZAxisLimitSpeed;
- public double BoatZAxisLimitSpeed
- {
- get => _boatZAxisLimitSpeed;
- set
- {
- _boatZAxisLimitSpeed = value;
- NotifyOfPropertyChange(nameof(BoatZAxisLimitSpeed));
- }
- }
- private double _boatRAxisLimitSpeed;
- public double BoatRAxisLimitSpeed
- {
- get => _boatRAxisLimitSpeed;
- set
- {
- _boatRAxisLimitSpeed = value;
- NotifyOfPropertyChange(nameof(BoatRAxisLimitSpeed));
- }
- }
- 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();
- BoatZAxisLimitSpeed = (double)QueryDataClient.Instance.Service.GetConfig($"Boat.BoatElevatorServo.BoatZAxisLimitSpeed");
- BoatRAxisLimitSpeed = (double)QueryDataClient.Instance.Service.GetConfig($"Boat.BoatRotationServo.BoatRAxisLimitSpeed");
- }
- 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, "Manual Gas View");
- 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)
- {
- BrushConverter brushConverter = new BrushConverter();
- 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);
- var maxData = (double)QueryDataClient.Instance.Service.GetConfig($"PM1.MFC.{mFCData.Name}.N2Scale");
- if (setValue > maxData && type == "Value")
- {
- DialogBox.ShowWarning($"{mFCData.Name} Out of the setting range {0}~{maxData}!");
- ((TextBoxEx)sender).ChangedColor = ((TextBoxEx)sender).NormalColor;
- ((TextBoxEx)sender).Text = $"0";
- return;
- }
- switch (type)
- {
- case "Value":
- mFCData.Value = value;
- if (setValue != aITMfcData.SetPoint)
- {
- ((TextBoxEx)sender).ChangedColor = (Brush)brushConverter.ConvertFromString("Yellow");
- 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>();
- foreach (var item in MFCDataList)
- {
- 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));
- }
- }
- }
- }
|