aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ControllerElementEditor.xaml.cs1
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DancerElementEditor.xaml.cs1
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DigitalInElementEditor.xaml.cs1
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DigitalOutElementEditor.xaml.cs1
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DispenserElementEditor.xaml.cs1
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MeterElementEditor.xaml.cs1
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MonitorElementEditor.xaml.cs1
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorElementEditor.xaml.cs1
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorGroupElementEditor.xaml.cs1
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MultiGraphElementEditor.xaml.cs1
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/PidElementEditor.xaml.cs1
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ProcessParametersElementEditor.xaml114
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ProcessParametersElementEditor.xaml.cs182
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/SingleGraphElementEditor.xaml.cs1
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/SpeedSensorElementEditor.xaml.cs1
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ThreadMotionElementEditor.xaml.cs1
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/WinderElementEditor.xaml.cs1
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Images/process-params.pngbin0 -> 1491 bytes
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/ProcessParametersTemplate.xaml45
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/ProcessParametersTemplate.xaml.cs28
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Tango.MachineStudio.Technician.csproj22
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/ProcessParametersItem.cs133
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/TechItem.cs1
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs46
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml9
25 files changed, 591 insertions, 4 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ControllerElementEditor.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ControllerElementEditor.xaml.cs
index 4d183dac6..af116a3f2 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ControllerElementEditor.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ControllerElementEditor.xaml.cs
@@ -18,6 +18,7 @@ using System.Windows.Shapes;
using Tango.Editors;
using Tango.BL.Entities;
using Tango.MachineStudio.Technician.TechItems;
+using Tango.Core;
namespace Tango.MachineStudio.Technician.Editors
{
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DancerElementEditor.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DancerElementEditor.xaml.cs
index a83050194..4023f3334 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DancerElementEditor.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DancerElementEditor.xaml.cs
@@ -18,6 +18,7 @@ using System.Windows.Shapes;
using Tango.Editors;
using Tango.BL.Entities;
using Tango.MachineStudio.Technician.TechItems;
+using Tango.Core;
namespace Tango.MachineStudio.Technician.Editors
{
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DigitalInElementEditor.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DigitalInElementEditor.xaml.cs
index 11a7a63ee..f1c6f69fa 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DigitalInElementEditor.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DigitalInElementEditor.xaml.cs
@@ -18,6 +18,7 @@ using System.Windows.Shapes;
using Tango.Editors;
using Tango.BL.Entities;
using Tango.MachineStudio.Technician.TechItems;
+using Tango.Core;
namespace Tango.MachineStudio.Technician.Editors
{
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DigitalOutElementEditor.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DigitalOutElementEditor.xaml.cs
index 7738f5eb3..1a64e0483 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DigitalOutElementEditor.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DigitalOutElementEditor.xaml.cs
@@ -18,6 +18,7 @@ using System.Windows.Shapes;
using Tango.Editors;
using Tango.BL.Entities;
using Tango.MachineStudio.Technician.TechItems;
+using Tango.Core;
namespace Tango.MachineStudio.Technician.Editors
{
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DispenserElementEditor.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DispenserElementEditor.xaml.cs
index 98bd4313b..ca686d3e2 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DispenserElementEditor.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/DispenserElementEditor.xaml.cs
@@ -19,6 +19,7 @@ using System.Windows.Shapes;
using Tango.Editors;
using Tango.BL.Entities;
using Tango.MachineStudio.Technician.TechItems;
+using Tango.Core;
namespace Tango.MachineStudio.Technician.Editors
{
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MeterElementEditor.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MeterElementEditor.xaml.cs
index 79a1e4c38..a4a56e13d 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MeterElementEditor.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MeterElementEditor.xaml.cs
@@ -18,6 +18,7 @@ using System.Windows.Shapes;
using Tango.Editors;
using Tango.BL.Entities;
using Tango.MachineStudio.Technician.TechItems;
+using Tango.Core;
namespace Tango.MachineStudio.Technician.Editors
{
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MonitorElementEditor.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MonitorElementEditor.xaml.cs
index 54fb2dc69..e1b7f9709 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MonitorElementEditor.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MonitorElementEditor.xaml.cs
@@ -18,6 +18,7 @@ using System.Windows.Shapes;
using Tango.Editors;
using Tango.BL.Entities;
using Tango.MachineStudio.Technician.TechItems;
+using Tango.Core;
namespace Tango.MachineStudio.Technician.Editors
{
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorElementEditor.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorElementEditor.xaml.cs
index 7dacfddde..da65b9ab4 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorElementEditor.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorElementEditor.xaml.cs
@@ -19,6 +19,7 @@ using System.Windows.Shapes;
using Tango.Editors;
using Tango.BL.Entities;
using Tango.MachineStudio.Technician.TechItems;
+using Tango.Core;
namespace Tango.MachineStudio.Technician.Editors
{
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorGroupElementEditor.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorGroupElementEditor.xaml.cs
index f8cb5aab9..eaee03c2b 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorGroupElementEditor.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MotorGroupElementEditor.xaml.cs
@@ -20,6 +20,7 @@ using Tango.Editors;
using Tango.BL.Entities;
using Tango.MachineStudio.Technician.TechItems;
using Tango.SharedUI.Components;
+using Tango.Core;
namespace Tango.MachineStudio.Technician.Editors
{
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MultiGraphElementEditor.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MultiGraphElementEditor.xaml.cs
index d7c0da879..f24c77f1c 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MultiGraphElementEditor.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/MultiGraphElementEditor.xaml.cs
@@ -18,6 +18,7 @@ using System.Windows.Shapes;
using Tango.Editors;
using Tango.BL.Entities;
using Tango.MachineStudio.Technician.TechItems;
+using Tango.Core;
namespace Tango.MachineStudio.Technician.Editors
{
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/PidElementEditor.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/PidElementEditor.xaml.cs
index 7e7f9c131..f8cabca59 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/PidElementEditor.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/PidElementEditor.xaml.cs
@@ -18,6 +18,7 @@ using System.Windows.Shapes;
using Tango.Editors;
using Tango.BL.Entities;
using Tango.MachineStudio.Technician.TechItems;
+using Tango.Core;
namespace Tango.MachineStudio.Technician.Editors
{
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ProcessParametersElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ProcessParametersElementEditor.xaml
new file mode 100644
index 000000000..c1a76fe8a
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ProcessParametersElementEditor.xaml
@@ -0,0 +1,114 @@
+<local:ElementEditor x:Class="Tango.MachineStudio.Technician.Editors.ProcessParametersElementEditor"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:sharedConverters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
+ xmlns:editors="clr-namespace:Tango.SharedUI.Editors;assembly=Tango.SharedUI"
+ xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls"
+ xmlns:dragAndDrop="clr-namespace:Tango.DragAndDrop;assembly=Tango.DragAndDrop"
+ xmlns:items="clr-namespace:Tango.MachineStudio.Technician.TechItems"
+ xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+ xmlns:converters="clr-namespace:Tango.Editors.Converters;assembly=Tango.Editors"
+ xmlns:visuals="clr-namespace:Tango.Visuals;assembly=Tango.Visuals"
+ xmlns:local="clr-namespace:Tango.Editors;assembly=Tango.Editors"
+ mc:Ignorable="d" Background="Transparent" ClipToBounds="False" BorderThickness="0" MinWidth="1" MinHeight="1" RenderTransformOrigin="0.5,0.5" d:DataContext="{d:DesignInstance Type=items:ProcessParametersItem, IsDesignTimeCreatable=False}" Height="200" Width="400">
+
+ <UserControl.Resources>
+ <converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"></converters:BoolToVisibilityConverter>
+ <sharedConverters:BooleanInverseConverter x:Key="BooleanInverseConverter" />
+
+ <!--Theme-->
+ <SolidColorBrush x:Key="BorderBrush" Color="Transparent"></SolidColorBrush>
+ <SolidColorBrush x:Key="CornersBrush" Color="Red"></SolidColorBrush>
+ </UserControl.Resources>
+
+ <UserControl.RenderTransform>
+ <RotateTransform Angle="{Binding RelativeSource={RelativeSource AncestorType=local:ElementEditor},Path=Angle}"></RotateTransform>
+ </UserControl.RenderTransform>
+
+ <Grid>
+
+
+ <!--Content-->
+ <Grid IsHitTestVisible="{Binding RelativeSource={RelativeSource AncestorType=local:ElementsEditor},Path=IsEditable,Converter={StaticResource BooleanInverseConverter}}">
+ <Grid>
+ <Border BorderThickness="1" CornerRadius="5" Padding="10">
+ <Border.BorderBrush>
+ <SolidColorBrush Color="{Binding Color}"></SolidColorBrush>
+ </Border.BorderBrush>
+ <DockPanel>
+ <TextBox DockPanel.Dock="Top" FontSize="12" Foreground="#202020" Text="{Binding DisplayName}"></TextBox>
+ <Button DockPanel.Dock="Bottom" Margin="0 10 0 0" Height="40" Command="{Binding PushParametersCommand}">
+ <StackPanel Orientation="Horizontal">
+ <TextBlock Margin="0 0 10 0">PUSH PARAMETERS</TextBlock>
+ <materialDesign:PackIcon VerticalAlignment="Center" Kind="ArrowRightBold"></materialDesign:PackIcon>
+ </StackPanel>
+ </Button>
+ <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
+ <editors:ParameterizedEditor GeneratingItems="ParameterizedEditor_GeneratingItems" Margin="0 10 0 0" ParameterizedObject="{Binding ProcessParameters}">
+ <editors:ParameterizedEditor.ItemsPanel>
+ <ItemsPanelTemplate>
+ <UniformGrid Columns="1" />
+ </ItemsPanelTemplate>
+ </editors:ParameterizedEditor.ItemsPanel>
+ <editors:ParameterizedEditor.DoubleTemplate>
+ <DataTemplate>
+ <Grid Margin="0 2" Focusable="False" Background="Transparent" Style="{StaticResource draggableDroppableGrid}" dragAndDrop:DragAndDropService.Drop="OnProcessParametersDropped" dragAndDrop:DragAndDropService.DraggingSurface="{Binding RelativeSource={RelativeSource AncestorType=editors:ParameterizedEditor},Path=DraggingSurface}">
+ <ContentControl Focusable="False">
+ <DockPanel Focusable="False">
+ <TextBlock Focusable="False" Width="150" FontSize="12" Foreground="#202020" DockPanel.Dock="Left" IsHitTestVisible="False" Margin="0 5 0 5" Text="{Binding Name}"></TextBlock>
+ <mahapps:NumericUpDown FontSize="14" Minimum="0" Margin="0 0 5 0" HorizontalContentAlignment="Left" HideUpDownButtons="True" Maximum="10000" StringFormat="0.0" InterceptArrowKeys="True" InterceptMouseWheel="True" HasDecimals="True" Value="{Binding Value,Mode=TwoWay}" Background="#6EFFFFFF"></mahapps:NumericUpDown>
+ </DockPanel>
+ </ContentControl>
+ </Grid>
+ </DataTemplate>
+ </editors:ParameterizedEditor.DoubleTemplate>
+ </editors:ParameterizedEditor>
+ </ScrollViewer>
+ </DockPanel>
+ </Border>
+ </Grid>
+ </Grid>
+ <!--Content-->
+
+
+ <Border BorderThickness="1" BorderBrush="{Binding RelativeSource={RelativeSource AncestorType=local:ElementEditor},Path=BorderBrush,TargetNullValue={StaticResource BorderBrush},FallbackValue={StaticResource BorderBrush}}" Visibility="{Binding RelativeSource={RelativeSource AncestorType=local:ElementEditor},Path=(local:ElementsEditor.IsSelected),Converter={StaticResource BoolToVisibilityConverter}}">
+ <Grid>
+ <ContentPresenter Content="{Binding RelativeSource={RelativeSource AncestorType=local:ElementEditor},Path=InnerContent}"></ContentPresenter>
+
+ <Thumb Opacity="0" DragDelta="MoveDrag" DragStarted="DragStarted" DragCompleted="OnDragEnded"></Thumb>
+ <Thumb HorizontalAlignment="Left" Cursor="SizeWE" Opacity="0" DragDelta="DragLeft" DragStarted="DragStarted" DragCompleted="OnDragEnded"></Thumb>
+ <Thumb HorizontalAlignment="Right" Cursor="SizeWE" Opacity="0" DragDelta="DragRight" DragStarted="DragStarted" DragCompleted="OnDragEnded"></Thumb>
+ <Thumb VerticalAlignment="Top" Cursor="SizeNS" Opacity="0" DragDelta="DragTop" DragStarted="DragStarted" DragCompleted="OnDragEnded"></Thumb>
+ <Thumb VerticalAlignment="Bottom" Cursor="SizeNS" Opacity="0" DragDelta="DragBottom" DragStarted="DragStarted" DragCompleted="OnDragEnded"></Thumb>
+
+ <Grid ClipToBounds="False" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0 -20 0 0" Width="10" Height="10">
+ <Ellipse Stroke="{Binding RelativeSource={RelativeSource AncestorType=local:ElementEditor},Path=CornersBrush,TargetNullValue={StaticResource CornersBrush},FallbackValue={StaticResource CornersBrush}}" StrokeThickness="2"></Ellipse>
+ <Rectangle HorizontalAlignment="Center" VerticalAlignment="Stretch" Margin="0 10 0 -8" StrokeThickness="1" Stroke="Red"></Rectangle>
+ <Thumb Opacity="0" DragDelta="DragAngle" DragStarted="DragStarted" Cursor="Arrow" DragCompleted="OnDragEnded"></Thumb>
+ </Grid>
+
+ <Grid Width="10" Height="10" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="-8 -8 0 0">
+ <Border BorderBrush="{Binding RelativeSource={RelativeSource AncestorType=local:ElementEditor},Path=CornersBrush,TargetNullValue={StaticResource CornersBrush},FallbackValue={StaticResource CornersBrush}}" BorderThickness="2 2 0 0"></Border>
+ <Thumb Opacity="0" DragDelta="DragTopLeft" DragStarted="DragStarted" Cursor="SizeNWSE" DragCompleted="OnDragEnded"></Thumb>
+ </Grid>
+
+ <Grid Width="10" Height="10" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0 -8 -8 0">
+ <Border BorderBrush="{Binding RelativeSource={RelativeSource AncestorType=local:ElementEditor},Path=CornersBrush,TargetNullValue={StaticResource CornersBrush},FallbackValue={StaticResource CornersBrush}}" BorderThickness="0 2 2 0"></Border>
+ <Thumb Opacity="0" DragDelta="DragTopRight" DragStarted="DragStarted" Cursor="SizeNESW" DragCompleted="OnDragEnded"></Thumb>
+ </Grid>
+
+ <Grid Width="10" Height="10" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0 0 -8 -8">
+ <Border BorderBrush="{Binding RelativeSource={RelativeSource AncestorType=local:ElementEditor},Path=CornersBrush,TargetNullValue={StaticResource CornersBrush},FallbackValue={StaticResource CornersBrush}}" BorderThickness="0 0 2 2"></Border>
+ <Thumb Opacity="0" DragDelta="DragBottomRight" DragStarted="DragStarted" Cursor="SizeNWSE" DragCompleted="OnDragEnded"></Thumb>
+ </Grid>
+
+ <Grid Width="10" Height="10" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="-8 0 0 -8">
+ <Border BorderBrush="{Binding RelativeSource={RelativeSource AncestorType=local:ElementEditor},Path=CornersBrush,TargetNullValue={StaticResource CornersBrush},FallbackValue={StaticResource CornersBrush}}" BorderThickness="2 0 0 2"></Border>
+ <Thumb Opacity="0" DragDelta="DragBottomLeft" DragStarted="DragStarted" Cursor="SizeNESW" DragCompleted="OnDragEnded"></Thumb>
+ </Grid>
+ </Grid>
+ </Border>
+ </Grid>
+</local:ElementEditor>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ProcessParametersElementEditor.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ProcessParametersElementEditor.xaml.cs
new file mode 100644
index 000000000..5f3cda494
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ProcessParametersElementEditor.xaml.cs
@@ -0,0 +1,182 @@
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Markup;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using Tango.Editors;
+using Tango.BL.Entities;
+using Tango.MachineStudio.Technician.TechItems;
+using Tango.Core;
+using static Tango.MachineStudio.Technician.TechItems.ProcessParametersItem;
+using Tango.SharedUI.Editors;
+
+namespace Tango.MachineStudio.Technician.Editors
+{
+ [ContentProperty("InnerContent")]
+ public partial class ProcessParametersElementEditor : ElementEditor
+ {
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ProcessParametersElementEditor"/> class.
+ /// </summary>
+ public ProcessParametersElementEditor()
+ : base()
+ {
+ InitializeComponent();
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ProcessParametersElementEditor"/> class.
+ /// </summary>
+ /// <param name="frameworkElement">The framework element.</param>
+ public ProcessParametersElementEditor(ProcessParametersItem processParametersItem)
+ : this()
+ {
+ ProcessParametersItem = processParametersItem;
+ DataContext = ProcessParametersItem;
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ProcessParametersElementEditor"/> class.
+ /// </summary>
+ /// <param name="frameworkElement">The framework element.</param>
+ /// <param name="bounds">The bounds.</param>
+ public ProcessParametersElementEditor(ProcessParametersItem processParametersItem, Rect bounds)
+ : this(processParametersItem)
+ {
+ Left = bounds.Left;
+ Top = bounds.Top;
+ Width = bounds.Width;
+ Height = bounds.Height;
+ }
+
+ private ProcessParametersItem _processParametersItem;
+
+ public ProcessParametersItem ProcessParametersItem
+ {
+ get { return _processParametersItem; }
+ set { _processParametersItem = value; RaisePropertyChanged(nameof(ProcessParametersItem)); }
+ }
+
+
+ /// <summary>
+ /// Clones this instance.
+ /// </summary>
+ /// <returns></returns>
+ public override IElementEditor Clone()
+ {
+ try
+ {
+ var clonedItem = ProcessParametersItem.Clone() as ProcessParametersItem;
+ ProcessParametersElementEditor cloned = new ProcessParametersElementEditor(clonedItem);
+ cloned.Top = Top;
+ cloned.Left = Left;
+ cloned.Width = Width;
+ cloned.Height = Height;
+ cloned.Angle = Angle;
+ return cloned;
+ }
+ catch (Exception ex)
+ {
+ throw new InvalidOperationException("Could not clone this editor. You may have to create a custom editor and implement a custom Clone method.", ex);
+ }
+ }
+
+ /// <summary>
+ /// Gets the hosted element.
+ /// </summary>
+ [ParameterIgnore]
+ public override Object HostedElement
+ {
+ get { return ProcessParametersItem; }
+ }
+
+ private void OnProcessParametersDropped(object sender, DragAndDrop.DropEventArgs e)
+ {
+ ParameterItem draggedItem = e.Draggable.DataContext as ParameterItem;
+ ParameterItem droppedItem = e.Droppable.DataContext as ParameterItem;
+
+ if (draggedItem != null && droppedItem != null && draggedItem.ParameterizedObject == droppedItem.ParameterizedObject)
+ {
+ var parameters = draggedItem.ParameterizedObject.Parameters;
+
+ var draggedSettingItem = ProcessParametersItem.ParametersIndices.FirstOrDefault(x => x.Name == draggedItem.Name);
+ var droppedSettingItem = ProcessParametersItem.ParametersIndices.FirstOrDefault(x => x.Name == droppedItem.Name);
+
+ if (draggedSettingItem != null && droppedSettingItem != null)
+ {
+ if (draggedSettingItem.Index > droppedSettingItem.Index)
+ {
+ draggedSettingItem.Index = droppedSettingItem.Index - 1;
+ }
+ else
+ {
+ draggedSettingItem.Index = droppedSettingItem.Index + 1;
+ }
+
+ int index = 1;
+
+ foreach (var settingItem in ProcessParametersItem.ParametersIndices.OrderBy(x => x.Index))
+ {
+ settingItem.Index = index++;
+ }
+ }
+ }
+
+ var editor = e.Draggable.FindAncestor<ParameterizedEditor>();
+
+ if (editor != null)
+ {
+ editor.ParameterizedObject = null;
+ editor.ParameterizedObject = draggedItem.ParameterizedObject;
+ }
+ }
+
+ private void ParameterizedEditor_GeneratingItems(object sender, SharedUI.Editors.ParameterizedEditor.GeneratingItemsEventArgs e)
+ {
+ List<ParameterItem> items = e.Result.ToList();
+
+ if (ProcessParametersItem.ParametersIndices.Count > 0)
+ {
+ items.Clear();
+
+ foreach (var item in ProcessParametersItem.ParametersIndices.OrderBy(x => x.Index))
+ {
+ var p = e.Source.SingleOrDefault(x => x.Name == item.Name);
+
+ if (p != null)
+ {
+ items.Add(p);
+ }
+ }
+ }
+ else
+ {
+ ProcessParametersTable p = new ProcessParametersTable();
+ var pp = p.CreateParametersCollection(Core.ParameterItemMode.Binding);
+
+ foreach (var item in pp)
+ {
+ ProcessParametersItem.ParametersIndices.Add(new ParameterIndex()
+ {
+ Index = pp.IndexOf(item),
+ Name = item.Name
+ });
+ }
+ }
+
+ e.Result = items;
+ }
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/SingleGraphElementEditor.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/SingleGraphElementEditor.xaml.cs
index 8ead4b6ee..694aaf5eb 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/SingleGraphElementEditor.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/SingleGraphElementEditor.xaml.cs
@@ -18,6 +18,7 @@ using System.Windows.Shapes;
using Tango.Editors;
using Tango.BL.Entities;
using Tango.MachineStudio.Technician.TechItems;
+using Tango.Core;
namespace Tango.MachineStudio.Technician.Editors
{
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/SpeedSensorElementEditor.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/SpeedSensorElementEditor.xaml.cs
index 2909b52bc..d5855fe70 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/SpeedSensorElementEditor.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/SpeedSensorElementEditor.xaml.cs
@@ -18,6 +18,7 @@ using System.Windows.Shapes;
using Tango.Editors;
using Tango.BL.Entities;
using Tango.MachineStudio.Technician.TechItems;
+using Tango.Core;
namespace Tango.MachineStudio.Technician.Editors
{
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ThreadMotionElementEditor.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ThreadMotionElementEditor.xaml.cs
index 6fca820b6..f5565a796 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ThreadMotionElementEditor.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ThreadMotionElementEditor.xaml.cs
@@ -19,6 +19,7 @@ using System.Windows.Shapes;
using Tango.Editors;
using Tango.BL.Entities;
using Tango.MachineStudio.Technician.TechItems;
+using Tango.Core;
namespace Tango.MachineStudio.Technician.Editors
{
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/WinderElementEditor.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/WinderElementEditor.xaml.cs
index 5ccb05fc5..57aa30872 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/WinderElementEditor.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/WinderElementEditor.xaml.cs
@@ -18,6 +18,7 @@ using System.Windows.Shapes;
using Tango.Editors;
using Tango.BL.Entities;
using Tango.MachineStudio.Technician.TechItems;
+using Tango.Core;
namespace Tango.MachineStudio.Technician.Editors
{
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Images/process-params.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Images/process-params.png
new file mode 100644
index 000000000..f20eeb16c
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Images/process-params.png
Binary files differ
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/ProcessParametersTemplate.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/ProcessParametersTemplate.xaml
new file mode 100644
index 000000000..5e5a6d46d
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/ProcessParametersTemplate.xaml
@@ -0,0 +1,45 @@
+<UserControl x:Class="Tango.MachineStudio.Technician.PropertiesTemplates.ProcessParametersTemplate"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:converters="clr-namespace:Tango.MachineStudio.Technician.Converters"
+ xmlns:sharedConverters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
+ xmlns:items="clr-namespace:Tango.MachineStudio.Technician.TechItems"
+ xmlns:editors="clr-namespace:Tango.SharedUI.Editors;assembly=Tango.SharedUI"
+ xmlns:mahApps="http://metro.mahapps.com/winfx/xaml/controls"
+ xmlns:colorPicker="clr-namespace:Tango;assembly=Tango.ColorPicker"
+ xmlns:local="clr-namespace:Tango.MachineStudio.Technician.PropertiesTemplates"
+ mc:Ignorable="d"
+ d:DesignHeight="500" d:DesignWidth="200" d:DataContext="{d:DesignInstance Type=items:ProcessParametersItem, IsDesignTimeCreatable=False}">
+
+ <UserControl.Resources>
+ <sharedConverters:DoubleToIntConverter x:Key="DoubleToIntConverter" />
+
+ <Style TargetType="{x:Type TabItem}" BasedOn="{StaticResource {x:Type TabItem}}">
+ <Setter Property="mahApps:ControlsHelper.HeaderFontSize" Value="14" />
+ <Setter Property="Margin" Value="2" />
+ </Style>
+ </UserControl.Resources>
+
+ <Grid>
+ <StackPanel>
+ <GroupBox Header="PROCESS PARAMETERS">
+ <StackPanel>
+ <TextBlock FontSize="10">Reset to RML</TextBlock>
+ <ComboBox Margin="0 5 0 0" ItemsSource="{Binding Adapter.RmlsViewSource}" SelectedItem="{Binding SelectedResetRML,Mode=TwoWay}" DisplayMemberPath="Name" />
+
+ <Button Margin="0 10 0 0" Command="{Binding ResetToRMLCommand}">RESET</Button>
+ </StackPanel>
+ </GroupBox>
+
+ <GroupBox Header="COLOR" Margin="0 10 0 0">
+ <StackPanel>
+ <Viewbox Margin="0 5 0 0">
+ <colorPicker:ColorCanvas SelectedColor="{Binding Color,Mode=TwoWay}" Background="Transparent" />
+ </Viewbox>
+ </StackPanel>
+ </GroupBox>
+ </StackPanel>
+ </Grid>
+</UserControl>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/ProcessParametersTemplate.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/ProcessParametersTemplate.xaml.cs
new file mode 100644
index 000000000..e1ad2f4ad
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/ProcessParametersTemplate.xaml.cs
@@ -0,0 +1,28 @@
+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;
+
+namespace Tango.MachineStudio.Technician.PropertiesTemplates
+{
+ /// <summary>
+ /// Interaction logic for MonitorTemplate.xaml
+ /// </summary>
+ public partial class ProcessParametersTemplate : UserControl
+ {
+ public ProcessParametersTemplate()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Tango.MachineStudio.Technician.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Tango.MachineStudio.Technician.csproj
index fb9b8869b..4c596e21e 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Tango.MachineStudio.Technician.csproj
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Tango.MachineStudio.Technician.csproj
@@ -96,6 +96,9 @@
<Compile Include="Editors\ControllerElementEditor.xaml.cs">
<DependentUpon>ControllerElementEditor.xaml</DependentUpon>
</Compile>
+ <Compile Include="Editors\ProcessParametersElementEditor.xaml.cs">
+ <DependentUpon>ProcessParametersElementEditor.xaml</DependentUpon>
+ </Compile>
<Compile Include="Editors\DigitalInElementEditor.xaml.cs">
<DependentUpon>DigitalInElementEditor.xaml</DependentUpon>
</Compile>
@@ -161,6 +164,9 @@
<Compile Include="PropertiesTemplates\DancerTemplate.xaml.cs">
<DependentUpon>DancerTemplate.xaml</DependentUpon>
</Compile>
+ <Compile Include="PropertiesTemplates\ProcessParametersTemplate.xaml.cs">
+ <DependentUpon>ProcessParametersTemplate.xaml</DependentUpon>
+ </Compile>
<Compile Include="PropertiesTemplates\SpeedSensorTemplate.xaml.cs">
<DependentUpon>SpeedSensorTemplate.xaml</DependentUpon>
</Compile>
@@ -192,6 +198,7 @@
<Compile Include="TechItems\MotorActionType.cs" />
<Compile Include="TechItems\DispenserItem.cs" />
<Compile Include="TechItems\DancerItem.cs" />
+ <Compile Include="TechItems\ProcessParametersItem.cs" />
<Compile Include="TechItems\SpeedSensorItem.cs" />
<Compile Include="TechItems\WinderItem.cs" />
<Compile Include="TechItems\PidItem.cs" />
@@ -214,6 +221,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
+ <Page Include="Editors\ProcessParametersElementEditor.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </Page>
<Page Include="Editors\DigitalInElementEditor.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -298,6 +309,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
+ <Page Include="PropertiesTemplates\ProcessParametersTemplate.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </Page>
<Page Include="PropertiesTemplates\SpeedSensorTemplate.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -386,6 +401,10 @@
<Project>{a34ee0f0-649d-41c8-8489-b6f1cc6924ee}</Project>
<Name>Tango.Core</Name>
</ProjectReference>
+ <ProjectReference Include="..\..\..\Tango.DragAndDrop\Tango.DragAndDrop.csproj">
+ <Project>{b112d89a-a106-41ae-a0c1-4abc84c477f5}</Project>
+ <Name>Tango.DragAndDrop</Name>
+ </ProjectReference>
<ProjectReference Include="..\..\..\Tango.Editors\Tango.Editors.csproj">
<Project>{de2f2b86-025b-4f26-83a4-38bd48224ed5}</Project>
<Name>Tango.Editors</Name>
@@ -519,5 +538,8 @@
<ItemGroup>
<Resource Include="Images\speed-big.png" />
</ItemGroup>
+ <ItemGroup>
+ <Resource Include="Images\process-params.png" />
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> \ No newline at end of file
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/ProcessParametersItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/ProcessParametersItem.cs
new file mode 100644
index 000000000..a6d3ae8f0
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/ProcessParametersItem.cs
@@ -0,0 +1,133 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Media;
+using System.Xml.Serialization;
+using Tango.BL.Entities;
+using Tango.Core.Commands;
+using Tango.SharedUI.Helpers;
+
+namespace Tango.MachineStudio.Technician.TechItems
+{
+ /// <summary>
+ /// Represents a process parameters table item.
+ /// </summary>
+ /// <seealso cref="Tango.MachineStudio.Technician.TechItems.TechItem" />
+ [TechItem(20)]
+ public class ProcessParametersItem : TechItem
+ {
+ public class ParameterIndex
+ {
+ public String Name { get; set; }
+ public int Index { get; set; }
+ }
+
+ private static int _counter = 0;
+
+ public event EventHandler<ProcessParametersTable> PushParametersPressed;
+
+ private String _displayName;
+ /// <summary>
+ /// Gets or sets the display name.
+ /// </summary>
+ public String DisplayName
+ {
+ get { return _displayName; }
+ set { _displayName = value; RaisePropertyChangedAuto(); }
+ }
+
+ private ProcessParametersTable _processParameters;
+ /// <summary>
+ /// Gets or sets the process parameters.
+ /// </summary>
+ public ProcessParametersTable ProcessParameters
+ {
+ get { return _processParameters; }
+ set { _processParameters = value; RaisePropertyChangedAuto(); }
+ }
+
+ /// <summary>
+ /// Gets or sets the parameters indices.
+ /// </summary>
+ public List<ParameterIndex> ParametersIndices { get; set; }
+
+ /// <summary>
+ /// Gets or sets the push parameters command.
+ /// </summary>
+ [XmlIgnore]
+ public RelayCommand PushParametersCommand { get; set; }
+
+ private Rml _selectedResetRml;
+ /// <summary>
+ /// Gets or sets the selected reset RML.
+ /// </summary>
+ [XmlIgnore]
+ public Rml SelectedResetRML
+ {
+ get { return _selectedResetRml; }
+ set { _selectedResetRml = value; RaisePropertyChangedAuto(); ResetToRMLCommand.RaiseCanExecuteChanged(); }
+ }
+
+
+ /// <summary>
+ /// Gets or sets the push parameters command.
+ /// </summary>
+ [XmlIgnore]
+ public RelayCommand ResetToRMLCommand { get; set; }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ProcessParametersItem"/> class.
+ /// </summary>
+ public ProcessParametersItem() : base()
+ {
+ ParametersIndices = new List<ParameterIndex>();
+ DisplayName = "Process parameters " + _counter++;
+ Name = "Process Parameters";
+ Description = "Process parameters table";
+ Image = ResourceHelper.GetImageFromResources("Images/process-params.png");
+ ProcessParameters = new ProcessParametersTable();
+ Color = Colors.DodgerBlue;
+ PushParametersCommand = new RelayCommand(() => PushParametersPressed?.Invoke(this, ProcessParameters));
+
+ ResetToRMLCommand = new RelayCommand(ResetToRml, () => SelectedResetRML != null);
+ }
+
+ private void ResetToRml()
+ {
+ if (SelectedResetRML != null)
+ {
+ var group = SelectedResetRML.ProcessParametersTablesGroups.FirstOrDefault(x => x.Active);
+
+ if (group != null)
+ {
+ var table = group.ProcessParametersTables.OrderBy(x => x.TableIndex).FirstOrDefault();
+
+ if (table != null)
+ {
+ ProcessParameters = table.Clone();
+ }
+ }
+ }
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ProcessParametersItem"/> class.
+ /// </summary>
+ /// <param name="processParameters">The process parameters.</param>
+ public ProcessParametersItem(ProcessParametersTable processParameters) : this()
+ {
+
+ }
+
+ public override TechItem Clone()
+ {
+ ProcessParametersItem cloned = base.Clone() as ProcessParametersItem;
+ cloned.ProcessParameters = ProcessParameters.Clone();
+ cloned.ParametersIndices = ParametersIndices.Select(x => new ParameterIndex() { Index = x.Index, Name = x.Name }).ToList();
+ return cloned;
+ }
+
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/TechItem.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/TechItem.cs
index 24ca57a4a..ff75c1644 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/TechItem.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/TechItem.cs
@@ -34,6 +34,7 @@ namespace Tango.MachineStudio.Technician.TechItems
[XmlInclude(typeof(WinderItem))]
[XmlInclude(typeof(DancerItem))]
[XmlInclude(typeof(SpeedSensorItem))]
+ [XmlInclude(typeof(ProcessParametersItem))]
public abstract class TechItem : ExtendedObject
{
/// <summary>
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 381101c7e..41fff94d9 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
@@ -52,7 +52,7 @@ namespace Tango.MachineStudio.Technician.ViewModels
private DateTime _lastDiagnosticsResponseUpdate;
private const int MIN_DIAGNOSTICS_UPDATE_MILI = 500;
private TechnicianModuleSettings _settings;
-
+
#region Properties
@@ -535,6 +535,11 @@ namespace Tango.MachineStudio.Technician.ViewModels
{
CreateElement<SpeedSensorElementEditor, SpeedSensorItem, HardwareSpeedSensorType>(bounds, Adapter.HardwareSpeedSensorTypes.FirstOrDefault());
}
+ else if (item is ProcessParametersItem)
+ {
+ var editor = CreateElement<ProcessParametersElementEditor, ProcessParametersItem, object>(bounds, null);
+ InitProcessParameterItem(editor.ProcessParametersItem);
+ }
}
/// <summary>
@@ -654,6 +659,11 @@ namespace Tango.MachineStudio.Technician.ViewModels
(item as SpeedSensorItem).HardwareSpeedSensorType = Adapter.HardwareSpeedSensorTypes.FirstOrDefault(x => x.Guid == item.ItemGuid);
CreateElement<SpeedSensorElementEditor>(item);
}
+ else if (item is ProcessParametersItem)
+ {
+ var editor = CreateElement<ProcessParametersElementEditor>(item);
+ InitProcessParameterItem(editor.ProcessParametersItem);
+ }
}
/// <summary>
@@ -1139,6 +1149,40 @@ namespace Tango.MachineStudio.Technician.ViewModels
}
/// <summary>
+ /// Initializes the process parameter item.
+ /// </summary>
+ /// <param name="item">The item.</param>
+ private void InitProcessParameterItem(ProcessParametersItem item)
+ {
+ item.PushParametersPressed += async (x, parameters) =>
+ {
+ try
+ {
+ CheckMachineOperator();
+
+ using (_notification.PushTaskItem("Uploading process parameters..."))
+ {
+ try
+ {
+ await MachineOperator.UploadProcessParameters(parameters);
+ }
+ catch (Exception ex)
+ {
+ String msg = "Error uploading process parameters:" + Environment.NewLine + parameters.ToJsonString();
+ _eventLogger.Log(ex,msg);
+ LogManager.Log(ex, msg);
+ _notification.ShowError("Could not upload process parameters." + Environment.NewLine + ex.Message);
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ _notification.ShowError(ex.Message);
+ }
+ };
+ }
+
+ /// <summary>
/// Checks the machine operator.
/// </summary>
/// <exception cref="InvalidOperationException">No machine connected.</exception>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml
index 9843162de..5807341b7 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Views/MachineTechView.xaml
@@ -155,7 +155,7 @@
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0 0 5 10" Height="40">
- <Button Height="Auto" Margin="0 0 10 0" FontSize="12" Command="{Binding ResetHardwareConfigurationCommand}" IsEnabled="{Binding ApplicationManager.IsMachineConnected}" ToolTip="Reset all visual elements to the hardware configuration defined for the current machine">
+ <Button Height="Auto" Margin="0 0 10 0" FontSize="12" Command="{Binding ResetHardwareConfigurationCommand}" ToolTip="Reset all visual elements to the hardware configuration defined for the current machine">
<StackPanel Orientation="Horizontal">
<materialDesign:PackIcon Margin="0 0 2 0" Width="24" Height="24" Kind="Refresh"/>
<TextBlock VerticalAlignment="Center">RESET</TextBlock>
@@ -375,9 +375,12 @@
<ContentControl Margin="0 10 0 0" DataContext="{Binding ElementName=editor,Path=SelectedElement.HostedElement}" Content="{Binding ElementName=editor,Path=SelectedElement.HostedElement}">
<ContentControl.Resources>
<DataTemplate DataType="{x:Type sys:Nullable}">
-
+
+ </DataTemplate>
+ <DataTemplate DataType="{x:Type items:ProcessParametersItem}">
+ <templates:ProcessParametersTemplate/>
</DataTemplate>
- <DataTemplate DataType="{x:Type items:SpeedSensorItem}">
+ <DataTemplate DataType="{x:Type items:SpeedSensorItem}">
<templates:SpeedSensorTemplate/>
</DataTemplate>
<DataTemplate DataType="{x:Type items:DancerItem}">