diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2020-01-27 09:19:11 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2020-01-27 09:19:11 +0200 |
| commit | ddda6089bff56e80703c8d2dce297919edc58bf1 (patch) | |
| tree | 7702c5cf169124d522eacc7f1a9e0878373baedd /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer | |
| parent | 1d4d327571d4c0c9f4e17411551bd4dae1e2aed0 (diff) | |
| parent | bf2f3245339b9fd9148a2ad25b5ba3320e970cc1 (diff) | |
| download | Tango-ddda6089bff56e80703c8d2dce297919edc58bf1.tar.gz Tango-ddda6089bff56e80703c8d2dce297919edc58bf1.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer')
7 files changed, 393 insertions, 269 deletions
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 4ab3bb1bb..a641c87b6 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 @@ -50,6 +50,9 @@ using Tango.Core.ExtensionMethods; using Tango.ColorConversion; using Tango.PMR.Exports; using Microsoft.WindowsAPICodePack.Dialogs; +using Tango.BL.Enumerations; +using Tango.BL.DTO; +using Tango.BL.ActionLogs; namespace Tango.MachineStudio.Developer.ViewModels { @@ -84,6 +87,10 @@ namespace Tango.MachineStudio.Developer.ViewModels private bool _rml_has_no_cct; private TaskItem _preparingTaskItem; private IColorConverter _converter; + private string _current_job_string; + private JobDTO _beforeSaveJobDTO; + private IActionLogManager _actionLogManager; + private RmlDTO _selectedRMLBeforeLiquidFactorsSaves; #region Properties @@ -746,7 +753,7 @@ namespace Tango.MachineStudio.Developer.ViewModels /// </summary> /// <param name="applicationManager">The application manager.</param> /// <param name="notificationProvider">The notification provider.</param> - public MainViewVM(IStudioApplicationManager applicationManager, INotificationProvider notificationProvider, IDiagnosticsFrameProvider diagnosticsFrameProvider, IVideoCaptureProvider videoCaptureProvider, DeveloperNavigationManager navigation, INavigationManager navigationManager, IAuthenticationProvider authentication, IEventLogger eventLogger, ISpeechProvider speech) + public MainViewVM(IStudioApplicationManager applicationManager, INotificationProvider notificationProvider, IDiagnosticsFrameProvider diagnosticsFrameProvider, IVideoCaptureProvider videoCaptureProvider, DeveloperNavigationManager navigation, INavigationManager navigationManager, IAuthenticationProvider authentication, IEventLogger eventLogger, ISpeechProvider speech, IActionLogManager actionLogManager) { _converter = new DefaultColorConverter(); @@ -755,6 +762,7 @@ namespace Tango.MachineStudio.Developer.ViewModels AuthenticationProvider = authentication; + _actionLogManager = actionLogManager; _notification = notificationProvider; _speech = speech; _navigation = navigation; @@ -872,7 +880,7 @@ namespace Tango.MachineStudio.Developer.ViewModels foreach (var stop in stops) { - if (stop.ColorSpace.Code == BL.Enumerations.ColorSpaces.Volume.ToInt32() && !stop.IsLiquidVolumesOutOfRange) + if (stop.ColorSpace.Code == BL.Enumerations.ColorSpaces.Volume.ToInt32()) { try { @@ -1033,6 +1041,11 @@ namespace Tango.MachineStudio.Developer.ViewModels { var percent = (e.Progress / e.Total * 100d); + if (_preparingTaskItem != null) + { + _preparingTaskItem.Message = $"Preparing job for printing {(e.Progress / e.Total * 100d).ToString("0.0")}%..."; + } + if (_preparingTaskItem == null && percent == 0) { _preparingTaskItem = _notification.PushTaskItem("Preparing job for printing..."); @@ -1042,13 +1055,6 @@ namespace Tango.MachineStudio.Developer.ViewModels _preparingTaskItem.Pop(); _preparingTaskItem = null; } - else - { - if (_preparingTaskItem != null) - { - _preparingTaskItem.Message = $"Preparing job for printing {(e.Progress / e.Total * 100d).ToString("0.0")}%..."; - } - } } private void MachineOperator_ResumingJob(object sender, ResumingJobEventArgs e) @@ -1593,8 +1599,12 @@ namespace Tango.MachineStudio.Developer.ViewModels { LogManager.Log(String.Format("Saving liquid factors for RML {0}...", SelectedRML.Name)); await SelectedRML.SaveAsync(_activeJobDbContext); + var rmlAfterChange = RmlDTO.FromObservable(SelectedRML); + _actionLogManager.InsertLog(ActionLogType.RmlSaved, AuthenticationProvider.CurrentUser, SelectedRML.Name, _selectedRMLBeforeLiquidFactorsSaves, rmlAfterChange, "RML liquid factors changed from Machine Studio Research module."); + _selectedRMLBeforeLiquidFactorsSaves = rmlAfterChange; LiquidTypesRmls = ActiveJob.Machine.Configuration.GetSupportedIdsPacks(SelectedRML).Select(x => x.LiquidType).SelectMany(x => x.LiquidTypesRmls).Where(x => x.Rml.Guid == SelectedRML.Guid).ToList(); + foreach (var segment in ActiveJob.Segments) { SetSegmentBrushStopsLiquidVolumes(segment); @@ -1624,6 +1634,8 @@ namespace Tango.MachineStudio.Developer.ViewModels _selectedRML = new RmlBuilder(_activeJobDbContext).Set(SelectedRML.Guid).WithAllParametersGroup().WithCAT(SelectedMachine.Guid).WithCCT().WithLiquidFactors().Build(); + _selectedRMLBeforeLiquidFactorsSaves = RmlDTO.FromObservable(_selectedRML); + if (_selectedRML.Cct == null) { InvokeUI(() => @@ -1714,6 +1726,8 @@ namespace Tango.MachineStudio.Developer.ViewModels using (_notification.PushTaskItem("Saving Parameters Group...")) { + var processGroupBefore = ProcessParametersTablesGroupDTO.FromObservable(SelectedRML.GetActiveProcessGroup()); + using (var db = ObservablesContext.CreateDefault()) { var active_groups = db.ProcessParametersTablesGroups.Where(x => x.RmlGuid == SelectedRML.Guid && x.Active).ToList(); @@ -1755,6 +1769,8 @@ namespace Tango.MachineStudio.Developer.ViewModels SelectedRML.ProcessParametersTablesGroups.Add(group); await SelectedRML.SaveAsync(_activeJobDbContext); + _actionLogManager.InsertLog(ActionLogType.RmlActiveProcessParametersChanged, AuthenticationProvider.CurrentUser, SelectedRML.Name, processGroupBefore, ProcessParametersTablesGroupDTO.FromObservable(SelectedRML.GetActiveProcessGroup()), "RML Active process parameters changed from Machine Studio Research module."); + InvalidateLiquidFactorsAndProcessTables(); } @@ -1799,92 +1815,110 @@ namespace Tango.MachineStudio.Developer.ViewModels using (_notification.PushTaskItem("Loading job details...")) { - await Task.Factory.StartNew(() => + try { - _disable_gamut_check = true; + await Task.Factory.StartNew(() => + { + _disable_gamut_check = true; - LogManager.Log(String.Format("Loading job {0}...", SelectedMachineJob.Name)); - SelectedSegments = new ObservableCollection<Segment>(); - SelectedBrushStops = new ObservableCollection<BrushStop>(); - SelectedRML = null; - SelectedSegment = null; - SelectedGroupHistory = null; - SelectedBrushStop = null; - SelectedProcessParametersTable = null; - RmlProcessParametersTableGroup = null; + LogManager.Log(String.Format("Loading job {0}...", SelectedMachineJob.Name)); + SelectedSegments = new ObservableCollection<Segment>(); + SelectedBrushStops = new ObservableCollection<BrushStop>(); + SelectedRML = null; + SelectedSegment = null; + SelectedGroupHistory = null; + SelectedBrushStop = null; + SelectedProcessParametersTable = null; + RmlProcessParametersTableGroup = null; - _blockInvalidateCommands = false; + _blockInvalidateCommands = false; - LogManager.Log("Creating active job DB context..."); - _activeJobDbContext = ObservablesContext.CreateDefault(); + LogManager.Log("Creating active job DB context..."); + _activeJobDbContext = ObservablesContext.CreateDefault(); - LogManager.Log("Initializing available color spaces, RMLs & Winding methods..."); + LogManager.Log("Initializing available color spaces, RMLs & Winding methods..."); - //var processParamsGroups = _activeJobDbContext.ProcessParametersTablesGroups.ToList(); - //var processParams = _activeJobDbContext.ProcessParametersTables.ToList(); + //var processParamsGroups = _activeJobDbContext.ProcessParametersTablesGroups.ToList(); + //var processParams = _activeJobDbContext.ProcessParametersTables.ToList(); - ColorSpaces = _activeJobDbContext.ColorSpaces.ToObservableCollection(); - Rmls = _activeJobDbContext.Rmls.ToObservableCollection(); - WindingMethods = _activeJobDbContext.WindingMethods.ToObservableCollection(); - SpoolTypes = _activeJobDbContext.SpoolTypes.ToObservableCollection(); + ColorSpaces = _activeJobDbContext.ColorSpaces.ToObservableCollection(); + Rmls = _activeJobDbContext.Rmls.ToObservableCollection(); + WindingMethods = _activeJobDbContext.WindingMethods.ToObservableCollection(); + SpoolTypes = _activeJobDbContext.SpoolTypes.ToObservableCollection(); - LogManager.Log("Loading machine spools..."); - _activeJobDbContext.Spools.Where(x => x.MachineGuid == SelectedMachine.Guid).Load(); + LogManager.Log("Loading machine spools..."); + _activeJobDbContext.Spools.Where(x => x.MachineGuid == SelectedMachine.Guid).Load(); - LogManager.Log("Setting active job..."); - ActiveJob = new JobBuilder(_activeJobDbContext).Set(SelectedMachineJob.Guid).WithUser().WithSegments().WithBrushStops().WithConfiguration().WithRML().Build(); + LogManager.Log("Setting active job..."); + ActiveJob = new JobBuilder(_activeJobDbContext).Set(SelectedMachineJob.Guid).WithUser().WithSegments().WithBrushStops().WithConfiguration().WithRML().Build(); - //_activeJobDbContext.Ccts.Where(x => x.RmlGuid == ActiveJob.RmlGuid).ToList(); - //_activeJobDbContext.Cats.Where(x => x.RmlGuid == ActiveJob.RmlGuid).ToList(); - //_activeJobDbContext.Machines.SingleOrDefault(x => x.Guid == ActiveJob.MachineGuid); - //_activeJobDbContext.Configurations.SingleOrDefault(x => x.Guid == ActiveJob.Machine.ConfigurationGuid); + //_activeJobDbContext.Ccts.Where(x => x.RmlGuid == ActiveJob.RmlGuid).ToList(); + //_activeJobDbContext.Cats.Where(x => x.RmlGuid == ActiveJob.RmlGuid).ToList(); + //_activeJobDbContext.Machines.SingleOrDefault(x => x.Guid == ActiveJob.MachineGuid); + //_activeJobDbContext.Configurations.SingleOrDefault(x => x.Guid == ActiveJob.Machine.ConfigurationGuid); - //_activeJobDbContext.LiquidTypesRmls.ToList(); + //_activeJobDbContext.LiquidTypesRmls.ToList(); - //_activeJobDbContext.IdsPackFormulas.ToList(); - //_activeJobDbContext.LiquidTypes.ToList(); - //_activeJobDbContext.MidTankTypes.ToList(); - //_activeJobDbContext.DispenserTypes.ToList(); + //_activeJobDbContext.IdsPackFormulas.ToList(); + //_activeJobDbContext.LiquidTypes.ToList(); + //_activeJobDbContext.MidTankTypes.ToList(); + //_activeJobDbContext.DispenserTypes.ToList(); - //_activeJobDbContext.IdsPacks.Where(x => x.ConfigurationGuid == ActiveJob.Machine.ConfigurationGuid).ToList(); + //_activeJobDbContext.IdsPacks.Where(x => x.ConfigurationGuid == ActiveJob.Machine.ConfigurationGuid).ToList(); + _beforeSaveJobDTO = JobDTO.FromObservable(ActiveJob); - LogManager.Log("Setting selected segment..."); - _selectedSegment = ActiveJob.OrderedSegments.FirstOrDefault(); + LogManager.Log("Setting selected segment..."); + _selectedSegment = ActiveJob.OrderedSegments.FirstOrDefault(); - ActiveJob.LengthChanged -= ActiveJob_LengthChanged; - ActiveJob.LengthChanged += ActiveJob_LengthChanged; + ActiveJob.LengthChanged -= ActiveJob_LengthChanged; + ActiveJob.LengthChanged += ActiveJob_LengthChanged; - _selectedRML = ActiveJob.Rml; - InvalidateLiquidFactorsAndProcessTables(); - RaisePropertyChanged(nameof(SelectedRML)); + _selectedRML = ActiveJob.Rml; + InvalidateLiquidFactorsAndProcessTables(); + RaisePropertyChanged(nameof(SelectedRML)); - UpdateEstimatedDuration(); + UpdateEstimatedDuration(); - _blockInvalidateCommands = false; - InvalidateRelayCommands(); + _blockInvalidateCommands = false; + InvalidateRelayCommands(); - _disable_gamut_check = false; + _disable_gamut_check = false; - _settings.LastSelectedMachineGuid = SelectedMachine != null ? SelectedMachine.Guid : null; - _settings.LastSelectedJobGuid = SelectedMachineJob != null ? SelectedMachineJob.Guid : null; + _settings.LastSelectedMachineGuid = SelectedMachine != null ? SelectedMachine.Guid : null; + _settings.LastSelectedJobGuid = SelectedMachineJob != null ? SelectedMachineJob.Guid : null; - _settings.Save(); - }); + _settings.Save(); + }); - SegmentsCollectionView = CollectionViewSource.GetDefaultView(ActiveJob.Segments); - SegmentsCollectionView.SortDescriptions.Add(new SortDescription(nameof(Segment.SegmentIndex), ListSortDirection.Ascending)); + SegmentsCollectionView = CollectionViewSource.GetDefaultView(ActiveJob.Segments); + SegmentsCollectionView.SortDescriptions.Add(new SortDescription(nameof(Segment.SegmentIndex), ListSortDirection.Ascending)); - foreach (var segment in ActiveJob.Segments) - { - SetSegmentBrushStopsLiquidVolumes(segment); - } + foreach (var segment in ActiveJob.Segments) + { + SetSegmentBrushStopsLiquidVolumes(segment); + } - SelectedSegment = _selectedSegment; + SelectedSegment = _selectedSegment; - UIHelper.DoEvents(); - _navigation.NavigateTo(DeveloperNavigationView.JobView); + if (ActiveJob != null) + { + _current_job_string = ActiveJob.ToJobFileWhenLoaded().ToString(); + } + + UIHelper.DoEvents(); + _navigation.NavigateTo(DeveloperNavigationView.JobView); + } + catch (Exception ex) + { + LogManager.Log(ex, "Error loading job."); + _notification.ShowError($"An error occurred while trying to load the selected job.\n{ex.FlattenMessage()}"); + } + finally + { + CanWork = true; + } } CanWork = true; @@ -1902,46 +1936,65 @@ namespace Tango.MachineStudio.Developer.ViewModels { CanWork = false; - using (_notification.PushTaskItem("Saving job details...")) + try { - await Task.Factory.StartNew(() => + using (_notification.PushTaskItem("Saving job details...")) { - LogManager.Log(String.Format("Saving the active job {0}...", ActiveJob.Name)); - ActiveJob.LastUpdated = DateTime.UtcNow; - ActiveJob.Rml = SelectedRML; - ActiveJob.EstimatedDurationMili = (int)EstimatedDuration.TotalMilliseconds; - _activeJobDbContext.SaveChanges(); - - _machineDbContext.Entry(SelectedMachineJob).Reload(); + await Task.Factory.StartNew(() => + { + LogManager.Log(String.Format("Saving the active job {0}...", ActiveJob.Name)); + ActiveJob.LastUpdated = DateTime.UtcNow; + ActiveJob.IsSynchronized = false; + ActiveJob.Rml = SelectedRML; + ActiveJob.EstimatedDurationMili = (int)EstimatedDuration.TotalMilliseconds; + ActiveJob.MarkModified(_activeJobDbContext); + _activeJobDbContext.SaveChanges(); + var afterJobDTO = JobDTO.FromObservable(ActiveJob); + _actionLogManager.InsertLog(ActionLogType.JobSaved, AuthenticationProvider.CurrentUser, _beforeSaveJobDTO.Name, _beforeSaveJobDTO, afterJobDTO, "Job saved from research module in Machine Studio."); + _beforeSaveJobDTO = afterJobDTO; - _machineDbContext.Entry(SelectedMachineJob).Collection(x => x.Segments).Load(); + _machineDbContext.Entry(SelectedMachineJob).Reload(); - foreach (var segment in SelectedMachineJob.Segments.ToList()) - { - _machineDbContext.Entry(segment).Collection(x => x.BrushStops).Load(); + _machineDbContext.Entry(SelectedMachineJob).Collection(x => x.Segments).Load(); - foreach (var brushStop in segment.BrushStops.ToList()) + foreach (var segment in SelectedMachineJob.Segments.ToList()) { - _machineDbContext.Entry(brushStop).Reload(); - } + _machineDbContext.Entry(segment).Collection(x => x.BrushStops).Load(); - _machineDbContext.Entry(segment).Reload(); - } + foreach (var brushStop in segment.BrushStops.ToList()) + { + _machineDbContext.Entry(brushStop).Reload(); + } - InvokeUI(() => - { - SelectedMachineJob.Segments = SelectedMachineJob.Segments; - }); + _machineDbContext.Entry(segment).Reload(); + } - var settings = SettingsManager.Default.GetOrCreate<DeveloperModuleSettings>(); - settings.DefaultJobRmlGuid = ActiveJob.RmlGuid; - settings.Save(); + InvokeUI(() => + { + SelectedMachineJob.Segments = SelectedMachineJob.Segments; + }); - }); - } + var settings = SettingsManager.Default.GetOrCreate<DeveloperModuleSettings>(); + settings.DefaultJobRmlGuid = ActiveJob.RmlGuid; + settings.Save(); - CanWork = true; + if (ActiveJob != null) + { + _current_job_string = ActiveJob.ToJobFileWhenLoaded().ToString(); + } + }); + } + } + catch (Exception ex) + { + LogManager.Log(ex, "Error saving active job."); + _notification.ShowError($"An error occurred while trying to save the current job.\n{ex.FlattenMessage()}"); + } + finally + { + CanWork = true; + } } } @@ -1950,7 +2003,7 @@ namespace Tango.MachineStudio.Developer.ViewModels LogManager.Log("User request for 'back to jobs'..."); LogManager.Log("Comparing active job with selected job..."); - bool jobModified = !ActiveJob.CompareUsingJson(SelectedMachineJob); + bool jobModified = ActiveJob.ToJobFileWhenLoaded().ToString() != _current_job_string; if (jobModified) { @@ -2161,6 +2214,8 @@ namespace Tango.MachineStudio.Developer.ViewModels { if (_notification.ShowQuestion("Are you sure you want to delete the selected jobs?")) { + var jobsToReport = SelectedJobs.Select(x => JobDTO.FromObservable(x)).ToList(); + LogManager.Log(String.Format("Removing {0} jobs...", SelectedJobs.Count)); SelectedJobs.ToList().ForEach(x => { @@ -2172,6 +2227,11 @@ namespace Tango.MachineStudio.Developer.ViewModels LogManager.Log("Saving selected machine to database..."); await SelectedMachine.SaveAsync(_machineDbContext); } + + foreach (var job in jobsToReport) + { + _actionLogManager.InsertLog(ActionLogType.JobDeleted, AuthenticationProvider.CurrentUser, job.Name, job, "Job deleted using Machine Studio.", true); + } } } } @@ -2192,6 +2252,8 @@ namespace Tango.MachineStudio.Developer.ViewModels var settings = SettingsManager.Default.GetOrCreate<DeveloperModuleSettings>(); Job newJob = new Job(); + newJob.LastUpdated = DateTime.UtcNow; + newJob.JobSource = JobSource.Remote; newJob.Name = jobName; newJob.CreationDate = DateTime.UtcNow; newJob.UserGuid = AuthenticationProvider.CurrentUser.Guid; @@ -2226,6 +2288,7 @@ namespace Tango.MachineStudio.Developer.ViewModels LogManager.Log("Saving selected machine to database..."); await SelectedMachine.SaveAsync(_machineDbContext); + _actionLogManager.InsertLog(ActionLogType.JobCreated, AuthenticationProvider.CurrentUser, newJob.Name, newJob, "Job created using Machine Studio."); SelectedMachineJob = newJob; LoadSelectedJob(); } @@ -2251,6 +2314,7 @@ namespace Tango.MachineStudio.Developer.ViewModels return; } SelectedSegment.BrushStops.Remove(x); + _activeJobDbContext.BrushStops.Remove(x); }); ArrangeBrushStopsIndices(); @@ -2355,6 +2419,11 @@ namespace Tango.MachineStudio.Developer.ViewModels LogManager.Log("Saving selected machine to database..."); await SelectedMachine.SaveAsync(_machineDbContext); + foreach (var job in SelectedJobs) + { + _actionLogManager.InsertLog(ActionLogType.JobCreated, AuthenticationProvider.CurrentUser, job.Name, job, "Job cloned using Machine Studio."); + } + CanWork = true; } } @@ -2578,17 +2647,26 @@ namespace Tango.MachineStudio.Developer.ViewModels LogManager.Log($"Importing job files..."); + List<Job> jobsToReport = new List<Job>(); + foreach (var file in dlg.FileNames) { var bytes = File.ReadAllBytes(file); var jobFile = JobFile.Parser.ParseFrom(bytes); var job = await Job.FromJobFile(jobFile, SelectedMachine.Guid, AuthenticationProvider.CurrentUser.Guid); + job.JobSource = JobSource.Remote; _machineDbContext.Jobs.Add(job); + jobsToReport.Add(job); } await _machineDbContext.SaveChangesAsync(); + foreach (var job in jobsToReport) + { + _actionLogManager.InsertLog(ActionLogType.JobImported, AuthenticationProvider.CurrentUser, job.Name, job, "Job imported using Machine Studio."); + } + IsFree = true; _notification.ShowInfo($"Jobs imported successfully."); diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/InsufficientLiquidQuantityView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/InsufficientLiquidQuantityView.xaml index f0e9dc29c..c0cb963e7 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/InsufficientLiquidQuantityView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/InsufficientLiquidQuantityView.xaml @@ -5,8 +5,10 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:vm="clr-namespace:Tango.MachineStudio.Developer.ViewModels" xmlns:local="clr-namespace:Tango.MachineStudio.Developer.Views" + xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - Height="450" Width="800" Background="{StaticResource WhiteBackgroundBrush}" d:DataContext="{d:DesignInstance Type=vm:InsufficientLiquidQuantityViewVM, IsDesignTimeCreatable=False}"> + Height="590" Width="800" d:DataContext="{d:DesignInstance Type=vm:InsufficientLiquidQuantityViewVM, IsDesignTimeCreatable=False}" Foreground="{StaticResource Dialog.Foreground}" + Background="{StaticResource Dialog.Background}"> <Grid Margin="10"> <DockPanel> <StackPanel DockPanel.Dock="Top"> @@ -23,28 +25,60 @@ <Button HorizontalAlignment="Right" DockPanel.Dock="Bottom" Height="40" Width="140" Command="{Binding CloseCommand}" Margin="10 0 0 0">CLOSE</Button> </Grid> - <Border Margin="0 40 0 0" BorderThickness="1" BorderBrush="{StaticResource BorderBrushGainsboro}" CornerRadius="3"> - <ItemsControl ItemsSource="{Binding Exception.IdsPackLevels}"> + <Border Margin="0 20 0 0" Padding="10" BorderThickness="1" BorderBrush="{StaticResource BorderBrushGainsboro}" CornerRadius="3"> + <ItemsControl ItemsSource="{Binding Exception.IdsPackLevels}" VerticalAlignment="Top"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> - <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Horizontal" IsItemsHost="True"></StackPanel> + <StackPanel HorizontalAlignment="Left" VerticalAlignment="Center" Orientation="Vertical" IsItemsHost="True"></StackPanel> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.ItemTemplate> <DataTemplate> - <StackPanel Margin="15 0"> - <TextBlock HorizontalAlignment="Center" Text="{Binding IdsPack.LiquidType.Name}"></TextBlock> - <Border Margin="0 5 0 0" Height="150" Width="50" CornerRadius="3" BorderThickness="1" BorderBrush="{StaticResource BorderBrushGainsboro}"> + <Grid Margin="0 0 0 4"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="40" /> + <ColumnDefinition Width="160" /> + <ColumnDefinition Width="1*" /> + </Grid.ColumnDefinitions> + <material:PackIcon VerticalAlignment="Center" Width="24" Height="24"> + <material:PackIcon.Style> + <Style TargetType="material:PackIcon"> + <Setter Property="Kind" Value="Check"></Setter> + <Setter Property="Foreground" Value="{StaticResource GreenBrush100}"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding IsValid}" Value="False"> + <Setter Property="Kind" Value="Alert"></Setter> + <Setter Property="Foreground" Value="{StaticResource OrangeBrush}"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding IsOverMax}" Value="True"> + <Setter Property="Kind" Value="AlertOctagon"></Setter> + <Setter Property="Foreground" Value="{StaticResource RedBrush100}"></Setter> + </DataTrigger> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding IsValid}" Value="True" /> + <Condition Binding="{Binding IsOverMax}" Value="False" /> + </MultiDataTrigger.Conditions> + <Setter Property="Kind" Value="Check"></Setter> + <Setter Property="Foreground" Value="{StaticResource GreenBrush100}"></Setter> + </MultiDataTrigger> + </Style.Triggers> + </Style> + </material:PackIcon.Style> + </material:PackIcon> + <!--<material:PackIcon Kind="AlertOctagon" VerticalAlignment="Center" Width="24" Height="24" Visibility="{Binding IsValid,Converter={StaticResource BoolToVisConverter}}" />--> + + <Border Grid.Column="1" Margin="5 0 0 0" Height="45" Width="150" CornerRadius="3" BorderThickness="1" BorderBrush="{StaticResource BorderBrushGainsboro}"> <Grid> - <Border CornerRadius="3" VerticalAlignment="Bottom" Loaded="IdsPackLoaded" MinHeight="5"> + <Border VerticalAlignment="Center" CornerRadius="3" Loaded="IdsPackLoaded" MinHeight="45" HorizontalAlignment="Left" MinWidth="5"> <Border.Background> - <LinearGradientBrush> - <GradientStop Offset="0" Color="#4DFFFFFF" /> + <LinearGradientBrush StartPoint="0,0" EndPoint="1,1"> <GradientStop Offset="0.5" Color="{Binding IdsPack.LiquidType.LiquidTypeColor}" /> + <GradientStop Offset="1" Color="#4EFFFFFF" /> </LinearGradientBrush> </Border.Background> </Border> - <Rectangle Loaded="Limit_Loaded" Stroke="Red" StrokeThickness="2" VerticalAlignment="Bottom"> + <Rectangle Loaded="Limit_Loaded" Stroke="Red" StrokeThickness="2" HorizontalAlignment="Left"> <Rectangle.Style> <Style TargetType="Rectangle"> <Style.Triggers> @@ -69,9 +103,18 @@ </Style> </Rectangle.Style> </Rectangle> + + + <TextBlock Foreground="#3B3B3B" HorizontalAlignment="Center" Text="{Binding IdsPack.LiquidType.Name}" VerticalAlignment="Center"> + <TextBlock.Effect> + <DropShadowEffect ShadowDepth="1" BlurRadius="1" Color="White" /> + </TextBlock.Effect> + </TextBlock> + </Grid> </Border> - </StackPanel> + <TextBlock Grid.Column="2" HorizontalAlignment="Left" Text="{Binding Message}" VerticalAlignment="Center" Margin="20,0,0,0" TextWrapping="Wrap" Foreground="{StaticResource RedBrush100}"></TextBlock> + </Grid> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/InsufficientLiquidQuantityView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/InsufficientLiquidQuantityView.xaml.cs index 171cb754e..51cfb1e73 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/InsufficientLiquidQuantityView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/InsufficientLiquidQuantityView.xaml.cs @@ -33,7 +33,7 @@ namespace Tango.MachineStudio.Developer.Views Grid parent = border.Parent as Grid; IDSPackLevel packLevel = border.DataContext as IDSPackLevel; - border.Height = ((double)packLevel.Current / (double)MachineOperator.MAX_DISPENSER_NANOLITER) * parent.ActualHeight; + border.Width = ((double)packLevel.Current / (double)MachineOperator.MAX_DISPENSER_NANOLITER) * parent.ActualWidth; } private void Limit_Loaded(object sender, RoutedEventArgs e) @@ -42,8 +42,8 @@ namespace Tango.MachineStudio.Developer.Views Grid parent = rect.Parent as Grid; IDSPackLevel packLevel = rect.DataContext as IDSPackLevel; - var top = ((double)packLevel.Required / (double)MachineOperator.MAX_DISPENSER_NANOLITER) * parent.ActualHeight; - rect.Margin = new Thickness(0, 0, 0, top); + var left = ((double)packLevel.Required / (double)MachineOperator.MAX_DISPENSER_NANOLITER) * parent.ActualWidth; + rect.Margin = new Thickness(left, 0, 0, 0); if (packLevel.IsValid) { 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 3bda86036..47cb41522 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 @@ -241,91 +241,93 @@ </Style> <DataTemplate x:Key="Volume_Template"> - <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> - <StackPanel VerticalAlignment="Center"> - <ItemsControl VerticalAlignment="Center"> - <ItemsControl.Style> - <Style TargetType="ItemsControl"> - <Setter Property="ItemsSource" Value="{Binding LiquidVolumes}"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.Settings.UsePreferredLiquidVolumeIndex}" Value="True"> - <Setter Property="ItemsSource" Value="{Binding LiquidVolumesOrdered}"></Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </ItemsControl.Style> - <ItemsControl.ItemsPanel> - <ItemsPanelTemplate> - <StackPanel VerticalAlignment="Center" Orientation="Horizontal" IsItemsHost="True"></StackPanel> - </ItemsPanelTemplate> - </ItemsControl.ItemsPanel> - <ItemsControl.ItemTemplate> - <DataTemplate> - <Border> - <Border.Style> - <Style TargetType="Border"> - <Setter Property="Visibility" Value="Visible"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding IdsPack.IdsPackFormula.Name}" Value="Lubricant"> - <Setter Property="Visibility" Value="Collapsed"></Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </Border.Style> - <ContentControl Focusable="False" Style="{StaticResource numberBorder}" Margin="10 0 0 0" Width="60" Height="60"> - <ContentControl.Foreground> - <SolidColorBrush Color="{Binding IdsPack.LiquidType.Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush> - </ContentControl.Foreground> - <mahapps:NumericUpDown ValueChanged="OnBrushStopFieldValueChanged" FontSize="{StaticResource NumbersFontSize}" ScrollViewer.HorizontalScrollBarVisibility="Disabled" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Volume, Mode=TwoWay}" Background="Transparent" Width="40" HideUpDownButtons="True" Minimum="0" Maximum="1000" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> - <mahapps:NumericUpDown.Resources> - <StaticResource ResourceKey="SelectAllTextBoxResource"></StaticResource> - </mahapps:NumericUpDown.Resources> - </mahapps:NumericUpDown> - </ContentControl> - </Border> - </DataTemplate> - </ItemsControl.ItemTemplate> - </ItemsControl> - - <StackPanel Orientation="Horizontal" Margin="30 10 0 0" Height="16" Visibility="{Binding IsLiquidVolumesOutOfRange,Converter={StaticResource BooleanToVisibilityConverter}}"> - <materialDesign:PackIcon Kind="Alert" Foreground="{StaticResource OrangeBrush}" /> - <TextBlock Margin="5 0 0 0" Foreground="{StaticResource OrangeBrush}">Liquid volumes exceeds the maximum range for color conversion!</TextBlock> + <StackPanel> + <StackPanel Orientation="Horizontal" HorizontalAlignment="Left"> + <StackPanel VerticalAlignment="Center"> + <ItemsControl VerticalAlignment="Center"> + <ItemsControl.Style> + <Style TargetType="ItemsControl"> + <Setter Property="ItemsSource" Value="{Binding LiquidVolumes}"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.Settings.UsePreferredLiquidVolumeIndex}" Value="True"> + <Setter Property="ItemsSource" Value="{Binding LiquidVolumesOrdered}"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </ItemsControl.Style> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <StackPanel VerticalAlignment="Center" Orientation="Horizontal" IsItemsHost="True"></StackPanel> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate> + <Border> + <Border.Style> + <Style TargetType="Border"> + <Setter Property="Visibility" Value="Visible"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding IdsPack.IdsPackFormula.Name}" Value="Lubricant"> + <Setter Property="Visibility" Value="Collapsed"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </Border.Style> + <ContentControl Focusable="False" Style="{StaticResource numberBorder}" Margin="10 0 0 0" Width="60" Height="60"> + <ContentControl.Foreground> + <SolidColorBrush Color="{Binding IdsPack.LiquidType.Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush> + </ContentControl.Foreground> + <mahapps:NumericUpDown ValueChanged="OnBrushStopFieldValueChanged" FontSize="{StaticResource NumbersFontSize}" ScrollViewer.HorizontalScrollBarVisibility="Disabled" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Volume, Mode=TwoWay}" Background="Transparent" Width="40" HideUpDownButtons="True" Minimum="0" Maximum="1000" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown.Resources> + <StaticResource ResourceKey="SelectAllTextBoxResource"></StaticResource> + </mahapps:NumericUpDown.Resources> + </mahapps:NumericUpDown> + </ContentControl> + </Border> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> </StackPanel> - </StackPanel> - <materialDesign:PackIcon Kind="ChevronDoubleLeft" Margin="40 2 0 0" VerticalAlignment="Center" Foreground="Gray" /> + <materialDesign:PackIcon Kind="ChevronDoubleLeft" Margin="40 2 0 0" VerticalAlignment="Center" Foreground="Gray" /> - <TextBlock VerticalAlignment="Center" FontSize="16" Margin="5 0 0 0" FontStyle="Italic" Foreground="Gray"> + <TextBlock VerticalAlignment="Center" FontSize="16" Margin="5 0 0 0" FontStyle="Italic" Foreground="Gray"> <Run>Total:</Run> <Run Text="{Binding TotalLiquidVolume,Mode=OneWay,StringFormat=0}"></Run><Run>%</Run> <Run>(</Run> <Run FontSize="10" Text="{Binding TotalLiquidNanoliterPerCentimeter,Mode=OneWay,StringFormat=0.00}"></Run> <Run FontSize="12">nl</Run> <Run>)</Run> - </TextBlock> + </TextBlock> - <Border Margin="60 0 0 0" DataContext="{Binding LiquidVolumes,Converter={StaticResource LiquidVolumesToLubricantLiquidVolume}}" BorderBrush="{StaticResource WhiteBrush100}" BorderThickness="1 0 0 0"> - <Border.Style> - <Style TargetType="Border"> - <Setter Property="Visibility" Value="Collapsed"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding Converter={StaticResource NullObjectToBooleanConverter}}" Value="True"> - <Setter Property="Visibility" Value="Visible"></Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </Border.Style> - <ContentControl Focusable="False" Style="{StaticResource numberBorder}" Margin="10 0 0 0" Width="55" Height="55"> - <ContentControl.Foreground> - <SolidColorBrush Color="{Binding IdsPack.LiquidType.Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush> - </ContentControl.Foreground> - <mahapps:NumericUpDown Foreground="{StaticResource GrayBrush250}" ScrollViewer.HorizontalScrollBarVisibility="Disabled" FontSize="20" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Volume, Mode=TwoWay}" Background="Transparent" Width="40" HideUpDownButtons="True" Minimum="0" Maximum="1000" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> - <mahapps:NumericUpDown.Resources> - <StaticResource ResourceKey="SelectAllTextBoxResource"></StaticResource> - </mahapps:NumericUpDown.Resources> - </mahapps:NumericUpDown> - </ContentControl> - </Border> + <Border Margin="60 0 0 0" DataContext="{Binding LiquidVolumes,Converter={StaticResource LiquidVolumesToLubricantLiquidVolume}}" BorderBrush="{StaticResource WhiteBrush100}" BorderThickness="1 0 0 0"> + <Border.Style> + <Style TargetType="Border"> + <Setter Property="Visibility" Value="Collapsed"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding Converter={StaticResource NullObjectToBooleanConverter}}" Value="True"> + <Setter Property="Visibility" Value="Visible"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </Border.Style> + <ContentControl Focusable="False" Style="{StaticResource numberBorder}" Margin="10 0 0 0" Width="55" Height="55"> + <ContentControl.Foreground> + <SolidColorBrush Color="{Binding IdsPack.LiquidType.Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush> + </ContentControl.Foreground> + <mahapps:NumericUpDown Foreground="{StaticResource GrayBrush250}" ScrollViewer.HorizontalScrollBarVisibility="Disabled" FontSize="20" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Volume, Mode=TwoWay}" Background="Transparent" Width="40" HideUpDownButtons="True" Minimum="0" Maximum="1000" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center"> + <mahapps:NumericUpDown.Resources> + <StaticResource ResourceKey="SelectAllTextBoxResource"></StaticResource> + </mahapps:NumericUpDown.Resources> + </mahapps:NumericUpDown> + </ContentControl> + </Border> + </StackPanel> + + <StackPanel Orientation="Horizontal" Margin="30 10 0 0" Height="16" Visibility="{Binding IsLiquidVolumesOutOfRange,Converter={StaticResource BooleanToVisibilityConverter}}"> + <materialDesign:PackIcon Kind="Alert" Foreground="{StaticResource OrangeBrush}" /> + <TextBlock Margin="5 0 0 0" Foreground="{StaticResource OrangeBrush}">Liquid volumes exceeds the maximum range for color conversion!</TextBlock> + </StackPanel> </StackPanel> </DataTemplate> @@ -789,9 +791,9 @@ </StackPanel> - <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0 40 180 0"> + <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="60 40 180 0"> <materialDesign:PackIcon Kind="ChevronLeft" Width="24" Height="24" /> - <TextBlock Margin="0 -2 0 0" VerticalAlignment="Center"><Run>SUPPORTED MEDIA LIQUID</Run> <Run FontSize="10" Foreground="{StaticResource DimGrayBrush}">( Max Nanolitter/CM )</Run></TextBlock> + <TextBlock Margin="0 -2 0 0" VerticalAlignment="Center"><Run>MEDIA LIQUIDS</Run> <Run FontSize="10" Foreground="{StaticResource DimGrayBrush}">( Max Nanolitter/CM )</Run></TextBlock> <materialDesign:PackIcon Kind="ChevronRight" Width="24" Height="24" /> </StackPanel> @@ -1187,6 +1189,41 @@ <Setter Property="Content"> <Setter.Value> <TextBlock> + <Run Text="{Binding PulsePerSecondFull,Mode=OneWay,StringFormat='0.0'}"></Run> + <Run Text="(pulse)" FontSize="9" Foreground="{StaticResource GrayBrush250}"></Run> + </TextBlock> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding DispenserStepDivision}" Value="{x:Static dispensing:DispenserStepDivisions.Auto}"> + <Setter Property="Content" Value="Auto"></Setter> + </DataTrigger> + <DataTrigger Binding="{Binding DispenserStepDivision,Converter={StaticResource IsNotConverter},ConverterParameter={x:Static dispensing:DispenserStepDivisions.Auto}}" Value="True"> + <Setter Property="Content"> + <Setter.Value> + <TextBlock> + <Run Text="{Binding PulsePerSecondFull,Mode=OneWay,StringFormat='0.0'}"></Run> + <Run Text="(pulse)" FontSize="9" Foreground="{StaticResource GrayBrush250}"></Run> + </TextBlock> + </Setter.Value> + </Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </Label.Style> + </Label> + </DataTemplate> + </DataGridTemplateColumn.CellTemplate> + </DataGridTemplateColumn> + <DataGridTemplateColumn Header="PULSE / SEC (full step)"> + <DataGridTemplateColumn.CellTemplate> + <DataTemplate> + <Label VerticalAlignment="Center"> + <Label.Style> + <Style TargetType="Label"> + <Setter Property="Content"> + <Setter.Value> + <TextBlock> <Run Text="{Binding PulsePerSecond,Mode=OneWay,StringFormat='0.0'}"></Run> <Run Text="(pulse)" FontSize="9" Foreground="{StaticResource GrayBrush250}"></Run> </TextBlock> @@ -1366,7 +1403,7 @@ <Grid Background="{StaticResource TransparentBackgroundBrush100}"> <Grid.Style> <Style TargetType="Grid"> - <Setter Property="Width" Value="520"></Setter> + <Setter Property="Width" Value="640"></Setter> <Setter Property="LayoutTransform"> <Setter.Value> <ScaleTransform ScaleY="1" ScaleX="0"></ScaleTransform> @@ -1504,7 +1541,7 @@ </WrapPanel.Resources> - <editors:ParameterizedEditor ParameterizedObject="{Binding}" GeneratingItems="ParameterizedEditor_GeneratingItems"> + <editors:ParameterizedEditor ParameterizedObject="{Binding}"> <editors:ParameterizedEditor.ItemsPanel> <ItemsPanelTemplate> <WrapPanel IsItemsHost="True" Orientation="Horizontal" /> @@ -1512,11 +1549,11 @@ </editors:ParameterizedEditor.ItemsPanel> <editors:ParameterizedEditor.DoubleTemplate> <DataTemplate> - <Grid Background="Transparent" Style="{StaticResource draggableDroppableGrid}" dragAndDrop:DragAndDropService.Drop="OnProcessParameterDropped" dragAndDrop:DragAndDropService.DraggingSurface="{Binding RelativeSource={RelativeSource AncestorType=editors:ParameterizedEditor},Path=DraggingSurface}"> + <Grid Background="Transparent"> <ContentControl> <StackPanel> <TextBlock IsHitTestVisible="False" Margin="0 5 0 5" Text="{Binding Name}" FontSize="11" Foreground="{StaticResource MainWindow.Foreground}"></TextBlock> - <mahapps:NumericUpDown FontSize="20" Minimum="0" Margin="0 0 5 0" HideUpDownButtons="True" HorizontalContentAlignment="Center" Maximum="10000" StringFormat="0.0" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" Value="{Binding Value,Mode=TwoWay}" Foreground="{StaticResource MainWindow.Foreground}"></mahapps:NumericUpDown> + <mahapps:NumericUpDown FontSize="20" Minimum="0" Margin="0 0 5 0" HideUpDownButtons="True" HorizontalContentAlignment="Center" Maximum="10000" StringFormat="{Binding StringFormat}" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" Value="{Binding Value,Mode=TwoWay}" Foreground="{StaticResource MainWindow.Foreground}"></mahapps:NumericUpDown> </StackPanel> </ContentControl> </Grid> @@ -1572,16 +1609,17 @@ <StackPanel Orientation="Horizontal"> <ToggleButton IsChecked="{Binding AutoProcessSelection}" /> - <TextBlock Margin="5 0 0 0">Use Recommended Process Parameters (auto)</TextBlock> + <TextBlock Margin="5 3 0 0">Use Recommended Process Parameters (auto)</TextBlock> </StackPanel> - <StackPanel Margin="0 40 0 0" Orientation="Horizontal" HorizontalAlignment="Right"> - <Button Height="40" Width="105" Command="{Binding ResetProcessParametersCommand}" Background="Transparent" BorderBrush="{StaticResource DarkGrayBrush200}" Foreground="{StaticResource DarkGrayBrush200}" Margin="0 2 10 0" ToolTip="Resets the current process parameters in the embedded device"> + <Grid Margin="0 40 0 0" > + <Button HorizontalAlignment="Left" Height="40" Width="105" Command="{Binding ResetProcessParametersCommand}" Background="Transparent" BorderBrush="{StaticResource DarkGrayBrush200}" Foreground="{StaticResource DarkGrayBrush200}" Margin="0 2 10 0" ToolTip="Resets the current process parameters in the embedded device"> <TextBlock TextWrapping="Wrap" TextAlignment="Center"> TEMP OFF </TextBlock> </Button> - <Button Height="40" Command="{Binding SaveProcessParametersCommand}" HorizontalAlignment="Left" IsEnabled="{Binding AuthenticationProvider.CurrentUser,Converter={StaticResource UserRoleToBooleanConverter},ConverterParameter='Researcher'}"> + <StackPanel Orientation="Horizontal" HorizontalAlignment="Right"> + <Button Height="40" Command="{Binding SaveProcessParametersCommand}" HorizontalAlignment="Left" IsEnabled="{Binding AuthenticationProvider.CurrentUser,Converter={StaticResource UserRoleToBooleanConverter},ConverterParameter='Researcher'}"> <StackPanel Orientation="Horizontal"> <materialDesign:PackIcon VerticalAlignment="Center" Kind="ContentSave"></materialDesign:PackIcon> <TextBlock Margin="10 0 0 0">SAVE PARAMETERS</TextBlock> @@ -1594,6 +1632,7 @@ </StackPanel> </Button> </StackPanel> + </Grid> </StackPanel> </StackPanel> </Grid> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml.cs index 28e488aae..a4a8fdcf4 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml.cs @@ -159,46 +159,6 @@ namespace Tango.MachineStudio.Developer.Views e.Handled = true; } - private void ParameterizedEditor_GeneratingItems(object sender, SharedUI.Editors.ParameterizedEditor.GeneratingItemsEventArgs e) - { - var settings = SettingsManager.Default.GetOrCreate<DeveloperModuleSettings>(); - - List<ParameterItem> items = e.Result.ToList(); - - if (settings.ProcessParametersIndices.Count > 0) - { - items.Clear(); - - foreach (var item in settings.ProcessParametersIndices.OrderBy(x => x.Index)) - { - var p = e.Source.SingleOrDefault(x => x.Name == item.Name); - - if (p != null) - { - items.Add(p); - } - } - } - else - { - ProcessParametersTable p = new ProcessParametersTable(); - var pp = p.CreateParametersCollection(Core.ParameterItemMode.Binding); - - foreach (var item in pp) - { - settings.ProcessParametersIndices.Add(new ParameterIndex() - { - Index = pp.IndexOf(item), - Name = item.Name - }); - } - - settings.Save(); - } - - e.Result = items; - } - private void OnProcessParameterDropped(object sender, DropEventArgs e) { ParameterItem draggedItem = e.Draggable.DataContext as ParameterItem; diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml index f8a10e7c4..bf626f462 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml @@ -64,7 +64,7 @@ <Grid DockPanel.Dock="Top"> <StackPanel> <StackPanel Orientation="Horizontal"> - <Image Source="../Images/machine-trans.png" RenderOptions.BitmapScalingMode="Fant" Width="50"></Image> + <Image Source="{StaticResource MachineSmall}" RenderOptions.BitmapScalingMode="Fant" Width="50"></Image> <TextBlock VerticalAlignment="Center" FontWeight="SemiBold" Margin="30 0 0 0" FontSize="30" FontStyle="Italic">MACHINE JOBS</TextBlock> </StackPanel> <Rectangle HorizontalAlignment="Stretch" Margin="0 10 0 0" VerticalAlignment="Bottom" StrokeThickness="1" Height="3"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml index 08ba5b699..d0caa2447 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml @@ -330,31 +330,36 @@ <Rectangle Height="30" Margin="0 10 0 0" VerticalAlignment="Center" Fill="{Binding SegmentBrush}"> </Rectangle> - <Canvas Height="30" HorizontalAlignment="Center" Width="80"> - <Label Padding="0" Margin="0"> - <Label.Style> - <Style TargetType="Label"> - <Setter Property="Content" Value="{x:Null}"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding Started}" Value="True"> - <Setter Property="Content"> - <Setter.Value> - <TextBlock Text="{Binding RemainingTime,StringFormat=hh\\:mm\\:ss}" Foreground="{StaticResource RedBrush300}" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Margin="10" FontSize="20"></TextBlock> - </Setter.Value> - </Setter> - </DataTrigger> - <DataTrigger Binding="{Binding Completed}" Value="True"> - <Setter Property="Content"> - <Setter.Value> - <materialDesign:PackIcon Margin="30 10 0 0" HorizontalAlignment="Center" Width="24" Height="24" Kind="Check" Foreground="#47FF00" /> - </Setter.Value> - </Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </Label.Style> - </Label> - </Canvas> + + <Grid Height="30"> + <TextBlock Visibility="{Binding RelativeSource={RelativeSource AncestorType=UserControl}, Path=DataContext.RunningJobStatus.IsFinalizing, Converter={StaticResource BooleanToVisibilityConverter}}" VerticalAlignment="Center" Background="Transparent" FontSize="12" Foreground="{StaticResource RedBrush100}">Finalizing...</TextBlock> + <Canvas Height="30" HorizontalAlignment="Center" Width="80"> + <Label Padding="0" Margin="0"> + <Label.Style> + <Style TargetType="Label"> + <Setter Property="Content" Value="{x:Null}"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding Started}" Value="True"> + <Setter Property="Content"> + <Setter.Value> + <TextBlock Text="{Binding RemainingTime,StringFormat=hh\\:mm\\:ss}" Foreground="{StaticResource RedBrush300}" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Margin="10" FontSize="20"></TextBlock> + </Setter.Value> + </Setter> + </DataTrigger> + <DataTrigger Binding="{Binding Completed}" Value="True"> + <Setter Property="Content"> + <Setter.Value> + <materialDesign:PackIcon Margin="30 10 0 0" HorizontalAlignment="Center" Width="24" Height="24" Kind="Check" Foreground="#47FF00" /> + </Setter.Value> + </Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </Label.Style> + </Label> + </Canvas> + </Grid> + </StackPanel> <Rectangle HorizontalAlignment="Right" Stroke="White" Margin="0 35 0 25" ></Rectangle> @@ -408,8 +413,7 @@ </Grid> </DockPanel> - <TextBlock Visibility="{Binding RunningJobStatus.IsFinalizing,Converter={StaticResource BooleanToVisibilityConverter}}" VerticalAlignment="Top" HorizontalAlignment="Center" Margin="-170 0 0 0" Background="{StaticResource DarkGrayBrush}" FontSize="14" Height="30" Foreground="{StaticResource RedBrush100}">Finalizing...</TextBlock> - </Grid> + </Grid> </Border> <ProgressBar IsIndeterminate="True" VerticalAlignment="Bottom" Height="3" Visibility="{Binding IsJobRunning,Converter={StaticResource BooleanToVisibilityConverter}}"></ProgressBar> @@ -555,15 +559,15 @@ <Border BorderBrush="{StaticResource GrayBrush280}" BorderThickness="0 1 0 1" Padding="5"> <DockPanel> - <StackPanel Orientation="Horizontal" DockPanel.Dock="Left"> - <materialDesign:PackIcon Kind="Alert" Width="32" Height="32" VerticalAlignment="Center" /> - <TextBlock VerticalAlignment="Center" FontSize="16" FontWeight="SemiBold" Margin="10 0 0 0" FontStyle="Italic">Job Aborted By User</TextBlock> + <StackPanel Orientation="Horizontal" DockPanel.Dock="Left" > + <materialDesign:PackIcon Kind="Alert" Width="32" Height="32" VerticalAlignment="Center" Foreground="#FF494949"/> + <TextBlock VerticalAlignment="Center" Foreground="#FF494949" FontSize="16" FontWeight="SemiBold" Margin="10 0 0 0" FontStyle="Italic">Job Aborted By User</TextBlock> </StackPanel> <StackPanel Orientation="Horizontal" DockPanel.Dock="Right" Margin="0 0 10 0"> <Button Padding="0" Height="20" Command="{Binding CloseJobCompletionStatusCommand}" Style="{StaticResource MaterialDesignFlatButton}"> <StackPanel Orientation="Horizontal"> - <materialDesign:PackIcon Foreground="{StaticResource DarkGrayBrush}" VerticalAlignment="Center" Width="20" Height="20" Kind="Close" /> + <materialDesign:PackIcon Foreground="#FF494949" VerticalAlignment="Center" Width="20" Height="20" Kind="Close" /> </StackPanel> </Button> </StackPanel> |
