diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2020-08-31 09:10:47 +0300 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2020-08-31 09:10:47 +0300 |
| commit | 66f00e5729e48811cc7d5d6f728988cd64f225e7 (patch) | |
| tree | a4eea76659627fc0efdc1d80a0725b4fda154eff /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels | |
| parent | eeaeeca65c5e0a376ca3f164a4921cad995d62ed (diff) | |
| download | Tango-66f00e5729e48811cc7d5d6f728988cd64f225e7.tar.gz Tango-66f00e5729e48811cc7d5d6f728988cd64f225e7.zip | |
Calibration Color. LAB graph is added to Linearization tab.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/ColorCalibrationViewVM.cs | 68 |
1 files changed, 63 insertions, 5 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/ColorCalibrationViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/ColorCalibrationViewVM.cs index f7e93a4e6..31d89005e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/ColorCalibrationViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/ColorCalibrationViewVM.cs @@ -41,7 +41,7 @@ namespace Tango.MachineStudio.RML.ViewModels public BL.Entities.LiquidType LiquidType { get { return _liquidType; } - set { _liquidType = value; RaisePropertyChangedAuto(); } + set { _liquidType = value; RaisePropertyChangedAuto(); RaisePropertyChanged("LiquidTypeName"); } } private List<BL.Entities.LiquidType> _liquidTypes; @@ -99,7 +99,7 @@ namespace Tango.MachineStudio.RML.ViewModels public string LiquidTypeName { - get { return LiquidType == null ?"" : LiquidType.Name; } + get { return LiquidType == null ?"" : LiquidType.Name; } } public Plot PlotControl { get; set; } @@ -162,7 +162,23 @@ namespace Tango.MachineStudio.RML.ViewModels } } - + private double _LabMinVal; + + public double LabMinVal + { + get { return _LabMinVal; } + set { _LabMinVal = value; RaisePropertyChangedAuto(); } + } + + private double _LabMaxVal; + + public double LabMaxVal + { + get { return _LabMaxVal; } + set { _LabMaxVal = value; RaisePropertyChangedAuto(); } + } + + public Plot LABLinearizationPlotControl { get; set; } public Plot LinearizationPlotControl { get; set; } private IList<DataPoint> _linearizationPoints; /// <summary> @@ -178,6 +194,31 @@ namespace Tango.MachineStudio.RML.ViewModels } } + private IList<DataPoint> _LPoints; + + public IList<DataPoint> LPoints + { + get { return _LPoints; } + set { _LPoints = value; } + } + + private IList<DataPoint> _APoints; + + public IList<DataPoint> APoints + { + get { return _APoints; } + set { _APoints = value; } + } + + private IList<DataPoint> _BPoints; + + public IList<DataPoint> BPoints + { + get { return _BPoints; } + set { _BPoints = value; } + } + + #endregion public ColorCalibrationViewVM(INotificationProvider notification) @@ -199,6 +240,9 @@ namespace Tango.MachineStudio.RML.ViewModels this.Points = new List<DataPoint>(); TargetPoints = new List<DataPoint>(); LinearizationPoints = new List<DataPoint>(); + LPoints = new List<DataPoint>(); + APoints = new List<DataPoint>(); + BPoints = new List<DataPoint>(); } public void Loading() @@ -254,7 +298,7 @@ namespace Tango.MachineStudio.RML.ViewModels List<ColorLinearizationModel.LinearizationDataItem> items;//List<LinearizationDataItem> items ColorLinearizationModel model = new ColorLinearizationModel(); model.GetDataFromFile(dlg.FileName, out items); - if (items.Count == 0) + if (items == null || items.Count == 0) return; Measurements.Clear(); items.ForEach(x => Measurements.Add(new CalibrationMeasurementModel(x))); @@ -345,7 +389,7 @@ namespace Tango.MachineStudio.RML.ViewModels List<ColorLinearizationModel.LinearizationDataItem> items; model.GetDataFromFile(fileName, out items); - if (items.Count == 0) + if (items == null || items.Count == 0) return; List<double> outputPoints = new List<double>(); @@ -355,6 +399,20 @@ namespace Tango.MachineStudio.RML.ViewModels }); LinearizationPoints.Clear(); + LPoints.Clear(); + APoints.Clear(); + BPoints.Clear(); + LabMinVal = LabMaxVal = 0; + + LabMinVal = items.Min(x => Math.Min(x.L, Math.Min(x.A, x.B))); + LabMaxVal = items.Max(x => Math.Max(x.L, Math.Max(x.A, x.B))); + foreach (var labItem in items) + { + LPoints.Add(new DataPoint(labItem.InkPercentage, labItem.L)); + APoints.Add(new DataPoint(labItem.InkPercentage, labItem.A)); + BPoints.Add(new DataPoint(labItem.InkPercentage, labItem.B)); + } + LABLinearizationPlotControl.InvalidatePlot(true); if (outputPoints == null || outputPoints.Count != items.Count) return; |
