diff options
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner')
3 files changed, 17 insertions, 42 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs index cad54c848..ddc0d91a3 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs @@ -36,6 +36,7 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels { public class MainViewVM : StudioViewModel<IMainView> { + private const int MAX_IDS_PACKS = 12; private INotificationProvider _notification; private IActionLogManager _actionLogManager; private IAuthenticationProvider _authentication; @@ -283,7 +284,7 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels _machines_action_timer = new ActionTimer(TimeSpan.FromMilliseconds(200)); _dispensers_action_timer = new ActionTimer(TimeSpan.FromMilliseconds(200)); - AddIdsCommand = new RelayCommand(AddIds, (x) => ActiveMachine != null && ActiveMachine.Configuration != null && ActiveMachine.Configuration.IdsPacks.Count < 10); + AddIdsCommand = new RelayCommand(AddIds, (x) => ActiveMachine != null && ActiveMachine.Configuration != null && ActiveMachine.Configuration.IdsPacks.Count < MAX_IDS_PACKS); RemoveIdsCommand = new RelayCommand(RemoveIds, (x) => SelectedIds != null); EditMachineCommand = new RelayCommand(() => LoadSelectedMachine(), () => SelectedMachine != null); BackToMachinesCommand = new RelayCommand(() => View.NavigateTo(MachineDesignerNavigationView.MachinesView)); diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/ConfigurationView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/ConfigurationView.xaml index d1eaaaeff..9b99c9ec5 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/ConfigurationView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/ConfigurationView.xaml @@ -139,18 +139,6 @@ <materialDesign:PackIcon Kind="Minus" Width="24" Height="24"></materialDesign:PackIcon> </Button> - <UniformGrid Width="310" Canvas.Top="295" Canvas.Left="420" Rows="1" Columns="10" TextElement.FontSize="9"> - <TextBlock HorizontalAlignment="Center">1</TextBlock> - <TextBlock HorizontalAlignment="Center">2</TextBlock> - <TextBlock HorizontalAlignment="Center">3</TextBlock> - <TextBlock HorizontalAlignment="Center">4</TextBlock> - <TextBlock HorizontalAlignment="Center">5</TextBlock> - <TextBlock HorizontalAlignment="Center">6</TextBlock> - <TextBlock HorizontalAlignment="Center">7</TextBlock> - <TextBlock HorizontalAlignment="Center">8</TextBlock> - <TextBlock HorizontalAlignment="Center">9</TextBlock> - <TextBlock HorizontalAlignment="Center">10</TextBlock> - </UniformGrid> <Grid x:Name="gridIds" Width="310" Height="195" Canvas.Top="314" Canvas.Left="420"> <ListBox ItemsSource="{Binding ActiveMachine.Configuration.IdsPacks}" SelectedItem="{Binding SelectedIds}" ScrollViewer.VerticalScrollBarVisibility="Disabled" ScrollViewer.HorizontalScrollBarVisibility="Disabled"> <ListBox.ItemContainerStyle> @@ -162,13 +150,14 @@ </ListBox.ItemContainerStyle> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> - <UniformGrid Columns="10"></UniformGrid> + <UniformGrid Rows="1"></UniformGrid> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.ItemTemplate> <DataTemplate> - <Grid dragAndDrop:DragAndDropService.DraggableBorderBrush="{StaticResource AccentColorBrush}" dragAndDrop:DragAndDropService.Drop="OnDropOnIdsPack"> + <Grid MaxWidth="35" dragAndDrop:DragAndDropService.DraggableBorderBrush="{StaticResource AccentColorBrush}" dragAndDrop:DragAndDropService.Drop="OnDropOnIdsPack"> <Grid.RowDefinitions> + <RowDefinition Height="11"/> <RowDefinition Height="1*"/> <RowDefinition Height="30"/> </Grid.RowDefinitions> @@ -179,7 +168,7 @@ </Style.Triggers> </Style> </Grid.Style> - <UniformGrid Columns="1" Rows="2"> + <UniformGrid Grid.Row="1" Columns="1" Rows="2"> <Grid Margin="2"> <Image IsHitTestVisible="False" Source="../Images/dispenser.png" RenderOptions.BitmapScalingMode="Fant"> <Image.Style> @@ -231,7 +220,7 @@ </Grid> </UniformGrid> - <Grid Grid.Row="1" Margin="3" IsHitTestVisible="False"> + <Grid Grid.Row="2" Margin="3" IsHitTestVisible="False"> <Grid.Style> <Style TargetType="Grid"> <Style.Triggers> @@ -258,6 +247,8 @@ </Border.Background> </Border> </Grid> + + <TextBlock Grid.Row="0" FontSize="9" HorizontalAlignment="Center" VerticalAlignment="Top" Text="{Binding PackIndex}"></TextBlock> </Grid> </DataTemplate> </ItemsControl.ItemTemplate> 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 54e47c0d4..ea2e2e84d 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 @@ -69,19 +69,6 @@ <Rectangle Stroke="Gray" HorizontalAlignment="Left" StrokeThickness="1" StrokeDashArray="5" RenderTransformOrigin="0.5,0.5"/> </Grid> - <UniformGrid Width="310" Canvas.Top="295" Canvas.Left="420" Rows="1" Columns="10" TextElement.FontSize="9"> - <TextBlock HorizontalAlignment="Center">1</TextBlock> - <TextBlock HorizontalAlignment="Center">2</TextBlock> - <TextBlock HorizontalAlignment="Center">3</TextBlock> - <TextBlock HorizontalAlignment="Center">4</TextBlock> - <TextBlock HorizontalAlignment="Center">5</TextBlock> - <TextBlock HorizontalAlignment="Center">6</TextBlock> - <TextBlock HorizontalAlignment="Center">7</TextBlock> - <TextBlock HorizontalAlignment="Center">8</TextBlock> - <TextBlock HorizontalAlignment="Center">9</TextBlock> - <TextBlock HorizontalAlignment="Center">10</TextBlock> - </UniformGrid> - <Grid x:Name="gridIds" Width="310" Height="195" Canvas.Top="314" Canvas.Left="420"> <ListBox ItemsSource="{Binding Configuration.IdsPacks}" ScrollViewer.VerticalScrollBarVisibility="Disabled" ScrollViewer.HorizontalScrollBarVisibility="Disabled"> <ListBox.ItemContainerStyle> @@ -93,24 +80,18 @@ </ListBox.ItemContainerStyle> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> - <UniformGrid Columns="10"></UniformGrid> + <UniformGrid Rows="1"></UniformGrid> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.ItemTemplate> <DataTemplate> - <Grid dragAndDrop:DragAndDropService.DraggableBorderBrush="{StaticResource AccentColorBrush}" > + <Grid MaxWidth="35"> <Grid.RowDefinitions> + <RowDefinition Height="11"/> <RowDefinition Height="1*"/> <RowDefinition Height="30"/> </Grid.RowDefinitions> - <Grid.Style> - <Style TargetType="Grid" BasedOn="{StaticResource draggableGrid}"> - <Style.Triggers> - - </Style.Triggers> - </Style> - </Grid.Style> - <UniformGrid Columns="1" Rows="2"> + <UniformGrid Grid.Row="1" Columns="1" Rows="2"> <Grid Margin="2"> <Image IsHitTestVisible="False" Source="../Images/dispenser.png" RenderOptions.BitmapScalingMode="Fant"> <Image.Style> @@ -156,7 +137,7 @@ </Grid> </UniformGrid> - <Grid Grid.Row="1" Margin="3" IsHitTestVisible="False"> + <Grid Grid.Row="2" Margin="3" IsHitTestVisible="False"> <Grid.Style> <Style TargetType="Grid"> <Style.Triggers> @@ -183,6 +164,8 @@ </Border.Background> </Border> </Grid> + + <TextBlock Grid.Row="0" FontSize="9" HorizontalAlignment="Center" VerticalAlignment="Top" Text="{Binding PackIndex}"></TextBlock> </Grid> </DataTemplate> </ItemsControl.ItemTemplate> @@ -199,7 +182,7 @@ </Style.Triggers> </Style> </Grid.Style> - <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="20" FontWeight="Bold" Foreground="Gainsboro">NO IDS PACKS</TextBlock> + <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="20" FontWeight="Bold" Foreground="{StaticResource BorderBrushGainsboro}">NO IDS PACKS</TextBlock> </Grid> <Rectangle VerticalAlignment="Bottom" Stroke="DimGray" StrokeThickness="1"> |
