aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-01-31 13:30:15 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-01-31 13:30:15 +0200
commit80c023fa734d7788e155d4f311ab16220aa80650 (patch)
treedc79c0689e00419c7f447d1b32716df99df8f278 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs
parent2fa92ca3654ebb274482f9bad86231028d357e5a (diff)
downloadTango-80c023fa734d7788e155d4f311ab16220aa80650.tar.gz
Tango-80c023fa734d7788e155d4f311ab16220aa80650.zip
Job Brush working nicely.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs37
1 files changed, 36 insertions, 1 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs
index c76cf657f..143280e66 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs
@@ -16,6 +16,7 @@ using Tango.Integration.Observables;
using Tango.DragAndDrop;
using Tango.MachineStudio.Developer.Converters;
using Tango.MachineStudio.Developer.ViewModels;
+using System.Windows.Threading;
namespace Tango.MachineStudio.Developer.Views
{
@@ -25,6 +26,7 @@ namespace Tango.MachineStudio.Developer.Views
public partial class MainView : UserControl
{
private MainViewVM _vm;
+ private DispatcherTimer _jobBrushTimer;
public DraggingSurface DraggingSurface
{
@@ -46,6 +48,40 @@ namespace Tango.MachineStudio.Developer.Views
chkGraphs.Checked += (x, y) => { graphRowDefinition.Height = new GridLength(440, GridUnitType.Pixel); };
chkGraphs.Unchecked += (x, y) => { graphRowDefinition.Height = new GridLength(80, GridUnitType.Pixel); };
+
+ _jobBrushTimer = new DispatcherTimer();
+ _jobBrushTimer.Interval = TimeSpan.FromSeconds(1);
+ _jobBrushTimer.Tick += _jobBrushTimer_Tick;
+ _jobBrushTimer.Start();
+ }
+
+ private void _jobBrushTimer_Tick(object sender, EventArgs e)
+ {
+ if (_vm != null && _vm.SelectedJob != null)
+ {
+ List<Segment> segments = new List<Segment>();
+ foreach (var s in _vm.SelectedJob.Segments)
+ {
+ segments.Add(s);
+
+ if (_vm.SelectedJob.EnableInterSegment && _vm.SelectedJob.Segments.IndexOf(s) != _vm.SelectedJob.Segments.Count - 1)
+ {
+ segments.Add(new Segment()
+ {
+ Length = _vm.SelectedJob.InterSegmentLength,
+ BrushStops = new System.Collections.ObjectModel.ObservableCollection<BrushStop>()
+ {
+ new BrushStop()
+ {
+ Color = Colors.White,
+ }
+ },
+ });
+ }
+ }
+
+ jobBrushList.ItemsSource = segments;
+ }
}
private void OnDropAvailableSensor(object sender, DropEventArgs e)
@@ -73,7 +109,6 @@ namespace Tango.MachineStudio.Developer.Views
SegmentToGradientStopsConverter converter = new SegmentToGradientStopsConverter();
GradientStopCollection stops = converter.Convert(_vm.SelectedSegment, null, null, null) as GradientStopCollection;
gradientBrush.GradientStops = stops;
- jobBrushList.UpdateLayout();
}
else
{