diff options
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner')
12 files changed, 515 insertions, 90 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/AutoComplete/MachinesProvider.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/AutoComplete/MachinesProvider.cs new file mode 100644 index 000000000..943c52f81 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/AutoComplete/MachinesProvider.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.AutoComplete.Editors; +using Tango.DAL.Observables; + +namespace Tango.MachineStudio.MachineDesigner.AutoComplete +{ + public class MachinesProvider : ISuggestionProvider + { + public IEnumerable GetSuggestions(string filter) + { + return ObservablesEntitiesAdapter.Instance.Machines.Where(x => x.SerialNumber.StartsWith(filter, StringComparison.CurrentCultureIgnoreCase)).ToList(); + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Images/app.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Images/app.png Binary files differnew file mode 100644 index 000000000..9798ed866 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Images/app.png diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Images/dispenser.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Images/dispenser.png Binary files differindex 82cf1a39a..b7c292bf9 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Images/dispenser.png +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Images/dispenser.png diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Images/embedded-software.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Images/embedded-software.png Binary files differnew file mode 100644 index 000000000..b6a2087aa --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Images/embedded-software.png diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Images/embedded.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Images/embedded.png Binary files differnew file mode 100644 index 000000000..d0b917b44 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Images/embedded.png diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Images/mid-tank.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Images/mid-tank.png Binary files differindex d22896e86..6603d1b9f 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Images/mid-tank.png +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Images/mid-tank.png diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Images/tablet.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Images/tablet.png Binary files differnew file mode 100644 index 000000000..1a09683eb --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Images/tablet.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 fbec9280e..2c3f6c674 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 @@ -31,6 +31,9 @@ <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> + <Reference Include="FontAwesome.WPF, Version=4.7.0.37774, Culture=neutral, PublicKeyToken=0758b07a11a4f466, processorArchitecture=MSIL"> + <HintPath>..\..\..\packages\FontAwesome.WPF.4.7.0.9\lib\net40\FontAwesome.WPF.dll</HintPath> + </Reference> <Reference Include="GalaSoft.MvvmLight, Version=5.3.0.19026, Culture=neutral, PublicKeyToken=e7570ab207bcb616, processorArchitecture=MSIL"> <HintPath>..\..\..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.dll</HintPath> </Reference> @@ -71,6 +74,7 @@ <Reference Include="PresentationFramework" /> </ItemGroup> <ItemGroup> + <Compile Include="AutoComplete\MachinesProvider.cs" /> <Compile Include="ViewModelLocator.cs" /> <Compile Include="ViewModels\MainViewVM.cs" /> <Compile Include="Views\MainView.xaml.cs"> @@ -183,5 +187,15 @@ <Resource Include="Images\liquid.png" /> <Resource Include="Images\tank.png" /> </ItemGroup> + <ItemGroup> + <Resource Include="Images\embedded.png" /> + <Resource Include="Images\tablet.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\app.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\embedded-software.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 dbba1962e..241297d85 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 @@ -32,7 +32,7 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels public Machine Machine { get { return _machine; } - set { _machine = value; RaisePropertyChangedAuto(); } + set { _machine = value; RaisePropertyChangedAuto(); OnMachineChanged(); } } private Configuration _configuration; @@ -45,8 +45,22 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels set { _configuration = value; RaisePropertyChangedAuto(); } } + private IdsPack _selectedIds; + /// <summary> + /// Gets or sets the selected ids pack. + /// </summary> + public IdsPack SelectedIds + { + get { return _selectedIds; } + set { _selectedIds = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } + } + public RelayCommand SaveCommand { get; set; } + public RelayCommand AddIdsCommand { get; set; } + + public RelayCommand RemoveIdsCommand { get; set; } + /// <summary> /// Initializes a new instance of the <see cref="MainViewVM"/> class. /// </summary> @@ -56,15 +70,59 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels Adapter = ObservablesEntitiesAdapter.Instance; Configuration = new Configuration(); - Configuration.Name = "Config 2"; + Configuration.Name = "Untitled"; + SaveCommand = new RelayCommand(Save, (x) => !_isSaving); + AddIdsCommand = new RelayCommand(AddIds, (x) => !_isSaving && Configuration.IdsPacks.Count < 8); + RemoveIdsCommand = new RelayCommand(RemoveIds, (x) => !_isSaving && SelectedIds != null); + } - for (int i = 0; i < 8; i++) + private void OnMachineChanged() + { + if (Machine != null) + { + Configuration = Machine.Configuration; + } + else { - Configuration.IdsPacks.Add(new IdsPack() { Name = "IDS PACK " + i }); + Configuration = new Configuration() { Name = "Untitled" }; } + } - SaveCommand = new RelayCommand(Save, (x) => !_isSaving); + public void DropTouchPanel(ApplicationDisplayPanelVersion applicationDisplayPanelVersion) + { + Configuration.ApplicationDisplayPanelVersions = applicationDisplayPanelVersion; + Configuration.ApplicationDisplayPanelVersionGuid = applicationDisplayPanelVersion.Guid; + } + + public void DropApplicationVersion(ApplicationVersion applicationVersion) + { + Configuration.ApplicationVersions = applicationVersion; + Configuration.ApplicationVersionGuid = applicationVersion.Guid; + } + + public void DropEmbeddedFirmware(EmbeddedFirmwareVersion embeddedFirmwareVersion) + { + Configuration.EmbeddedFirmwareVersions = embeddedFirmwareVersion; + Configuration.EmbeddedFirmwareVersionGuid = embeddedFirmwareVersion.Guid; + } + + public void DropEmbeddedSoftware(EmbeddedSoftwareVersion embeddedSoftwareVersion) + { + Configuration.EmbeddedSoftwareVersions = embeddedSoftwareVersion; + Configuration.EmbeddedSoftwareVersionGuid = embeddedSoftwareVersion.Guid; + } + + private void RemoveIds() + { + Configuration.IdsPacks.Remove(SelectedIds); + SelectedIds = null; + } + + private void AddIds() + { + Configuration.IdsPacks.Add(new IdsPack()); + InvalidateRelayCommands(); } public void DropCartridgeType(CartridgeType cartridgeType, IdsPack idsPack) 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 1542adf49..48b90aa6b 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 @@ -5,6 +5,9 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:dragAndDrop="clr-namespace:Tango.DragAndDrop;assembly=Tango.DragAndDrop" xmlns:global="clr-namespace:Tango.MachineStudio.MachineDesigner" + xmlns:fa="http://schemas.fontawesome.io/icons/" + xmlns:providers="clr-namespace:Tango.MachineStudio.MachineDesigner.AutoComplete" + xmlns:autoComplete="clr-namespace:Tango.AutoComplete.Editors;assembly=Tango.AutoComplete" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:sharedConverters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" xmlns:vm="clr-namespace:Tango.MachineStudio.MachineDesigner.ViewModels" @@ -14,6 +17,7 @@ <UserControl.Resources> <sharedConverters:ColorToIntegerConverter x:Key="ColorToIntegerConverter" /> + <providers:MachinesProvider x:Key="MachinesProvider"></providers:MachinesProvider> <Style x:Key="draggableGrid" TargetType="Grid"> <Setter Property="RenderTransform"> @@ -48,100 +52,293 @@ </Trigger> </Style.Triggers> </Style> + + <Style TargetType="Expander" BasedOn="{StaticResource {x:Type Expander}}"> + <Setter Property="HeaderTemplate"> + <Setter.Value> + <DataTemplate> + <TextBlock Text="{Binding}" FontSize="13"></TextBlock> + </DataTemplate> + </Setter.Value> + </Setter> + </Style> </UserControl.Resources> <Grid> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="477*"/> - <ColumnDefinition Width="250"/> + <ColumnDefinition Width="310"/> </Grid.ColumnDefinitions> <Grid> - <Viewbox MaxWidth="900"> - <Grid> - <Image Source="../Images/machine-full-fx.png" MaxWidth="800" RenderOptions.BitmapScalingMode="Fant"> - <Image.Effect> - <DropShadowEffect ShadowDepth="0" BlurRadius="20" Opacity="1" RenderingBias="Performance" Color="DimGray"></DropShadowEffect> - </Image.Effect> - </Image> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="200"/> + <ColumnDefinition Width="1*"/> + </Grid.ColumnDefinitions> + + <Grid Grid.Column="1"> + <Grid.RowDefinitions> + <RowDefinition Height="89*"/> + <RowDefinition Height="631*"/> + </Grid.RowDefinitions> - <Canvas> - <Grid Width="310" Height="195" Canvas.Top="314" Canvas.Left="420"> - <ItemsControl ItemsSource="{Binding Configuration.IdsPacks}"> - <ItemsControl.ItemsPanel> - <ItemsPanelTemplate> - <UniformGrid Columns="8"></UniformGrid> - </ItemsPanelTemplate> - </ItemsControl.ItemsPanel> - <ItemsControl.ItemTemplate> + <Grid> + <TextBlock FontSize="30" FontStyle="Italic" VerticalAlignment="Center" Margin="50 10 10 10" Foreground="Silver" FontWeight="Bold">MACHINE DESIGNER</TextBlock> + <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0 0 50 0"> + <StackPanel Orientation="Horizontal"> + <fa:ImageAwesome Icon="Key" Width="24" Height="24" Foreground="Silver"></fa:ImageAwesome> + <autoComplete:AutoCompleteTextBox FontSize="14" Margin="5 0 0 0" Width="200" materialDesign:HintAssist.Hint="Enter machine serial number" DisplayMember="SerialNumber" Provider="{StaticResource ResourceKey=MachinesProvider}" SelectedItem="{Binding Machine,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"> + <autoComplete:AutoCompleteTextBox.ItemTemplate> <DataTemplate> - <UniformGrid Columns="1" Rows="2"> - <Grid Margin="2" Style="{StaticResource draggableGrid}" dragAndDrop:DragAndDropService.Drop="OnDroppedDispenser"> - <Image IsHitTestVisible="False" Source="../Images/dispenser.png" RenderOptions.BitmapScalingMode="Fant"></Image> - <Rectangle IsHitTestVisible="False" Margin="14 25 13 34"> - <Rectangle.Fill> - <LinearGradientBrush StartPoint="0,0" EndPoint="0,0.8" Opacity="0.8"> - <GradientStop Offset="0" Color="Transparent" /> - <GradientStop Offset="1" Color="{Binding LiquidTypes.Color,Converter={StaticResource ColorToIntegerConverter}}"/> - </LinearGradientBrush> - </Rectangle.Fill> - </Rectangle> - </Grid> + <TextBlock Text="{Binding SerialNumber}"></TextBlock> + </DataTemplate> + </autoComplete:AutoCompleteTextBox.ItemTemplate> + <autoComplete:AutoCompleteTextBox.LoadingContent> + <TextBlock Text="Loading..." Margin="5" FontSize="14" /> + </autoComplete:AutoCompleteTextBox.LoadingContent> + </autoComplete:AutoCompleteTextBox> + </StackPanel> + </StackPanel> + </Grid> + + <Viewbox MaxWidth="1200" Grid.RowSpan="2" > + <Grid> + <Image Source="../Images/machine-full-fx.png" MaxWidth="800" RenderOptions.BitmapScalingMode="Fant"> + <Image.Effect> + <DropShadowEffect ShadowDepth="0" BlurRadius="20" Opacity="1" RenderingBias="Performance" Color="DimGray"></DropShadowEffect> + </Image.Effect> + </Image> + + <Canvas> + + <TextBlock Canvas.Top="222" Canvas.Left="446" FontStyle="Italic" Foreground="Gray">Add IDS</TextBlock> + <Grid Width="23" Height="20" Canvas.Top="231" Canvas.Left="414"> + <Rectangle Stroke="Gray" VerticalAlignment="Top" StrokeThickness="1" StrokeDashArray="5" RenderTransformOrigin="0.5,0.5"/> + <Rectangle Stroke="Gray" HorizontalAlignment="Left" StrokeThickness="1" StrokeDashArray="5" RenderTransformOrigin="0.5,0.5"/> + </Grid> - <Grid Margin="2" Style="{StaticResource draggableGrid}"> - <Image IsHitTestVisible="False" Source="../Images/mid-tank.png" RenderOptions.BitmapScalingMode="Fant"></Image> - <Rectangle IsHitTestVisible="False" Margin="4 25 4 1"> - <Rectangle.Fill> - <LinearGradientBrush StartPoint="0,0" EndPoint="0,0.8" Opacity="0.8"> - <GradientStop Offset="0" Color="Transparent" /> - <GradientStop Offset="1" Color="{Binding LiquidTypes.Color,Converter={StaticResource ColorToIntegerConverter}}"/> - </LinearGradientBrush> - </Rectangle.Fill> - </Rectangle> + <TextBlock Canvas.Top="255" Canvas.Left="500" FontStyle="Italic" Foreground="Gray">Remove IDS</TextBlock> + <Grid Width="35" Height="8" Canvas.Top="264" Canvas.Left="460"> + <Rectangle Stroke="Gray" VerticalAlignment="Top" StrokeThickness="1" StrokeDashArray="5" RenderTransformOrigin="0.5,0.5"/> + </Grid> + + <Button Command="{Binding AddIdsCommand}" Style="{StaticResource MaterialDesignFlatButton}" Height="24" Width="24" Padding="0" Canvas.Left="402" Canvas.Top="253"> + <materialDesign:PackIcon Kind="Plus" Width="24" Height="24"></materialDesign:PackIcon> + </Button> + + <Button Command="{Binding RemoveIdsCommand}" Style="{StaticResource MaterialDesignFlatButton}" Height="24" Width="24" Padding="0" Canvas.Left="430" Canvas.Top="252"> + <materialDesign:PackIcon Kind="Minus" Width="24" Height="24"></materialDesign:PackIcon> + </Button> + + <Grid Width="310" Height="195" Canvas.Top="314" Canvas.Left="420"> + <ListBox ItemsSource="{Binding Configuration.IdsPacks}" SelectedItem="{Binding SelectedIds}" ScrollViewer.VerticalScrollBarVisibility="Disabled" ScrollViewer.HorizontalScrollBarVisibility="Disabled"> + <ListBox.ItemContainerStyle> + <Style TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}"> + <Setter Property="Padding" Value="0"></Setter> + <Setter Property="VerticalContentAlignment" Value="Stretch"></Setter> + <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter> + </Style> + </ListBox.ItemContainerStyle> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <UniformGrid Columns="8"></UniformGrid> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate> + <Grid dragAndDrop:DragAndDropService.DraggableBorderBrush="{StaticResource AccentColorBrush}" dragAndDrop:DragAndDropService.Drop="OnDropOnIdsPack"> + <Grid.Style> + <Style TargetType="Grid" BasedOn="{StaticResource draggableGrid}"> + <Style.Triggers> + + </Style.Triggers> + </Style> + </Grid.Style> + <UniformGrid Columns="1" Rows="2"> + <Grid Margin="2"> + <Image IsHitTestVisible="False" Source="../Images/dispenser.png" RenderOptions.BitmapScalingMode="Fant"> + <Image.Style> + <Style TargetType="Image"> + <Style.Triggers> + <DataTrigger Binding="{Binding Dispenser}" Value="{x:Null}"> + <Setter Property="Opacity" Value="0.2"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </Image.Style> + </Image> + <Rectangle IsHitTestVisible="False" Margin="14 25 13 34"> + <Rectangle.Fill> + <LinearGradientBrush StartPoint="0,0" EndPoint="0,0.8" Opacity="0.8"> + <GradientStop Offset="0" Color="Transparent" /> + <GradientStop Offset="1" Color="{Binding LiquidTypes.Color,Converter={StaticResource ColorToIntegerConverter}}"/> + </LinearGradientBrush> + </Rectangle.Fill> + </Rectangle> + </Grid> + + <Grid Margin="2"> + <Image IsHitTestVisible="False" Stretch="Fill" Source="../Images/mid-tank.png" RenderOptions.BitmapScalingMode="Fant"> + <Image.Style> + <Style TargetType="Image"> + <Style.Triggers> + <DataTrigger Binding="{Binding MidTankTypes}" Value="{x:Null}"> + <Setter Property="Opacity" Value="0.2"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </Image.Style> + </Image> + <Rectangle IsHitTestVisible="False" Margin="4 25 4 1"> + <Rectangle.Fill> + <LinearGradientBrush StartPoint="0,0" EndPoint="0,0.8" Opacity="0.8"> + <GradientStop Offset="0" Color="Transparent" /> + <GradientStop Offset="1" Color="{Binding LiquidTypes.Color,Converter={StaticResource ColorToIntegerConverter}}"/> + </LinearGradientBrush> + </Rectangle.Fill> + </Rectangle> + </Grid> + </UniformGrid> </Grid> - </UniformGrid> - </DataTemplate> - </ItemsControl.ItemTemplate> - </ItemsControl> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ListBox> - <Rectangle VerticalAlignment="Bottom" Stroke="DimGray" StrokeThickness="1"> - <Rectangle.Effect> - <DropShadowEffect ShadowDepth="1" Opacity="1" Color="Black" /> - </Rectangle.Effect> - </Rectangle> - </Grid> + <Grid Margin="0 50 0 0"> + <Grid.Style> + <Style TargetType="Grid"> + <Setter Property="Visibility" Value="Hidden"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding Configuration.IdsPacks.Count}" Value="0"> + <Setter Property="Visibility" Value="Visible"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </Grid.Style> + <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="20" FontWeight="Bold" Foreground="Gainsboro">NO IDS PACKS</TextBlock> + </Grid> - <Grid Width="100" Height="100" Canvas.Left="70" Canvas.Top="331"> - <Image Source="../Images/ti-tm4c129x.png" RenderOptions.BitmapScalingMode="Fant"></Image> - </Grid> + <Rectangle VerticalAlignment="Bottom" Stroke="DimGray" StrokeThickness="1"> + <Rectangle.Effect> + <DropShadowEffect ShadowDepth="1" Opacity="1" Color="Black" /> + </Rectangle.Effect> + </Rectangle> + </Grid> - <TextBlock Canvas.Top="163" Canvas.Left="288" FontStyle="Italic" Foreground="Gray">Touch Panel:</TextBlock> - <Grid Width="53" Height="55" Canvas.Top="184" Canvas.Left="279"> - <Rectangle Stroke="Gray" VerticalAlignment="Bottom" StrokeThickness="1" StrokeDashArray="5" RenderTransformOrigin="0.5,0.5"/> - <Rectangle Stroke="Gray" HorizontalAlignment="Right" StrokeThickness="1" StrokeDashArray="5" RenderTransformOrigin="0.5,0.5"/> - </Grid> + <Grid Style="{StaticResource draggableGrid}" Width="100" Height="100" Canvas.Left="70" Canvas.Top="331" IsHitTestVisible="True" SnapsToDevicePixels="True" dragAndDrop:DragAndDropService.Drop="OnEmbeddedDrop"> + <Image Source="../Images/ti-tm4c129x.png" RenderOptions.BitmapScalingMode="Fant"></Image> + </Grid> - <TextBlock Canvas.Top="441" Canvas.Left="156" FontStyle="Italic" Foreground="Gray">Embedded Firmware:</TextBlock> - <Grid Width="82" Height="26" Canvas.Top="410" Canvas.Left="158"> - <Rectangle Stroke="Gray" VerticalAlignment="Top" StrokeThickness="1" StrokeDashArray="5" RenderTransformOrigin="0.5,0.5"/> - <Rectangle Stroke="Gray" HorizontalAlignment="Right" StrokeThickness="1" StrokeDashArray="6" RenderTransformOrigin="0.5,0.5"/> - </Grid> + <Grid Width="42" IsHitTestVisible="True" SnapsToDevicePixels="True" ClipToBounds="True" Height="32" Canvas.Left="102" Canvas.Top="395"> + <Grid.RowDefinitions> + <RowDefinition Height="1*" /> + <RowDefinition Height="1*" /> + </Grid.RowDefinitions> + <TextBlock Padding="1" Foreground="Gainsboro" IsHitTestVisible="False" FontSize="5" TextAlignment="Center" TextWrapping="Wrap"> + <Run Text="{Binding Configuration.EmbeddedFirmwareVersions.Name}"></Run> + <Run></Run> + <Run Text="{Binding Configuration.EmbeddedFirmwareVersions.Version}"></Run> + </TextBlock> + <Rectangle IsHitTestVisible="False" Stroke="DimGray" Margin="1" StrokeThickness="1" StrokeDashArray="5" VerticalAlignment="Bottom"></Rectangle> + <TextBlock Padding="1" IsHitTestVisible="False" Foreground="Gainsboro" FontSize="5" TextAlignment="Center" Grid.Row="1" TextWrapping="Wrap"> + <Run Text="{Binding Configuration.EmbeddedSoftwareVersions.Name}"></Run> + <Run></Run> + <Run Text="{Binding Configuration.EmbeddedSoftwareVersions.Version}"></Run> + </TextBlock> + </Grid> - <TextBlock Canvas.Top="310" Canvas.Left="340" FontStyle="Italic" Foreground="Gray">Dispensers:</TextBlock> - <Grid Width="53" Height="20" Canvas.Top="331" Canvas.Left="377"> - <Rectangle Stroke="Gray" VerticalAlignment="Bottom" StrokeThickness="1" StrokeDashArray="5" RenderTransformOrigin="0.5,0.5"/> - <Rectangle Stroke="Gray" HorizontalAlignment="Left" StrokeThickness="1" StrokeDashArray="5" RenderTransformOrigin="0.5,0.5"/> - </Grid> + <TextBlock Canvas.Top="163" Canvas.Left="288" FontStyle="Italic" Foreground="Gray">Touch Panel:</TextBlock> + <Grid Width="53" Height="55" Canvas.Top="184" Canvas.Left="279"> + <Rectangle Stroke="Gray" VerticalAlignment="Bottom" StrokeThickness="1" StrokeDashArray="5" RenderTransformOrigin="0.5,0.5"/> + <Rectangle Stroke="Gray" HorizontalAlignment="Right" StrokeThickness="1" StrokeDashArray="5" RenderTransformOrigin="0.5,0.5"/> + </Grid> - <TextBlock Canvas.Top="420" Canvas.Left="340" FontStyle="Italic" Foreground="Gray">Mid Tanks:</TextBlock> - <Grid Width="53" Height="44" Canvas.Top="441" Canvas.Left="362"> - <Rectangle Stroke="Gray" VerticalAlignment="Bottom" StrokeThickness="1" StrokeDashArray="5" RenderTransformOrigin="0.5,0.5"/> - <Rectangle Stroke="Gray" HorizontalAlignment="Left" StrokeThickness="1" StrokeDashArray="5" RenderTransformOrigin="0.5,0.5"/> - </Grid> - </Canvas> - </Grid> - </Viewbox> + <TextBlock Canvas.Top="441" Canvas.Left="156" FontStyle="Italic" Foreground="Gray">Embedded Firmware:</TextBlock> + <Grid Width="82" Height="26" Canvas.Top="410" Canvas.Left="158"> + <Rectangle Stroke="Gray" VerticalAlignment="Top" StrokeThickness="1" StrokeDashArray="5" RenderTransformOrigin="0.5,0.5"/> + <Rectangle Stroke="Gray" HorizontalAlignment="Right" StrokeThickness="1" StrokeDashArray="6" RenderTransformOrigin="0.5,0.5"/> + </Grid> + + <TextBlock Canvas.Top="310" Canvas.Left="340" FontStyle="Italic" Foreground="Gray">Dispensers:</TextBlock> + <Grid Width="53" Height="20" Canvas.Top="331" Canvas.Left="377"> + <Rectangle Stroke="Gray" VerticalAlignment="Bottom" StrokeThickness="1" StrokeDashArray="5" RenderTransformOrigin="0.5,0.5"/> + <Rectangle Stroke="Gray" HorizontalAlignment="Left" StrokeThickness="1" StrokeDashArray="5" RenderTransformOrigin="0.5,0.5"/> + </Grid> + + <TextBlock Canvas.Top="420" Canvas.Left="340" FontStyle="Italic" Foreground="Gray">Mid Tanks:</TextBlock> + <Grid Width="53" Height="44" Canvas.Top="441" Canvas.Left="362"> + <Rectangle Stroke="Gray" VerticalAlignment="Bottom" StrokeThickness="1" StrokeDashArray="5" RenderTransformOrigin="0.5,0.5"/> + <Rectangle Stroke="Gray" HorizontalAlignment="Left" StrokeThickness="1" StrokeDashArray="5" RenderTransformOrigin="0.5,0.5"/> + </Grid> + + <Grid Width="67" IsHitTestVisible="True" SnapsToDevicePixels="True" ClipToBounds="True" Height="90" Canvas.Left="188" Canvas.Top="198" dragAndDrop:DragAndDropService.Drop="OnTabletDrop" dragAndDrop:DragAndDropService.DraggableBorderBrush="{StaticResource AccentColorBrush}" dragAndDrop:DragAndDropService.DraggableBackground="#202020"> + <Grid.Style> + <Style TargetType="Grid" BasedOn="{StaticResource draggableGrid}"> + <Setter Property="Background" Value="Transparent"></Setter> + <Style.Triggers> + <Trigger Property="dragAndDrop:DragAndDropService.IsDraggableOver" Value="True"> + <Setter Property="Background" Value="#151515"></Setter> + </Trigger> + </Style.Triggers> + </Style> + </Grid.Style> + <Grid.RowDefinitions> + <RowDefinition Height="1*" /> + <RowDefinition Height="1*" /> + </Grid.RowDefinitions> + <TextBlock Padding="2" Foreground="Gainsboro" IsHitTestVisible="False" FontSize="6" TextAlignment="Center" TextWrapping="Wrap"> + <Run Text="{Binding Configuration.ApplicationDisplayPanelVersions.Name}"></Run> + <Run></Run> + <Run Text="{Binding Configuration.ApplicationDisplayPanelVersions.Version}"></Run> + </TextBlock> + <Rectangle IsHitTestVisible="False" Stroke="DimGray" Margin="5 5 5 5" StrokeThickness="1" StrokeDashArray="5" VerticalAlignment="Bottom"></Rectangle> + <TextBlock Padding="2" IsHitTestVisible="False" Foreground="Gainsboro" FontSize="6" TextAlignment="Center" Grid.Row="1" TextWrapping="Wrap"> + <Run Text="{Binding Configuration.ApplicationVersions.Name}"></Run> + <Run></Run> + <Run Text="{Binding Configuration.ApplicationVersions.Version}"></Run> + </TextBlock> + </Grid> + </Canvas> + </Grid> + </Viewbox> + </Grid> + + + <Grid> + <TextBlock Margin="10" FontStyle="Italic" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Top" Foreground="Gray" FontSize="16">IDS PACKS</TextBlock> + <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto"> + <ItemsControl ItemsSource="{Binding Configuration.IdsPacks}" FontSize="10" Foreground="DimGray" Margin="10 30 10 10"> + <ItemsControl.ItemTemplate> + <DataTemplate> + <StackPanel> + <TextBox materialDesign:HintAssist.Hint="IDS Pack Name..." Text="{Binding Name,UpdateSourceTrigger=PropertyChanged}" FontWeight="Bold" FontSize="12" Margin="5"></TextBox> + <StackPanel Margin="20 0 0 0"> + <StackPanel Orientation="Horizontal" Margin="0 3 0 3"> + <Image RenderOptions.BitmapScalingMode="Fant" Source="../Images/injection.png" Width="12" VerticalAlignment="Center"></Image> + <TextBlock Margin="5 0 0 0" VerticalAlignment="Center"><Run FontWeight="Bold">Dispenser:</Run> <Run FontStyle="Italic" Text="{Binding Dispenser.SerialNumber}"></Run></TextBlock> + </StackPanel> + <StackPanel Orientation="Horizontal" Margin="0 3 0 3"> + <Image RenderOptions.BitmapScalingMode="Fant" Source="../Images/cartridge.png" Width="12" VerticalAlignment="Center"></Image> + <TextBlock Margin="5 0 0 0" VerticalAlignment="Center"><Run FontWeight="Bold">Cartridge:</Run> <Run FontStyle="Italic" Text="{Binding CartridgeTypes.Name}"></Run></TextBlock> + </StackPanel> + <StackPanel Orientation="Horizontal" Margin="0 3 0 3"> + <Image RenderOptions.BitmapScalingMode="Fant" Source="../Images/tank.png" Width="12" VerticalAlignment="Center"></Image> + <TextBlock Margin="5 0 0 0" VerticalAlignment="Center"><Run FontWeight="Bold">Mid Tank:</Run> <Run FontStyle="Italic" Text="{Binding MidTankTypes.Name}"></Run></TextBlock> + </StackPanel> + <StackPanel Orientation="Horizontal" Margin="0 3 0 3"> + <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 LiquidTypes.Name}"></Run></TextBlock> + </StackPanel> + </StackPanel> + </StackPanel> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </ScrollViewer> + + <Rectangle HorizontalAlignment="Right" Margin="0 20 0 20" Stroke="Gainsboro" StrokeThickness="1" StrokeDashArray="5 5 5 5"></Rectangle> + </Grid> </Grid> <Grid Grid.Column="1"> @@ -151,7 +348,7 @@ </Grid.RowDefinitions> <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto"> <Grid> - <materialDesign:Card Margin="10,10,10,0" Background="{DynamicResource MaterialDesignBackground}"> + <materialDesign:Card Margin="5,10,5,0" Background="{DynamicResource MaterialDesignBackground}"> <StackPanel> <Expander HorizontalAlignment="Stretch" Header="Dispensers" IsExpanded="True"> <ListBox ItemsSource="{Binding Adapter.DispensersViewSource}" HorizontalContentAlignment="Stretch"> @@ -165,7 +362,7 @@ <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 5"> + <StackPanel Orientation="Horizontal" Margin="2 8"> <Image IsHitTestVisible="False" Width="24" Height="24" Source="../Images/injection.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 DispenserTypes.Name}"></Run></TextBlock> @@ -180,7 +377,7 @@ </ListBox> </Expander> <Border Height="1" HorizontalAlignment="Stretch" Background="{DynamicResource MaterialDesignDivider}" SnapsToDevicePixels="True" /> - <Expander IsExpanded="True" HorizontalAlignment="Stretch" Header="Cartridge Types"> + <Expander IsExpanded="True" HorizontalAlignment="Stretch" Header="Cartridges"> <ListBox ItemsSource="{Binding Adapter.CartridgeTypesViewSource}" HorizontalContentAlignment="Stretch"> <ListBox.ItemContainerStyle> <Style TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}"> @@ -192,7 +389,7 @@ <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 5"> + <StackPanel Orientation="Horizontal" Margin="2 8"> <Image IsHitTestVisible="False" Width="24" Height="24" Source="../Images/cartridge.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> @@ -206,7 +403,7 @@ </ListBox> </Expander> <Border Height="1" HorizontalAlignment="Stretch" Background="{DynamicResource MaterialDesignDivider}" SnapsToDevicePixels="True" /> - <Expander IsExpanded="True" HorizontalAlignment="Stretch" Header="Mid Tank Types"> + <Expander IsExpanded="True" HorizontalAlignment="Stretch" Header="Mid Tanks"> <ListBox ItemsSource="{Binding Adapter.MidTankTypesViewSource}" HorizontalContentAlignment="Stretch"> <ListBox.ItemContainerStyle> <Style TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}"> @@ -218,7 +415,7 @@ <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 5"> + <StackPanel Orientation="Horizontal" Margin="2 8"> <Image IsHitTestVisible="False" Width="24" Height="24" Source="../Images/tank.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> @@ -232,7 +429,7 @@ </ListBox> </Expander> <Border Height="1" HorizontalAlignment="Stretch" Background="{DynamicResource MaterialDesignDivider}" SnapsToDevicePixels="True" /> - <Expander IsExpanded="True" HorizontalAlignment="Stretch" Header="Liquid Types"> + <Expander IsExpanded="True" HorizontalAlignment="Stretch" Header="Liquids"> <ListBox ItemsSource="{Binding Adapter.LiquidTypesViewSource}" HorizontalContentAlignment="Stretch"> <ListBox.ItemContainerStyle> <Style TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}"> @@ -244,7 +441,7 @@ <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 5"> + <StackPanel Orientation="Horizontal" Margin="2 8"> <Image IsHitTestVisible="False" Width="24" Height="24" Source="../Images/liquid.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> @@ -263,6 +460,114 @@ </ListBox.ItemTemplate> </ListBox> </Expander> + <Border Height="1" HorizontalAlignment="Stretch" Background="{DynamicResource MaterialDesignDivider}" SnapsToDevicePixels="True" /> + <Expander IsExpanded="True" HorizontalAlignment="Stretch" Header="Touch Panels"> + <ListBox ItemsSource="{Binding Adapter.ApplicationDisplayPanelVersionsViewSource}" 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/tablet.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> + <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="DimGray"><Run>v</Run><Run Text="{Binding Version}"></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 IsExpanded="True" HorizontalAlignment="Stretch" Header="Application Versions"> + <ListBox ItemsSource="{Binding Adapter.ApplicationVersions}" 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/app.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> + <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="DimGray"><Run>v</Run><Run Text="{Binding Version}"></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 IsExpanded="True" HorizontalAlignment="Stretch" Header="Embedded Firmware Versions"> + <ListBox ItemsSource="{Binding Adapter.EmbeddedFirmwareVersionsViewSource}" 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/embedded.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> + <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="DimGray"><Run>v</Run><Run Text="{Binding Version}"></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 IsExpanded="True" HorizontalAlignment="Stretch" Header="Embedded Software Versions"> + <ListBox ItemsSource="{Binding Adapter.EmbeddedSoftwareVersionsViewSource}" 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/embedded-software.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> + <TextBlock IsHitTestVisible="False" FontSize="10" Foreground="DimGray"><Run>v</Run><Run Text="{Binding Version}"></Run></TextBlock> + </StackPanel> + </StackPanel> + + <Rectangle Margin="0 10 0 0" VerticalAlignment="Bottom" Stroke="Gainsboro" StrokeThickness="1"></Rectangle> + </Grid> + </DataTemplate> + </ListBox.ItemTemplate> + </ListBox> + </Expander> </StackPanel> </materialDesign:Card> </Grid> 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 97412178e..ebf45624d 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 @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; +using System.Threading; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; @@ -29,7 +30,10 @@ namespace Tango.MachineStudio.MachineDesigner.Views { InitializeComponent(); DraggingSurface = dragSufrace; - this.Loaded += (x, y) => _vm = DataContext as MainViewVM; + this.Loaded += (x, y) => + { + _vm = DataContext as MainViewVM; + }; } public DraggingSurface DraggingSurface @@ -40,7 +44,7 @@ namespace Tango.MachineStudio.MachineDesigner.Views public static readonly DependencyProperty DraggingSurfaceProperty = DependencyProperty.Register("DraggingSurface", typeof(DraggingSurface), typeof(MainView), new PropertyMetadata(null)); - private void OnDroppedDispenser(object sender, DropEventArgs e) + private void OnDropOnIdsPack(object sender, DropEventArgs e) { if (e.Draggable.DataContext is Dispenser) { @@ -59,5 +63,29 @@ namespace Tango.MachineStudio.MachineDesigner.Views _vm.DropMidTankType(e.Draggable.DataContext as MidTankType, e.Droppable.DataContext as IdsPack); } } + + private void OnTabletDrop(object sender, DropEventArgs e) + { + if (e.Draggable.DataContext is ApplicationDisplayPanelVersion) + { + _vm.DropTouchPanel(e.Draggable.DataContext as ApplicationDisplayPanelVersion); + } + else if (e.Draggable.DataContext is ApplicationVersion) + { + _vm.DropApplicationVersion(e.Draggable.DataContext as ApplicationVersion); + } + } + + private void OnEmbeddedDrop(object sender, DropEventArgs e) + { + if (e.Draggable.DataContext is EmbeddedFirmwareVersion) + { + _vm.DropEmbeddedFirmware(e.Draggable.DataContext as EmbeddedFirmwareVersion); + } + else if (e.Draggable.DataContext is EmbeddedSoftwareVersion) + { + _vm.DropEmbeddedSoftware(e.Draggable.DataContext as EmbeddedSoftwareVersion); + } + } } } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/packages.config b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/packages.config index 4fd672b32..42945b407 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/packages.config +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/packages.config @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <packages> <package id="CommonServiceLocator" version="1.3" targetFramework="net46" /> + <package id="FontAwesome.WPF" version="4.7.0.9" targetFramework="net46" /> <package id="MahApps.Metro" version="1.5.0" targetFramework="net46" /> <package id="MaterialDesignColors" version="1.1.2" targetFramework="net46" /> <package id="MaterialDesignThemes" version="2.3.1.953" targetFramework="net46" /> |
