From 06ad24ef8a414fc89c0cf42b9f5264d584292afe Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 1 Feb 2018 11:39:19 +0200 Subject: Improved RequestShutDown Mechanism on machine studio UI implementation. Fixed issue with job brush markers visibility. Implemented Job Progress Indicator. --- .../Converters/JobProgressToPositionConverter.cs | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/JobProgressToPositionConverter.cs (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/JobProgressToPositionConverter.cs') 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(); + } + } +} -- cgit v1.3.1