diff options
Diffstat (limited to 'Software/Visual_Studio/MachineStudio')
4 files changed, 27 insertions, 5 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/DeveloperModuleSettings.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/DeveloperModuleSettings.cs index e6d5674e1..2099b12d9 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/DeveloperModuleSettings.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/DeveloperModuleSettings.cs @@ -24,9 +24,22 @@ namespace Tango.MachineStudio.Developer public String DefaultJobRmlGuid { get; set; } + /// <summary> + /// Gets or sets a value indicating whether to enable gradient generation. + /// </summary> + public bool EnableGradientGeneration { get; set; } + + /// <summary> + /// Gets or sets the gradient resolution in centimeters. + /// </summary> + public int GradientResolutionCM { get; set; } + public DeveloperModuleSettings() { ProcessParametersIndices = new List<ParameterIndex>(); + + EnableGradientGeneration = true; + GradientResolutionCM = 500; } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs index 4ce8ab39d..3f28c2cff 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs @@ -552,6 +552,12 @@ namespace Tango.MachineStudio.Developer.ViewModels public IAuthenticationProvider AuthenticationProvider { get; set; } + public DeveloperModuleSettings Settings + { + get { return _settings; } + set { _settings = value; RaisePropertyChangedAuto(); } + } + #endregion #region Commands @@ -783,7 +789,7 @@ namespace Tango.MachineStudio.Developer.ViewModels public override void OnApplicationReady() { - _settings = SettingsManager.Default.GetOrCreate<DeveloperModuleSettings>(); + Settings = SettingsManager.Default.GetOrCreate<DeveloperModuleSettings>(); SelectedJobs = new ObservableCollection<Job>(); JobEvents = new ObservableCollection<MachinesEvent>(); @@ -972,7 +978,7 @@ namespace Tango.MachineStudio.Developer.ViewModels { _preparingTaskItem = _notification.PushTaskItem("Preparing job for printing..."); } - else if (percent == 100) + else if (percent == 100 && _preparingTaskItem != null) { _preparingTaskItem.Pop(); _preparingTaskItem = null; @@ -1341,6 +1347,9 @@ namespace Tango.MachineStudio.Developer.ViewModels IsFree = false; LogManager.Log("Sending job to machine operator..."); + MachineOperator.GradientGenerationConfiguration.IsEnabled = Settings.EnableGradientGeneration; + MachineOperator.GradientGenerationConfiguration.ResolutionCM = Settings.GradientResolutionCM; + if (resumeFunc == null) { JobHandler = await MachineOperator.Print(ActiveJob, SelectedProcessParametersTable); diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml index a5d137e67..8a5ec94fa 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml @@ -867,9 +867,9 @@ <DockPanel> <StackPanel Orientation="Horizontal" DockPanel.Dock="Right" VerticalAlignment="Center" Margin="0 0 0 0"> <TextBlock VerticalAlignment="Center" Foreground="DimGray">Generate Gradient</TextBlock> - <ToggleButton Margin="10 0 0 0" IsChecked="{Binding ApplicationManager.ConnectedMachine.GradientGenerationConfiguration.IsEnabled,Mode=TwoWay}" /> + <ToggleButton Margin="10 0 0 0" IsChecked="{Binding Settings.EnableGradientGeneration,Mode=TwoWay}" /> <TextBlock Margin="10 0 0 0" VerticalAlignment="Center" Foreground="DimGray">Resolution:</TextBlock> - <mahapps:NumericUpDown HideUpDownButtons="True" Width="90" HorizontalAlignment="Left" FontSize="14" FontFamily="{StaticResource digital-7}" StringFormat="{}{0:N0} cm" Margin="5 1 0 0" Minimum="10" Maximum="1000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" BorderBrush="DimGray" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding MachineOperator.GradientGenerationConfiguration.ResolutionCM,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"> + <mahapps:NumericUpDown HideUpDownButtons="True" Width="90" HorizontalAlignment="Left" FontSize="14" FontFamily="{StaticResource digital-7}" StringFormat="{}{0:N0} cm" Margin="5 1 0 0" Minimum="10" Maximum="1000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" BorderBrush="DimGray" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding Settings.GradientResolutionCM,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"> <mahapps:NumericUpDown.Resources> <StaticResource ResourceKey="SelectAllTextBoxResource"></StaticResource> </mahapps:NumericUpDown.Resources> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs index e5fe63d87..0433ff7be 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs @@ -146,7 +146,7 @@ namespace Tango.MachineStudio.Common StudioModulesBounds = new List<StudioModuleBounds>(); Environment = WorkingEnvironment.Remote; DeploymentSlot = DeploymentSlot.DEV; - JobUploadStrategy = JobUploadStrategy.Default; + JobUploadStrategy = JobUploadStrategy.JobDescriptionFile; MaximumCacheTime = TimeSpan.FromMinutes(5); CachingMode = ObservablesContextInMemoryCachingMode.None; } |
