aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-12-28 04:00:29 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-12-28 04:00:29 +0200
commit29241b674e6e747ce64e521446e87596eb66dedd (patch)
tree5169b73b62cff50146ca3f110818787b48bcd387 /Software/Visual_Studio
parent1cb99b7e98491a9064eb4c87b89991b5301528c1 (diff)
downloadTango-29241b674e6e747ce64e521446e87596eb66dedd.tar.gz
Tango-29241b674e6e747ce64e521446e87596eb66dedd.zip
Implemented lubrication level control per RML for PPC user.
Diffstat (limited to 'Software/Visual_Studio')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs28
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml36
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs64
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/Views/MainView.xaml48
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Lubrication/LubricationLevel.cs23
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Lubrication/RmlLubricationLevel.cs19
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs7
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj4
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs14
-rw-r--r--Software/Visual_Studio/Tango.Integration/Operation/AdditionalJobConfiguration.cs18
-rw-r--r--Software/Visual_Studio/Tango.Integration/Operation/IMachineOperator.cs3
-rw-r--r--Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs7
-rw-r--r--Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj3
13 files changed, 255 insertions, 19 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs
index cfac759dd..6f7717a90 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs
@@ -38,6 +38,7 @@ using System.IO;
using Tango.ColorConversion;
using Tango.Integration.Operation;
using Tango.BL.Enumerations;
+using Tango.PPC.Common.Lubrication;
namespace Tango.PPC.Jobs.ViewModels
{
@@ -201,6 +202,13 @@ namespace Tango.PPC.Jobs.ViewModels
set { _availableCatalogs = value; RaisePropertyChangedAuto(); }
}
+ private RmlLubricationLevel _lubricationLevel;
+ public RmlLubricationLevel LubricationLevel
+ {
+ get { return _lubricationLevel; }
+ set { _lubricationLevel = value; RaisePropertyChangedAuto(); }
+ }
+
#endregion
#region Commands
@@ -453,6 +461,8 @@ namespace Tango.PPC.Jobs.ViewModels
Job.ValidateOnPropertyChanged = true;
+ GetLubricationLevel();
+
LogManager.Log("Loading RMLS...");
Rmls = (await new RmlsCollectionBuilder(_db).SetAll().WithActiveParametersGroup().WithCAT(Job.MachineGuid).WithCCT().WithLiquidFactors().WithSpools().ForHeadType(MachineProvider.Machine.MachineHeadType).ForSite(MachineProvider.Machine.SiteGuid).BuildAsync()).ToList();
LogManager.Log("Loading Color Spaces...");
@@ -673,6 +683,8 @@ namespace Tango.PPC.Jobs.ViewModels
// stop.ColorCatalog = replacement;
//}
+ GetLubricationLevel();
+
ResetFineTuning();
}
@@ -1346,6 +1358,22 @@ namespace Tango.PPC.Jobs.ViewModels
#endregion
+ #region Lubrication Level
+
+ private void GetLubricationLevel()
+ {
+ if (Job != null)
+ {
+ LubricationLevel = Settings.LubricationLevels.FirstOrDefault(x => x.RmlGuid == Job.RmlGuid);
+ }
+ else
+ {
+ LubricationLevel = null;
+ }
+ }
+
+ #endregion
+
#region Export Embroidery
private async void ExportEmbroidery()
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 c1472793a..029ba7145 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
@@ -489,22 +489,36 @@
</touch:TouchExpander.Header>
<StackPanel Margin="60 30 60 20" TextElement.FontWeight="Medium">
- <controls:TableGrid RowHeight="50">
+ <StackPanel>
- <TextBlock>Job name:</TextBlock>
- <touch:TouchTextBox Text="{Binding Job.Name,UpdateSourceTrigger=PropertyChanged,ValidatesOnDataErrors=True,ValidatesOnNotifyDataErrors=True}" KeyboardMode="AlphaNumeric" FocusSelectionMode="SelectAll" KeyboardAction="Next" KeyboardContainer="{Binding ElementName=Container}" />
+ <DockPanel>
+ <TextBlock Width="100" Margin="0 0 0 5" VerticalAlignment="Bottom">Job name:</TextBlock>
+ <touch:TouchTextBox Margin="10 0 0 0" Text="{Binding Job.Name,UpdateSourceTrigger=PropertyChanged,ValidatesOnDataErrors=True,ValidatesOnNotifyDataErrors=True}" KeyboardMode="AlphaNumeric" FocusSelectionMode="SelectAll" KeyboardAction="Next" KeyboardContainer="{Binding ElementName=Container}" />
+ </DockPanel>
- <TextBlock>Customer:</TextBlock>
- <touch:TouchAutoComplete ForceItemSelection="False" Text="{Binding CustomersFilter}" ItemsSource="{Binding Customers}" SelectedItem="{Binding Job.Customer}" DisplayMemberPath="Name" AutoCompleteProvider="{Binding CustomersAutoCompleteProvider}" KeyboardMode="AlphaNumeric" KeyboardAction="Next" KeyboardContainer="{Binding ElementName=Container}" />
+ <DockPanel Margin="0 15 0 0">
+ <TextBlock Width="100" Margin="0 0 0 5" VerticalAlignment="Bottom">Customer:</TextBlock>
+ <touch:TouchAutoComplete Margin="10 0 0 0" ForceItemSelection="False" Text="{Binding CustomersFilter}" ItemsSource="{Binding Customers}" SelectedItem="{Binding Job.Customer}" DisplayMemberPath="Name" AutoCompleteProvider="{Binding CustomersAutoCompleteProvider}" KeyboardMode="AlphaNumeric" KeyboardAction="Next" KeyboardContainer="{Binding ElementName=Container}" />
+ </DockPanel>
- <TextBlock>Thread type:</TextBlock>
- <touch:TouchComboBox ItemsSource="{Binding Rmls}" SelectedItem="{Binding Job.Rml}" DisplayMemberPath="Name" Title="Select Thread" />
+ <DockPanel Margin="0 15 0 0">
+ <TextBlock Width="100" VerticalAlignment="Bottom" Margin="0 0 0 3">Thread type:</TextBlock>
+ <touch:TouchComboBox Margin="10 0 0 0" ItemsSource="{Binding Rmls}" SelectedItem="{Binding Job.Rml}" DisplayMemberPath="Name" Title="Select Thread" />
+ </DockPanel>
- <TextBlock>Comment:</TextBlock>
- <touch:TouchMultiLineTextBox Margin="20 0 0 -42" Text="{Binding Job.Description}" Height="60" keyboard:KeyboardView.Container="{Binding ElementName=Container}">
+ <DockPanel Margin="110 5 0 0" TextElement.Foreground="{StaticResource TangoGrayTextBrush}" Visibility="{Binding LubricationLevel,Converter={StaticResource IsNullToVisibilityConverter}}">
+ <touch:TouchIcon Icon="AlertCircleOutline" Width="16" Foreground="{StaticResource TangoGrayTextBrush}" />
+ <TextBlock Margin="5 0 0 0">
+ <Run Text="{Binding LubricationLevel.LubricationLevel,Mode=OneWay,Converter={StaticResource EnumToDescriptionConverter}}"></Run>
+ <Run>Lubrication</Run>
+ </TextBlock>
+ </DockPanel>
- </touch:TouchMultiLineTextBox>
- </controls:TableGrid>
+ <StackPanel Margin="0 35 0 0">
+ <TextBlock>Comment:</TextBlock>
+ <touch:TouchMultiLineTextBox Margin="0 5 0 0" Text="{Binding Job.Description}" Height="60" keyboard:KeyboardView.Container="{Binding ElementName=Container}"></touch:TouchMultiLineTextBox>
+ </StackPanel>
+ </StackPanel>
<Grid HorizontalAlignment="Center" Margin="0 20 0 0" TextElement.Foreground="{StaticResource TangoGrayTextBrush}">
<Grid.ColumnDefinitions>
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs
index 20cfd6bf4..f4bbf6da3 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.MachineSettings/ViewModels/MainViewVM.cs
@@ -18,6 +18,7 @@ using Tango.Core.ExtensionMethods;
using Tango.PPC.Common;
using Tango.PPC.Common.Connection;
using Tango.PPC.Common.ExternalBridge;
+using Tango.PPC.Common.Lubrication;
using Tango.PPC.Common.Messages;
using Tango.PPC.Common.OS;
using Tango.PPC.Common.UWF;
@@ -35,6 +36,36 @@ namespace Tango.PPC.MachineSettings.ViewModels
private TimeZoneInfo _previousTimeZone;
private bool _previousEnableUWF;
+ #region Classes
+
+ public class RmlLubricationLevelSettings : RmlLubricationLevel
+ {
+ public String Name { get; set; }
+
+ public RmlLubricationLevelSettings()
+ {
+
+ }
+
+ public RmlLubricationLevelSettings(RmlLubricationLevel rmlLevel, String name)
+ {
+ RmlGuid = rmlLevel.RmlGuid;
+ LubricationLevel = rmlLevel.LubricationLevel;
+ Name = name;
+ }
+
+ public RmlLubricationLevel ToRmlLubricationLevel()
+ {
+ return new RmlLubricationLevel()
+ {
+ RmlGuid = RmlGuid,
+ LubricationLevel = LubricationLevel,
+ };
+ }
+ }
+
+ #endregion
+
#region Properties
[TangoInject]
@@ -189,6 +220,12 @@ namespace Tango.PPC.MachineSettings.ViewModels
set { _enableUWF = value; RaisePropertyChangedAuto(); }
}
+ private List<RmlLubricationLevelSettings> _lubricationLevels;
+ public List<RmlLubricationLevelSettings> LubricationLevels
+ {
+ get { return _lubricationLevels; }
+ set { _lubricationLevels = value; RaisePropertyChangedAuto(); }
+ }
#endregion
@@ -213,6 +250,7 @@ namespace Tango.PPC.MachineSettings.ViewModels
public MainViewVM()
{
+ LubricationLevels = new List<RmlLubricationLevelSettings>();
SaveCommand = new RelayCommand(Save);
DiscardCommand = new RelayCommand(Discard);
SynchronizeCommand = new RelayCommand(Synchronize, () => !MachineDataSynchronizer.IsSynchronizing && IsFree);
@@ -243,6 +281,7 @@ namespace Tango.PPC.MachineSettings.ViewModels
Settings.SynchronizeJobs = SynchronizeJobs;
Settings.SynchronizeDiagnostics = SynchronizeDiagnostics;
Settings.AutoCheckForUpdates = AutoCheckForUpdates;
+ Settings.LubricationLevels = LubricationLevels.Where(x => x.LubricationLevel != LubricationLevel.Standard).Select(x => x.ToRmlLubricationLevel()).ToList();
MachineDataSynchronizer.IsEnabled = SynchronizeJobs || SynchronizeDiagnostics;
@@ -368,7 +407,7 @@ namespace Tango.PPC.MachineSettings.ViewModels
SelectedJobTypes = new SelectedObjectCollection<JobTypes>(Enum.GetValues(typeof(JobTypes)).Cast<JobTypes>().ToObservableCollection(), Settings.SupportedJobTypes.ToObservableCollection());
SelectedColorSpaces = new SelectedObjectCollection<ColorSpaces>(Enum.GetValues(typeof(ColorSpaces)).Cast<ColorSpaces>().Where(x => x.IsUserSpace()).ToObservableCollection(), Settings.SupportedColorSpaces.ToObservableCollection());
- DefaultRML = Adapter.Rmls.SingleOrDefault(x => x.Guid == Settings.DefaultRmlGuid);
+ DefaultRML = Rmls.SingleOrDefault(x => x.Guid == Settings.DefaultRmlGuid);
DefaultSpoolType = Adapter.SpoolTypes.SingleOrDefault(x => x.Guid == Settings.DefaultSpoolTypeGuid);
SynchronizeJobs = Settings.SynchronizeJobs;
@@ -388,6 +427,29 @@ namespace Tango.PPC.MachineSettings.ViewModels
{
LogManager.Log(ex, "Error getting UWF status.");
}
+
+ try
+ {
+ List<RmlLubricationLevelSettings> levels = new List<RmlLubricationLevelSettings>();
+
+ foreach (var rml in Rmls)
+ {
+ RmlLubricationLevel userLevel = Settings.LubricationLevels.FirstOrDefault(x => x.RmlGuid == rml.Guid);
+
+ RmlLubricationLevelSettings rmlLevel = new RmlLubricationLevelSettings();
+ rmlLevel.RmlGuid = rml.Guid;
+ rmlLevel.Name = rml.Name;
+ rmlLevel.LubricationLevel = userLevel != null ? userLevel.LubricationLevel : LubricationLevel.Standard;
+
+ levels.Add(rmlLevel);
+ }
+
+ LubricationLevels = levels;
+ }
+ catch (Exception ex)
+ {
+ LogManager.Log(ex, "Error loading lubrication levels.");
+ }
}
private async void OnEnableRemoteAssistanceChanged()
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 ba3516be4..baaa4384e 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
@@ -6,17 +6,28 @@
xmlns:enumerations="clr-namespace:Tango.BL.Enumerations;assembly=Tango.BL"
xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
xmlns:keyboard="clr-namespace:Tango.Touch.Keyboard;assembly=Tango.Touch"
- xmlns:sys="clr-namespace:System.Collections;assembly=mscorlib"
+ xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
xmlns:vm="clr-namespace:Tango.PPC.MachineSettings.ViewModels"
xmlns:connectivity="clr-namespace:Tango.PPC.Common.Connectivity;assembly=Tango.PPC.Common"
xmlns:adapters="clr-namespace:Tango.Transport.Adapters;assembly=Tango.Transport"
xmlns:global="clr-namespace:Tango.PPC.MachineSettings"
xmlns:integrationPMR="clr-namespace:Tango.PMR.Integration;assembly=Tango.PMR"
+ xmlns:lubrication="clr-namespace:Tango.PPC.Common.Lubrication;assembly=Tango.PPC.Common"
xmlns:local="clr-namespace:Tango.PPC.MachineSettings.Views"
mc:Ignorable="d"
d:DesignHeight="4500" d:DesignWidth="800" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}">
+ <UserControl.Resources>
+ <ObjectDataProvider x:Key="lubricationLevels" MethodName="GetValues"
+ ObjectType="{x:Type sys:Enum}">
+ <ObjectDataProvider.MethodParameters>
+ <x:Type TypeName="lubrication:LubricationLevel"/>
+ </ObjectDataProvider.MethodParameters>
+ </ObjectDataProvider>
+ </UserControl.Resources>
+
+
<Grid Background="{StaticResource TangoMidBackgroundBrush}" IsEnabled="{Binding IsFree}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
@@ -160,6 +171,41 @@
</StackPanel>
</touch:TouchExpander>
+ <!--LUBRICATION-->
+ <touch:TouchExpander Margin="0 20 0 0" Header="Lubrication Levels" IsExpanded="True" FontSize="{StaticResource TangoExpanderHeaderFontSize}">
+ <StackPanel Margin="0 0 10 0">
+ <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>
+ </StackPanel>
+
+ <StackPanel Margin="0 20 0 0">
+ <TextBlock Foreground="{StaticResource TangoGrayTextBrush}" FontSize="{StaticResource TangoSmallFontSize}" HorizontalAlignment="Center">Level</TextBlock>
+ <ListBox Margin="0 10 0 0" FontSize="{StaticResource TangoSmallFontSize}" ItemsSource="{Binding Source={StaticResource lubricationLevels}}" SelectedItem="{Binding ElementName=lubricationCombo,Path=SelectedItem.LubricationLevel}" Style="{StaticResource BlankListBox}">
+ <ListBox.ItemsPanel>
+ <ItemsPanelTemplate>
+ <UniformGrid Columns="5" />
+ </ItemsPanelTemplate>
+ </ListBox.ItemsPanel>
+ <ListBox.ItemContainerStyle>
+ <Style TargetType="ListBoxItem" BasedOn="{StaticResource BlankListBoxItem}">
+ <Setter Property="ContentTemplate">
+ <Setter.Value>
+ <DataTemplate>
+ <StackPanel Background="Transparent">
+ <touch:TouchRadioButton HorizontalAlignment="Center" Margin="0 0 -8 0" IsChecked="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}"></touch:TouchRadioButton>
+ <TextBlock Text="{Binding Converter={StaticResource EnumToDescriptionConverter}}" Margin="0 5 0 0" HorizontalAlignment="Center"></TextBlock>
+ </StackPanel>
+ </DataTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+ </ListBox.ItemContainerStyle>
+ </ListBox>
+ </StackPanel>
+ </StackPanel>
+ </touch:TouchExpander>
+
<!--REMOTE ASSISTANCE-->
<touch:TouchExpander Margin="0 20 0 0" Header="Remote Assistance" IsExpanded="True" FontSize="{StaticResource TangoExpanderHeaderFontSize}">
<StackPanel>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Lubrication/LubricationLevel.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Lubrication/LubricationLevel.cs
new file mode 100644
index 000000000..6246eeefe
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Lubrication/LubricationLevel.cs
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tango.PPC.Common.Lubrication
+{
+ public enum LubricationLevel
+ {
+ [Description("No")]
+ No = 0,
+ [Description("Low")]
+ Low = 50,
+ [Description("Standard")]
+ Standard = 100,
+ [Description("High")]
+ High = 150,
+ [Description("Very High")]
+ VeryHigh = 200
+ }
+}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Lubrication/RmlLubricationLevel.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Lubrication/RmlLubricationLevel.cs
new file mode 100644
index 000000000..2a5eed22c
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Lubrication/RmlLubricationLevel.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tango.PPC.Common.Lubrication
+{
+ public class RmlLubricationLevel
+ {
+ public String RmlGuid { get; set; }
+ public LubricationLevel LubricationLevel { get; set; }
+
+ public RmlLubricationLevel()
+ {
+ LubricationLevel = LubricationLevel.Standard;
+ }
+ }
+}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs
index aacbe8901..112708ca0 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/PPCSettings.cs
@@ -9,6 +9,7 @@ using Tango.Integration.Operation;
using Tango.Logging;
using Tango.PMR.Integration;
using Tango.PMR.Printing;
+using Tango.PPC.Common.Lubrication;
using Tango.Settings;
using Tango.Transport.Adapters;
using Tango.Web;
@@ -288,6 +289,11 @@ namespace Tango.PPC.Common
public String LastDatabaseBackupFile { get; set; }
/// <summary>
+ /// Gets or sets the RMLs lubrication levels.
+ /// </summary>
+ public List<RmlLubricationLevel> LubricationLevels { get; set; }
+
+ /// <summary>
/// Gets the machine service address.
/// </summary>
/// <returns></returns>
@@ -301,6 +307,7 @@ namespace Tango.PPC.Common
/// </summary>
public PPCSettings()
{
+ LubricationLevels = new List<RmlLubricationLevel>();
JobUploadStrategy = JobUploadStrategy.JobDescriptionFile;
EnableGradientGeneration = true;
GradientGenerationResolution = 20;
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj
index 9d39c96d9..44e25d624 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj
@@ -170,6 +170,8 @@
<Compile Include="Insights\IInsightsService.cs" />
<Compile Include="IPPCView.cs" />
<Compile Include="IPPCService.cs" />
+ <Compile Include="Lubrication\LubricationLevel.cs" />
+ <Compile Include="Lubrication\RmlLubricationLevel.cs" />
<Compile Include="MachineSetup\IMachineSetupManager.cs" />
<Compile Include="MachineSetup\MachineSetupManager.cs" />
<Compile Include="MachineSetup\MachineSetupProgress.cs" />
@@ -520,7 +522,7 @@
</Target>
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
+ <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
</VisualStudio>
</ProjectExtensions>
</Project> \ No newline at end of file
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 b3fcd1208..1de877bc9 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs
@@ -9,6 +9,7 @@ using Tango.BL.Enumerations;
using Tango.Core;
using Tango.Core.DI;
using Tango.Integration.Operation;
+using Tango.PPC.Common;
using Tango.PPC.Common.Connection;
using Tango.PPC.Common.Messages;
using Tango.PPC.Common.Models;
@@ -17,6 +18,7 @@ using Tango.PPC.Common.Notifications;
using Tango.PPC.Common.Printing;
using Tango.PPC.Jobs.Messages;
using Tango.PPC.UI.Dialogs;
+using Tango.Settings;
namespace Tango.PPC.UI.Printing
{
@@ -59,7 +61,17 @@ namespace Tango.PPC.UI.Printing
try
{
_notificationProvider.SetGlobalBusyMessage("Processing job...");
- handler = await _machineProvider.MachineOperator.Print(job);
+
+ //Apply additional job configuration...
+ AdditionalJobConfiguration config = new AdditionalJobConfiguration();
+ var settings = SettingsManager.Default.GetOrCreate<PPCSettings>();
+ var rmlLubrication = settings.LubricationLevels.FirstOrDefault(x => x.RmlGuid == job.RmlGuid);
+ if (rmlLubrication != null)
+ {
+ config.LubricationVolume = (int)rmlLubrication.LubricationLevel;
+ }
+
+ handler = await _machineProvider.MachineOperator.Print(job, config);
_notificationProvider.ReleaseGlobalBusyMessage();
}
catch (InsufficientLiquidQuantityException ex)
diff --git a/Software/Visual_Studio/Tango.Integration/Operation/AdditionalJobConfiguration.cs b/Software/Visual_Studio/Tango.Integration/Operation/AdditionalJobConfiguration.cs
new file mode 100644
index 000000000..88fd3ddd3
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Integration/Operation/AdditionalJobConfiguration.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tango.Integration.Operation
+{
+ public class AdditionalJobConfiguration
+ {
+ public double LubricationVolume { get; set; }
+
+ public AdditionalJobConfiguration()
+ {
+ LubricationVolume = 100;
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Tango.Integration/Operation/IMachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/IMachineOperator.cs
index e7d3cd0e8..49abe2c43 100644
--- a/Software/Visual_Studio/Tango.Integration/Operation/IMachineOperator.cs
+++ b/Software/Visual_Studio/Tango.Integration/Operation/IMachineOperator.cs
@@ -327,8 +327,9 @@ namespace Tango.Integration.Operation
/// This method cannot accept brush stops with 'Volume' as color space.
/// </summary>
/// <param name="job">The job.</param>
+ /// <param name="config">Optional job configuration.</param>
/// <returns></returns>
- Task<JobHandler> Print(Job job);
+ Task<JobHandler> Print(Job job, AdditionalJobConfiguration config = null);
/// <summary>
/// Prints the specified job using the specified job parameters.
diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
index ada7a4b73..60eced34f 100644
--- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
+++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
@@ -2407,11 +2407,14 @@ namespace Tango.Integration.Operation
/// This method cannot accept brush stops with 'Volume' as color space.
/// </summary>
/// <param name="job">The job.</param>
+ /// <param name="config">Optional job configuration.</param>
/// <returns></returns>
- public async Task<JobHandler> Print(Job job)
+ public async Task<JobHandler> Print(Job job, AdditionalJobConfiguration config = null)
{
ProcessParametersTable processParameters = null;
+ if (config == null) config = new AdditionalJobConfiguration();
+
await Task.Factory.StartNew(() =>
{
IColorConverter converter = new DefaultColorConverter();
@@ -2548,7 +2551,7 @@ namespace Tango.Integration.Operation
if (lubricantVolume != null)
{
- lubricantVolume.Volume = 100;
+ lubricantVolume.Volume = config.LubricationVolume;
}
}
}
diff --git a/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj b/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj
index 591cd282a..c8771416a 100644
--- a/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj
+++ b/Software/Visual_Studio/Tango.Integration/Tango.Integration.csproj
@@ -112,6 +112,7 @@
<Compile Include="JobRuns\BasicJobRunsLogger.cs" />
<Compile Include="JobRuns\IJobRunsLogger.cs" />
<Compile Include="Logging\EmbeddedLogFileParser.cs" />
+ <Compile Include="Operation\AdditionalJobConfiguration.cs" />
<Compile Include="Operation\CachedJobOperation.cs" />
<Compile Include="Operation\CartridgeValidationEventArgs.cs" />
<Compile Include="Operation\DefaultMachineEventsStateProvider.cs" />
@@ -221,7 +222,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