aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-02-27 14:25:58 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-02-27 14:25:58 +0200
commit7d61c30b400b62069d1e69893ebe196412b2df2b (patch)
treee0a0655f153972f7db3efb5821d04926f020d489 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB
parent0157053d3ab06d5fbf2777150bb12a9a35bd7368 (diff)
downloadTango-7d61c30b400b62069d1e69893ebe196412b2df2b.tar.gz
Tango-7d61c30b400b62069d1e69893ebe196412b2df2b.zip
Added PID Control.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj15
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs10
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/PidControlsViewVM.cs19
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/PidControlView.xaml73
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/PidControlView.xaml.cs28
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/PidControlsView.xaml48
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/PidControlsView.xaml.cs32
7 files changed, 225 insertions, 0 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj
index 189c7ee0d..fa567697d 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj
@@ -134,6 +134,7 @@
<Compile Include="ViewModels\MultiComboVM.cs" />
<Compile Include="ViewModels\OrganizationsViewVM.cs" />
<Compile Include="ViewModels\PermissionsViewVM.cs" />
+ <Compile Include="ViewModels\PidControlsViewVM.cs" />
<Compile Include="ViewModels\ProcessParametersTablesViewVM.cs" />
<Compile Include="ViewModels\ProcessParametersTablesGroupsViewVM.cs" />
<Compile Include="ViewModels\RmlsViewVM.cs" />
@@ -148,9 +149,15 @@
<Compile Include="Views\DBViews\ActionTypeView.xaml.cs">
<DependentUpon>ActionTypeView.xaml</DependentUpon>
</Compile>
+ <Compile Include="Views\DBViews\PidControlsView.xaml.cs">
+ <DependentUpon>PidControlsView.xaml</DependentUpon>
+ </Compile>
<Compile Include="Views\DBViews\DancerTypesView.xaml.cs">
<DependentUpon>DancerTypesView.xaml</DependentUpon>
</Compile>
+ <Compile Include="Views\DBViews\PidControlView.xaml.cs">
+ <DependentUpon>PidControlView.xaml</DependentUpon>
+ </Compile>
<Compile Include="Views\DBViews\DancerTypeView.xaml.cs">
<DependentUpon>DancerTypeView.xaml</DependentUpon>
</Compile>
@@ -402,10 +409,18 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
+ <Page Include="Views\DBViews\PidControlsView.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </Page>
<Page Include="Views\DBViews\DancerTypesView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
+ <Page Include="Views\DBViews\PidControlView.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </Page>
<Page Include="Views\DBViews\DancerTypeView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs
index 13fd85122..0889be54e 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs
@@ -67,6 +67,8 @@ namespace Tango.MachineStudio.DB
SimpleIoc.Default.Register<DancerTypesViewVM>();
SimpleIoc.Default.Register<HardwareVersionsDancerTypeViewVM>();
SimpleIoc.Default.Register<HardwareVersionsMotorTypesViewVM>();
+
+ SimpleIoc.Default.Register<PidControlsViewVM>();
}
public static MainViewVM MainViewVM
@@ -404,5 +406,13 @@ namespace Tango.MachineStudio.DB
return ServiceLocator.Current.GetInstance<HardwareVersionsMotorTypesViewVM>();
}
}
+
+ public static PidControlsViewVM PidControlsViewVM
+ {
+ get
+ {
+ return ServiceLocator.Current.GetInstance<PidControlsViewVM>();
+ }
+ }
}
} \ No newline at end of file
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/PidControlsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/PidControlsViewVM.cs
new file mode 100644
index 000000000..7fe342da5
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/PidControlsViewVM.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.Integration.Observables;
+using Tango.MachineStudio.Common.Notifications;
+using Tango.SharedUI;
+
+namespace Tango.MachineStudio.DB.ViewModels
+{
+ public class PidControlsViewVM : DbTableViewModel<PidControl>
+ {
+ public PidControlsViewVM(INotificationProvider notification) : base(notification)
+ {
+
+ }
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/PidControlView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/PidControlView.xaml
new file mode 100644
index 000000000..5459fbbff
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/PidControlView.xaml
@@ -0,0 +1,73 @@
+<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.PidControlView"
+ 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:mahapps="http://metro.mahapps.com/winfx/xaml/controls"
+ xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls"
+ xmlns:colorPicker="clr-namespace:Tango;assembly=Tango.ColorPicker"
+ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
+ xmlns:vm="clr-namespace:Tango.MachineStudio.DB.ViewModels"
+ xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews"
+ mc:Ignorable="d"
+ d:DesignHeight="400" d:DesignWidth="300" d:DataContext="{d:DesignInstance Type=vm:PidControlsViewVM, IsDesignTimeCreatable=False}">
+
+ <Grid>
+ <controls:TableGrid>
+ <TextBlock Text="ID:" FontWeight="Bold"></TextBlock>
+ <TextBox Text="{Binding EditEntity.ID}" IsReadOnly="True"></TextBox>
+ <TextBlock Text="GUID:" FontWeight="Bold"></TextBlock>
+ <TextBox Text="{Binding EditEntity.Guid}" IsReadOnly="True"></TextBox>
+ <TextBlock Text="Last Updated:" FontWeight="Bold"></TextBlock>
+ <TextBox Text="{Binding EditEntity.LastUpdated}" IsReadOnly="True"></TextBox>
+ <TextBlock Text="Code:" FontWeight="Bold"></TextBlock>
+ <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding EditEntity.Code,Mode=TwoWay}"></mahapps:NumericUpDown>
+ <TextBlock Text="Name:" FontWeight="Bold"></TextBlock>
+ <TextBox Text="{Binding EditEntity.Name,Mode=TwoWay}"></TextBox>
+ <TextBlock Text="Description:" FontWeight="Bold"></TextBlock>
+ <TextBox Text="{Binding EditEntity.Description,Mode=TwoWay}"></TextBox>
+
+ <TextBlock Text="Output Proportional Power Limit:" FontWeight="Bold"></TextBlock>
+ <mahapps:NumericUpDown Minimum="0" Maximum="10000" Value="{Binding EditEntity.OutputProportionalPowerLimit,Mode=TwoWay}" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left"></mahapps:NumericUpDown>
+
+ <TextBlock Text="Output Proportional Band:" FontWeight="Bold"></TextBlock>
+ <mahapps:NumericUpDown Minimum="0" Maximum="10000" Value="{Binding EditEntity.OutputProportionalBand,Mode=TwoWay}" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left"></mahapps:NumericUpDown>
+
+ <TextBlock Text="Integral Time:" FontWeight="Bold"></TextBlock>
+ <mahapps:NumericUpDown Minimum="0" Maximum="10000" Value="{Binding EditEntity.IntegralTime,Mode=TwoWay}" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left"></mahapps:NumericUpDown>
+
+ <TextBlock Text="Derivative Time:" FontWeight="Bold"></TextBlock>
+ <mahapps:NumericUpDown Minimum="0" Maximum="10000" Value="{Binding EditEntity.DerivativeTime,Mode=TwoWay}" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left"></mahapps:NumericUpDown>
+
+ <TextBlock Text="Sensor Correction Adjustment:" FontWeight="Bold"></TextBlock>
+ <mahapps:NumericUpDown Minimum="0" Maximum="10000" Value="{Binding EditEntity.SensorCorrectionAdjustment,Mode=TwoWay}" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left"></mahapps:NumericUpDown>
+
+ <TextBlock Text="Sensor Min Value:" FontWeight="Bold"></TextBlock>
+ <mahapps:NumericUpDown Minimum="0" Maximum="10000" Value="{Binding EditEntity.SensorMinValue,Mode=TwoWay}" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left"></mahapps:NumericUpDown>
+
+ <TextBlock Text="Sensor Max Value:" FontWeight="Bold"></TextBlock>
+ <mahapps:NumericUpDown Minimum="0" Maximum="10000" Value="{Binding EditEntity.SensorMaxValue,Mode=TwoWay}" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left"></mahapps:NumericUpDown>
+
+ <TextBlock Text="SetPoint Ramp Rateor Soft Start Ramp:" FontWeight="Bold"></TextBlock>
+ <mahapps:NumericUpDown Minimum="0" Maximum="10000" Value="{Binding EditEntity.SetPointRampRateorSoftStartRamp,Mode=TwoWay}" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left"></mahapps:NumericUpDown>
+
+ <TextBlock Text="Set Point Control Output Rate:" FontWeight="Bold"></TextBlock>
+ <mahapps:NumericUpDown Minimum="0" Maximum="10000" Value="{Binding EditEntity.SetPointControlOutputRate,Mode=TwoWay}" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left"></mahapps:NumericUpDown>
+
+ <TextBlock Text="Control Output Type:" FontWeight="Bold"></TextBlock>
+ <mahapps:NumericUpDown Minimum="0" Maximum="10000" Value="{Binding EditEntity.ControlOutputType,Mode=TwoWay}" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left"></mahapps:NumericUpDown>
+
+ <TextBlock Text="SSR Control Output Type:" FontWeight="Bold"></TextBlock>
+ <mahapps:NumericUpDown Minimum="0" Maximum="10000" Value="{Binding EditEntity.SsrControlOutputType,Mode=TwoWay}" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left"></mahapps:NumericUpDown>
+
+ <TextBlock Text="Output On/Off Hysteresis Value:" FontWeight="Bold"></TextBlock>
+ <mahapps:NumericUpDown Minimum="0" Maximum="10000" Value="{Binding EditEntity.OutputOnOffHysteresisValue,Mode=TwoWay}" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left"></mahapps:NumericUpDown>
+
+ <TextBlock Text="Process Variable Sampling Rate:" FontWeight="Bold"></TextBlock>
+ <mahapps:NumericUpDown Minimum="0" Maximum="10000" Value="{Binding EditEntity.ProcessVariableSamplingRate,Mode=TwoWay}" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left"></mahapps:NumericUpDown>
+
+ <TextBlock Text="PV Input Filter Factor Mode:" FontWeight="Bold"></TextBlock>
+ <mahapps:NumericUpDown Minimum="0" Maximum="10000" Value="{Binding EditEntity.PvInputFilterFactorMode,Mode=TwoWay}" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left"></mahapps:NumericUpDown>
+ </controls:TableGrid>
+ </Grid>
+</UserControl>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/PidControlView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/PidControlView.xaml.cs
new file mode 100644
index 000000000..df45fb1ff
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/PidControlView.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.DB.Views.DBViews
+{
+ /// <summary>
+ /// Interaction logic for MachineView.xaml
+ /// </summary>
+ public partial class PidControlView : UserControl
+ {
+ public PidControlView()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/PidControlsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/PidControlsView.xaml
new file mode 100644
index 000000000..0a7d6d4df
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/PidControlsView.xaml
@@ -0,0 +1,48 @@
+<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.PidControlsView"
+ 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:global="clr-namespace:Tango.MachineStudio.DB"
+ xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls"
+ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
+ xmlns:observables="clr-namespace:Tango.Integration.Observables;assembly=Tango.Integration"
+ xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
+ mc:Ignorable="d"
+ d:DesignHeight="720" d:DesignWidth="1280" Background="White" d:DataContext="{d:DesignInstance Type=observables:PidControl, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.PidControlsViewVM}">
+
+ <UserControl.Resources>
+ <converters:BooleanToYesNoConverter x:Key="BooleanToYesNoConverter" />
+ </UserControl.Resources>
+
+ <Grid>
+ <controls:DbTableView>
+ <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.PidControlsViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsReadOnly="True">
+ <DataGrid.Columns>
+ <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn>
+ <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn>
+ <DataGridTextColumn Header="Code" Binding="{Binding Code}"></DataGridTextColumn>
+ <DataGridTextColumn Header="Name" Binding="{Binding Name}"></DataGridTextColumn>
+
+ <DataGridTextColumn Header="Description" Binding="{Binding Description}"></DataGridTextColumn>
+ <DataGridTextColumn Header="Output Proportional Power Limit" Binding="{Binding OutputProportionalPowerLimit}"></DataGridTextColumn>
+ <DataGridTextColumn Header="Output Proportional Band" Binding="{Binding OutputProportionalBand}"></DataGridTextColumn>
+
+ <DataGridTextColumn Header="Integral Time" Binding="{Binding IntegralTime}"></DataGridTextColumn>
+ <DataGridTextColumn Header="Derivative Time" Binding="{Binding DerivativeTime}"></DataGridTextColumn>
+ <DataGridTextColumn Header="Sensor Correction Adjustment" Binding="{Binding SensorCorrectionAdjustment}"></DataGridTextColumn>
+ <DataGridTextColumn Header="Sensor Min Value" Binding="{Binding SensorMinValue}"></DataGridTextColumn>
+ <DataGridTextColumn Header="Sensor Max Value" Binding="{Binding SensorMaxValue}"></DataGridTextColumn>
+ <DataGridTextColumn Header="SetPoint Ramp Rateor Soft Start Ramp" Binding="{Binding SetPointRampRateorSoftStartRamp}"></DataGridTextColumn>
+ <DataGridTextColumn Header="Set Point Control Output Rate" Binding="{Binding SetPointControlOutputRate}"></DataGridTextColumn>
+ <DataGridTextColumn Header="Control Output Type" Binding="{Binding ControlOutputType}"></DataGridTextColumn>
+
+ <DataGridTextColumn Header="SSR Control Output Type" Binding="{Binding SsrControlOutputType}"></DataGridTextColumn>
+ <DataGridTextColumn Header="Output On/Off Hysteresis Value" Binding="{Binding OutputOnOffHysteresisValue}"></DataGridTextColumn>
+ <DataGridTextColumn Header="Process Variable Sampling Rate" Binding="{Binding ProcessVariableSamplingRate}"></DataGridTextColumn>
+ <DataGridTextColumn Header="PV Input Filter Factor Mode" Binding="{Binding PvInputFilterFactorMode}"></DataGridTextColumn>
+ </DataGrid.Columns>
+ </DataGrid>
+ </controls:DbTableView>
+ </Grid>
+</UserControl>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/PidControlsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/PidControlsView.xaml.cs
new file mode 100644
index 000000000..9ac44d396
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/PidControlsView.xaml.cs
@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using Tango.MachineStudio.DB.CustomAttributes;
+using Tango.MachineStudio.DB.Managers;
+using Tango.SharedUI.Controls;
+
+namespace Tango.MachineStudio.DB.Views.DBViews
+{
+ /// <summary>
+ /// Interaction logic for MachinesView.xaml
+ /// </summary>
+ [DBView]
+ public partial class PidControlsView : UserControl
+ {
+ public PidControlsView() : base()
+ {
+ InitializeComponent();
+ }
+ }
+}