aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2019-09-24 12:07:14 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2019-09-24 12:07:14 +0300
commitcb769a96ca8841ced9cff6ed4a6c99939e139610 (patch)
treec1e3e51f1ce32961592abd0b98223575cdf8a29d /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views
parentb5c5758e431077d84fb53a3ff62f8e751fca2731 (diff)
downloadTango-cb769a96ca8841ced9cff6ed4a6c99939e139610.tar.gz
Tango-cb769a96ca8841ced9cff6ed4a6c99939e139610.zip
Implemented auto process selection on Research 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.xaml60
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml.cs32
2 files changed, 53 insertions, 39 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 742798ce4..3bda86036 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
@@ -1431,20 +1431,15 @@
</DockPanel>
</Border>
- <ListBox ScrollViewer.VerticalScrollBarVisibility="Disabled" ScrollViewer.HorizontalScrollBarVisibility="Disabled" Background="Transparent" BorderThickness="0" Style="{x:Null}" HorizontalContentAlignment="Stretch" ItemsSource="{Binding RmlProcessParametersTableGroup.ProcessParametersTables}" SelectedItem="{Binding SelectedProcessParametersTable}" IsEnabled="{Binding RmlProcessParametersTableGroup.Active}">
+ <ListBox ScrollViewer.VerticalScrollBarVisibility="Disabled" ScrollViewer.HorizontalScrollBarVisibility="Disabled" Background="Transparent" BorderThickness="0" Style="{x:Null}" HorizontalContentAlignment="Stretch" ItemsSource="{Binding RmlProcessParametersTableGroup.ProcessParametersTables}" SelectedItem="{Binding SelectedProcessParametersTable}">
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem" BasedOn="{StaticResource basicListBoxItem}">
</Style>
</ListBox.ItemContainerStyle>
- <!--<ListBox.ItemsPanel>
- <ItemsPanelTemplate>
- <WrapPanel IsItemsHost="True"></WrapPanel>
- </ItemsPanelTemplate>
- </ListBox.ItemsPanel>-->
<ListBox.ItemTemplate>
<DataTemplate DataType="{x:Type observables:ProcessParametersTable}">
- <Border Padding="5" CornerRadius="5" BorderThickness="1" Margin="5">
+ <Border Padding="5" CornerRadius="5" BorderThickness="1" Margin="5" IsEnabled="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.RmlProcessParametersTableGroup.Active}">
<Border.Style>
<Style TargetType="Border">
<Setter Property="BorderBrush" Value="{StaticResource borderBrush}"></Setter>
@@ -1456,6 +1451,11 @@
<Setter Property="Background" Value="{StaticResource TransparentBackgroundBrush300}"></Setter>
<Setter Property="Opacity" Value="1"></Setter>
</DataTrigger>
+ <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.AutoProcessSelection}" Value="True">
+ <Setter Property="BorderBrush" Value="{StaticResource AccentColorBrush}"></Setter>
+ <Setter Property="Background" Value="Transparent"></Setter>
+ <Setter Property="Opacity" Value="1"></Setter>
+ </DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
@@ -1526,7 +1526,8 @@
</WrapPanel>
</DockPanel>
- <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="5" Visibility="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected,Converter={StaticResource BooleanToVisibilityConverter}}">
+ <Grid HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="5">
+ <StackPanel Orientation="Horizontal" Visibility="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected,Converter={StaticResource BooleanToVisibilityConverter}}">
<TextBlock Text="Active" FontWeight="Bold" FontStyle="Italic" FontSize="13" VerticalAlignment="Center"></TextBlock>
<materialDesign:PackIcon Foreground="{StaticResource GreenBrush400}" Kind="CheckboxBlankCircle" VerticalAlignment="Center" Margin="5 0 0 0">
<materialDesign:PackIcon.Style>
@@ -1559,6 +1560,7 @@
</materialDesign:PackIcon.Style>
</materialDesign:PackIcon>
</StackPanel>
+ </Grid>
</StackPanel>
</Grid>
</Border>
@@ -1566,24 +1568,32 @@
</ListBox.ItemTemplate>
</ListBox>
- <StackPanel Margin="10 20" VerticalAlignment="Bottom" Orientation="Horizontal" HorizontalAlignment="Right">
- <Button Height="40" Width="105" Command="{Binding ResetProcessParametersCommand}" Background="Transparent" BorderBrush="{StaticResource DarkGrayBrush200}" Foreground="{StaticResource DarkGrayBrush200}" Margin="0 2 10 0" ToolTip="Resets the current process parameters in the embedded device">
- <TextBlock TextWrapping="Wrap" TextAlignment="Center">
+ <StackPanel Margin="10 10" VerticalAlignment="Bottom">
+
+ <StackPanel Orientation="Horizontal">
+ <ToggleButton IsChecked="{Binding AutoProcessSelection}" />
+ <TextBlock Margin="5 0 0 0">Use Recommended Process Parameters (auto)</TextBlock>
+ </StackPanel>
+
+ <StackPanel Margin="0 40 0 0" Orientation="Horizontal" HorizontalAlignment="Right">
+ <Button Height="40" Width="105" Command="{Binding ResetProcessParametersCommand}" Background="Transparent" BorderBrush="{StaticResource DarkGrayBrush200}" Foreground="{StaticResource DarkGrayBrush200}" Margin="0 2 10 0" ToolTip="Resets the current process parameters in the embedded device">
+ <TextBlock TextWrapping="Wrap" TextAlignment="Center">
TEMP OFF
- </TextBlock>
- </Button>
- <Button Height="40" Command="{Binding SaveProcessParametersCommand}" HorizontalAlignment="Left" IsEnabled="{Binding AuthenticationProvider.CurrentUser,Converter={StaticResource UserRoleToBooleanConverter},ConverterParameter='Researcher'}">
- <StackPanel Orientation="Horizontal">
- <materialDesign:PackIcon VerticalAlignment="Center" Kind="ContentSave"></materialDesign:PackIcon>
- <TextBlock Margin="10 0 0 0">SAVE PARAMETERS</TextBlock>
- </StackPanel>
- </Button>
- <Button Height="40" Margin="10 0 0 0" Command="{Binding PushProcessParametersCommand}" HorizontalAlignment="Left">
- <StackPanel Orientation="Horizontal">
- <materialDesign:PackIcon VerticalAlignment="Center" Kind="ArrowRightBold"></materialDesign:PackIcon>
- <TextBlock Margin="10 0 0 0">PUSH PARAMETERS</TextBlock>
- </StackPanel>
- </Button>
+ </TextBlock>
+ </Button>
+ <Button Height="40" Command="{Binding SaveProcessParametersCommand}" HorizontalAlignment="Left" IsEnabled="{Binding AuthenticationProvider.CurrentUser,Converter={StaticResource UserRoleToBooleanConverter},ConverterParameter='Researcher'}">
+ <StackPanel Orientation="Horizontal">
+ <materialDesign:PackIcon VerticalAlignment="Center" Kind="ContentSave"></materialDesign:PackIcon>
+ <TextBlock Margin="10 0 0 0">SAVE PARAMETERS</TextBlock>
+ </StackPanel>
+ </Button>
+ <Button Height="40" Margin="10 0 0 0" Command="{Binding PushProcessParametersCommand}" HorizontalAlignment="Left">
+ <StackPanel Orientation="Horizontal">
+ <materialDesign:PackIcon VerticalAlignment="Center" Kind="ArrowRightBold"></materialDesign:PackIcon>
+ <TextBlock Margin="10 0 0 0">PUSH PARAMETERS</TextBlock>
+ </StackPanel>
+ </Button>
+ </StackPanel>
</StackPanel>
</StackPanel>
</Grid>
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 18dc795bd..28e488aae 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
@@ -251,7 +251,7 @@ namespace Tango.MachineStudio.Developer.Views
private void BrushPicker_ColorChanged(object sender, BrushPicker.ColorChangedEventArgs e)
{
-
+
}
private void ColorCanvas_SelectedColorChanged(object sender, RoutedPropertyChangedEventArgs<Color?> e)
@@ -284,7 +284,7 @@ namespace Tango.MachineStudio.Developer.Views
private void listBoxSegments_PreviewMouseDown(object sender, MouseButtonEventArgs e)
{
-
+
}
private void listBoxSegments_MouseEnter(object sender, MouseEventArgs e)
@@ -295,22 +295,26 @@ namespace Tango.MachineStudio.Developer.Views
private void OnBrushStopFieldValueChanged(object sender, RoutedPropertyChangedEventArgs<double?> e)
{
- BrushStop stop = null;
- var dataContext = (sender as FrameworkElement).DataContext;
-
- if (dataContext != null)
+ try
{
- if (dataContext is BrushStop)
- {
- stop = dataContext as BrushStop;
- }
- else
+ BrushStop stop = null;
+ var dataContext = (sender as FrameworkElement).DataContext;
+
+ if (dataContext != null)
{
- stop = (dataContext as LiquidVolume).BrushStop;
- }
+ if (dataContext is BrushStop)
+ {
+ stop = dataContext as BrushStop;
+ }
+ else
+ {
+ stop = (dataContext as LiquidVolume).BrushStop;
+ }
- _vm.OnBrushStopFieldValueChanged(stop);
+ _vm.OnBrushStopFieldValueChanged(stop);
+ }
}
+ catch { }
}
private void OnBrushStopMouseDown(object sender, MouseButtonEventArgs e)