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.. --- Software/DB/PPC/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/PPC/Tango_log.ldf | Bin 1048576 -> 1048576 bytes Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 15400960 -> 15400960 bytes .../Tango.MachineStudio.ColorLab.csproj | 6 +- .../ViewModels/CalibrationDataPointVM.cs | 3 +- .../ViewModels/CalibrationDataVM.cs | 12 ++- .../ViewModels/LiquidVolumeVM.cs | 3 +- .../ViewModels/RgbVM.cs | 3 +- .../Tango.MachineStudio.RML.csproj | 8 ++ .../ViewModels/AddLiquidFactorViewVM.cs | 50 ++++++++++ .../ViewModels/MainViewVM.cs | 71 ++++++++++++++ .../Views/AddLiquidFactorView.xaml | 56 +++++++++++ .../Views/AddLiquidFactorView.xaml.cs | 28 ++++++ .../Tango.MachineStudio.RML/Views/RmlView.xaml | 13 ++- .../Resources/Calibration Data Template.xlsx | Bin 0 -> 9306 bytes .../Visual_Studio/Tango.BL/Builders/RmlBuilder.cs | 2 +- .../Visual_Studio/Tango.Documents/ExcelWriter.cs | 104 +++++++++++++++++++++ .../Tango.Documents/Tango.Documents.csproj | 3 +- .../Tango.UnitTesting/ColorLib_TST.cs | 28 ++++++ Software/Visual_Studio/Tango.UnitTesting/Helper.cs | 2 +- .../Tango.UnitTesting/Tango.UnitTesting.csproj | 10 +- 22 files changed, 389 insertions(+), 13 deletions(-) create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/AddLiquidFactorViewVM.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/AddLiquidFactorView.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/AddLiquidFactorView.xaml.cs create mode 100644 Software/Visual_Studio/Resources/Calibration Data Template.xlsx create mode 100644 Software/Visual_Studio/Tango.Documents/ExcelWriter.cs diff --git a/Software/DB/PPC/Tango.mdf b/Software/DB/PPC/Tango.mdf index cea4bce53..198fdf37c 100644 Binary files a/Software/DB/PPC/Tango.mdf and b/Software/DB/PPC/Tango.mdf differ diff --git a/Software/DB/PPC/Tango_log.ldf b/Software/DB/PPC/Tango_log.ldf index 81d900e41..e6f724f8b 100644 Binary files a/Software/DB/PPC/Tango_log.ldf and b/Software/DB/PPC/Tango_log.ldf differ diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index 6a62ca559..dc1bf2460 100644 Binary files a/Software/DB/Tango.mdf and b/Software/DB/Tango.mdf differ diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf index e84ee38f5..fbffee0bd 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Tango.MachineStudio.ColorLab.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Tango.MachineStudio.ColorLab.csproj index 18d51aa09..b4ab87be6 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Tango.MachineStudio.ColorLab.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/Tango.MachineStudio.ColorLab.csproj @@ -131,6 +131,10 @@ {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} Tango.Core + + {ca87a608-7b17-4c98-88f2-42abee10f4c1} + Tango.Documents + {942134ac-6ea2-4500-8f22-0f739b70a05f} Tango.Hive @@ -187,7 +191,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/CalibrationDataPointVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/CalibrationDataPointVM.cs index 74f892a81..33110d50e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/CalibrationDataPointVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/CalibrationDataPointVM.cs @@ -3,11 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.Core; using Tango.SharedUI; namespace Tango.MachineStudio.ColorLab.ViewModels { - public class CalibrationDataPointVM : ViewModel + public class CalibrationDataPointVM : ExtendedObject { private double _x; diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/CalibrationDataVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/CalibrationDataVM.cs index 87bbacab5..8fe8ec4ac 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/CalibrationDataVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/CalibrationDataVM.cs @@ -5,12 +5,22 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Tango.BL.Entities; +using Tango.Core; using Tango.SharedUI; namespace Tango.MachineStudio.ColorLab.ViewModels { - public class CalibrationDataVM : ViewModel + public class CalibrationDataVM : ExtendedObject { + private LiquidType _liquidType; + + public LiquidType LiquidType + { + get { return _liquidType; } + set { _liquidType = value; RaisePropertyChangedAuto(); } + } + + private String _name; public String Name diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/LiquidVolumeVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/LiquidVolumeVM.cs index 245fda239..ca4f12b5d 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/LiquidVolumeVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/LiquidVolumeVM.cs @@ -4,11 +4,12 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Tango.BL.Entities; +using Tango.Core; using Tango.SharedUI; namespace Tango.MachineStudio.ColorLab.ViewModels { - public class LiquidVolumeVM : ViewModel + public class LiquidVolumeVM : ExtendedObject { public event EventHandler VolumeChanged; diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/RgbVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/RgbVM.cs index badb238fb..aae490a6e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/RgbVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ColorLab/ViewModels/RgbVM.cs @@ -4,11 +4,12 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Media; +using Tango.Core; using Tango.SharedUI; namespace Tango.MachineStudio.ColorLab.ViewModels { - public class RgbVM : ViewModel + public class RgbVM : ExtendedObject { public event EventHandler ColorChanged; diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Tango.MachineStudio.RML.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Tango.MachineStudio.RML.csproj index 99b0a3c19..b9d77e95a 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Tango.MachineStudio.RML.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Tango.MachineStudio.RML.csproj @@ -88,7 +88,11 @@ True + + + AddLiquidFactorView.xaml + MainView.xaml @@ -159,6 +163,10 @@ + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/AddLiquidFactorViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/AddLiquidFactorViewVM.cs new file mode 100644 index 000000000..f6fca0ac2 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/AddLiquidFactorViewVM.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL; +using Tango.BL.Entities; +using Tango.SharedUI; +using System.Data.Entity; + +namespace Tango.MachineStudio.RML.ViewModels +{ + public class AddLiquidFactorViewVM : DialogViewVM + { + private ObservablesContext _context; + + private ObservableCollection _liquidTypes; + public ObservableCollection LiquidTypes + { + get + { + return _liquidTypes; + } + set + { + _liquidTypes = value; RaisePropertyChangedAuto(); + } + } + + private LiquidType _selectedLiquidType; + public LiquidType SelectedLiquidType + { + get { return _selectedLiquidType; } + set { _selectedLiquidType = value; RaisePropertyChangedAuto(); } + } + + public AddLiquidFactorViewVM(ObservablesContext context) + { + _context = context; + } + + public async override void OnShow() + { + base.OnShow(); + LiquidTypes = (await _context.LiquidTypes.ToListAsync()).ToObservableCollection(); + SelectedLiquidType = LiquidTypes.FirstOrDefault(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs index b7e7859ac..be46e2148 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs @@ -14,6 +14,7 @@ using Tango.MachineStudio.ColorLab.ViewModels; using Tango.MachineStudio.Common; using Tango.MachineStudio.Common.Notifications; using Tango.MachineStudio.RML.Contracts; +using Tango.MachineStudio.RML.Views; namespace Tango.MachineStudio.RML.ViewModels { @@ -140,6 +141,14 @@ namespace Tango.MachineStudio.RML.ViewModels public RelayCommand AddProcessParametersTableCommand { get; set; } + public RelayCommand RemoveProcessParametersTableCommand { get; set; } + + public RelayCommand AddLiquidFactorCommand { get; set; } + + public RelayCommand RemoveLiquidFactorCommand { get; set; } + + public RelayCommand CreateCalibrationDataExcelTemplateCommand { get; set; } + /// /// Gets or sets the back to RMLS command. /// @@ -153,6 +162,10 @@ namespace Tango.MachineStudio.RML.ViewModels AddRmlCommand = new RelayCommand(AddNewRml); BackToRmlsCommand = new RelayCommand(BackToRmls); AddProcessParametersTableCommand = new RelayCommand(AddProcessParametersTable); + RemoveProcessParametersTableCommand = new RelayCommand(RemoveProcessParametersTable); + AddLiquidFactorCommand = new RelayCommand(AddLiquidFactor); + RemoveLiquidFactorCommand = new RelayCommand(RemoveLiquidFactor); + CreateCalibrationDataExcelTemplateCommand = new RelayCommand(CreateCalibrationDataExcelTemplate); } public override void OnApplicationReady() @@ -205,6 +218,7 @@ namespace Tango.MachineStudio.RML.ViewModels CalibrationDataVM catVM = new CalibrationDataVM(); catVM.Name = liquidTypeRml.LiquidType.Name; catVM.Color = liquidTypeRml.LiquidType.Color; + catVM.LiquidType = liquidTypeRml.LiquidType; if (liquidTypeRml.DefaultCatData != null) { @@ -316,6 +330,63 @@ namespace Tango.MachineStudio.RML.ViewModels ActiveProcessParametersTableView.Refresh(); } + private void RemoveLiquidFactor(LiquidTypesRml liquidFactor) + { + if (_notification.ShowQuestion("Removing this liquid factor will remove the liquid type association with the RML and will drop the calibration data. Are you sure?")) + { + var catVM = CalibrationDataViewVM.LiquidsCalibrationData.SingleOrDefault(x => x.LiquidType == liquidFactor.LiquidType); + CalibrationDataViewVM.LiquidsCalibrationData.Remove(catVM); + _active_context.LiquidTypesRmls.Remove(liquidFactor); + } + } + + private void AddLiquidFactor() + { + AddLiquidFactorViewVM vm = new AddLiquidFactorViewVM(_active_context); + _notification.ShowModalDialog(vm, (_) => + { + if (LiquidTypesRmls.ToList().Exists(x => x.LiquidType == vm.SelectedLiquidType)) + { + _notification.ShowError("The selected liquid type is already associated with this RML."); + return; + } + + LiquidTypesRml liquidFactor = new LiquidTypesRml() + { + LiquidType = vm.SelectedLiquidType, + Rml = ActiveRML, + }; + + _active_context.LiquidTypesRmls.Add(liquidFactor); + + CalibrationDataVM catVM = new CalibrationDataVM(); + catVM.Name = liquidFactor.LiquidType.Name; + catVM.Color = liquidFactor.LiquidType.Color; + + CalibrationDataViewVM.LiquidsCalibrationData.Add(catVM); + + }, () => { }); + } + + private void RemoveProcessParametersTable(ProcessParametersTable processParametersTable) + { + if (ActiveProcessParametersGroup.ProcessParametersTables.Count == 1) + { + _notification.ShowError("The process group must contain at least one table."); + return; + } + + if (_notification.ShowQuestion("Are you sure you want to remove this process parameters table?")) + { + _active_context.ProcessParametersTables.Remove(processParametersTable); + } + } + + private void CreateCalibrationDataExcelTemplate() + { + + } + private void BackToRmls() { View.NavigateTo(RmlNavigationView.RmlsView); diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/AddLiquidFactorView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/AddLiquidFactorView.xaml new file mode 100644 index 000000000..6d9b68edb --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/AddLiquidFactorView.xaml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + v + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/AddLiquidFactorView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/AddLiquidFactorView.xaml.cs new file mode 100644 index 000000000..cdacddf42 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/AddLiquidFactorView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.MachineStudio.RML.Views +{ + /// + /// Interaction logic for AddLiquidFactorView.xaml + /// + public partial class AddLiquidFactorView : UserControl + { + public AddLiquidFactorView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml index e77663de4..aa6f39d9e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlView.xaml @@ -155,7 +155,7 @@ - @@ -221,7 +221,7 @@ LIQUID FACTORS - @@ -234,9 +234,9 @@ - + - @@ -269,7 +269,12 @@ + CALIBRATION DATA + + diff --git a/Software/Visual_Studio/Resources/Calibration Data Template.xlsx b/Software/Visual_Studio/Resources/Calibration Data Template.xlsx new file mode 100644 index 000000000..cd6b52fba Binary files /dev/null and b/Software/Visual_Studio/Resources/Calibration Data Template.xlsx differ diff --git a/Software/Visual_Studio/Tango.BL/Builders/RmlBuilder.cs b/Software/Visual_Studio/Tango.BL/Builders/RmlBuilder.cs index 8eab66c85..0fe653a67 100644 --- a/Software/Visual_Studio/Tango.BL/Builders/RmlBuilder.cs +++ b/Software/Visual_Studio/Tango.BL/Builders/RmlBuilder.cs @@ -58,7 +58,7 @@ namespace Tango.BL.Builders { return AddStep(5, () => { - Context.LiquidTypesRmls.Where(x => x.RmlGuid == Entity.Guid).Include(x => x.LiquidType).ToList(); + Context.LiquidTypesRmls.Where(x => x.RmlGuid == Entity.Guid).Include(x => x.LiquidType).OrderBy(x => x.LiquidType.Code).ToList(); }); } diff --git a/Software/Visual_Studio/Tango.Documents/ExcelWriter.cs b/Software/Visual_Studio/Tango.Documents/ExcelWriter.cs new file mode 100644 index 000000000..613bbd90f --- /dev/null +++ b/Software/Visual_Studio/Tango.Documents/ExcelWriter.cs @@ -0,0 +1,104 @@ +using DocumentFormat.OpenXml.Packaging; +using DocumentFormat.OpenXml.Spreadsheet; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading.Tasks; + +namespace Tango.Documents +{ + public class ExcelWriter : IDisposable + { + private Stream _stream; + private SpreadsheetDocument _document; + private List _column_names; + + public ExcelWriter(Stream source) + { + _stream = source; + _document = SpreadsheetDocument.Open(_stream, true); + _column_names = new List(); + + if (_document.WorkbookPart.Workbook.GetFirstChild() != null) + { + foreach (DefinedName name in _document.WorkbookPart.Workbook.GetFirstChild()) + { + _column_names.Add(name); + } + } + } + + public ExcelWriter(String fileName) : this(new FileStream(fileName, FileMode.OpenOrCreate, FileAccess.ReadWrite)) + { + + } + + public void WriteData(IEnumerable data, String sheetName) + { + var props = typeof(T).GetProperties(BindingFlags.Public | BindingFlags.Instance).ToList(); + + WorksheetPart work_sheet_part = GetWorkSheetPart(sheetName); + Worksheet workSheet = work_sheet_part.Worksheet; + SheetData sheetData = workSheet.GetFirstChild(); + List rows = sheetData.Elements().ToList(); + + var list = data.ToList(); + + for (int i = 0; i < list.Count; i++) + { + var item = list[i]; + + Row newRow = new Row(); + + sheetData.InsertAfter(newRow, sheetData.Elements().Last()); + + foreach (var prop in props) + { + var definedName = _column_names.SingleOrDefault(x => x.Name == prop.Name); + + if (definedName != null) + { + SetCellRow(newRow, GetCellReference(definedName, i + 2), prop.GetValue(item)); + } + } + } + } + + private void SetCellRow(Row row, string cellReference, object value) + { + Cell cell = row.Descendants().FirstOrDefault(c => c.CellReference == cellReference); + if (cell == null) + { + cell = new Cell(); + cell.CellReference = cellReference; + } + cell.CellValue = new CellValue(value.ToString()); + cell.DataType = CellValues.String; + row.Append(cell); + } + + private WorksheetPart GetWorkSheetPart(String sheetName) + { + var sheet = _document.WorkbookPart.Workbook.Descendants().FirstOrDefault(x => x.Name.Value == sheetName); + string relId = sheet.Id; + return (WorksheetPart)_document.WorkbookPart.GetPartById(relId); + } + + private string GetCellReference(DefinedName name, int rowIndex) + { + Regex rowPatern = new Regex("^.*\\!\\$(.*)\\$\\d*$"); + Match match = rowPatern.Match(name.Text); + return match.Groups[1].Value + rowIndex.ToString(); + } + + public void Dispose() + { + _document.Save(); + _stream.Dispose(); + } + } +} diff --git a/Software/Visual_Studio/Tango.Documents/Tango.Documents.csproj b/Software/Visual_Studio/Tango.Documents/Tango.Documents.csproj index cbfd9c79b..17ba03257 100644 --- a/Software/Visual_Studio/Tango.Documents/Tango.Documents.csproj +++ b/Software/Visual_Studio/Tango.Documents/Tango.Documents.csproj @@ -60,6 +60,7 @@ GlobalVersionInfo.cs + @@ -87,7 +88,7 @@ - + \ No newline at end of file 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