using Caliburn.Micro.Core; using RecipeEditorLib.RecipeModel.Params; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; namespace MECF.Framework.UI.Client.CenterViews.Parameter { public class TempProfileTable : ParameterTable { private string _preheatTime; public string PreheatTime { get => _preheatTime; set { _preheatTime = value; NotifyOfPropertyChange("PreheatTime"); } } private string _checkTime; public string CheckTime { get => _checkTime; set { _checkTime = value; NotifyOfPropertyChange("CheckTime"); } } private DoubleParam _limitU; public DoubleParam LimitU { get => _limitU; set { _limitU = value; NotifyOfPropertyChange("LimitU"); } } private DoubleParam _limitCU; public DoubleParam LimitCU { get => _limitCU; set { _limitCU = value; NotifyOfPropertyChange("LimitCU"); } } private DoubleParam _limitC; public DoubleParam LimitC { get => _limitC; set { _limitC = value; NotifyOfPropertyChange("LimitC"); } } private DoubleParam _limitCL; public DoubleParam LimitCL { get => _limitCL; set { _limitCL = value; NotifyOfPropertyChange("LimitCL"); } } private DoubleParam _limitL; public DoubleParam LimitL { get => _limitL; set { _limitL = value; NotifyOfPropertyChange("LimitL"); } } private string _totalTime; public string TotalTime { get => _totalTime; set { _totalTime = value; NotifyOfPropertyChange("TotalTime"); } } private DoubleParam _alarmLimit; public DoubleParam AlarmLimit { get => _alarmLimit; set { _alarmLimit = value; NotifyOfPropertyChange("AlarmLimit"); } } public TempProfileTable() : base() { } public TempProfileTable(ParameterDataBase recipeData) { if (recipeData.Steps.Count <= 0) return; SetCurrentRecipeStep(recipeData, recipeData.Steps[0]); } public TempProfileTable(ParameterDataBase recipeData, int selectedStepNo) { ParameterTable step = recipeData.Steps.Where(x => x.StepNo == selectedStepNo).FirstOrDefault(); SetCurrentRecipeStep(recipeData, step); } public void SetTempCorrectionData(string value) { if (string.IsNullOrEmpty(value)) return; string[] strTempCorrection = value.Split('|'); foreach (var item in strTempCorrection) { if (string.IsNullOrEmpty(item)) continue; string[] subTempCorrection = item.Split(';'); Dictionary dictTempCorrection = new Dictionary(); foreach (var pid in subTempCorrection) { if (string.IsNullOrEmpty(item)) continue; var keyValue = pid.Split(':'); if (keyValue == null || keyValue.Length != 2) continue; dictTempCorrection[keyValue[0]] = keyValue[1]; } } } } }