aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2019-09-16 15:10:09 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2019-09-16 15:10:09 +0300
commite161c0471aa5703882e321b8e6661579dc4e0533 (patch)
tree6c0ea156ec9f9949a40ef933e3607782ef8e317f /Software/Visual_Studio
parent1c74b1f3e6fd3f64936df890de14e162303ee1fb (diff)
downloadTango-e161c0471aa5703882e321b8e6661579dc4e0533.tar.gz
Tango-e161c0471aa5703882e321b8e6661579dc4e0533.zip
Implemented bug reporting Machine SN & Embedded Version.
Implemented ProcessParameters.DryerBufferLengthMeters.
Diffstat (limited to 'Software/Visual_Studio')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamFoundationServiceExtendedClient.cs6
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.BugReporting/TFS/TeamFoundationServicePPCClient.cs12
-rw-r--r--Software/Visual_Studio/Tango.BL/Entities/Job.cs2
-rw-r--r--Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTable.cs11
-rw-r--r--Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs8
-rw-r--r--Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs8
-rw-r--r--Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs4
-rw-r--r--Software/Visual_Studio/Tango.TFS/TeamFoundationServiceClient.cs22
-rw-r--r--Software/Visual_Studio/Tango.TFS/WorkItem.cs15
-rw-r--r--Software/Visual_Studio/Tango.UnitTesting/TFS/TFS_TST.cs4
10 files changed, 79 insertions, 13 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamFoundationServiceExtendedClient.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamFoundationServiceExtendedClient.cs
index fba037a6e..31b330c3f 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamFoundationServiceExtendedClient.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/TFS/TeamFoundationServiceExtendedClient.cs
@@ -245,6 +245,12 @@ namespace Tango.MachineStudio.UI.TFS
}
}
+ if (app.Machine != null && app.ConnectedMachine != null && app.ConnectedMachine.DeviceInformation != null)
+ {
+ item.EmbeddedVersion = app.ConnectedMachine.DeviceInformation.Version;
+ item.MachineSerialNumber = app.Machine.SerialNumber;
+ }
+
String html = String.Empty;
using (var stream = EmbeddedResourceHelper.GetEmbeddedResourceStream("Tango.MachineStudio.UI.TFS.SystemInformationTemplate.cshtml"))
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.BugReporting/TFS/TeamFoundationServicePPCClient.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.BugReporting/TFS/TeamFoundationServicePPCClient.cs
index 52867c65f..26d6425bf 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.BugReporting/TFS/TeamFoundationServicePPCClient.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.BugReporting/TFS/TeamFoundationServicePPCClient.cs
@@ -61,7 +61,7 @@ namespace Tango.PPC.BugReporting.TFS
var tempFolder = TemporaryManager.CreateFolder();
- await Task.Factory.StartNew(() =>
+ await Task.Factory.StartNew(() =>
{
item.Title = title;
@@ -150,6 +150,16 @@ namespace Tango.PPC.BugReporting.TFS
LogManager.Log("Machine is disconnected.");
}
+ if (_machineProvider.MachineOperator.DeviceInformation != null)
+ {
+ item.EmbeddedVersion = _machineProvider.MachineOperator.DeviceInformation.Version;
+ }
+
+ if (_machineProvider.Machine != null)
+ {
+ item.MachineSerialNumber = _machineProvider.Machine.SerialNumber;
+ }
+
String html = String.Empty;
LogManager.Log("Generating HTML system information from template...");
diff --git a/Software/Visual_Studio/Tango.BL/Entities/Job.cs b/Software/Visual_Studio/Tango.BL/Entities/Job.cs
index 2b683bc4c..2d536c268 100644
--- a/Software/Visual_Studio/Tango.BL/Entities/Job.cs
+++ b/Software/Visual_Studio/Tango.BL/Entities/Job.cs
@@ -488,7 +488,7 @@ namespace Tango.BL.Entities
{
throw new ArgumentException("Process parameters dying speed cannot be zero.");
}
- return TimeSpan.FromSeconds((LengthIncludingNumberOfUnits + processParameters.DryerBufferLength) / (processParameters.DyeingSpeed / 100d));
+ return TimeSpan.FromSeconds((LengthIncludingNumberOfUnits + processParameters.DryerBufferLengthMeters) / (processParameters.DyeingSpeed / 100d));
}
///// <summary>
diff --git a/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTable.cs b/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTable.cs
index 549aff6e7..2cef9ba4c 100644
--- a/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTable.cs
+++ b/Software/Visual_Studio/Tango.BL/Entities/ProcessParametersTable.cs
@@ -1,5 +1,7 @@
+using Newtonsoft.Json;
using System;
using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -10,6 +12,8 @@ namespace Tango.BL.Entities
{
public event EventHandler DyeingSpeedMinInkUptakeChanged;
+ public const double DRYER_METERS_PER_CYCLE = 0.76;
+
protected override void RaisePropertyChanged(string propName)
{
base.RaisePropertyChanged(propName);
@@ -25,6 +29,13 @@ namespace Tango.BL.Entities
DyeingSpeedMinInkUptakeChanged?.Invoke(this, new EventArgs());
}
+ [NotMapped]
+ [JsonIgnore]
+ public double DryerBufferLengthMeters
+ {
+ get { return DryerBufferLength * DRYER_METERS_PER_CYCLE; }
+ }
+
/// <summary>
/// Initializes a new instance of the <see cref="ProcessParametersTable" /> class.
/// </summary>
diff --git a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs
index 719e79679..06e340d1d 100644
--- a/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs
+++ b/Software/Visual_Studio/Tango.Emulations/Emulators/MachineEmulator.cs
@@ -651,7 +651,7 @@ namespace Tango.Emulations.Emulators
Task.Factory.StartNew(() =>
{
- while (progress < job.Length + job.ProcessParameters.DryerBufferLength && !_cancelJob)
+ while (progress < job.Length + job.ProcessParameters.DryerBufferLength * ProcessParametersTable.DRYER_METERS_PER_CYCLE && !_cancelJob)
{
var status = new PMR.Printing.JobStatus();
status.Progress = progress;
@@ -682,7 +682,7 @@ namespace Tango.Emulations.Emulators
}
}
- progress += Math.Min((centimeter_per_second / 1000d), (job.Length + job.ProcessParameters.DryerBufferLength) - progress);
+ progress += Math.Min((centimeter_per_second / 1000d), (job.Length + job.ProcessParameters.DryerBufferLength * ProcessParametersTable.DRYER_METERS_PER_CYCLE) - progress);
Thread.Sleep(100);
}
@@ -714,7 +714,7 @@ namespace Tango.Emulations.Emulators
{
Status = new PMR.Printing.JobStatus()
{
- Progress = job.Length + job.ProcessParameters.DryerBufferLength,
+ Progress = job.Length + job.ProcessParameters.DryerBufferLength * ProcessParametersTable.DRYER_METERS_PER_CYCLE,
}
}, request.Container.Token, !_cancelJob);
@@ -725,7 +725,7 @@ namespace Tango.Emulations.Emulators
{
Status = new PMR.Printing.JobStatus()
{
- Progress = job.Length + job.ProcessParameters.DryerBufferLength,
+ Progress = job.Length + job.ProcessParameters.DryerBufferLength * ProcessParametersTable.DRYER_METERS_PER_CYCLE,
}
}, _current_job_resume_token, !_cancelJob);
diff --git a/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs b/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs
index 9a7289c41..4b0066d7f 100644
--- a/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs
+++ b/Software/Visual_Studio/Tango.Integration/Operation/JobHandler.cs
@@ -150,14 +150,14 @@ namespace Tango.Integration.Operation
Status.TotalTime = job.GetEstimatedDuration(processParameters);
Status.RemainingUnits = job.NumberOfUnits;
- Status.TotalProgress = Job.LengthIncludingNumberOfUnits + processParameters.DryerBufferLength;
- Status.FinalizingTotalProgress = processParameters.DryerBufferLength;
+ Status.TotalProgress = Job.LengthIncludingNumberOfUnits + processParameters.DryerBufferLengthMeters;
+ Status.FinalizingTotalProgress = processParameters.DryerBufferLengthMeters;
Status.TotalProgressWithoutFinalization = Job.LengthIncludingNumberOfUnits;
Status.Progress = 0;
Status.RemainingTime = Status.TotalTime;
Status.RemainingProgress = Status.TotalProgress;
Status.CurrentUnitSegments = _effectiveSegments.ToList();
- Status.SettingUpTotalProgress = processParameters.DryerBufferLength;
+ Status.SettingUpTotalProgress = processParameters.DryerBufferLengthMeters;
Status.TotalProgressMinusSettingUp = Job.LengthIncludingNumberOfUnits;
Status.IsSettingUp = true;
@@ -496,7 +496,7 @@ namespace Tango.Integration.Operation
_finalizing = true;
Status.IsFinalizing = true;
var last_Segment = _effectiveSegments.Last().Clone();
- last_Segment.Length = ProcessParameters.DryerBufferLength;
+ last_Segment.Length = ProcessParameters.DryerBufferLengthMeters;
Status.CurrentUnitSegments = new List<Segment> { last_Segment };
Status.CurrentUnitTotalProgress = last_Segment.Length;
Status.CurrentUnitProgress = 0;
diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
index ab4237f9c..da8d115a3 100644
--- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
+++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs
@@ -1064,7 +1064,7 @@ namespace Tango.Integration.Operation
if (JobHandlingMode == JobHandlerModes.SettingUp)
{
- if (response.Message.Status.Progress > jobTicket.ProcessParameters.DryerBufferLength)
+ if (response.Message.Status.Progress > processParameters.DryerBufferLengthMeters)
{
if (!completed)
{
@@ -1785,7 +1785,7 @@ namespace Tango.Integration.Operation
if (JobHandlingMode == JobHandlerModes.SettingUp)
{
- if (response.Message.Status.Progress > request.JobTicket.ProcessParameters.DryerBufferLength)
+ if (response.Message.Status.Progress > processParameters.DryerBufferLengthMeters)
{
if (!completed)
{
diff --git a/Software/Visual_Studio/Tango.TFS/TeamFoundationServiceClient.cs b/Software/Visual_Studio/Tango.TFS/TeamFoundationServiceClient.cs
index 5c4746567..11bdf2f2f 100644
--- a/Software/Visual_Studio/Tango.TFS/TeamFoundationServiceClient.cs
+++ b/Software/Visual_Studio/Tango.TFS/TeamFoundationServiceClient.cs
@@ -34,6 +34,8 @@ namespace Tango.TFS
public const String RESOLVED_BY = "Microsoft.VSTS.Common.ResolvedBy";
public const String RESOLVED_DATE = "Microsoft.VSTS.Common.ResolvedDate";
public const String RESOLVED_REASON = "Microsoft.VSTS.Common.ResolvedReason";
+ public const String EMBEDDED_VERSION = "Custom.EmbeddedVersion";
+ public const String MACHINE_SN = "Custom.MachineSN";
}
#endregion
@@ -382,6 +384,26 @@ namespace Tango.TFS
Value = workItem.SystemInformation,
});
+ if (workItem.EmbeddedVersion != null)
+ {
+ patchDocument.Add(new JsonPatchOperation
+ {
+ Operation = Operation.Add,
+ Path = GetExtensionFieldNameForWrite(ExtensionFields.EMBEDDED_VERSION),
+ Value = workItem.EmbeddedVersion,
+ });
+ }
+
+ if (workItem.MachineSerialNumber != null)
+ {
+ patchDocument.Add(new JsonPatchOperation
+ {
+ Operation = Operation.Add,
+ Path = GetExtensionFieldNameForWrite(ExtensionFields.MACHINE_SN),
+ Value = workItem.MachineSerialNumber,
+ });
+ }
+
var resultWorkItem = witClient.CreateWorkItemAsync(patchDocument, project.Name, workItem.Type.ToString(), bypassRules: true).Result;
workItem.ID = resultWorkItem.Id.Value;
diff --git a/Software/Visual_Studio/Tango.TFS/WorkItem.cs b/Software/Visual_Studio/Tango.TFS/WorkItem.cs
index 59f277f2e..230f4a5ef 100644
--- a/Software/Visual_Studio/Tango.TFS/WorkItem.cs
+++ b/Software/Visual_Studio/Tango.TFS/WorkItem.cs
@@ -168,6 +168,21 @@ namespace Tango.TFS
set { _foundInBuild = value; RaisePropertyChangedAuto(); }
}
+ private String _embeddedVersion;
+ public String EmbeddedVersion
+ {
+ get { return _embeddedVersion; }
+ set { _embeddedVersion = value; RaisePropertyChangedAuto(); }
+ }
+
+ private String _machineSerialNumber;
+ public String MachineSerialNumber
+ {
+ get { return _machineSerialNumber; }
+ set { _machineSerialNumber = value; RaisePropertyChangedAuto(); }
+ }
+
+
private String _comment;
public String Comment
{
diff --git a/Software/Visual_Studio/Tango.UnitTesting/TFS/TFS_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/TFS/TFS_TST.cs
index 613cfb8c5..c3238ec40 100644
--- a/Software/Visual_Studio/Tango.UnitTesting/TFS/TFS_TST.cs
+++ b/Software/Visual_Studio/Tango.UnitTesting/TFS/TFS_TST.cs
@@ -127,7 +127,7 @@ namespace Tango.UnitTesting.TFS
item.Description = "This is a test description";
item.FoundInBuild = "1.0.0.9";
- item.Iteration = project.Iterations.First();
+ item.Iteration = project.Iterations.FirstOrDefault();
item.Priority = Priority.Priority3;
item.Severity = Severity.Medium;
item.State = State.New;
@@ -136,6 +136,8 @@ namespace Tango.UnitTesting.TFS
item.Tags.Add(project.Tags.First());
item.Title = "Test Bug";
item.Type = WorkItemType.Bug;
+ item.EmbeddedVersion = "4.0.0.0";
+ item.MachineSerialNumber = "0008";
var workItem = client.UploadWorkItem(project, item).Result;