diff options
| author | Roy Ben Shabat <roy.mail.net@gmail.com> | 2025-09-12 17:39:45 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <roy.mail.net@gmail.com> | 2025-09-12 17:39:45 +0300 |
| commit | 7eb361c1201381c6ad88efa0ebed2c6595b45d13 (patch) | |
| tree | 005c5e210d9352d3b26cbb8ab1f80139279b1898 /Software/Visual_Studio/FSE/Tango.FSE.UI | |
| parent | 8e15f292e2950cac71282923adc357f2abf8b306 (diff) | |
| download | Tango-7eb361c1201381c6ad88efa0ebed2c6595b45d13.tar.gz Tango-7eb361c1201381c6ad88efa0ebed2c6595b45d13.zip | |
Fixed FSE Gateway service with production slot cookie.
Implemented FSE dynamic csv job upload. extra inks.
Implemented PPC dynamic csv job read. extra inks.
Diffstat (limited to 'Software/Visual_Studio/FSE/Tango.FSE.UI')
4 files changed, 56 insertions, 35 deletions
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/JobUploadView.xaml b/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/JobUploadView.xaml index c806be854..f159cadc9 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/JobUploadView.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/JobUploadView.xaml @@ -7,7 +7,7 @@ xmlns:local="clr-namespace:Tango.FSE.UI.Dialogs" xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" mc:Ignorable="d" - Width="400" Height="500" d:DataContext="{d:DesignInstance Type=local:JobUploadViewVM, IsDesignTimeCreatable=False}" Background="{StaticResource FSE_PrimaryBackgroundLightBrush}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}"> + MinWidth="400" Width="Auto" Height="500" d:DataContext="{d:DesignInstance Type=local:JobUploadViewVM, IsDesignTimeCreatable=False}" Background="{StaticResource FSE_PrimaryBackgroundLightBrush}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}"> <DockPanel Margin="10"> <StackPanel DockPanel.Dock="Top" Orientation="Horizontal"> @@ -36,7 +36,22 @@ <mahapps:NumericUpDown Margin="0 5 0 0" Padding="5 0 0 0" Minimum="1" Maximum="1000000" HasDecimals="False" Style="{StaticResource FSE_NumericUpDown_Flat_Dark}" HideUpDownButtons="True" Value="{Binding Length}"></mahapps:NumericUpDown> </StackPanel> - <UniformGrid Columns="4" Height="100"> + <ItemsControl ItemsSource="{Binding Volumes}" Height="100"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <UniformGrid Columns="{Binding Volumes.Count}" /> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate> + <StackPanel> + <TextBlock HorizontalAlignment="Center" Foreground="{Binding LiquidType.LiquidTypeBrush}" Text="{Binding LiquidType.ShortName}"></TextBlock> + <mahapps:NumericUpDown Loaded="NumericUpDown_Loaded" PreviewKeyDown="Num_PreviewKeyDown" Minimum="0" Maximum="200" Margin="0 5 0 0" BorderBrush="{Binding LiquidType.LiquidTypeBrush}" BorderThickness="1" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="20" Height="60" HasDecimals="True" Style="{StaticResource FSE_NumericUpDown_Flat_Dark}" HideUpDownButtons="True" Value="{Binding Volume}"></mahapps:NumericUpDown> + </StackPanel> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + <!--<UniformGrid Columns="4" Height="100"> <StackPanel> <TextBlock HorizontalAlignment="Center" Foreground="Cyan">C</TextBlock> <mahapps:NumericUpDown x:Name="numC" PreviewKeyDown="Num_PreviewKeyDown" Minimum="0" Maximum="200" Margin="0 5 0 0" BorderBrush="Cyan" BorderThickness="1" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="20" Height="60" HasDecimals="True" Style="{StaticResource FSE_NumericUpDown_Flat_Dark}" HideUpDownButtons="True" Value="{Binding C}"></mahapps:NumericUpDown> @@ -56,7 +71,7 @@ <TextBlock HorizontalAlignment="Center" Foreground="Black">K</TextBlock> <mahapps:NumericUpDown x:Name="numK" PreviewKeyDown="Num_PreviewKeyDown" Minimum="0" Maximum="200" Margin="0 5 0 0" BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="20" Height="60" HasDecimals="True" Style="{StaticResource FSE_NumericUpDown_Flat_Dark}" HideUpDownButtons="True" Value="{Binding K}"></mahapps:NumericUpDown> </StackPanel> - </UniformGrid> + </UniformGrid>--> </DockPanel> </Grid> </DockPanel> diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/JobUploadView.xaml.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/JobUploadView.xaml.cs index 98d1d8878..f0dcffa65 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/JobUploadView.xaml.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/JobUploadView.xaml.cs @@ -28,10 +28,6 @@ namespace Tango.FSE.UI.Dialogs { InitializeComponent(); nums = new List<NumericUpDown>(); - nums.Add(numC); - nums.Add(numM); - nums.Add(numY); - nums.Add(numK); } private void Num_PreviewKeyDown(object sender, KeyEventArgs e) @@ -70,5 +66,11 @@ namespace Tango.FSE.UI.Dialogs } } } + + private void NumericUpDown_Loaded(object sender, RoutedEventArgs e) + { + NumericUpDown num = sender as NumericUpDown; + nums.Add(num); + } } } diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/JobUploadViewVM.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/JobUploadViewVM.cs index f12e4edf1..896175400 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/JobUploadViewVM.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Dialogs/JobUploadViewVM.cs @@ -4,15 +4,23 @@ using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.BL.Entities; using Tango.Core.DI; using Tango.FSE.Common; using Tango.FSE.Common.Build; +using Tango.FSE.Common.Connection; using Tango.PPC.Shared.Statistics; namespace Tango.FSE.UI.Dialogs { public class JobUploadViewVM : FSEDialogViewVM { + public class LiquidVolume + { + public LiquidType LiquidType { get; set; } + public double Volume { get; set; } + } + private String _name; public String Name { @@ -24,21 +32,18 @@ namespace Tango.FSE.UI.Dialogs public ThreadFilterData SelectedRML { get; set; } - public int Length { get; set; } - - public double C { get; set; } - - public double M { get; set; } + public List<LiquidVolume> Volumes { get; set; } - public double Y { get; set; } - - public double K { get; set; } + public int Length { get; set; } - public JobUploadViewVM() + public JobUploadViewVM(IMachineProvider machineProvider) { Rmls = new List<ThreadFilterData>(); - TangoIOC.Default.Inject(this); + Volumes = machineProvider.Machine.Configuration.NoneEmptyIdsPacks.OrderBy(x => x.LiquidType.PreferredIndex).Where(x => x.LiquidType.AvailableForStandardUser).Select(x => new LiquidVolume() + { + LiquidType = x.LiquidType + }).ToList(); OKText = "UPLOAD"; CancelText = "CANCEL"; diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LayoutViewVM.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LayoutViewVM.cs index 33297d103..c7b52df81 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LayoutViewVM.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LayoutViewVM.cs @@ -387,35 +387,34 @@ namespace Tango.FSE.UI.ViewModels var lastSelectedRml = data.Rmls.FirstOrDefault(x => x.Guid == Settings.LastJobUploadThreadGuid); if (lastSelectedRml == null) lastSelectedRml = data.Rmls.FirstOrDefault(); - var vm = await NotificationProvider.ShowDialog(new JobUploadViewVM() { Rmls = data.Rmls, SelectedRML = lastSelectedRml }); + var vm = await NotificationProvider.ShowDialog(new JobUploadViewVM(MachineProvider) { Rmls = data.Rmls, SelectedRML = lastSelectedRml }); if (vm.DialogResult) { - TemporaryFile tmpFile = TemporaryManager.CreateFile(".csv"); + TemporaryFile tmpFile = TemporaryManager.CreateImaginaryFile(".csv"); try { Settings.LastJobUploadThreadGuid = vm.SelectedRML.Guid; Settings.Save(); - SegmentCsvModel model = new SegmentCsvModel(); - List<string> columnNames = model.GetType().GetProperties().Select(x => x.Name).ToList(); - CsvFile<SegmentCsvModel> csvFile = new CsvFile<SegmentCsvModel>(new CsvDestination(tmpFile), new CsvDefinition() - { - Columns = columnNames - }); + CsvDynamicWriter csv = new CsvDynamicWriter(); + + int cIndex = 0; - model.Index = "1"; - model.ThreadName = vm.SelectedRML.Name; - model.ColorSpace = ColorSpaces.Volume.ToDescription(); - model.Length = vm.Length.ToString(); - model.Cyan1 = vm.C.ToString(); - model.Magenta1 = vm.M.ToString(); - model.Yellow1 = vm.Y.ToString(); - model.Black1 = vm.K.ToString(); + csv.Write(1, "Index", 0, cIndex++); + csv.Write(vm.SelectedRML.Name, "ThreadName", "", cIndex++); + csv.Write(vm.Length, "Length", 0, cIndex++); + csv.Write(ColorSpaces.Volume, "ColorSpace", ColorSpaces.Volume, cIndex++); + foreach (var liquidVolume in vm.Volumes) + { + if (liquidVolume.Volume > 0) + { + csv.Write(liquidVolume.Volume, liquidVolume.LiquidType.DisplayName, 0, cIndex); + } + } - csvFile.Append(model); - csvFile.Dispose(); + csv.Save(tmpFile); } catch (Exception ex) { |
