diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-02-26 15:29:37 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-02-26 15:29:37 +0200 |
| commit | 76fd65594e3c7434be615036ea569a1f8907a648 (patch) | |
| tree | dce0fd8c3214af20e15ea34586b39d1a9280c8b1 /Software/Visual_Studio/MachineStudio/Modules | |
| parent | 6549d8672a93893599e921d9f1938af7dcabb8bf (diff) | |
| download | Tango-76fd65594e3c7434be615036ea569a1f8907a648.tar.gz Tango-76fd65594e3c7434be615036ea569a1f8907a648.zip | |
Added DB Tables.
TECH_HEATERS
DANCER_TYPES
MOTOR_TYPES
HARDWARE_VERSIONS_MOTOR_TYPES
HARDWARE_VERSIONS_DANCER_TYPES
Implemented Dancers & motors on DB Module.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules')
17 files changed, 541 insertions, 0 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Converters/EntityFieldNameToFriendlyStringConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Converters/EntityFieldNameToFriendlyStringConverter.cs new file mode 100644 index 000000000..4c4228174 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Converters/EntityFieldNameToFriendlyStringConverter.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; + +namespace Tango.MachineStudio.DB.Converters +{ + public class EntityFieldNameToFriendlyStringConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value != null) + { + String input = value.ToString(); + String output = String.Empty; + + foreach (var c in input) + { + if (char.IsUpper(c) && input.IndexOf(c) > 0) + { + output += " "; + } + + output += c; + } + + return output; + } + return value; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} 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 aa33f9a20..189c7ee0d 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 @@ -88,6 +88,7 @@ </ItemGroup> <ItemGroup> <Compile Include="Converters\ByteArrayToFileSizeConverter.cs" /> + <Compile Include="Converters\EntityFieldNameToFriendlyStringConverter.cs" /> <Compile Include="Converters\EventTypeActionsToStringConverter.cs" /> <Compile Include="Converters\LiquidTypeRmlsToStringConverter.cs" /> <Compile Include="Converters\RolesPermissionsToStringConverter.cs" /> @@ -105,6 +106,7 @@ <Compile Include="ViewModels\CctsViewVM.cs" /> <Compile Include="ViewModels\ConfigurationsViewVM.cs" /> <Compile Include="ViewModels\ContactsViewVM.cs" /> + <Compile Include="ViewModels\DancerTypesViewVM.cs" /> <Compile Include="ViewModels\DbTableViewModel.cs" /> <Compile Include="ViewModels\DialogOpenMode.cs" /> <Compile Include="ViewModels\DispenserTypesViewVM.cs" /> @@ -113,6 +115,8 @@ <Compile Include="ViewModels\EventTypesViewVM.cs" /> <Compile Include="ViewModels\FiberShapesViewVM.cs" /> <Compile Include="ViewModels\FiberSynthsViewVM.cs" /> + <Compile Include="ViewModels\HardwareVersionsDancerTypeViewVM.cs" /> + <Compile Include="ViewModels\HardwareVersionsMotorTypesViewVM.cs" /> <Compile Include="ViewModels\HardwareVersionsViewVM.cs" /> <Compile Include="ViewModels\IdsPackFormulasViewVM.cs" /> <Compile Include="ViewModels\IdsPacksViewVM.cs" /> @@ -126,6 +130,7 @@ <Compile Include="ViewModels\MediaMaterialsViewVM.cs" /> <Compile Include="ViewModels\MediaPurposesViewVM.cs" /> <Compile Include="ViewModels\MidTankTypesViewVM.cs" /> + <Compile Include="ViewModels\MotorTypesViewVM.cs" /> <Compile Include="ViewModels\MultiComboVM.cs" /> <Compile Include="ViewModels\OrganizationsViewVM.cs" /> <Compile Include="ViewModels\PermissionsViewVM.cs" /> @@ -143,6 +148,18 @@ <Compile Include="Views\DBViews\ActionTypeView.xaml.cs"> <DependentUpon>ActionTypeView.xaml</DependentUpon> </Compile> + <Compile Include="Views\DBViews\DancerTypesView.xaml.cs"> + <DependentUpon>DancerTypesView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\DancerTypeView.xaml.cs"> + <DependentUpon>DancerTypeView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\MotorTypeView.xaml.cs"> + <DependentUpon>MotorTypeView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\MotorTypesView.xaml.cs"> + <DependentUpon>MotorTypesView.xaml</DependentUpon> + </Compile> <Compile Include="Views\DBViews\IdsPackFormulasView.xaml.cs"> <DependentUpon>IdsPackFormulasView.xaml</DependentUpon> </Compile> @@ -385,6 +402,22 @@ <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\DancerTypeView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\MotorTypeView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\MotorTypesView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> <Page Include="Views\DBViews\IdsPackFormulasView.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 46223d9f4..13fd85122 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs @@ -62,6 +62,11 @@ namespace Tango.MachineStudio.DB SimpleIoc.Default.Register<ProcessParametersTablesViewVM>(); SimpleIoc.Default.Register<ProcessParametersTablesGroupsViewVM>(); + + SimpleIoc.Default.Register<MotorTypesViewVM>(); + SimpleIoc.Default.Register<DancerTypesViewVM>(); + SimpleIoc.Default.Register<HardwareVersionsDancerTypeViewVM>(); + SimpleIoc.Default.Register<HardwareVersionsMotorTypesViewVM>(); } public static MainViewVM MainViewVM @@ -367,5 +372,37 @@ namespace Tango.MachineStudio.DB return ServiceLocator.Current.GetInstance<IdsPackFormulasViewVM>(); } } + + public static MotorTypesViewVM MotorTypesViewVM + { + get + { + return ServiceLocator.Current.GetInstance<MotorTypesViewVM>(); + } + } + + public static DancerTypesViewVM DancerTypesViewVM + { + get + { + return ServiceLocator.Current.GetInstance<DancerTypesViewVM>(); + } + } + + public static HardwareVersionsDancerTypeViewVM HardwareVersionsDancerTypeViewVM + { + get + { + return ServiceLocator.Current.GetInstance<HardwareVersionsDancerTypeViewVM>(); + } + } + + public static HardwareVersionsMotorTypesViewVM HardwareVersionsMotorTypesViewVM + { + get + { + return ServiceLocator.Current.GetInstance<HardwareVersionsMotorTypesViewVM>(); + } + } } }
\ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DancerTypesViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DancerTypesViewVM.cs new file mode 100644 index 000000000..59d55bd0e --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/DancerTypesViewVM.cs @@ -0,0 +1,17 @@ +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; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class DancerTypesViewVM : DbTableViewModel<DancerType> + { + public DancerTypesViewVM(INotificationProvider notification) : base(notification) + { + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/HardwareVersionsDancerTypeViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/HardwareVersionsDancerTypeViewVM.cs new file mode 100644 index 000000000..8fd1480ee --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/HardwareVersionsDancerTypeViewVM.cs @@ -0,0 +1,17 @@ +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; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class HardwareVersionsDancerTypeViewVM : DbTableViewModel<HardwareVersionsDancerType> + { + public HardwareVersionsDancerTypeViewVM(INotificationProvider notification) : base(notification) + { + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/HardwareVersionsMotorTypesViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/HardwareVersionsMotorTypesViewVM.cs new file mode 100644 index 000000000..1dab55614 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/HardwareVersionsMotorTypesViewVM.cs @@ -0,0 +1,17 @@ +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; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class HardwareVersionsMotorTypesViewVM : DbTableViewModel<HardwareVersionsMotorType> + { + public HardwareVersionsMotorTypesViewVM(INotificationProvider notification) : base(notification) + { + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MotorTypesViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MotorTypesViewVM.cs new file mode 100644 index 000000000..ad3eeac8f --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MotorTypesViewVM.cs @@ -0,0 +1,17 @@ +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; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class MotorTypesViewVM : DbTableViewModel<MotorType> + { + public MotorTypesViewVM(INotificationProvider notification) : base(notification) + { + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DancerTypeView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DancerTypeView.xaml new file mode 100644 index 000000000..717e07f48 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DancerTypeView.xaml @@ -0,0 +1,41 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.DancerTypeView" + 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:DancerTypesViewVM, 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="Gradual:" FontWeight="Bold"></TextBlock> + <ToggleButton IsChecked="{Binding EditEntity.Gradual}" HorizontalAlignment="Right"></ToggleButton> + + <TextBlock Text="K:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.K,Mode=TwoWay}"></mahapps:NumericUpDown> + + <TextBlock Text="X:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.X,Mode=TwoWay}"></mahapps:NumericUpDown> + + <TextBlock Text="Pulse Per Millimeter Spring:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="40000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding EditEntity.PulsePerMmSpring,Mode=TwoWay}"></mahapps:NumericUpDown> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DancerTypeView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DancerTypeView.xaml.cs new file mode 100644 index 000000000..d07cf68c5 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DancerTypeView.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 DancerTypeView : UserControl + { + public DancerTypeView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DancerTypesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DancerTypesView.xaml new file mode 100644 index 000000000..245d4a04a --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DancerTypesView.xaml @@ -0,0 +1,34 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.DancerTypesView" + 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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.DancerTypesViewVM}"> + + <UserControl.Resources> + <converters:BooleanToYesNoConverter x:Key="BooleanToYesNoConverter" /> + </UserControl.Resources> + + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.DancerTypesViewSource}" 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="Gradual" Binding="{Binding Gradual,Converter={StaticResource BooleanToYesNoConverter}}"></DataGridTextColumn> + <DataGridTextColumn Header="K" Binding="{Binding K}"></DataGridTextColumn> + <DataGridTextColumn Header="X" Binding="{Binding X}"></DataGridTextColumn> + <DataGridTextColumn Header="Pulse Per Millimeter Spring" Binding="{Binding PulsePerMmSpring}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DancerTypesView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DancerTypesView.xaml.cs new file mode 100644 index 000000000..1b0c8e82e --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DancerTypesView.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 DancerTypesView : UserControl + { + public DancerTypesView() : base() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypeView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypeView.xaml index 55c995360..e7b5957e2 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypeView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypeView.xaml @@ -28,6 +28,42 @@ <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.NlPerPulse,Mode=TwoWay}"></mahapps:NumericUpDown> <TextBlock Text="Capacity:" FontWeight="Bold"></TextBlock> <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.Capacity,Mode=TwoWay}"></mahapps:NumericUpDown> + + <TextBlock Text="Min Frequency:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="40000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding EditEntity.MinFrequency,Mode=TwoWay}"></mahapps:NumericUpDown> + + <TextBlock Text="Max Frequency:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="40000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding EditEntity.MaxFrequency,Mode=TwoWay}"></mahapps:NumericUpDown> + + <TextBlock Text="Min Micro Step:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding EditEntity.MinMicroStep,Mode=TwoWay}"></mahapps:NumericUpDown> + + <TextBlock Text="Max Micro Step:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding EditEntity.MaxMicroStep,Mode=TwoWay}"></mahapps:NumericUpDown> + + <TextBlock Text="Correction Gain:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.CorrectionGain,Mode=TwoWay}"></mahapps:NumericUpDown> + + <TextBlock Text="Ratio To Dryer Speed:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.RatioToDryerSpeed,Mode=TwoWay}"></mahapps:NumericUpDown> + + <TextBlock Text="KP:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.KP,Mode=TwoWay}"></mahapps:NumericUpDown> + + <TextBlock Text="KI:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.Ki,Mode=TwoWay}"></mahapps:NumericUpDown> + + <TextBlock Text="KD:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.Kd,Mode=TwoWay}"></mahapps:NumericUpDown> + + <TextBlock Text="Change Slope:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.ChangeSlope,Mode=TwoWay}"></mahapps:NumericUpDown> + + <TextBlock Text="High Length Micro Second:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.HighLengthMicroSecond,Mode=TwoWay}"></mahapps:NumericUpDown> + + <TextBlock Text="Control Timing:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding EditEntity.ControlTiming,Mode=TwoWay}"></mahapps:NumericUpDown> </controls:TableGrid> </Grid> </UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypesView.xaml index 040ac5799..e88e0dfea 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypesView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/DispenserTypesView.xaml @@ -19,6 +19,20 @@ <DataGridTextColumn Header="Name" Binding="{Binding Name}"></DataGridTextColumn> <DataGridTextColumn Header="Nanolitter Per Pulse" Binding="{Binding NlPerPulse}"></DataGridTextColumn> <DataGridTextColumn Header="Capacity" Binding="{Binding Capacity}"></DataGridTextColumn> + <DataGridTextColumn Header="Min Frequency" Binding="{Binding MinFrequency}"></DataGridTextColumn> + + <DataGridTextColumn Header="Max Frequency" Binding="{Binding MaxFrequency}"></DataGridTextColumn> + <DataGridTextColumn Header="Min Micro Step" Binding="{Binding MinMicroStep}"></DataGridTextColumn> + <DataGridTextColumn Header="Max Micro Step" Binding="{Binding MaxMicroStep}"></DataGridTextColumn> + <DataGridTextColumn Header="Correction Gain" Binding="{Binding CorrectionGain}"></DataGridTextColumn> + <DataGridTextColumn Header="Ratio To Dryer Speed" Binding="{Binding RatioToDryerSpeed}"></DataGridTextColumn> + <DataGridTextColumn Header="KP" Binding="{Binding Kp}"></DataGridTextColumn> + <DataGridTextColumn Header="KI" Binding="{Binding Ki}"></DataGridTextColumn> + + <DataGridTextColumn Header="KD" Binding="{Binding Kd}"></DataGridTextColumn> + <DataGridTextColumn Header="Change Slope" Binding="{Binding ChangeSlope}"></DataGridTextColumn> + <DataGridTextColumn Header="High Length Micro Second" Binding="{Binding HighLengthMicroSecond}"></DataGridTextColumn> + <DataGridTextColumn Header="Control Timing" Binding="{Binding ControlTiming}"></DataGridTextColumn> </DataGrid.Columns> </DataGrid> </controls:DbTableView> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MotorTypeView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MotorTypeView.xaml new file mode 100644 index 000000000..491c69a69 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MotorTypeView.xaml @@ -0,0 +1,72 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.MotorTypeView" + 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:MotorTypesViewVM, 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="Min Frequency:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="40000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding EditEntity.MinFrequency,Mode=TwoWay}"></mahapps:NumericUpDown> + + <TextBlock Text="Max Frequency:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="40000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding EditEntity.MaxFrequency,Mode=TwoWay}"></mahapps:NumericUpDown> + + <TextBlock Text="Min Micro Step:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding EditEntity.MinMicroStep,Mode=TwoWay}"></mahapps:NumericUpDown> + + <TextBlock Text="Max Micro Step:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding EditEntity.MaxMicroStep,Mode=TwoWay}"></mahapps:NumericUpDown> + + <TextBlock Text="Linear Ratio:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.LinearRatio,Mode=TwoWay}"></mahapps:NumericUpDown> + + <TextBlock Text="Median Position:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding EditEntity.MedianPosition,Mode=TwoWay}"></mahapps:NumericUpDown> + + <TextBlock Text="Correction Gain:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.CorrectionGain,Mode=TwoWay}"></mahapps:NumericUpDown> + + <TextBlock Text="Ratio To Dryer Speed:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.RatioToDryerSpeed,Mode=TwoWay}"></mahapps:NumericUpDown> + + <TextBlock Text="KP:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.Kp,Mode=TwoWay}"></mahapps:NumericUpDown> + + <TextBlock Text="KI:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.Ki,Mode=TwoWay}"></mahapps:NumericUpDown> + + <TextBlock Text="KD:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.Kd,Mode=TwoWay}"></mahapps:NumericUpDown> + + <TextBlock Text="Change Slope:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.ChangeSlope,Mode=TwoWay}"></mahapps:NumericUpDown> + + <TextBlock Text="High Length Micro Second:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.HighLengthMicroSecond,Mode=TwoWay}"></mahapps:NumericUpDown> + + <TextBlock Text="Speed Master:" FontWeight="Bold"></TextBlock> + <ToggleButton IsChecked="{Binding EditEntity.SpeedMaster}" HorizontalAlignment="Right"></ToggleButton> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MotorTypeView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MotorTypeView.xaml.cs new file mode 100644 index 000000000..e19082280 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MotorTypeView.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 MotorTypeView : UserControl + { + public MotorTypeView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MotorTypesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MotorTypesView.xaml new file mode 100644 index 000000000..0f748eba6 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MotorTypesView.xaml @@ -0,0 +1,46 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.MotorTypesView" + 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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.MotorTypesViewVM}"> + + <UserControl.Resources> + <converters:BooleanToYesNoConverter x:Key="BooleanToYesNoConverter" /> + </UserControl.Resources> + + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.MotorTypesViewSource}" 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="Min Frequency" Binding="{Binding MinFrequency}"></DataGridTextColumn> + <DataGridTextColumn Header="Max Frequency" Binding="{Binding MaxFrequency}"></DataGridTextColumn> + <DataGridTextColumn Header="Min Micro Step" Binding="{Binding MinMicroStep}"></DataGridTextColumn> + <DataGridTextColumn Header="Max Micro Step" Binding="{Binding MaxMicroStep}"></DataGridTextColumn> + <DataGridTextColumn Header="Linear Ratio" Binding="{Binding LinearRatio}"></DataGridTextColumn> + <DataGridTextColumn Header="Median Position" Binding="{Binding MedianPosition}"></DataGridTextColumn> + <DataGridTextColumn Header="Correction Gain" Binding="{Binding CorrectionGain}"></DataGridTextColumn> + <DataGridTextColumn Header="Ratio To Dryer Speed" Binding="{Binding RatioToDryerSpeed}"></DataGridTextColumn> + <DataGridTextColumn Header="KP" Binding="{Binding Kp}"></DataGridTextColumn> + <DataGridTextColumn Header="KI" Binding="{Binding Ki}"></DataGridTextColumn> + + <DataGridTextColumn Header="KD" Binding="{Binding Kd}"></DataGridTextColumn> + <DataGridTextColumn Header="Change Slope" Binding="{Binding ChangeSlope}"></DataGridTextColumn> + <DataGridTextColumn Header="High Length Micro Second" Binding="{Binding HighLengthMicroSecond}"></DataGridTextColumn> + + <DataGridTextColumn Header="Speed Master" Binding="{Binding SpeedMaster,Converter={StaticResource BooleanToYesNoConverter}}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MotorTypesView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MotorTypesView.xaml.cs new file mode 100644 index 000000000..9497d1f1e --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/MotorTypesView.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 MotorTypesView : UserControl + { + public MotorTypesView() : base() + { + InitializeComponent(); + } + } +} |
