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-02-19 17:52:10 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-02-19 17:52:10 +0200
commita794a5d088b425d7b41f87d7c3a43b904249e11e (patch)
tree65c99c623ceec3699bdd6fb7fdbf24c6d3057721 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs
parent8feeef663f8984c609cb3aa530d09ffcffda5709 (diff)
downloadTango-a794a5d088b425d7b41f87d7c3a43b904249e11e.tar.gz
Tango-a794a5d088b425d7b41f87d7c3a43b904249e11e.zip
Working on developer module...
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.cs162
1 files changed, 0 insertions, 162 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
deleted file mode 100644
index 2bd36e449..000000000
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs
+++ /dev/null
@@ -1,162 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
-using Tango.Integration.Observables;
-using Tango.DragAndDrop;
-using Tango.MachineStudio.Developer.Converters;
-using Tango.MachineStudio.Developer.ViewModels;
-using System.Windows.Threading;
-using Tango.SharedUI;
-
-namespace Tango.MachineStudio.Developer.Views
-{
- /// <summary>
- /// Interaction logic for MainView.xaml
- /// </summary>
- public partial class MainView : UserControl, IMainView
- {
- public static MainView Self { get; set; }
-
- private MainViewVM _vm;
- private DispatcherTimer _jobBrushTimer;
-
- public DraggingSurface DraggingSurface
- {
- get { return (DraggingSurface)GetValue(DraggingSurfaceProperty); }
- set { SetValue(DraggingSurfaceProperty, value); }
- }
- public static readonly DependencyProperty DraggingSurfaceProperty =
- DependencyProperty.Register("DraggingSurface", typeof(DraggingSurface), typeof(MainView), new PropertyMetadata(null));
-
- public event EventHandler<IView> ViewAttached;
-
- public MainView()
- {
- Self = this;
-
- InitializeComponent();
-
- DraggingSurface = draggingSurface;
- this.Loaded += (x, y) =>
- {
- _vm = DataContext as MainViewVM;
- ViewAttached?.Invoke(this, this);
- };
-
- chkGraphs.Checked += (x, y) =>
- {
- graphRowDefinition.Height = new GridLength(440, GridUnitType.Pixel);
- //listCameras.Width = 240;
- //dockCameras.Width = 270;
- //dockCameras.Height = 600;
- };
- chkGraphs.Unchecked += (x, y) =>
- {
- graphRowDefinition.Height = new GridLength(80, GridUnitType.Pixel);
- //listCameras.Width = double.NaN;
- //dockCameras.Width = 330;
- //dockCameras.Height = 850;
- };
-
- _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.ActiveJob != null)
- {
- List<Segment> segments = new List<Segment>();
- foreach (var s in _vm.ActiveJob.Segments)
- {
- segments.Add(s);
-
- if (_vm.ActiveJob.EnableInterSegment && _vm.ActiveJob.Segments.IndexOf(s) != _vm.ActiveJob.Segments.Count - 1)
- {
- segments.Add(new Segment()
- {
- Length = _vm.ActiveJob.InterSegmentLength,
- BrushStops = new System.Collections.ObjectModel.ObservableCollection<BrushStop>()
- {
- new BrushStop()
- {
- Color = Colors.White,
- }
- },
- });
- }
- }
-
- jobBrushList.ItemsSource = segments;
- }
- }
-
- private void OnDropAvailableGraph(object sender, DropEventArgs e)
- {
- if (e.Draggable.DataContext is TechMonitor)
- {
- _vm.OnDropAvailableGraph(e.Draggable.DataContext as TechMonitor);
- }
- }
-
- private void Offset_Slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
- {
- UpdateGradientBrushDisplay();
- }
-
- private void UpdateGradientBrushDisplay()
- {
- if (_vm.SelectedSegment != null)
- {
- SegmentToGradientStopsConverter converter = new SegmentToGradientStopsConverter();
- GradientStopCollection stops = converter.Convert(_vm.SelectedSegment, null, null, null) as GradientStopCollection;
- gradientBrush.GradientStops = stops;
- }
- else
- {
- gradientBrush.GradientStops = new GradientStopCollection();
- }
- }
-
- private void OnBrushStopBorderDrop(object sender, DropEventArgs e)
- {
- if (e.Draggable.DataContext is BrushStop)
- {
- _vm.OnDropBrushStop(e.Draggable.DataContext as BrushStop, e.Droppable.DataContext as BrushStop);
- }
- }
-
- private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
- {
- UpdateGradientBrushDisplay();
- }
-
- private void OnJobStartClick(object sender, RoutedEventArgs e)
- {
-
- }
-
- private void HiveColorPickerControl_SelectedColorChanged(object sender, Color e)
- {
- UpdateGradientBrushDisplay();
- }
-
- private void Popup_MouseDown(object sender, MouseButtonEventArgs e)
- {
- e.Handled = true;
- }
- }
-}