aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules
diff options
context:
space:
mode:
authorAvi Levkovich <avi@twine-s.com>2018-02-26 16:30:42 +0200
committerAvi Levkovich <avi@twine-s.com>2018-02-26 16:30:42 +0200
commit5942bb7a13e5ad26c720a1b95ae4ea766eeeda25 (patch)
tree2a855ce1065c875e615f5b040f984cb3fb84e518 /Software/Visual_Studio/MachineStudio/Modules
parent4c052df707280abd208b03aa88cf904e0eb6b9bf (diff)
parent6549d8672a93893599e921d9f1938af7dcabb8bf (diff)
downloadTango-5942bb7a13e5ad26c720a1b95ae4ea766eeeda25.tar.gz
Tango-5942bb7a13e5ad26c720a1b95ae4ea766eeeda25.zip
MERGE!
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/DataCaptureModule.cs2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/ViewModels/MainViewVM.cs57
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/MainView.xaml47
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/PlayingBarView.xaml12
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/MillisecondsToTimeSpanConverter.cs30
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Resources/GraphEx.xaml126
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Tango.MachineStudio.Developer.csproj5
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs1
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml28
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml.cs23
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MachineJobSelectionView.xaml78
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/StubsModule.cs2
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs29
13 files changed, 240 insertions, 200 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/DataCaptureModule.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/DataCaptureModule.cs
index ee650dc13..b138af4f3 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/DataCaptureModule.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/DataCaptureModule.cs
@@ -69,7 +69,7 @@ namespace Tango.MachineStudio.DataCapture
{
get
{
- return Permissions.RunTechnicianModule;
+ return Permissions.RunDataCaptureModule;
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/ViewModels/MainViewVM.cs
index 269007dac..840863752 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/ViewModels/MainViewVM.cs
@@ -122,6 +122,26 @@ namespace Tango.MachineStudio.DataCapture.ViewModels
/// </summary>
public RelayCommand MediaPlayPauseCommand { get; set; }
+ /// <summary>
+ /// Gets or sets the media seek forward command.
+ /// </summary>
+ public RelayCommand MediaSeekForwardCommand { get; set; }
+
+ /// <summary>
+ /// Gets or sets the media seek backward command.
+ /// </summary>
+ public RelayCommand MediaSeekBackwardCommand { get; set; }
+
+ /// <summary>
+ /// Gets or sets the media seek command.
+ /// </summary>
+ public RelayCommand<double> MediaSeekCommand { get; set; }
+
+ /// <summary>
+ /// Gets or sets the media seek hold command.
+ /// </summary>
+ public RelayCommand MediaSeekHoldCommand { get; set; }
+
#endregion
#region Constructors
@@ -148,6 +168,10 @@ namespace Tango.MachineStudio.DataCapture.ViewModels
MediaRecordingCommand = new RelayCommand(StartDiagnosticsRecording, () => !Recorder.IsRecording && MachineOperator != null && !Player.IsPlaying);
MediaStopCommand = new RelayCommand(StopRecorderOrPlayer, () => Recorder.IsRecording || Player.IsPlaying);
MediaPlayPauseCommand = new RelayCommand(DiagnosticsTogglePlayPause, () => !Recorder.IsRecording && SelectedRecording != null);
+ MediaSeekForwardCommand = new RelayCommand(MediaSeekForward, () => !Recorder.IsRecording && Player.IsPlaying);
+ MediaSeekBackwardCommand = new RelayCommand(MediaSeekBackward, () => !Recorder.IsRecording && Player.IsPlaying);
+ MediaSeekCommand = new RelayCommand<double>(MediaSeek, (x) => Player.IsPlaying);
+ MediaSeekHoldCommand = new RelayCommand(MediaSeekHold,() => Player.IsPlaying);
_recordingsFolder = Path.Combine(SettingsManager.DefaultFolder, "Recordings");
Directory.CreateDirectory(_recordingsFolder);
@@ -321,6 +345,39 @@ namespace Tango.MachineStudio.DataCapture.ViewModels
InvalidateRelayCommands();
}
+ private void MediaSeekBackward()
+ {
+ if (Player.IsPlaying)
+ {
+ Player.Seek(Player.CurrentFrame - 200);
+ }
+ }
+
+ private void MediaSeekForward()
+ {
+ if (Player.IsPlaying)
+ {
+ Player.Seek(Player.CurrentFrame + 200);
+ }
+ }
+
+ private void MediaSeek(double frame)
+ {
+ if (Player != null)
+ {
+ Player.Seek((int)frame);
+ Player.Play();
+ }
+ }
+
+ private void MediaSeekHold()
+ {
+ if (Player != null)
+ {
+ Player.Pause();
+ }
+ }
+
#endregion
}
}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/MainView.xaml
index 72f7da03d..e3f9d380a 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/MainView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/MainView.xaml
@@ -3,6 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
@@ -161,7 +162,7 @@
<Grid Grid.Row="1">
- <DockPanel HorizontalAlignment="Center" VerticalAlignment="Top" Margin="60" Visibility="{Binding Recorder.IsRecording,Converter={StaticResource BooleanToVisibilityConverter}}" TextElement.FontSize="40">
+ <DockPanel HorizontalAlignment="Center" VerticalAlignment="Top" Margin="60" Visibility="{Binding Recorder.IsRecording,Converter={StaticResource BooleanToVisibilityConverter}}" TextElement.FontSize="20">
<TextBlock DockPanel.Dock="Left">
<Run FontWeight="SemiBold" FontStyle="Italic">Total Frames:</Run>
<Run FontStyle="Italic" Foreground="#545454" Text="{Binding Recorder.TotalFramesRecorded,StringFormat={}{0:N0},Mode=OneWay,TargetNullValue=0,FallbackValue=0}"></Run>
@@ -175,7 +176,7 @@
<StackPanel VerticalAlignment="Bottom" Margin="0 0 0 50">
<Grid Margin="50 0 0 0">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center">
- <Button Command="{Binding MediaStopCommand}" Margin="0 0 0 0" Style="{StaticResource MaterialDesignFloatingActionButton}" Padding="0" Width="150" Height="150" Background="Transparent">
+ <Button Command="{Binding MediaSeekBackwardCommand}" Margin="0 0 0 0" Style="{StaticResource MaterialDesignFloatingActionButton}" Padding="0" Width="150" Height="150" Background="Transparent">
<materialDesign:PackIcon Width="100" Height="100" Kind="Rewind" Foreground="{StaticResource AccentColorBrush}" />
</Button>
<Button Command="{Binding MediaPlayPauseCommand}" Margin="20 0 0 0" Style="{StaticResource MaterialDesignFloatingActionButton}" Padding="0" Width="200" Height="200" Background="Transparent">
@@ -199,7 +200,7 @@
<Button Command="{Binding MediaStopCommand}" Margin="20 0 0 0" Style="{StaticResource MaterialDesignFloatingActionButton}" Padding="0" Width="150" Height="150" Background="Transparent">
<materialDesign:PackIcon Width="100" Height="100" Kind="Stop" Foreground="{StaticResource AccentColorBrush}" />
</Button>
- <Button Command="{Binding MediaStopCommand}" Margin="20 0 0 0" Style="{StaticResource MaterialDesignFloatingActionButton}" Padding="0" Width="150" Height="150" Background="Transparent">
+ <Button Command="{Binding MediaSeekForwardCommand}" Margin="20 0 0 0" Style="{StaticResource MaterialDesignFloatingActionButton}" Padding="0" Width="150" Height="150" Background="Transparent">
<materialDesign:PackIcon Width="100" Height="100" Kind="FastForward" Foreground="{StaticResource AccentColorBrush}" />
</Button>
<Button Command="{Binding MediaRecordingCommand}" Margin="20 0 0 0" Style="{StaticResource MaterialDesignFloatingActionButton}" Foreground="#FF7A7A" BorderBrush="#FF8585" Padding="0" Width="100" Height="100" Background="Transparent" ToolTip="Start Recording">
@@ -207,12 +208,28 @@
</Button>
</StackPanel>
<Grid>
- <TextBlock Margin="0 0 50 0" VerticalAlignment="Center" HorizontalAlignment="Right" Foreground="#FF8585" FontSize="60" FontFamily="{StaticResource digital-7}">
- <TextBlock.Style>
- <Style TargetType="TextBlock">
+ <Label Margin="0 0 50 0" VerticalAlignment="Center" HorizontalAlignment="Right" Foreground="#FF8585" FontSize="60" FontFamily="{StaticResource digital-7}">
+ <Label.Style>
+ <Style TargetType="Label">
<Setter Property="Opacity" Value="1"></Setter>
+ <Setter Property="Content">
+ <Setter.Value>
+ <TextBlock>
+ <Run Text="{Binding Player.CurrentTime,Mode=OneWay,StringFormat=hh\\:mm\\:ss,FallbackValue='00:00:00'}"/>
+ <Run>/</Run>
+ <Run Text="{Binding Player.TotalTime,Mode=OneWay,StringFormat=hh\\:mm\\:ss,FallbackValue='00:00:00'}"/>
+ </TextBlock>
+ </Setter.Value>
+ </Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding Recorder.IsRecording}" Value="True">
+ <Setter Property="Content">
+ <Setter.Value>
+ <TextBlock>
+ <Run Text="{Binding Recorder.RecordingTime,Mode=OneWay,StringFormat=hh\\:mm\\:ss,FallbackValue='00:00:00'}"/>
+ </TextBlock>
+ </Setter.Value>
+ </Setter>
<DataTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>
@@ -235,14 +252,20 @@
</DataTrigger>
</Style.Triggers>
</Style>
- </TextBlock.Style>
- <Run Text="{Binding Player.CurrentTime,Mode=OneWay,StringFormat=hh\\:mm\\:ss,FallbackValue='00:00:00'}"/>
- <Run>/</Run>
- <Run Text="{Binding Player.TotalTime,Mode=OneWay,StringFormat=hh\\:mm\\:ss,FallbackValue='00:00:00'}"/>
- </TextBlock>
+ </Label.Style>
+ </Label>
</Grid>
</Grid>
- <Slider Margin="10 40 50 0" Visibility="{Binding Recorder.IsRecording,Converter={StaticResource BooleanToVisibilityInverseConverter}}" Maximum="{Binding Player.TotalFrames}" Value="{Binding Player.CurrentFrame}"></Slider>
+ <Slider x:Name="slider" Margin="10 40 50 0" Visibility="{Binding Recorder.IsRecording,Converter={StaticResource BooleanToVisibilityInverseConverter}}" Maximum="{Binding Player.TotalFrames}" Value="{Binding Player.CurrentFrame,Mode=OneWay}">
+ <i:Interaction.Triggers>
+ <i:EventTrigger EventName="PreviewMouseDown">
+ <i:InvokeCommandAction Command="{Binding MediaSeekHoldCommand}"></i:InvokeCommandAction>
+ </i:EventTrigger>
+ <i:EventTrigger EventName="PreviewMouseUp">
+ <i:InvokeCommandAction Command="{Binding MediaSeekCommand}" CommandParameter="{Binding ElementName=slider,Path=Value}"></i:InvokeCommandAction>
+ </i:EventTrigger>
+ </i:Interaction.Triggers>
+ </Slider>
</StackPanel>
</Grid>
</Grid>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/PlayingBarView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/PlayingBarView.xaml
index 3e76ce6ef..ee423e676 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/PlayingBarView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DataCapture/Views/PlayingBarView.xaml
@@ -3,6 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mahapps="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
@@ -47,7 +48,16 @@
</Button>
</StackPanel>
- <Slider VerticalAlignment="Center" Margin="10 0 10 0" Foreground="White" Maximum="{Binding Player.TotalFrames}" Value="{Binding Player.CurrentFrame}"></Slider>
+ <Slider x:Name="slider" VerticalAlignment="Center" Margin="10 0 10 0" Foreground="White" Maximum="{Binding Player.TotalFrames}" Value="{Binding Player.CurrentFrame,Mode=OneWay}">
+ <i:Interaction.Triggers>
+ <i:EventTrigger EventName="PreviewMouseDown">
+ <i:InvokeCommandAction Command="{Binding MediaSeekHoldCommand}"></i:InvokeCommandAction>
+ </i:EventTrigger>
+ <i:EventTrigger EventName="PreviewMouseUp">
+ <i:InvokeCommandAction Command="{Binding MediaSeekCommand}" CommandParameter="{Binding ElementName=slider,Path=Value}"></i:InvokeCommandAction>
+ </i:EventTrigger>
+ </i:Interaction.Triggers>
+ </Slider>
</DockPanel>
</Grid>
</UserControl>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/MillisecondsToTimeSpanConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/MillisecondsToTimeSpanConverter.cs
new file mode 100644
index 000000000..70b7ce191
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/MillisecondsToTimeSpanConverter.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 MillisecondsToTimeSpanConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value != null)
+ {
+ return TimeSpan.FromMilliseconds(System.Convert.ToInt32(value));
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Resources/GraphEx.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Resources/GraphEx.xaml
deleted file mode 100644
index a44a8191c..000000000
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Resources/GraphEx.xaml
+++ /dev/null
@@ -1,126 +0,0 @@
-<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:sys="clr-namespace:System;assembly=mscorlib"
- xmlns:local="clr-namespace:Tango.MachineStudio.Developer.Resources">
-
- <FontFamily x:Key="FontName">Segoe UI</FontFamily>
- <FontFamily x:Key="NotesFont">Lucida Console</FontFamily>
-
- <sys:Double x:Key="ExtraExtraLargeFontSize">28</sys:Double>
- <sys:Double x:Key="ExtraLargeFontSize">26</sys:Double>
- <sys:Double x:Key="LargeFontSize">20</sys:Double>
- <sys:Double x:Key="MediumFontSize">16</sys:Double>
- <sys:Double x:Key="SmallFontSize">14</sys:Double>
- <sys:Double x:Key="MiniFontSize">12</sys:Double>
- <sys:Double x:Key="TinyFontSize">9</sys:Double>
-
- <!--Colors-->
- <Color x:Key="borderColor">Silver</Color>
- <Color x:Key="graphGridLinesColor">#FFE9E9E9</Color>
- <Color x:Key="graphsMarkerColor">Gray</Color>
- <Color x:Key="materialColor">#03A9F4</Color>
-
-
- <!--Brushes-->
- <SolidColorBrush x:Key="borderBrush" Color="{StaticResource borderColor}"></SolidColorBrush>
- <SolidColorBrush x:Key="graphGridLinesBrush" Color="{StaticResource graphGridLinesColor}"></SolidColorBrush>
- <SolidColorBrush x:Key="BlackBrush" Color="#545454"></SolidColorBrush>
-
- <SolidColorBrush x:Key="graphGridLinesLightBrush" Color="{StaticResource graphGridLinesColor}"></SolidColorBrush>
- <SolidColorBrush x:Key="graphGridLinesDarkBrush" Color="#FF2E2E2E"></SolidColorBrush>
-
- <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" x:Key="graphBackgroundLight">
- <GradientStop Color="White"/>
- <GradientStop Color="#FFE9E9E9" Offset="1"/>
- </LinearGradientBrush>
-
- <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" x:Key="graphBackgroundDark">
- <GradientStop Color="Black"/>
- <GradientStop Color="#FF333333" Offset="1"/>
- </LinearGradientBrush>
-
- <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" x:Key="graphBackground">
- <GradientStop Color="White"/>
- <GradientStop Color="#FFE9E9E9" Offset="1"/>
- </LinearGradientBrush>
-
- <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" x:Key="graphLabelBackground" Opacity="0.7">
- <GradientStop Color="White"/>
- <GradientStop Color="#FFD9D9D9" Offset="1"/>
- </LinearGradientBrush>
-
- <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" x:Key="graphLegendBackground" Opacity="0.7">
- <GradientStop Color="#FFE9E9E9"/>
- <GradientStop Color="#FFBDBDBD" Offset="1"/>
- </LinearGradientBrush>
-
- <SolidColorBrush Color="#FFF1F1F1" x:Key="topBarBackgroundBrush"></SolidColorBrush>
-
- <!--Navigation Link Button-->
- <Style x:Key="LinkButton" TargetType="Button">
- <Setter Property="Stylus.IsPressAndHoldEnabled" Value="False"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="Button">
- <TextBlock FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}">
- <ContentPresenter /></TextBlock>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Setter Property="Foreground" Value="{StaticResource BlackBrush}" />
- <Style.Triggers>
- <Trigger Property="IsEnabled" Value="False">
- <Setter Property="Opacity" Value="0.5"></Setter>
- </Trigger>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter Property="Foreground" Value="{StaticResource AccentColorBrush}" />
- </Trigger>
- <EventTrigger RoutedEvent="TouchUp">
- <BeginStoryboard>
- <Storyboard>
- <ColorAnimation Storyboard.TargetProperty="Foreground.Color" Duration="0" To="{StaticResource BlackColor}"></ColorAnimation>
- </Storyboard>
- </BeginStoryboard>
- </EventTrigger>
- </Style.Triggers>
- </Style>
- <!--Navigation Link Button-->
-
-
- <!--Graph Label-->
- <Style x:Key="graphLabel" TargetType="Label">
- <Style.Setters>
- <Setter Property="IsHitTestVisible" Value="False"></Setter>
- <Setter Property="Margin" Value="-1 -1 0 0"></Setter>
- <Setter Property="HorizontalAlignment" Value="Left"></Setter>
- <Setter Property="VerticalAlignment" Value="Top"></Setter>
- <Setter Property="Padding" Value="0"></Setter>
- <Setter Property="ContentTemplate">
- <Setter.Value>
- <DataTemplate>
- <Border Width="Auto" Padding="0 0 20 0" Height="25" BorderBrush="{StaticResource AccentColorBrush}" BorderThickness="1" CornerRadius="0 0 30 0" Background="{StaticResource graphLabelBackground}" >
- <TextBlock Margin="5 0 0 0" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="{StaticResource TinyFontSize}" Text="{Binding}"></TextBlock>
- </Border>
- </DataTemplate>
- </Setter.Value>
- </Setter>
- </Style.Setters>
- </Style>
- <!--Graph Label-->
-
-
- <!--Graph Ticks Template-->
- <DataTemplate x:Key="graphTicksTemplate">
- <Ellipse Width="3" Height="3" Margin="0 0 0 0" Fill="{StaticResource AccentColorBrush}"></Ellipse>
- </DataTemplate>
- <!--Graph Ticks Template-->
-
- <DataTemplate x:Key="graphTooltipTemplate">
- <Border CornerRadius="5" BorderThickness="1" BorderBrush="White" Padding="8" MinWidth="50" Margin="20 0 20 0">
- <Border.Background>
- <SolidColorBrush Color="Black" Opacity="0.5"></SolidColorBrush>
- </Border.Background>
- <TextBlock Foreground="White" FontSize="10" HorizontalAlignment="Center" TextAlignment="Center" Text="{Binding StringFormat='0.000'}"></TextBlock>
- </Border>
- </DataTemplate>
-</ResourceDictionary> \ No newline at end of file
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 364b8573a..2d20b789c 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
@@ -108,6 +108,7 @@
<Compile Include="Converters\InkVolumeToLiquidRmlFactor.cs" />
<Compile Include="Converters\JobProgressToPositionConverter.cs" />
<Compile Include="Converters\JobToColumnDefinitionsConverter.cs" />
+ <Compile Include="Converters\MillisecondsToTimeSpanConverter.cs" />
<Compile Include="Converters\ObjectsNotEqualToBooleanConveter.cs" />
<Compile Include="Converters\OneToPercentConverter.cs" />
<Compile Include="Converters\SegmentLengthToWidthConverter.cs" />
@@ -136,10 +137,6 @@
<Compile Include="Views\RunningJobView.xaml.cs">
<DependentUpon>RunningJobView.xaml</DependentUpon>
</Compile>
- <Page Include="Resources\GraphEx.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </Page>
<Page Include="Views\MainView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
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 cf66efbd6..b9ef26e9b 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
@@ -1165,6 +1165,7 @@ namespace Tango.MachineStudio.Developer.ViewModels
LogManager.Log(String.Format("Saving the active job {0}...", ActiveJob.Name));
ActiveJob.LastUpdated = DateTime.UtcNow;
ActiveJob.Rml = SelectedRML;
+ ActiveJob.EstimatedDurationMili = (int)EstimatedDuration.TotalMilliseconds;
await ActiveJob.SaveAsync(_activeJobDbContext);
ReloadMachine();
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 4467b1f28..e9867d202 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
@@ -34,6 +34,13 @@
<Setter Property="Margin" Value="2" />
</Style>
+ <ResourceDictionary x:Key="SelectAllTextBoxResource">
+ <Style TargetType="TextBox">
+ <EventSetter Event="GotFocus" Handler="TextBox_GotFocus"></EventSetter>
+ <EventSetter Event="MouseDown" Handler="TextBox_PreviewMouseUp"></EventSetter>
+ </Style>
+ </ResourceDictionary>
+
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<converters:BooleanToVisibilityInverseConverter x:Key="BooleanToVisibilityInverseConverter" />
<converters:ColorToIntegerConverter x:Key="ColorToIntegerConverter"></converters:ColorToIntegerConverter>
@@ -59,6 +66,7 @@
<localConverters:OneToPercentConverter x:Key="OneToPercentConverter"/>
<converters:EnumToItemsSourceConverter x:Key="EnumToItemsSourceConverter" />
<converters:EnumToDescriptionConverter x:Key="EnumToDescriptionConverter" />
+ <converters:IsNotConverter x:Key="IsNotConverter" />
<ObjectDataProvider x:Key="dispenserDivisions" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
@@ -474,7 +482,7 @@
</Grid>
-
+
</StackPanel>
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Orientation="Horizontal" Margin="0 40 40 0">
@@ -617,13 +625,13 @@
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
- <ContentControl Style="{StaticResource numberBorder}" Width="60" Height="60" Margin="10 0 0 0">
+ <ContentControl Focusable="False" Style="{StaticResource numberBorder}" Width="60" Height="60" Margin="10 0 0 0">
<ContentControl.Foreground>
<SolidColorBrush Color="{Binding IdsPack.LiquidType.Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush>
</ContentControl.Foreground>
- <mahapps:NumericUpDown FontSize="16" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Volume, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.0" HideUpDownButtons="True" Minimum="0" Maximum="1000" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center">
+ <mahapps:NumericUpDown FontSize="16" FontFamily="{StaticResource digital-7}" HorizontalAlignment="Center" Value="{Binding Volume, Mode=TwoWay}" Background="Transparent" Width="40" StringFormat="0.00" HideUpDownButtons="True" Minimum="0" Maximum="1000" InterceptArrowKeys="True" BorderThickness="0" InterceptMouseWheel="True" HasDecimals="True" HorizontalContentAlignment="Center">
<mahapps:NumericUpDown.Resources>
- <Style TargetType="TextBox"/>
+ <StaticResource ResourceKey="SelectAllTextBoxResource"></StaticResource>
</mahapps:NumericUpDown.Resources>
</mahapps:NumericUpDown>
</ContentControl>
@@ -969,6 +977,16 @@
<DataTrigger Binding="{Binding DispenserStepDivision}" Value="{x:Static dispensing:DispenserStepDivisions.Auto}">
<Setter Property="Content" Value="Auto"></Setter>
</DataTrigger>
+ <DataTrigger Binding="{Binding DispenserStepDivision,Converter={StaticResource IsNotConverter},ConverterParameter={x:Static dispensing:DispenserStepDivisions.Auto}}" Value="True">
+ <Setter Property="Content">
+ <Setter.Value>
+ <TextBlock>
+ <Run Text="{Binding PulsePerSecond,Mode=OneWay,StringFormat='0.0'}"></Run>
+ <Run Text="(pulse)" FontSize="9" Foreground="Gray"></Run>
+ </TextBlock>
+ </Setter.Value>
+ </Setter>
+ </DataTrigger>
</Style.Triggers>
</Style>
</Label.Style>
@@ -1217,7 +1235,7 @@
<TextBox materialDesign:HintAssist.Hint="Table Name" DockPanel.Dock="Top" Text="{Binding Name}"></TextBox>
<WrapPanel Orientation="Vertical" Margin="0 5 0 0">
<WrapPanel.Resources>
- <Style TargetType="TextBlock" BasedOn="{StaticResource {x:Type TextBlock}}">
+ <Style TargetType="TextBlock">
<Setter Property="FontSize" Value="10"></Setter>
<Setter Property="Foreground" Value="#7A7A7A"></Setter>
<Setter Property="Margin" Value="0 5 0 5"></Setter>
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 27ea3cae8..470d98912 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
@@ -1,4 +1,5 @@
-using System;
+using MahApps.Metro.Controls;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -89,7 +90,7 @@ namespace Tango.MachineStudio.Developer.Views
private void UpdateGradientBrushDisplay()
{
- if (_vm.SelectedSegment != null)
+ if (_vm != null && _vm.SelectedSegment != null)
{
SegmentToGradientStopsConverter converter = new SegmentToGradientStopsConverter();
GradientStopCollection stops = converter.Convert(_vm.SelectedSegment, null, null, null) as GradientStopCollection;
@@ -97,7 +98,10 @@ namespace Tango.MachineStudio.Developer.Views
}
else
{
- gradientBrush.GradientStops = new GradientStopCollection();
+ if (gradientBrush != null)
+ {
+ gradientBrush.GradientStops = new GradientStopCollection();
+ }
}
}
@@ -133,5 +137,18 @@ namespace Tango.MachineStudio.Developer.Views
{
_vm.OnDropSegment(e.Draggable.DataContext as Segment, e.Droppable.DataContext as Segment);
}
+
+
+ private async void TextBox_GotFocus(object sender, RoutedEventArgs e)
+ {
+ await Task.Delay(200);
+ TextBox txtBox = sender as TextBox;
+ txtBox.SelectAll();
+ }
+
+ private void TextBox_PreviewMouseUp(object sender, MouseButtonEventArgs e)
+ {
+ e.Handled = true;
+ }
}
}
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 fcb730de7..1ddff2696 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
@@ -19,6 +19,9 @@
<UserControl.Resources>
<localConverters:SegmentToBrushConverterMulti x:Key="SegmentToBrushConverterMulti" />
<converters:DateTimeUTCToShortDateTimeConverter x:Key="DateTimeUTCToShortDateTimeConverter"/>
+ <localConverters:MillisecondsToTimeSpanConverter x:Key="MillisecondsToTimeSpanConverter" />
+ <converters:GreaterThanToBooleanConverter x:Key="GreaterThanToBooleanConverter" />
+ <converters:MathOperatorConverter x:Key="MathOperatorConverter" />
</UserControl.Resources>
<Grid>
@@ -80,7 +83,7 @@
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0 0 10 0">
<materialDesign:PackIcon Kind="Magnify" Width="26" Height="26"/>
- <TextBox Width="300" materialDesign:HintAssist.Hint="Search" Text="{Binding JobFilter,UpdateSourceTrigger=PropertyChanged}"></TextBox>
+ <TextBox Width="300" materialDesign:HintAssist.Hint="Search name, user, length..." Text="{Binding JobFilter,UpdateSourceTrigger=PropertyChanged}"></TextBox>
</StackPanel>
</Grid>
@@ -139,21 +142,21 @@
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
- <DataGridTemplateColumn Header="CREATION DATE" Width="170" CanUserSort="True" SortMemberPath="CreationDate">
+ <DataGridTemplateColumn Header="CREATION DATE" Width="150" CanUserSort="True" SortMemberPath="CreationDate">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding CreationDate,Converter={StaticResource DateTimeUTCToShortDateTimeConverter}}" VerticalAlignment="Center" FontSize="14"></TextBlock>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
- <DataGridTemplateColumn Header="LAST MODIFIED" Width="170" CanUserSort="True" SortMemberPath="LastUpdated">
+ <DataGridTemplateColumn Header="LAST MODIFIED" Width="150" CanUserSort="True" SortMemberPath="LastUpdated">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding LastUpdated,Converter={StaticResource DateTimeUTCToShortDateTimeConverter}}" VerticalAlignment="Center" FontSize="14"></TextBlock>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
- <DataGridTemplateColumn Header="LAST RUN" Width="170" CanUserSort="True" SortMemberPath="LastRun">
+ <DataGridTemplateColumn Header="LAST RUN" Width="150" CanUserSort="True" SortMemberPath="LastRun">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding LastRun,Converter={StaticResource DateTimeUTCToShortDateTimeConverter},FallbackValue='Never',TargetNullValue='Never'}" VerticalAlignment="Center" FontSize="14"></TextBlock>
@@ -177,29 +180,54 @@
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
- <DataGridTemplateColumn Width="1*">
+ <DataGridTemplateColumn Header="DURATION" Width="100" CanUserSort="True" SortMemberPath="EstimatedDurationMili">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
- <ItemsControl HorizontalAlignment="Right" ItemsSource="{Binding Segments}">
- <ItemsControl.ItemsPanel>
- <ItemsPanelTemplate>
- <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
-
- </StackPanel>
- </ItemsPanelTemplate>
- </ItemsControl.ItemsPanel>
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <Border Width="25" Height="25" Margin="10 0 0 0" BorderThickness="1" BorderBrush="DimGray" CornerRadius="3">
- <Border.Background>
- <MultiBinding Converter="{StaticResource SegmentToBrushConverterMulti}">
- <Binding Path="."></Binding>
- </MultiBinding>
- </Border.Background>
- </Border>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
+ <TextBlock VerticalAlignment="Center" FontSize="14">
+ <Run Text="{Binding EstimatedDurationMili,Converter={StaticResource MillisecondsToTimeSpanConverter},Mode=OneWay,StringFormat=hh\\:mm\\:ss,TargetNullValue='Unknown'}"></Run>
+ </TextBlock>
+ </DataTemplate>
+ </DataGridTemplateColumn.CellTemplate>
+ </DataGridTemplateColumn>
+ <DataGridTemplateColumn Width="1*" Header="SEGMENTS" CanUserSort="True" SortMemberPath="Segments.Count">
+ <DataGridTemplateColumn.CellTemplate>
+ <DataTemplate>
+ <StackPanel Orientation="Horizontal">
+ <ItemsControl HorizontalAlignment="Right" ItemsSource="{Binding Segments}">
+ <ItemsControl.ItemsPanel>
+ <ItemsPanelTemplate>
+ <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" MaxWidth="110">
+
+ </StackPanel>
+ </ItemsPanelTemplate>
+ </ItemsControl.ItemsPanel>
+ <ItemsControl.ItemTemplate>
+ <DataTemplate>
+ <Border Width="25" Height="25" Margin="10 0 0 0" BorderThickness="1" BorderBrush="DimGray" CornerRadius="3">
+ <Border.Background>
+ <MultiBinding Converter="{StaticResource SegmentToBrushConverterMulti}">
+ <Binding Path="."></Binding>
+ </MultiBinding>
+ </Border.Background>
+ </Border>
+ </DataTemplate>
+ </ItemsControl.ItemTemplate>
+ </ItemsControl>
+ <StackPanel Orientation="Horizontal" Margin="0 0 0 0" VerticalAlignment="Center">
+ <StackPanel.Style>
+ <Style TargetType="StackPanel">
+ <Setter Property="Visibility" Value="Collapsed"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding Segments.Count,Converter={StaticResource GreaterThanToBooleanConverter},ConverterParameter=3}" Value="True">
+ <Setter Property="Visibility" Value="Visible"></Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </StackPanel.Style>
+ <materialDesign:PackIcon Kind="Plus" Width="18" Height="18" VerticalAlignment="Center" />
+ <TextBlock Margin="0 -3 0 0" Text="{Binding Segments.Count,Converter={StaticResource MathOperatorConverter},ConverterParameter='-3'}" FontSize="16" VerticalAlignment="Center" FontWeight="SemiBold" FontStyle="Italic"></TextBlock>
+ </StackPanel>
+ </StackPanel>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/StubsModule.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/StubsModule.cs
index 817c68b49..4dd0bdff1 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/StubsModule.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Stubs/StubsModule.cs
@@ -41,7 +41,7 @@ namespace Tango.MachineStudio.Stubs
/// <summary>
/// Gets the permission required to see and load this module.
/// </summary>
- public override Permissions Permission => Permissions.RunSynchronizationModule;
+ public override Permissions Permission => Permissions.RunStubsModule;
/// <summary>
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs
index 6ccc1caa0..ad763fe54 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/ViewModels/MachineTechViewVM.cs
@@ -18,6 +18,7 @@ using Tango.Editors;
using Tango.Integration.Observables;
using Tango.Integration.Observables.Enumerations;
using Tango.Integration.Operators;
+using Tango.MachineStudio.Common.Diagnostics;
using Tango.MachineStudio.Common.Notifications;
using Tango.MachineStudio.Common.StudioApplication;
using Tango.MachineStudio.Technician.Editors;
@@ -168,19 +169,7 @@ namespace Tango.MachineStudio.Technician.ViewModels
/// </summary>
/// <param name="applicationManager">The application manager.</param>
/// <param name="notificationProvider">The notification provider.</param>
- [PreferredConstructor]
- public MachineTechViewVM(IStudioApplicationManager applicationManager, INotificationProvider notificationProvider) : this(applicationManager, notificationProvider, true)
- {
-
- }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="MachineTechViewVM"/> class.
- /// </summary>
- /// <param name="applicationManager">The application manager.</param>
- /// <param name="notificationProvider">The notification provider.</param>
- /// <param name="loadLastProject">if set to <c>true</c> [load last project].</param>
- public MachineTechViewVM(IStudioApplicationManager applicationManager, INotificationProvider notificationProvider, bool loadLastProject)
+ public MachineTechViewVM(IStudioApplicationManager applicationManager, INotificationProvider notificationProvider, IDiagnosticsFrameProvider _diagnosticsFrameProvider)
{
_notification = notificationProvider;
_singleControllers = new Dictionary<SingleGraphItem, GraphController>();
@@ -200,10 +189,12 @@ namespace Tango.MachineStudio.Technician.ViewModels
_lastTechProjectFile = SettingsManager.Default.MachineStudio.TechnicianModule.LasTechProjectFile;
- if (File.Exists(_lastTechProjectFile) && loadLastProject)
+ if (File.Exists(_lastTechProjectFile))
{
OpenProjectFile(_lastTechProjectFile);
}
+
+ _diagnosticsFrameProvider.FrameReceived += DiagnosticsFrameProvider_FrameReceived;
}
#endregion
@@ -218,20 +209,14 @@ namespace Tango.MachineStudio.Technician.ViewModels
private void ApplicationManager_ConnectedMachineChanged(object sender, Integration.Services.IExternalBridgeClient machine)
{
MachineOperator = machine;
-
- if (MachineOperator != null)
- {
- MachineOperator.DiagnosticsDataAvailable -= MachineOperator_DiagnosticsDataAvailable;
- MachineOperator.DiagnosticsDataAvailable += MachineOperator_DiagnosticsDataAvailable;
- }
}
/// <summary>
- /// Machines the operator diagnostics data available.
+ /// Handles the diagnostics frame provider data.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="response">The response.</param>
- private void MachineOperator_DiagnosticsDataAvailable(object sender, PushDiagnosticsResponse response)
+ private void DiagnosticsFrameProvider_FrameReceived(object sender, PushDiagnosticsResponse response)
{
PopulateDiagnosticsData(response);
}