aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/JobProgressToPositionConverter.cs
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-02-01 11:39:19 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-02-01 11:39:19 +0200
commit06ad24ef8a414fc89c0cf42b9f5264d584292afe (patch)
tree7bbe6eadb54d21996aba8d50855137ce20750578 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/JobProgressToPositionConverter.cs
parentf573292928d08acbf04acb8ea74f55f7561390a0 (diff)
downloadTango-06ad24ef8a414fc89c0cf42b9f5264d584292afe.tar.gz
Tango-06ad24ef8a414fc89c0cf42b9f5264d584292afe.zip
Improved RequestShutDown Mechanism on machine studio UI implementation.
Fixed issue with job brush markers visibility. Implemented Job Progress Indicator.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/JobProgressToPositionConverter.cs')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Converters/JobProgressToPositionConverter.cs43
1 files changed, 43 insertions, 0 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();
+ }
+ }
+}