aboutsummaryrefslogtreecommitdiffstats
path: root/Software
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-07-15 13:22:53 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-07-15 13:22:53 +0300
commitc6b01f3e683b83fb0d6bf080efbd24a9a732b9f5 (patch)
tree900238695f8c1e0e2ea1f5786e3b847fcfa1ba43 /Software
parentdf9b2580669472d446e109dff88bdfa247b23b1e (diff)
downloadTango-c6b01f3e683b83fb0d6bf080efbd24a9a732b9f5.tar.gz
Tango-c6b01f3e683b83fb0d6bf080efbd24a9a732b9f5.zip
Implemented process parameters item on machine studio tech board.
Diffstat (limited to 'Software')
-rw-r--r--Software/DB/Tango.mdfbin75497472 -> 75497472 bytes
-rw-r--r--Software/DB/Tango_log.ldfbin1572864 -> 1572864 bytes
-rw-r--r--Software/Graphics/process-params.pngbin0 -> 1491 bytes
-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
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt2
-rw-r--r--Software/Visual_Studio/Tango.BL/ObservableEntity.cs24
-rw-r--r--Software/Visual_Studio/Tango.Core/IParameterized.cs2
-rw-r--r--Software/Visual_Studio/Tango.Editors/CustomScrollViewer.cs5
-rw-r--r--Software/Visual_Studio/Tango.Editors/ElementEditor.cs1
-rw-r--r--Software/Visual_Studio/Tango.Editors/FrameworkElementEditor.xaml.cs1
-rw-r--r--Software/Visual_Studio/Tango.Editors/IElementEditor.cs1
-rw-r--r--Software/Visual_Studio/Tango.Editors/IParameterized.cs52
-rw-r--r--Software/Visual_Studio/Tango.Editors/IParameterizedExtensions.cs124
-rw-r--r--Software/Visual_Studio/Tango.Editors/ParameterIgnoreAttribute.cs17
-rw-r--r--Software/Visual_Studio/Tango.Editors/ParameterItem.cs152
-rw-r--r--Software/Visual_Studio/Tango.Editors/ParameterItemAttribute.cs140
-rw-r--r--Software/Visual_Studio/Tango.Editors/ParameterItemMode.cs23
-rw-r--r--Software/Visual_Studio/Tango.Editors/Tango.Editors.csproj6
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/Editors/ParameterizedEditor.xaml2
43 files changed, 613 insertions, 534 deletions
diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf
index cd5c2cf3e..67bfef2e9 100644
--- a/Software/DB/Tango.mdf
+++ b/Software/DB/Tango.mdf
Binary files differ
diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf
index 6b75579c8..ef2543dd1 100644
--- a/Software/DB/Tango_log.ldf
+++ b/Software/DB/Tango_log.ldf
Binary files differ
diff --git a/Software/Graphics/process-params.png b/Software/Graphics/process-params.png
new file mode 100644
index 000000000..f20eeb16c
--- /dev/null
+++ b/Software/Graphics/process-params.png
Binary files differ
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}">
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt
index a05a3d84b..5dc121dd6 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Resources/BuildDate.txt
@@ -1 +1 @@
-Sat 07/14/2018 0:58:07.59
+Sun 07/15/2018 13:22:20.95
diff --git a/Software/Visual_Studio/Tango.BL/ObservableEntity.cs b/Software/Visual_Studio/Tango.BL/ObservableEntity.cs
index 41f18bee5..7c82d927b 100644
--- a/Software/Visual_Studio/Tango.BL/ObservableEntity.cs
+++ b/Software/Visual_Studio/Tango.BL/ObservableEntity.cs
@@ -92,8 +92,16 @@ namespace Tango.BL
[ParameterIgnore]
public ReadOnlyObservableCollection<ParameterItem> Parameters
{
- get { return _parameters; }
- set { _parameters = value; RaisePropertyChangedAuto(); }
+ get
+ {
+ if (_parameters == null)
+ {
+ _parameters = new ReadOnlyObservableCollection<ParameterItem>(this.CreateParametersCollection(ParameterItemMode.Binding));
+ }
+
+ return _parameters;
+ }
+ private set { _parameters = value; RaisePropertyChangedAuto(); }
}
/// <summary>
@@ -118,14 +126,6 @@ namespace Tango.BL
(?<=[A-Z])(?=[A-Z][a-z]) |
(?<=[^A-Z])(?=[A-Z]) |
(?<=[A-Za-z])(?=[^A-Za-z])", RegexOptions.IgnorePatternWhitespace);
-
- if (!DesignMode)
- {
- ThreadsHelper.InvokeWhenAvailable(() =>
- {
- Parameters = new ReadOnlyObservableCollection<ParameterItem>(this.CreateParametersCollection(ParameterItemMode.Binding));
- });
- }
}
/// <summary>
@@ -178,7 +178,7 @@ namespace Tango.BL
/// <returns></returns>
public Task SaveAsync(ObservablesContext context)
{
- return Task.Factory.StartNew(() =>
+ return Task.Factory.StartNew(() =>
{
Save(context);
});
@@ -325,7 +325,7 @@ Maybe you have deleted an entity that was no yet inserted into database?", LogCa
/// <param name="context">The context.</param>
public virtual void Validate(ObservablesContext context)
{
-
+
}
public DbSet<T1> GetDbSet<T1>(ObservablesContext context) where T1 : class, IObservableEntity
diff --git a/Software/Visual_Studio/Tango.Core/IParameterized.cs b/Software/Visual_Studio/Tango.Core/IParameterized.cs
index 242d9a147..776a7f926 100644
--- a/Software/Visual_Studio/Tango.Core/IParameterized.cs
+++ b/Software/Visual_Studio/Tango.Core/IParameterized.cs
@@ -18,6 +18,6 @@ namespace Tango.Core
/// </summary>
[ParameterIgnore]
[XmlIgnore]
- ReadOnlyObservableCollection<ParameterItem> Parameters { get; set; }
+ ReadOnlyObservableCollection<ParameterItem> Parameters { get; }
}
}
diff --git a/Software/Visual_Studio/Tango.Editors/CustomScrollViewer.cs b/Software/Visual_Studio/Tango.Editors/CustomScrollViewer.cs
index e70c374ed..87ba8f0ca 100644
--- a/Software/Visual_Studio/Tango.Editors/CustomScrollViewer.cs
+++ b/Software/Visual_Studio/Tango.Editors/CustomScrollViewer.cs
@@ -38,7 +38,10 @@ namespace Tango.Editors
protected override void OnPreviewKeyDown(KeyEventArgs e)
{
- e.Handled = true;
+ if (e.Key == Key.Up || e.Key == Key.Down || e.Key == Key.Right || e.Key == Key.Left)
+ {
+ e.Handled = true;
+ }
}
protected virtual void OnMouseZooming(MouseWheelEventArgs e)
diff --git a/Software/Visual_Studio/Tango.Editors/ElementEditor.cs b/Software/Visual_Studio/Tango.Editors/ElementEditor.cs
index 5d90a2b4c..8dfb9000a 100644
--- a/Software/Visual_Studio/Tango.Editors/ElementEditor.cs
+++ b/Software/Visual_Studio/Tango.Editors/ElementEditor.cs
@@ -13,6 +13,7 @@ using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
+using Tango.Core;
using Tango.Editors;
namespace Tango.Editors
diff --git a/Software/Visual_Studio/Tango.Editors/FrameworkElementEditor.xaml.cs b/Software/Visual_Studio/Tango.Editors/FrameworkElementEditor.xaml.cs
index 655edb27c..7e287676c 100644
--- a/Software/Visual_Studio/Tango.Editors/FrameworkElementEditor.xaml.cs
+++ b/Software/Visual_Studio/Tango.Editors/FrameworkElementEditor.xaml.cs
@@ -15,6 +15,7 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
+using Tango.Core;
using Tango.Editors;
namespace Tango.Editors
diff --git a/Software/Visual_Studio/Tango.Editors/IElementEditor.cs b/Software/Visual_Studio/Tango.Editors/IElementEditor.cs
index dfe539537..eaff358a2 100644
--- a/Software/Visual_Studio/Tango.Editors/IElementEditor.cs
+++ b/Software/Visual_Studio/Tango.Editors/IElementEditor.cs
@@ -5,6 +5,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls.Primitives;
+using Tango.Core;
using Tango.Editors;
namespace Tango.Editors
diff --git a/Software/Visual_Studio/Tango.Editors/IParameterized.cs b/Software/Visual_Studio/Tango.Editors/IParameterized.cs
deleted file mode 100644
index d0a32f209..000000000
--- a/Software/Visual_Studio/Tango.Editors/IParameterized.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Tango.Editors
-{
- /// <summary>
- /// Represents a component that exposes some of it's properties as an observable collection of <see cref="ParameterItem"/> which can be bound to UI controls.
- /// <para>
- /// Use the <see cref="T:WpfVideoTools.Editors.ParameterizedEditor"/> to automatically display and edit the collection of parameters.
- /// </para>
- /// <para>
- /// See
- /// </para>
- /// <list type="bullet">
- /// <item><see cref="T:WpfVideoTools.Editors.ParameterizedEditor"/></item>
- /// <item><see cref="T:WpfVideoTools.Editors.IParameterItemEditor"/></item>
- /// </list>
- /// </summary>
- /// <example>
- /// <para class="example-title">
- /// <img class="exampleIcon" src="../Icons/CodeExample.png" />
- /// <i>
- /// The following example demonstrates how to implement the IParameterized interface, implement a custom parameter editor and use the ParameterizedEditor to display/edit the object.
- /// </i>
- /// </para>
- /// <para><img class="exampleImage" src="../Media/ParameterizedEditorExample.png" /></para>
- /// <i>Implement IParameterized.</i>
- /// <code lang="C#" source="../FullAPIExamples/Examples/Core/IParameterizedExample.cs" title="Implement IParameterized interface." />
- /// <i>Custom editor.</i>
- /// <code lang="XAML" source="../FullAPIExamples/Examples/Core/CustomEditor.xaml" title="Implement custom editor." />
- /// <i>Custom editor code behind.</i>
- /// <code lang="C#" source="../FullAPIExamples/Examples/Core/CustomEditor.xaml.cs" title="Implement custom editor." />
- /// <i>Use the ParameterizedEditor to display the parameterized object.</i>
- /// <code lang="XAML" source="../FullAPIExamples/Examples/Core/ParameterizedEditorExample.xaml" title="Use ParameterizedEditor." />
- /// <i>Code-Behind.</i>
- /// <code lang="C#" source="../FullAPIExamples/Examples/Core/ParameterizedEditorExample.xaml.cs" title="Use ParameterizedEditor." />
- /// </example>
- /// <seealso cref="T:WpfVideoTools.Editors.ParameterizedEditor" />
- /// <seealso cref="T:WpfVideoTools.Editors.IParameterItemEditor" />
- public interface IParameterized
- {
- /// <summary>
- /// Gets a bind-able observable collection of the component properties.
- /// </summary>
- [ParameterIgnore]
- ReadOnlyObservableCollection<ParameterItem> Parameters { get; set; }
- }
-}
diff --git a/Software/Visual_Studio/Tango.Editors/IParameterizedExtensions.cs b/Software/Visual_Studio/Tango.Editors/IParameterizedExtensions.cs
deleted file mode 100644
index d238cd297..000000000
--- a/Software/Visual_Studio/Tango.Editors/IParameterizedExtensions.cs
+++ /dev/null
@@ -1,124 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Linq;
-using System.Reflection;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-using Tango.Editors;
-
-/// <summary>
-/// Contains extension methods for <see cref="IParameterized"/>.
-/// </summary>
-public static class IParameterizedExtensions
-{
- /// <summary>
- /// Creates an observable collection of the parameterized object.
- /// </summary>
- /// <param name="instance">The instance.</param>
- /// <param name="mode">The parameters update mode.</param>
- /// <returns></returns>
- public static ObservableCollection<ParameterItem> CreateParametersCollection(this IParameterized instance, ParameterItemMode mode)
- {
- var ps = new ObservableCollection<ParameterItem>();
-
- int index = 0;
-
- List<Type> types = new List<Type>();
- Type currentType = instance.GetType();
-
- while (true)
- {
- if (typeof(IParameterized).IsAssignableFrom(currentType) && currentType != typeof(IParameterized))
- {
- types.Add(currentType);
- currentType = currentType.BaseType;
- }
- else
- {
- break;
- }
- }
-
- List<PropertyInfo> properties = new List<PropertyInfo>();
-
- foreach (var type in types)
- {
- foreach (var prop in type.GetProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly))
- {
- var paramAtt = prop.GetCustomAttributes(typeof(ParameterItemAttribute), false).Cast<ParameterItemAttribute>().FirstOrDefault();
- var ignore = prop.GetCustomAttributes(typeof(ParameterIgnoreAttribute), false).Cast<ParameterIgnoreAttribute>().FirstOrDefault();
-
- if (ignore == null && !properties.Exists(x => x.Name == prop.Name))
- {
- var item = instance.CreateParameterItem(prop, paramAtt, index++, mode);
- ps.Add(item);
- properties.Add(prop);
- }
- }
- }
-
- return ps;
- }
-
- /// <summary>
- /// Creates the parameter item.
- /// </summary>
- /// <param name="instance">The instance.</param>
- /// <param name="propertyInfo">The property information.</param>
- /// <param name="attribute">The attribute.</param>
- /// <param name="index">The index.</param>
- /// <param name="mode">The mode.</param>
- /// <returns></returns>
- public static ParameterItem CreateParameterItem(this IParameterized instance, PropertyInfo propertyInfo, ParameterItemAttribute attribute, int index, ParameterItemMode mode)
- {
- ParameterItem item = new ParameterItem();
- item.Name = propertyInfo.Name.ToTitle();
- item.Index = index;
- item.Type = propertyInfo.PropertyType;
- item.Value = propertyInfo.GetValue(instance, null);
-
- if (attribute != null)
- {
- item.Minimum = attribute.Minimum;
- item.Maximum = attribute.Maximum;
- item.CustomEditorTypeName = attribute.CustomEditorTypeName;
- item.ExtraObject = attribute.ExtraObject;
-
- if (attribute.Name != null)
- {
- item.Name = attribute.Name;
- }
- }
-
- if (mode == ParameterItemMode.Event)
- {
- item.ParameterValueChanged += (sender, e) =>
- {
- propertyInfo.SetValue(instance, e.Value);
- };
- }
- else if (mode == ParameterItemMode.Binding)
- {
- item.Bind(ParameterItem.ValueProperty, instance as DependencyObject, propertyInfo.Name, System.Windows.Data.BindingMode.TwoWay);
- }
-
- return item;
- }
-
- /// <summary>
- /// Creates the parameter item.
- /// </summary>
- /// <param name="instance">The instance.</param>
- /// <param name="propertyName">Name of the property.</param>
- /// <param name="attribute">The attribute.</param>
- /// <param name="index">The index.</param>
- /// <param name="mode">The mode.</param>
- /// <returns></returns>
- public static ParameterItem CreateParameterItem(this IParameterized instance, String propertyName, ParameterItemAttribute attribute, int index, ParameterItemMode mode)
- {
- return instance.CreateParameterItem(instance.GetType().GetProperty(propertyName), attribute, index, mode);
- }
-}
-
diff --git a/Software/Visual_Studio/Tango.Editors/ParameterIgnoreAttribute.cs b/Software/Visual_Studio/Tango.Editors/ParameterIgnoreAttribute.cs
deleted file mode 100644
index f94f7d354..000000000
--- a/Software/Visual_Studio/Tango.Editors/ParameterIgnoreAttribute.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Tango.Editors
-{
- /// <summary>
- /// Represents an attribute for specifying properties to ignore as parameters.
- /// </summary>
- /// <seealso cref="System.Attribute" />
- public class ParameterIgnoreAttribute : Attribute
- {
-
- }
-}
diff --git a/Software/Visual_Studio/Tango.Editors/ParameterItem.cs b/Software/Visual_Studio/Tango.Editors/ParameterItem.cs
deleted file mode 100644
index 4f08d25d6..000000000
--- a/Software/Visual_Studio/Tango.Editors/ParameterItem.cs
+++ /dev/null
@@ -1,152 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-
-namespace Tango.Editors
-{
- /// <summary>
- /// Represents a component parameter name and value which can be bound to UI elements.
- /// </summary>
- /// <seealso cref="System.Windows.DependencyObject" />
- public class ParameterItem : DependencyObject
- {
- /// <summary>
- /// Occurs when the parameter value has changed.
- /// </summary>
- public event EventHandler<ParameterItem> ParameterValueChanged;
-
- /// <summary>
- /// Gets or sets the parameter index.
- /// </summary>
- public int Index
- {
- get { return (int)GetValue(IndexProperty); }
- set { SetValue(IndexProperty, value); }
- }
- public static readonly DependencyProperty IndexProperty =
- DependencyProperty.Register("Index", typeof(int), typeof(ParameterItem), new PropertyMetadata(0));
-
- /// <summary>
- /// Gets or sets the parameter value type.
- /// </summary>
- public Type Type
- {
- get { return (Type)GetValue(TypeProperty); }
- set { SetValue(TypeProperty, value); }
- }
- public static readonly DependencyProperty TypeProperty =
- DependencyProperty.Register("Type", typeof(Type), typeof(ParameterItem), new PropertyMetadata(typeof(double)));
-
-
- /// <summary>
- /// Gets or sets the parameter name.
- /// </summary>
- public String Name
- {
- get { return (String)GetValue(NameProperty); }
- set { SetValue(NameProperty, value); }
- }
- public static readonly DependencyProperty NameProperty =
- DependencyProperty.Register("Name", typeof(String), typeof(ParameterItem), new PropertyMetadata(null));
-
- /// <summary>
- /// Gets or sets the current parameter value.
- /// </summary>
- public object Value
- {
- get { return (object)GetValue(ValueProperty); }
- set { SetValue(ValueProperty, value); }
- }
- public static readonly DependencyProperty ValueProperty =
- DependencyProperty.Register("Value", typeof(object), typeof(ParameterItem), new PropertyMetadata(null, new PropertyChangedCallback(OnValueChanged)));
-
-
- /// <summary>
- /// Gets or sets the minimum parameter value.
- /// </summary>
- public object Minimum
- {
- get { return (object)GetValue(MinimumProperty); }
- set { SetValue(MinimumProperty, value); }
- }
- public static readonly DependencyProperty MinimumProperty =
- DependencyProperty.Register("Minimum", typeof(object), typeof(ParameterItem), new PropertyMetadata(0.0d));
-
-
- /// <summary>
- /// Gets or sets the maximum parameter value.
- /// </summary>
- public object Maximum
- {
- get { return (object)GetValue(MaximumProperty); }
- set { SetValue(MaximumProperty, value); }
- }
- public static readonly DependencyProperty MaximumProperty =
- DependencyProperty.Register("Maximum", typeof(object), typeof(ParameterItem), new PropertyMetadata(1.0d));
-
-
- /// <summary>
- /// Gets or sets an optional extra object.
- /// </summary>
- public object ExtraObject
- {
- get { return (object)GetValue(ExtraObjectProperty); }
- set { SetValue(ExtraObjectProperty, value); }
- }
- public static readonly DependencyProperty ExtraObjectProperty =
- DependencyProperty.Register("ExtraObject", typeof(object), typeof(ParameterItem), new PropertyMetadata(null));
-
-
- /// <summary>
- /// Gets or sets an optional custom editor.
- /// </summary>
- public String CustomEditorTypeName
- {
- get { return (String)GetValue(CustomEditorTypeNameProperty); }
- set { SetValue(CustomEditorTypeNameProperty, value); }
- }
- public static readonly DependencyProperty CustomEditorTypeNameProperty =
- DependencyProperty.Register("CustomEditorType", typeof(String), typeof(ParameterItem), new PropertyMetadata(null));
-
-
- /// <summary>
- /// Gets a value indicating whether this instance requires custom editor.
- /// </summary>
- public bool HasCustomEditor
- {
- get { return CustomEditorTypeName != null; }
- }
-
- /// <summary>
- /// Called when value has changed.
- /// </summary>
- /// <param name="d">The d.</param>
- /// <param name="e">The <see cref="DependencyPropertyChangedEventArgs"/> instance containing the event data.</param>
- private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- (d as ParameterItem).OnParameterChanged();
- }
-
- /// <summary>
- /// Called when the parameter value has changed.
- /// </summary>
- protected virtual void OnParameterChanged()
- {
- if (ParameterValueChanged != null) ParameterValueChanged(this, this);
- }
-
- /// <summary>
- /// Returns a <see cref="System.String" /> that represents this instance.
- /// </summary>
- /// <returns>
- /// A <see cref="System.String" /> that represents this instance.
- /// </returns>
- public override string ToString()
- {
- return Name;
- }
- }
-}
diff --git a/Software/Visual_Studio/Tango.Editors/ParameterItemAttribute.cs b/Software/Visual_Studio/Tango.Editors/ParameterItemAttribute.cs
deleted file mode 100644
index c914dd156..000000000
--- a/Software/Visual_Studio/Tango.Editors/ParameterItemAttribute.cs
+++ /dev/null
@@ -1,140 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Tango.Editors
-{
- /// <summary>
- /// Represents a parameter item attribute for used for default, min and max values definition of properties.
- /// </summary>
- /// <seealso cref="System.Attribute" />
- public class ParameterItemAttribute : Attribute
- {
- /// <summary>
- /// Gets or sets the custom parameter name.
- /// </summary>
- public String Name { get; set; }
-
- /// <summary>
- /// Gets or sets the default value.
- /// </summary>
- public object Default { get; set; }
-
- /// <summary>
- /// Gets or sets the minimum value.
- /// </summary>
- public object Minimum { get; set; }
-
- /// <summary>
- /// Gets or sets the maximum value.
- /// </summary>
- public object Maximum { get; set; }
-
- /// <summary>
- /// Gets or sets an optional extra object.
- /// </summary>
- public object ExtraObject { get; set; }
-
- /// <summary>
- /// Gets or sets an optional custom editor type name.
- /// </summary>
- public String CustomEditorTypeName { get; set; }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="ParameterItemAttribute"/> class.
- /// </summary>
- public ParameterItemAttribute()
- {
- Default = null;
- Minimum = 0.0d;
- Maximum = 1.0d;
- }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="ParameterItemAttribute"/> class.
- /// </summary>
- /// <param name="name">The name.</param>
- /// <param name="minimumValue">The minimum value.</param>
- /// <param name="maximumValue">The maximum value.</param>
- /// <param name="defaultValue">The default value.</param>
- public ParameterItemAttribute(String name, object minimumValue, object maximumValue, object defaultValue) : this()
- {
- Name = name;
- Default = defaultValue;
- Minimum = minimumValue;
- Maximum = maximumValue;
- }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="ParameterItemAttribute"/> class.
- /// </summary>
- /// <param name="name">The name.</param>
- /// <param name="minimumValue">The minimum value.</param>
- /// <param name="maximumValue">The maximum value.</param>
- public ParameterItemAttribute(String name, object minimumValue, double maximumValue) : this(name, minimumValue, maximumValue, null)
- {
-
- }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="ParameterItemAttribute"/> class.
- /// </summary>
- /// <param name="minimumValue">The minimum value.</param>
- /// <param name="maximumValue">The maximum value.</param>
- public ParameterItemAttribute(object minimumValue, object maximumValue) : this()
- {
- Minimum = minimumValue;
- Maximum = maximumValue;
- }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="ParameterItemAttribute"/> class.
- /// </summary>
- /// <param name="customParameterEditorTypeName">Type of the custom parameter editor type name.</param>
- public ParameterItemAttribute(String customParameterEditorTypeName) : this()
- {
- CustomEditorTypeName = customParameterEditorTypeName;
- }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="ParameterItemAttribute"/> class.
- /// </summary>
- /// <param name="name">The name.</param>
- /// <param name="customParameterEditorTypeName">Name of the custom parameter editor type.</param>
- /// <param name="minimumValue">The minimum value.</param>
- /// <param name="maximumValue">The maximum value.</param>
- /// <param name="defaultValue">The default value.</param>
- /// <param name="extraObject">The extra object.</param>
- public ParameterItemAttribute(String name, String customParameterEditorTypeName, object minimumValue, object maximumValue, object defaultValue, object extraObject) : this()
- {
- Name = name;
- Minimum = minimumValue;
- Maximum = maximumValue;
- Default = defaultValue;
- CustomEditorTypeName = customParameterEditorTypeName;
- ExtraObject = extraObject;
- }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="ParameterItemAttribute"/> class.
- /// </summary>
- /// <param name="name">The name.</param>
- /// <param name="customParameterEditorTypeName">Custom parameter editor type.</param>
- /// <param name="minimumValue">The minimum value.</param>
- /// <param name="maximumValue">The maximum value.</param>
- /// <param name="defaultValue">The default value.</param>
- /// <param name="extraObject">The extra object.</param>
- public ParameterItemAttribute(String name, Type customParameterEditorType, object minimumValue, object maximumValue, object defaultValue, object extraObject)
- : this()
- {
- Name = name;
- Minimum = minimumValue;
- Maximum = maximumValue;
- Default = defaultValue;
- CustomEditorTypeName = customParameterEditorType.AssemblyQualifiedName;
- ExtraObject = extraObject;
- }
- }
-}
diff --git a/Software/Visual_Studio/Tango.Editors/ParameterItemMode.cs b/Software/Visual_Studio/Tango.Editors/ParameterItemMode.cs
deleted file mode 100644
index 2c3ed373c..000000000
--- a/Software/Visual_Studio/Tango.Editors/ParameterItemMode.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Tango.Editors
-{
- /// <summary>
- /// Represents a <see cref="ParameterItem"/> update mode.
- /// </summary>
- public enum ParameterItemMode
- {
- /// <summary>
- /// Update by binding.
- /// </summary>
- Binding,
- /// <summary>
- /// Update by event.
- /// </summary>
- Event
- }
-}
diff --git a/Software/Visual_Studio/Tango.Editors/Tango.Editors.csproj b/Software/Visual_Studio/Tango.Editors/Tango.Editors.csproj
index 5cb0f7b1d..a328e47b7 100644
--- a/Software/Visual_Studio/Tango.Editors/Tango.Editors.csproj
+++ b/Software/Visual_Studio/Tango.Editors/Tango.Editors.csproj
@@ -69,13 +69,7 @@
<DependentUpon>CanvasItemEditor.xaml</DependentUpon>
</None>
<Compile Include="FrameworkElementExtensions.cs" />
- <Compile Include="IParameterized.cs" />
- <Compile Include="IParameterizedExtensions.cs" />
<Compile Include="ObjectExtensions.cs" />
- <Compile Include="ParameterIgnoreAttribute.cs" />
- <Compile Include="ParameterItem.cs" />
- <Compile Include="ParameterItemAttribute.cs" />
- <Compile Include="ParameterItemMode.cs" />
<Compile Include="UIElementExtension.cs" />
<Compile Include="UIHelper.cs" />
<Compile Include="UndoRedoStatesProviderBase.cs" />
diff --git a/Software/Visual_Studio/Tango.SharedUI/Editors/ParameterizedEditor.xaml b/Software/Visual_Studio/Tango.SharedUI/Editors/ParameterizedEditor.xaml
index f9ffa762e..679b9f953 100644
--- a/Software/Visual_Studio/Tango.SharedUI/Editors/ParameterizedEditor.xaml
+++ b/Software/Visual_Studio/Tango.SharedUI/Editors/ParameterizedEditor.xaml
@@ -26,7 +26,7 @@
<ItemsControl x:Name="itemsControl" ItemsPanel="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=ItemsPanel}" ItemsSource="{Binding RelativeSource={RelativeSource AncestorType=local:ParameterizedEditor},Path=Parameters}" HorizontalContentAlignment="Stretch">
<ItemsControl.ItemTemplate>
<DataTemplate>
- <ContentControl Content="{Binding}">
+ <ContentControl Content="{Binding}" Focusable="False">
<ContentControl.Style>
<Style TargetType="ContentControl">
<Setter Property="ContentTemplate" Value="{StaticResource nullTemplate}">