diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2021-12-20 15:47:33 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2021-12-20 15:47:33 +0200 |
| commit | 5ab11fca7d8094678b1c675cf6a42011f7f2c3de (patch) | |
| tree | 9d1fc6c52f47d4d06421a31d22223640d34c3a42 /Software/Visual_Studio/MachineStudio/Modules | |
| parent | fd24c47e3c812d00e5d3889dd646ba9f3d834297 (diff) | |
| parent | ad251a8c9af9b1728cc53acfe672cee83949c71b (diff) | |
| download | Tango-5ab11fca7d8094678b1c675cf6a42011f7f2c3de.tar.gz Tango-5ab11fca7d8094678b1c675cf6a42011f7f2c3de.zip | |
Merged Thread Extensions Bugs branch.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules')
17 files changed, 821 insertions, 302 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/ViewModels/JobRunsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/ViewModels/JobRunsViewVM.cs index 9494de3f9..b671e053e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/ViewModels/JobRunsViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/ViewModels/JobRunsViewVM.cs @@ -298,7 +298,7 @@ namespace Tango.MachineStudio.Statistics.ViewModels { _notification = notificationProvider; JobRuns = new ObservableCollection<JobRunModel>(); - LoadJobRunsCommand = new RelayCommand(async () => await LoadJobRuns(), () => IsFree && SelectedMachines.Source.Count >0); + LoadJobRunsCommand = new RelayCommand(async () => await LoadJobRuns(), () => IsFree && SelectedMachines!= null && SelectedMachines.Source.Count >0); ExportToExcelCommand = new RelayCommand(ExportToExcel, () => IsFree); LengthUpperValue = 10000.0; LengthLowerValue = 0.0; diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Converters/NumericFieldConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Converters/NumericFieldConverter.cs new file mode 100644 index 000000000..0afcf2956 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Converters/NumericFieldConverter.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; + +namespace Tango.MachineStudio.ThreadExtensions.Converters +{ + public class NumericFieldConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + return value; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + return value; + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Models/ColorDataExcelModel.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Excel/ColorDataExcelModel.cs index da7471e16..da7471e16 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Models/ColorDataExcelModel.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Excel/ColorDataExcelModel.cs diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Excel/ColorParametrsExcelModel.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Excel/ColorParametrsExcelModel.cs new file mode 100644 index 000000000..72e31b3d7 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Excel/ColorParametrsExcelModel.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.MachineStudio.ThreadExtensions.Models +{ + public class ColorParametrsExcelModel + { + public String Thread_name { get; set; } + public String MachineNumber { get; set; } + public double White_point_L { get; set; } + public double White_point_a { get; set; } + public double White_point_B { get; set; } + public double Factor_100__C { get; set; } + public double Factor_100__Cyan_L { get; set; } + public double Factor_100__Cyan_A { get; set; } + public double Factor_100__Cyan_B { get; set; } + public double Factor_100__M { get; set; } + public double Factor_100__Magenta_L { get; set; } + public double Factor_100__Magenta_A { get; set; } + public double Factor_100__Magenta_B { get; set; } + + public double Factor_100__Y { get; set; } + public double Factor_100__Yellow_L { get; set; } + public double Factor_100__Yellow_A { get; set; } + public double Factor_100__Yellow_B { get; set; } + public double Factor_100_K { get; set; } + public double Factor_100__Key_L { get; set; } + public double Factor_100__Key_A { get; set; } + public double Factor_100__Key_B { get; set; } + public double Factor_200_C { get; set; } + public double Factor_200__Cyan_L { get; set; } + public double Factor_200__Cyan_A { get; set; } + public double Factor_200__Cyan_B { get; set; } + + public double Factor_200__Magenta { get; set; } + public double Factor_200__Magenta_L { get; set; } + public double Factor_200__Magenta_A { get; set; } + public double Factor_200__Magenta_B { get; set; } + + public double Factor_200__Yellow { get; set; } + public double Factor_200__Yellow_L { get; set; } + public double Factor_200__Yellow_A { get; set; } + public double Factor_200__Yellow_B { get; set; } + + public double Factor_200__Key { get; set; } + public double Factor_200__Key_L { get; set; } + public double Factor_200__Key_A { get; set; } + public double Factor_200__Key_B { get; set; } + + public int Min_Ink_Uptake_Zone1 { get; set; } + public int Min_Ink_Uptake_Zone2 { get; set; } + public int Max_Ink_Uptake_Zone1 { get; set; } + public int Max_ink_uptake__Zone2 { get; set; } + + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Excel/TestResultsExcelModel.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Excel/TestResultsExcelModel.cs new file mode 100644 index 000000000..58d48f62e --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Excel/TestResultsExcelModel.cs @@ -0,0 +1,123 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.MachineStudio.ThreadExtensions.Models +{ + public class TestResultsExcelModel + { + public String Thread_name_test_results { get; set; } + public String Machine_number { get; set; } + public String Test_results_name__tab { get; set; } + + public int Dryer_temp { get; set; } + public int Dryer_flow { get; set; } + public int Tunnel_temp { get; set; } + public int Tunnel_flow { get; set; } + + public String Tension_in_head { get; set; } + public String Tension_after_dryer { get; set; } + public String Tension_in_winder { get; set; } + public String BTSR { get; set; } + public String Puller_tension { get; set; } + public String Winder_tension { get; set; } + + public double Rubbing_K_100___DE { get; set; } + public double Rubbing_K_100___GS { get; set; } + public double Rubbing_K_200___DE { get; set; } + public double Rubbing_K_200___GS { get; set; } + public double Rubbing_C_100___DE { get; set; } + public double Rubbing_C_100___GS { get; set; } + public double Rubbing_C_200___DE { get; set; } + public double Rubbing_C_200___GS { get; set; } + public double Rubbing_Y_100___DE { get; set; } + public double Rubbing_Y_100___GS { get; set; } + public double Rubbing_Y_200___DE { get; set; } + public double Rubbing_Y_200___GS { get; set; } + public double Rubbing_M_100___DE { get; set; } + public double Rubbing_M_100___GS { get; set; } + public double Rubbing_M_200___DE { get; set; } + public double Rubbing_M_200___GS { get; set; } + + public String Color_REF { get; set; } + public double Load__N_REF { get; set; } + public double STDEV_REF { get; set; } + public double REF_Strain { get; set; } + public double STDEV_Strain_REF { get; set; } + + public int Color_100_C { get; set; } + public String C_color_100_C { get; set; } + public double Load_N_100_C { get; set; } + public double STDEV_100_C { get; set; } + public double Change_100_C { get; set; } + public double Strain_100_C { get; set; } + public double STDEV_100_C_2 { get; set; } + public double Change_100_C_2 { get; set; } + + public int Color_100_K { get; set; } + public String C_color_100_K { get; set; } + public double Load__N_100_K { get; set; } + public double STDEV_100_K { get; set; } + public double Change__100_K { get; set; } + public double Strain_100_K { get; set; } + public double STDEV_100_K_2 { get; set; } + public double Change_100_K_2 { get; set; } + + public int Color_200_C { get; set; } + public String C_color_200_C { get; set; } + public double Load__N_200_C { get; set; } + public double STDEV_200_C { get; set; } + public double Change_200_C { get; set; } + public double Strain_200_C { get; set; } + public double STDEV_200_C_2 { get; set; } + public double Change_200_C_2 { get; set; } + + public int Color_200_K { get; set; } + public String C_color_200_K { get; set; } + public double Load__N_200_K { get; set; } + public double STDEV_200_K { get; set; } + public double Change_200_K { get; set; } + public double Strain_200_K { get; set; } + public double STDEV_200_K_2 { get; set; } + public double Change_200_K_2 { get; set; } + + public String Uniformity_Zone_1 { get; set; } + public String Uniformity_Zone_2 { get; set; } + + public double COF_REF { get; set; } + public double CV_REF { get; set; } + public double COF_Black { get; set; } + public double CV_Black { get; set; } + //for twine inly + public double lub_amount { get; set; } + + public String Comments { get; set; } + public String Conclusion { get; set; } + + public TestResultsExcelModel() + { + Comments = Conclusion = ""; + C_color_100_C = "Cyan"; + Color_100_C = 100; + Load__N_100_K = STDEV_100_K = Change__100_K = Strain_100_K = STDEV_100_K_2 = Change_100_K_2 = 0.0; + + C_color_200_C = "Cyan"; + Color_200_C = 200; + Load__N_200_C = STDEV_200_C = Change_200_C = Strain_200_C = STDEV_200_C_2 = Change_200_C_2 = 0.0; + + C_color_100_K = "Black"; + Color_100_K = 100; + Load__N_100_K = STDEV_100_K = Change__100_K = Strain_100_K = STDEV_100_K_2 = Change_100_K_2 = 0.0; + + C_color_200_K = "Black"; + Color_200_K = 200; + Load__N_200_K = STDEV_200_K = Change_200_K = Strain_200_K = STDEV_200_K_2 = Change_200_K_2 = 0.0; + + Color_REF = "REF"; + Load__N_REF = STDEV_REF = REF_Strain = STDEV_Strain_REF = 0; + } + + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Excel/ThreadCharacteristicsExelModel.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Excel/ThreadCharacteristicsExelModel.cs new file mode 100644 index 000000000..1f894d70b --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Excel/ThreadCharacteristicsExelModel.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.MachineStudio.ThreadExtensions.Models +{ + public class ThreadCharacteristicsExcelModel + { + public String ThreadName { get; set; } + public String Manufacturer { get; set; } + public String Brand { get; set; } + public String Country { get; set; } + public String EndUse { get; set; } + public String Applications { get; set; } + public String IndustrySector { get; set; } + public String Material { get; set; } + public String Type { get; set; } + public String SubFamily { get; set; } + public String Family { get; set; } + public String Group { get; set; } + public String Texturing { get; set; } + public String Geometry { get; set; } + public String Color { get; set; } + public String GlossLevel { get; set; } + public double LinearDensity { get; set; } + public String Unit { get; set; } + public int Plies { get; set; } + public int FilamentCountPerPlie { get; set; } + public int LinearDensityCount { get; set; } + public int CountDen { get; set; } + public String FiberCount { get; set; } + public int Twist { get; set; } + public String TwistDirection { get; set; } + } +} 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 index 0cb2679fd..a9bc38f4c 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Models/FactorTarget.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Models/FactorTarget.cs @@ -10,10 +10,10 @@ namespace Tango.MachineStudio.ThreadExtensions.Models public static class FactorTarget { public static Dictionary<FactorColors, double> FACTOR100 = new Dictionary<FactorColors, double>() { - { FactorColors.CYAN, 51.95}, {FactorColors.MAGENTA, 47.47}, { FactorColors.YELLOW, 94.05}, {FactorColors.BLACK, 26.58}}; + { FactorColors.CYAN, 51.64}, {FactorColors.MAGENTA, 46.77}, { FactorColors.YELLOW, 90.3}, {FactorColors.BLACK, 31.61}}; public static Dictionary<FactorColors, double> FACTOR200 = new Dictionary<FactorColors, double>() { - { FactorColors.CYAN, 46.3}, {FactorColors.MAGENTA, 41.04}, { FactorColors.YELLOW, 97.78}, {FactorColors.BLACK, 21.01}}; + { FactorColors.CYAN, 42.26}, {FactorColors.MAGENTA, 42.1}, { FactorColors.YELLOW, 98.86}, {FactorColors.BLACK, 24}}; public static double GetFactor100(FactorColors color) { 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 35123f9b1..9ea43ad0b 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 @@ -94,11 +94,15 @@ <Compile Include="Converters\ColorNameToBrushConverter.cs" /> <Compile Include="Converters\ColorWithPercentToBrushConverter.cs" /> <Compile Include="Converters\ComboBoxVisibleConverter.cs" /> - <Compile Include="Models\ColorDataExcelModel.cs" /> + <Compile Include="Converters\NumericFieldConverter.cs" /> + <Compile Include="Excel\ColorDataExcelModel.cs" /> + <Compile Include="Excel\ColorParametrsExcelModel.cs" /> <Compile Include="Models\FactorTarget.cs" /> <Compile Include="Models\MachineModel.cs" /> <Compile Include="Models\PlotProperties.cs" /> <Compile Include="Models\RmlExtensionModel.cs" /> + <Compile Include="Excel\TestResultsExcelModel.cs" /> + <Compile Include="Excel\ThreadCharacteristicsExelModel.cs" /> <Compile Include="ViewModelLocator.cs" /> <Compile Include="ViewModels\AddItemDialogVM.cs" /> <Compile Include="ViewModels\ColorParametersVewVM.cs" /> @@ -198,6 +202,7 @@ <Generator>SettingsSingleFileGenerator</Generator> <LastGenOutput>Settings.Designer.cs</LastGenOutput> </None> + <EmbeddedResource Include="Templates\ExportRMLTemplate.xlsx" /> </ItemGroup> <ItemGroup> <Resource Include="Images\threads.png" /> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Templates/ExportRMLTemplate.xlsx b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Templates/ExportRMLTemplate.xlsx Binary files differnew file mode 100644 index 000000000..19b6a0004 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Templates/ExportRMLTemplate.xlsx 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 index a89a2e33c..e13e016c5 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorParametersVewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/ColorParametersVewVM.cs @@ -138,35 +138,18 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels } } - private ObservableCollection<ColorProcessFactor> _minInkUptake; - public ObservableCollection<ColorProcessFactor> MinInkUptake - { - get - { - return _minInkUptake; - } - set - { - _minInkUptake = value; - RaisePropertyChangedAuto(); - } - } - private ObservableCollection<ColorProcessFactor> _maxInkUptake; - public ObservableCollection<ColorProcessFactor> MaxInkUptake + private ObservableCollection<ColorProcessInkUptake> _colorProcessInkUptakeData; + + public ObservableCollection<ColorProcessInkUptake> ColorProcessInkUptakeData { - get - { - return _maxInkUptake; - } - set - { - _maxInkUptake = value; + get { return _colorProcessInkUptakeData; } + set { + _colorProcessInkUptakeData = value; RaisePropertyChangedAuto(); } } - - + private PlotProperties _cyanPlot; public PlotProperties CyanPlot @@ -456,7 +439,7 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels var currentcolorProcessParameter = _active_context.ColorProcessParameters.Where(x => x.RmlsExtensionsGuid == RMLExtemtionGUID && x.MachineGuid == SelectedMachineGUID).FirstOrDefault(); if (currentcolorProcessParameter != null) { - SelectedColorProcessParameter = new ColorProcessParametersBuilder(_active_context).Set(currentcolorProcessParameter.Guid).WithColorProcessData().WithColorProcessFactor().Build(); + SelectedColorProcessParameter = new ColorProcessParametersBuilder(_active_context).Set(currentcolorProcessParameter.Guid).WithColorProcessData().WithColorProcessFactor().WithColorProcessInkUptake().Build(); } if (SelectedColorProcessParameter == null) @@ -473,17 +456,20 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels SelectedColorProcessParameter.ColorProcessFactors.Add(new ColorProcessFactor() { FactorColor = FactorColors.MAGENTA, FactorPercent = 200, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); SelectedColorProcessParameter.ColorProcessFactors.Add(new ColorProcessFactor() { FactorColor = FactorColors.YELLOW, FactorPercent = 200, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); SelectedColorProcessParameter.ColorProcessFactors.Add(new ColorProcessFactor() { FactorColor = FactorColors.BLACK, FactorPercent = 200, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); - SelectedColorProcessParameter.ColorProcessFactors.Add(new ColorProcessFactor() { FactorColor = FactorColors.CYAN, FactorPercent = 1, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); - SelectedColorProcessParameter.ColorProcessFactors.Add(new ColorProcessFactor() { FactorColor = FactorColors.MAGENTA, FactorPercent = 1, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); - SelectedColorProcessParameter.ColorProcessFactors.Add(new ColorProcessFactor() { FactorColor = FactorColors.YELLOW, FactorPercent = 1, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); - SelectedColorProcessParameter.ColorProcessFactors.Add(new ColorProcessFactor() { FactorColor = FactorColors.BLACK, FactorPercent = 1, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); - SelectedColorProcessParameter.ColorProcessFactors.Add(new ColorProcessFactor() { FactorColor = FactorColors.CYAN, FactorPercent = 1111, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); - SelectedColorProcessParameter.ColorProcessFactors.Add(new ColorProcessFactor() { FactorColor = FactorColors.MAGENTA, FactorPercent = 1111, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); - SelectedColorProcessParameter.ColorProcessFactors.Add(new ColorProcessFactor() { FactorColor = FactorColors.YELLOW, FactorPercent = 1111, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); - SelectedColorProcessParameter.ColorProcessFactors.Add(new ColorProcessFactor() { FactorColor = FactorColors.BLACK, FactorPercent = 1111, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); + SelectedColorProcessParameter.ColorProcessInkUptake.Add(new ColorProcessInkUptake() { InkUptakeZoneType = InkUptakeZoneTypes.MININKUPTAKEZONE1, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); + SelectedColorProcessParameter.ColorProcessInkUptake.Add(new ColorProcessInkUptake() { InkUptakeZoneType = InkUptakeZoneTypes.MAXINKUPTAKEZONE1, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); + SelectedColorProcessParameter.ColorProcessInkUptake.Add(new ColorProcessInkUptake() { InkUptakeZoneType = InkUptakeZoneTypes.MININKUPTAKEZONE2, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); + SelectedColorProcessParameter.ColorProcessInkUptake.Add(new ColorProcessInkUptake() { InkUptakeZoneType = InkUptakeZoneTypes.MAXINKUPTAKEZONE2, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); _active_context.ColorProcessParameters.Add(SelectedColorProcessParameter); _active_context.SaveChangesAsync(); } + else if(SelectedColorProcessParameter.ColorProcessInkUptake.Count == 0) + { + SelectedColorProcessParameter.ColorProcessInkUptake.Add(new ColorProcessInkUptake() { InkUptakeZoneType = InkUptakeZoneTypes.MININKUPTAKEZONE1, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); + SelectedColorProcessParameter.ColorProcessInkUptake.Add(new ColorProcessInkUptake() { InkUptakeZoneType = InkUptakeZoneTypes.MAXINKUPTAKEZONE1, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); + SelectedColorProcessParameter.ColorProcessInkUptake.Add(new ColorProcessInkUptake() { InkUptakeZoneType = InkUptakeZoneTypes.MININKUPTAKEZONE2, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); + SelectedColorProcessParameter.ColorProcessInkUptake.Add(new ColorProcessInkUptake() { InkUptakeZoneType = InkUptakeZoneTypes.MAXINKUPTAKEZONE2, ColorProcessParametersGuid = SelectedColorProcessParameter.Guid }); + } } }); @@ -498,10 +484,8 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels Factor200ProcessData = SelectedColorProcessParameter.ColorProcessFactors.Where(x => x.FactorPercent == 200).ToObservableCollection(); - MinInkUptake = SelectedColorProcessParameter.ColorProcessFactors.Where(x => x.FactorPercent == 1).ToObservableCollection(); - - MaxInkUptake = SelectedColorProcessParameter.ColorProcessFactors.Where(x => x.FactorPercent == 1111).ToObservableCollection(); - + ColorProcessInkUptakeData = SelectedColorProcessParameter.ColorProcessInkUptake.ToObservableCollection(); + RemovedColorProcessDataBeforeSave.Clear(); var cyanDataList = SelectedColorProcessParameter.ColorProcessData.Where(x => x.FactorColor == FactorColors.CYAN).ToList().OrderBy(x => x.InkNlCm).ToList(); @@ -672,31 +656,10 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels var processData = SelectedColorProcessParameter.ColorProcessData.Where(x => x.FactorColor == color).ToList(); double target100 = FactorTarget.GetFactor100(color); double target200 = FactorTarget.GetFactor200(color); - //ColorProcessData closest100 = null; - //ColorProcessData closest200 = 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; - // } - //} + var point100 = GetTargetPoint(processData, target100, isLtype); UpdateFactor(Factor100ProcessData.FirstOrDefault(x => x.FactorColor == color), point100); var point200 = GetTargetPoint(processData, target200, isLtype); @@ -716,12 +679,15 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels for (int index = 1; index < distinctItems.Count; index++) { var item = distinctItems[index]; + if (prevItem.L > item.L && (factor > prevItem.L || (factor <= prevItem.L && factor >= item.L)) || (prevItem.L <= item.L && (factor > prevItem.L || (factor >= prevItem.L && factor <= item.L))) || ((index + 1) == distinctItems.Count && calculatedX == 0.0)) { calculatedX = CalculateXValue(factor, new DataPoint(prevItem.InkNlCm, prevItem.L), new DataPoint(item.InkNlCm, item.L)); - break; + //Yellow line is ascending line( up line), others - descending line(down) + if (isLtype) + break; } prevItem = item; @@ -793,10 +759,14 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels { factordata.LastUpdated = DateTime.UtcNow; } + foreach (var inkdata in SelectedColorProcessParameter.ColorProcessInkUptake) + { + inkdata.LastUpdated = DateTime.UtcNow; + } await _active_context.SaveChangesAsync(); - LoadColorParameters(); + // LoadColorParameters(); } catch (Exception ex) { @@ -812,6 +782,104 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels } #endregion + + #region export to excel + + public void WritetoExcel(ColorParametrsExcelModel colorParametrsExcelModel, string machineGuid) + { + if (_active_context == null) + { + _active_context = ObservablesContext.CreateDefault(); + } + var colorProcessParametercur = _active_context.ColorProcessParameters.Where(x => x.RmlsExtensionsGuid == RMLExtemtionGUID && x.MachineGuid == machineGuid).FirstOrDefault(); + if (colorProcessParametercur == null) + return; + var colorProcessParameter = new ColorProcessParametersBuilder(_active_context).Set(colorProcessParametercur.Guid).WithColorProcessData().WithColorProcessFactor().WithColorProcessInkUptake().Build(); + var factor_cyan100 = colorProcessParameter.ColorProcessFactors.Where(x => x.FactorColor == FactorColors.CYAN && x.FactorPercent == 100).FirstOrDefault(); + if (factor_cyan100 != null) + { + colorParametrsExcelModel.Factor_100__C = factor_cyan100.InkNlCm; + colorParametrsExcelModel.Factor_100__Cyan_L = factor_cyan100.L; + colorParametrsExcelModel.Factor_100__Cyan_A = factor_cyan100.A; + colorParametrsExcelModel.Factor_100__Cyan_B = factor_cyan100.B; + } + + var factor_magenta100 = colorProcessParameter.ColorProcessFactors.Where(x => x.FactorColor == FactorColors.MAGENTA && x.FactorPercent == 100).FirstOrDefault(); + if (factor_magenta100 != null) + { + colorParametrsExcelModel.Factor_100__M = factor_magenta100.InkNlCm; + colorParametrsExcelModel.Factor_100__Magenta_L = factor_magenta100.L; + colorParametrsExcelModel.Factor_100__Magenta_A = factor_magenta100.A; + colorParametrsExcelModel.Factor_100__Magenta_B = factor_magenta100.B; + } + + var factor_yellow100 = colorProcessParameter.ColorProcessFactors.Where(x => x.FactorColor == FactorColors.YELLOW && x.FactorPercent == 100).FirstOrDefault(); + if (factor_yellow100 != null) + { + colorParametrsExcelModel.Factor_100__Y = factor_yellow100.InkNlCm; + colorParametrsExcelModel.Factor_100__Yellow_L = factor_yellow100.L; + colorParametrsExcelModel.Factor_100__Yellow_A = factor_yellow100.A; + colorParametrsExcelModel.Factor_100__Yellow_B = factor_yellow100.B; + } + + var factor_key100 = colorProcessParameter.ColorProcessFactors.Where(x => x.FactorColor == FactorColors.BLACK && x.FactorPercent == 100).FirstOrDefault(); + if (factor_key100 != null) + { + colorParametrsExcelModel.Factor_100_K = factor_key100.InkNlCm; + colorParametrsExcelModel.Factor_100__Key_L = factor_key100.L; + colorParametrsExcelModel.Factor_100__Key_A = factor_key100.A; + colorParametrsExcelModel.Factor_100__Key_B = factor_key100.B; + } + + var factor_cyan200 = colorProcessParameter.ColorProcessFactors.Where(x => x.FactorColor == FactorColors.CYAN && x.FactorPercent == 200).FirstOrDefault(); + if (factor_cyan200 != null) + { + colorParametrsExcelModel.Factor_200_C = factor_cyan200.InkNlCm; + colorParametrsExcelModel.Factor_200__Cyan_L = factor_cyan200.L; + colorParametrsExcelModel.Factor_200__Cyan_A = factor_cyan200.A; + colorParametrsExcelModel.Factor_200__Cyan_B = factor_cyan200.B; + } + + var factor_magenta200 = colorProcessParameter.ColorProcessFactors.Where(x => x.FactorColor == FactorColors.MAGENTA && x.FactorPercent == 200).FirstOrDefault(); + if (factor_magenta200 != null) + { + colorParametrsExcelModel.Factor_200__Magenta = factor_magenta200.InkNlCm; + colorParametrsExcelModel.Factor_200__Magenta_L = factor_magenta200.L; + colorParametrsExcelModel.Factor_200__Magenta_A = factor_magenta200.A; + colorParametrsExcelModel.Factor_200__Magenta_B = factor_magenta200.B; + } + + var factor_yellow200 = colorProcessParameter.ColorProcessFactors.Where(x => x.FactorColor == FactorColors.YELLOW && x.FactorPercent == 200).FirstOrDefault(); + if (factor_yellow200 != null) + { + colorParametrsExcelModel.Factor_200__Yellow = factor_yellow200.InkNlCm; + colorParametrsExcelModel.Factor_200__Yellow_L = factor_yellow200.L; + colorParametrsExcelModel.Factor_200__Yellow_A = factor_yellow200.A; + colorParametrsExcelModel.Factor_200__Yellow_B = factor_yellow200.B; + } + + var factor_key200 = colorProcessParameter.ColorProcessFactors.Where(x => x.FactorColor == FactorColors.BLACK && x.FactorPercent == 200).FirstOrDefault(); + if (factor_key200 != null) + { + colorParametrsExcelModel.Factor_200__Key = factor_key200.InkNlCm; + colorParametrsExcelModel.Factor_200__Key_L = factor_key200.L; + colorParametrsExcelModel.Factor_200__Key_A = factor_key200.A; + colorParametrsExcelModel.Factor_200__Key_B = factor_key200.B; + } + + foreach (var inkUptakeZone in colorProcessParameter.ColorProcessInkUptake) + { + if (inkUptakeZone.InkUptakeZoneType == InkUptakeZoneTypes.MININKUPTAKEZONE1) + colorParametrsExcelModel.Min_Ink_Uptake_Zone1 = (inkUptakeZone.InkValue == null) ? 0 : (int)inkUptakeZone.InkValue; + else if (inkUptakeZone.InkUptakeZoneType == InkUptakeZoneTypes.MININKUPTAKEZONE2) + colorParametrsExcelModel.Min_Ink_Uptake_Zone2 = (inkUptakeZone.InkValue == null) ? 0 : (int)inkUptakeZone.InkValue; + else if (inkUptakeZone.InkUptakeZoneType == InkUptakeZoneTypes.MAXINKUPTAKEZONE1) + colorParametrsExcelModel.Max_Ink_Uptake_Zone1 = (inkUptakeZone.InkValue == null) ? 0 : (int)inkUptakeZone.InkValue; + else if (inkUptakeZone.InkUptakeZoneType == InkUptakeZoneTypes.MAXINKUPTAKEZONE2) + colorParametrsExcelModel.Max_ink_uptake__Zone2 = (inkUptakeZone.InkValue == null) ? 0 : (int)inkUptakeZone.InkValue; + } + } + #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 b33ead70a..4802e0af1 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 @@ -28,11 +28,19 @@ using Tango.MachineStudio.ThreadExtensions.Views; using Tango.MachineStudio.ThreadExtensions.Models; using Tango.Settings; using System.Reflection; +using Tango.Core.Helpers; +using Tango.Documents; namespace Tango.MachineStudio.ThreadExtensions.ViewModels { public class MainViewVM : StudioViewModel<IMainView> { + public enum MachineTestResultsTabs + { + ColorParameters, + TestResults + } + private INotificationProvider _notification; private IAuthenticationProvider _authentication; private IActionLogManager _actionLogManager; @@ -286,11 +294,27 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels } + private MachineTestResultsTabs PreviosSelectedTab { get; set; } + + private MachineTestResultsTabs _selectedTab; + + public MachineTestResultsTabs SelectedTab + { + get { return _selectedTab; } + set { + PreviosSelectedTab = _selectedTab; + _selectedTab = value; + OnSelectedMachineTestResultsTabChanged(); + RaisePropertyChangedAuto(); + } + } + #endregion #region commands public RelayCommand SaveCommand { get; set; } + public RelayCommand ExportToFileCommand { get; set; } public RelayCommand ManageRmlExtensionCommand { get; set; } @@ -298,8 +322,11 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels private async void BackToThreadExtensionViews(object obj) { - View.NavigateTo(RMLExtensionNavigationView.RMLExtensionsView); - await LoadRmlExtentions(); + if (_notification.ShowQuestion("Are you sure you want to exit the RML without saving changes?")) + { + View.NavigateTo(RMLExtensionNavigationView.RMLExtensionsView); + await LoadRmlExtentions(); + } } public RelayCommand AddManufacturerItemCommand { get; set; } @@ -766,14 +793,15 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels BackToThreadExtensionViewsCommand = new RelayCommand(BackToThreadExtensionViews, () => IsFree); SaveCommand = new RelayCommand(Save, () => IsFree); + ExportToFileCommand = new RelayCommand(ExportRMLToExcel, () => IsFree); ManageRmlExtensionCommand = new RelayCommand(() => LoadActiveRMLExtension(SelectedRMLExtension.Guid), () => SelectedRMLExtension != null); AddManufacturerItemCommand = new RelayCommand(AddManufacturerItem); - EditManufacturerItemCommand = new RelayCommand(EditManufacturerItem, () => ActiveRML.Manufacturer != ""); + EditManufacturerItemCommand = new RelayCommand(EditManufacturerItem, () => ActiveRML !=null && ActiveRML.Manufacturer != ""); AddBrandItemCommand = new RelayCommand(AddBrandItem); - EditBrandItemCommand = new RelayCommand(EditBrandItem, () => ActiveRMLExtension.YarnBrand != null); + EditBrandItemCommand = new RelayCommand(EditBrandItem, () => ActiveRMLExtension != null && ActiveRMLExtension.YarnBrand != null); AddEndUseItemCommand = new RelayCommand(AddEndUseItem); EditEndUseItemCommand = new RelayCommand(EditEndUseItem); @@ -1102,6 +1130,10 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels { ColorParametersVewVM.SelectedMachineGUID = SelectedMachine.Guid; } + if(TestResultsViewVM != null) + { + TestResultsViewVM.SelectedMachineGUID = SelectedMachine.Guid; + } } #endregion @@ -1148,5 +1180,161 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels } #endregion + + #region selections + + private void OnSelectedMachineTestResultsTabChanged() + { + if(SelectedTab == MachineTestResultsTabs.ColorParameters) + { + //if(PreviosSelectedTab == MachineTestResultsTabs.TestResults && TestResultsViewVM != null) + //{ + // TestResultsViewVM.Save(); + //} + //save + //if (_notification.ShowQuestion("Are you sure you want to exit this page without saving changes?")) + + } + else if(SelectedTab == MachineTestResultsTabs.TestResults) + { + //if (PreviosSelectedTab == MachineTestResultsTabs.ColorParameters && ColorParametersVewVM != null) + //{ + // ColorParametersVewVM.Save(); + //} + } + } + + #endregion + + #region Export / Import Excel + + public void ExportRMLToExcel() + { + SaveFileDialog dlg = new SaveFileDialog(); + dlg.Filter = "Excel Documents|*.xlsx"; + if (dlg.ShowDialog().Value) + { + using (_notification.PushTaskItem("Exporting RML to file...")) + { + Task.Factory.StartNew(() => + { + try + { + IsFree = false; + + Stream stream = null; + bool dispose = false; + String file = AssemblyHelper.GetCurrentAssemblyFolder() + "\\Templates\\ExportRMLTemplate.xlsx"; + + if (File.Exists(file)) + { + stream = File.OpenRead(file); + dispose = true; + } + else + { + stream = EmbeddedResourceHelper.GetEmbeddedResourceStream("Tango.MachineStudio.ThreadExtensions.Templates.ExportRMLTemplate.xlsx"); + } + + byte[] data = new byte[stream.Length]; + stream.Read(data, 0, data.Length); + File.WriteAllBytes(dlg.FileName, data); + + if (dispose) + { + stream.Dispose(); + } + + ExcelWriter writer = new ExcelWriter(dlg.FileName); + //ActiveRMLExtension = await new RmlExtensionsBuilder(_active_context) + // .Set(guid) + // .WithUser() + // .BuildAsync(); + + //ActiveRML = new RmlBuilder(_active_context) + // .Set(SelectedRMLExtension.RMLGuid) + // .Build(); + + List<ThreadCharacteristicsExcelModel> threadCharacteristicsExelModels = new List<ThreadCharacteristicsExcelModel>(); + ThreadCharacteristicsExcelModel model = new ThreadCharacteristicsExcelModel(); + model.ThreadName = ActiveRML.Name; + model.Manufacturer = ActiveRML.Manufacturer == null? "": ActiveRML.Manufacturer; + model.Brand = ActiveRMLExtension.YarnBrand == null ? "": ActiveRMLExtension.YarnBrand.Name; + model.Country = ActiveRMLExtension.Country == null? "" : ActiveRMLExtension.Country; + model.EndUse = ActiveRML.MediaPurpose == null ? "" : ActiveRML.MediaPurpose.Name; + model.Applications = ActiveRMLExtension.YarnApplication == null ? "" : ActiveRMLExtension.YarnApplication.Name; + model.IndustrySector = ActiveRMLExtension.YarnIndustrysector == null ? "" : ActiveRMLExtension.YarnIndustrysector.Name; + model.Material = ActiveRML.MediaMaterial == null ? "" : ActiveRML.MediaMaterial.Name; + model.Type = ActiveRMLExtension.YarnType == null ? "" : ActiveRMLExtension.YarnType.Name; + model.SubFamily = ActiveRMLExtension.YarnSubFamily == null ? "" : ActiveRMLExtension.YarnSubFamily.Name; + model.Family = ActiveRMLExtension.YarnFamily == null ? "" : ActiveRMLExtension.YarnFamily.Name; + model.Group = ActiveRMLExtension.YarnGroup == null ? "" : ActiveRMLExtension.YarnGroup.Name; + model.Texturing = ActiveRMLExtension.YarnTexturing == null ? "" : ActiveRMLExtension.YarnTexturing.Name; + model.Geometry = ActiveRML.FiberShape == null ? "" : ActiveRML.FiberShape.Name; + model.Color = ActiveRMLExtension.YarnWhiteShade == null ? "" : ActiveRMLExtension.YarnWhiteShade.Name; + model.GlossLevel = ActiveRMLExtension.YarnGlossLevel == null ? "" : ActiveRMLExtension.YarnGlossLevel.Name; + model.LinearDensity = ActiveRML.FiberSize; + model.Unit = ActiveRML.LinearMassDensityUnit == null ? "" : ActiveRML.LinearMassDensityUnit.Name; + model.Plies = (int) ActiveRML.RMLPlies; + model.FilamentCountPerPlie = ActiveRML.PliesPerFiber; + model.LinearDensityCount = ActiveRML.DencityCount; + model.CountDen = ActiveRML.DencityCount; + model.FiberCount = ActiveRML.FiberCount; + model.Twist = ActiveRMLExtension.TwistTpm; + model.TwistDirection = ActiveRMLExtension.YarnTwistDirections.ToDescription(); + threadCharacteristicsExelModels.Add(model); + writer.WriteData(threadCharacteristicsExelModels, "Thread characteristics", 2); + + List<ColorParametrsExcelModel> colorParametrsExcelList = new List<ColorParametrsExcelModel>(); + + List<TestResultsExcelModel> testResultsExcelModelList = new List<TestResultsExcelModel>(); + + foreach(var machine in Machines) + { + if (machine.HasRMLTest) + { + ColorParametrsExcelModel colorParametrsExcelModel = new ColorParametrsExcelModel(); + colorParametrsExcelModel.Thread_name = ActiveRML.Name; + colorParametrsExcelModel.MachineNumber = machine.SerialNumber.ToString(); + colorParametrsExcelModel.White_point_L = ActiveRML.WhitePointL; + colorParametrsExcelModel.White_point_a = ActiveRML.WhitePointA; + colorParametrsExcelModel.White_point_B = ActiveRML.WhitePointB; + ColorParametersVewVM.WritetoExcel(colorParametrsExcelModel, machine.Guid); + + colorParametrsExcelList.Add(colorParametrsExcelModel); + + TestResultsViewVM.LoadTestResultsExcel(testResultsExcelModelList, machine.Guid, machine.SerialNumber); + } + } + + writer.WriteData(colorParametrsExcelList, "Color parameters"); + writer.WriteData(testResultsExcelModelList.OrderBy(x => x.Machine_number), "Machine tests results"); + + writer.Dispose(); + + InvokeUI(() => + { + _notification.ShowInfo("RML extensions exported successfully."); + }); + } + catch (Exception ex) + { + LogManager.Log(ex, $"Error exporting RML extensions to {dlg.FileName}"); + + InvokeUI(() => + { + _notification.ShowError($"An error occurred while trying to export the RML extensions. Make sure the selected excel file is closed and data is valid.\n{ex.FlattenMessage()}"); + }); + } + finally + { + IsFree = true; + } + }); + } + } + } + + #endregion } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/TestResultViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/TestResultViewVM.cs index 4e7d84e7f..41be789ed 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/TestResultViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/TestResultViewVM.cs @@ -12,6 +12,7 @@ using Tango.BL.Entities; using Tango.BL.Enumerations; using Tango.Core.Commands; using Tango.MachineStudio.Common.Notifications; +using Tango.MachineStudio.ThreadExtensions.Models; using Tango.SharedUI; namespace Tango.MachineStudio.ThreadExtensions.ViewModels @@ -63,139 +64,14 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels #endregion - public RelayCommand ExportToFileCommand { get; set; } + public TestResultViewVM(INotificationProvider notification, IActionLogManager actionLogManager) { _notification = notification; _actionLogManager = actionLogManager; - ExportToFileCommand = new RelayCommand(ExportToFile); - } - - #region save - // public void Save(ObservablesContext active_context) - //{ - // try - // { - // IsFree = false; - - // TestResult.LastUpdated = DateTime.UtcNow; - - // var RmlExtensionTestResultAfterChange = RmlExtensionTestResultDTO.FromObservable(TestResult); - - // active_context.SaveChanges(); - // } - // catch (Exception ex) - // { - // LogManager.Log(ex, "Could not update RmlExtension TestResult."); - // _notification.ShowError($"An error occurred while trying to save RmlExtension TestResult.\n{ex.Message}"); - // } - // finally - // { - // IsFree = true; - // } - //} - #endregion - - private void ExportToFile() - { - SaveFileDialog dlg = new SaveFileDialog(); - try - { - dlg.Title = $"Export excel calibration file for {TestResult.Name}"; - dlg.Filter = "Text Files|*.txt"; - dlg.DefaultExt = ".txt"; - dlg.FileName = $"RML_EXTENSION_{TestResult.Name}.txt"; - if (dlg.ShowDialog().Value) - { - using (StreamWriter outputFile = new StreamWriter(dlg.FileName)) - { - outputFile.WriteLine(String.Format($" {TestResult.Name.ToUpper()} ")); - outputFile.WriteLine(""); - outputFile.WriteLine(""); - outputFile.WriteLine(" Dryer temperature"); - outputFile.WriteLine(""); - outputFile.WriteLine(String.Format($" Dryer temperature : {TestResult.DryerTemperature.ToString()}")); - outputFile.WriteLine(String.Format($" Tunnel temperature : {TestResult.TunnelTemperature.ToString()}")); - outputFile.WriteLine(String.Format($" Tunnel flow : {TestResult.TunnelFlow.ToString()}")); - outputFile.WriteLine(String.Format($" Tunnel AVG temperature : {TestResult.TunnelAvgTemperature.ToString()}")); - outputFile.WriteLine(""); - outputFile.WriteLine(""); - outputFile.WriteLine(" Tension through the thread path"); - outputFile.WriteLine(""); - outputFile.WriteLine(String.Format($" Head : {TestResult.TensionHeadMin.ToString()} - {TestResult.TensionHeadMax.ToString()}")); - outputFile.WriteLine(String.Format($" After dryer : {TestResult.TensionAfterDryerMin.ToString()} - {TestResult.TensioinAfterDryerMax.ToString()}")); - outputFile.WriteLine(String.Format($" Winder : {TestResult.BtsrMin.ToString()} - {TestResult.BtsrMax.ToString()}")); - outputFile.WriteLine(String.Format($" BTSR : {TestResult.TensionHeadMin.ToString()} - {TestResult.TensionHeadMax.ToString()}")); - outputFile.WriteLine(String.Format($" Puller tension : {TestResult.PullerTensionMin.ToString()} - {TestResult.PullerTensionMax.ToString()}")); - outputFile.WriteLine(String.Format($" Winder exit tension: {TestResult.ExitTensionMin.ToString()} - {TestResult.ExitTensionMax.ToString()}")); - - outputFile.WriteLine(""); - outputFile.WriteLine(" Rubbing results"); - outputFile.WriteLine(""); - outputFile.WriteLine(" Color DeltaE CIE 100 % GS 100% DeltaETestResult CIE 200 % GS 200% "); - foreach (var rubbingResult in TestResult.RubbingResults) - { - StringBuilder sb = new StringBuilder(); - //sb.Append(" Color: "); - sb.Append($" { rubbingResult.TestResultColor.ToString()} "); - //sb.Append(" DeltaE CIE 100 % : "); - sb.Append($" { rubbingResult.DeltaeCie100.ToString()} "); - //sb.Append(" GS 100% : "); - sb.Append($" { rubbingResult.Gs100Min.ToString()}-{rubbingResult.Gs100Max.ToString()} "); - //sb.Append(" DeltaE CIE 200 % : "); - sb.Append($" { rubbingResult.DeltaeCie200.ToString()} "); - //sb.Append(" GS 200% : "); - sb.Append($" { rubbingResult.Gs200Min.ToString()}-{rubbingResult.Gs200Max.ToString()} "); - outputFile.WriteLine(sb); - } - outputFile.WriteLine(""); - outputFile.WriteLine(" Mechanical properties"); - outputFile.WriteLine(""); - outputFile.WriteLine(" %Color Color Load at Maximum Load(N) STDEV Percentage Strain at Maximum Load STDEV "); - foreach (var result in TestResult.TensileResults) - { - StringBuilder sb = new StringBuilder(); - //sb.Append(" % Color: "); - sb.Append($" { result.ColorPercent.ToString()}"); - //sb.Append(" Color : "); - sb.Append($" { result.TestResultColor.ToString()}"); - //sb.Append(" Load at Maximum Load(N) : "); - sb.Append($" { result.MaxLoad.ToString()}"); - //sb.Append(" STDEV : "); - sb.Append($" { result.StdevMaxLoad.ToString()}"); - //sb.Append(" Percentage Strain at Maximum Load: "); - sb.Append($" {result.StrainMaxLoad.ToString()}"); - //sb.Append(" STDEV : "); - sb.Append($" { result.StdevStrainMaxLoad.ToString()}"); - outputFile.WriteLine(sb); - } - outputFile.WriteLine(""); - outputFile.WriteLine(" Uniformity"); - outputFile.WriteLine(""); - outputFile.WriteLine(String.Format($" Zone1 : {TestResult.SeverityZone1Min.ToString()} - {TestResult.SeverityZone1Max.ToString()}")); - outputFile.WriteLine(String.Format($" Zone2 : {TestResult.SeverityZone2Min.ToString()} - {TestResult.SeverityZone2Max.ToString()}")); - outputFile.WriteLine(""); - outputFile.WriteLine(" COF"); - outputFile.WriteLine(""); - outputFile.WriteLine(" Thread name Lub Version COF Lub amount "); - outputFile.WriteLine(String.Format($" REF {TestResult.RefLubVersion} {TestResult.RefCof.ToString()} {TestResult.RefLub.ToString()}")); - outputFile.WriteLine(String.Format($" {ThreadName} {TestResult.ThreadLubVersion} {TestResult.ThreadCof.ToString()} {TestResult.ThreadLub.ToString()}")); - - outputFile.WriteLine(""); - outputFile.WriteLine(String.Format($" Comments: {TestResult.Comment}")); - outputFile.WriteLine(String.Format($" Conclusion: {TestResult.Conclusions}")); - outputFile.WriteLine(""); - outputFile.Flush(); - } - - } - } - catch (Exception ex) - { - LogManager.Log(ex, "Error exporting excel file " + dlg.FileName); - _notification.ShowError("An error occurred while trying to export the test result data."); - } } + + } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/TestResultsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/TestResultsViewVM.cs index cc3a49a23..c1fb4497f 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/TestResultsViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/TestResultsViewVM.cs @@ -352,10 +352,10 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels var processParametersTables = activeProcessParametersGroup.ProcessParametersTables.OrderBy(x => x.TableIndex).ToSynchronizedObservableCollection().FirstOrDefault(); processParametersTables.DryerZone1Temp = SelectedTab.TestResult.DryerTemperature == null? 0 : (double)SelectedTab.TestResult.DryerTemperature; - processParametersTables.RBlowerFlow = SelectedTab.TestResult.TunnelFlow == null ? 0 : (double)SelectedTab.TestResult.TunnelFlow; - processParametersTables.RBlowerTemp = SelectedTab.TestResult.TunnelFlow == null ? 0 : (double)SelectedTab.TestResult.TunnelFlow; ; - processParametersTables.LBlowerFlow = SelectedTab.TestResult.TunnelTemperature == null ? 0 : (double)SelectedTab.TestResult.TunnelTemperature; ; - processParametersTables.LBlowerTemp = SelectedTab.TestResult.TunnelTemperature == null ? 0 : (double)SelectedTab.TestResult.TunnelTemperature; ; + processParametersTables.RBlowerFlow = SelectedTab.TestResult.TunnelTemperature == null ? 0 : (double)SelectedTab.TestResult.TunnelTemperature; + processParametersTables.RBlowerTemp = SelectedTab.TestResult.TunnelTemperature == null ? 0 : (double)SelectedTab.TestResult.TunnelTemperature; + processParametersTables.LBlowerFlow = SelectedTab.TestResult.TunnelFlow == null ? 0 : (double)SelectedTab.TestResult.TunnelFlow; + processParametersTables.LBlowerTemp = SelectedTab.TestResult.TunnelFlow == null ? 0 : (double)SelectedTab.TestResult.TunnelFlow; await context.SaveChangesAsync(); } } @@ -386,7 +386,7 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels _active_context.SaveChanges(); }); - LoadTestResults(); + // LoadTestResults(); } catch (Exception ex) { @@ -402,5 +402,159 @@ namespace Tango.MachineStudio.ThreadExtensions.ViewModels } #endregion + + public async void LoadTestResultsExcel(List<TestResultsExcelModel> testResultsExcelModelList, string machineGUID, string machineSerialNumber) + { + try + { + IsFree = false; + if (_active_context == null) + { + _active_context = ObservablesContext.CreateDefault(); + } + + using (_notification.PushTaskItem("Loading Test Results Parameters for save in Excel file ...")) + { + SynchronizedObservableCollection<RmlExtensionTestResult> testResults = SelectedTestResults; + if (SelectedMachineGUID != machineGUID) + { + var loadedtestResults = await new RMLExtensionTestResultsCollectionBuilder(_active_context).SetAll().ForRMLExtension(RMLExtemtionGUID).ForMachine(machineGUID).WithRubbingAndTensileResults().BuildAsync(); + testResults = loadedtestResults.OrderBy(x => x.ResultIndex).ToSynchronizedObservableCollection(); + + } + foreach (var testresult in testResults) + { + TestResultsExcelModel testResultsExcelModel = new TestResultsExcelModel(); + testResultsExcelModel.Thread_name_test_results = ThreadName; + testResultsExcelModel.Machine_number = machineSerialNumber; + testResultsExcelModel.Test_results_name__tab = testresult.Name; + + testResultsExcelModel.Dryer_temp = testresult.DryerTemperature == null ? 0 : (int)testresult.DryerTemperature; + testResultsExcelModel.Dryer_flow = 0; + testResultsExcelModel.Tunnel_temp = testresult.TunnelTemperature == null ? 0 : (int)testresult.TunnelTemperature; + testResultsExcelModel.Tunnel_flow = testresult.TunnelFlow == null ? 0 : (int)testresult.TunnelFlow; + + testResultsExcelModel.Tension_in_head = testresult.TensionHeadMin == null ? "" : testresult.TensionHeadMin.ToString(); + testResultsExcelModel.Tension_after_dryer = testresult.TensionAfterDryerMin == null ? "" : testresult.TensionAfterDryerMin.ToString(); + testResultsExcelModel.Tension_in_winder = testresult.TensionWinderMin == null ? "" : testresult.TensionWinderMin.ToString(); + testResultsExcelModel.BTSR = testresult.BtsrMin == null ? "" : testresult.BtsrMin.ToString(); + testResultsExcelModel.Puller_tension = testresult.PullerTensionMin == null ? "" : testresult.PullerTensionMin.ToString(); + testResultsExcelModel.Winder_tension = testresult.ExitTensionMin == null ? "" : testresult.ExitTensionMin.ToString(); + + foreach (var tensileResult in testresult.TensileResults) + { + if (tensileResult.TestResultColor == TestResultColors.CYAN) + { + if (tensileResult.ColorPercent == 100) + { + testResultsExcelModel.Load_N_100_C = tensileResult.MaxLoad == null ? 0 : (double)tensileResult.MaxLoad; + testResultsExcelModel.STDEV_100_C = tensileResult.StdevMaxLoad == null ? 0 : (double)tensileResult.StdevMaxLoad; + testResultsExcelModel.Change_100_C = tensileResult.PercentChangeLoad == null ? 0 : (double)tensileResult.PercentChangeLoad; + testResultsExcelModel.Strain_100_C = tensileResult.StrainMaxLoad == null ? 0 : (double)tensileResult.StrainMaxLoad; + testResultsExcelModel.STDEV_100_C_2 = tensileResult.StdevStrainMaxLoad == null ? 0 : (double)tensileResult.StdevStrainMaxLoad; + testResultsExcelModel.Change_100_C_2 = tensileResult.PercentChangeStrain == null ? 0 : (double)tensileResult.PercentChangeStrain; + } + else if (tensileResult.ColorPercent == 200) + { + testResultsExcelModel.Load__N_200_C = tensileResult.MaxLoad == null ? 0 : (double)tensileResult.MaxLoad; + testResultsExcelModel.STDEV_200_C = tensileResult.StdevMaxLoad == null ? 0 : (double)tensileResult.StdevMaxLoad; + testResultsExcelModel.Change_200_C = tensileResult.PercentChangeLoad == null ? 0 : (double)tensileResult.PercentChangeLoad; + testResultsExcelModel.Strain_200_C = tensileResult.StrainMaxLoad == null ? 0 : (double)tensileResult.StrainMaxLoad; + testResultsExcelModel.STDEV_200_C_2 = tensileResult.StdevStrainMaxLoad == null ? 0 : (double)tensileResult.StdevStrainMaxLoad; + testResultsExcelModel.Change_200_C_2 = tensileResult.PercentChangeStrain == null ? 0 : (double)tensileResult.PercentChangeStrain; + } + } + else if (tensileResult.TestResultColor == TestResultColors.BLACK) + { + if (tensileResult.ColorPercent == 100) + { + testResultsExcelModel.Load__N_100_K = tensileResult.MaxLoad == null ? 0 : (double)tensileResult.MaxLoad; + testResultsExcelModel.STDEV_100_K = tensileResult.StdevMaxLoad == null ? 0 : (double)tensileResult.StdevMaxLoad; + testResultsExcelModel.Change__100_K = tensileResult.PercentChangeLoad == null ? 0 : (double)tensileResult.PercentChangeLoad; + testResultsExcelModel.Strain_100_K = tensileResult.StrainMaxLoad == null ? 0 : (double)tensileResult.StrainMaxLoad; + testResultsExcelModel.STDEV_100_K_2 = tensileResult.StdevStrainMaxLoad == null ? 0 : (double)tensileResult.StdevStrainMaxLoad; + testResultsExcelModel.Change_100_K_2 = tensileResult.PercentChangeStrain == null ? 0 : (double)tensileResult.PercentChangeStrain; + } + else if (tensileResult.ColorPercent == 200) + { + testResultsExcelModel.Load__N_200_K = tensileResult.MaxLoad == null ? 0 : (double)tensileResult.MaxLoad; + testResultsExcelModel.STDEV_200_K = tensileResult.StdevMaxLoad == null ? 0 : (double)tensileResult.StdevMaxLoad; + testResultsExcelModel.Change_200_K = tensileResult.PercentChangeLoad == null ? 0 : (double)tensileResult.PercentChangeLoad; + testResultsExcelModel.Strain_200_K = tensileResult.StrainMaxLoad == null ? 0 : (double)tensileResult.StrainMaxLoad; + testResultsExcelModel.STDEV_200_K_2 = tensileResult.StdevStrainMaxLoad == null ? 0 : (double)tensileResult.StdevStrainMaxLoad; + testResultsExcelModel.Change_200_K_2 = tensileResult.PercentChangeStrain == null ? 0 : (double)tensileResult.PercentChangeStrain; + } + + } + else if (tensileResult.IsWhiteColor) + { + testResultsExcelModel.Load__N_REF = tensileResult.MaxLoad == null ? 0 : (double)tensileResult.MaxLoad; + testResultsExcelModel.STDEV_REF = tensileResult.StdevMaxLoad == null ? 0 : (double)tensileResult.StdevMaxLoad; + testResultsExcelModel.STDEV_Strain_REF = tensileResult.StdevStrainMaxLoad == null ? 0 : (double)tensileResult.StdevStrainMaxLoad; + testResultsExcelModel.REF_Strain = tensileResult.StrainMaxLoad == null ? 0 : (double)tensileResult.StrainMaxLoad; + } + + } + + foreach (var rubbingresult in testresult.RubbingResults) + { + if (rubbingresult.TestResultColor == TestResultColors.CYAN) + { + testResultsExcelModel.Rubbing_C_100___DE = rubbingresult.DeltaeCie100 == null ? 0.0 : (double)rubbingresult.DeltaeCie100; + testResultsExcelModel.Rubbing_C_100___GS = rubbingresult.Gs100 == null ? 0.0 : (double)rubbingresult.Gs100; + testResultsExcelModel.Rubbing_C_200___DE = rubbingresult.DeltaeCie200 == null ? 0.0 : (double)rubbingresult.DeltaeCie200; + testResultsExcelModel.Rubbing_C_200___GS = rubbingresult.Gs200 == null ? 0.0 : (double)rubbingresult.Gs200; + } + else if (rubbingresult.TestResultColor == TestResultColors.MAGENTA) + { + testResultsExcelModel.Rubbing_M_100___DE = rubbingresult.DeltaeCie100 == null ? 0.0 : (double)rubbingresult.DeltaeCie100; + testResultsExcelModel.Rubbing_M_100___GS = rubbingresult.Gs100 == null ? 0.0 : (double)rubbingresult.Gs100; + testResultsExcelModel.Rubbing_M_200___DE = rubbingresult.DeltaeCie200 == null ? 0.0 : (double)rubbingresult.DeltaeCie200; + testResultsExcelModel.Rubbing_M_200___GS = rubbingresult.Gs200 == null ? 0.0 : (double)rubbingresult.Gs200; + } + else if (rubbingresult.TestResultColor == TestResultColors.YELLOW) + { + testResultsExcelModel.Rubbing_Y_100___DE = rubbingresult.DeltaeCie100 == null ? 0.0 : (double)rubbingresult.DeltaeCie100; + testResultsExcelModel.Rubbing_Y_100___GS = rubbingresult.Gs100 == null ? 0.0 : (double)rubbingresult.Gs100; + testResultsExcelModel.Rubbing_Y_200___DE = rubbingresult.DeltaeCie200 == null ? 0.0 : (double)rubbingresult.DeltaeCie200; + testResultsExcelModel.Rubbing_Y_200___GS = rubbingresult.Gs200 == null ? 0.0 : (double)rubbingresult.Gs200; + } + else if (rubbingresult.TestResultColor == TestResultColors.BLACK) + { + testResultsExcelModel.Rubbing_K_100___DE = rubbingresult.DeltaeCie100 == null ? 0.0 : (double)rubbingresult.DeltaeCie100; + testResultsExcelModel.Rubbing_K_100___GS = rubbingresult.Gs100 == null ? 0.0 : (double)rubbingresult.Gs100; + testResultsExcelModel.Rubbing_K_200___DE = rubbingresult.DeltaeCie200 == null ? 0.0 : (double)rubbingresult.DeltaeCie200; + testResultsExcelModel.Rubbing_K_200___GS = rubbingresult.Gs200 == null ? 0.0 : (double)rubbingresult.Gs200; + } + } + string minZone = testresult.SeverityZone1Min == null ? "" : ((double)testresult.SeverityZone1Min).ToString(); + string maxZone = testresult.SeverityZone1Max == null ? "" : ((double)testresult.SeverityZone1Max).ToString(); + testResultsExcelModel.Uniformity_Zone_1 = $"{minZone} - {maxZone}"; + minZone = testresult.SeverityZone2Min == null ? "" : ((double)testresult.SeverityZone2Min).ToString(); + maxZone = testresult.SeverityZone2Max == null ? "" : ((double)testresult.SeverityZone2Max).ToString(); + testResultsExcelModel.Uniformity_Zone_2 = $"{minZone} - {maxZone}"; + + testResultsExcelModel.COF_REF = testresult.RefCof == null ? 0.0 : (double)testresult.RefCof; + testResultsExcelModel.CV_REF = 0.0; + testResultsExcelModel.COF_Black = testresult.ThreadCof == null ? 0.0 : (double)testresult.ThreadCof; + testResultsExcelModel.CV_Black = 0.0; + testResultsExcelModel.lub_amount = testresult.ThreadLub == null ? 0.0 : (double)testresult.ThreadLub; + + testResultsExcelModel.Comments = testresult.Comment; + testResultsExcelModel.Conclusion = testresult.Conclusions; + testResultsExcelModelList.Add(testResultsExcelModel); + } + } + IsFree = true; + } + catch (Exception ex) + { + LogManager.Log(ex, $"Error loading TestResults for saving in Excel file.\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 index 697289604..504bf0610 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ColorParametersView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ColorParametersView.xaml @@ -5,7 +5,8 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:Tango.MachineStudio.ThreadExtensions.Views" xmlns:vm="clr-namespace:Tango.MachineStudio.ThreadExtensions.ViewModels" - xmlns:converters="clr-namespace:Tango.MachineStudio.ThreadExtensions.Converters" + xmlns:localconverters="clr-namespace:Tango.MachineStudio.ThreadExtensions.Converters" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:enumerators="clr-namespace:Tango.BL.Enumerations;assembly=Tango.BL" xmlns:global="clr-namespace:Tango.MachineStudio.ThreadExtensions" xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" @@ -20,7 +21,9 @@ <UserControl.Resources> <autoCompleteMachine:MachinesProvider x:Key="MachinesProvider" /> - <converters:ColorNameToBrushConverter x:Key="ColorNameToBrushConverter"/> + <localconverters:ColorNameToBrushConverter x:Key="ColorNameToBrushConverter"/> + <localconverters:NumericFieldConverter x:Key="NumericFieldConverter"/> + <converters:EnumToDescriptionConverter x:Key="EnumToDescriptionConverter" /> <Style x:Key="CellNumericUpDown" TargetType="{x:Type mahapps:NumericUpDown}" BasedOn="{StaticResource {x:Type mahapps:NumericUpDown}}"> <Setter Property="FrameworkElement.HorizontalAlignment" Value="Stretch"/> @@ -400,62 +403,43 @@ </DataGrid.Columns> </DataGrid> - <DataGrid x:Name="MinInkUptakeGrid" HorizontalAlignment="Left" VerticalScrollBarVisibility ="Auto" MaxHeight="250" RowHeight="26" SelectionUnit="FullRow" BorderBrush="{StaticResource DarkGrayBrush }" BorderThickness="1" Background="{StaticResource TransparentBackgroundBrush}" AlternatingRowBackground="{StaticResource Transparent200}" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" ItemsSource="{Binding MinInkUptake}" Margin="0 10 0 20"> - <DataGrid.CellStyle> - <Style TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}"> - <Setter Property="BorderThickness" Value="0"/> - <Setter Property="FocusVisualStyle" Value="{x:Null}"/> - <Setter Property="VerticalContentAlignment" Value="Center"></Setter> - <Setter Property="Padding" Value="0"></Setter> - <Setter Property="Margin" Value="0 0 0 0"></Setter> - <Setter Property="FontSize" Value="14"/> - </Style> - </DataGrid.CellStyle> - <DataGrid.Columns> - <DataGridTemplateColumn Header="Min Ink Uptake" Width="1*"> - <DataGridTemplateColumn.CellTemplate> - <DataTemplate> - <Border BorderThickness="0" Background="{Binding FactorColor, Converter={StaticResource ColorNameToBrushConverter}}"> - <mahapps:NumericUpDown Minimum="0" Maximum="500" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" - HideUpDownButtons="True" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding InkNlCm,Mode=TwoWay}" FontSize="14"></mahapps:NumericUpDown> - </Border> - </DataTemplate> - </DataGridTemplateColumn.CellTemplate> - </DataGridTemplateColumn> - <mahapps:DataGridNumericUpDownColumn Header="L" Minimum="0" Maximum="100" Binding="{Binding L}" HideUpDownButtons="True" Width="1*" ElementStyle="{StaticResource FactorCellNumericUpDown}" EditingElementStyle="{StaticResource EditableCellNumericUpDown}"/> - <mahapps:DataGridNumericUpDownColumn Header="A" Minimum="-128" Maximum="127" Binding="{Binding A}" HideUpDownButtons="True" Width="1*" ElementStyle="{StaticResource FactorCellNumericUpDown}" EditingElementStyle="{StaticResource EditableCellNumericUpDown}" /> - <mahapps:DataGridNumericUpDownColumn Header="B" Minimum="-128" Maximum="127" Binding="{Binding B}" HideUpDownButtons="True" Width="1*" ElementStyle="{StaticResource FactorCellNumericUpDown}" EditingElementStyle="{StaticResource EditableCellNumericUpDown}" /> - </DataGrid.Columns> - </DataGrid> + <DataGrid x:Name="InkUptakeGrid" HorizontalAlignment="Left" VerticalScrollBarVisibility ="Auto" MaxHeight="250" RowHeight="26" SelectionUnit="FullRow" BorderBrush="{StaticResource DarkGrayBrush }" BorderThickness="1" Background="{StaticResource TransparentBackgroundBrush}" AlternatingRowBackground="{StaticResource Transparent200}" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" ItemsSource="{Binding ColorProcessInkUptakeData}" Margin="0 10 0 20"> + <DataGrid.CellStyle> + <Style TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}"> + <Setter Property="BorderThickness" Value="0"/> + <Setter Property="FocusVisualStyle" Value="{x:Null}"/> + <Setter Property="VerticalContentAlignment" Value="Center"></Setter> + <Setter Property="Padding" Value="0"></Setter> + <Setter Property="Margin" Value="0 0 0 0"></Setter> + <Setter Property="FontSize" Value="14"/> + </Style> + </DataGrid.CellStyle> + <DataGrid.Columns> + <DataGridTemplateColumn Header="" Width="1*"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <Border BorderThickness="0" > + <TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10 0 0 0" Foreground="{StaticResource GrayBrush200}" Text="{Binding InkUptakeZoneType, Converter={StaticResource EnumToDescriptionConverter}}" FontSize="14"></TextBlock> - <DataGrid x:Name="MaxInkUptakeGrid" HorizontalAlignment="Left" VerticalScrollBarVisibility ="Auto" MaxHeight="250" RowHeight="26" SelectionUnit="FullRow" BorderBrush="{StaticResource DarkGrayBrush }" BorderThickness="1" Background="{StaticResource TransparentBackgroundBrush}" AlternatingRowBackground="{StaticResource Transparent200}" AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" ItemsSource="{Binding MaxInkUptake}" Margin="0 10 0 20"> - <DataGrid.CellStyle> - <Style TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}"> - <Setter Property="BorderThickness" Value="0"/> - <Setter Property="FocusVisualStyle" Value="{x:Null}"/> - <Setter Property="VerticalContentAlignment" Value="Center"></Setter> - <Setter Property="Padding" Value="0"></Setter> - <Setter Property="Margin" Value="0 0 0 0"></Setter> - <Setter Property="FontSize" Value="14"/> - </Style> - </DataGrid.CellStyle> - <DataGrid.Columns> - <DataGridTemplateColumn Header="Max Ink Uptake" Width="1*"> - <DataGridTemplateColumn.CellTemplate> - <DataTemplate> - <Border BorderThickness="0" Background="{Binding FactorColor, Converter={StaticResource ColorNameToBrushConverter}}"> - <mahapps:NumericUpDown Minimum="0" Maximum="500" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" - HideUpDownButtons="True" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding InkNlCm,Mode=TwoWay}" FontSize="14"></mahapps:NumericUpDown> - </Border> - </DataTemplate> - </DataGridTemplateColumn.CellTemplate> - </DataGridTemplateColumn> - <mahapps:DataGridNumericUpDownColumn Header="L" Minimum="0" Maximum="100" Binding="{Binding L}" HideUpDownButtons="True" Width="1*" ElementStyle="{StaticResource FactorCellNumericUpDown}" EditingElementStyle="{StaticResource EditableCellNumericUpDown}" /> - <mahapps:DataGridNumericUpDownColumn Header="A" Minimum="-128" Maximum="127" Binding="{Binding A}" HideUpDownButtons="True" Width="1*" ElementStyle="{StaticResource FactorCellNumericUpDown}" EditingElementStyle="{StaticResource EditableCellNumericUpDown}" /> - <mahapps:DataGridNumericUpDownColumn Header="B" Minimum="-128" Maximum="127" Binding="{Binding B}" HideUpDownButtons="True" Width="1*" ElementStyle="{StaticResource FactorCellNumericUpDown}" EditingElementStyle="{StaticResource EditableCellNumericUpDown}" /> - </DataGrid.Columns> - </DataGrid> - </StackPanel> + </Border> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTemplateColumn Header="Value" Width="1*"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <Border BorderThickness="0" > + <mahapps:NumericUpDown Minimum="10" Maximum="1000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" + HideUpDownButtons="True" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding InkValue, Converter={StaticResource NumericFieldConverter} ,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="14"></mahapps:NumericUpDown> + </Border> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <!--<mahapps:DataGridNumericUpDownColumn Header="Value" Minimum="10" Maximum="1000" Binding="{Binding InkValue}" HideUpDownButtons="True" Width="1*" ElementStyle="{StaticResource FactorCellNumericUpDown}" EditingElementStyle="{StaticResource EditableCellNumericUpDown}"/>--> + + </DataGrid.Columns> + </DataGrid> + </StackPanel> </DockPanel> </Grid> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/MachineTestResultsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/MachineTestResultsView.xaml index 27bffbebb..bfb8a58d0 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/MachineTestResultsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/MachineTestResultsView.xaml @@ -11,12 +11,14 @@ xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:global="clr-namespace:Tango.MachineStudio.ThreadExtensions" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="1200" Background="Transparent" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> <UserControl.Resources> <autoCompleteMachine:MachinesProvider x:Key="MachinesProvider" /> + <converters:EnumToIntConverter x:Key="EnumToIntConverter" /> </UserControl.Resources> <Grid> @@ -41,7 +43,7 @@ </controls:SearchComboBox> </StackPanel> <Grid IsEnabled="{Binding IsFree}" Margin="0 30 20 10" > - <TabControl Background="Transparent" Margin="0,-50,0,0" x:Name="processTabControl" Padding="0 25 0 0" > + <TabControl Background="Transparent" Margin="0,-50,0,0" x:Name="processTabControl" Padding="0 25 0 0" SelectedIndex="{Binding SelectedTab,Mode=TwoWay,Converter={StaticResource EnumToIntConverter}}"> <TabControl.Resources> <Style TargetType="TabPanel"> <Setter Property="HorizontalAlignment" Value="Center"/> @@ -53,7 +55,7 @@ <TabItem Header="COLOR PARAMETERS" Margin="20 0 0 0" mahapps:ControlsHelper.HeaderFontSize="20"> <local:ColorParametersView/> </TabItem> - <TabItem Header="TEST RESULTS" Margin="20 0 0 0" mahapps:ControlsHelper.HeaderFontSize="20"> + <TabItem Header="TEST RESULTS" Margin="20 0 0 0" mahapps:ControlsHelper.HeaderFontSize="20" > <local:TestResultsView /> </TabItem> </TabControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/TestResultsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/TestResultsView.xaml index 7435112b7..50a2537e1 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/TestResultsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/TestResultsView.xaml @@ -267,16 +267,14 @@ <Grid Grid.Column="0" MinWidth="600" HorizontalAlignment="Left" > <DockPanel > - <Button DockPanel.Dock="Bottom" Width="200" HorizontalAlignment="Right" Margin="20" Command="{Binding SelectedTab.ExportToFileCommand}" IsEnabled="False"> Export to File</Button> - - <Grid DockPanel.Dock="Bottom" Margin="20 10 20 0"> + <Grid DockPanel.Dock="Bottom" Margin="20 10 20 40"> <TextBlock FontSize="21">Conclusion:</TextBlock> - <TextBox Margin="120 0 10 0" HorizontalAlignment="Stretch" MinHeight="40" Text="{Binding SelectedTab.TestResult.Conclusions}" Style="{StaticResource Rounded_Corners_TextBox_Multiline}"></TextBox> + <TextBox Margin="120 0 10 0" HorizontalAlignment="Stretch" Height="46" Text="{Binding SelectedTab.TestResult.Conclusions}" Style="{StaticResource Rounded_Corners_TextBox_Multiline}"></TextBox> </Grid> <Grid DockPanel.Dock="Bottom" Margin="20 10 20 0"> <TextBlock FontSize="21">Comments:</TextBlock> - <TextBox Margin="120 0 10 0" Style="{StaticResource Rounded_Corners_TextBox_Multiline}" HorizontalAlignment="Stretch" MinHeight="40" Text="{Binding SelectedTab.TestResult.Comment}"></TextBox> + <TextBox Margin="120 0 10 0" Style="{StaticResource Rounded_Corners_TextBox_Multiline}" HorizontalAlignment="Stretch" Height="46" Text="{Binding SelectedTab.TestResult.Comment}"></TextBox> </Grid> @@ -371,9 +369,7 @@ <DataGridTemplateColumn.CellTemplate> <DataTemplate> <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> - <mahapps:NumericUpDown HasDecimals="True" Minimum="1" Maximum="5" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" HideUpDownButtons="True" InterceptMouseWheel="True" HorizontalContentAlignment="Left" Value="{Binding Gs100Min,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="16" Margin="0 0 0 0" Padding="0" StringFormat="{}{0:F2}" HorizontalAlignment="Right" MinWidth="26"/> - <TextBlock FontSize="16" VerticalAlignment="Center"> -</TextBlock> - <mahapps:NumericUpDown HasDecimals="True" Minimum="1" Maximum="5" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" HideUpDownButtons="True" InterceptMouseWheel="True" HorizontalContentAlignment="Left" Value="{Binding Gs100Max,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="16" Margin="0 0 0 0" Padding="0" StringFormat="{}{0:F2}" HorizontalAlignment="Left" MinWidth="26"/> + <mahapps:NumericUpDown HasDecimals="True" Minimum="0" Maximum="5" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" HideUpDownButtons="False" InterceptMouseWheel="True" HorizontalContentAlignment="Left" Value="{Binding Gs100,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="16" Margin="0 0 0 0" Padding="0" StringFormat="{}{0:F1}" HorizontalAlignment="Right" MinWidth="26" Interval="0.5"/> </StackPanel> </DataTemplate> </DataGridTemplateColumn.CellTemplate> @@ -385,9 +381,7 @@ <DataGridTemplateColumn.CellTemplate> <DataTemplate> <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> - <mahapps:NumericUpDown HasDecimals="True" Minimum="1" Maximum="5" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" HideUpDownButtons="True" InterceptMouseWheel="True" HorizontalContentAlignment="Left" Value="{Binding Gs200Min,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="16" Margin="0 0 0 0" Padding="0" StringFormat="{}{0:F2}" HorizontalAlignment="Right" MinWidth="26"/> - <TextBlock FontSize="16" VerticalAlignment="Center"> -</TextBlock> - <mahapps:NumericUpDown HasDecimals="True" Minimum="1" Maximum="5" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" HideUpDownButtons="True" InterceptMouseWheel="True" HorizontalContentAlignment="Left" Value="{Binding Gs200Max,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="16" Margin="0 0 0 0" Padding="0" StringFormat="{}{0:F2}" HorizontalAlignment="Left" MinWidth="26"/> + <mahapps:NumericUpDown HasDecimals="True" Minimum="0" Maximum="5" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" HideUpDownButtons="False" InterceptMouseWheel="True" HorizontalContentAlignment="Left" Value="{Binding Gs200,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="16" Margin="0 0 0 0" Padding="0" StringFormat="{}{0:F1}" HorizontalAlignment="Right" MinWidth="26" Interval="0.5"/> </StackPanel> </DataTemplate> </DataGridTemplateColumn.CellTemplate> @@ -418,8 +412,8 @@ <Border BorderThickness="0 0 0 1" Background="{StaticResource TransparentBackgroundBrush700}" BorderBrush="{StaticResource BorderBrushGainsboro}"> <StackPanel Orientation="Horizontal"> <mahapps:NumericUpDown HasDecimals="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" HideUpDownButtons="True" InterceptMouseWheel="True" HorizontalContentAlignment="Left" Value="{Binding SelectedTab.TestResult.TensionHeadMin,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="16" Margin="10 0 0 0" Padding="0" StringFormat="{}{0:F2}" HorizontalAlignment="Right" MinWidth="26"/> - <TextBlock FontSize="16" VerticalAlignment="Center"> -</TextBlock> - <mahapps:NumericUpDown HasDecimals="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" HideUpDownButtons="True" InterceptMouseWheel="True" HorizontalContentAlignment="Left" Value="{Binding SelectedTab.TestResult.TensionHeadMax,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="16" Margin="0 0 0 0" Padding="0" StringFormat="{}{0:F2}" HorizontalAlignment="Left" MinWidth="26"/> + <!--<TextBlock FontSize="16" VerticalAlignment="Center"> -</TextBlock> + <mahapps:NumericUpDown HasDecimals="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" HideUpDownButtons="True" InterceptMouseWheel="True" HorizontalContentAlignment="Left" Value="{Binding SelectedTab.TestResult.TensionHeadMax,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="16" Margin="0 0 0 0" Padding="0" StringFormat="{}{0:F2}" HorizontalAlignment="Left" MinWidth="26"/>--> </StackPanel> </Border> <Border BorderThickness="0 0 0 1" Background="{StaticResource TransparentBackgroundBrush700}" BorderBrush="{StaticResource BorderBrushGainsboro}"> @@ -428,8 +422,8 @@ <Border BorderThickness="0 0 0 1" Background="{StaticResource TransparentBackgroundBrush700}" BorderBrush="{StaticResource BorderBrushGainsboro}"> <StackPanel Orientation="Horizontal"> <mahapps:NumericUpDown HasDecimals="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" HideUpDownButtons="True" InterceptMouseWheel="True" HorizontalContentAlignment="Left" Value="{Binding SelectedTab.TestResult.BtsrMin,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="16" Margin="10 0 0 0" Padding="0" StringFormat="{}{0:F2}" HorizontalAlignment="Right" MinWidth="26"/> - <TextBlock FontSize="16" VerticalAlignment="Center"> -</TextBlock> - <mahapps:NumericUpDown HasDecimals="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" HideUpDownButtons="True" InterceptMouseWheel="True" HorizontalContentAlignment="Left" Value="{Binding SelectedTab.TestResult.BtsrMax,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="16" Margin="0 0 0 0" Padding="0" StringFormat="{}{0:F2}" HorizontalAlignment="Left" MinWidth="26"/> + <!--<TextBlock FontSize="16" VerticalAlignment="Center"> -</TextBlock> + <mahapps:NumericUpDown HasDecimals="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" HideUpDownButtons="True" InterceptMouseWheel="True" HorizontalContentAlignment="Left" Value="{Binding SelectedTab.TestResult.BtsrMax,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="16" Margin="0 0 0 0" Padding="0" StringFormat="{}{0:F2}" HorizontalAlignment="Left" MinWidth="26"/>--> </StackPanel> </Border> <Border BorderThickness="0 0 0 1" Background="{StaticResource TransparentBackgroundBrush}" BorderBrush="{StaticResource BorderBrushGainsboro}"> @@ -438,8 +432,8 @@ <Border BorderThickness="0 0 0 1" Background="{StaticResource TransparentBackgroundBrush}" BorderBrush="{StaticResource BorderBrushGainsboro}"> <StackPanel Orientation="Horizontal"> <mahapps:NumericUpDown HasDecimals="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" HideUpDownButtons="True" InterceptMouseWheel="True" HorizontalContentAlignment="Left" Value="{Binding SelectedTab.TestResult.TensionAfterDryerMin,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="16" Margin="10 0 0 0" Padding="0" StringFormat="{}{0:F2}" HorizontalAlignment="Right" MinWidth="26"/> - <TextBlock FontSize="16" VerticalAlignment="Center"> -</TextBlock> - <mahapps:NumericUpDown HasDecimals="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" HideUpDownButtons="True" InterceptMouseWheel="True" HorizontalContentAlignment="Left" Value="{Binding SelectedTab.TestResult.TensioinAfterDryerMax,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="16" Margin="0 0 0 0" Padding="0" StringFormat="{}{0:F2}" HorizontalAlignment="Left" MinWidth="26"/> + <!--<TextBlock FontSize="16" VerticalAlignment="Center"> -</TextBlock> + <mahapps:NumericUpDown HasDecimals="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" HideUpDownButtons="True" InterceptMouseWheel="True" HorizontalContentAlignment="Left" Value="{Binding SelectedTab.TestResult.TensioinAfterDryerMax,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="16" Margin="0 0 0 0" Padding="0" StringFormat="{}{0:F2}" HorizontalAlignment="Left" MinWidth="26"/>--> </StackPanel> </Border> <Border BorderThickness="0 0 0 1" Background="{StaticResource TransparentBackgroundBrush}" BorderBrush="{StaticResource BorderBrushGainsboro}"> @@ -447,9 +441,9 @@ </Border> <Border BorderThickness="0 0 0 1" Background="{StaticResource TransparentBackgroundBrush}" BorderBrush="{StaticResource BorderBrushGainsboro}"> <StackPanel Orientation="Horizontal"> - <mahapps:NumericUpDown HasDecimals="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" HideUpDownButtons="True" InterceptMouseWheel="True" HorizontalContentAlignment="Left" Value="{Binding SelectedTab.TestResult.PullerTensionMin,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="16" Margin="10 0 0 0" Padding="0" StringFormat="{}{0:F2}" HorizontalAlignment="Right" MinWidth="26"/> - <TextBlock FontSize="16" VerticalAlignment="Center"> -</TextBlock> - <mahapps:NumericUpDown HasDecimals="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" HideUpDownButtons="True" InterceptMouseWheel="True" HorizontalContentAlignment="Left" Value="{Binding SelectedTab.TestResult.PullerTensionMax,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="16" Margin="0 0 0 0" Padding="0" StringFormat="{}{0:F2}" HorizontalAlignment="Left" MinWidth="26"/> + <mahapps:NumericUpDown HasDecimals="True" Minimum="0" Maximum="100000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" HideUpDownButtons="True" InterceptMouseWheel="True" HorizontalContentAlignment="Left" Value="{Binding SelectedTab.TestResult.PullerTensionMin,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="16" Margin="10 0 0 0" Padding="0" StringFormat="{}{0:F2}" HorizontalAlignment="Right" MinWidth="26"/> + <!--<TextBlock FontSize="16" VerticalAlignment="Center"> -</TextBlock> + <mahapps:NumericUpDown HasDecimals="True" Minimum="0" Maximum="100000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" HideUpDownButtons="True" InterceptMouseWheel="True" HorizontalContentAlignment="Left" Value="{Binding SelectedTab.TestResult.PullerTensionMax,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="16" Margin="0 0 0 0" Padding="0" StringFormat="{}{0:F2}" HorizontalAlignment="Left" MinWidth="26"/>--> </StackPanel> </Border> <Border BorderThickness="0 0 0 1" Background="{StaticResource TransparentBackgroundBrush700}" BorderBrush="{StaticResource BorderBrushGainsboro}"> @@ -458,21 +452,21 @@ <Border BorderThickness="0 0 0 1" Background="{StaticResource TransparentBackgroundBrush700}" BorderBrush="{StaticResource BorderBrushGainsboro}"> <StackPanel Orientation="Horizontal"> <mahapps:NumericUpDown HasDecimals="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" HideUpDownButtons="True" InterceptMouseWheel="True" HorizontalContentAlignment="Left" Value="{Binding SelectedTab.TestResult.TensionWinderMin,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="16" Margin="10 0 0 0" Padding="0" StringFormat="{}{0:F2}" HorizontalAlignment="Right" MinWidth="26"/> - <TextBlock FontSize="16" VerticalAlignment="Center"> -</TextBlock> - <mahapps:NumericUpDown HasDecimals="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" HideUpDownButtons="True" InterceptMouseWheel="True" HorizontalContentAlignment="Left" Value="{Binding SelectedTab.TestResult.TensionWinderMax,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="16" Margin="0 0 0 0" Padding="0" StringFormat="{}{0:F2}" HorizontalAlignment="Left" MinWidth="26"/> + <!--<TextBlock FontSize="16" VerticalAlignment="Center"> -</TextBlock> + <mahapps:NumericUpDown HasDecimals="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" HideUpDownButtons="True" InterceptMouseWheel="True" HorizontalContentAlignment="Left" Value="{Binding SelectedTab.TestResult.TensionWinderMax,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="16" Margin="0 0 0 0" Padding="0" StringFormat="{}{0:F2}" HorizontalAlignment="Left" MinWidth="26"/>--> </StackPanel> </Border> <Border BorderThickness="0 0 0 1" Background="{StaticResource TransparentBackgroundBrush700}" BorderBrush="{StaticResource BorderBrushGainsboro}"> <TextBlock Margin="5 0 0 0">Winder Exit Tension</TextBlock> - </Border> + </Border> <Border BorderThickness="0 0 0 1" Background="{StaticResource TransparentBackgroundBrush700}" BorderBrush="{StaticResource BorderBrushGainsboro}"> - <StackPanel Orientation="Horizontal"> - <mahapps:NumericUpDown HasDecimals="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" HideUpDownButtons="True" InterceptMouseWheel="True" HorizontalContentAlignment="Left" Value="{Binding SelectedTab.TestResult.ExitTensionMin,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="16" Margin="10 0 0 0" Padding="0" StringFormat="{}{0:F2}" HorizontalAlignment="Right" MinWidth="26"/> - <TextBlock FontSize="16" VerticalAlignment="Center"> - </TextBlock> - <mahapps:NumericUpDown HasDecimals="True" Minimum="0" Maximum="100" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" HideUpDownButtons="True" InterceptMouseWheel="True" HorizontalContentAlignment="Left" Value="{Binding SelectedTab.TestResult.ExitTensionMax,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="16" Margin="0 0 0 0" Padding="0" StringFormat="{}{0:F2}" HorizontalAlignment="Left" MinWidth="26"/> - </StackPanel> - </Border> - </UniformGrid> + <StackPanel Orientation="Horizontal"> + <mahapps:NumericUpDown HasDecimals="True" Minimum="0" Maximum="100000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" HideUpDownButtons="True" InterceptMouseWheel="True" HorizontalContentAlignment="Left" Value="{Binding SelectedTab.TestResult.ExitTensionMin,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="16" Margin="10 0 0 0" Padding="0" StringFormat="{}{0:F2}" HorizontalAlignment="Right" MinWidth="26"/> + <!--<TextBlock FontSize="16" VerticalAlignment="Center"> -</TextBlock> + <mahapps:NumericUpDown HasDecimals="True" Minimum="0" Maximum="100000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" HideUpDownButtons="True" InterceptMouseWheel="True" HorizontalContentAlignment="Left" Value="{Binding SelectedTab.TestResult.ExitTensionMax,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontSize="16" Margin="0 0 0 0" Padding="0" StringFormat="{}{0:F2}" HorizontalAlignment="Left" MinWidth="26"/>--> + </StackPanel> + </Border> + </UniformGrid> </Border> </StackPanel> <StackPanel x:Name="MechanicalPropertiesPanel" Grid.Column="1" Grid.Row="1" Margin="0 5 0 0"> @@ -515,9 +509,9 @@ </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn> - <mahapps:DataGridNumericUpDownColumn Header="Load at 
Maximum 
Load(N)" Minimum="0" Maximum="100" Binding="{Binding MaxLoad}" HideUpDownButtons="True" Width="1*" ElementStyle="{StaticResource CellNumericUpDown}" EditingElementStyle="{StaticResource EditableCellNumericUpDown}" StringFormat="{}{0:F2}" /> + <mahapps:DataGridNumericUpDownColumn Header="Load at 
Maximum 
Load(N)" Minimum="0" Maximum="100" Binding="{Binding MaxLoad, UpdateSourceTrigger=PropertyChanged}" HideUpDownButtons="True" Width="1*" ElementStyle="{StaticResource CellNumericUpDown}" EditingElementStyle="{StaticResource EditableCellNumericUpDown}" StringFormat="{}{0:F2}" /> <mahapps:DataGridNumericUpDownColumn Header="STDEV" Minimum="0" Maximum="100" Binding="{Binding StdevMaxLoad}" HideUpDownButtons="True" Width="1*" ElementStyle="{StaticResource CellNumericUpDown}" EditingElementStyle="{StaticResource EditableCellNumericUpDown}" StringFormat="{}{0:F2}" /> - <mahapps:DataGridNumericUpDownColumn Header="% Change" Minimum="-100" Maximum="100" Binding="{Binding PercentChangeLoad}" HideUpDownButtons="True" Width="1*" ElementStyle="{StaticResource CellNumericUpDown}" EditingElementStyle="{StaticResource EditableCellNumericUpDownWithTrigger}" StringFormat="{}{0:F2}" > + <mahapps:DataGridNumericUpDownColumn Header="% Change" Minimum="-100" Maximum="100" Binding="{Binding PercentChangeLoad, UpdateSourceTrigger=PropertyChanged}" HideUpDownButtons="True" Width="1*" ElementStyle="{StaticResource CellNumericUpDown}" EditingElementStyle="{StaticResource EditableCellNumericUpDownWithTrigger}" StringFormat="{}{0:F2}" > <mahapps:DataGridNumericUpDownColumn.CellStyle> <Style TargetType="DataGridCell"> <Setter Property="Visibility" Value="Visible"/> @@ -530,13 +524,13 @@ </mahapps:DataGridNumericUpDownColumn.CellStyle> </mahapps:DataGridNumericUpDownColumn> - <mahapps:DataGridNumericUpDownColumn Header="Percentage 
Strain at 
Maximum Load" Minimum="0" Maximum="100" Binding="{Binding StrainMaxLoad}" HideUpDownButtons="True" Width="1*" ElementStyle="{StaticResource CellNumericUpDown}" EditingElementStyle="{StaticResource EditableCellNumericUpDown}" StringFormat="{}{0:F2}" > + <mahapps:DataGridNumericUpDownColumn Header="Percentage 
Strain at 
Maximum Load" Minimum="0" Maximum="100" Binding="{Binding StrainMaxLoad, UpdateSourceTrigger=PropertyChanged}" HideUpDownButtons="True" Width="1*" ElementStyle="{StaticResource CellNumericUpDown}" EditingElementStyle="{StaticResource EditableCellNumericUpDown}" StringFormat="{}{0:F2}" > </mahapps:DataGridNumericUpDownColumn> <mahapps:DataGridNumericUpDownColumn Header="STDEV" Minimum="0" Maximum="100" Binding="{Binding StdevStrainMaxLoad}" HideUpDownButtons="True" Width="1*" ElementStyle="{StaticResource CellNumericUpDown}" EditingElementStyle="{StaticResource EditableCellNumericUpDown}" StringFormat="{}{0:F2}" /> - <mahapps:DataGridNumericUpDownColumn Header="% Change" Minimum="-100" Maximum="100" Binding="{Binding PercentChangeStrain}" HideUpDownButtons="True" Width="1*" ElementStyle="{StaticResource CellNumericUpDown}" EditingElementStyle="{StaticResource EditableCellNumericUpDownWithTrigger}" StringFormat="{}{0:F2}"> + <mahapps:DataGridNumericUpDownColumn Header="% Change" Minimum="-100" Maximum="100" Binding="{Binding PercentChangeStrain, UpdateSourceTrigger=PropertyChanged}" HideUpDownButtons="True" Width="1*" ElementStyle="{StaticResource CellNumericUpDown}" EditingElementStyle="{StaticResource EditableCellNumericUpDownWithTrigger}" StringFormat="{}{0:F2}"> <mahapps:DataGridNumericUpDownColumn.CellStyle> <Style TargetType="DataGridCell"> <Setter Property="Visibility" Value="Visible"/> 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 index aeedcb6df..05ad00b72 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ThreadCharacteristicsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/Views/ThreadCharacteristicsView.xaml @@ -225,12 +225,18 @@ </Grid> </UniformGrid> - <Button Grid.Row="1" HorizontalAlignment="Right" Width="170" Height="45" Margin="0 0 20 0" VerticalAlignment="Center" Command="{Binding SaveCommand}"> - <StackPanel Orientation="Horizontal"> - <materialDesign:PackIcon Kind="ContentSaveAll" Width="24" Height="24" /> - <TextBlock VerticalAlignment="Center" Margin="10 0 0 0">SAVE</TextBlock> - </StackPanel> - </Button> + <DockPanel Grid.Row="1"> + + + <Button DockPanel.Dock="Right" HorizontalAlignment="Right" Width="170" Height="45" Margin="0 0 20 0" VerticalAlignment="Center" Command="{Binding SaveCommand}"> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon Kind="ContentSaveAll" Width="24" Height="24" /> + <TextBlock VerticalAlignment="Center" Margin="10 0 0 0">SAVE</TextBlock> + </StackPanel> + </Button> + <Button DockPanel.Dock="Left" Width="170" Height="45" HorizontalAlignment="Left" Margin="20" Command="{Binding ExportToFileCommand}" >Export to File</Button> + + </DockPanel> </Grid> </materialDesign:Card> </Grid> |
