From 7e457b408bd016edb63b26fa92b236d08ef9d274 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Tue, 14 Aug 2018 16:26:49 +0300 Subject: Added motor & dispenser tech items speed. --- .../Editors/DispenserElementEditor.xaml | 6 ++++++ .../Editors/MotorElementEditor.xaml | 13 +++++++++---- .../TechItems/DispenserItem.cs | 2 ++ .../Tango.MachineStudio.Technician/TechItems/MotorItem.cs | 1 + .../ViewModels/MachineTechViewVM.cs | 8 +++++++- 5 files changed, 25 insertions(+), 5 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DispenserElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DispenserElementEditor.xaml index 81ddfd184..122ef091c 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DispenserElementEditor.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DispenserElementEditor.xaml @@ -85,8 +85,14 @@ --> + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorElementEditor.xaml index 7c575d7af..6210178c5 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorElementEditor.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorElementEditor.xaml @@ -5,9 +5,10 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:items="clr-namespace:Tango.MachineStudio.Technician.TechItems" - xmlns:sharedConverters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" - xmlns:converters="clr-namespace:Tango.Editors.Converters;assembly=Tango.Editors" + xmlns:sharedConverters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:visuals="clr-namespace:Tango.Visuals;assembly=Tango.Visuals" + xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:converters="clr-namespace:Tango.Editors.Converters;assembly=Tango.Editors" xmlns:local="clr-namespace:Tango.Editors;assembly=Tango.Editors" mc:Ignorable="d" d:DesignHeight="164.393" d:DesignWidth="224.65" Background="Transparent" ClipToBounds="False" BorderThickness="0" MinWidth="1" MinHeight="1" RenderTransformOrigin="0.5,0.5" d:DataContext="{d:DesignInstance Type=items:MotorItem, IsDesignTimeCreatable=False}"> @@ -65,7 +66,7 @@ - + @@ -76,6 +77,11 @@ + + + + + @@ -226,7 +232,6 @@ - diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/DispenserItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/DispenserItem.cs index 5acb2e7e5..f058036d0 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/DispenserItem.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/DispenserItem.cs @@ -167,6 +167,7 @@ namespace Tango.MachineStudio.Technician.TechItems { Name = "Dispenser"; Description = "Dispenser Controller"; + Speed = 500; Image = ResourceHelper.GetImageFromResources("Images/dispenser-big.png"); Color = Colors.White; DispenserType = new DispenserType(); @@ -190,6 +191,7 @@ namespace Tango.MachineStudio.Technician.TechItems DispenserItem cloned = base.Clone() as DispenserItem; cloned.TechDispenser = TechDispenser; cloned.DisplayName = DisplayName; + cloned.Speed = Speed; return cloned; } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MotorItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MotorItem.cs index 2df926093..779919039 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MotorItem.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/MotorItem.cs @@ -158,6 +158,7 @@ namespace Tango.MachineStudio.Technician.TechItems { Name = "Motor"; Description = "Motor Controller"; + Speed = 500; Image = ResourceHelper.GetImageFromResources("Images/engine.png"); Color = Colors.White; HardwareMotor = new HardwareMotor(); diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs index f79ebb29b..333e43187 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs @@ -903,6 +903,7 @@ namespace Tango.MachineStudio.Technician.ViewModels await MachineOperator.StartMotorJogging(new MotorJoggingRequest() { MotorType = (PMR.Hardware.HardwareMotorType)item.HardwareMotorType.Code, + Speed = item.Speed, Direction = MotorDirection.Forward, }); } @@ -918,6 +919,7 @@ namespace Tango.MachineStudio.Technician.ViewModels await MachineOperator.StartMotorJogging(new MotorJoggingRequest() { MotorType = (PMR.Hardware.HardwareMotorType)item.HardwareMotorType.Code, + Speed = item.Speed, Direction = MotorDirection.Backward, }); } @@ -937,6 +939,7 @@ namespace Tango.MachineStudio.Technician.ViewModels MachineOperator.StartMotorHoming(new MotorHomingRequest() { MotorType = (PMR.Hardware.HardwareMotorType)item.HardwareMotorType.Code, + Speed = item.Speed, }) .Subscribe((response) => { @@ -988,6 +991,7 @@ namespace Tango.MachineStudio.Technician.ViewModels { Index = item.TechDispenser.Code, Direction = MotorDirection.Forward, + Speed = item.Speed, }); } else if (action == MotorActionType.ForwardReleased) @@ -1003,6 +1007,7 @@ namespace Tango.MachineStudio.Technician.ViewModels { Index = item.TechDispenser.Code, Direction = MotorDirection.Backward, + Speed = item.Speed, }); } else if (action == MotorActionType.BackwardReleased) @@ -1020,7 +1025,8 @@ namespace Tango.MachineStudio.Technician.ViewModels MachineOperator.StartDispenserHoming(new DispenserHomingRequest() { - Index = item.TechDispenser.Code + Index = item.TechDispenser.Code, + Speed = item.Speed, }) .Subscribe((response) => { -- cgit v1.3.1