diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-01-22 17:12:18 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-01-22 17:12:18 +0200 |
| commit | d71c73171948d29db6dab71e1ca038445d6ab318 (patch) | |
| tree | ada32baf879c02cb38aeed701884421915e6ef5e /Software/Visual_Studio/MachineStudio/Modules | |
| parent | 3234e33cc4ba354f0395bb514b8b2fa102cf38ec (diff) | |
| download | Tango-d71c73171948d29db6dab71e1ca038445d6ab318.tar.gz Tango-d71c73171948d29db6dab71e1ca038445d6ab318.zip | |
Implemented Developer Module Configuration Section!
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules')
5 files changed, 457 insertions, 87 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MainViewVM.cs index a0ce93a5a..7e472ee75 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/MainViewVM.cs @@ -1,18 +1,40 @@ -using System; +using Microsoft.Practices.ServiceLocation; +using System; using System.Collections.Generic; using System.Linq; +using System.Reflection; using System.Text; using System.Threading.Tasks; using System.Windows; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common; +using Tango.MachineStudio.Common.StudioApplication; using Tango.SharedUI; namespace Tango.MachineStudio.DB.ViewModels { - public class MainViewVM : ViewModel + public class MainViewVM : ViewModel, IModuleRequestListener { public MainViewVM() : base() { } + + public void OnRequestModule(IStudioModule module, object args) + { + if (module is DBModule && args != null && args is IObservableEntity) + { + String vmName = args.GetType().Name + "sViewVM"; + + Type vmType = Assembly.GetAssembly(typeof(MainViewVM)).GetTypes().SingleOrDefault(x => x.Name == vmName); + + if (vmType != null) + { + var vm = ServiceLocator.Current.GetInstance(vmType); + vmType.GetProperty("SelectedEntity").SetValue(vm, args); + vmType.GetMethod("OnEdit", BindingFlags.Instance | BindingFlags.NonPublic).Invoke(vm, new object[] { }); + } + } + } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/MainDBView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/MainDBView.xaml index 6c7cb2b95..a6edd80da 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/MainDBView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/Views/MainDBView.xaml @@ -9,10 +9,11 @@ xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:managers="clr-namespace:Tango.MachineStudio.DB.Managers" + xmlns:global="clr-namespace:Tango.MachineStudio.DB" xmlns:commonControls="clr-namespace:Tango.MachineStudio.Common.Controls;assembly=Tango.MachineStudio.Common" xmlns:local="clr-namespace:Tango.MachineStudio.DB.Views" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1270" DataContext="{Binding MainViewVM, Source={StaticResource Locator}}"> + d:DesignHeight="720" d:DesignWidth="1270" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> <UserControl.Background> <ImageBrush ImageSource="../Images/seamless-grid.jpg" Stretch="None" TileMode="Tile" ViewportUnits="Absolute" Viewport="0,0,32,32"></ImageBrush> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs index e7e97097b..621ce550b 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs @@ -1,5 +1,7 @@ -using System; +using GalaSoft.MvvmLight.Ioc; +using System; using System.Collections.Generic; +using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -21,29 +23,86 @@ namespace Tango.MachineStudio.Developer.ViewModels public Machine SelectedMachine { get { return _selectedMachine; } - set { _selectedMachine = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } + set { _selectedMachine = value; RaisePropertyChangedAuto(); OnMachineChanged(); InvalidateRelayCommands(); } } + private List<LiquidTypesRml> _liquidTypesRmls; + + public List<LiquidTypesRml> LiquidTypesRmls + { + get { return _liquidTypesRmls; } + set { _liquidTypesRmls = value; RaisePropertyChangedAuto(); } + } + + private ObservableCollection<RmlsProcessParametersTable> _rmlProcessParametersTables; + + public ObservableCollection<RmlsProcessParametersTable> RmlProcessParametersTables + { + get { return _rmlProcessParametersTables; } + set { _rmlProcessParametersTables = value; RaisePropertyChangedAuto(); } + } + + private DBViewContextWrapper<Rml> _selectedRML; public DBViewContextWrapper<Rml> SelectedRML { get { return _selectedRML; } - set { _selectedRML = value; RaisePropertyChangedAuto(); } + set { _selectedRML = value; RaisePropertyChangedAuto(); InvalidateLiquidFactorsAndProcessTables(); InvalidateRelayCommands(); } } + private bool _isSideBarOpened; + + public bool IsSideBarOpened + { + get { return _isSideBarOpened; } + set { _isSideBarOpened = value; RaisePropertyChangedAuto(); } + } + + public RelayCommand EditMachineCommand { get; set; } + public RelayCommand EditRMLCommand { get; set; } + + public RelayCommand ToggleSideBarCommand { get; set; } + + public MainViewVM() + { + IsSideBarOpened = true; + } + + [PreferredConstructor] public MainViewVM(IStudioApplicationManager applicationManager) { Adapter = ObservablesEntitiesAdapter.Instance; EditMachineCommand = new RelayCommand(EditMachine, (x) => SelectedMachine != null); ApplicationManager = applicationManager; + EditRMLCommand = new RelayCommand(EditRML, (x) => SelectedRML != null); + ToggleSideBarCommand = new RelayCommand(() => IsSideBarOpened = !IsSideBarOpened); + } + + private void EditRML() + { + ApplicationManager.RequestModule("Data Base", SelectedRML.EditEntity); } private void EditMachine() { ApplicationManager.RequestModule("Machine Designer", SelectedMachine); } + + private void OnMachineChanged() + { + InvalidateLiquidFactorsAndProcessTables(); + } + + private void InvalidateLiquidFactorsAndProcessTables() + { + if (SelectedRML != null && SelectedMachine != null) + { + LiquidTypesRmls = SelectedMachine.Configuration.IdsPacks.OrderBy(x => x.PackIndex).Select(x => x.LiquidTypes).SelectMany(x => x.LiquidTypesRmls).Where(x => x.Rml.Guid == SelectedRML.EditEntity.Guid).ToList(); + RmlProcessParametersTables = SelectedRML.EditEntity.RmlsProcessParametersTables.ToObservableCollection(); + } + } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml index 5b26b7891..0a65511c8 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml @@ -12,9 +12,11 @@ xmlns:vm="clr-namespace:Tango.MachineStudio.Developer.ViewModels" xmlns:localConverters="clr-namespace:Tango.MachineStudio.Developer.Converters" xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:observables="clr-namespace:Tango.DAL.Observables;assembly=Tango.DAL.Observables" + xmlns:shapes="clr-namespace:Tango.SharedUI.Shapes;assembly=Tango.SharedUI" xmlns:local="clr-namespace:Tango.MachineStudio.Developer.Views" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> + d:DesignHeight="1080" d:DesignWidth="1280" Background="White" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=True}" DataContext="{x:Static global:ViewModelLocator.MainViewVM}"> <UserControl.Resources> <Style TargetType="{x:Type TabItem}" BasedOn="{StaticResource {x:Type TabItem}}"> @@ -24,117 +26,403 @@ <converters:ColorToIntegerConverter x:Key="ColorToIntegerConverter"></converters:ColorToIntegerConverter> <localConverters:DbRmlViewToEntityConverter x:Key="DbRmlViewToEntityConverter"></localConverters:DbRmlViewToEntityConverter> + <converters:NullObjectToBooleanConverter x:Key="NullObjectToBooleanConverter"></converters:NullObjectToBooleanConverter> + + <SolidColorBrush x:Key="SideBarBackground" Color="#F9F9F9"> + + </SolidColorBrush> </UserControl.Resources> - <Grid Margin="10"> + <Grid> <Grid> <Grid.ColumnDefinitions> - <ColumnDefinition Width="450"/> - <ColumnDefinition Width="5"/> - <ColumnDefinition Width="474*"/> + <ColumnDefinition Width="Auto"/> + <ColumnDefinition Width="1*"/> </Grid.ColumnDefinitions> + <Grid Grid.Column="1"> + <Grid.RowDefinitions> + <RowDefinition Height="Auto"/> + <RowDefinition Height="1*"/> + </Grid.RowDefinitions> - <Grid> - <!--<Grid.RowDefinitions> - <RowDefinition Height="90"/> - <RowDefinition Height="319*"/> - <RowDefinition Height="333*"/> - <RowDefinition Height="60*"/> - </Grid.RowDefinitions>--> + <Grid Background="{StaticResource SideBarBackground}"> + <Grid.Style> + <Style TargetType="Grid"> + <Setter Property="Height" Value="350"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding IsSideBarOpened}" Value="True"> + <DataTrigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="Height" To="350" Duration="00:00:0.2"></DoubleAnimation> + </Storyboard> + </BeginStoryboard> + </DataTrigger.EnterActions> + <DataTrigger.ExitActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="Height" To="0" Duration="00:00:0.2"></DoubleAnimation> + </Storyboard> + </BeginStoryboard> + </DataTrigger.ExitActions> + </DataTrigger> + </Style.Triggers> + </Style> + </Grid.Style> - <TabControl> - <TabItem Header="MACHINE" > - <StackPanel Margin="0 40 0 0"> - <ComboBox ItemsSource="{Binding Adapter.Machines}" SelectedItem="{Binding SelectedMachine}" materialDesign:HintAssist.IsFloating="True" materialDesign:HintAssist.Hint="Selected machine" Margin="40 0 40 0"> - <ComboBox.ItemTemplate> - <DataTemplate> - <StackPanel> - <TextBlock Text="{Binding SerialNumber}" FontWeight="Bold" FontStyle="Italic"></TextBlock> - <TextBlock FontSize="11" Text="{Binding Name}" Foreground="Gray"></TextBlock> - </StackPanel> - </DataTemplate> - </ComboBox.ItemTemplate> - </ComboBox> - <designer:MachineView IsHitTestVisible="False" Margin="0 40 0 0" DataContext="{Binding SelectedMachine}" /> - <Button Command="{Binding EditMachineCommand}" HorizontalAlignment="Right" Margin="0 10 30 0" Style="{StaticResource MaterialDesignFlatButton}"> - <StackPanel Orientation="Horizontal"> - <materialDesign:PackIcon VerticalAlignment="Center" Kind="Pencil"></materialDesign:PackIcon> - <TextBlock Margin="10 0 0 0">EDIT</TextBlock> - </StackPanel> - </Button> - </StackPanel> - </TabItem> - <TabItem Header="MEDIA"> - <DockPanel Margin="0 40 0 0"> - <ComboBox DockPanel.Dock="Top" ItemsSource="{Binding Adapter.Rmls}" SelectedItem="{Binding SelectedRML,Converter={StaticResource DbRmlViewToEntityConverter}}" materialDesign:HintAssist.IsFloating="True" materialDesign:HintAssist.Hint="Selected RML" Margin="40 0 40 0"> - <ComboBox.ItemTemplate> - <DataTemplate> - <StackPanel> - <TextBlock Text="{Binding Name}" FontWeight="Bold" FontStyle="Italic"></TextBlock> - <TextBlock FontSize="11" Text="{Binding Manufacturer}" Foreground="Gray"></TextBlock> - </StackPanel> - </DataTemplate> - </ComboBox.ItemTemplate> - </ComboBox> + <ScrollViewer VerticalScrollBarVisibility="Auto"> + <StackPanel> + <Expander Header="PROCESS PARAMETERS" IsExpanded="True"> + <Grid> + <Grid Height="250"> + <StackPanel Orientation="Horizontal" Margin="20 0 0 0"> + <ItemsControl ItemsSource="{Binding RmlProcessParametersTables}"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <WrapPanel IsItemsHost="True"></WrapPanel> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate DataType="{x:Type observables:RmlsProcessParametersTable}"> + <Border Padding="5" CornerRadius="5" BorderThickness="1" BorderBrush="Silver" Height="250" Margin="0 0 10 0"> + <DockPanel> + <TextBox materialDesign:HintAssist.Hint="Table Name" DockPanel.Dock="Top" Text="{Binding ProcessParametersTables.Name}"></TextBox> + <WrapPanel Orientation="Vertical" Margin="0 5 0 0"> + <WrapPanel.Resources> + <Style TargetType="TextBlock" BasedOn="{StaticResource {x:Type TextBlock}}"> + <Setter Property="FontSize" Value="10"></Setter> + <Setter Property="Foreground" Value="Gray"></Setter> + <Setter Property="Margin" Value="0 5 0 5"></Setter> + <Setter Property="MinWidth" Value="80"></Setter> + </Style> - <ScrollViewer Margin="30 10 30 0"> - <db:RmlView Margin="0 0 10 0" IsEnabled="False" DataContext="{Binding SelectedRML,Converter={StaticResource DbRmlViewToEntityConverter}}" /> - </ScrollViewer> - </DockPanel> - </TabItem> - <TabItem Header="PROCESS"> + <Style TargetType="Border"> + <Setter Property="BorderBrush" Value="Gainsboro"></Setter> + <Setter Property="BorderThickness" Value="1"></Setter> + <Setter Property="Padding" Value="2"></Setter> + <Setter Property="Margin" Value="5"></Setter> + <Setter Property="CornerRadius" Value="3"></Setter> + </Style> + + + </WrapPanel.Resources> - </TabItem> - <TabItem Header="CONTROL"> + <Border> + <StackPanel> + <TextBlock>Dyeing Speed:</TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding ProcessParametersTables.DyeingSpeed,Mode=TwoWay}"></mahapps:NumericUpDown> + </StackPanel> + </Border> - </TabItem> - </TabControl> + <Border> + <StackPanel> + <TextBlock>Min Ink Uptake:</TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding ProcessParametersTables.MinInkUptake,Mode=TwoWay}"></mahapps:NumericUpDown> + </StackPanel> + </Border> - <!--<materialDesign:Card Background="{DynamicResource MaterialDesignBackground}"> - <StackPanel> - <Expander Header="MACHINE"> + <Border> + <StackPanel> + <TextBlock>Mixer Temp:</TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding ProcessParametersTables.MixerTemp,Mode=TwoWay}"></mahapps:NumericUpDown> + </StackPanel> + </Border> - </Expander> + <Border> + <StackPanel> + <TextBlock>Head Zone1 Temp:</TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding ProcessParametersTables.HeadZone1Temp,Mode=TwoWay}"></mahapps:NumericUpDown> + </StackPanel> + </Border> - <Separator Foreground="{StaticResource MaterialDesignDivider}" Background="{StaticResource MaterialDesignDivider}" /> + <Border> + <StackPanel> + <TextBlock>Head Zone2 Temp:</TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding ProcessParametersTables.HeadZone2Temp,Mode=TwoWay}"></mahapps:NumericUpDown> + </StackPanel> + </Border> - <Expander Header="MEDIA"> + <Border> + <StackPanel> + <TextBlock>Head Zone3 Temp:</TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding ProcessParametersTables.HeadZone3Temp,Mode=TwoWay}"></mahapps:NumericUpDown> + </StackPanel> + </Border> - </Expander> + <Border> + <StackPanel> + <TextBlock>Head Air Flow:</TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding ProcessParametersTables.HeadAirFlow,Mode=TwoWay}"></mahapps:NumericUpDown> + </StackPanel> + </Border> - <Separator Foreground="{StaticResource MaterialDesignDivider}" Background="{StaticResource MaterialDesignDivider}" /> + <Border> + <StackPanel> + <TextBlock>Feeder Tension:</TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding ProcessParametersTables.FeederTension,Mode=TwoWay}"></mahapps:NumericUpDown> + </StackPanel> + </Border> - <Expander Header="PROCESS"> + <Border> + <StackPanel> + <TextBlock>Puller Tension:</TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding ProcessParametersTables.PullerTension,Mode=TwoWay}"></mahapps:NumericUpDown> + </StackPanel> + </Border> - </Expander> + <Border> + <StackPanel> + <TextBlock>Dryer Buffer Length:</TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding ProcessParametersTables.DryerBufferLength,Mode=TwoWay}"></mahapps:NumericUpDown> + </StackPanel> + </Border> - <Separator Foreground="{StaticResource MaterialDesignDivider}" Background="{StaticResource MaterialDesignDivider}" /> + <Border> + <StackPanel> + <TextBlock>Dryer Zone1 Temp:</TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding ProcessParametersTables.DryerZone1Temp,Mode=TwoWay}"></mahapps:NumericUpDown> + </StackPanel> + </Border> - <Expander Header="CONTROL"> + <Border> + <StackPanel> + <TextBlock>Dryer Zone2 Temp:</TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding ProcessParametersTables.DryerZone2Temp,Mode=TwoWay}"></mahapps:NumericUpDown> + </StackPanel> + </Border> - </Expander> - </StackPanel> - </materialDesign:Card>--> + <Border> + <StackPanel> + <TextBlock>Dryer Zone3 Temp:</TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding ProcessParametersTables.DryerZone3Temp,Mode=TwoWay}"></mahapps:NumericUpDown> + </StackPanel> + </Border> + + + <Border> + <StackPanel> + <TextBlock>Dryer Air Flow:</TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding ProcessParametersTables.DryerAirFlow,Mode=TwoWay}"></mahapps:NumericUpDown> + </StackPanel> + </Border> + + <Border> + <StackPanel> + <TextBlock>Winder Tension:</TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding ProcessParametersTables.WinderTension,Mode=TwoWay}"></mahapps:NumericUpDown> + </StackPanel> + </Border> + + <Border> + <StackPanel> + <TextBlock>Lubrication NL/CM:</TextBlock> + <mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding ProcessParametersTables.LubricationNlPerCm,Mode=TwoWay}"></mahapps:NumericUpDown> + </StackPanel> + </Border> + + <Border> + <StackPanel> + <TextBlock>Lubrication:</TextBlock> + <ToggleButton HorizontalAlignment="Right" IsChecked="{Binding ProcessParametersTables.Lubrication}"></ToggleButton> + </StackPanel> + </Border> + </WrapPanel> + </DockPanel> + </Border> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </StackPanel> + </Grid> + + <Grid Height="150"> + <Grid.Style> + <Style TargetType="Grid"> + <Setter Property="Visibility" Value="Visible"></Setter> + <Style.Triggers> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding SelectedMachine,Converter={StaticResource NullObjectToBooleanConverter}}" Value="True"></Condition> + <Condition Binding="{Binding SelectedRML,Converter={StaticResource NullObjectToBooleanConverter}}" Value="True"></Condition> + </MultiDataTrigger.Conditions> + <Setter Property="Visibility" Value="Collapsed"></Setter> + </MultiDataTrigger> + </Style.Triggers> + </Style> + </Grid.Style> + <TextBlock Foreground="#FA9292" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="24">SELECT MACHINE & MEDIA</TextBlock> + </Grid> + </Grid> + </Expander> + <Expander Header="CONTROLS PARAMETERS" IsExpanded="False"> + + </Expander> + </StackPanel> + </ScrollViewer> - <!--<Grid> - <GroupBox Header="MEDIA" Margin="5"></GroupBox> + <Rectangle VerticalAlignment="Bottom" Stroke="#CECECE" StrokeThickness="1"></Rectangle> </Grid> <Grid Grid.Row="1"> - <GroupBox Header="PROCESS PARAMETERS" Margin="5"></GroupBox> + <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Margin="344,265,343,352" Grid.Row="1">CENTER</TextBlock> </Grid> + </Grid> + + <Grid Background="{StaticResource SideBarBackground}"> + <Grid.Style> + <Style TargetType="Grid"> + <Setter Property="Width" Value="550"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding IsSideBarOpened}" Value="True"> + <DataTrigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="Width" To="550" Duration="00:00:0.2"></DoubleAnimation> + </Storyboard> + </BeginStoryboard> + </DataTrigger.EnterActions> + <DataTrigger.ExitActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="Width" To="0" Duration="00:00:0.2"></DoubleAnimation> + </Storyboard> + </BeginStoryboard> + </DataTrigger.ExitActions> + </DataTrigger> + </Style.Triggers> + </Style> + </Grid.Style> + + <ScrollViewer VerticalScrollBarVisibility="Auto" FlowDirection="RightToLeft"> + <materialDesign:Card Background="{StaticResource SideBarBackground}" FlowDirection="LeftToRight"> + <StackPanel> + <Expander Header="MACHINE" IsExpanded="True" Background="{StaticResource SideBarBackground}"> + <StackPanel Margin="0 0 0 0"> + <ComboBox ItemsSource="{Binding Adapter.Machines}" SelectedItem="{Binding SelectedMachine}" materialDesign:HintAssist.IsFloating="True" materialDesign:HintAssist.Hint="Selected Machine" Margin="40 0 40 0"> + <ComboBox.ItemTemplate> + <DataTemplate> + <StackPanel> + <TextBlock Text="{Binding SerialNumber}" FontWeight="Bold" FontStyle="Italic"></TextBlock> + <TextBlock FontSize="11" Text="{Binding Name}" Foreground="Gray"></TextBlock> + </StackPanel> + </DataTemplate> + </ComboBox.ItemTemplate> + </ComboBox> + <designer:MachineView IsHitTestVisible="False" Margin="0 40 0 0" DataContext="{Binding SelectedMachine}" /> + <Button Command="{Binding EditMachineCommand}" HorizontalAlignment="Right" Margin="0 10 20 20" Style="{StaticResource MaterialDesignFlatButton}"> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon VerticalAlignment="Center" Kind="Pencil"></materialDesign:PackIcon> + <TextBlock Margin="10 0 0 0">EDIT</TextBlock> + </StackPanel> + </Button> + </StackPanel> + </Expander> + + <Separator Foreground="{StaticResource MaterialDesignDivider}" Background="{StaticResource MaterialDesignDivider}" /> + + <Expander Header="MEDIA" Background="{StaticResource SideBarBackground}" IsExpanded="True"> + <StackPanel> + <ComboBox DockPanel.Dock="Top" ItemsSource="{Binding Adapter.Rmls}" SelectedItem="{Binding SelectedRML,Converter={StaticResource DbRmlViewToEntityConverter}}" materialDesign:HintAssist.IsFloating="True" materialDesign:HintAssist.Hint="Selected Thread" Margin="40 0 40 0"> + <ComboBox.ItemTemplate> + <DataTemplate> + <StackPanel> + <TextBlock Text="{Binding Name}" FontWeight="Bold" FontStyle="Italic"></TextBlock> + <TextBlock FontSize="11" Text="{Binding Manufacturer}" Foreground="Gray"></TextBlock> + </StackPanel> + </DataTemplate> + </ComboBox.ItemTemplate> + </ComboBox> + + <Button DockPanel.Dock="Bottom" Command="{Binding EditRMLCommand}" HorizontalAlignment="Right" Margin="0 10 20 20" Style="{StaticResource MaterialDesignFlatButton}"> + <StackPanel Orientation="Horizontal"> + <materialDesign:PackIcon VerticalAlignment="Center" Kind="Pencil"></materialDesign:PackIcon> + <TextBlock Margin="10 0 0 0">EDIT</TextBlock> + </StackPanel> + </Button> + </StackPanel> + </Expander> - <Grid Grid.Row="2"> - <GroupBox Header="CONTROL PARAMETERS" Margin="5"></GroupBox> - </Grid>--> + <Separator Foreground="{StaticResource MaterialDesignDivider}" Background="{StaticResource MaterialDesignDivider}" /> + + <Expander Background="{StaticResource SideBarBackground}" IsExpanded="True"> + <Expander.HeaderTemplate> + <DataTemplate> + <TextBlock><Run>LIQUID FACTORS</Run> <Run FontSize="10" Foreground="DimGray">( Max Nanolitter/CM )</Run></TextBlock> + </DataTemplate> + </Expander.HeaderTemplate> + + <Grid> + <StackPanel Margin="40 0 40 0"> + <ItemsControl ItemsSource="{Binding LiquidTypesRmls}"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <WrapPanel IsItemsHost="True"></WrapPanel> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate DataType="{x:Type observables:LiquidTypesRml}"> + <StackPanel Margin="0 0 10 20"> + <TextBlock HorizontalAlignment="Center" FontSize="10" Foreground="DimGray" Text="{Binding LiquidTypes.Name}"></TextBlock> + <Grid Width="60" Height="50" Margin="0 5 0 0"> + <shapes:Hexagon StrokeThickness="1" Stroke="Gray"> + <shapes:Hexagon.Fill> + <LinearGradientBrush Opacity="0.7" > + <GradientStop Color="{Binding LiquidTypes.Color,Converter={StaticResource ColorToIntegerConverter}}"/> + <GradientStop Color="White" Offset="1"/> + </LinearGradientBrush> + </shapes:Hexagon.Fill> + </shapes:Hexagon> + + <TextBox Style="{x:Null}" Background="Transparent" Foreground="Black" BorderThickness="0" Text="{Binding MaxNlPerCm}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontWeight="Bold" FontStyle="Italic"></TextBox> + </Grid> + <!--<mahapps:NumericUpDown Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding MaxNlPerCm,Mode=TwoWay}"></mahapps:NumericUpDown>--> + </StackPanel> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </StackPanel> + + <Grid Height="150"> + <Grid.Style> + <Style TargetType="Grid"> + <Setter Property="Visibility" Value="Visible"></Setter> + <Style.Triggers> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding SelectedMachine,Converter={StaticResource NullObjectToBooleanConverter}}" Value="True"></Condition> + <Condition Binding="{Binding SelectedRML,Converter={StaticResource NullObjectToBooleanConverter}}" Value="True"></Condition> + </MultiDataTrigger.Conditions> + <Setter Property="Visibility" Value="Collapsed"></Setter> + </MultiDataTrigger> + </Style.Triggers> + </Style> + </Grid.Style> + <TextBlock Foreground="#FA9292" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="24">SELECT MACHINE & MEDIA</TextBlock> + </Grid> + </Grid> + </Expander> + + + </StackPanel> + </materialDesign:Card> + </ScrollViewer> - <!--<Grid Grid.Row="3"> - <Button Height="40">EXPORT</Button> - </Grid>--> + <Rectangle HorizontalAlignment="Right" Stroke="#CECECE" StrokeThickness="1"></Rectangle> </Grid> + <Button Background="{StaticResource SideBarBackground}" Command="{Binding ToggleSideBarCommand}" Padding="0" Style="{StaticResource MaterialDesignFlatButton}" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" HorizontalAlignment="Right" VerticalAlignment="Center" Height="200" Width="50" Margin="0 0 -50 0"> + <Border CornerRadius="0 10 10 0" BorderThickness="0 1 1 1" BorderBrush="#C6C0C0"> + <Grid> + <TextBlock Text="CONFIGURATION" FontSize="16" RenderTransformOrigin="0.5,0.5" VerticalAlignment="Center" HorizontalAlignment="Center"> + <TextBlock.LayoutTransform> + <RotateTransform Angle="270"></RotateTransform> + </TextBlock.LayoutTransform> + </TextBlock> + </Grid> + </Border> + </Button> </Grid> </Grid> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineView.xaml index a54f9bbdc..a7e604352 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MachineView.xaml @@ -13,7 +13,7 @@ xmlns:vm="clr-namespace:Tango.MachineStudio.MachineDesigner.ViewModels" xmlns:local="clr-namespace:Tango.MachineStudio.MachineDesigner.Views" mc:Ignorable="d" - d:DesignHeight="720" d:DesignWidth="1280" Background="White" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}"> + d:DesignHeight="720" d:DesignWidth="1280" d:DataContext="{d:DesignInstance Type=vm:MainViewVM, IsDesignTimeCreatable=False}"> <UserControl.Resources> <sharedConverters:ColorToIntegerConverter x:Key="ColorToIntegerConverter" /> |
