diff options
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner')
5 files changed, 59 insertions, 10 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Images/application-firmware.png b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Images/application-firmware.png Binary files differnew file mode 100644 index 000000000..110ae36aa --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Images/application-firmware.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 1a2564e0c..a2c955d30 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 @@ -204,5 +204,8 @@ <Resource Include="Images\android.png" /> <Resource Include="Images\hardware.png" /> </ItemGroup> + <ItemGroup> + <Resource Include="Images\application-firmware.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 be28f92b5..457be98b2 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 @@ -113,7 +113,6 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels Configuration.Name = "Untitled"; Machine = new Machine(); Machine.Configuration = Configuration; - Configuration.ApplicationFirmwareVersions = Adapter.ApplicationFirmwareVersions.First(); SaveCommand = new RelayCommand(Save, (x) => !_isSaving); AddIdsCommand = new RelayCommand(AddIds, (x) => !_isSaving && Configuration.IdsPacks.Count < 8); @@ -153,6 +152,12 @@ namespace Tango.MachineStudio.MachineDesigner.ViewModels Configuration.ApplicationDisplayPanelVersionGuid = applicationDisplayPanelVersion.Guid; } + public void DropApplicationFirmwareVersion(ApplicationFirmwareVersion applicationFirmwareVersion) + { + Configuration.ApplicationFirmwareVersions = applicationFirmwareVersion; + Configuration.ApplicationFirmwareVersionGuid = applicationFirmwareVersion.Guid; + } + public void DropApplicationVersion(ApplicationVersion applicationVersion) { Configuration.ApplicationVersions = applicationVersion; 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 68c772c0c..26a98a802 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 @@ -350,11 +350,12 @@ <RowDefinition Height="1*" /> <RowDefinition Height="1*" /> <RowDefinition Height="1*" /> + <RowDefinition Height="1*" /> </Grid.RowDefinitions> <StackPanel> <Image Source="../Images/tablet.png" Width="10" Margin="2" RenderOptions.BitmapScalingMode="Fant"></Image> - <TextBlock Padding="2" Foreground="Gainsboro" IsHitTestVisible="False" FontSize="6" TextAlignment="Center" TextWrapping="Wrap"> + <TextBlock Padding="2 0 2 0" Foreground="Gainsboro" IsHitTestVisible="False" FontSize="6" TextAlignment="Center" TextWrapping="Wrap"> <Run Text="{Binding Configuration.ApplicationDisplayPanelVersions.Name}"></Run> <Run Text="{Binding Configuration.ApplicationDisplayPanelVersions.Version}"></Run> </TextBlock> @@ -362,15 +363,24 @@ <StackPanel Grid.Row="2" > <Image Source="../Images/app.png" Width="10" Margin="2" RenderOptions.BitmapScalingMode="Fant"></Image> - <TextBlock Padding="2" IsHitTestVisible="False" Foreground="Gainsboro" FontSize="6" TextAlignment="Center" TextWrapping="Wrap"> + <TextBlock Padding="2 0 2 0" IsHitTestVisible="False" Foreground="Gainsboro" FontSize="6" TextAlignment="Center" TextWrapping="Wrap"> <Run Text="{Binding Configuration.ApplicationVersions.Name}"></Run> <Run Text="{Binding Configuration.ApplicationVersions.Version}"></Run> </TextBlock> </StackPanel> + + <StackPanel Grid.Row="3" > + <Image Source="../Images/application-firmware.png" Width="10" Margin="2" RenderOptions.BitmapScalingMode="Fant"></Image> + <TextBlock Padding="2 0 2 0" IsHitTestVisible="False" Foreground="Gainsboro" FontSize="6" TextAlignment="Center" TextWrapping="Wrap"> + <Run Text="{Binding Configuration.ApplicationFirmwareVersions.Name}"></Run> + <Run Text="{Binding Configuration.ApplicationFirmwareVersions.Version}"></Run> + </TextBlock> + </StackPanel> + <StackPanel Grid.Row="1" > <Image Source="../Images/android.png" Width="10" Margin="2" RenderOptions.BitmapScalingMode="Fant"></Image> - <TextBlock Padding="2" IsHitTestVisible="False" Foreground="Gainsboro" FontSize="6" TextAlignment="Center" TextWrapping="Wrap"> + <TextBlock Padding="2 0 2 0" IsHitTestVisible="False" Foreground="Gainsboro" FontSize="6" TextAlignment="Center" TextWrapping="Wrap"> <Run Text="{Binding Configuration.ApplicationOsVersions.Name}"></Run> <Run Text="{Binding Configuration.ApplicationOsVersions.Version}"></Run> </TextBlock> @@ -629,7 +639,7 @@ </ListBox> </Expander> <Border Height="1" HorizontalAlignment="Stretch" Background="{DynamicResource MaterialDesignDivider}" SnapsToDevicePixels="True" /> - <Expander HorizontalAlignment="Stretch" Header="OS Versions"> + <Expander HorizontalAlignment="Stretch" Header="Operation Systems"> <ListBox ItemsSource="{Binding Adapter.ApplicationOsVersionsViewSource}" HorizontalContentAlignment="Stretch"> <ListBox.ItemContainerStyle> <Style TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}"> @@ -656,8 +666,8 @@ </ListBox> </Expander> <Border Height="1" HorizontalAlignment="Stretch" Background="{DynamicResource MaterialDesignDivider}" SnapsToDevicePixels="True" /> - <Expander HorizontalAlignment="Stretch" Header="Application Versions"> - <ListBox ItemsSource="{Binding Adapter.ApplicationVersions}" HorizontalContentAlignment="Stretch"> + <Expander HorizontalAlignment="Stretch" Header="Application Softwares"> + <ListBox ItemsSource="{Binding Adapter.ApplicationVersionsViewSource}" HorizontalContentAlignment="Stretch"> <ListBox.ItemContainerStyle> <Style TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}"> <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter> @@ -683,7 +693,34 @@ </ListBox> </Expander> <Border Height="1" HorizontalAlignment="Stretch" Background="{DynamicResource MaterialDesignDivider}" SnapsToDevicePixels="True" /> - <Expander HorizontalAlignment="Stretch" Header="Embedded Firmware Versions"> + <Expander HorizontalAlignment="Stretch" Header="Application Firmwares"> + <ListBox ItemsSource="{Binding Adapter.ApplicationFirmwareVersionsViewSource}" 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/application-firmware.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 HorizontalAlignment="Stretch" Header="Embedded Firmwares"> <ListBox ItemsSource="{Binding Adapter.EmbeddedFirmwareVersionsViewSource}" HorizontalContentAlignment="Stretch"> <ListBox.ItemContainerStyle> <Style TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}"> @@ -710,7 +747,7 @@ </ListBox> </Expander> <Border Height="1" HorizontalAlignment="Stretch" Background="{DynamicResource MaterialDesignDivider}" SnapsToDevicePixels="True" /> - <Expander HorizontalAlignment="Stretch" Header="Embedded Software Versions"> + <Expander HorizontalAlignment="Stretch" Header="Embedded Softwares"> <ListBox ItemsSource="{Binding Adapter.EmbeddedSoftwareVersionsViewSource}" HorizontalContentAlignment="Stretch"> <ListBox.ItemContainerStyle> <Style TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}"> @@ -737,7 +774,7 @@ </ListBox> </Expander> <Border Height="1" HorizontalAlignment="Stretch" Background="{DynamicResource MaterialDesignDivider}" SnapsToDevicePixels="True" /> - <Expander HorizontalAlignment="Stretch" Header="Hardware Versions"> + <Expander HorizontalAlignment="Stretch" Header="Hardwares"> <ListBox ItemsSource="{Binding Adapter.HardwareVersionsViewSource}" HorizontalContentAlignment="Stretch"> <ListBox.ItemContainerStyle> <Style TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}"> 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 f38c8f8d6..44ce75c12 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 @@ -122,6 +122,10 @@ namespace Tango.MachineStudio.MachineDesigner.Views { _vm.DropApplicationOsVersion(e.Draggable.DataContext as ApplicationOsVersion); } + else if (e.Draggable.DataContext is ApplicationFirmwareVersion) + { + _vm.DropApplicationFirmwareVersion(e.Draggable.DataContext as ApplicationFirmwareVersion); + } } private void OnEmbeddedDrop(object sender, DropEventArgs e) |
