diff options
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner')
5 files changed, 57 insertions, 2 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Images/formula.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Images/formula.png Binary files differnew file mode 100644 index 000000000..6f476e79c --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Images/formula.png diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Tango.MachineStudio.MachineDesigner.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Tango.MachineStudio.MachineDesigner.csproj index 64c54b357..bebcf2480 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Tango.MachineStudio.MachineDesigner.csproj +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Tango.MachineStudio.MachineDesigner.csproj @@ -226,5 +226,8 @@ <ItemGroup> <Resource Include="Images\machine-designer-module.jpg" /> </ItemGroup> + <ItemGroup> + <Resource Include="Images\formula.png" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> </Project>
\ No newline at end of file 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 5cb216a6c..f4da7beaa 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 @@ -361,6 +361,18 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels idsPack.LiquidTypeGuid = liquidType.Guid; } + /// <summary> + /// Drops the ids formula. + /// </summary> + /// <param name="idsPackFormula">The ids pack formula.</param> + /// <param name="idsPack">The ids pack.</param> + /// <exception cref="NotImplementedException"></exception> + public void DropIdsFormula(IdsPackFormula idsPackFormula, IdsPack idsPack) + { + idsPack.IdsPackFormula = idsPackFormula; + idsPack.IdsPackFormulaGuid = idsPackFormula.Guid; + } + #endregion #region Private Methods diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml index e442e0e6f..61259508a 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml @@ -226,6 +226,12 @@ </LinearGradientBrush> </Rectangle.Fill> </Rectangle> + + <TextBlock Text="{Binding IdsPackFormula.Name}" TextWrapping="Wrap" Height="30" IsHitTestVisible="False" Width="50" Margin="-20 15 0 0" FontSize="7" TextAlignment="Center" RenderTransformOrigin="0.5,0.5" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"> + <TextBlock.LayoutTransform> + <RotateTransform Angle="90" /> + </TextBlock.LayoutTransform> + </TextBlock> </Grid> </UniformGrid> @@ -417,6 +423,10 @@ <Image RenderOptions.BitmapScalingMode="Fant" Source="../Images/liquid.png" Width="12" VerticalAlignment="Center"></Image> <TextBlock Margin="5 0 0 0" VerticalAlignment="Center"><Run FontWeight="Bold">Liquid:</Run> <Run FontStyle="Italic" Text="{Binding LiquidType.Name}"></Run></TextBlock> </StackPanel> + <StackPanel Orientation="Horizontal" Margin="0 3 0 3"> + <Image RenderOptions.BitmapScalingMode="Fant" Source="../Images/formula.png" Width="12" VerticalAlignment="Center"></Image> + <TextBlock Margin="5 0 0 0" VerticalAlignment="Center"><Run FontWeight="Bold">Formula:</Run> <Run FontStyle="Italic" Text="{Binding IdsPackFormula.Name}"></Run></TextBlock> + </StackPanel> </StackPanel> </StackPanel> </DataTemplate> @@ -618,6 +628,32 @@ </ListBox> </Expander> <Border Height="1" HorizontalAlignment="Stretch" Background="{DynamicResource MaterialDesignDivider}" SnapsToDevicePixels="True" /> + <Expander HorizontalAlignment="Stretch" Header="Formulas"> + <ListBox ItemsSource="{Binding Adapter.IdsPackFormulasViewSource}" HorizontalContentAlignment="Stretch"> + <ListBox.ItemContainerStyle> + <Style TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}"> + <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter> + <Setter Property="VerticalContentAlignment" Value="Stretch"></Setter> + <Setter Property="Padding" Value="1"></Setter> + </Style> + </ListBox.ItemContainerStyle> + <ListBox.ItemTemplate> + <DataTemplate> + <Grid Background="Transparent" IsHitTestVisible="True" dragAndDrop:DragAndDropService.DraggableBorderBrush="{StaticResource AccentColorBrush}" dragAndDrop:DragAndDropService.Draggable="True" dragAndDrop:DragAndDropService.DraggingSurface="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DraggingSurface}"> + <StackPanel Orientation="Horizontal" Margin="2 8"> + <Image IsHitTestVisible="False" Width="24" Height="24" Source="../Images/formula.png" Stretch="Fill" RenderOptions.BitmapScalingMode="Fant"></Image> + <StackPanel Margin="5 0 0 0" IsHitTestVisible="False"> + <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="DimGray"><Run Text="{Binding Name}"></Run></TextBlock> + </StackPanel> + </StackPanel> + + <Rectangle Margin="0 10 0 0" VerticalAlignment="Bottom" Stroke="Gainsboro" StrokeThickness="1"></Rectangle> + </Grid> + </DataTemplate> + </ListBox.ItemTemplate> + </ListBox> + </Expander> + <Border Height="1" HorizontalAlignment="Stretch" Background="{DynamicResource MaterialDesignDivider}" SnapsToDevicePixels="True" /> <Expander HorizontalAlignment="Stretch" Header="Touch Panels"> <ListBox ItemsSource="{Binding Adapter.ApplicationDisplayPanelVersionsViewSource}" HorizontalContentAlignment="Stretch"> <ListBox.ItemContainerStyle> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml.cs index 6d08a10e0..70e127b6c 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml.cs @@ -62,7 +62,7 @@ namespace Tango.MachineStudio.MachineDesigner.Views { SetHighlightRegion(hardwareGrid); } - else if (e.DataContext is ApplicationVersion || e.DataContext is ApplicationOsVersion || e.DataContext is ApplicationDisplayPanelVersion) + else if (e.DataContext is ApplicationVersion || e.DataContext is ApplicationOsVersion || e.DataContext is ApplicationDisplayPanelVersion || e.DataContext is ApplicationFirmwareVersion) { SetHighlightRegion(gridTablet); } @@ -70,7 +70,7 @@ namespace Tango.MachineStudio.MachineDesigner.Views { SetHighlightRegion(gridEmbedded); } - else if (e.DataContext is DispenserType || e.DataContext is CartridgeType || e.DataContext is LiquidType || e.DataContext is MidTankType) + else if (e.DataContext is DispenserType || e.DataContext is CartridgeType || e.DataContext is LiquidType || e.DataContext is MidTankType || e.DataContext is IdsPackFormula) { SetHighlightRegion(gridIds); } @@ -102,6 +102,10 @@ namespace Tango.MachineStudio.MachineDesigner.Views { _vm.DropMidTankType(e.Draggable.DataContext as MidTankType, e.Droppable.DataContext as IdsPack); } + else if (e.Draggable.DataContext is IdsPackFormula) + { + _vm.DropIdsFormula(e.Draggable.DataContext as IdsPackFormula, e.Droppable.DataContext as IdsPack); + } else if (e.Draggable.DataContext is IdsPack) { _vm.DropIdsPack(e.Draggable.DataContext as IdsPack, e.Droppable.DataContext as IdsPack); |
