From c23d740d6a80db62b7b43ea17639ba4c2ef4e336 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Wed, 3 Oct 2018 14:19:04 +0300 Subject: Working on RML Module.. --- .../Tango.UnitTesting/ColorLib_TST.cs | 28 ++++++++++++++++++++++ Software/Visual_Studio/Tango.UnitTesting/Helper.cs | 2 +- .../Tango.UnitTesting/Tango.UnitTesting.csproj | 10 +++++++- 3 files changed, 38 insertions(+), 2 deletions(-) (limited to 'Software/Visual_Studio/Tango.UnitTesting') diff --git a/Software/Visual_Studio/Tango.UnitTesting/ColorLib_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/ColorLib_TST.cs index 5541bc286..dc19c77dd 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/ColorLib_TST.cs +++ b/Software/Visual_Studio/Tango.UnitTesting/ColorLib_TST.cs @@ -11,6 +11,9 @@ using System.Collections.Generic; using Tango.BL; using System.IO; using System.Diagnostics; +using Tango.Documents; +using Tango.Core.IO; +using Tango.MachineStudio.ColorLab.ViewModels; namespace Tango.UnitTesting { @@ -163,6 +166,31 @@ namespace Tango.UnitTesting Assert.IsTrue(output.SingleCoordinates.OutputLiquids.Count == conversionInput.InputCoordinates.InputLiquids.Count); } + [TestMethod] + public void Write_Calibration_Data_Excel_File() + { + String temp_file = Helper.GetTempFolderPath() + "\\CalibrationData.xlsx"; + File.Copy(Helper.GetResourcePath("Calibration Data Template.xlsx"), temp_file); + + CalibrationDataVM vm = new CalibrationDataVM(); + + for (int i = 0; i < 10; i++) + { + vm.CalibrationPoints.Add(new CalibrationDataPointVM() + { + X = i + 1, + Y = (i + 1) * 10, + }); + } + + using (ExcelWriter writer = new ExcelWriter(temp_file)) + { + writer.WriteData(vm.CalibrationPoints, "CalibrationData"); + } + + Helper.ShowInExplorer(temp_file); + } + private static CalibrationData GenerateCalibrationData(PMR.ColorLab.LiquidType liquidType) { CalibrationData data = new CalibrationData(); diff --git a/Software/Visual_Studio/Tango.UnitTesting/Helper.cs b/Software/Visual_Studio/Tango.UnitTesting/Helper.cs index 67252f914..ae7636c7b 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/Helper.cs +++ b/Software/Visual_Studio/Tango.UnitTesting/Helper.cs @@ -22,7 +22,7 @@ namespace Tango.UnitTesting /// public static String GetResourcePath(String fileName) { - return Path.GetFullPath(@"..\..\Resources\" + fileName); + return Path.GetFullPath(@"..\..\..\Resources\" + fileName); } /// diff --git a/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj b/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj index 7a37655a8..49d2d8cb5 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj +++ b/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj @@ -115,6 +115,10 @@ + + {4d183aca-552b-4135-ae81-7c5a8e5fc3b1} + Tango.MachineStudio.ColorLab + {1674f726-0e66-414f-b9fd-c6f20d7f07c7} Tango.MachineStudio.Logging @@ -143,6 +147,10 @@ {38197109-8610-4d3f-92b9-16d48df94d7c} Tango.DAL.Remote + + {ca87a608-7b17-4c98-88f2-42abee10f4c1} + Tango.Documents + {4206ac58-3b57-4699-8835-90bf6db01a61} Tango.Integration @@ -202,7 +210,7 @@ - + \ No newline at end of file -- cgit v1.3.1