diff options
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules')
17 files changed, 184 insertions, 66 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Controls/DbTableView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Controls/DbTableView.xaml index d1c62ed7e..f3e13e338 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Controls/DbTableView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Controls/DbTableView.xaml @@ -5,7 +5,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280"> + d:DesignHeight="720" d:DesignWidth="1000" MaxWidth="1000"> <Grid> <Grid> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Converters/ProcessParametersRmlsToStringConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Converters/ProcessParametersRmlsToStringConverter.cs deleted file mode 100644 index 359467e2d..000000000 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Converters/ProcessParametersRmlsToStringConverter.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Data; -using Tango.DAL.Observables; -using Tango.MachineStudio.DB.ViewModels; - -namespace Tango.MachineStudio.DB.Converters -{ - /// <summary> - /// Converts a liquid type RML to string. - /// </summary> - /// <seealso cref="System.Windows.Data.IValueConverter" /> - public class ProcessParametersRmlsToStringConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value == null) return ""; - - if (value is IEnumerable<RmlsProcessParameter>) - { - IEnumerable<RmlsProcessParameter> liquidRmls = value as IEnumerable<RmlsProcessParameter>; - return String.Join(", ", liquidRmls.Select(x => x.Rml.Name)); - } - else - { - IEnumerable<MultiComboVM<Rml>> rmls = value as IEnumerable<MultiComboVM<Rml>>; - return String.Join(", ", rmls.Where(x => x.IsSelected).Select(x => x.Entity.Name)); - } - } - - 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/Managers/RegisteredView.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Managers/RegisteredView.cs index cdd32eaa5..cd53ff8d8 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Managers/RegisteredView.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Managers/RegisteredView.cs @@ -33,7 +33,14 @@ namespace Tango.MachineStudio.DB.Managers { Location = new Point(rnd.Next(30, 200), rnd.Next(30, 200)); Icon = PackIconKind.Table; + + if (header.Length < 5) + { + header = header.ToUpper(); + } + Header = header; + View = view; if (action != null) @@ -64,6 +71,11 @@ namespace Tango.MachineStudio.DB.Managers /// <param name="view">The view.</param> public RegisteredView(String header, FrameworkElement view) : this(header, view, null) { + if (header.Length < 5) + { + header = header.ToUpper(); + } + Header = header; View = view; } 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 42bcb5eac..bb3084207 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 @@ -89,7 +89,6 @@ <ItemGroup> <Compile Include="Converters\ByteArrayToFileSizeConverter.cs" /> <Compile Include="Converters\EventTypeActionsToStringConverter.cs" /> - <Compile Include="Converters\ProcessParametersRmlsToStringConverter.cs" /> <Compile Include="Converters\LiquidTypeRmlsToStringConverter.cs" /> <Compile Include="Converters\RolesPermissionsToStringConverter.cs" /> <Compile Include="DBModule.cs" /> @@ -130,6 +129,7 @@ <Compile Include="ViewModels\OrganizationsViewVM.cs" /> <Compile Include="ViewModels\PermissionsViewVM.cs" /> <Compile Include="ViewModels\ProcessParametersTablesViewVM.cs" /> + <Compile Include="ViewModels\RmlsProcessParametersTablesViewVM.cs" /> <Compile Include="ViewModels\RmlsViewVM.cs" /> <Compile Include="ViewModels\RolesViewVM.cs" /> <Compile Include="ViewModels\UsersViewVM.cs" /> @@ -142,6 +142,12 @@ <Compile Include="Views\DBViews\ActionTypeView.xaml.cs"> <DependentUpon>ActionTypeView.xaml</DependentUpon> </Compile> + <Compile Include="Views\DBViews\RmlsProcessParametersTablesView.xaml.cs"> + <DependentUpon>RmlsProcessParametersTablesView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\DBViews\RmlsProcessParametersTableView.xaml.cs"> + <DependentUpon>RmlsProcessParametersTableView.xaml</DependentUpon> + </Compile> <Compile Include="Views\DBViews\ProcessParametersTablesView.xaml.cs"> <DependentUpon>ProcessParametersTablesView.xaml</DependentUpon> </Compile> @@ -372,6 +378,14 @@ <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> </Page> + <Page Include="Views\DBViews\RmlsProcessParametersTablesView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + <Page Include="Views\DBViews\RmlsProcessParametersTableView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> <Page Include="Views\DBViews\ProcessParametersTablesView.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 350bebcc0..5fe386749 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModelLocator.cs @@ -60,6 +60,7 @@ namespace Tango.MachineStudio.DB SimpleIoc.Default.Register<CatsViewVM>(); SimpleIoc.Default.Register<ProcessParametersTablesViewVM>(); + SimpleIoc.Default.Register<RmlsProcessParametersTablesViewVM>(); } public static MainViewVM MainViewVM @@ -349,5 +350,13 @@ namespace Tango.MachineStudio.DB return ServiceLocator.Current.GetInstance<ProcessParametersTablesViewVM>(); } } + + public static RmlsProcessParametersTablesViewVM RmlsProcessParametersTablesViewVM + { + get + { + return ServiceLocator.Current.GetInstance<RmlsProcessParametersTablesViewVM>(); + } + } } }
\ No newline at end of file diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CatsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CatsViewVM.cs index 74a7e29eb..a768b3c7c 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CatsViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CatsViewVM.cs @@ -16,6 +16,7 @@ namespace Tango.MachineStudio.DB.ViewModels public CatsViewVM(INotificationProvider notification) : base(notification) { SelectDataFileCommand = new RelayCommand(SelectDataFile); + } public RelayCommand SelectDataFileCommand { get; set; } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/RmlsProcessParametersTablesViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/RmlsProcessParametersTablesViewVM.cs new file mode 100644 index 000000000..4ae1f063f --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/RmlsProcessParametersTablesViewVM.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class RmlsProcessParametersTablesViewVM : DbTableViewModel<RmlsProcessParametersTable> + { + public RmlsProcessParametersTablesViewVM(INotificationProvider notification) : base(notification) + { + + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CatView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CatView.xaml index 442f77ae3..9cd01cfc4 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CatView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CatView.xaml @@ -28,6 +28,9 @@ <TextBlock Text="Last Updated:" FontWeight="Bold"></TextBlock> <TextBox Text="{Binding EditEntity.LastUpdated}" IsReadOnly="True"></TextBox> + <TextBlock Text="Name:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Name}"></TextBox> + <TextBlock Text="Liquid Type:" FontWeight="Bold"></TextBlock> <ComboBox ItemsSource="{Binding Adapter.LiquidTypes}" SelectedItem="{Binding EditEntity.LiquidTypes,Mode=TwoWay}"> <ComboBox.ItemTemplate> @@ -44,8 +47,8 @@ </ComboBox.ItemTemplate> </ComboBox> - <TextBlock Text="Machine:" FontWeight="Bold"></TextBlock> - <ComboBox ItemsSource="{Binding Adapter.Machines}" SelectedItem="{Binding EditEntity.Machine,Mode=TwoWay}" DisplayMemberPath="SerialNumber"></ComboBox> + <TextBlock Text="RML:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.Rmls}" SelectedItem="{Binding EditEntity.Rml,Mode=TwoWay}" DisplayMemberPath="Name"></ComboBox> <TextBlock Text="Calibration Data:" FontWeight="Bold"></TextBlock> <DockPanel LastChildFill="False"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CatsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CatsView.xaml index d88a2a142..e72146525 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CatsView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/CatsView.xaml @@ -22,6 +22,7 @@ <DataGrid.Columns> <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> + <DataGridTextColumn Header="Name" Binding="{Binding Name}"></DataGridTextColumn> <DataGridTextColumn Header="Liquid Type" Binding="{Binding LiquidTypes.Name}"></DataGridTextColumn> <DataGridTemplateColumn Header="Liquid Type Color"> <DataGridTemplateColumn.CellTemplate> @@ -34,7 +35,7 @@ </DataTemplate> </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn> - <DataGridTextColumn Header="Machine" Binding="{Binding Machine.SerialNumber}"></DataGridTextColumn> + <DataGridTextColumn Header="RML" Binding="{Binding Rml.Name}"></DataGridTextColumn> <DataGridTextColumn Header="Calibration Data Size" Binding="{Binding Data.Length,Converter={StaticResource ByteArrayToFileSizeConverter}}"></DataGridTextColumn> </DataGrid.Columns> </DataGrid> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTableView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTableView.xaml index 06442196e..e9b7c31af 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTableView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/ProcessParametersTableView.xaml @@ -56,7 +56,7 @@ <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.WinderTension,Mode=TwoWay}"></mahapps:NumericUpDown> <TextBlock Text="Lubrication:" FontWeight="Bold"></TextBlock> <ToggleButton HorizontalAlignment="Right" IsChecked="{Binding EditEntity.Lubrication}" Style="{StaticResource MaterialDesignSwitchToggleButton}" /> - <TextBlock Text="Lubrication Nanolitter Per Centimeter:" FontWeight="Bold"></TextBlock> + <TextBlock Text="Lubrication Nanoliter Per Centimeter:" FontWeight="Bold"></TextBlock> <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding EditEntity.LubricationNlPerCm,Mode=TwoWay}"></mahapps:NumericUpDown> </controls:TableGrid> </Grid> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTableView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTableView.xaml new file mode 100644 index 000000000..767b39f29 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTableView.xaml @@ -0,0 +1,31 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.RmlsProcessParametersTableView" + 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:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:global="clr-namespace:Tango.MachineStudio.DB" + xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls" + xmlns:converters="clr-namespace:Tango.MachineStudio.DB.Converters" + xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" + mc:Ignorable="d" + d:DesignHeight="300" d:DesignWidth="300" DataContext="{x:Static global:ViewModelLocator.RmlsProcessParametersTablesViewVM}"> + + <Grid> + <controls:TableGrid> + <TextBlock Text="ID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.ID}" IsReadOnly="True" IsEnabled="False"></TextBox> + <TextBlock Text="GUID:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.Guid}" IsReadOnly="True" IsEnabled="False"></TextBox> + <TextBlock Text="Last Updated:" FontWeight="Bold"></TextBlock> + <TextBox Text="{Binding EditEntity.LastUpdated}" IsReadOnly="True" IsEnabled="False"></TextBox> + <TextBlock Text="RML:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.Rmls}" SelectedItem="{Binding EditEntity.Rml,Mode=TwoWay}" DisplayMemberPath="Name"></ComboBox> + <TextBlock Text="Process Parameters Table:" FontWeight="Bold"></TextBlock> + <ComboBox ItemsSource="{Binding Adapter.ProcessParametersTables}" SelectedItem="{Binding EditEntity.ProcessParametersTables}" DisplayMemberPath="Name"></ComboBox> + <TextBlock Text="Index:" FontWeight="Bold"></TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="False" HorizontalContentAlignment="Left" Value="{Binding EditEntity.TableIndex,Mode=TwoWay}"></mahapps:NumericUpDown> + </controls:TableGrid> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTableView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTableView.xaml.cs new file mode 100644 index 000000000..713a46204 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTableView.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 UserView.xaml + /// </summary> + public partial class RmlsProcessParametersTableView : UserControl + { + public RmlsProcessParametersTableView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTablesView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTablesView.xaml new file mode 100644 index 000000000..d599c64a3 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTablesView.xaml @@ -0,0 +1,26 @@ +<UserControl x:Class="Tango.MachineStudio.DB.Views.DBViews.RmlsProcessParametersTablesView" + 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:controls="clr-namespace:Tango.MachineStudio.DB.Controls" + xmlns:global="clr-namespace:Tango.MachineStudio.DB" + xmlns:converters="clr-namespace:Tango.MachineStudio.DB.Converters" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views.DBViews" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" Background="White" DataContext="{x:Static global:ViewModelLocator.RmlsProcessParametersTablesViewVM}"> + + <Grid> + <controls:DbTableView> + <DataGrid Background="Transparent" ItemsSource="{Binding Adapter.RmlsProcessParametersTablesViewSource}" SelectedItem="{Binding SelectedEntity}" AutoGenerateColumns="False" IsReadOnly="True"> + <DataGrid.Columns> + <DataGridTextColumn Header="ID" Binding="{Binding ID}"></DataGridTextColumn> + <DataGridTextColumn Header="GUID" Binding="{Binding Guid}"></DataGridTextColumn> + <DataGridTextColumn Header="RML" Binding="{Binding Rml.Name}"></DataGridTextColumn> + <DataGridTextColumn Header="Process Parameters Table" Binding="{Binding ProcessParametersTables.Name}"></DataGridTextColumn> + <DataGridTextColumn Header="Index" Binding="{Binding TableIndex}"></DataGridTextColumn> + </DataGrid.Columns> + </DataGrid> + </controls:DbTableView> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTablesView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTablesView.xaml.cs new file mode 100644 index 000000000..c4ee7e66d --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/DBViews/RmlsProcessParametersTablesView.xaml.cs @@ -0,0 +1,30 @@ +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; + +namespace Tango.MachineStudio.DB.Views.DBViews +{ + /// <summary> + /// Interaction logic for UsersView.xaml + /// </summary> + [DBView] + public partial class RmlsProcessParametersTablesView : UserControl + { + public RmlsProcessParametersTablesView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/MainDBView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/MainDBView.xaml.cs index 1ffdf7eb0..b769b9bfd 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/MainDBView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/MainDBView.xaml.cs @@ -58,7 +58,7 @@ namespace Tango.MachineStudio.DB.Views grid.DataContext = message.Context; presenter.Content = view; icon.Kind = (message.DialogOpenMode == DialogOpenMode.Editing ? PackIconKind.TableEdit : PackIconKind.Plus); - txtTitle.Text = (message.DialogOpenMode == DialogOpenMode.Editing ? "Edit " : "Add New ") + message.EntityType.Name.ToTitle(); + txtTitle.Text = (message.DialogOpenMode == DialogOpenMode.Editing ? "Edit " : "Add New ") + (message.EntityType.Name.Length < 5 ? message.EntityType.Name.ToUpper() : message.EntityType.Name).ToTitle(); IsEditViewOpen = true; } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MachineVersionDialogVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MachineVersionDialogVM.cs index 6854472f1..3776a5e91 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MachineVersionDialogVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MachineVersionDialogVM.cs @@ -12,7 +12,7 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels { public class MachineVersionDialogVM : DialogViewVM { - public MachineVersionsProvider VersionsProvider { get; set; } + public ObservablesEntitiesAdapter Adapter { get; set; } public double Version { get; set; } @@ -44,16 +44,10 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels public MachineVersionDialogVM() { - VersionsProvider = new MachineVersionsProvider(); + Adapter = ObservablesEntitiesAdapter.Instance; AcceptCommand = new RelayCommand(() => { - if (SelectedVersion == null) - { - Version = double.Parse(VersionsProvider.Text); - } - Accept(); - }); CancelCommand = new RelayCommand(Cancel); } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineVersionDialog.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineVersionDialog.xaml index 60aebef7f..f6c39a6cd 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineVersionDialog.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineVersionDialog.xaml @@ -36,18 +36,9 @@ </Grid.RowDefinitions> <Grid> - <StackPanel HorizontalAlignment="Left" Margin="10"> + <StackPanel Margin="10"> <TextBlock>Version</TextBlock> - <autoComplete:AutoCompleteTextBox Margin="0 5 0 0" Width="200" materialDesign:HintAssist.Hint="Selected version" DisplayMember="Version" Provider="{Binding VersionsProvider}" SelectedItem="{Binding SelectedVersion,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"> - <autoComplete:AutoCompleteTextBox.ItemTemplate> - <DataTemplate> - <TextBlock><Run Text="{Binding Name}"></Run><Run>,</Run><Run Text="{Binding Version}"></Run></TextBlock> - </DataTemplate> - </autoComplete:AutoCompleteTextBox.ItemTemplate> - <autoComplete:AutoCompleteTextBox.LoadingContent> - <TextBlock Text="Loading..." Margin="5" FontSize="14" /> - </autoComplete:AutoCompleteTextBox.LoadingContent> - </autoComplete:AutoCompleteTextBox> + <ComboBox ItemsSource="{Binding Adapter.MachineVersions}" Text="{Binding Version}" DisplayMemberPath="Version" SelectedItem="{Binding SelectedVersion}" IsEditable="True" materialDesign:HintAssist.Hint="Select or enter a new version name"></ComboBox> <TextBlock Margin="0 10 0 0">Name</TextBlock> <TextBox materialDesign:HintAssist.Hint="Version name" Text="{Binding VersionName}"> <TextBox.Style> |
