aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2024-11-18 12:08:38 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2024-11-18 12:08:38 +0200
commit2212c3579b4112251dea031223658f17bad59b84 (patch)
treef60dc0f3a9e0292205729cf4c934c59436b65572 /Software/Visual_Studio
parentb4fbcbf7da681226f82befa6ffc7f292cf39b270 (diff)
downloadTango-2212c3579b4112251dea031223658f17bad59b84.tar.gz
Tango-2212c3579b4112251dea031223658f17bad59b84.zip
Some work on statistics
Diffstat (limited to 'Software/Visual_Studio')
-rw-r--r--Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Controls/RangeProgressBar.cs7
-rw-r--r--Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Models/CsvModel.cs2
-rw-r--r--Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Models/StopModel.cs10
-rw-r--r--Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/ViewModels/MainViewVM.cs8
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest2
-rw-r--r--Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs15
-rw-r--r--Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs7
-rw-r--r--Software/Visual_Studio/Tango.WebRTC/WebRtcTransportAdapter.cs25
8 files changed, 55 insertions, 21 deletions
diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Controls/RangeProgressBar.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Controls/RangeProgressBar.cs
index cfa0eaa4e..eb5f4f199 100644
--- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Controls/RangeProgressBar.cs
+++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Controls/RangeProgressBar.cs
@@ -75,7 +75,12 @@ namespace Tango.FSE.Statistics.Controls
private void PlaceInnerBorder()
{
- _innerBorder.Margin = new Thickness(LowerValue / Maximum * _outerBorder.ActualWidth, 0, _outerBorder.ActualWidth - (UpperValue / Maximum * _outerBorder.ActualWidth), 0);
+ double leftMargin = LowerValue / Maximum * _outerBorder.ActualWidth;
+ double rightMargin = _outerBorder.ActualWidth - (UpperValue / Maximum * _outerBorder.ActualWidth);
+ leftMargin = Double.IsNaN(leftMargin) ? 0 : leftMargin;
+ rightMargin = Double.IsNaN(rightMargin) ? 0 : rightMargin;
+
+ _innerBorder.Margin = new Thickness(leftMargin, 0, rightMargin, 0);
}
}
}
diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Models/CsvModel.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Models/CsvModel.cs
index 9e1485f07..6cce0c9cf 100644
--- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Models/CsvModel.cs
+++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Models/CsvModel.cs
@@ -16,6 +16,8 @@ namespace Tango.FSE.Statistics.Models
public String NumberOfUnits { get; set; }
public String StartTime { get; set; }
public String Duration { get; set; }
+ public String Distance { get; set; }
+ public String StartPosition { get; set; }
public String EndPosition { get; set; }
public String Status { get; set; }
public String SegmentIndex { get; set; }
diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Models/StopModel.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Models/StopModel.cs
index d979fe55b..8a4873aa2 100644
--- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Models/StopModel.cs
+++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/Models/StopModel.cs
@@ -168,6 +168,14 @@ namespace Tango.FSE.Statistics.Models
return JobRun.NumberOfUnits > 1 ? $"{length} x{JobRun.NumberOfUnits}" : length.ToString(); }
}
+ public double LogicalLengthMeters
+ {
+ get
+ {
+ return (IsEureka ? JobRun.JobLogicalLength * 4 : JobRun.JobLogicalLength);
+ }
+ }
+
public double JobLength
{
get { return IsEureka ? JobRun.JobLength * 4 : JobRun.JobLength; }
@@ -200,7 +208,7 @@ namespace Tango.FSE.Statistics.Models
public double ActualLength
{
- get { return IsEureka ? JobRun.JobLogicalLength * 4 : JobRun.JobLogicalLength; }
+ get { return LogicalLengthMeters * JobRun.NumberOfUnits; }
}
public String FineTuningMeasured
diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/ViewModels/MainViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/ViewModels/MainViewVM.cs
index a21619aac..264ed400d 100644
--- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Statistics/ViewModels/MainViewVM.cs
@@ -691,6 +691,8 @@ namespace Tango.FSE.Statistics.ViewModels
"Number Of Units",
"Start Time",
"Duration",
+ "Distance",
+ "Start Position",
"End Position",
"Status",
"Segment Index",
@@ -736,11 +738,13 @@ namespace Tango.FSE.Statistics.ViewModels
model.JobName = stop.JobRun.JobName;
model.JobKind = ((JobDesignations)stop.JobRun.JobDesignation).ToDescription();
model.Thread = stop.ThreadName;
- model.Length = stop.LogicalLength;
+ model.Length = stop.LogicalLengthMeters.ToString();
model.NumberOfUnits = stop.JobRun.NumberOfUnits.ToString();
model.StartTime = stop.JobRun.StartDate.ToLocalTime().ToString();
model.Duration = stop.Duration.ToStringUnlimitedHours();
- model.EndPosition = stop.EndPosition.ToString();
+ model.Distance = stop.Distance.ToString();
+ model.StartPosition = stop.ActualStartPosition.ToString();
+ model.EndPosition = stop.ActualEndPosition.ToString();
model.Status = ((JobRunStatus)stop.JobRun.Status).ToString();
model.SegmentIndex = stop.SegmentIndex.ToString();
model.Offset = stop.StartMeters.ToString();
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest
index d72e75011..efc5f8179 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest
@@ -16,7 +16,7 @@
Remove this element if your application requires this virtualization for backwards
compatibility.
-->
- <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
+ <!--<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />-->
</requestedPrivileges>
</security>
</trustInfo>
diff --git a/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs b/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs
index 630bda866..47f4ca94a 100644
--- a/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs
+++ b/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs
@@ -344,14 +344,21 @@ namespace Tango.Integration.Operation
if (_last_progress != s.Progress)
{
- if (s.Progress <= PROGRESS_REPORT_RANGE_METERS || s.Progress >= Status.TotalProgress - PROGRESS_REPORT_RANGE_METERS)
+ if (LogManager.Categories.Exists(x => x == LogCategory.Debug))
{
LogManager.Log($"Updating job progress {s.Progress}/{Status.TotalProgress}...");
}
- else if (!loggedContinueMessage)
+ else
{
- loggedContinueMessage = true;
- LogManager.Log($"Progress logging will continue {PROGRESS_REPORT_RANGE_METERS} meters before completion...");
+ if (s.Progress <= PROGRESS_REPORT_RANGE_METERS || s.Progress >= Status.TotalProgress - PROGRESS_REPORT_RANGE_METERS)
+ {
+ LogManager.Log($"Updating job progress {s.Progress}/{Status.TotalProgress}...");
+ }
+ else if (!loggedContinueMessage)
+ {
+ loggedContinueMessage = true;
+ LogManager.Log($"Progress logging will continue {PROGRESS_REPORT_RANGE_METERS} meters before completion...");
+ }
}
}
diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
index 1b229831f..2dbb4cdde 100644
--- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
+++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
@@ -3276,11 +3276,17 @@ namespace Tango.Integration.Operation
if (config.ResumeConfig != null)
{
+ LogManager.Log("Job Resume Detected...");
+
resumePreProgress = config.ResumeConfig.GlobalStartPosition - config.ResumeConfig.FirstUnitStartPosition;//- processParameters.DryerBufferLengthMeters;
+
request.FirstUnitStartPosition = config.ResumeConfig.FirstUnitStartPosition;
+
//LogManager.Log($" resumePreProgress = {resumePreProgress}, GlobalStartPosition {config.ResumeConfig.GlobalStartPosition} FirstUnitStartPosition {request.FirstUnitStartPosition}");
request.JobTicket.Length = (request.JobTicket.Length / Math.Max(request.JobTicket.NumberOfUnits, 1)) * (int)Math.Max(config.ResumeConfig.RemainingUnits, 1);
request.JobTicket.NumberOfUnits = (uint)Math.Max(config.ResumeConfig.RemainingUnits, 1);
+
+ LogManager.Log($"Resume Config:\n{config.ResumeConfig.ToJsonString()}\n\nAppended Progress: {resumePreProgress}\n\nSent To Firmware:\nJob Length: {request.JobTicket.Length}\nNumber Of Units: {request.JobTicket.NumberOfUnits}\nFirst Unit Start Position: {request.FirstUnitStartPosition}");
}
SendContinuousRequest<JobRequest, JobResponse>(request, new TransportContinuousRequestConfig() { Timeout = TimeSpan.FromSeconds(10), ContinuousTimeout = TimeSpan.FromSeconds(10), ShouldLog = true }).Subscribe((response) =>
@@ -3289,6 +3295,7 @@ namespace Tango.Integration.Operation
{
if (resumePreProgress > 0 && response.Message.Status.Progress > 0)
{
+ LogManager.Log($"Appending Resume Progress {resumePreProgress} + {response.Message.Status.Progress}", LogCategory.Debug);
response.Message.Status.Progress += resumePreProgress;
}
diff --git a/Software/Visual_Studio/Tango.WebRTC/WebRtcTransportAdapter.cs b/Software/Visual_Studio/Tango.WebRTC/WebRtcTransportAdapter.cs
index 59784fa56..38e50d530 100644
--- a/Software/Visual_Studio/Tango.WebRTC/WebRtcTransportAdapter.cs
+++ b/Software/Visual_Studio/Tango.WebRTC/WebRtcTransportAdapter.cs
@@ -6,6 +6,7 @@ using System.Threading;
using System.Threading.Tasks;
using Tango.Core;
using Tango.Core.Threading;
+using Tango.Logging;
using Tango.Transport;
using Tango.Transport.Adapters;
using Tango.Transport.Compression;
@@ -114,22 +115,22 @@ namespace Tango.WebRTC
if (Mode == WebRtcTransportAdapterMode.Active)
{
- LogManager.Log($"{ComponentName}: Creating WebRTC offer...");
+ LogManager.Log($"{ComponentName}: Creating WebRTC offer...", LogCategory.Debug);
var offer = await _client.CreateOffer();
- LogManager.Log($"{ComponentName}: Sending WebRTC offer via signaling transporter...");
+ LogManager.Log($"{ComponentName}: Sending WebRTC offer via signaling transporter...", LogCategory.Debug);
var response = await SignalingTransporter.SendGenericRequest<OfferRequest, OfferResponse>(new OfferRequest() { Offer = offer }, new TransportRequestConfig()
{
Timeout = TimeSpan.FromSeconds(30),
});
- LogManager.Log($"{ComponentName}: WebRTC offer sent and responded with an answer. Setting WebRTC answer...");
+ LogManager.Log($"{ComponentName}: WebRTC offer sent and responded with an answer. Setting WebRTC answer...", LogCategory.Debug);
_client.SetAnswer(response.Answer);
_answerReceived = true;
foreach (var ice in _queuedIceCandidates.ToList())
{
- LogManager.Log($"{ComponentName}: Sending existing ice candidate '{ice.Sdp}'...");
+ LogManager.Log($"{ComponentName}: Sending existing ice candidate '{ice.Sdp}'...", LogCategory.Debug);
try
{
@@ -146,7 +147,7 @@ namespace Tango.WebRTC
}
else
{
- LogManager.Log($"{ComponentName}: Waiting for offer...");
+ LogManager.Log($"{ComponentName}: Waiting for offer...", LogCategory.Debug);
State = TransportComponentState.Connected;
if (!completed)
@@ -230,7 +231,7 @@ namespace Tango.WebRTC
foreach (var ice in _queuedIceCandidates.ToList())
{
- LogManager.Log($"{ComponentName}: Sending existing ice candidate '{ice.Sdp}'...");
+ LogManager.Log($"{ComponentName}: Sending existing ice candidate '{ice.Sdp}'...", LogCategory.Debug);
try
{
@@ -258,7 +259,7 @@ namespace Tango.WebRTC
{
if (_answerReceived)
{
- LogManager.Log($"{ComponentName}: New WebRTC candidate available. Sending ice to remote peer...");
+ LogManager.Log($"{ComponentName}: New WebRTC candidate available. Sending ice to remote peer...", LogCategory.Debug);
await SignalingTransporter.SendGenericRequest<IceCandidateRequest, IceCandidateResponse>(new IceCandidateRequest() { IceCandidate = e.IceCandidate }, new TransportRequestConfig()
{
@@ -269,11 +270,11 @@ namespace Tango.WebRTC
{
if (Mode == WebRtcTransportAdapterMode.Active)
{
- LogManager.Log($"{ComponentName}: New WebRTC candidate available. Will be sent after an answer is received...");
+ LogManager.Log($"{ComponentName}: New WebRTC candidate available. Will be sent after an answer is received...", LogCategory.Debug);
}
else
{
- LogManager.Log($"{ComponentName}: New WebRTC candidate available. Will be sent after an offer is received...");
+ LogManager.Log($"{ComponentName}: New WebRTC candidate available. Will be sent after an offer is received...", LogCategory.Debug);
}
_queuedIceCandidates.Add(e.IceCandidate);
@@ -289,12 +290,12 @@ namespace Tango.WebRTC
{
try
{
- LogManager.Log($"{ComponentName}: Ice candidate request received from the remote peer.");
+ LogManager.Log($"{ComponentName}: Ice candidate request received from the remote peer.", LogCategory.Debug);
await SignalingTransporter.SendGenericResponse(new IceCandidateResponse() { }, token);
- LogManager.Log($"{ComponentName}: Adding ice candidate '{request.IceCandidate.Sdp}'...");
+ LogManager.Log($"{ComponentName}: Adding ice candidate '{request.IceCandidate.Sdp}'...", LogCategory.Debug);
_client.AddIceCandidate(request.IceCandidate);
- LogManager.Log($"{ComponentName}: Ice candidate added.");
+ LogManager.Log($"{ComponentName}: Ice candidate added.", LogCategory.Debug);
}
catch (Exception ex)
{