aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/MachineStudio')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/JobProgressToPositionConverter.cs43
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/ObjectsNotEqualToBooleanConveter.cs30
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/SegmentLengthToWidthConverter.cs22
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs75
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml153
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs5
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs29
8 files changed, 322 insertions, 37 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/JobProgressToPositionConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/JobProgressToPositionConverter.cs
new file mode 100644
index 000000000..9865b26f8
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/JobProgressToPositionConverter.cs
@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+using Tango.Integration.Observables;
+
+namespace Tango.MachineStudio.Developer.Converters
+{
+ public class JobProgressToPositionConverter : IMultiValueConverter
+ {
+ public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
+ {
+ try
+ {
+ Job job = values[0] as Job;
+
+ if (job != null)
+ {
+ double progress = System.Convert.ToDouble(values[1]);
+ double parentElementWidth = System.Convert.ToDouble(values[2]);
+
+ return (progress / job.Length) * parentElementWidth;
+ }
+ else
+ {
+ return 0d;
+ }
+ }
+ catch
+ {
+ return 0d;
+ }
+ }
+
+ public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/ObjectsNotEqualToBooleanConveter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/ObjectsNotEqualToBooleanConveter.cs
new file mode 100644
index 000000000..15bfd6add
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/ObjectsNotEqualToBooleanConveter.cs
@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+
+namespace Tango.MachineStudio.Developer.Converters
+{
+ public class ObjectsNotEqualToBooleanConveter : IMultiValueConverter
+ {
+ public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
+ {
+ try
+ {
+ return (values[0] != values[1]);
+ }
+ catch
+ {
+ return true;
+ }
+ }
+
+ public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/SegmentLengthToWidthConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/SegmentLengthToWidthConverter.cs
index 959fb6410..b632d9d12 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/SegmentLengthToWidthConverter.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/SegmentLengthToWidthConverter.cs
@@ -19,21 +19,29 @@ namespace Tango.MachineStudio.Developer.Converters
if (values.Length == 4)
{
Job job = values[0] as Job;
- double jobLength = System.Convert.ToDouble(values[1]);
- double elementWidth = System.Convert.ToDouble(values[2]);
- double segmentLength = System.Convert.ToDouble(values[3]);
- double totalLength = job.Length;
- return (segmentLength / totalLength) * elementWidth;
+ if (job != null && values[1] is double)
+ {
+ double jobLength = System.Convert.ToDouble(values[1]);
+ double elementWidth = System.Convert.ToDouble(values[2]);
+ double segmentLength = System.Convert.ToDouble(values[3]);
+ double totalLength = job.Length;
+
+ return (segmentLength / totalLength) * elementWidth;
+ }
+ else
+ {
+ return 0d;
+ }
}
else
{
- return 0;
+ return 0d;
}
}
catch
{
- return 0;
+ return 0d;
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj
index b58908048..3b72c4971 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj
@@ -77,7 +77,9 @@
<Compile Include="Converters\BrushStopToOffsetLimitConverter.cs" />
<Compile Include="Converters\DbRmlViewToEntityConverter.cs" />
<Compile Include="Converters\InkVolumeToLiquidRmlFactor.cs" />
+ <Compile Include="Converters\JobProgressToPositionConverter.cs" />
<Compile Include="Converters\JobToColumnDefinitionsConverter.cs" />
+ <Compile Include="Converters\ObjectsNotEqualToBooleanConveter.cs" />
<Compile Include="Converters\SegmentLengthToWidthConverter.cs" />
<Compile Include="Converters\SegmentToBrushConverter.cs" />
<Compile Include="Converters\SegmentToBrushConverterMulti.cs" />
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
index 85febd0f1..4f7447253 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
@@ -15,6 +15,7 @@ using Tango.MachineStudio.Common.Notifications;
using Tango.MachineStudio.Common.StudioApplication;
using Tango.SharedUI;
using System.Runtime.CompilerServices;
+using System.Windows.Threading;
namespace Tango.MachineStudio.Developer.ViewModels
{
@@ -22,7 +23,7 @@ namespace Tango.MachineStudio.Developer.ViewModels
/// Represents the developer module main view, view model.
/// </summary>
/// <seealso cref="Tango.SharedUI.ViewModel" />
- public class MainViewVM : ViewModel
+ public class MainViewVM : ViewModel, IShutdownRequestBlocker
{
private INotificationProvider _notification;
@@ -203,13 +204,35 @@ namespace Tango.MachineStudio.Developer.ViewModels
}
private bool _isJobRunning;
-
+ /// <summary>
+ /// Gets or sets a value indicating whether a job is currently running.
+ /// </summary>
public bool IsJobRunning
{
get { return _isJobRunning; }
set { _isJobRunning = value; RaisePropertyChangedAuto(); }
}
+ private Job _runningJob;
+ /// <summary>
+ /// Gets or sets the currently running job.
+ /// </summary>
+ public Job RunningJob
+ {
+ get { return _runningJob; }
+ set { _runningJob = value; RaisePropertyChangedAuto(); }
+ }
+
+ private double _runningJobProgress;
+ /// <summary>
+ /// Gets or sets the running job current progress.
+ /// </summary>
+ public double RunningJobProgress
+ {
+ get { return _runningJobProgress; }
+ set { _runningJobProgress = value; RaisePropertyChangedAuto(); }
+ }
+
#endregion
#region Commands
@@ -279,6 +302,11 @@ namespace Tango.MachineStudio.Developer.ViewModels
/// </summary>
public RelayCommand StartJobCommand { get; set; }
+ /// <summary>
+ /// Gets or sets the stop job command.
+ /// </summary>
+ public RelayCommand StopJobCommand { get; set; }
+
#endregion
#region Constructors
@@ -324,6 +352,7 @@ namespace Tango.MachineStudio.Developer.ViewModels
RemoveBrushStopCommand = new RelayCommand(RemoveBrushStop, () => SelectedBrushStop != null);
SaveJobsCommand = new RelayCommand(SaveJobs, () => SelectedMachine != null);
StartJobCommand = new RelayCommand(StartJob, () => SelectedJob != null && !IsJobRunning);
+ StopJobCommand = new RelayCommand(StopJob, () => IsJobRunning);
}
#endregion
@@ -438,9 +467,32 @@ namespace Tango.MachineStudio.Developer.ViewModels
#region Private Methods
+ private void StopJob()
+ {
+ RunningJobProgress = 0;
+ IsJobRunning = false;
+ RunningJob = null;
+ }
+
private void StartJob()
{
IsJobRunning = true;
+ RunningJob = SelectedJob;
+
+ DispatcherTimer timer = new DispatcherTimer();
+ timer.Interval = TimeSpan.FromSeconds(0.1);
+ timer.Tick += (x, y) =>
+ {
+ if (RunningJob == null || RunningJobProgress >= RunningJob.Length)
+ {
+ timer.Stop();
+ StopJob();
+ return;
+ }
+ RunningJobProgress += 0.1;
+ };
+
+ timer.Start();
}
private async void SaveJobs()
@@ -739,5 +791,24 @@ namespace Tango.MachineStudio.Developer.ViewModels
}
#endregion
+
+ #region IShutdownRequestBlocker
+
+ public Task<bool> OnShutdownRequest()
+ {
+ if (IsJobRunning)
+ {
+ InvokeUI(() =>
+ {
+ _notification.ShowWarning("Please stop the currently running job before closing the developer module.");
+ });
+
+ return Task.FromResult(false);
+ }
+
+ return Task.FromResult(true);
+ }
+
+ #endregion
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml
index a1b607b8b..5dbb8604b 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml
@@ -42,6 +42,8 @@
<localConverters:SegmentToGradientStopsConverterMulti x:Key="SegmentToGradientStopsConverterMulti" />
<localConverters:SegmentToBrushConverter x:Key="SegmentToBrushConverter" />
<localConverters:SegmentToBrushConverterMulti x:Key="SegmentToBrushConverterMulti" />
+ <localConverters:ObjectsNotEqualToBooleanConveter x:Key="ObjectsNotEqualToBooleanConveter" />
+ <localConverters:JobProgressToPositionConverter x:Key="JobProgressToPositionConverter" />
<SolidColorBrush x:Key="SideBarBackground" Color="White">
@@ -164,12 +166,12 @@
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
- <Grid>
+ <Grid Background="#202020" TextElement.Foreground="Silver">
<Grid.Style>
<Style TargetType="Grid">
<Setter Property="LayoutTransform">
<Setter.Value>
- <ScaleTransform ScaleX="1" ScaleY="0" />
+ <ScaleTransform ScaleX="1" ScaleY="1" />
</Setter.Value>
</Setter>
<Style.Triggers>
@@ -192,11 +194,118 @@
</Style.Triggers>
</Style>
</Grid.Style>
- <Border BorderBrush="Silver" BorderThickness="0 0 0 1" Padding="10">
- <TextBlock>JOB RUNNING...</TextBlock>
+ <Border BorderBrush="#404040" BorderThickness="0 0 0 1" Padding="20">
+ <DockPanel>
+ <StackPanel Orientation="Horizontal" DockPanel.Dock="Left">
+ <ProgressBar Width="30" Height="30" HorizontalAlignment="Center" VerticalAlignment="Center" IsIndeterminate="True" Style="{StaticResource MaterialDesignCircularProgressBar}" Value="0" />
+ <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" FontSize="14" FontStyle="Italic" FontWeight="DemiBold">
+ <Run Text="Running '"></Run>
+ <Run Text="{Binding RunningJob.Name}"></Run>
+ <Run Text="'..."></Run>
+ </TextBlock>
+ </StackPanel>
+ <StackPanel DockPanel.Dock="Right">
+ <Button Height="40" Width="170" Command="{Binding StopJobCommand}" Background="#FF6464" BorderBrush="#FF6464">
+ <StackPanel Orientation="Horizontal">
+ <materialDesign:PackIcon VerticalAlignment="Center" Width="24" Height="24" Kind="Stop" />
+ <TextBlock VerticalAlignment="Center" Margin="10 0 0 0">STOP</TextBlock>
+ </StackPanel>
+ </Button>
+ </StackPanel>
+ <Grid>
+ <Grid>
+ <Border VerticalAlignment="Bottom" Width="1200" BorderBrush="#404040" BorderThickness="0" ClipToBounds="False">
+ <Grid ClipToBounds="False" Height="32">
+ <ItemsControl ClipToBounds="False" x:Name="runningJobBrushList">
+ <ItemsControl.ItemsPanel>
+ <ItemsPanelTemplate>
+ <StackPanel Orientation="Horizontal" ClipToBounds="False"></StackPanel>
+ </ItemsPanelTemplate>
+ </ItemsControl.ItemsPanel>
+ <ItemsControl.ItemTemplate>
+ <DataTemplate>
+ <Grid>
+ <Grid.Width>
+ <MultiBinding Converter="{StaticResource SegmentLengthToWidthConverter}">
+ <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.RunningJob"></Binding>
+ <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.RunningJob.Length"></Binding>
+ <Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="ActualWidth"></Binding>
+ <Binding Path="Length"></Binding>
+ </MultiBinding>
+ </Grid.Width>
+ <Rectangle Height="10" VerticalAlignment="Bottom">
+ <Rectangle.Fill>
+ <MultiBinding Converter="{StaticResource SegmentToBrushConverterMulti}">
+ <Binding Path="."></Binding>
+ <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.RunningJob"></Binding>
+ <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.RunningJob.Length"></Binding>
+ </MultiBinding>
+ </Rectangle.Fill>
+ </Rectangle>
+
+ <StackPanel Margin="0 0 0 0" HorizontalAlignment="Center">
+ <TextBlock FontSize="9" HorizontalAlignment="Right">
+ <Run Text="{Binding Length,Mode=OneWay}"></Run>
+ <Run FontSize="8" Text="m"></Run>
+ </TextBlock>
+ <materialDesign:PackIcon HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5" Kind="Triangle" Width="8" Height="8">
+ <materialDesign:PackIcon.RenderTransform>
+ <RotateTransform Angle="180" />
+ </materialDesign:PackIcon.RenderTransform>
+ </materialDesign:PackIcon>
+ </StackPanel>
+ </Grid>
+ </DataTemplate>
+ </ItemsControl.ItemTemplate>
+ </ItemsControl>
+
+ <StackPanel Margin="-20 -5 0 0" HorizontalAlignment="Left">
+ <TextBlock FontSize="9">
+ <Run Text="0"></Run>
+ <Run FontSize="8" Text="m"></Run>
+ </TextBlock>
+ <materialDesign:PackIcon HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5" Kind="SubdirectoryArrowRight" Width="16" Height="16">
+
+ </materialDesign:PackIcon>
+ </StackPanel>
+
+ <StackPanel Margin="0 -5 -20 0" HorizontalAlignment="Right">
+ <TextBlock FontSize="9">
+ <Run Text="{Binding RunningJob.Length,Mode=OneWay}"></Run>
+ <Run FontSize="8" Text="m"></Run>
+ </TextBlock>
+ <materialDesign:PackIcon HorizontalAlignment="Right" RenderTransformOrigin="0.5,0.5" Kind="FlagCheckered" Width="16" Height="16">
+
+ </materialDesign:PackIcon>
+ </StackPanel>
+
+ <Border BorderBrush="#404040" BorderThickness="1" VerticalAlignment="Bottom" Height="10">
+
+ </Border>
+
+ <Canvas x:Name="jobProgressCanvas">
+ <Grid Canvas.Top="0">
+ <Canvas.Left>
+ <MultiBinding Converter="{StaticResource JobProgressToPositionConverter}">
+ <Binding Path="RunningJob" />
+ <Binding Path="RunningJobProgress" />
+ <Binding ElementName="jobProgressCanvas" Path="ActualWidth" />
+ </MultiBinding>
+ </Canvas.Left>
+ <materialDesign:PackIcon Kind="MapMarker" Width="16" Height="16" Margin="-6 0 0 0" />
+ <TextBlock Margin="-4 -18 0 0" FontSize="10" Text="{Binding RunningJobProgress,StringFormat=0.0}"></TextBlock>
+ </Grid>
+ </Canvas>
+ </Grid>
+ </Border>
+ </Grid>
+ </Grid>
+ </DockPanel>
</Border>
+
+ <ProgressBar IsIndeterminate="True" VerticalAlignment="Bottom" Height="3"></ProgressBar>
</Grid>
-
+
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
@@ -316,7 +425,7 @@
</Style>
<Style TargetType="ContentControl">
- <Setter Property="FontFamily" Value="digital-7"></Setter>
+ <!--<Setter Property="FontFamily" Value="digital-7"></Setter>-->
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ContentControl">
@@ -353,7 +462,7 @@
<DataTemplate>
<ContentControl>
<StackPanel>
- <TextBlock Text="{Binding Name}"></TextBlock>
+ <TextBlock Text="{Binding Name}" FontSize="10"></TextBlock>
<mahapps:NumericUpDown Minimum="0" Maximum="10000" StringFormat="0.0" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding Value,Mode=TwoWay}"></mahapps:NumericUpDown>
</StackPanel>
</ContentControl>
@@ -467,6 +576,12 @@
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid>
+ <Grid.IsEnabled>
+ <MultiBinding Converter="{StaticResource ObjectsNotEqualToBooleanConveter}">
+ <Binding Path="SelectedJob" />
+ <Binding Path="RunningJob" />
+ </MultiBinding>
+ </Grid.IsEnabled>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
@@ -513,7 +628,7 @@
</StackPanel>
<DockPanel LastChildFill="True">
<ToggleButton Margin="10 0 0 0" DockPanel.Dock="Right" VerticalAlignment="Bottom" HorizontalAlignment="Right" IsChecked="{Binding SelectedJob.EnableInterSegment}"></ToggleButton>
- <mahapps:NumericUpDown StringFormat="{}{0:N1} m" 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>
+ <mahapps:NumericUpDown StringFormat="{}{0:N1} m" FontFamily="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>
</DockPanel>
</StackPanel>
</Border>
@@ -623,7 +738,7 @@
<Image Source="../Images/ruler.png" Width="32"></Image>
<TextBlock VerticalAlignment="Center" Margin="5 0 0 0" FontSize="10">Length</TextBlock>
</StackPanel>
- <mahapps:NumericUpDown StringFormat="{}{0:N1} m" Margin="0 2 0 0" Minimum="1" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0 0 0 1" BorderBrush="DimGray" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding SelectedSegment.Length,Mode=TwoWay}"></mahapps:NumericUpDown>
+ <mahapps:NumericUpDown FontFamily="digital-7" StringFormat="{}{0:N1} m" Margin="0 2 0 0" Minimum="1" Maximum="10000" InterceptArrowKeys="True" Background="Transparent" BorderThickness="0 0 0 1" BorderBrush="DimGray" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Left" Value="{Binding SelectedSegment.Length,Mode=TwoWay}"></mahapps:NumericUpDown>
</StackPanel>
</Border>
</StackPanel>
@@ -1043,7 +1158,7 @@
<Grid DockPanel.Dock="Right">
<StackPanel Orientation="Horizontal">
- <Button Height="40" Width="170" Command="{Binding StartJobCommand}">
+ <Button Height="40" Width="170" Command="{Binding StartJobCommand}" Click="OnJobStartClick">
<StackPanel Orientation="Horizontal">
<materialDesign:PackIcon VerticalAlignment="Center" Width="24" Height="24" Kind="ClockFast" />
<TextBlock VerticalAlignment="Center" Margin="10 0 0 0">START</TextBlock>
@@ -1052,8 +1167,8 @@
</StackPanel>
</Grid>
- <Grid>
- <Border VerticalAlignment="Center" Height="10" Margin="30 0 40 0" BorderBrush="Gainsboro" BorderThickness="1" ClipToBounds="False">
+ <Grid Margin="0 -18 0 0">
+ <Border VerticalAlignment="Center" Height="35" Margin="30 0 40 0" ClipToBounds="False">
<Grid ClipToBounds="False">
<ItemsControl x:Name="jobBrushList" ClipToBounds="False">
<ItemsControl.ItemsPanel>
@@ -1072,7 +1187,7 @@
<Binding Path="Length"></Binding>
</MultiBinding>
</Grid.Width>
- <Rectangle>
+ <Rectangle VerticalAlignment="Bottom" Height="10">
<Rectangle.Fill>
<MultiBinding Converter="{StaticResource SegmentToBrushConverterMulti}">
<Binding Path="."></Binding>
@@ -1083,7 +1198,7 @@
</Rectangle.Fill>
</Rectangle>
- <StackPanel Margin="0 -23 0 0" HorizontalAlignment="Right">
+ <StackPanel Margin="0 0 0 0" HorizontalAlignment="Center">
<TextBlock FontSize="9" HorizontalAlignment="Right">
<Run Text="{Binding Length,Mode=OneWay}"></Run>
<Run Foreground="Gray" FontSize="8" Text="m"></Run>
@@ -1099,7 +1214,7 @@
</ItemsControl.ItemTemplate>
</ItemsControl>
- <StackPanel Margin="-20 -26 0 0" HorizontalAlignment="Left">
+ <StackPanel Margin="-20 -5 0 0" HorizontalAlignment="Left">
<TextBlock FontSize="9">
<Run Text="0"></Run>
<Run Foreground="Gray" FontSize="8" Text="m"></Run>
@@ -1109,7 +1224,7 @@
</materialDesign:PackIcon>
</StackPanel>
- <StackPanel Margin="0 -26 -30 0" HorizontalAlignment="Right">
+ <StackPanel Margin="0 -5 -20 0" HorizontalAlignment="Right">
<TextBlock FontSize="9">
<Run Text="{Binding SelectedJob.Length,Mode=OneWay}"></Run>
<Run Foreground="Gray" FontSize="8" Text="m"></Run>
@@ -1118,6 +1233,10 @@
</materialDesign:PackIcon>
</StackPanel>
+
+ <Border BorderBrush="Gainsboro" BorderThickness="1" VerticalAlignment="Bottom" Height="10">
+
+ </Border>
</Grid>
</Border>
</Grid>
@@ -1322,7 +1441,7 @@
</Border>
</Grid>
- <Grid Grid.ColumnSpan="3" Background="White">
+ <Grid Grid.ColumnSpan="3" Background="White" Visibility="Collapsed">
<Grid.Style>
<Style TargetType="Grid">
<Setter Property="RenderTransform">
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 143280e66..e6f685535 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
@@ -128,5 +128,10 @@ namespace Tango.MachineStudio.Developer.Views
{
UpdateGradientBrushDisplay();
}
+
+ private void OnJobStartClick(object sender, RoutedEventArgs e)
+ {
+ runningJobBrushList.ItemsSource = jobBrushList.ItemsSource;
+ }
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs
index a59ecf8e0..7ea18014c 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/StudioApplication/DefaultStudioApplicationManager.cs
@@ -118,6 +118,24 @@ namespace Tango.MachineStudio.UI.StudioApplication
await Task.Factory.StartNew(async () =>
{
+ //Do Shutdown Procedures...
+ foreach (var vm in ServiceLocator.Current.GetAllInstancesByBase<IShutdownRequestBlocker>())
+ {
+ try
+ {
+ var result = await vm.OnShutdownRequest();
+ if (!result)
+ {
+ IsShuttingDown = false;
+ return;
+ }
+ }
+ catch (Exception ex)
+ {
+ LogManager.Log(ex, "Error on shutdown request with " + vm.GetType().Name);
+ }
+ }
+
try
{
if (ConnectedMachine != null)
@@ -130,17 +148,6 @@ namespace Tango.MachineStudio.UI.StudioApplication
LogManager.Log(ex, "Error disconnecting from machine.");
}
- //Do Shutdown Procedures...
- foreach (var vm in ServiceLocator.Current.GetAllInstancesByBase<IShutdownRequestBlocker>())
- {
- var result = await vm.OnShutdownRequest();
- if (!result)
- {
- IsShuttingDown = false;
- return;
- }
- }
-
_navigationManager.NavigateTo(NavigationView.ShutdownView);
Thread.Sleep(3000);
Environment.Exit(0);