From 5cda8b0a3ab579dd6f33b1cb19a1d295dc661d28 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 29 Jan 2018 18:45:10 +0200 Subject: Added gradient display of color Brush Stops. --- .../ViewModels/MainViewVM.cs | 24 +++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs') 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 4e3b4ec13..a3be7a2d6 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 @@ -37,7 +37,7 @@ namespace Tango.MachineStudio.Developer.ViewModels /// public ObservablesEntitiesAdapter Adapter { get; set; } - private Machine _selectedMachine; + protected Machine _selectedMachine; /// /// Gets or sets the selected machine. /// @@ -90,6 +90,7 @@ namespace Tango.MachineStudio.Developer.ViewModels } private ProcessParametersTablesGroup _selectedGroupHistory; + /// /// Gets or sets the selected process parameters tables group history. /// @@ -348,9 +349,12 @@ namespace Tango.MachineStudio.Developer.ViewModels private void SetSegmentBrushStopsInkVolumes(Segment segment) { - foreach (var stop in segment.BrushStops) + if (!DesignMode) { - stop.SetInkVolumes(SelectedMachine.Configuration); + foreach (var stop in segment.BrushStops) + { + stop.SetInkVolumes(SelectedMachine.Configuration); + } } } @@ -470,7 +474,7 @@ namespace Tango.MachineStudio.Developer.ViewModels if (SelectedJob != null) { Segment seg = new Segment(); - seg.Name = "New Seg"; + seg.Name = "Untitled Segment"; SelectedJob.Segments.Add(seg); } } @@ -496,7 +500,7 @@ namespace Tango.MachineStudio.Developer.ViewModels { SelectedMachine.Jobs.Add(new Job() { - Name = "New Job", + Name = "Untitled Job", CreationDate = DateTime.UtcNow, }); } @@ -582,6 +586,16 @@ namespace Tango.MachineStudio.Developer.ViewModels } } + /// + /// Switch the brush stop position in the segment. + /// + /// The dragged stop. + /// The dropped stop. + public void OnDropBrushStop(BrushStop draggedStop, BrushStop droppedStop) + { + SelectedSegment.BrushStops.Swap(draggedStop, droppedStop); + } + /// /// Removes the graph. /// -- cgit v1.3.1