diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2020-07-21 21:39:31 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2020-07-21 21:39:31 +0300 |
| commit | 9aa38289b089d2518c5b0ef68e78f262fe4a31ee (patch) | |
| tree | 439110fae993ea5eee8dd7415b5fa10ad1db1f38 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels | |
| parent | c984e27f2ee8d3d9cee9a09531c23dff9da7e8d6 (diff) | |
| parent | 004d88fd5af64ab5329d7eb3bca3069d737aca0a (diff) | |
| download | Tango-9aa38289b089d2518c5b0ef68e78f262fe4a31ee.tar.gz Tango-9aa38289b089d2518c5b0ef68e78f262fe4a31ee.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/_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 | 29 |
1 files changed, 18 insertions, 11 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 d065b58c5..7d05897d5 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 @@ -222,10 +222,10 @@ namespace Tango.MachineStudio.RML.ViewModels conversionInput.TargetB = lab.B; } CalibrationOutput result = _calibrator.GetLiquidFactor(conversionInput); - - ErrorMessage = Regex.Replace(result.ErrorMessage, "[^A-Za-z0-9_., ]+", ""); - + + ErrorMessage = result.ErrorMessage; HasError = false == String.IsNullOrEmpty(ErrorMessage); + return result.LiquidFactor; } catch (Exception ex ) @@ -309,6 +309,11 @@ namespace Tango.MachineStudio.RML.ViewModels LinearizationPlotControl.InvalidatePlot(true); } + + /// <summary> + /// Open file dialog and get name of file + /// </summary> + /// <returns></returns> private String GetInkDataFileOpen() { OpenFileDialog dlg = new OpenFileDialog(); @@ -321,6 +326,7 @@ namespace Tango.MachineStudio.RML.ViewModels return null; } + private List<double> GetLinearizationMeasurements(List<ColorLinearizationModel.LinearizationDataItem> items) { try @@ -338,23 +344,24 @@ namespace Tango.MachineStudio.RML.ViewModels } LinearizationOutput result = _linearizationMeasurementscalibrator.GetLinearizationMeasurements(linearizationInput); - ErrorMessage = Regex.Replace(result.ErrorMessage, "[^A-Za-z0-9_., ]+", ""); - - HasError = false == String.IsNullOrEmpty(ErrorMessage); + if(!String.IsNullOrEmpty(result.ErrorMessage)) + { + LogManager.Log(result.ErrorMessage, "Error occurred while trying to call GetLinearizationMeasurements."); + } return result.InkPercentage.ToList(); } catch (Exception ex) { - HasError = true; - ErrorMessage = "Error occurred while trying to call GetLiquidFactor."; - LogManager.Log(ex, "Error occurred while trying to call GetLiquidFactor."); + LogManager.Log(ex, "Error occurred while trying to call GetLinearizationMeasurements."); } return null; } #endregion - #region Export graph - + #region Export graph + /// <summary> + /// Exports the graph point to Excel file. + /// </summary> protected void ExportGraph() { SaveFileDialog dlg = new SaveFileDialog(); |
