diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-12-29 01:25:37 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-12-29 01:25:37 +0200 |
| commit | 5d68a000c44712026835be2af4698411e931865e (patch) | |
| tree | edf078c59631df433c26268d39c51c58343862dd /Software | |
| parent | 29241b674e6e747ce64e521446e87596eb66dedd (diff) | |
| download | Tango-5d68a000c44712026835be2af4698411e931865e.tar.gz Tango-5d68a000c44712026835be2af4698411e931865e.zip | |
Latest release notes.
Fixed issue with color space transition from volume.
New job creation template.xlsx
Improved job csv importer.
Fixed issue with CsvReader and CsvOrder Attr.
Diffstat (limited to 'Software')
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml | 2 | ||||
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml | 2 | ||||
| -rw-r--r-- | Software/Visual_Studio/Resources/Job Creation Template.xlsx | bin | 0 -> 66999 bytes | |||
| -rw-r--r-- | Software/Visual_Studio/Resources/Release Notes/Development Release Notes - Data Store.docx | bin | 0 -> 209548 bytes | |||
| -rw-r--r-- | Software/Visual_Studio/Resources/Release Notes/Development Release Notes [4.2, 1.2, 1.1].docx | bin | 0 -> 250822 bytes | |||
| -rw-r--r-- | Software/Visual_Studio/Resources/Release Notes/Development Release Notes [4.3, 1.3, 1.2].docx | bin | 0 -> 197625 bytes | |||
| -rw-r--r-- | Software/Visual_Studio/Tango.BL/Helpers/SegmentsCsvHelper.cs | 77 | ||||
| -rw-r--r-- | Software/Visual_Studio/Tango.CSV/CsvFileReader.cs | 20 |
8 files changed, 73 insertions, 28 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml index 029ba7145..5d676c15d 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml @@ -51,7 +51,7 @@ <ItemsControl.ItemTemplate> <DataTemplate> <Border> - <touch:TouchNumericTextBox DisplayWatermarkHint="True" Width="50" Watermark="{Binding IdsPack.LiquidType.Name}" Margin="2 0" ValueChanged="OnLiquidVolumeFieldValueChanged" HorizontalContentAlignment="Center" Value="{Binding Volume}" keyboard:KeyboardView.Container="{Binding ElementName=Container}" HasDecimalPoint="True" Minimum="0" Maximum="200" JoggingFactor="0.5" StringFormat="0.0" /> + <touch:TouchNumericTextBox UpdateBindingOnlyWhenFocused="True" DisplayWatermarkHint="True" Width="50" Watermark="{Binding IdsPack.LiquidType.Name}" Margin="2 0" ValueChanged="OnLiquidVolumeFieldValueChanged" HorizontalContentAlignment="Center" Value="{Binding Volume}" keyboard:KeyboardView.Container="{Binding ElementName=Container}" HasDecimalPoint="True" Minimum="0" Maximum="200" JoggingFactor="0.5" StringFormat="0.0" /> </Border> </DataTemplate> </ItemsControl.ItemTemplate> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml index baaa4384e..d105278e6 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml @@ -173,7 +173,7 @@ <!--LUBRICATION--> <touch:TouchExpander Margin="0 20 0 0" Header="Lubrication Levels" IsExpanded="True" FontSize="{StaticResource TangoExpanderHeaderFontSize}"> - <StackPanel Margin="0 0 10 0"> + <StackPanel Margin="20 0 20 40"> <StackPanel Margin="0 40 0 0"> <TextBlock FontSize="{StaticResource TangoSmallFontSize}" Foreground="{StaticResource TangoGrayTextBrush}">Thread Type</TextBlock> <touch:TouchComboBox x:Name="lubricationCombo" Margin="0 5 0 0" ItemsSource="{Binding LubricationLevels}" DisplayMemberPath="Name"></touch:TouchComboBox> diff --git a/Software/Visual_Studio/Resources/Job Creation Template.xlsx b/Software/Visual_Studio/Resources/Job Creation Template.xlsx Binary files differnew file mode 100644 index 000000000..ef2de185d --- /dev/null +++ b/Software/Visual_Studio/Resources/Job Creation Template.xlsx diff --git a/Software/Visual_Studio/Resources/Release Notes/Development Release Notes - Data Store.docx b/Software/Visual_Studio/Resources/Release Notes/Development Release Notes - Data Store.docx Binary files differnew file mode 100644 index 000000000..434b98bd1 --- /dev/null +++ b/Software/Visual_Studio/Resources/Release Notes/Development Release Notes - Data Store.docx diff --git a/Software/Visual_Studio/Resources/Release Notes/Development Release Notes [4.2, 1.2, 1.1].docx b/Software/Visual_Studio/Resources/Release Notes/Development Release Notes [4.2, 1.2, 1.1].docx Binary files differnew file mode 100644 index 000000000..72abcc66a --- /dev/null +++ b/Software/Visual_Studio/Resources/Release Notes/Development Release Notes [4.2, 1.2, 1.1].docx diff --git a/Software/Visual_Studio/Resources/Release Notes/Development Release Notes [4.3, 1.3, 1.2].docx b/Software/Visual_Studio/Resources/Release Notes/Development Release Notes [4.3, 1.3, 1.2].docx Binary files differnew file mode 100644 index 000000000..2b4ed0bbe --- /dev/null +++ b/Software/Visual_Studio/Resources/Release Notes/Development Release Notes [4.3, 1.3, 1.2].docx diff --git a/Software/Visual_Studio/Tango.BL/Helpers/SegmentsCsvHelper.cs b/Software/Visual_Studio/Tango.BL/Helpers/SegmentsCsvHelper.cs index 446f7c9de..f99f9c97a 100644 --- a/Software/Visual_Studio/Tango.BL/Helpers/SegmentsCsvHelper.cs +++ b/Software/Visual_Studio/Tango.BL/Helpers/SegmentsCsvHelper.cs @@ -14,48 +14,77 @@ namespace Tango.BL.Helpers { public static class SegmentsCsvHelper { + private const double MAX_VOLUME = 200; + public class SegmentCsvModel { - + [CsvOrder(0)] public String Index { get; set; } - + + [CsvOrder(1)] public String ColorSpace { get; set; } - + + [CsvOrder(2)] public String Length { get; set; } + [CsvOrder(4)] public String CatalogName1 { get; set; } + + [CsvOrder(5)] public String CatalogItem1 { get; set; } + [CsvOrder(6)] public String Red1 { get; set; } + [CsvOrder(7)] public String Green1 { get; set; } + [CsvOrder(8)] public String Blue1 { get; set; } + [CsvOrder(9)] public String L1 { get; set; } + [CsvOrder(10)] public String A1 { get; set; } + [CsvOrder(11)] public String B1 { get; set; } - + + [CsvOrder(12)] public String Cyan1 { get; set; } + [CsvOrder(13)] public String Magenta1 { get; set; } + [CsvOrder(14)] public String Yellow1 { get; set; } + [CsvOrder(15)] public String Black1 { get; set; } + [CsvOrder(17)] public String CatalogName2 { get; set; } + [CsvOrder(18)] public String CatalogItem2 { get; set; } + [CsvOrder(19)] public String Red2 { get; set; } + [CsvOrder(20)] public String Green2 { get; set; } + [CsvOrder(21)] public String Blue2 { get; set; } + [CsvOrder(22)] public String L2 { get; set; } + [CsvOrder(23)] public String A2 { get; set; } + [CsvOrder(24)] public String B2 { get; set; } + [CsvOrder(25)] public String Cyan2{ get; set; } + [CsvOrder(26)] public String Magenta2 { get; set; } + [CsvOrder(27)] public String Yellow2 { get; set; } + [CsvOrder(28)] public String Black2 { get; set; } public bool IsRgb2NullOrEqual() @@ -120,14 +149,28 @@ namespace Tango.BL.Helpers { Segment segment = new Segment(); segment.Name = "Standard Segment"; - segment.Length = double.Parse(row.Length); - segment.SegmentIndex = int.Parse(row.Index); + + double length; + if (!double.TryParse(row.Length, out length)) + { + throw new InvalidOperationException($"Value Length '{row.Length}' should be a number on line'{lineCount}'."); + } + + int segmentIndex; + if (!int.TryParse(row.Index, out segmentIndex)) + { + throw new InvalidOperationException($"Value Index '{row.Index}' should be a number on line'{lineCount}'."); + } + + segment.Length = length; + segment.SegmentIndex = segmentIndex; ColorSpace colorSpace = colorSpaces.SingleOrDefault(x => x.Name == row.ColorSpace); if (colorSpace == null) throw new InvalidOperationException($"Color space '{row.ColorSpace}' not found on line '{lineCount}'."); BrushStop stop1 = new BrushStop(); + stop1.StopIndex = 1; stop1.ColorSpace = colorSpace; stop1.OffsetPercent = 0; stop1.Segment = segment; @@ -162,6 +205,7 @@ namespace Tango.BL.Helpers if (!row.IsRgb2NullOrEqual()) { BrushStop stop2 = new BrushStop(); + stop2.StopIndex = 2; stop2.ColorSpace = stop1.ColorSpace; stop2.OffsetPercent = 100; @@ -200,7 +244,7 @@ namespace Tango.BL.Helpers { throw new InvalidOperationException($"Value Cyan1 '{row.Cyan1}' should be a number on line'{lineCount}.'!"); } - if (cyan1 < 0 || cyan1 > 100) throw new InvalidOperationException($"Value Cyan1 '{row.Cyan1}' is out of range on line '{lineCount}.'!"); + if (cyan1 < 0 || cyan1 > MAX_VOLUME) throw new InvalidOperationException($"Value Cyan1 '{row.Cyan1}' is out of range on line '{lineCount}.'!"); stop1.SetVolume(cyanIdsPack.PackIndex, cyan1); double magenta1; @@ -208,7 +252,7 @@ namespace Tango.BL.Helpers { throw new InvalidOperationException($"Value Magenta1 '{row.Magenta1}' should be a number on line'{lineCount}.'!"); } - if (magenta1 < 0 || magenta1 > 100) throw new InvalidOperationException($"Value Magenta1 '{row.Magenta1}' is out of range on line '{lineCount}.'!"); + if (magenta1 < 0 || magenta1 > MAX_VOLUME) throw new InvalidOperationException($"Value Magenta1 '{row.Magenta1}' is out of range on line '{lineCount}.'!"); stop1.SetVolume(magentaIdsPack.PackIndex, magenta1); @@ -217,7 +261,7 @@ namespace Tango.BL.Helpers { throw new InvalidOperationException($"Value Yellow1 '{row.Yellow1}' should be a number on line'{lineCount}.'!"); } - if (yellow1 < 0 || yellow1 > 100) throw new InvalidOperationException($"Value Yellow1 '{row.Yellow1}' is out of range on line '{lineCount}.'!"); + if (yellow1 < 0 || yellow1 > MAX_VOLUME) throw new InvalidOperationException($"Value Yellow1 '{row.Yellow1}' is out of range on line '{lineCount}.'!"); stop1.SetVolume(yellowIdsPack.PackIndex, yellow1); @@ -226,13 +270,14 @@ namespace Tango.BL.Helpers { throw new InvalidOperationException($"Value Black1 '{row.Black1}' should be a number on line'{lineCount}.'!"); } - if (black1 < 0 || black1 > 100) throw new InvalidOperationException($"Value Black1 '{row.Black1}' is out of range on line '{lineCount}.'!"); + if (black1 < 0 || black1 > MAX_VOLUME) throw new InvalidOperationException($"Value Black1 '{row.Black1}' is out of range on line '{lineCount}.'!"); stop1.SetVolume(blackIdsPack.PackIndex, black1); if (!row.IsVolumeNullOrEqual()) { BrushStop stop2 = new BrushStop(); + stop2.StopIndex = 2; stop2.ColorSpace = stop1.ColorSpace; stop2.OffsetPercent = 100; @@ -241,7 +286,7 @@ namespace Tango.BL.Helpers { throw new InvalidOperationException($"Value Cyan2 '{row.Cyan2}' should be a number on line'{lineCount}.'!"); } - if (cyan2 < 0 || cyan2 > 100) throw new InvalidOperationException($"Value Cyan2 '{row.Cyan2}' is out of range on line '{lineCount}.'!"); + if (cyan2 < 0 || cyan2 > MAX_VOLUME) throw new InvalidOperationException($"Value Cyan2 '{row.Cyan2}' is out of range on line '{lineCount}.'!"); stop2.SetVolume(cyanIdsPack.PackIndex, cyan2); double magenta2; @@ -249,7 +294,7 @@ namespace Tango.BL.Helpers { throw new InvalidOperationException($"Value Magenta2 '{row.Magenta2}' should be a number on line'{lineCount}.'!"); } - if (magenta2 < 0 || magenta2 > 100) throw new InvalidOperationException($"Value Magenta2 '{row.Magenta2}' is out of range on line '{lineCount}.'!"); + if (magenta2 < 0 || magenta2 > MAX_VOLUME) throw new InvalidOperationException($"Value Magenta2 '{row.Magenta2}' is out of range on line '{lineCount}.'!"); stop2.SetVolume(magentaIdsPack.PackIndex, magenta2); @@ -258,7 +303,7 @@ namespace Tango.BL.Helpers { throw new InvalidOperationException($"Value Yellow2 '{row.Yellow2}' should be a number on line'{lineCount}.'!"); } - if (yellow2 < 0 || yellow2 > 100) throw new InvalidOperationException($"Value Yellow2 '{row.Yellow2}' is out of range on line '{lineCount}.'!"); + if (yellow2 < 0 || yellow2 > MAX_VOLUME) throw new InvalidOperationException($"Value Yellow2 '{row.Yellow2}' is out of range on line '{lineCount}.'!"); stop2.SetVolume(yellowIdsPack.PackIndex, yellow2); @@ -267,7 +312,7 @@ namespace Tango.BL.Helpers { throw new InvalidOperationException($"Value Black2 '{row.Black2}' should be a number on line'{lineCount}.'!"); } - if (black2 < 0 || black2 > 100) throw new InvalidOperationException($"Value Black2 '{row.Black2}' is out of range on line '{lineCount}.'!"); + if (black2 < 0 || black2 > MAX_VOLUME) throw new InvalidOperationException($"Value Black2 '{row.Black2}' is out of range on line '{lineCount}.'!"); stop2.SetVolume(blackIdsPack.PackIndex, black2); @@ -306,6 +351,7 @@ namespace Tango.BL.Helpers throw new InvalidOperationException($"Catalog item '{row.CatalogItem2}' not found on catalog '{catalog2.Name}' on line '{lineCount}'."); } BrushStop stop2 = new BrushStop(); + stop2.StopIndex = 2; stop2.ColorCatalog = catalog2; stop2.ColorCatalogsItem = item2; stop2.Color = item2.Color; @@ -333,6 +379,7 @@ namespace Tango.BL.Helpers if (!row.IsLab2NullOrEqual()) { BrushStop stop2 = new BrushStop(); + stop2.StopIndex = 2; stop2.ColorSpace = stop1.ColorSpace; stop2.OffsetPercent = 100; @@ -362,7 +409,7 @@ namespace Tango.BL.Helpers } catch (Exception ex) { - throw new InvalidOperationException($"Error parsing file on line {lineCount}.\n{ex.FlattenMessage()}"); + throw new InvalidOperationException($"Error parsing file on line {lineCount}.\n{ex.Message}"); } } diff --git a/Software/Visual_Studio/Tango.CSV/CsvFileReader.cs b/Software/Visual_Studio/Tango.CSV/CsvFileReader.cs index 79f716aab..c4e3e6d07 100644 --- a/Software/Visual_Studio/Tango.CSV/CsvFileReader.cs +++ b/Software/Visual_Studio/Tango.CSV/CsvFileReader.cs @@ -247,6 +247,15 @@ namespace Tango.CSV var flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.IgnoreCase | (staticMember ? BindingFlags.Static : BindingFlags.Instance); Action<T, string> action = null; + var propByIndex = typeof(T).GetProperties(flags).SingleOrDefault(x => x.GetCustomAttribute<CsvOrderAttribute>() != null && x.GetCustomAttribute<CsvOrderAttribute>().Index == index); + + if (propByIndex != null) + { + var pFunc = StringToObject(propByIndex.PropertyType); + action = EmitSetValueAction(propByIndex, pFunc); + return action; + } + PropertyInfo pi = typeof(T).GetProperty(c, flags); if (pi != null) { @@ -264,17 +273,6 @@ namespace Tango.CSV } } - if (action == null && index != null) - { - var propByIndex = typeof(T).GetProperties(flags).SingleOrDefault(x => x.GetCustomAttribute<CsvOrderAttribute>() != null && x.GetCustomAttribute<CsvOrderAttribute>().Index == index); - - if (propByIndex != null) - { - var pFunc = StringToObject(propByIndex.PropertyType); - action = EmitSetValueAction(propByIndex, pFunc); - } - } - return action; } |
