diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-09-22 18:23:40 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-09-22 18:23:40 +0300 |
| commit | cd5a926df30ea7e7a4f4f4a55d71b43ec7aee3e1 (patch) | |
| tree | 9120c194b18b4f7e3e781803971684673d26a970 /Software/Visual_Studio | |
| parent | 8e49a8041391c9aa946060aed2c538b1ce958a68 (diff) | |
| download | Tango-cd5a926df30ea7e7a4f4f4a55d71b43ec7aee3e1.tar.gz Tango-cd5a926df30ea7e7a4f4f4a55d71b43ec7aee3e1.zip | |
Implemented auto process selection on color space volume.
Implemented number of units on Device.
Fixed issue with color conversion process index.
Increased max volume to 200 on PPC.
Implemented Thread cloning on MS!
Diffstat (limited to 'Software/Visual_Studio')
16 files changed, 194 insertions, 56 deletions
diff --git a/Software/Visual_Studio/ColorLib/Tango.ColorLib_v2/ColorConverter.cpp b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v2/ColorConverter.cpp index 4c6186efb..61fc387c6 100644 --- a/Software/Visual_Studio/ColorLib/Tango.ColorLib_v2/ColorConverter.cpp +++ b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v2/ColorConverter.cpp @@ -1333,8 +1333,19 @@ void Tango::ColorLib::ColorConverter::ConvertVolumeToRGBDisplay(ConversionInput* VectorXd NLInkP((int)(m_nVolumes)); VectorXd InkOut((int)(m_nVolumes)); //Convert to Nonlinear Inks + double SumVol_Ink = 0.0; + for (int i = 0; i < m_nVolumes; ++i) + { Volume(i) = conversionInput->inputcoordinates->inputliquids[i]->volume; //volume is given in % + SumVol_Ink += Volume(i); + } + for (int i = 0; i < int(conversionInput->n_processranges - 1); ++i) + { + if (SumVol_Ink > m_ProcessRangesMaxP[i]) + GamutRegion++; + } + VolumeToNLInkP(Volume, NLInkP); double *InkOutP = new double[m_nA2BnSepIn]; VectorToDouble(NLInkP, InkOutP); @@ -1367,7 +1378,6 @@ void Tango::ColorLib::ColorConverter::ConvertVolumeToRGBDisplay(ConversionInput* } //Convert to RGB - GamutRegion = 0; //Convert to Lab double *LabOutP = new double[m_nA2BnSepOut]; @@ -1606,6 +1616,7 @@ size_t Tango::ColorLib::ColorConverter::Convert(uint8_t * input_buffer, size_t i output_coordinates__init(outputCoords); fillRGB(outputCoords, RGBOut); fillLab(outputCoords, LabOut); + outputCoords->has_processparameterstableindex = true; outputCoords->processparameterstableindex = GamutRegion; fillVolume(outputCoords, Volume); conversionOutput->has_outofgamut = true; diff --git a/Software/Visual_Studio/ColorLib/Tango.ColorLib_v2/Utils/ColorTransf.cpp b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v2/Utils/ColorTransf.cpp index 39b8ee983..d695c71e6 100644 --- a/Software/Visual_Studio/ColorLib/Tango.ColorLib_v2/Utils/ColorTransf.cpp +++ b/Software/Visual_Studio/ColorLib/Tango.ColorLib_v2/Utils/ColorTransf.cpp @@ -457,7 +457,7 @@ void ColorTransf::evalInkP2Lab(double *ColorIn, double *&ColorOut, int &GamutReg ColorOut[0] = tmpLabOut.Get_x(); ColorOut[1] = tmpLabOut.Get_y(); ColorOut[2] = tmpLabOut.Get_z(); - GamutRegion = 0; + //GamutRegion = 0; if (iColorIn != NULL) { delete[] iColorIn; diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs index c2637b527..a76799881 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs @@ -20,6 +20,7 @@ using Tango.MachineStudio.RML.Models; using Tango.MachineStudio.RML.Views; using Tango.PMR.ColorLab; using System.Data.Entity; +using Tango.Core.ExtensionMethods; namespace Tango.MachineStudio.RML.ViewModels { @@ -178,11 +179,14 @@ namespace Tango.MachineStudio.RML.ViewModels public RelayCommand SaveCommand { get; set; } + public RelayCommand CloneRmlCommand { get; set; } + public MainViewVM(INotificationProvider notificationProvider) { _notification = notificationProvider; ManageRmlCommand = new RelayCommand(() => LoadActiveRML(SelectedRML.Guid), () => SelectedRML != null); - RemoveRmlCommand = new RelayCommand(RemoveSelectedRml); + RemoveRmlCommand = new RelayCommand(RemoveSelectedRml, () => SelectedRML != null); + CloneRmlCommand = new RelayCommand(CloneSelectedRml, () => SelectedRML != null); AddRmlCommand = new RelayCommand(AddNewRml); BackToRmlsCommand = new RelayCommand(BackToRmls, () => IsFree); AddProcessParametersTableCommand = new RelayCommand(AddProcessParametersTable, () => IsFree); @@ -443,6 +447,74 @@ namespace Tango.MachineStudio.RML.ViewModels } } + private async void CloneSelectedRml() + { + String name = _notification.ShowTextInput("Enter thread name", "thread name"); + + if (!String.IsNullOrWhiteSpace(name)) + { + using (_notification.PushTaskItem("Cloning thread...")) + { + try + { + IsFree = false; + + using (var context = ObservablesContext.CreateDefault()) + { + var rml = await new RmlBuilder(context).Set(SelectedRML.Guid).WithActiveParametersGroup().WithLiquidFactors().BuildAsync(); + + Rml cloned = new Rml(); + rml.MapPrimitivesWithStrings(cloned); + + cloned.Code = Rmls.Max(x => x.Code) + 1; + cloned.Guid = Guid.NewGuid().ToString(); + cloned.ID = 0; + cloned.Name = name; + + ProcessParametersTablesGroup group = new ProcessParametersTablesGroup(); + group.Name = rml.GetActiveProcessGroup().Name; + group.Active = true; + + foreach (var p in rml.GetActiveProcessGroup().ProcessParametersTables) + { + var pc = new ProcessParametersTable(); + p.MapPrimitivesTo(pc); + pc.Name = p.Name; + + group.ProcessParametersTables.Add(pc); + } + + cloned.ProcessParametersTablesGroups.Add(group); + + foreach (var liquidFactor in rml.LiquidTypesRmls) + { + LiquidTypesRml l = new LiquidTypesRml(); + l.DefaultCatData = liquidFactor.DefaultCatData; + l.LiquidType = liquidFactor.LiquidType; + l.MaxNlPerCm = liquidFactor.MaxNlPerCm; + cloned.LiquidTypesRmls.Add(l); + } + + context.Rmls.Add(cloned); + await context.SaveChangesAsync(); + } + + LoadRmls(); + } + catch (Exception ex) + { + LogManager.Log(ex, "Error cloning thread."); + _notification.ShowError($"An error occurred while trying to clone the selected thread\n{ex.Message}"); + } + finally + { + IsFree = true; + } + } + + } + } + private void AddProcessParametersTable() { var name = _notification.ShowTextInput("Enter table name", "Name"); diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlsView.xaml index 9f09ad248..719167679 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/Views/RmlsView.xaml @@ -31,6 +31,12 @@ <TextBlock Margin="5 0 0 0" FontSize="16">DELETE</TextBlock> </StackPanel> </Button> + <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="{StaticResource OrangeBrush300}" BorderBrush="{StaticResource OrangeBrush300}" Command="{Binding CloneRmlCommand}"> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon Kind="ContentCopy" Width="20" Height="20" /> + <TextBlock Margin="5 0 0 0" FontSize="16">DUPLICATE</TextBlock> + </StackPanel> + </Button> <Button Margin="0 0 10 0" MinWidth="160" Height="50" Background="{StaticResource GreenBrush300}" BorderBrush="{StaticResource GreenBrush300}" Command="{Binding AddRmlCommand}"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="Plus" Width="20" Height="20" /> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs index 2920c8dd9..219b6faf0 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs @@ -6,6 +6,7 @@ using System.Text; using System.Threading.Tasks; using System.Windows; using Tango.BL; +using Tango.Integration.Operation; using Tango.Logging; using Tango.PMR.Printing; using Tango.Settings; @@ -104,6 +105,11 @@ namespace Tango.MachineStudio.Common public JobUploadStrategy JobUploadStrategy { get; set; } /// <summary> + /// Gets or sets the job number of units method. + /// </summary> + public JobUnitsMethods JobUnitsMethod { get; set; } + + /// <summary> /// Gets or sets a value indicating whether to by pass environment version check. /// </summary> public bool ByPassEnvironmentVersionCheck { get; set; } @@ -155,6 +161,7 @@ namespace Tango.MachineStudio.Common MaximumCacheTime = TimeSpan.FromMinutes(5); CachingMode = ObservablesContextInMemoryCachingMode.None; Theme = MachineStudioTheme.Light; + JobUnitsMethod = JobUnitsMethods.Operator; } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/TextInputBoxWindow.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/TextInputBoxWindow.xaml index 5cc3d719b..a43fafb46 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/TextInputBoxWindow.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Notifications/TextInputBoxWindow.xaml @@ -32,7 +32,7 @@ <StackPanel VerticalAlignment="Top" Margin="0 30 0 0"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon Kind="{Binding RelativeSource={RelativeSource AncestorType=Window},Path=IconKind}" VerticalAlignment="Top" Width="50" Height="50" Foreground="{Binding RelativeSource={RelativeSource AncestorType=Window},Path=IconColor}" /> - <TextBlock Padding="0 10 0 0" TextWrapping="Wrap" Margin="10 0 0 0" VerticalAlignment="Top" FontSize="14" Text="{Binding RelativeSource={RelativeSource AncestorType=Window},Path=Message}" Width="400" Foreground="{StaticResource TransparentBackgroundBrush}"></TextBlock> + <TextBlock Padding="0 10 0 0" TextWrapping="Wrap" Margin="10 0 0 0" VerticalAlignment="Top" FontSize="14" Text="{Binding RelativeSource={RelativeSource AncestorType=Window},Path=Message}" Width="400"></TextBlock> </StackPanel> <TextBox x:Name="txtText" Margin="60 0 20 0" materialDesign:HintAssist.Hint="{Binding RelativeSource={RelativeSource AncestorType=Window},Path=Hint}" Text="{Binding RelativeSource={RelativeSource AncestorType=Window},Path=Response,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Foreground="{StaticResource Dialog.Foreground}"></TextBox> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs index 95f9f800d..b22d65192 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MainViewVM.cs @@ -454,6 +454,7 @@ namespace Tango.MachineStudio.UI.ViewModels x.SelectedMachine.EnableEmbeddedDebugging = x.EnableDiagnostics; x.SelectedMachine.EnableEventsNotification = x.EnableDiagnostics; x.SelectedMachine.UseKeepAlive = x.EnableKeepAlive; + x.SelectedMachine.JobUnitsMethod = _settings.JobUnitsMethod; if (x.SelectedMachine is ExternalBridgeTcpClient) { diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/AboutView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/AboutView.xaml index a5ffe9964..f7e90d4f5 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/AboutView.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/AboutView.xaml @@ -7,6 +7,7 @@ xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:pmrPrinting="clr-namespace:Tango.PMR.Printing;assembly=Tango.PMR" + xmlns:operation="clr-namespace:Tango.Integration.Operation;assembly=Tango.Integration" xmlns:bl="clr-namespace:Tango.BL;assembly=Tango.BL" xmlns:local="clr-namespace:Tango.MachineStudio.UI.Views" mc:Ignorable="d" @@ -46,7 +47,7 @@ - <controls:TableGrid RowHeight="25" DockPanel.Dock="Top"> + <controls:TableGrid RowHeight="27" DockPanel.Dock="Top"> <TextBlock FontWeight="SemiBold">Machine Studio:</TextBlock> <TextBlock><Run>v</Run><Run Text="{Binding ApplicationManager.Version,Mode=OneWay}"></Run></TextBlock> <TextBlock FontWeight="SemiBold">Core Libraries:</TextBlock> @@ -69,10 +70,11 @@ <TextBlock Margin="20 0 0 0" Foreground="{StaticResource GrayBrush}" VerticalAlignment="Center">(Requires restart)</TextBlock> </DockPanel> <TextBlock FontWeight="SemiBold">Job Upload Strategy:</TextBlock> - <DockPanel> - <ComboBox Width="150" DockPanel.Dock="Left" ItemsSource="{Binding Source={x:Type pmrPrinting:JobUploadStrategy},Converter={StaticResource EnumToItemsSourceConverter}}" SelectedValue="{Binding MachineStudioSettings.JobUploadStrategy}" SelectedValuePath="Value" DisplayMemberPath="DisplayName"></ComboBox> - <TextBlock Margin="20 0 0 0" Foreground="{StaticResource GrayBrush}" VerticalAlignment="Center">(Requires restart)</TextBlock> - </DockPanel> + <ComboBox HorizontalAlignment="Left" Width="150" ItemsSource="{Binding Source={x:Type pmrPrinting:JobUploadStrategy},Converter={StaticResource EnumToItemsSourceConverter}}" SelectedValue="{Binding MachineStudioSettings.JobUploadStrategy}" SelectedValuePath="Value" DisplayMemberPath="DisplayName"></ComboBox> + + <TextBlock FontWeight="SemiBold">Job Units Duplication Method:</TextBlock> + <ComboBox HorizontalAlignment="Left" Width="150" DockPanel.Dock="Left" ItemsSource="{Binding Source={x:Type operation:JobUnitsMethods},Converter={StaticResource EnumToItemsSourceConverter}}" SelectedValue="{Binding MachineStudioSettings.JobUnitsMethod}" SelectedValuePath="Value" DisplayMemberPath="DisplayName"></ComboBox> + </controls:TableGrid> <DockPanel Margin="0 0 0 0"> 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 fef39ff70..f0e06fdb6 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 @@ -49,7 +49,7 @@ <ItemsControl.ItemTemplate> <DataTemplate> <Border> - <touch:TouchNumericTextBox DisplayWatermarkHint="True" Width="50" Watermark="{Binding IdsPack.LiquidType.Name,IsAsync=True}" Margin="2 0" ValueChanged="OnLiquidVolumeFieldValueChanged" HorizontalContentAlignment="Center" Value="{Binding Volume}" keyboard:KeyboardView.Container="{Binding ElementName=Container}" HasDecimalPoint="True" Minimum="0" Maximum="100" JoggingFactor="0.5" StringFormat="0.0" /> + <touch:TouchNumericTextBox DisplayWatermarkHint="True" Width="50" Watermark="{Binding IdsPack.LiquidType.Name,IsAsync=True}" 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/Tango.PPC.UI/Printing/DefaultPrintingManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs index f9615199a..41a231932 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs @@ -52,15 +52,7 @@ namespace Tango.PPC.UI.Printing #if STUBPRINT handler = await _machineProvider.MachineOperator.PrintStub(job); #else - - if (job.ColorSpace.Code != ColorSpaces.Volume.ToInt32()) - { - handler = await _machineProvider.MachineOperator.Print(job); - } - else - { - handler = await _machineProvider.MachineOperator.Print(job, job.Rml.GetActiveProcessGroup().ProcessParametersTables.FirstOrDefault()); - } + handler = await _machineProvider.MachineOperator.Print(job); #endif handler.Completed += async (x, e) => @@ -152,7 +144,7 @@ namespace Tango.PPC.UI.Printing public async Task<JobHandler> PrintSample(Job job, ObservablesContext context) { ThrowIfJobInvalid(job); - + LogManager.Log("Cloning job..."); Job sampleDyeJob = job.Clone(); sampleDyeJob.Guid = job.Guid; diff --git a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs index 06e340d1d..cfd9a59f5 100644 --- a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs +++ b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs @@ -648,10 +648,11 @@ namespace Tango.Emulations.Emulators double progress = 0; _cancelJob = false; bool message_sent = false; + double length = job.Segments.Sum(x => x.Length) * (Math.Max(job.NumberOfUnits, 1)); Task.Factory.StartNew(() => { - while (progress < job.Length + job.ProcessParameters.DryerBufferLength * ProcessParametersTable.DRYER_METERS_PER_CYCLE && !_cancelJob) + while (progress < length + job.ProcessParameters.DryerBufferLength * ProcessParametersTable.DRYER_METERS_PER_CYCLE && !_cancelJob) { var status = new PMR.Printing.JobStatus(); status.Progress = progress; @@ -682,7 +683,7 @@ namespace Tango.Emulations.Emulators } } - progress += Math.Min((centimeter_per_second / 1000d), (job.Length + job.ProcessParameters.DryerBufferLength * ProcessParametersTable.DRYER_METERS_PER_CYCLE) - progress); + progress += Math.Min((centimeter_per_second / 1000d), (length + job.ProcessParameters.DryerBufferLength * ProcessParametersTable.DRYER_METERS_PER_CYCLE) - progress); Thread.Sleep(100); } @@ -714,7 +715,7 @@ namespace Tango.Emulations.Emulators { Status = new PMR.Printing.JobStatus() { - Progress = job.Length + job.ProcessParameters.DryerBufferLength * ProcessParametersTable.DRYER_METERS_PER_CYCLE, + Progress = length + job.ProcessParameters.DryerBufferLength * ProcessParametersTable.DRYER_METERS_PER_CYCLE, } }, request.Container.Token, !_cancelJob); @@ -725,7 +726,7 @@ namespace Tango.Emulations.Emulators { Status = new PMR.Printing.JobStatus() { - Progress = job.Length + job.ProcessParameters.DryerBufferLength * ProcessParametersTable.DRYER_METERS_PER_CYCLE, + Progress = length + job.ProcessParameters.DryerBufferLength * ProcessParametersTable.DRYER_METERS_PER_CYCLE, } }, _current_job_resume_token, !_cancelJob); diff --git a/Software/Visual_Studio/Tango.Integration/Operation/IMachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/IMachineOperator.cs index ae303563b..c1d204bae 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/IMachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/IMachineOperator.cs @@ -43,6 +43,11 @@ namespace Tango.Integration.Operation JobUploadStrategy JobUploadStrategy { get; set; } /// <summary> + /// Gets or sets the job number of units duplication method. + /// </summary> + JobUnitsMethods JobUnitsMethod { get; set; } + + /// <summary> /// Gets the current machine status. /// </summary> MachineStatuses Status { get; } diff --git a/Software/Visual_Studio/Tango.Integration/Operation/JobUnitsMethods.cs b/Software/Visual_Studio/Tango.Integration/Operation/JobUnitsMethods.cs new file mode 100644 index 000000000..bc95d04fb --- /dev/null +++ b/Software/Visual_Studio/Tango.Integration/Operation/JobUnitsMethods.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.Integration.Operation +{ + /// <summary> + /// Represents a job number of units duplication method. + /// </summary> + public enum JobUnitsMethods + { + /// <summary> + /// The job ticket will be duplicated before sending to the embedded device. + /// </summary> + Operator, + /// <summary> + /// The job will be duplicated on the embedded device, + /// </summary> + Device, + } +} diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index c34edf8f1..943afa21a 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -211,6 +211,11 @@ namespace Tango.Integration.Operation /// </summary> public JobUploadStrategy JobUploadStrategy { get; set; } + /// <summary> + /// Gets or sets the job number of units duplication method. + /// </summary> + public JobUnitsMethods JobUnitsMethod { get; set; } + private MachineStatuses _status; /// <summary> /// Gets the current machine status. @@ -1364,12 +1369,6 @@ namespace Tango.Integration.Operation var jobSegments = job.OrderedSegments; - //Check not brush stop has color space 'Volume'. - if (jobSegments.SelectMany(x => x.BrushStops).ToList().Exists(x => x.ColorSpace.Code == ColorSpaces.Volume.ToInt32())) - { - throw new InvalidOperationException("Cannot print a brush stop with volume color space when process parameters table has not been specified."); - } - if (job.Rml == null) { throw new NullReferenceException("Job RML is null"); @@ -1477,6 +1476,10 @@ namespace Tango.Integration.Operation throw new InvalidOperationException($"No catalog item specified for segment color."); } } + else if (stop.BrushColorSpace == ColorSpaces.Volume) + { + stop.SetLiquidVolumes(job.Machine.Configuration, job.Rml, processParameters); + } else { throw new InvalidOperationException($"Unsupported color space {stop.BrushColorSpace}."); @@ -1556,6 +1559,12 @@ namespace Tango.Integration.Operation ticket.EnableLubrication = job.EnableLubrication; ticket.Length = job.Length; ticket.WindingMethod = (JobWindingMethod)job.WindingMethod.Code; + + if (JobUnitsMethod == JobUnitsMethods.Device) + { + ticket.NumberOfUnits = (uint)job.NumberOfUnits; + } + ticket.Spool = new JobSpool(); job.SpoolType.MapPrimitivesTo(ticket.Spool); @@ -1662,7 +1671,18 @@ namespace Tango.Integration.Operation var segs = new List<JobSegment>(); - for (int i = 0; i < job.NumberOfUnits; i++) + if (JobUnitsMethod == JobUnitsMethods.Operator) + { + for (int i = 0; i < job.NumberOfUnits; i++) + { + foreach (var s in ticket.Segments) + { + var cloned = s.Clone(); + segs.Add(cloned); + } + } + } + else { foreach (var s in ticket.Segments) { diff --git a/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj b/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj index 62ff18fb6..6bd13ae6d 100644 --- a/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj +++ b/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj @@ -105,6 +105,7 @@ <Compile Include="Operation\DefaultGradientGenerationConfiguration.cs" /> <Compile Include="Operation\IGradientGenerationConfiguration.cs" /> <Compile Include="Operation\JobDescriptionFile.cs" /> + <Compile Include="Operation\JobUnitsMethods.cs" /> <Compile Include="Operation\PreparingJobProgressEventArgs.cs" /> <Compile Include="Operation\SpoolChangeRequiredEventArgs.cs" /> <Compile Include="Upgrade\FirmwareUpgradeHandler.cs" /> @@ -193,7 +194,7 @@ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> + <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.PMR/Printing/JobTicket.cs b/Software/Visual_Studio/Tango.PMR/Printing/JobTicket.cs index 7468346e4..b6ac9c9e1 100644 --- a/Software/Visual_Studio/Tango.PMR/Printing/JobTicket.cs +++ b/Software/Visual_Studio/Tango.PMR/Printing/JobTicket.cs @@ -25,7 +25,7 @@ namespace Tango.PMR.Printing { "Cg9Kb2JUaWNrZXQucHJvdG8SElRhbmdvLlBNUi5QcmludGluZxoQSm9iU2Vn", "bWVudC5wcm90bxoXUHJvY2Vzc1BhcmFtZXRlcnMucHJvdG8aFkpvYldpbmRp", "bmdNZXRob2QucHJvdG8aDkpvYlNwb29sLnByb3RvGhdKb2JVcGxvYWRTdHJh", - "dGVneS5wcm90byLpAwoJSm9iVGlja2V0EgwKBEd1aWQYASABKAkSDAoETmFt", + "dGVneS5wcm90byLxAwoJSm9iVGlja2V0EgwKBEd1aWQYASABKAkSDAoETmFt", "ZRgCIAEoCRIaChJFbmFibGVJbnRlclNlZ21lbnQYAyABKAgSGgoSSW50ZXJT", "ZWdtZW50TGVuZ3RoGAQgASgBEg4KBkxlbmd0aBgFIAEoARJAChFQcm9jZXNz", "UGFyYW1ldGVycxgGIAEoCzIlLlRhbmdvLlBNUi5QcmludGluZy5Qcm9jZXNz", @@ -35,13 +35,13 @@ namespace Tango.PMR.Printing { "Hi5UYW5nby5QTVIuUHJpbnRpbmcuSm9iU2VnbWVudBI9Cg5VcGxvYWRTdHJh", "dGVneRgKIAEoDjIlLlRhbmdvLlBNUi5QcmludGluZy5Kb2JVcGxvYWRTdHJh", "dGVneRIaChJKb2JEZXNjcmlwdGlvbkZpbGUYCyABKAkSGQoRRW5hYmxlTHVi", - "cmljYXRpb24YDCABKAgSDQoFdW5pdHMYDSABKA0SFQoNU2FtcGxlV2luZGlu", - "ZxgOIAEoCEIeChxjb20udHdpbmUudGFuZ28ucG1yLnByaW50aW5nYgZwcm90", - "bzM=")); + "cmljYXRpb24YDCABKAgSFQoNTnVtYmVyT2ZVbml0cxgNIAEoDRIVCg1TYW1w", + "bGVXaW5kaW5nGA4gASgIQh4KHGNvbS50d2luZS50YW5nby5wbXIucHJpbnRp", + "bmdiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::Tango.PMR.Printing.JobSegmentReflection.Descriptor, global::Tango.PMR.Printing.ProcessParametersReflection.Descriptor, global::Tango.PMR.Printing.JobWindingMethodReflection.Descriptor, global::Tango.PMR.Printing.JobSpoolReflection.Descriptor, global::Tango.PMR.Printing.JobUploadStrategyReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Printing.JobTicket), global::Tango.PMR.Printing.JobTicket.Parser, new[]{ "Guid", "Name", "EnableInterSegment", "InterSegmentLength", "Length", "ProcessParameters", "WindingMethod", "Spool", "Segments", "UploadStrategy", "JobDescriptionFile", "EnableLubrication", "Units", "SampleWinding" }, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Printing.JobTicket), global::Tango.PMR.Printing.JobTicket.Parser, new[]{ "Guid", "Name", "EnableInterSegment", "InterSegmentLength", "Length", "ProcessParameters", "WindingMethod", "Spool", "Segments", "UploadStrategy", "JobDescriptionFile", "EnableLubrication", "NumberOfUnits", "SampleWinding" }, null, null, null) })); } #endregion @@ -84,7 +84,7 @@ namespace Tango.PMR.Printing { uploadStrategy_ = other.uploadStrategy_; jobDescriptionFile_ = other.jobDescriptionFile_; enableLubrication_ = other.enableLubrication_; - units_ = other.units_; + numberOfUnits_ = other.numberOfUnits_; sampleWinding_ = other.sampleWinding_; } @@ -224,17 +224,14 @@ namespace Tango.PMR.Printing { } } - /// <summary>Field number for the "units" field.</summary> - public const int UnitsFieldNumber = 13; - private uint units_; - /// <summary> - ///repeat the job - /// </summary> + /// <summary>Field number for the "NumberOfUnits" field.</summary> + public const int NumberOfUnitsFieldNumber = 13; + private uint numberOfUnits_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint Units { - get { return units_; } + public uint NumberOfUnits { + get { return numberOfUnits_; } set { - units_ = value; + numberOfUnits_ = value; } } @@ -277,7 +274,7 @@ namespace Tango.PMR.Printing { if (UploadStrategy != other.UploadStrategy) return false; if (JobDescriptionFile != other.JobDescriptionFile) return false; if (EnableLubrication != other.EnableLubrication) return false; - if (Units != other.Units) return false; + if (NumberOfUnits != other.NumberOfUnits) return false; if (SampleWinding != other.SampleWinding) return false; return true; } @@ -297,7 +294,7 @@ namespace Tango.PMR.Printing { if (UploadStrategy != 0) hash ^= UploadStrategy.GetHashCode(); if (JobDescriptionFile.Length != 0) hash ^= JobDescriptionFile.GetHashCode(); if (EnableLubrication != false) hash ^= EnableLubrication.GetHashCode(); - if (Units != 0) hash ^= Units.GetHashCode(); + if (NumberOfUnits != 0) hash ^= NumberOfUnits.GetHashCode(); if (SampleWinding != false) hash ^= SampleWinding.GetHashCode(); return hash; } @@ -354,9 +351,9 @@ namespace Tango.PMR.Printing { output.WriteRawTag(96); output.WriteBool(EnableLubrication); } - if (Units != 0) { + if (NumberOfUnits != 0) { output.WriteRawTag(104); - output.WriteUInt32(Units); + output.WriteUInt32(NumberOfUnits); } if (SampleWinding != false) { output.WriteRawTag(112); @@ -401,8 +398,8 @@ namespace Tango.PMR.Printing { if (EnableLubrication != false) { size += 1 + 1; } - if (Units != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Units); + if (NumberOfUnits != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(NumberOfUnits); } if (SampleWinding != false) { size += 1 + 1; @@ -455,8 +452,8 @@ namespace Tango.PMR.Printing { if (other.EnableLubrication != false) { EnableLubrication = other.EnableLubrication; } - if (other.Units != 0) { - Units = other.Units; + if (other.NumberOfUnits != 0) { + NumberOfUnits = other.NumberOfUnits; } if (other.SampleWinding != false) { SampleWinding = other.SampleWinding; @@ -526,7 +523,7 @@ namespace Tango.PMR.Printing { break; } case 104: { - Units = input.ReadUInt32(); + NumberOfUnits = input.ReadUInt32(); break; } case 112: { |
