aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-06-18 14:49:53 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-06-18 14:49:53 +0300
commitf25823d812134a71b901562b72adfdb9185812a9 (patch)
tree36e4066677bca569cffb336896b8071a5212be46 /Software/Visual_Studio/MachineStudio/Modules
parent647548244947e71aedb0770be0b12bd74bcf4c93 (diff)
downloadTango-f25823d812134a71b901562b72adfdb9185812a9.tar.gz
Tango-f25823d812134a71b901562b72adfdb9185812a9.zip
Fixed issue with RML in Machine Studio DB Module.
Implemented TouchTextBox. Made some modifications to ViewModel validation.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Tango.MachineStudio.DB.csproj16
-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/SpoolTypesViewVM.cs18
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlView.xaml2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsView.xaml2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/SpoolTypeView.xaml53
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/SpoolTypeView.xaml.cs28
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/SpoolTypesView.xaml32
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/SpoolTypesView.xaml.cs32
9 files changed, 191 insertions, 2 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 baa6042f0..e7d4a4022 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
@@ -79,6 +79,7 @@
<Compile Include="Converters\EntityFieldNameToFriendlyStringConverter.cs" />
<Compile Include="Converters\EventTypeActionsToStringConverter.cs" />
<Compile Include="Converters\LiquidTypeRmlsToStringConverter.cs" />
+ <Compile Include="Converters\MediaColorToColorConverter.cs" />
<Compile Include="Converters\RolesPermissionsToStringConverter.cs" />
<Compile Include="DBModule.cs" />
<Compile Include="Messages\CloseEntityEditViewMessage.cs" />
@@ -126,6 +127,7 @@
<Compile Include="ViewModels\ProcessParametersTablesGroupsViewVM.cs" />
<Compile Include="ViewModels\RmlsViewVM.cs" />
<Compile Include="ViewModels\RolesViewVM.cs" />
+ <Compile Include="ViewModels\SpoolTypesViewVM.cs" />
<Compile Include="ViewModels\UsersViewVM.cs" />
<Compile Include="ViewModels\EntityViewModel.cs" />
<Compile Include="ViewModels\MainViewVM.cs" />
@@ -136,6 +138,12 @@
<Compile Include="Views\DBViews\ActionTypeView.xaml.cs">
<DependentUpon>ActionTypeView.xaml</DependentUpon>
</Compile>
+ <Compile Include="Views\DBViews\SpoolTypesView.xaml.cs">
+ <DependentUpon>SpoolTypesView.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Views\DBViews\SpoolTypeView.xaml.cs">
+ <DependentUpon>SpoolTypeView.xaml</DependentUpon>
+ </Compile>
<Compile Include="Views\DBViews\EventTypesGroupsView.xaml.cs">
<DependentUpon>EventTypesGroupsView.xaml</DependentUpon>
</Compile>
@@ -402,6 +410,14 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
+ <Page Include="Views\DBViews\SpoolTypesView.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </Page>
+ <Page Include="Views\DBViews\SpoolTypeView.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </Page>
<Page Include="Views\DBViews\EventTypesGroupsView.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 d2506c362..7bf3c6717 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs
@@ -65,6 +65,8 @@ namespace Tango.MachineStudio.DB
TangoIOC.Default.Register<HardwarePidControlTypesViewVM>();
TangoIOC.Default.Register<EventTypesGroupsViewVM>();
+
+ TangoIOC.Default.Register<SpoolTypesViewVM>();
}
public static MainViewVM MainViewVM
@@ -402,5 +404,13 @@ namespace Tango.MachineStudio.DB
return TangoIOC.Default.GetInstance<EventTypesGroupsViewVM>();
}
}
+
+ public static SpoolTypesViewVM SpoolTypesViewVM
+ {
+ get
+ {
+ return TangoIOC.Default.GetInstance<SpoolTypesViewVM>();
+ }
+ }
}
} \ No newline at end of file
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/SpoolTypesViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/SpoolTypesViewVM.cs
new file mode 100644
index 000000000..cc52e6e95
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/SpoolTypesViewVM.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.BL.Entities;
+using Tango.MachineStudio.Common.Notifications;
+
+namespace Tango.MachineStudio.DB.ViewModels
+{
+ public class SpoolTypesViewVM : DbTableViewModel<SpoolType>
+ {
+ public SpoolTypesViewVM(INotificationProvider notification) : base(notification)
+ {
+
+ }
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlView.xaml
index 43a17d8e4..9bddd3937 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlView.xaml
@@ -41,7 +41,7 @@
<StackPanel Orientation="Horizontal">
<Rectangle Width="16" Height="16" VerticalAlignment="Center">
<Rectangle.Fill>
- <SolidColorBrush Color="{Binding Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush>
+ <SolidColorBrush Color="{Binding Color}"></SolidColorBrush>
</Rectangle.Fill>
</Rectangle>
</StackPanel>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsView.xaml
index 86a61d400..8cd51ccac 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsView.xaml
@@ -29,7 +29,7 @@
<DataTemplate>
<Rectangle Width="50">
<Rectangle.Fill>
- <SolidColorBrush Color="{Binding MediaColor.Color,Converter={StaticResource ColorToIntegerConverter},Mode=TwoWay}"></SolidColorBrush>
+ <SolidColorBrush Color="{Binding MediaColor.Color}"></SolidColorBrush>
</Rectangle.Fill>
</Rectangle>
</DataTemplate>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/SpoolTypeView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/SpoolTypeView.xaml
new file mode 100644
index 000000000..843b9c244
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/SpoolTypeView.xaml
@@ -0,0 +1,53 @@
+<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.SpoolTypeView"
+ 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:SpoolTypesViewVM, 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="Length:" FontWeight="Bold"></TextBlock>
+ <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.Length,Mode=TwoWay}"></mahapps:NumericUpDown>
+
+ <TextBlock Text="Weight:" FontWeight="Bold"></TextBlock>
+ <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.Weight,Mode=TwoWay}"></mahapps:NumericUpDown>
+
+ <TextBlock Text="Diameter:" FontWeight="Bold"></TextBlock>
+ <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.Diameter,Mode=TwoWay}"></mahapps:NumericUpDown>
+
+ <TextBlock Text="Start Offset Pulses:" FontWeight="Bold"></TextBlock>
+ <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding EditEntity.StartOffsetPulses,Mode=TwoWay}"></mahapps:NumericUpDown>
+
+ <TextBlock Text="Backing Rate:" FontWeight="Bold"></TextBlock>
+ <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding EditEntity.BackingRate,Mode=TwoWay}"></mahapps:NumericUpDown>
+
+ <TextBlock Text="Segment Offset Pulses:" FontWeight="Bold"></TextBlock>
+ <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding EditEntity.SegmentOffsetPulses,Mode=TwoWay}"></mahapps:NumericUpDown>
+
+ <TextBlock Text="Bottom Backing Rate:" FontWeight="Bold"></TextBlock>
+ <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding EditEntity.BottomBackingRate,Mode=TwoWay}"></mahapps:NumericUpDown>
+
+ <TextBlock Text="Rotations Per Passage:" FontWeight="Bold"></TextBlock>
+ <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.RotationsPerPassage,Mode=TwoWay}"></mahapps:NumericUpDown>
+ </controls:TableGrid>
+ </Grid>
+</UserControl>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/SpoolTypeView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/SpoolTypeView.xaml.cs
new file mode 100644
index 000000000..51baf49bd
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/SpoolTypeView.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 SpoolTypeView : UserControl
+ {
+ public SpoolTypeView()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/SpoolTypesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/SpoolTypesView.xaml
new file mode 100644
index 000000000..4ed13cb11
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/SpoolTypesView.xaml
@@ -0,0 +1,32 @@
+<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.SpoolTypesView"
+ 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.SpoolTypesViewVM}">
+ <Grid>
+ <controls:DbTableView>
+ <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.SpoolTypesViewSource}" 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="Length" Binding="{Binding Length}"></DataGridTextColumn>
+ <DataGridTextColumn Header="Weight" Binding="{Binding Weight}"></DataGridTextColumn>
+ <DataGridTextColumn Header="Diameter" Binding="{Binding Diameter}"></DataGridTextColumn>
+ <DataGridTextColumn Header="Start Offset Pulses" Binding="{Binding StartOffsetPulses}"></DataGridTextColumn>
+ <DataGridTextColumn Header="Backing Rate" Binding="{Binding BackingRate}"></DataGridTextColumn>
+ <DataGridTextColumn Header="Segment Offset Pulses" Binding="{Binding SegmentOffsetPulses}"></DataGridTextColumn>
+ <DataGridTextColumn Header="Bottom Backing Rate" Binding="{Binding BottomBackingRate}"></DataGridTextColumn>
+ <DataGridTextColumn Header="Rotations Per Passage" Binding="{Binding RotationsPerPassage}"></DataGridTextColumn>
+ </DataGrid.Columns>
+ </DataGrid>
+ </controls:DbTableView>
+ </Grid>
+</UserControl>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/SpoolTypesView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/SpoolTypesView.xaml.cs
new file mode 100644
index 000000000..2f0864ee3
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/SpoolTypesView.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 SpoolTypesView : UserControl
+ {
+ public SpoolTypesView() : base()
+ {
+ InitializeComponent();
+ }
+ }
+}