From b29f337cff7513e0fe0e4b98e6bc7970da89e837 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Mon, 24 May 2021 17:07:45 +0300 Subject: Created a new project Tango.MachineStudio.ThreadExtentions. Changes in Database. --- .../Tango.MachineStudio.ThreadExtensions/App.xaml | 12 + .../Contracts/IMainView.cs | 20 + .../Converters/ColorNameToBrushConverter.cs | 42 ++ .../Images/threads.png | Bin 0 -> 315399 bytes .../Models/ColorDataExcelModel.cs | 39 + .../Models/FactorTarget.cs | 38 + .../Models/PlotProperties.cs | 169 +++++ .../Tango.MachineStudio.ThreadExtensions.csproj | 66 +- .../ViewModels/ColorParametersVewVM.cs | 788 +++++++++++++++++++++ .../ViewModels/MainViewVM.cs | 528 +++++++++++++- .../Views/ColorParametersView.xaml | 474 +++++++++++++ .../Views/ColorParametersView.xaml.cs | 44 ++ .../Views/MainView.xaml | 6 +- .../Views/MainView.xaml.cs | 10 +- .../Views/ThreadCharacteristicsView.xaml | 195 +++++ .../Views/ThreadCharacteristicsView.xaml.cs | 28 + .../Views/ThreadExtensionView.xaml | 61 ++ .../Views/ThreadExtensionView.xaml.cs | 27 + .../Views/ThreadExtensionsView.xaml | 103 +++ .../Views/ThreadExtensionsView.xaml.cs | 27 + .../app.config | 10 + .../packages.config | 3 + 22 files changed, 2685 insertions(+), 5 deletions(-) create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/App.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Contracts/IMainView.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Converters/ColorNameToBrushConverter.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Images/threads.png create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Models/ColorDataExcelModel.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Models/FactorTarget.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Models/PlotProperties.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorParametersVewVM.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ColorParametersView.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ColorParametersView.xaml.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ThreadCharacteristicsView.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ThreadCharacteristicsView.xaml.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ThreadExtensionView.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ThreadExtensionView.xaml.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ThreadExtensionsView.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ThreadExtensionsView.xaml.cs (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/App.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/App.xaml new file mode 100644 index 000000000..6925f5a1b --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/App.xaml @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Contracts/IMainView.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Contracts/IMainView.cs new file mode 100644 index 000000000..0f432eefb --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Contracts/IMainView.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.SharedUI; + +namespace Tango.MachineStudio.ThreadExtensions.Contracts +{ + public enum ThreadExtensionNavigationView + { + ThreadExtentionView, + ThreadExtensionsView, + } + + public interface IMainView : IView + { + void NavigateTo(ThreadExtensionNavigationView view); + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Converters/ColorNameToBrushConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Converters/ColorNameToBrushConverter.cs new file mode 100644 index 000000000..c9e246bb8 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Converters/ColorNameToBrushConverter.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; +using System.Windows.Media; + +namespace Tango.MachineStudio.ThreadExtensions.Converters +{ + public class ColorNameToBrushConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + try + { + string colorName = value as string; + if(String.IsNullOrEmpty(colorName)) + return new SolidColorBrush(Colors.Transparent); + + Color color = (Color)TypeDescriptor.GetConverter(typeof(Color)).ConvertFromString(colorName); + + SolidColorBrush brush = new SolidColorBrush(color); + brush.Opacity = 0.5; + + return brush; + } + catch + { + return new SolidColorBrush(Colors.Transparent); + } + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Images/threads.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Images/threads.png new file mode 100644 index 000000000..86eb0b335 Binary files /dev/null and b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Images/threads.png differ diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Models/ColorDataExcelModel.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Models/ColorDataExcelModel.cs new file mode 100644 index 000000000..da7471e16 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Models/ColorDataExcelModel.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Documents; + +namespace Tango.MachineStudio.ThreadExtensions.Models +{ + public class ColorDataExcelModel + { + public int NlCm { get; set; } + public double L { get; set; } + public double A { get; set; } + public double B { get; set; } + + public ColorDataExcelModel() + { + NlCm = 0; + L = A = B = 0.0; + } + + public static void GetDataFromFile(string fileName, out List items, ref string errors) + { + items = null; + try + { + using (ExcelReader reader = new ExcelReader(fileName)) + { + items = reader.GetDataByIndex("Sheet1", 1); + } + } + catch (Exception ex) + { + errors = ex.Message; + } + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Models/FactorTarget.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Models/FactorTarget.cs new file mode 100644 index 000000000..32f568f5f --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Models/FactorTarget.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.MachineStudio.ThreadExtensions.Models +{ + public static class FactorTarget + { + public static Dictionary FACTOR100 = new Dictionary() { + { "CYAN", 51.95}, {"MAGENTA", 47.47}, { "YELLOW", 94.05}, {"BLACK", 26.58}}; + + public static Dictionary FACTOR200 = new Dictionary() { + { "CYAN", 46.3}, {"MAGENTA", 41.04}, { "YELLOW", 97.78}, {"BLACK", 21.01}}; + + public static double GetFactor100(string color) + { + double result; + + if (FACTOR100.TryGetValue(color, out result)) + { + return result; + } + return 0.0; + } + public static double GetFactor200(string color) + { + double result; + + if (FACTOR200.TryGetValue(color, out result)) + { + return result; + } + return 0.0; + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Models/PlotProperties.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Models/PlotProperties.cs new file mode 100644 index 000000000..47632d3aa --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Models/PlotProperties.cs @@ -0,0 +1,169 @@ +using OxyPlot; +using OxyPlot.Wpf; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using Tango.BL.Entities; +using Tango.Core; +using Tango.MachineStudio.ThreadExtensions.ViewModels; + +namespace Tango.MachineStudio.ThreadExtensions.Models +{ + public class PlotProperties : ExtendedObject + { + public Plot PlotControl { get; set; } + private IList _points; + + private string _colorName; + + public string ColorName + { + get { return _colorName; } + set { _colorName = value; } + } + + /// + /// Binding to ItemsSource of line chart. + /// + public IList Points + { + get { return _points; } + set + { + _points = value; + RaisePropertyChangedAuto(); + } + } + private IList _target100Points; + /// + /// Binding to ItemsSource of line chart. + /// + public IList Target100Points + { + get { return _target100Points; } + set + { + _target100Points = value; + RaisePropertyChangedAuto(); + } + } + private IList _target200Points; + /// + /// Binding to ItemsSource of line chart. + /// + public IList Target200Points + { + get { return _target200Points; } + set + { + _target200Points = value; + RaisePropertyChangedAuto(); + } + } + private int _step; + public int XStep + { + get { return _step; } + set { _step = value; RaisePropertyChangedAuto(); } + } + + private double _from; + /// + /// From use to binding to bottom axis min value + /// + public double From + { + get { return _from; } + set + { + _from = value; RaisePropertyChangedAuto(); + } + } + + private double _to; + /// + /// To use to binding to bottom axis max value + /// + public double To + { + get { return _to; } + set + { + _to = value; RaisePropertyChangedAuto(); + } + } + + public PlotProperties(string colorName) + { + this.Points = new List(); + Target100Points = new List(); + Target200Points = new List(); + ColorName = colorName; + + } + + public void ClearResults() + { + Points.Clear(); + Target100Points.Clear(); + Target200Points.Clear(); + } + + public void CreateGraph(List points, bool isLtype) + { + if (PlotControl == null) + { + Debug.WriteLine("ERROR!!! CreateGraph. Plot Control is NULL."); + return; + } + + ClearResults(); + PlotControl.InvalidatePlot(true); + + double target100Y = FactorTarget.GetFactor100(ColorName); + double target200Y = FactorTarget.GetFactor200(ColorName); + + _to = target100Y > target200Y? target100Y + 10: target200Y + 10; + _from = target100Y < target200Y ? target100Y - 10 : target200Y - 10; + + foreach ( var x in points) + { + var point = new DataPoint(x.InkNlCm, isLtype ? x.L : x.B); + Points.Add(point); + + _to = _to > point.Y ? _to : point.Y; + _from = ( _from == 0 || _from > point.Y ) ? point.Y : _from; + + } + if (points.Count > 1) + { + var minInkNlCm = points.Min(n => n.InkNlCm); + var maxInkNlCm = points.Max(n => n.InkNlCm); + if(! Target100Points.Any(x => x.X == minInkNlCm)) + { + Target100Points.Add(new DataPoint(minInkNlCm, target100Y)); + Target200Points.Add(new DataPoint(minInkNlCm, target200Y)); + } + if (!Target100Points.Any(x => x.X == maxInkNlCm)) + { + Target100Points.Add(new DataPoint(maxInkNlCm, target100Y)); + Target200Points.Add(new DataPoint(maxInkNlCm, target200Y)); + } + } + Debug.WriteLine($"CreateGraph. Count Points {points.Count}"); + + if (_to == 0) + _to = isLtype ? 100 : 128; + if (_from == 0) + _from = isLtype ? 0 : -127; + + RaisePropertyChanged("To"); + RaisePropertyChanged("From"); + XStep = (int)(Points.Count / 6); + + PlotControl.InvalidatePlot(true); + + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Tango.MachineStudio.ThreadExtensions.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Tango.MachineStudio.ThreadExtensions.csproj index ca27b9a48..6b7204aac 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Tango.MachineStudio.ThreadExtensions.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Tango.MachineStudio.ThreadExtensions.csproj @@ -32,6 +32,12 @@ 4 + + ..\..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll + + + ..\..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll + ..\..\..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll @@ -47,8 +53,17 @@ ..\..\..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll + + ..\..\..\packages\OxyPlot.Core.2.0.0\lib\net45\OxyPlot.dll + + + ..\..\..\packages\OxyPlot.Wpf.2.0.0\lib\net45\OxyPlot.Wpf.dll + + + + ..\..\..\packages\MahApps.Metro.1.5.0\lib\net45\System.Windows.Interactivity.dll @@ -69,16 +84,54 @@ GlobalVersionInfo.cs + + + + + + + + ColorParametersView.xaml + MainView.xaml + + ThreadCharacteristicsView.xaml + + + ThreadExtensionView.xaml + + + ThreadExtensionsView.xaml + + + MSBuild:Compile + Designer + + + Designer + MSBuild:Compile + Designer MSBuild:Compile + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + MSBuild:Compile + Designer + @@ -105,8 +158,14 @@ Settings.Designer.cs - + + + + + {bb2abb74-ba58-4812-83aa-ec8171f42df4} + Tango.AutoComplete + {f441feee-322a-4943-b566-110e12fd3b72} Tango.BL @@ -115,6 +174,10 @@ {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} Tango.Core + + {ca87a608-7b17-4c98-88f2-42abee10f4c1} + Tango.Documents + {bc932dbd-7cdb-488c-99e4-f02cf441f55e} Tango.Logging @@ -139,5 +202,6 @@ + \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorParametersVewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorParametersVewVM.cs new file mode 100644 index 000000000..b2e677339 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorParametersVewVM.cs @@ -0,0 +1,788 @@ +using OxyPlot; +using OxyPlot.Wpf; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Collections.Specialized; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL; +using Tango.BL.ActionLogs; +using Tango.BL.Builders; +using Tango.BL.DTO; +using Tango.BL.Entities; +using Tango.Core; +using Tango.MachineStudio.Common.Notifications; +using Tango.SharedUI; +using Tango.AutoComplete.Editors; +using Tango.MachineStudio.ThreadExtensions.Models; +using Tango.Core.Commands; +using Microsoft.Win32; +using System.Diagnostics; + +namespace Tango.MachineStudio.ThreadExtensions.ViewModels +{ + public class ColorParametersVewVM : ViewModel + { + private INotificationProvider _notification; + private IActionLogManager _actionLogManager; + + private ObservablesContext _active_context; + private ObservablesContext _machineDbContext; + // private ColorProcessParameterDTO _hwBeforeSave; + + #region Properties + + private ColorProcessParameter _selectedColorProcessparameter; + /// + /// Gets or sets the selected RML. + /// + public ColorProcessParameter SelectedColorProcessParameter + { + get { return _selectedColorProcessparameter; } + set + { + _selectedColorProcessparameter = value; + RaisePropertyChangedAuto(); + } + } + + private ObservableCollection _magentaProcessData; + public ObservableCollection MagentaProcessData + { + get + { + return _magentaProcessData; + } + set + { + _magentaProcessData = value; + RaisePropertyChangedAuto(); + } + } + + private ObservableCollection _cyanProcessData; + public ObservableCollection CyanProcessData + { + get + { + return _cyanProcessData; + } + set + { + _cyanProcessData = value; + RaisePropertyChangedAuto(); + } + } + + private ObservableCollection _yellowProcessData; + public ObservableCollection YellowProcessData + { + get + { + return _yellowProcessData; + } + set + { + _yellowProcessData = value; + RaisePropertyChangedAuto(); + } + } + + private ObservableCollection _blackProcessData; + public ObservableCollection BlackProcessData + { + get + { + return _blackProcessData; + } + set + { + _blackProcessData = value; + RaisePropertyChangedAuto(); + } + } + + private ObservableCollection _factor100ProcessData; + public ObservableCollection Factor100ProcessData + { + get + { + return _factor100ProcessData; + } + set + { + _factor100ProcessData = value; + RaisePropertyChangedAuto(); + } + } + + private ObservableCollection _factor200ProcessData; + public ObservableCollection Factor200ProcessData + { + get + { + return _factor200ProcessData; + } + set + { + _factor200ProcessData = value; + RaisePropertyChangedAuto(); + } + } + + private ObservableCollection _minInkUptake; + public ObservableCollection MinInkUptake + { + get + { + return _minInkUptake; + } + set + { + _minInkUptake = value; + RaisePropertyChangedAuto(); + } + } + + private ObservableCollection _maxInkUptake; + public ObservableCollection MaxInkUptake + { + get + { + return _maxInkUptake; + } + set + { + _maxInkUptake = value; + RaisePropertyChangedAuto(); + } + } + + + private PlotProperties _cyanPlot; + + public PlotProperties CyanPlot + { + get { return _cyanPlot; } + set { + _cyanPlot = value; + RaisePropertyChangedAuto(); + } + } + + private PlotProperties _magentaPlot; + + public PlotProperties MagentaPlot + { + get { return _magentaPlot; } + set { _magentaPlot = value; } + } + + private PlotProperties _yellowPlot; + + public PlotProperties YellowPlot + { + get { return _yellowPlot; } + set { _yellowPlot = value; } + } + + private PlotProperties _blackPlot; + + public PlotProperties BlackPlot + { + get { return _blackPlot; } + set { _blackPlot = value; } + } + /// + /// Gets or sets the machines providers. + /// + public ISuggestionProvider MachinesProvider { get; set; } + + protected Machine _selectedMachine; + /// + /// Gets or sets the selected machine. + /// + public Machine SelectedMachine + { + get { return _selectedMachine; } + set + { + if (value != null && _selectedMachine != value) + { + _selectedMachine = value; + RaisePropertyChangedAuto(); + InvalidateRelayCommands(); + } + } + } + + private bool _isViewLoaded; + /// + /// Gets or sets a value indicating whether this instance is view loaded. Used to update charts. + /// + /// + /// true if this instance is view loaded; otherwise, false. + /// + public bool IsViewLoaded + { + get { return _isViewLoaded; } + set { + if(_isViewLoaded != value) + { + _isViewLoaded = value; + } + } + } + + private Dictionary _removedColorProcessDataBeforeSave; + + public Dictionary RemovedColorProcessDataBeforeSave + { + get { return _removedColorProcessDataBeforeSave; } + set { _removedColorProcessDataBeforeSave = value; } + } + + #endregion + #region commands + + public RelayCommand ImportCyanDataCommand { get; set; } + public RelayCommand ImportMagentaDataCommand { get; set; } + public RelayCommand ImportYellowDataCommand { get; set; } + public RelayCommand ImportBlackDataCommand { get; set; } + + private void ImportMagentaData(object obj) + { + List items; + if (LoadColorDataFromExcel(out items) && items != null) + { + MagentaProcessData.Clear(); + items.ForEach(x => MagentaProcessData.Add(new ColorProcessData() { InkNlCm = x.NlCm, L = x.L, A = x.A, B = x.B, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid})); + MagentaPlot.CreateGraph(MagentaProcessData.ToList(), true); + UpdateFactorsOnChangeProcessData("MAGENTA"); + } + } + + private void ImportYellowData(object obj) + { + List items; + if (LoadColorDataFromExcel(out items) && items != null) + { + YellowProcessData.Clear(); + items.ForEach(x => YellowProcessData.Add(new ColorProcessData() { InkNlCm = x.NlCm, L = x.L, A = x.A, B = x.B, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid})); + YellowPlot.CreateGraph(YellowProcessData.ToList(), false); + UpdateFactorsOnChangeProcessData("YELLOW"); + } + } + + private void ImportCyanData(object obj) + { + List items; + if (LoadColorDataFromExcel(out items) && items != null) + { + CyanProcessData.Clear(); + items.ForEach(x => CyanProcessData.Add(new ColorProcessData() { InkNlCm = x.NlCm, L = x.L, A = x.A, B = x.B, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid })); + CyanPlot.CreateGraph(CyanProcessData.ToList(), true); + UpdateFactorsOnChangeProcessData("CYAN"); + } + } + + private void ImportBlackData(object obj) + { + List items; + if (LoadColorDataFromExcel(out items) && items != null) + { + BlackProcessData.Clear(); + items.ForEach(x => BlackProcessData.Add(new ColorProcessData() { InkNlCm = x.NlCm, L = x.L, A = x.A, B = x.B, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid })); + BlackPlot.CreateGraph(BlackProcessData.ToList(), true); + UpdateFactorsOnChangeProcessData("BLACK"); + } + } + + private bool LoadColorDataFromExcel(out List items) + { + OpenFileDialog dlg = new OpenFileDialog(); + items = null; + try + { + dlg.Title = $"Import excel file with data"; + dlg.Filter = "Excel Files|*.xlsx"; + if (dlg.ShowDialog().Value) + { + string error = ""; + ColorDataExcelModel.GetDataFromFile(dlg.FileName, out items, ref error); + if (false == String.IsNullOrEmpty(error) || items == null || items.Count == 0) + { + _notification.ShowError("An error occurred while trying to import data form the selected excel file. Please check the file format if valid and is available to read."); + return false; + } + return true; + } + } + catch (Exception ex) + { + LogManager.Log(ex, "Error importing excel file " + dlg.FileName); + _notification.ShowError("An error occurred while trying to import the selected excel file. Please check the file format if valid and is available to read."); + } + return false; + } + + #endregion + + public ColorParametersVewVM(INotificationProvider notification, IActionLogManager actionLogManager) + { + _notification = notification; + _actionLogManager = actionLogManager; + _isViewLoaded = false; + RemovedColorProcessDataBeforeSave = new Dictionary(); + + MachinesProvider = new SuggestionProvider((filter) => + { + try + { + return _machineDbContext.Machines.Where(x => x.SerialNumber.StartsWith(filter)).ToList(); + } + catch + { + return null; + } + }); + + CyanProcessData = new ObservableCollection(); + CyanProcessData.CollectionChanged += OnCyanCollectionChanged; + + MagentaProcessData = new ObservableCollection(); + MagentaProcessData.CollectionChanged += OnMagentaCollectionChanged; + + YellowProcessData = new ObservableCollection(); + YellowProcessData.CollectionChanged += OnYellowCollectionChanged; + + BlackProcessData = new ObservableCollection(); + BlackProcessData.CollectionChanged += OnBlackCollectionChanged; + + CyanPlot = new PlotProperties("CYAN"); + YellowPlot = new PlotProperties("YELLOW"); + MagentaPlot = new PlotProperties("MAGENTA"); + BlackPlot = new PlotProperties("BLACK"); + + ImportCyanDataCommand = new RelayCommand(ImportCyanData); + ImportMagentaDataCommand = new RelayCommand(ImportMagentaData); + ImportYellowDataCommand = new RelayCommand(ImportYellowData); + ImportBlackDataCommand = new RelayCommand(ImportBlackData); + } + + #region Loading + + public async void LoadColorParameters(string RMLExtemtionGUID) + { + IsFree = false; + if (_active_context != null) + { + _active_context.Dispose(); + } + if (_machineDbContext != null) + { + _machineDbContext.Dispose(); + } + + + LogManager.Log("Initializing machine Db context..."); + + _machineDbContext = ObservablesContext.CreateDefault(); + + + _active_context = ObservablesContext.CreateDefault(); + + await Task.Factory.StartNew(() => + { + using (_notification.PushTaskItem("Loading Color Process Parameters ...")) + { + + var currentcolorProcessParameter = _active_context.ColorProcessParameters.Where(x => x.RmlsExtensionsGuid == RMLExtemtionGUID).FirstOrDefault(); + if(currentcolorProcessParameter != null) + { + SelectedColorProcessParameter = new ColorProcessParametersBuilder(_active_context).Set(currentcolorProcessParameter.Guid).WithColorProcessData().WithColorProcessFactor(). Build(); + } + + if (SelectedColorProcessParameter == null) + { + SelectedColorProcessParameter = new ColorProcessParameter() { RmlsExtensionsGuid = RMLExtemtionGUID }; + SelectedColorProcessParameter.WhitePointL = 0.0; + SelectedColorProcessParameter.WhitePointA = 0.0; + SelectedColorProcessParameter.WhitePointB = 0.0; + SelectedColorProcessParameter.ColorProcessFactor.Add(new ColorProcessFactor() { ColorName = "CYAN", FactorPercent = 100, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); + SelectedColorProcessParameter.ColorProcessFactor.Add(new ColorProcessFactor() { ColorName = "MAGENTA", FactorPercent = 100, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); + SelectedColorProcessParameter.ColorProcessFactor.Add(new ColorProcessFactor() { ColorName = "YELLOW", FactorPercent = 100, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); + SelectedColorProcessParameter.ColorProcessFactor.Add(new ColorProcessFactor() { ColorName = "BLACK", FactorPercent = 100, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); + SelectedColorProcessParameter.ColorProcessFactor.Add(new ColorProcessFactor() { ColorName = "CYAN", FactorPercent = 200, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); + SelectedColorProcessParameter.ColorProcessFactor.Add(new ColorProcessFactor() { ColorName = "MAGENTA", FactorPercent = 200, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); + SelectedColorProcessParameter.ColorProcessFactor.Add(new ColorProcessFactor() { ColorName = "YELLOW", FactorPercent = 200, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); + SelectedColorProcessParameter.ColorProcessFactor.Add(new ColorProcessFactor() { ColorName = "BLACK", FactorPercent = 200, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); + SelectedColorProcessParameter.ColorProcessFactor.Add(new ColorProcessFactor() { ColorName = "CYAN", FactorPercent = 1, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); + SelectedColorProcessParameter.ColorProcessFactor.Add(new ColorProcessFactor() { ColorName = "MAGENTA", FactorPercent = 1, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); + SelectedColorProcessParameter.ColorProcessFactor.Add(new ColorProcessFactor() { ColorName = "YELLOW", FactorPercent = 1, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); + SelectedColorProcessParameter.ColorProcessFactor.Add(new ColorProcessFactor() { ColorName = "BLACK", FactorPercent = 1, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); + SelectedColorProcessParameter.ColorProcessFactor.Add(new ColorProcessFactor() { ColorName = "CYAN", FactorPercent = 1111, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); + SelectedColorProcessParameter.ColorProcessFactor.Add(new ColorProcessFactor() { ColorName = "MAGENTA", FactorPercent = 1111, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); + SelectedColorProcessParameter.ColorProcessFactor.Add(new ColorProcessFactor() { ColorName = "YELLOW", FactorPercent = 1111, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); + SelectedColorProcessParameter.ColorProcessFactor.Add(new ColorProcessFactor() { ColorName = "BLACK", FactorPercent = 1111, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); + _active_context.ColorProcessParameters.Add(SelectedColorProcessParameter); + _active_context.SaveChangesAsync(); + } + + } + }); + + LoadParameters(); + IsFree = true; + } + + private void LoadParameters() + { + Factor100ProcessData = SelectedColorProcessParameter.ColorProcessFactor.Where(x => x.FactorPercent == 100).ToObservableCollection(); + + Factor200ProcessData = SelectedColorProcessParameter.ColorProcessFactor.Where(x => x.FactorPercent == 200).ToObservableCollection(); + + MinInkUptake = SelectedColorProcessParameter.ColorProcessFactor.Where(x => x.FactorPercent == 1).ToObservableCollection(); + + MaxInkUptake = SelectedColorProcessParameter.ColorProcessFactor.Where(x => x.FactorPercent == 1111).ToObservableCollection(); + + RemovedColorProcessDataBeforeSave.Clear(); + + var cyanDataList = SelectedColorProcessParameter.ColorProcessData.Where(x => x.ColorName == "CYAN").ToList().OrderBy(x => x.InkNlCm ).ToList(); + CyanProcessData.Clear(); + cyanDataList.ForEach( y => CyanProcessData.Add(y)); + + var magentaDatalist = SelectedColorProcessParameter.ColorProcessData.Where(x => x.ColorName == "MAGENTA").ToList().OrderBy(x => x.InkNlCm).ToList(); ; + MagentaProcessData.Clear(); + magentaDatalist.ForEach(y => MagentaProcessData.Add(y)); + + var yellowDatalist = SelectedColorProcessParameter.ColorProcessData.Where(x => x.ColorName == "YELLOW").ToList().OrderBy(x => x.InkNlCm).ToList(); ; + YellowProcessData.Clear(); + yellowDatalist.ForEach(y => YellowProcessData.Add(y)); + + var blackDatalist = SelectedColorProcessParameter.ColorProcessData.Where(x => x.ColorName == "BLACK").ToList().OrderBy(x => x.InkNlCm).ToList(); ; + BlackProcessData.Clear(); + blackDatalist.ForEach(y => BlackProcessData.Add(y)); + + UpdatePlots(); + SelectedColorProcessParameter.ColorProcessFactor.ToList().ForEach(x => UpdateFactorsOnChangeProcessData(x.ColorName)); + } + + #endregion + + #region Update Plot + + public void UpdatePlots() + { + if (IsViewLoaded) + { + CyanPlot.CreateGraph(CyanProcessData.ToList(), true); + MagentaPlot.CreateGraph(MagentaProcessData.ToList(), true); + YellowPlot.CreateGraph(YellowProcessData.ToList(), false); + BlackPlot.CreateGraph(BlackProcessData.ToList(), true); + } + } + + private void OnCyanCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) + { + if (e.Action == NotifyCollectionChangedAction.Reset) + { + var cyanProcessData = SelectedColorProcessParameter.ColorProcessData.Where(x => x.ColorName == "CYAN").ToObservableCollection(); + foreach (ColorProcessData item in cyanProcessData) + { + SelectedColorProcessParameter.ColorProcessData.Remove(item); + RemovedColorProcessDataBeforeSave[item.Guid] = item; + item.PropertyChanged -= CyanMeasurementModelPropertyChanged; + } + // UpdateFactorsOnChangeProcessData("Cyan"); + } + else if (e.Action == NotifyCollectionChangedAction.Remove) + { + foreach (ColorProcessData item in e.OldItems) + { + SelectedColorProcessParameter.ColorProcessData.Remove(item); + RemovedColorProcessDataBeforeSave[item.Guid] = item; + item.PropertyChanged -= CyanMeasurementModelPropertyChanged; + } + UpdateFactorsOnChangeProcessData("CYAN"); + } + else if (e.Action == NotifyCollectionChangedAction.Add) + { + foreach (ColorProcessData item in e.NewItems) + { + item.ColorName = "CYAN"; + item.ColorProcessParametersGuid = SelectedColorProcessParameter.Guid; + SelectedColorProcessParameter.ColorProcessData.Add(item); + RemovedColorProcessDataBeforeSave.Remove(item.Guid); + item.PropertyChanged += CyanMeasurementModelPropertyChanged; + } + } + } + + private void CyanMeasurementModelPropertyChanged(object sender, PropertyChangedEventArgs e) + { + if(IsFree) + { + CyanPlot.CreateGraph(CyanProcessData.ToList(), true); + UpdateFactorsOnChangeProcessData("CYAN"); + } + } + + private void OnMagentaCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) + { + if (e.Action == NotifyCollectionChangedAction.Reset) + { + var magentaProcessData = SelectedColorProcessParameter.ColorProcessData.Where(x => x.ColorName == "MAGENTA").ToObservableCollection(); + foreach (ColorProcessData item in magentaProcessData) + { + item.PropertyChanged -= MagentaMeasurementModelPropertyChanged; + SelectedColorProcessParameter.ColorProcessData.Remove(item); + RemovedColorProcessDataBeforeSave[item.Guid] = item; + } + // UpdateFactorsOnChangeProcessData("Magenta"); + } + else if (e.Action == NotifyCollectionChangedAction.Remove) + { + foreach (ColorProcessData item in e.OldItems) + { + SelectedColorProcessParameter.ColorProcessData.Remove(item); + RemovedColorProcessDataBeforeSave[item.Guid] = item; + item.PropertyChanged -= MagentaMeasurementModelPropertyChanged; + } + UpdateFactorsOnChangeProcessData("MAGENTA"); + } + else if (e.Action == NotifyCollectionChangedAction.Add) + { + foreach (ColorProcessData item in e.NewItems) + { + item.ColorName = "MAGENTA"; + item.ColorProcessParametersGuid = SelectedColorProcessParameter.Guid; + SelectedColorProcessParameter.ColorProcessData.Add(item); + RemovedColorProcessDataBeforeSave.Remove(item.Guid); + item.PropertyChanged += MagentaMeasurementModelPropertyChanged; + } + } + } + + private void MagentaMeasurementModelPropertyChanged(object sender, PropertyChangedEventArgs e) + { + if (IsFree) + { + MagentaPlot.CreateGraph(MagentaProcessData.ToList(), true); + UpdateFactorsOnChangeProcessData("MAGENTA"); + } + } + + private void OnYellowCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) + { + if (e.Action == NotifyCollectionChangedAction.Reset) + { + var yellowProcessData = SelectedColorProcessParameter.ColorProcessData.Where(x => x.ColorName == "YELLOW").ToObservableCollection(); + foreach (ColorProcessData item in yellowProcessData) + { + item.PropertyChanged -= YellowMeasurementModelPropertyChanged; + SelectedColorProcessParameter.ColorProcessData.Remove(item); + RemovedColorProcessDataBeforeSave[item.Guid] = item; + } + //UpdateFactorsOnChangeProcessData("Yellow"); + } + else if (e.Action == NotifyCollectionChangedAction.Remove) + { + foreach (ColorProcessData item in e.OldItems) + { + SelectedColorProcessParameter.ColorProcessData.Remove(item); + RemovedColorProcessDataBeforeSave[item.Guid] = item; + item.PropertyChanged -= YellowMeasurementModelPropertyChanged; + } + UpdateFactorsOnChangeProcessData("YELLOW"); + } + else if (e.Action == NotifyCollectionChangedAction.Add) + { + foreach (ColorProcessData item in e.NewItems) + { + item.ColorName = "YELLOW"; + item.ColorProcessParametersGuid = SelectedColorProcessParameter.Guid; + SelectedColorProcessParameter.ColorProcessData.Add(item); + RemovedColorProcessDataBeforeSave.Remove(item.Guid); + item.PropertyChanged += YellowMeasurementModelPropertyChanged; + } + } + } + + private void YellowMeasurementModelPropertyChanged(object sender, PropertyChangedEventArgs e) + { + if (IsFree) + { + YellowPlot.CreateGraph(YellowProcessData.ToList(), false); + UpdateFactorsOnChangeProcessData("YELLOW"); + } + } + + private void OnBlackCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) + { + if(e.Action == NotifyCollectionChangedAction.Reset) + { + var blackProcessData = SelectedColorProcessParameter.ColorProcessData.Where(x => x.ColorName == "BLACK").ToObservableCollection(); + foreach (ColorProcessData item in blackProcessData) + { + item.PropertyChanged -= BlackMeasurementModelPropertyChanged; + SelectedColorProcessParameter.ColorProcessData.Remove(item); + RemovedColorProcessDataBeforeSave[item.Guid] = item; + } + //UpdateFactorsOnChangeProcessData("Black"); + } + else if (e.Action == NotifyCollectionChangedAction.Remove) + { + foreach (ColorProcessData item in e.OldItems) + { + SelectedColorProcessParameter.ColorProcessData.Remove(item); + RemovedColorProcessDataBeforeSave[item.Guid] = item; + item.PropertyChanged -= BlackMeasurementModelPropertyChanged; + } + UpdateFactorsOnChangeProcessData("BLACK"); + } + else if (e.Action == NotifyCollectionChangedAction.Add) + { + foreach (ColorProcessData item in e.NewItems) + { + item.ColorName = "BLACK"; + item.ColorProcessParametersGuid = SelectedColorProcessParameter.Guid; + SelectedColorProcessParameter.ColorProcessData.Add(item); + RemovedColorProcessDataBeforeSave.Remove(item.Guid); + item.PropertyChanged += BlackMeasurementModelPropertyChanged; + } + + } + } + + private void BlackMeasurementModelPropertyChanged(object sender, PropertyChangedEventArgs e) + { + if (IsFree) + { + BlackPlot.CreateGraph(BlackProcessData.ToList(), true); + UpdateFactorsOnChangeProcessData("BLACK"); + } + } + + #endregion + + #region update factors + + /// + /// Updates the ColorProcessFactor from ColorProcessData item. + /// + /// The factor. + /// The item. + private void UpdateFactor(ColorProcessFactor factor, ColorProcessData item) + { + if (factor == null) + return; + if (item == null) + { + factor.InkNlCm = 0; + factor.L = factor.A = factor.B = 0.0; + return; + } + factor.InkNlCm = item.InkNlCm; + factor.L = item.L; + factor.A = item.A; + factor.B = item.B; + } + + /// + /// Calculate and Update the factors on change process data. + /// + /// The color. + private void UpdateFactorsOnChangeProcessData(string color) + { + bool isLtype = color.ToLower() == "yellow" ? false : true; + var processData = SelectedColorProcessParameter.ColorProcessData.Where(x => x.ColorName.ToLower() == color.ToLower()).ToObservableCollection(); + double target100 = FactorTarget.GetFactor100(color); + double target200 = FactorTarget.GetFactor200(color); + ColorProcessData closest100 = null; + ColorProcessData closest200 = null; + ColorProcessData minInk = null; + ColorProcessData maxInk = null; + + var minDifference100 = double.MaxValue; + var minDifference200 = double.MaxValue; + + if (processData.Count == 0) + return; + + foreach (var item in processData) + { + var colorvalue = isLtype ? item.L : item.B; + var difference100 = Math.Abs(colorvalue - target100); + if (minDifference100 > difference100) + { + minDifference100 = (int)difference100; + closest100 = item; + } + var difference200 = Math.Abs(colorvalue - target200); + if (minDifference200 > difference200) + { + minDifference200 = (int)difference200; + closest200 = item; + } + if (minInk == null || minInk.InkNlCm > item.InkNlCm) + { + minInk = item; + } + if (maxInk == null || maxInk.InkNlCm < item.InkNlCm) + { + maxInk = item; + } + } + UpdateFactor(Factor100ProcessData.FirstOrDefault(x => x.ColorName == color), closest100); + UpdateFactor(Factor200ProcessData.FirstOrDefault(x => x.ColorName == color), closest200); + UpdateFactor(MinInkUptake.FirstOrDefault(x => x.ColorName == color), minInk); + UpdateFactor(MaxInkUptake.FirstOrDefault(x => x.ColorName == color), maxInk); + } + + #endregion + + #region save + + public async void Save() + { + try + { + IsFree = false; + await Task.Factory.StartNew(() => + { + SelectedColorProcessParameter.LastUpdated = DateTime.UtcNow; + + var colorProcessParameterAfterChange = ColorProcessParameterDTO.FromObservable(SelectedColorProcessParameter); + + foreach (KeyValuePair item in RemovedColorProcessDataBeforeSave) + { + var existingColorProcessData = _active_context.ColorProcessData.FirstOrDefault(y => y.Guid == item.Value.Guid); + if (existingColorProcessData != null) + { + _active_context.ColorProcessData.Remove(existingColorProcessData); + } + } + _active_context.SaveChanges(); + + }); + LoadColorParameters(SelectedColorProcessParameter.RmlsExtensionsGuid); + } + catch (Exception ex) + { + LogManager.Log(ex, "Could not update color parameters."); + _notification.ShowError($"An error occurred while trying to save color parameters.\n{ex.Message}"); + } + finally + { + IsFree = true; + } + } + + #endregion + } +} + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/MainViewVM.cs index 607670461..3fde7abbe 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/MainViewVM.cs @@ -1,18 +1,542 @@ - +using Microsoft.Win32; using System; using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Windows.Data; +using Tango.BL; +using Tango.BL.Builders; +using Tango.BL.Calibration; +using Tango.BL.Entities; +using Tango.Core.Commands; using Tango.MachineStudio.Common; +using Tango.MachineStudio.Common.Notifications; + + +using System.Data.Entity; +using Tango.Core.ExtensionMethods; +using Tango.MachineStudio.Common.Authentication; +using Tango.BL.ActionLogs; +using Tango.BL.DTO; +using Tango.BL.Enumerations; +using Tango.MachineStudio.ThreadExtensions.Contracts; +using Tango.MachineStudio.ThreadExtensions.Views; namespace Tango.MachineStudio.ThreadExtensions.ViewModels { - public class MainViewVM : StudioViewModel + public class MainViewVM : StudioViewModel { + private INotificationProvider _notification; + private IAuthenticationProvider _authentication; + private IActionLogManager _actionLogManager; + private RmlsExtensionDTO _rmlExtensionBeforeSave; + + private ObservablesContext _rmlExtentions_context; + private ObservablesContext _active_context; + + #region properties + private ObservableCollection _rmlsExtension; + public ObservableCollection RmlsExtensions + { + get { return _rmlsExtension; } + set { _rmlsExtension = value; + RaisePropertyChangedAuto(); } + } + + + private RmlsExtension _activeRMLExtention; + public RmlsExtension ActiveRMLExtention + { + get { return _activeRMLExtention; } + set { _activeRMLExtention = value; + RaisePropertyChangedAuto(); } + } + + private RmlsExtension _selectedRMLExtension; + public RmlsExtension SelectedRMLExtension + { + get { return _selectedRMLExtension; } + set { _selectedRMLExtension = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } + } + + private ICollectionView _rmlExtCollectionView; + /// + /// Gets or sets the RML collection view. + /// + public ICollectionView RmlExtCollectionView + { + get { return _rmlExtCollectionView; } + set + { + _rmlExtCollectionView = value; + RaisePropertyChangedAuto(); + } + } + + private ObservableCollection _applications; + public ObservableCollection Applications + { + get { return _applications; } + set { _applications = value; RaisePropertyChangedAuto(); } + } + + private ObservableCollection _brands; + public ObservableCollection Brands + { + get { return _brands; } + set { _brands = value; RaisePropertyChangedAuto(); } + } + + private ObservableCollection _yarnColor; + public ObservableCollection YarnColor + { + get { return _yarnColor; } + set { _yarnColor = value; RaisePropertyChangedAuto(); } + } + + private ObservableCollection _enduse; + public ObservableCollection EndUse + { + get { return _enduse; } + set { _enduse = value; RaisePropertyChangedAuto(); } + } + + private ObservableCollection _family; + public ObservableCollection Family + { + get { return _family; } + set { _family = value; RaisePropertyChangedAuto(); } + } + + private ObservableCollection _geometry; + public ObservableCollection Geometry + { + get { return _geometry; } + set { _geometry = value; RaisePropertyChangedAuto(); } + } + + private ObservableCollection _glosslevel; + public ObservableCollection GlossLevel + { + get { return _glosslevel; } + set { _glosslevel = value; RaisePropertyChangedAuto(); } + } + + private ObservableCollection _group; + public ObservableCollection Group + { + get { return _group; } + set { _group = value; RaisePropertyChangedAuto(); } + } + + private ObservableCollection _manufacturer; + public ObservableCollection Manufacturer + { + get { return _manufacturer; } + set { _manufacturer = value; RaisePropertyChangedAuto(); } + } + + private ObservableCollection _materials; + public ObservableCollection Materials + { + get { return _materials; } + set { _materials = value; RaisePropertyChangedAuto(); } + } + + private ObservableCollection _subFamilies; + public ObservableCollection SubFamilies + { + get { return _subFamilies; } + set { _subFamilies = value; RaisePropertyChangedAuto(); } + } + + private ObservableCollection _texturing; + public ObservableCollection Texturing + { + get { return _texturing; } + set { _texturing = value; RaisePropertyChangedAuto(); } + } + + private ObservableCollection _yarnTypes; + public ObservableCollection YarnTypes + { + get { return _yarnTypes; } + set { _yarnTypes = value; RaisePropertyChangedAuto(); } + } + + private ObservableCollection _industrySector; + public ObservableCollection IndustrySector + { + get { return _industrySector; } + set { _industrySector = value; RaisePropertyChangedAuto(); } + } + + private String _Filter; + /// + /// Gets or sets the search filter. + /// + public String Filter + { + get { return _Filter; } + set { _Filter = value; RaisePropertyChangedAuto(); OnFilterChanged(); } + } + + private void OnFilterChanged() + { + RmlExtCollectionView.Refresh(); + } + + private ColorParametersVewVM _colorParametersVewVM; + public ColorParametersVewVM ColorParametersVewVM + { + get { return _colorParametersVewVM; } + set { _colorParametersVewVM = value; RaisePropertyChangedAuto(); } + } + #endregion + + #region commands + + public RelayCommand SaveCommand { get; set; } + + public RelayCommand ManageRmlExtensionCommand { get; set; } + + public RelayCommand AddRmlExtCommand { get; set; } + + public RelayCommand RemoveRmlExtensionCommand { get; set; } + + public RelayCommand CloneRmlExtensionCommand { get; set; } + + public RelayCommand BackToThreadExtensionViewsCommand { get; set; } + + + private void BackToThreadExtensionViews(object obj) + { + View.NavigateTo(ThreadExtensionNavigationView.ThreadExtensionsView); + LoadRmlExtentions(); + } + + private async void CloneSelectedRmlExtension(object obj) + { + using (_notification.PushTaskItem("Cloning thread...")) + { + try + { + IsFree = false; + + using (var context = ObservablesContext.CreateDefault()) + { + RmlsExtension rml_extention = await new RmlExtensionsBuilder(_rmlExtentions_context).Set(SelectedRMLExtension.Guid).WithUser().BuildAsync(); + + RmlsExtension cloned = new RmlsExtension(); + rml_extention.MapPropertiesTo(cloned, MappingFlags.NoReferenceTypes); + + cloned.Guid = Guid.NewGuid().ToString(); + cloned.ID = 0; + + + context.RmlsExtensions.Add(cloned); + await context.SaveChangesAsync(); + + //_actionLogManager.InsertLog(BL.Enumerations.ActionLogType.RmlCreated, _authentication.CurrentUser, cloned.Name, cloned, "RML cloned from Machine Studio."); + } + + LoadRmlExtentions(); + } + catch (Exception ex) + { + LogManager.Log(ex, "Error cloning thread."); + _notification.ShowError($"An error occurred while trying to clone the selected thread\n{ex.Message}"); + } + finally + { + IsFree = true; + } + } + } + + private async void RemoveRmlExtension(object obj) + { + if (_notification.ShowQuestion(" Are you sure you want to delete the selected RML Extension?")) + { + using (_notification.PushTaskItem("Removing RML Extension...")) + { + try + { + IsFree = false; + + await SelectedRMLExtension.DeleteCascadeAsync(_rmlExtentions_context); + //_actionLogManager.InsertLog(BL.Enumerations.ActionLogType.RmlDeleted, _authentication.CurrentUser, SelectedRML.Name, SelectedRML, "RML deleted from Machine Studio."); + + LoadRmlExtentions(); + } + catch (Exception ex) + { + LogManager.Log(ex, $"Error removing selected RML {SelectedRMLExtension?.Name}."); + _notification.ShowError($"An error occurred while trying to remove the selected RML Extension.\n{ex.FlattenMessage()}"); + LoadRmlExtentions(); + } + finally + { + IsFree = true; + } + } + } + } + #endregion + + public MainViewVM(INotificationProvider notificationProvider, IAuthenticationProvider authentication, IActionLogManager actionLogManager) + { + _notification = notificationProvider; + _authentication = authentication; + _actionLogManager = actionLogManager; + + BackToThreadExtensionViewsCommand = new RelayCommand(BackToThreadExtensionViews, () => IsFree); + SaveCommand = new RelayCommand(Save, () => IsFree); + ManageRmlExtensionCommand = new RelayCommand(() => LoadActiveRMLExtention(SelectedRMLExtension.Guid), () => SelectedRMLExtension != null); + RemoveRmlExtensionCommand = new RelayCommand(RemoveRmlExtension, () => SelectedRMLExtension != null); + CloneRmlExtensionCommand = new RelayCommand(CloneSelectedRmlExtension, () => SelectedRMLExtension != null); + AddRmlExtCommand = new RelayCommand(AddNewRmlExtention); + } + public override void OnApplicationReady() { + LoadRmlExtentions(); + } + + #region Loading + + private async void LoadRmlExtentions() + { + try + { + IsFree = false; + + using (_notification.PushTaskItem("Loading RmlExtentions...")) + { + if (_rmlExtentions_context != null) _rmlExtentions_context.Dispose(); + + _rmlExtentions_context = ObservablesContext.CreateDefault(); + RmlsExtensions = await new RMLExtentionsCollectionBuilder(_rmlExtentions_context).SetAll().WithUser().WithYarnProperties().BuildAsync(); + + + RmlExtCollectionView = CollectionViewSource.GetDefaultView(RmlsExtensions); + RmlExtCollectionView.SortDescriptions.Add(new SortDescription(nameof(Rml.LastUpdated), ListSortDirection.Descending)); + + RmlExtCollectionView.Filter = (rml) => + { + RmlsExtension r = rml as RmlsExtension; + return String.IsNullOrWhiteSpace(Filter) + || r.Name.ToLower().Contains(Filter.ToLower()); + }; + + } + } + catch (Exception ex) + { + LogManager.Log(ex, $"Error loading RMLExtensions.\n{ex.FlattenMessage()}"); + } + finally + { + IsFree = true; + } + } + + private void LoadRmlProperties() + { + Applications = _active_context.YarnApplications.ToObservableCollection(); + Brands = _active_context.YarnBrand.ToObservableCollection(); + YarnColor = _active_context.YarnColor.ToObservableCollection(); + EndUse = _active_context.YarnEndUse.ToObservableCollection(); + Family = _active_context.YarnFamily.ToObservableCollection(); + Geometry = _active_context.YarnGeometry.ToObservableCollection(); + GlossLevel = _active_context.YarnGlossLevel.ToObservableCollection(); + Group = _active_context.YarnGroup.ToObservableCollection(); + Manufacturer = _active_context.YarnManufacturer.ToObservableCollection(); + + Materials = _active_context.YarnMaterials.ToObservableCollection(); + SubFamilies = _active_context.YarnSubFamily.ToObservableCollection(); + Texturing = _active_context.YarnTexturing.ToObservableCollection(); + YarnTypes = _active_context.YarnType.ToObservableCollection(); + IndustrySector = _active_context.YarnIndustrysector.ToObservableCollection(); + } + + private async void AddNewRmlExtention(object obj) + { + using (_notification.PushTaskItem("Creating new RML Extension...")) + { + IsFree = false; + + if (_active_context != null) + { + _active_context.Dispose(); + } + + _active_context = ObservablesContext.CreateDefault(); + + LoadRmlProperties(); + + RmlsExtension rml_extention = new RmlsExtension(); + rml_extention.Created = DateTime.UtcNow; + rml_extention.UserGuid = _authentication.CurrentUser.Guid; + rml_extention.YarnManufacturer = Manufacturer.FirstOrDefault(); + rml_extention.YarnBrand = Brands.FirstOrDefault(); + rml_extention.Country = null; + rml_extention.YarnEndUse = EndUse.FirstOrDefault(); + rml_extention.YarnApplications = Applications.FirstOrDefault(); + rml_extention.YarnIndustrysector = IndustrySector.FirstOrDefault(); + + rml_extention.YarnMaterial = Materials.FirstOrDefault(); + rml_extention.YarnType = YarnTypes.FirstOrDefault(); + rml_extention.YarnSubFamily = SubFamilies.FirstOrDefault(); + rml_extention.YarnFamily = Family.FirstOrDefault(); + rml_extention.YarnGroup = Group.FirstOrDefault(); + rml_extention.YarnTexturing = Texturing.FirstOrDefault(); + rml_extention.YarnGeometry = Geometry.FirstOrDefault(); + rml_extention.YarnColor = YarnColor.FirstOrDefault(); + rml_extention.YarnGlossLevel = GlossLevel.FirstOrDefault(); + rml_extention.LinearDensity = 0; + rml_extention.YarnUnit = YarnUnits.DTEX; + rml_extention.YarnPlies = Plies.P1; + rml_extention.FilamentCount = 0; + rml_extention.TwistTpm = 0; + rml_extention.YarnTwistDirections = TwistDirections.S; + rml_extention.MinElongation = 0.0; + rml_extention.MaxElongation = 100.0; + rml_extention.MinMaxForceN = 0.0; + rml_extention.MaxMaxForceN = 100.0; + rml_extention.MinElasticity = 0.0; + rml_extention.MaxElasticity = 100.0; + rml_extention.MinTenacity = 0.0; + rml_extention.MaxTenacity = 100.0; + rml_extention.Finishing = "Lubrication"; + + _active_context.RmlsExtensions.Add(rml_extention); + await _active_context.SaveChangesAsync(); + + //_actionLogManager.InsertLog(BL.Enumerations.ActionLogType.RmlCreated, _authentication.CurrentUser, rml.Name, rml, "Rml created using Machine Studio."); + ColorParametersVewVM = new ColorParametersVewVM(_notification, _actionLogManager); + LoadActiveRMLExtention(rml_extention.Guid); + + IsFree = true; + } + } + + private async void LoadActiveRMLExtention(String guid) + { + using (_notification.PushTaskItem("Loading RML Extension...")) + { + try + { + IsFree = false; + + if (_active_context != null) + { + _active_context.Dispose(); + } + + _active_context = ObservablesContext.CreateDefault(); + + LoadRmlProperties(); + + ActiveRMLExtention = await new RmlExtensionsBuilder(_active_context) + .Set(guid) + .WithUser() + .BuildAsync(); + + ColorParametersVewVM = new ColorParametersVewVM(_notification, _actionLogManager); + ColorParametersVewVM.LoadColorParameters(guid); + View.NavigateTo(ThreadExtensionNavigationView.ThreadExtentionView); + + InvalidateRelayCommands(); + + IsFree = true; + } + catch (Exception ex) + { + //LogManager.Log($"Error loading RML '{ActiveRML.Name}'..."); + _notification.ShowError($"Error loading the selected thread.\n{ex.FlattenMessage()}"); + } + finally + { + IsFree = true; + } + } + } + + private async void RefreshView(String guid) + { + try + { + IsFree = false; + + //if (_active_context != null) + //{ + // _active_context.Dispose(); + //} + + //_active_context = ObservablesContext.CreateDefault(); + + LoadRmlProperties(); + ActiveRMLExtention = await new RmlExtensionsBuilder(_active_context) + .Set(guid) + .WithUser() + .BuildAsync(); + + InvalidateRelayCommands(); + + IsFree = true; + } + catch (Exception ex) + { + //LogManager.Log($"Error loading RML '{ActiveRML.Name}'..."); + _notification.ShowError($"Error refresh the selected thread.\n{ex.FlattenMessage()}"); + } + finally + { + IsFree = true; + } + } + + #endregion + + private async void Save() + { + IsFree = false; + + try + { + using (_notification.PushTaskItem("Saving RML Extension...")) + { + + ActiveRMLExtention.LastUpdated = DateTime.UtcNow; + + ColorParametersVewVM.Save(); + + var rmlExtensionAfter = RmlsExtensionDTO.FromObservable(ActiveRMLExtention); + + await _active_context.SaveChangesAsync(); + + //ColorParametersVewVM.LoadColorParameters(ActiveRMLExtention.Guid); + // _actionLogManager.InsertLog(BL.Enumerations.ActionLogType.RmlSaved, _authentication.CurrentUser, _rmlBeforeSave.Name, _rmlBeforeSave, rmlAfter, "RML saved using Machine Studio."); + + _rmlExtensionBeforeSave = rmlExtensionAfter; + RefreshView(SelectedRMLExtension.Guid); + } + } + catch (Exception ex) + { + LogManager.Log(ex, $"Error saving RML Extension {ActiveRMLExtention.Name}"); + _notification.ShowError($"An error occurred while trying to save the current RML Extension.\n{ex.FlattenMessage()}"); + } + finally + { + IsFree = true; + } } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ColorParametersView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ColorParametersView.xaml new file mode 100644 index 000000000..1526a49cb --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ColorParametersView.xaml @@ -0,0 +1,474 @@ + + + + + + + + + + + + + + + + + + + + + + + + + TARGET MACHINE + + + + + + + + + + + + + + + + + + + + + + + LIQUID TYPE CYAN + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LIQUID TYPE MAGENTA + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LIQUID TYPE YELLOW + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LIQUID TYPE BLACK + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + L + + + A + + + B + + + White point + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ColorParametersView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ColorParametersView.xaml.cs new file mode 100644 index 000000000..4e6a8c048 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ColorParametersView.xaml.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +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; +using Tango.MachineStudio.ThreadExtensions.ViewModels; + +namespace Tango.MachineStudio.ThreadExtensions.Views +{ + /// + /// Interaction logic for ColorParametersView.xaml + /// + public partial class ColorParametersView : UserControl + { + public ColorParametersView() + { + InitializeComponent(); + this.Loaded += ColorParametersView_Loaded; + } + + private void ColorParametersView_Loaded(object sender, RoutedEventArgs e) + { + if (contentGrid != null && contentGrid.DataContext is ColorParametersVewVM) + { + ColorParametersVewVM vm = (ColorParametersVewVM)contentGrid.DataContext; + vm.CyanPlot.PlotControl = CyanPlotControl; + vm.MagentaPlot.PlotControl = MagentaPlotControl; + vm.YellowPlot.PlotControl = YellowPlotControl; + vm.BlackPlot.PlotControl = BlackPlotControl; + vm.IsViewLoaded = true; + } + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/MainView.xaml index b446c7cc7..0ef5850c6 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/MainView.xaml @@ -4,12 +4,16 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:Tango.MachineStudio.ThreadExtensions.Views" + xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" xmlns:vm="clr-namespace:Tango.MachineStudio.ThreadExtensions.ViewModels" xmlns:global="clr-namespace:Tango.MachineStudio.ThreadExtensions" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" d:DesignHeight="1080" d:DesignWidth="1920" Background="Transparent" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> - Thread Extensions + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/MainView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/MainView.xaml.cs index 863a96398..251099c8a 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/MainView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/MainView.xaml.cs @@ -12,17 +12,25 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using Tango.Core.DI; +using Tango.MachineStudio.ThreadExtensions.Contracts; namespace Tango.MachineStudio.ThreadExtensions.Views { /// /// Interaction logic for MainView.xaml /// - public partial class MainView : UserControl + public partial class MainView : UserControl, IMainView { public MainView() { InitializeComponent(); + TangoIOC.Default.Register(this); + } + + public void NavigateTo(ThreadExtensionNavigationView view) + { + navigationControl.NavigateTo(view.ToString()); } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ThreadCharacteristicsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ThreadCharacteristicsView.xaml new file mode 100644 index 000000000..fac8e6af4 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ThreadCharacteristicsView.xaml @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + Yarn Source + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Yarn Source + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Yarn Data + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Yarn Properties from datasheet + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ThreadCharacteristicsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ThreadCharacteristicsView.xaml.cs new file mode 100644 index 000000000..944cf07f4 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ThreadCharacteristicsView.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.ThreadExtensions.Views +{ + /// + /// Interaction logic for ThreadCharacteristicsView.xaml + /// + public partial class ThreadCharacteristicsView : UserControl + { + public ThreadCharacteristicsView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ThreadExtensionView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ThreadExtensionView.xaml new file mode 100644 index 000000000..f9d8a2dc3 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ThreadExtensionView.xaml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ThreadExtensionView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ThreadExtensionView.xaml.cs new file mode 100644 index 000000000..2cce29e57 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ThreadExtensionView.xaml.cs @@ -0,0 +1,27 @@ +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.Shapes; + +namespace Tango.MachineStudio.ThreadExtensions.Views +{ + /// + /// Interaction logic for ThreadExtView.xaml + /// + public partial class ThreadExtentionView : UserControl + { + public ThreadExtentionView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ThreadExtensionsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ThreadExtensionsView.xaml new file mode 100644 index 000000000..b85222b12 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ThreadExtensionsView.xaml @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ThreadExtensionsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ThreadExtensionsView.xaml.cs new file mode 100644 index 000000000..9afb7a5c8 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ThreadExtensionsView.xaml.cs @@ -0,0 +1,27 @@ +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.Shapes; + +namespace Tango.MachineStudio.ThreadExtensions.Views +{ + /// + /// Interaction logic for ThreadExtViews.xaml + /// + public partial class ThreadExtensionsView : UserControl + { + public ThreadExtensionsView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/app.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/app.config index 97a204217..7b82e5f7c 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/app.config +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/app.config @@ -1,5 +1,9 @@  + + +
+ @@ -72,4 +76,10 @@ + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/packages.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/packages.config index fd88f4804..5a03cfb57 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/packages.config +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/packages.config @@ -1,8 +1,11 @@  + + + \ No newline at end of file -- cgit v1.3.1