diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-09-02 09:14:49 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-09-02 09:14:49 +0300 |
| commit | d9de7926573db7556abed36eb6e1ef17604d0066 (patch) | |
| tree | 55c9feadd2b62e76b15c9d0d8a89222a296f1f69 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels | |
| parent | be444b0c97d357e6a9acb6c8d57f0093585819e9 (diff) | |
| parent | 81d0eb4c6619851b19deb34bc19784eee38c559f (diff) | |
| download | Tango-d9de7926573db7556abed36eb6e1ef17604d0066.tar.gz Tango-d9de7926573db7556abed36eb6e1ef17604d0066.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
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; |
