From c03fb4a1b2aadd8952b321d08ca840e55fcee72d Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Sun, 14 Jul 2024 23:06:47 +0300 Subject: Revision of statistics and resumed jobs. --- .../Visual_Studio/Tango.BL/DTO/JobRunDTOBase.cs | 16 +++++ Software/Visual_Studio/Tango.BL/Entities/Job.cs | 4 ++ Software/Visual_Studio/Tango.BL/Entities/JobRun.cs | 13 ++++ .../Visual_Studio/Tango.BL/Entities/JobRunBase.cs | 76 ++++++++++++++++++++++ 4 files changed, 109 insertions(+) (limited to 'Software/Visual_Studio/Tango.BL') diff --git a/Software/Visual_Studio/Tango.BL/DTO/JobRunDTOBase.cs b/Software/Visual_Studio/Tango.BL/DTO/JobRunDTOBase.cs index fe0816ff5..139223d8d 100644 --- a/Software/Visual_Studio/Tango.BL/DTO/JobRunDTOBase.cs +++ b/Software/Visual_Studio/Tango.BL/DTO/JobRunDTOBase.cs @@ -341,5 +341,21 @@ namespace Tango.BL.DTO get; set; } + /// + /// actual start position + /// + public Double ActualStartPosition + { + get; set; + } + + /// + /// actual end position + /// + public Double ActualEndPosition + { + get; set; + } + } } diff --git a/Software/Visual_Studio/Tango.BL/Entities/Job.cs b/Software/Visual_Studio/Tango.BL/Entities/Job.cs index 3139a5a5b..4e115f5e8 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/Job.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/Job.cs @@ -415,6 +415,10 @@ namespace Tango.BL.Entities [JsonIgnore] public VectorFineTuningRunModel VectorFineTuningRunModel { get; set; } + [NotMapped] + [JsonIgnore] + public double ResumeStartPosition { get; set; } + #endregion #region Event Handlers diff --git a/Software/Visual_Studio/Tango.BL/Entities/JobRun.cs b/Software/Visual_Studio/Tango.BL/Entities/JobRun.cs index 2ab10f14d..4aae63562 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/JobRun.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/JobRun.cs @@ -144,6 +144,8 @@ namespace Tango.BL.Entities } + [NotMapped] + [JsonIgnore] public TimeSpan TotalDyeingTime { get @@ -157,6 +159,17 @@ namespace Tango.BL.Entities } + [NotMapped] + [JsonIgnore] + public double Distance + { + get + { + return (ActualEndPosition > 0 ? ActualEndPosition : EndPosition) - ActualStartPosition; + } + } + + /// /// Initializes a new instance of the class. /// diff --git a/Software/Visual_Studio/Tango.BL/Entities/JobRunBase.cs b/Software/Visual_Studio/Tango.BL/Entities/JobRunBase.cs index efb6c70d6..6da5b8f8b 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/JobRunBase.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/JobRunBase.cs @@ -97,6 +97,10 @@ namespace Tango.BL.Entities public event EventHandler MachineTypeChanged; + public event EventHandler ActualStartPositionChanged; + + public event EventHandler ActualEndPositionChanged; + protected String _machineguid; /// @@ -1169,6 +1173,60 @@ namespace Tango.BL.Entities } } + protected Double _actualstartposition; + + /// + /// Gets or sets the jobrunbase actual start position. + /// + + [Column("ACTUAL_START_POSITION")] + + public Double ActualStartPosition + { + get + { + return _actualstartposition; + } + + set + { + if (_actualstartposition != value) + { + _actualstartposition = value; + + OnActualStartPositionChanged(value); + + } + } + } + + protected Double _actualendposition; + + /// + /// Gets or sets the jobrunbase actual end position. + /// + + [Column("ACTUAL_END_POSITION")] + + public Double ActualEndPosition + { + get + { + return _actualendposition; + } + + set + { + if (_actualendposition != value) + { + _actualendposition = value; + + OnActualEndPositionChanged(value); + + } + } + } + /// /// Called when the JobName has changed. /// @@ -1484,6 +1542,24 @@ namespace Tango.BL.Entities RaisePropertyChanged(nameof(MachineType)); } + /// + /// Called when the ActualStartPosition has changed. + /// + protected virtual void OnActualStartPositionChanged(Double actualstartposition) + { + ActualStartPositionChanged?.Invoke(this, actualstartposition); + RaisePropertyChanged(nameof(ActualStartPosition)); + } + + /// + /// Called when the ActualEndPosition has changed. + /// + protected virtual void OnActualEndPositionChanged(Double actualendposition) + { + ActualEndPositionChanged?.Invoke(this, actualendposition); + RaisePropertyChanged(nameof(ActualEndPosition)); + } + /// /// Initializes a new instance of the class. /// -- cgit v1.3.1