diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-01-07 13:33:24 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-01-07 13:33:24 +0200 |
| commit | 6ed849ee54a2f30315a622242f38dce92a309991 (patch) | |
| tree | d355caf909d287adcdd89c5afe6b1f1bdd2ba748 /Software | |
| parent | 8d2dc68fdddc51bc24ac6f41feb97460a7d27372 (diff) | |
| download | Tango-6ed849ee54a2f30315a622242f38dce92a309991.tar.gz Tango-6ed849ee54a2f30315a622242f38dce92a309991.zip | |
Added Application Firmware Versions To Machine Designer.
Diffstat (limited to 'Software')
| -rw-r--r-- | Software/DB/Tango.mdf | bin | 75497472 -> 75497472 bytes | |||
| -rw-r--r-- | Software/DB/Tango_log.ldf | bin | 8388608 -> 8388608 bytes | |||
| -rw-r--r-- | Software/Graphics/application-firmware.png | bin | 0 -> 953 bytes | |||
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Images/application-firmware.png | bin | 0 -> 953 bytes | |||
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Tango.MachineStudio.MachineDesigner.csproj | 3 | ||||
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs | 7 | ||||
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml | 55 | ||||
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/Views/MainView.xaml.cs | 4 | ||||
| -rw-r--r-- | Software/Visual_Studio/Tango.DragAndDrop/DragAndDropService.cs | 3 |
9 files changed, 61 insertions, 11 deletions
diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf Binary files differindex 27dd1f996..b0364cb10 100644 --- a/Software/DB/Tango.mdf +++ b/Software/DB/Tango.mdf diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf Binary files differindex 6bd9fb7c5..d970fc8a6 100644 --- a/Software/DB/Tango_log.ldf +++ b/Software/DB/Tango_log.ldf diff --git a/Software/Graphics/application-firmware.png b/Software/Graphics/application-firmware.png Binary files differnew file mode 100644 index 000000000..110ae36aa --- /dev/null +++ b/Software/Graphics/application-firmware.png 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) diff --git a/Software/Visual_Studio/Tango.DragAndDrop/DragAndDropService.cs b/Software/Visual_Studio/Tango.DragAndDrop/DragAndDropService.cs index 122954de8..fe58367aa 100644 --- a/Software/Visual_Studio/Tango.DragAndDrop/DragAndDropService.cs +++ b/Software/Visual_Studio/Tango.DragAndDrop/DragAndDropService.cs @@ -452,7 +452,8 @@ namespace Tango.DragAndDrop //Point dropPoint = dropElement.TransformToAncestor(rootElement).Transform(new Point(0, 0)); Point dropPoint = dropElement.PointToScreen(new Point(0, 0)); - Rect dropRect = new Rect(dropPoint, new Size(dropElement.ActualWidth, dropElement.ActualHeight)); + var dropElementScaledSize = dropElement.PointToScreen(new Point(dropElement.ActualWidth, dropElement.ActualHeight)) - dropElement.PointToScreen(new Point(0, 0)); + Rect dropRect = new Rect(dropPoint, new Size(dropElementScaledSize.X, dropElementScaledSize.Y)); Rect dragRect = new Rect(Canvas.GetLeft(_dragBorder), Canvas.GetTop(_dragBorder), _dragBorder.Width / 2, _dragBorder.Height); Point mousePoint = rootElement.PointToScreen(Mouse.GetPosition(rootElement)); |
