diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-05-05 11:43:19 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-05-05 11:43:19 +0300 |
| commit | 9cc18084e2f9db73ce9e2820dfebcab4e50e5730 (patch) | |
| tree | 7e8751d6796a34599adf4fd90964ac62c0ee1cc7 /Software/Visual_Studio/MachineStudio/Modules | |
| parent | eda6e4979dbb722ce5f9412955f89388dfa2af3f (diff) | |
| download | Tango-9cc18084e2f9db73ce9e2820dfebcab4e50e5730.tar.gz Tango-9cc18084e2f9db73ce9e2820dfebcab4e50e5730.zip | |
MREGE.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules')
3 files changed, 26 insertions, 4 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> |
