diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2020-07-21 16:37:15 +0300 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2020-07-21 16:37:15 +0300 |
| commit | fcce49aec07952eeb60cc6b33b90a8e493c85254 (patch) | |
| tree | 1cdde42117e8733a490202f576d229c6c79224e3 /Software/Visual_Studio/MachineStudio/Modules | |
| parent | 9e268e6d994e21e63ead68b4314d54f4b6be56bd (diff) | |
| download | Tango-fcce49aec07952eeb60cc6b33b90a8e493c85254.tar.gz Tango-fcce49aec07952eeb60cc6b33b90a8e493c85254.zip | |
Deleted unnecessary allocation memory, handle error message
Related Work Items: #2957
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules')
| -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(); |
