From 453565753c012a087f402fc55eee528c132b7c8c Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 7 May 2018 14:45:31 +0300 Subject: New Hardware designer module. --- .../Views/MainView.xaml | 374 ++++----------------- .../Views/MainView.xaml.cs | 61 ---- 2 files changed, 68 insertions(+), 367 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Views') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Views/MainView.xaml index 55b3580fe..335ce809e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Views/MainView.xaml @@ -8,12 +8,13 @@ xmlns:mahApps="http://metro.mahapps.com/winfx/xaml/controls" xmlns:editors="clr-namespace:Tango.SharedUI.Editors;assembly=Tango.SharedUI" xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL" xmlns:local="clr-namespace:Tango.MachineStudio.HardwareDesigner.Views" xmlns:vm="clr-namespace:Tango.MachineStudio.HardwareDesigner.ViewModels" xmlns:observables="clr-namespace:Tango.BL.Entities;assembly=Tango.BL" xmlns:global="clr-namespace:Tango.MachineStudio.HardwareDesigner" mc:Ignorable="d" - d:DesignHeight="720" Background="Transparent" d:DesignWidth="1280" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> + d:DesignHeight="720" d:DesignWidth="1280" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> @@ -25,22 +26,17 @@ - + - - - - - - + HARDWARE DESIGNER @@ -56,202 +52,76 @@ - - - - - - - + - - - - DRAG & DROP DANCERS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DRAG & DROP MOTORS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + MOTORS + + + + + + + + + + + - - - DRAG & DROP PID CONTROLS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + DANCERS + + + + + + + + + + + - - - DRAG & DROP WINDERS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + PID CONTROLS + + + + + + + + + + + + + + + WINDERS + + + + + + + + + + + + + - - - - - DROP HERE TO DELETE - - - - + @@ -261,7 +131,7 @@ - + @@ -276,114 +146,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Views/MainView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Views/MainView.xaml.cs index dad105a43..14593327b 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Views/MainView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/Views/MainView.xaml.cs @@ -25,72 +25,11 @@ namespace Tango.MachineStudio.HardwareDesigner.Views { private MainViewVM _vm; - 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 MainView() { InitializeComponent(); - DraggingSurface = dragSufrace; Loaded += (x, y) => _vm = DataContext as MainViewVM; } - - private void OnMotorsDrop(object sender, DropEventArgs e) - { - if (e.Draggable.DataContext is HardwareMotorType) - { - _vm.OnMotorDrop(e.Draggable.DataContext as HardwareMotorType); - } - } - - private void OnDancerDrop(object sender, DropEventArgs e) - { - if (e.Draggable.DataContext is HardwareDancerType) - { - _vm.OnDropDancer(e.Draggable.DataContext as HardwareDancerType); - } - } - - private void OnPidControlDrop(object sender, DropEventArgs e) - { - if (e.Draggable.DataContext is HardwarePidControlType) - { - _vm.OnDropPidControl(e.Draggable.DataContext as HardwarePidControlType); - } - } - - private void OnDropWinder(object sender, DropEventArgs e) - { - if (e.Draggable.DataContext is HardwareWinderType) - { - _vm.OnDropWinder(e.Draggable.DataContext as HardwareWinderType); - } - } - - private void OnTrashDrop(object sender, DropEventArgs e) - { - if (e.Draggable.DataContext is HardwareMotor) - { - _vm.OnRemoveMotor(e.Draggable.DataContext as HardwareMotor); - } - else if (e.Draggable.DataContext is HardwareDancer) - { - _vm.OnRemoveDancer(e.Draggable.DataContext as HardwareDancer); - } - else if (e.Draggable.DataContext is HardwarePidControl) - { - _vm.OnRemovePidControl(e.Draggable.DataContext as HardwarePidControl); - } - else if (e.Draggable.DataContext is HardwareWinder) - { - _vm.OnRemoveWinder(e.Draggable.DataContext as HardwareWinder); - } - } } } -- cgit v1.3.1