aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules
diff options
context:
space:
mode:
authorAvi Levkovich <avi@twine-s.com>2018-07-12 16:30:36 +0300
committerAvi Levkovich <avi@twine-s.com>2018-07-12 16:30:36 +0300
commit04bc3b7e0070ed810ce2255f944f1caa87b03d52 (patch)
tree1c6141cf42d9ce94cd837bda7bff05014049a09a /Software/Visual_Studio/MachineStudio/Modules
parent0de74a76e7002a1b960c3fa68f8b4cd530865e15 (diff)
parentbd695634133b6e5683b7aae50f8a1df96be54b1a (diff)
downloadTango-04bc3b7e0070ed810ce2255f944f1caa87b03d52.tar.gz
Tango-04bc3b7e0070ed810ce2255f944f1caa87b03d52.zip
merge conflicts
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/JobProgressToPositionConverter.cs7
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml1
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml4
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Converters/LogItemToMessageConverter.cs39
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Tango.MachineStudio.Logging.csproj1
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/ApplicationLogsViewVM.cs4
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/EmbeddedLogsViewVM.cs4
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogDetailsView.xaml4
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogsView.xaml7
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EmbeddedLogsView.xaml7
10 files changed, 70 insertions, 8 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
index f6d2c4f42..4212c6908 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/JobProgressToPositionConverter.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/JobProgressToPositionConverter.cs
@@ -15,14 +15,13 @@ namespace Tango.MachineStudio.Developer.Converters
{
try
{
- Job job = values[0] as Job;
-
- if (job != null)
+ if (values.Length == 3)
{
+ double length = System.Convert.ToDouble(values[0]);
double progress = System.Convert.ToDouble(values[1]);
double parentElementWidth = System.Convert.ToDouble(values[2]);
- return (progress / job.Length) * parentElementWidth;
+ return (progress / length) * parentElementWidth;
}
else
{
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 585a0cb6b..fde7ff275 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
@@ -59,7 +59,6 @@
<localConverters:SegmentToBrushConverter x:Key="SegmentToBrushConverter" />
<localConverters:SegmentToBrushConverterMulti x:Key="SegmentToBrushConverterMulti" />
<localConverters:ObjectsNotEqualToBooleanConveter x:Key="ObjectsNotEqualToBooleanConveter" />
- <localConverters:JobProgressToPositionConverter x:Key="JobProgressToPositionConverter" />
<localConverters:BrushStopToOffsetValueConverter x:Key="BrushStopToOffsetValueConverter" />
<converters:StringEllipsisConverter x:Key="StringEllipsisConverter" />
<converters:NumberToFileSizeConverter x:Key="NumberToFileSizeConverter"/>
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 14c4cd78a..3e76ccbd0 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
@@ -213,8 +213,8 @@
<Grid Canvas.Top="0">
<Canvas.Left>
<MultiBinding Converter="{StaticResource JobProgressToPositionConverter}">
- <Binding Path="RunningJob" />
- <Binding Path="RunningJobStatus.Progress" />
+ <Binding Path="RunningJobStatus.CurrentUnitTotalProgress" />
+ <Binding Path="RunningJobStatus.CurrentUnitProgress" />
<Binding ElementName="jobProgressCanvas" Path="ActualWidth" />
</MultiBinding>
</Canvas.Left>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Converters/LogItemToMessageConverter.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Converters/LogItemToMessageConverter.cs
new file mode 100644
index 000000000..7136b22ea
--- /dev/null
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Converters/LogItemToMessageConverter.cs
@@ -0,0 +1,39 @@
+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.Logging;
+using Tango.PMR.Common;
+
+namespace Tango.MachineStudio.Logging.Converters
+{
+ public class LogItemToMessageConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ LogItemBase log = value as LogItemBase;
+
+ if (log != null)
+ {
+ String str = log.Message;
+
+ if (log.LogObject != null)
+ {
+ str += Environment.NewLine + Environment.NewLine + log.LogObject.ToJsonString("Data");
+ }
+
+ return str;
+ }
+
+ 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.Logging/Tango.MachineStudio.Logging.csproj b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Tango.MachineStudio.Logging.csproj
index 706243ee1..2ce0446aa 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Tango.MachineStudio.Logging.csproj
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Tango.MachineStudio.Logging.csproj
@@ -74,6 +74,7 @@
<Compile Include="Controls\TimeRuler.cs" />
<Compile Include="Converters\DateIsInListToBooleanConverter.cs" />
<Compile Include="Converters\EventsToTimeRulerTicksConverter.cs" />
+ <Compile Include="Converters\LogItemToMessageConverter.cs" />
<Compile Include="Converters\MachineEventToXConverter.cs" />
<Compile Include="Converters\SecondsToWidthConverter.cs" />
<Compile Include="Converters\StringToFirstLineConverter.cs" />
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/ApplicationLogsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/ApplicationLogsViewVM.cs
index eb172069e..2bb96c1e5 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/ApplicationLogsViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/ApplicationLogsViewVM.cs
@@ -94,6 +94,8 @@ namespace Tango.MachineStudio.Logging.ViewModels
public RelayCommand ToggleRealTimePaused { get; set; }
+ public RelayCommand ClearRealTimeLogsCommand { get; set; }
+
public ApplicationLogsViewVM(LoggingNavigationManager navigation, INotificationProvider notification)
{
_notification = notification;
@@ -122,6 +124,8 @@ namespace Tango.MachineStudio.Logging.ViewModels
LogManager.NewLog += LogManager_NewLog;
ToggleRealTimePaused = new RelayCommand(() => RealTimePaused = !RealTimePaused);
+
+ ClearRealTimeLogsCommand = new RelayCommand(() => { _realTimeLogs.Clear(); });
}
private void LogManager_NewLog(object sender, LogItemBase log)
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/EmbeddedLogsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/EmbeddedLogsViewVM.cs
index 8cf4edcb3..ba18cbdb1 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/EmbeddedLogsViewVM.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/ViewModels/EmbeddedLogsViewVM.cs
@@ -96,6 +96,8 @@ namespace Tango.MachineStudio.Logging.ViewModels
public RelayCommand ToggleRealTimePaused { get; set; }
+ public RelayCommand ClearRealTimeLogsCommand { get; set; }
+
public EmbeddedLogsViewVM(LoggingNavigationManager navigation, IStudioApplicationManager application, INotificationProvider notification)
{
_notification = notification;
@@ -124,6 +126,8 @@ namespace Tango.MachineStudio.Logging.ViewModels
MachineOperator.EmbeddedLogManager.NewLog += EmbeddedLogManager_NewLog;
ToggleRealTimePaused = new RelayCommand(() => RealTimePaused = !RealTimePaused);
+
+ ClearRealTimeLogsCommand = new RelayCommand(() => { _realTimeLogs.Clear(); });
}
private void EmbeddedLogManager_NewLog(object sender, LogItemBase log)
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogDetailsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogDetailsView.xaml
index 8c934545a..c7ebcaf02 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogDetailsView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogDetailsView.xaml
@@ -6,6 +6,7 @@
xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
+ xmlns:localConverters="clr-namespace:Tango.MachineStudio.Logging.Converters"
xmlns:vm="clr-namespace:Tango.MachineStudio.Logging.ViewModels"
xmlns:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL"
xmlns:local="clr-namespace:Tango.MachineStudio.Logging.Views"
@@ -14,6 +15,7 @@
<UserControl.Resources>
<converters:DateTimeUTCToStringConverter x:Key="DateTimeUTCToStringConverter" />
+ <localConverters:LogItemToMessageConverter x:Key="LogItemToMessageConverter" />
</UserControl.Resources>
<Grid>
@@ -71,7 +73,7 @@
</Grid>
<Border Padding="5" BorderThickness="1" BorderBrush="Gainsboro">
- <TextBox BorderThickness="0" Text="{Binding Log.Message}" Style="{x:Null}" TextWrapping="Wrap" IsReadOnly="True" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" Background="Transparent" />
+ <TextBox BorderThickness="0" Text="{Binding Log,Converter={StaticResource LogItemToMessageConverter}}" Style="{x:Null}" TextWrapping="Wrap" IsReadOnly="True" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" Background="Transparent" />
</Border>
</DockPanel>
</Grid>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogsView.xaml
index 9115b6a7c..3ca10f370 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogsView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/ApplicationLogsView.xaml
@@ -92,6 +92,13 @@
</materialDesign:PackIcon.Style>
</materialDesign:PackIcon>
</Button>
+
+ <Button Margin="20 0 0 0" Background="#FF7777" BorderBrush="#FF7777" ToolTip="Clear real-time logs" Command="{Binding ClearRealTimeLogsCommand}">
+ <StackPanel Orientation="Horizontal">
+ <materialDesign:PackIcon Width="24" Height="24" Kind="DeleteSweep" />
+ <TextBlock VerticalAlignment="Center" Margin="10 0 0 0">CLEAR</TextBlock>
+ </StackPanel>
+ </Button>
</StackPanel>
</Grid>
</Border>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EmbeddedLogsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EmbeddedLogsView.xaml
index 3b54c1d35..d70149bbb 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EmbeddedLogsView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Views/EmbeddedLogsView.xaml
@@ -92,6 +92,13 @@
</materialDesign:PackIcon.Style>
</materialDesign:PackIcon>
</Button>
+
+ <Button Margin="20 0 0 0" Background="#FF7777" BorderBrush="#FF7777" ToolTip="Clear real-time logs" Command="{Binding ClearRealTimeLogsCommand}">
+ <StackPanel Orientation="Horizontal">
+ <materialDesign:PackIcon Width="24" Height="24" Kind="DeleteSweep" />
+ <TextBlock VerticalAlignment="Center" Margin="10 0 0 0">CLEAR</TextBlock>
+ </StackPanel>
+ </Button>
</StackPanel>
</Grid>
</Border>