aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-02-19 17:17:25 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-02-19 17:17:25 +0200
commit8feeef663f8984c609cb3aa530d09ffcffda5709 (patch)
tree6b69a7a62ea1234ba5b16948dd3781078834a973 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views
parent95b4e14bc4e06ffb94199f5ec4e0d2d9bebceeff (diff)
downloadTango-8feeef663f8984c609cb3aa530d09ffcffda5709.tar.gz
Tango-8feeef663f8984c609cb3aa530d09ffcffda5709.zip
Working on new developer module...
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml87
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml.cs13
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml5
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs8
4 files changed, 34 insertions, 79 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml
index 35a30e91e..cf7af21d9 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml
@@ -75,39 +75,6 @@
<Color x:Key="dummyColor">Transparent</Color>
- <Style x:Key="droppableGrid" TargetType="Grid">
- <Setter Property="RenderTransform">
- <Setter.Value>
- <ScaleTransform ScaleX="1" ScaleY="1"></ScaleTransform>
- </Setter.Value>
- </Setter>
- <Setter Property="RenderTransformOrigin" Value="0.5,0.5"></Setter>
- <Setter Property="Background" Value="Transparent"></Setter>
- <Setter Property="dragAndDrop:DragAndDropService.Droppable" Value="True"></Setter>
- <Setter Property="dragAndDrop:DragAndDropService.DraggingSurface" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DraggingSurface}"></Setter>
- <Style.Triggers>
- <Trigger Property="dragAndDrop:DragAndDropService.IsDraggableOver" Value="True">
- <Setter Property="Opacity" Value="0.5"></Setter>
- <Trigger.EnterActions>
- <BeginStoryboard>
- <Storyboard>
- <DoubleAnimation To="0.95" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleX"></DoubleAnimation>
- <DoubleAnimation To="0.95" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleY"></DoubleAnimation>
- </Storyboard>
- </BeginStoryboard>
- </Trigger.EnterActions>
- <Trigger.ExitActions>
- <BeginStoryboard>
- <Storyboard>
- <DoubleAnimation To="1" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleX"></DoubleAnimation>
- <DoubleAnimation To="1" Duration="00:00:0.2" Storyboard.TargetProperty="RenderTransform.ScaleY"></DoubleAnimation>
- </Storyboard>
- </BeginStoryboard>
- </Trigger.ExitActions>
- </Trigger>
- </Style.Triggers>
- </Style>
-
<Style x:Key="brushStopBorder" TargetType="Border">
<Setter Property="RenderTransform">
<Setter.Value>
@@ -142,18 +109,6 @@
</Style.Triggers>
</Style>
- <Style x:Key="draggableGrid" TargetType="Grid">
- <Setter Property="RenderTransform">
- <Setter.Value>
- <ScaleTransform ScaleX="1" ScaleY="1"></ScaleTransform>
- </Setter.Value>
- </Setter>
- <Setter Property="RenderTransformOrigin" Value="0.5,0.5"></Setter>
- <Setter Property="Background" Value="Transparent"></Setter>
- <Setter Property="dragAndDrop:DragAndDropService.Draggable" Value="True"></Setter>
- <Setter Property="dragAndDrop:DragAndDropService.DraggingSurface" Value="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DraggingSurface}"></Setter>
- </Style>
-
<Style TargetType="Border" x:Key="JobFieldBorder">
<Setter Property="BorderBrush" Value="#A5A4A4"></Setter>
<Setter Property="BorderThickness" Value="0 0 1 1"></Setter>
@@ -281,7 +236,7 @@
</StackPanel>
</Border>
- <controls:MultiSelectListBox Style="{StaticResource {x:Type ListBox}}" SelectionMode="Extended" SelectionChanged="ListBox_SelectionChanged" ItemsSource="{Binding SelectedJob.Segments}" SelectedItem="{Binding SelectedSegment}" SelectedItemsList="{Binding SelectedSegments,Mode=TwoWay}" HorizontalContentAlignment="Stretch">
+ <controls:MultiSelectListBox Style="{StaticResource {x:Type ListBox}}" SelectionMode="Extended" SelectionChanged="ListBox_SelectionChanged" ItemsSource="{Binding SegmentsCollectionView}" SelectedItem="{Binding SelectedSegment}" SelectedItemsList="{Binding SelectedSegments,Mode=TwoWay}" HorizontalContentAlignment="Stretch">
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem" BasedOn="{StaticResource basicListBoxItem}">
@@ -289,8 +244,8 @@
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate>
- <Grid Margin="5 10">
- <Polygon Points="40,0 290,0 290,100 0,100 0,30" StrokeThickness="0.2">
+ <Grid Margin="5 10" Style="{StaticResource draggableDroppableGrid}" dragAndDrop:DragAndDropService.Drop="OnSegmentDrop">
+ <Polygon Points="40,0 290,0 290,100 0,100 0,30" StrokeThickness="0.2" IsHitTestVisible="False">
<Polygon.Effect>
<DropShadowEffect Opacity="0.5" />
</Polygon.Effect>
@@ -321,8 +276,7 @@
</Style>
</Polygon.Style>
</Polygon>
- <Border Height="100" Padding="5">
-
+ <Border Height="100" Padding="5" IsHitTestVisible="False">
<Grid>
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16" FontStyle="Italic">
<Run>#</Run>
@@ -333,13 +287,12 @@
<Rectangle.Fill>
<MultiBinding Converter="{StaticResource SegmentToBrushConverterMulti}">
<Binding Path="."></Binding>
- <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.SelectedJob"></Binding>
- <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.SelectedJob.Length"></Binding>
+ <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.ActiveJob"></Binding>
+ <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.ActiveJob.Length"></Binding>
<Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.SelectedBrushStop.Color"></Binding>
</MultiBinding>
</Rectangle.Fill>
</Rectangle>
-
</Grid>
</Border>
@@ -378,11 +331,11 @@
<Grid>
<StackPanel Orientation="Horizontal" Margin="10">
<Image Source="../Images/rgb.png" Width="24"></Image>
- <TextBlock Margin="5 0 0 0" Text="{Binding SelectedJob.Name,FallbackValue='UNSET'}" FontSize="16" FontWeight="SemiBold" VerticalAlignment="Center"></TextBlock>
+ <TextBlock Margin="5 0 0 0" Text="{Binding ActiveJob.Name,FallbackValue='UNSET'}" FontSize="16" FontWeight="SemiBold" VerticalAlignment="Center"></TextBlock>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="0 5 0 0" HorizontalAlignment="Right">
- <TextBlock Margin="0 0 5 0" Text="{Binding SelectedJob.CreationDate,FallbackValue='UNSET'}" FontSize="12" Foreground="Gray" FontStyle="Italic" VerticalAlignment="Center"></TextBlock>
+ <TextBlock Margin="0 0 5 0" Text="{Binding ActiveJob.CreationDate,FallbackValue='UNSET'}" FontSize="12" Foreground="Gray" FontStyle="Italic" VerticalAlignment="Center"></TextBlock>
<Image Source="../Images/calendar.png" Width="16"></Image>
</StackPanel>
</Grid>
@@ -394,7 +347,7 @@
<Image Source="../Images/name.png" Width="32"></Image>
<TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Name</TextBlock>
</StackPanel>
- <TextBox Margin="0 3 0 0" Width="100" HorizontalAlignment="Left" Text="{Binding SelectedJob.Name,UpdateSourceTrigger=PropertyChanged}"></TextBox>
+ <TextBox Margin="0 3 0 0" Width="100" HorizontalAlignment="Left" Text="{Binding ActiveJob.Name,UpdateSourceTrigger=PropertyChanged}"></TextBox>
</StackPanel>
</Border>
@@ -404,7 +357,7 @@
<Image Source="../Images/wind.png" Width="32"></Image>
<TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Winding Method</TextBlock>
</StackPanel>
- <ComboBox Width="90" HorizontalAlignment="Left" ItemsSource="{Binding Adapter.WindingMethods}" SelectedItem="{Binding SelectedJob.WindingMethod}" DisplayMemberPath="Name" ></ComboBox>
+ <ComboBox Width="90" HorizontalAlignment="Left" ItemsSource="{Binding Adapter.WindingMethods}" SelectedItem="{Binding ActiveJob.WindingMethod}" DisplayMemberPath="Name" ></ComboBox>
</StackPanel>
</Border>
@@ -415,8 +368,8 @@
<TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Inter Segment</TextBlock>
</StackPanel>
<DockPanel LastChildFill="True">
- <ToggleButton Margin="10 0 25 0" DockPanel.Dock="Right" VerticalAlignment="Bottom" HorizontalAlignment="Right" IsChecked="{Binding SelectedJob.EnableInterSegment}"></ToggleButton>
- <mahapps:NumericUpDown Width="70" HorizontalAlignment="Left" StringFormat="{}{0:N1} m" FontFamily="{StaticResource digital-7}" IsEnabled="{Binding SelectedJob.EnableInterSegment}" Margin="0 2 0 0" HideUpDownButtons="True" Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0 0 0 1" BorderBrush="DimGray" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding SelectedJob.InterSegmentLength,Mode=TwoWay}"></mahapps:NumericUpDown>
+ <ToggleButton Margin="10 0 25 0" DockPanel.Dock="Right" VerticalAlignment="Bottom" HorizontalAlignment="Right" IsChecked="{Binding ActiveJob.EnableInterSegment}"></ToggleButton>
+ <mahapps:NumericUpDown Width="70" HorizontalAlignment="Left" StringFormat="{}{0:N1} m" FontFamily="{StaticResource digital-7}" IsEnabled="{Binding ActiveJob.EnableInterSegment}" Margin="0 2 0 0" HideUpDownButtons="True" Minimum="0" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0 0 0 1" BorderBrush="DimGray" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding ActiveJob.InterSegmentLength,Mode=TwoWay}"></mahapps:NumericUpDown>
</DockPanel>
</StackPanel>
</Border>
@@ -428,7 +381,7 @@
<TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Lubrication</TextBlock>
</StackPanel>
<DockPanel LastChildFill="True" Margin="0 10 30 0">
- <ToggleButton DockPanel.Dock="Right" VerticalAlignment="Center" HorizontalAlignment="Center" IsChecked="{Binding SelectedJob.EnableLubrication}"></ToggleButton>
+ <ToggleButton DockPanel.Dock="Right" VerticalAlignment="Center" HorizontalAlignment="Center" IsChecked="{Binding ActiveJob.EnableLubrication}"></ToggleButton>
</DockPanel>
</StackPanel>
</Border>
@@ -441,7 +394,7 @@
</StackPanel>
<Border BorderThickness="0" BorderBrush="Silver" CornerRadius="5" Margin="0 0 5 5">
- <TextBox Padding="5 0 0 0" FontStyle="Italic" Background="Transparent" Style="{x:Null}" BorderThickness="0" Margin="5" Height="40" Text="{Binding SelectedJob.Description}" VerticalAlignment="Stretch" materialDesign:HintAssist.Hint="Enter description" AcceptsReturn="True" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto"></TextBox>
+ <TextBox Padding="5 0 0 0" FontStyle="Italic" Background="Transparent" Style="{x:Null}" BorderThickness="0" Margin="5" Height="40" Text="{Binding ActiveJob.Description}" VerticalAlignment="Stretch" materialDesign:HintAssist.Hint="Enter description" AcceptsReturn="True" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto"></TextBox>
</Border>
</StackPanel>
</Border>
@@ -619,7 +572,7 @@
</Rectangle>
</Grid>
<Grid Margin="0 10 10 0">
- <controls:MultiSelectListBox SelectionMode="Extended" Style="{x:Null}" Background="Transparent" ScrollViewer.CanContentScroll="False" BorderThickness="0" ItemsSource="{Binding SelectedSegment.BrushStops}" SelectedItem="{Binding SelectedBrushStop}" SelectedItemsList="{Binding SelectedBrushStops,Mode=TwoWay}" HorizontalContentAlignment="Stretch">
+ <controls:MultiSelectListBox SelectionMode="Extended" Style="{x:Null}" Background="Transparent" ScrollViewer.CanContentScroll="False" BorderThickness="0" ItemsSource="{Binding BrushStopsCollectionView}" SelectedItem="{Binding SelectedBrushStop}" SelectedItemsList="{Binding SelectedBrushStops,Mode=TwoWay}" HorizontalContentAlignment="Stretch">
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem" BasedOn="{StaticResource basicListBoxItem}">
@@ -1097,8 +1050,8 @@
<Grid>
<Grid.Width>
<MultiBinding Converter="{StaticResource SegmentLengthToWidthConverter}">
- <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.SelectedJob"></Binding>
- <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.SelectedJob.Length"></Binding>
+ <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.ActiveJob"></Binding>
+ <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.ActiveJob.Length"></Binding>
<Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="ActualWidth"></Binding>
<Binding Path="Length"></Binding>
</MultiBinding>
@@ -1107,8 +1060,8 @@
<Rectangle.Fill>
<MultiBinding Converter="{StaticResource SegmentToBrushConverterMulti}">
<Binding Path="."></Binding>
- <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.SelectedJob"></Binding>
- <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.SelectedJob.Length"></Binding>
+ <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.ActiveJob"></Binding>
+ <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.ActiveJob.Length"></Binding>
<Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.SelectedBrushStop.Color"></Binding>
</MultiBinding>
</Rectangle.Fill>
@@ -1142,7 +1095,7 @@
<StackPanel Margin="0 -5 -20 0" HorizontalAlignment="Right">
<TextBlock FontSize="12" Foreground="Black">
- <Run Text="{Binding SelectedJob.Length,Mode=OneWay}"></Run>
+ <Run Text="{Binding ActiveJob.Length,Mode=OneWay}"></Run>
<Run Foreground="Gray" FontSize="10" Text="m"></Run>
</TextBlock>
<materialDesign:PackIcon HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5" Kind="FlagCheckered" Width="16" Height="16" Foreground="DimGray">
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml.cs
index a030cf885..41886357b 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml.cs
@@ -55,18 +55,18 @@ namespace Tango.MachineStudio.Developer.Views
private void _jobBrushTimer_Tick(object sender, EventArgs e)
{
- if (_vm != null && _vm.SelectedJob != null)
+ if (_vm != null && _vm.ActiveJob != null)
{
List<Segment> segments = new List<Segment>();
- foreach (var s in _vm.SelectedJob.Segments)
+ foreach (var s in _vm.ActiveJob.Segments)
{
segments.Add(s);
- if (_vm.SelectedJob.EnableInterSegment && _vm.SelectedJob.Segments.IndexOf(s) != _vm.SelectedJob.Segments.Count - 1)
+ if (_vm.ActiveJob.EnableInterSegment && _vm.ActiveJob.Segments.IndexOf(s) != _vm.ActiveJob.Segments.Count - 1)
{
segments.Add(new Segment()
{
- Length = _vm.SelectedJob.InterSegmentLength,
+ Length = _vm.ActiveJob.InterSegmentLength,
BrushStops = new System.Collections.ObjectModel.ObservableCollection<BrushStop>()
{
new BrushStop()
@@ -136,5 +136,10 @@ namespace Tango.MachineStudio.Developer.Views
{
e.Handled = true;
}
+
+ private void OnSegmentDrop(object sender, DropEventArgs e)
+ {
+ _vm.OnDropSegment(e.Draggable.DataContext as Segment, e.Droppable.DataContext as Segment);
+ }
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml
index b8d423026..8881e4f57 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml
@@ -116,7 +116,7 @@
</Grid>
<Grid Margin="0 20 0 0">
- <controls:MultiSelectDataGrid Style="{StaticResource {x:Type DataGrid}}" CanUserAddRows="False" CanUserDeleteRows="False" CanUserResizeColumns="True" CanUserSortColumns="True" AutoGenerateColumns="False" Background="Transparent" ItemsSource="{Binding SelectedMachine.Jobs}" SelectedItem="{Binding SelectedJob}" SelectedItemsList="{Binding SelectedJobs,Mode=TwoWay}">
+ <controls:MultiSelectDataGrid Style="{StaticResource {x:Type DataGrid}}" CanUserAddRows="False" CanUserDeleteRows="False" CanUserResizeColumns="True" CanUserSortColumns="True" AutoGenerateColumns="False" Background="Transparent" ItemsSource="{Binding JobsCollectionView}" SelectedItem="{Binding SelectedMachineJob}" SelectedItemsList="{Binding SelectedJobs,Mode=TwoWay}">
<DataGrid.CellStyle>
<Style TargetType="DataGridCell" BasedOn="{StaticResource {x:Type DataGridCell}}">
<Setter Property="BorderThickness" Value="0"/>
@@ -180,9 +180,6 @@
<Border.Background>
<MultiBinding Converter="{StaticResource SegmentToBrushConverterMulti}">
<Binding Path="."></Binding>
- <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.SelectedJob"></Binding>
- <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.SelectedJob.Length"></Binding>
- <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.SelectedBrushStop.Color"></Binding>
</MultiBinding>
</Border.Background>
</Border>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs
index e52a686bc..2bd36e449 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs
@@ -77,18 +77,18 @@ namespace Tango.MachineStudio.Developer.Views
private void _jobBrushTimer_Tick(object sender, EventArgs e)
{
- if (_vm != null && _vm.SelectedJob != null)
+ if (_vm != null && _vm.ActiveJob != null)
{
List<Segment> segments = new List<Segment>();
- foreach (var s in _vm.SelectedJob.Segments)
+ foreach (var s in _vm.ActiveJob.Segments)
{
segments.Add(s);
- if (_vm.SelectedJob.EnableInterSegment && _vm.SelectedJob.Segments.IndexOf(s) != _vm.SelectedJob.Segments.Count - 1)
+ if (_vm.ActiveJob.EnableInterSegment && _vm.ActiveJob.Segments.IndexOf(s) != _vm.ActiveJob.Segments.Count - 1)
{
segments.Add(new Segment()
{
- Length = _vm.SelectedJob.InterSegmentLength,
+ Length = _vm.ActiveJob.InterSegmentLength,
BrushStops = new System.Collections.ObjectModel.ObservableCollection<BrushStop>()
{
new BrushStop()