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/Models | |
| 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/Models')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Models/ColorLinearizationModel.cs | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Models/ColorLinearizationModel.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Models/ColorLinearizationModel.cs index 53e15f976..f82c04bbc 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Models/ColorLinearizationModel.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Models/ColorLinearizationModel.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -24,9 +25,19 @@ namespace Tango.MachineStudio.RML.Models public void GetDataFromFile(string fileName, out List<LinearizationDataItem> items) { - ExcelReader reader = new ExcelReader(fileName); - items = reader.GetDataByIndex<LinearizationDataItem>("Sheet1", 2); - reader.Dispose(); + items = null; + try + { + using (ExcelReader reader = new ExcelReader(fileName)) + { + items = reader.GetDataByIndex<LinearizationDataItem>("Sheet1", 2); + } + } + catch (Exception ex) + { + Console.WriteLine($" Error in GetDataFromFile {fileName} exception: {ex.Message}" + Environment.NewLine); + } + } } } |
