From b8566b704e0804239bcb58dfb90b32e5334ce446 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 15 Jul 2018 17:58:46 +0300 Subject: Implemented JobRunner on Tech Board !. --- Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 1572864 -> 1572864 bytes Software/Graphics/rgb-big.png | Bin 0 -> 2649 bytes .../Converters/JobProgressToPositionConverter.cs | 3 +- .../Editors/JobRunnerElementEditor.xaml | 280 +++++++++++++++++++++ .../Editors/JobRunnerElementEditor.xaml.cs | 103 ++++++++ .../Editors/ProcessParametersElementEditor.xaml | 2 +- .../Images/rgb-big.png | Bin 0 -> 2649 bytes .../PropertiesTemplates/JobRunnerTemplate.xaml | 78 ++++++ .../PropertiesTemplates/JobRunnerTemplate.xaml.cs | 28 +++ .../Tango.MachineStudio.Technician.csproj | 18 ++ .../TechItems/JobRunnerItem.cs | 188 ++++++++++++++ .../TechItems/ProcessParametersItem.cs | 25 +- .../TechItems/TechItem.cs | 1 + .../ViewModels/MachineTechViewVM.cs | 53 ++++ .../Views/MachineTechView.xaml | 3 + .../Tango.MachineStudio.UI/Resources/BuildDate.txt | 2 +- .../Tango.BL/EntitiesExtensions/Job.cs | 1 + .../Tango.Integration/Operation/JobHandler.cs | 1 + .../Tango.Integration/Operation/MachineOperator.cs | 5 + 20 files changed, 777 insertions(+), 14 deletions(-) create mode 100644 Software/Graphics/rgb-big.png create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/JobRunnerElementEditor.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/JobRunnerElementEditor.xaml.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Images/rgb-big.png create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/JobRunnerTemplate.xaml create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/PropertiesTemplates/JobRunnerTemplate.xaml.cs create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/TechItems/JobRunnerItem.cs (limited to 'Software') diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index cc6bc537c..25bb64505 100644 Binary files a/Software/DB/Tango.mdf and b/Software/DB/Tango.mdf differ diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf index 86c960e43..ff30c99cf 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ diff --git a/Software/Graphics/rgb-big.png b/Software/Graphics/rgb-big.png new file mode 100644 index 000000000..cee14ae53 Binary files /dev/null and b/Software/Graphics/rgb-big.png differ 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 4212c6908..93ede05c3 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 @@ -4,6 +4,7 @@ using System.Globalization; using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Windows; using System.Windows.Data; using Tango.BL.Entities; @@ -15,7 +16,7 @@ namespace Tango.MachineStudio.Developer.Converters { try { - if (values.Length == 3) + if (values.Length == 3 && values[1] != DependencyProperty.UnsetValue) { double length = System.Convert.ToDouble(values[0]); double progress = System.Convert.ToDouble(values[1]); diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/JobRunnerElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/JobRunnerElementEditor.xaml new file mode 100644 index 000000000..c481f1e1b --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/JobRunnerElementEditor.xaml @@ -0,0 +1,280 @@ + + + + + + + + + + + Transparent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + / + m + + | + + / + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/JobRunnerElementEditor.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/JobRunnerElementEditor.xaml.cs new file mode 100644 index 000000000..1daf2f6ca --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/JobRunnerElementEditor.xaml.cs @@ -0,0 +1,103 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Controls.Primitives; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Markup; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using Tango.Editors; +using Tango.BL.Entities; +using Tango.MachineStudio.Technician.TechItems; +using Tango.Core; + +namespace Tango.MachineStudio.Technician.Editors +{ + [ContentProperty("InnerContent")] + public partial class JobRunnerElementEditor : ElementEditor + { + /// + /// Initializes a new instance of the class. + /// + public JobRunnerElementEditor() + : base() + { + InitializeComponent(); + } + + /// + /// Initializes a new instance of the class. + /// + /// The framework element. + public JobRunnerElementEditor(JobRunnerItem jobRunnerItem) + : this() + { + JobRunnerItem = jobRunnerItem; + DataContext = JobRunnerItem; + } + + /// + /// Initializes a new instance of the class. + /// + /// The framework element. + /// The bounds. + public JobRunnerElementEditor(JobRunnerItem jobRunnerItem, Rect bounds) + : this(jobRunnerItem) + { + Left = bounds.Left; + Top = bounds.Top; + Width = bounds.Width; + Height = bounds.Height; + } + + private JobRunnerItem _jobRunnerItem; + + public JobRunnerItem JobRunnerItem + { + get { return _jobRunnerItem; } + set { _jobRunnerItem = value; RaisePropertyChanged(nameof(JobRunnerItem)); } + } + + + /// + /// Clones this instance. + /// + /// + public override IElementEditor Clone() + { + try + { + var clonedItem = JobRunnerItem.Clone() as JobRunnerItem; + JobRunnerElementEditor cloned = new JobRunnerElementEditor(clonedItem); + cloned.Top = Top; + cloned.Left = Left; + cloned.Width = Width; + cloned.Height = Height; + cloned.Angle = Angle; + return cloned; + } + catch (Exception ex) + { + throw new InvalidOperationException("Could not clone this editor. You may have to create a custom editor and implement a custom Clone method.", ex); + } + } + + /// + /// Gets the hosted element. + /// + [ParameterIgnore] + public override Object HostedElement + { + get { return JobRunnerItem; } + } + } +} diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ProcessParametersElementEditor.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ProcessParametersElementEditor.xaml index c1a76fe8a..716ac0a2d 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ProcessParametersElementEditor.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Technician/Editors/ProcessParametersElementEditor.xaml @@ -38,7 +38,7 @@ - +