aboutsummaryrefslogtreecommitdiffstats
path: root/Software
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2022-05-19 17:25:53 +0300
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2022-05-19 17:25:53 +0300
commit83b5cc5c1d60dbbef59c8fddee844dc0394c6314 (patch)
tree76eaa6f005d675cd67ae50b8be0a4ca985209b4f /Software
parent7fb6f7ff36d3e5395e6f417567d40268ef262daf (diff)
downloadTango-83b5cc5c1d60dbbef59c8fddee844dc0394c6314.tar.gz
Tango-83b5cc5c1d60dbbef59c8fddee844dc0394c6314.zip
Save job Version in Export/import job in PPC
Related Work Items: #6528
Diffstat (limited to 'Software')
-rw-r--r--Software/PMR/Messages/Exports/JobFile.proto1
-rw-r--r--Software/Visual_Studio/Tango.BL/Entities/BrushStop.cs2
-rw-r--r--Software/Visual_Studio/Tango.BL/Entities/Job.cs2
-rw-r--r--Software/Visual_Studio/Tango.PMR/Exports/JobFile.cs35
4 files changed, 36 insertions, 4 deletions
diff --git a/Software/PMR/Messages/Exports/JobFile.proto b/Software/PMR/Messages/Exports/JobFile.proto
index 3516076cd..f409e09f5 100644
--- a/Software/PMR/Messages/Exports/JobFile.proto
+++ b/Software/PMR/Messages/Exports/JobFile.proto
@@ -29,4 +29,5 @@ message JobFile
double LengthPercentageFactor = 20;
repeated JobFileSegment Segments = 21;
string ColorCatalogGuid = 22;
+ int32 Version = 23;
} \ No newline at end of file
diff --git a/Software/Visual_Studio/Tango.BL/Entities/BrushStop.cs b/Software/Visual_Studio/Tango.BL/Entities/BrushStop.cs
index 89ce78b16..1e13cda6d 100644
--- a/Software/Visual_Studio/Tango.BL/Entities/BrushStop.cs
+++ b/Software/Visual_Studio/Tango.BL/Entities/BrushStop.cs
@@ -183,7 +183,7 @@ namespace Tango.BL.Entities
if (Segment != null && Segment.Job != null)
{
- if (Segment.Job.Version < 2)
+ if (Segment.Job.Version < 2 || (BestMatchR == null || BestMatchG == null || BestMatchB == null))
{
r = (byte)Red;
g = (byte)Green;
diff --git a/Software/Visual_Studio/Tango.BL/Entities/Job.cs b/Software/Visual_Studio/Tango.BL/Entities/Job.cs
index 04451da31..91f13bab0 100644
--- a/Software/Visual_Studio/Tango.BL/Entities/Job.cs
+++ b/Software/Visual_Studio/Tango.BL/Entities/Job.cs
@@ -807,6 +807,7 @@ namespace Tango.BL.Entities
jobFile.Type = job.Type;
jobFile.WindingMethodGuid = job.WindingMethodGuid;
jobFile.ColorCatalogGuid = job.ColorCatalogGuid.ToStringOrEmpty();
+ jobFile.Version = job.Version;
foreach (var segm in job.OrderedSegmentsWithGroups)
{
@@ -921,6 +922,7 @@ namespace Tango.BL.Entities
job.LengthPercentageFactor = jobFile.LengthPercentageFactor;
job.Name = jobFile.Name.ToNullIfEmpty();
job.NumberOfUnits = jobFile.NumberOfUnits;
+ job.Version = jobFile.Version;
var job_rml = db.Rmls.SingleOrDefault(x => x.Guid == jobFile.RmlGuid);
diff --git a/Software/Visual_Studio/Tango.PMR/Exports/JobFile.cs b/Software/Visual_Studio/Tango.PMR/Exports/JobFile.cs
index 7aa03c4cb..dda4e2441 100644
--- a/Software/Visual_Studio/Tango.PMR/Exports/JobFile.cs
+++ b/Software/Visual_Studio/Tango.PMR/Exports/JobFile.cs
@@ -23,7 +23,7 @@ namespace Tango.PMR.Exports {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Cg1Kb2JGaWxlLnByb3RvEhFUYW5nby5QTVIuRXhwb3J0cxoUSm9iRmlsZVNl",
- "Z21lbnQucHJvdG8iuwQKB0pvYkZpbGUSDAoETmFtZRgBIAEoCRITCgtEZXNj",
+ "Z21lbnQucHJvdG8izAQKB0pvYkZpbGUSDAoETmFtZRgBIAEoCRITCgtEZXNj",
"cmlwdGlvbhgCIAEoCRIaChJFbmFibGVJbnRlclNlZ21lbnQYAyABKAgSGgoS",
"SW50ZXJTZWdtZW50TGVuZ3RoGAQgASgBEg8KB1JtbEd1aWQYBSABKAkSGQoR",
"V2luZGluZ01ldGhvZEd1aWQYBiABKAkSFQoNU3Bvb2xUeXBlR3VpZBgHIAEo",
@@ -36,11 +36,12 @@ namespace Tango.PMR.Exports {
"YW1wbGVVbml0c09yTWV0ZXJzGBMgASgFEh4KFkxlbmd0aFBlcmNlbnRhZ2VG",
"YWN0b3IYFCABKAESMwoIU2VnbWVudHMYFSADKAsyIS5UYW5nby5QTVIuRXhw",
"b3J0cy5Kb2JGaWxlU2VnbWVudBIYChBDb2xvckNhdGFsb2dHdWlkGBYgASgJ",
- "Qh0KG2NvbS50d2luZS50YW5nby5wbXIuZXhwb3J0c2IGcHJvdG8z"));
+ "Eg8KB1ZlcnNpb24YFyABKAVCHQobY29tLnR3aW5lLnRhbmdvLnBtci5leHBv",
+ "cnRzYgZwcm90bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Tango.PMR.Exports.JobFileSegmentReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
- new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Exports.JobFile), global::Tango.PMR.Exports.JobFile.Parser, new[]{ "Name", "Description", "EnableInterSegment", "InterSegmentLength", "RmlGuid", "WindingMethodGuid", "SpoolTypeGuid", "EnableLubrication", "HasEmbroideryFile", "EmbroideryFileData", "EmbroideryFileName", "EmbroideryJpeg", "ColorSpaceGuid", "NumberOfUnits", "Type", "Customer", "SpoolsDistribution", "NumberOfHeads", "SampleUnitsOrMeters", "LengthPercentageFactor", "Segments", "ColorCatalogGuid" }, null, null, null)
+ new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Exports.JobFile), global::Tango.PMR.Exports.JobFile.Parser, new[]{ "Name", "Description", "EnableInterSegment", "InterSegmentLength", "RmlGuid", "WindingMethodGuid", "SpoolTypeGuid", "EnableLubrication", "HasEmbroideryFile", "EmbroideryFileData", "EmbroideryFileName", "EmbroideryJpeg", "ColorSpaceGuid", "NumberOfUnits", "Type", "Customer", "SpoolsDistribution", "NumberOfHeads", "SampleUnitsOrMeters", "LengthPercentageFactor", "Segments", "ColorCatalogGuid", "Version" }, null, null, null)
}));
}
#endregion
@@ -93,6 +94,7 @@ namespace Tango.PMR.Exports {
lengthPercentageFactor_ = other.lengthPercentageFactor_;
segments_ = other.segments_.Clone();
colorCatalogGuid_ = other.colorCatalogGuid_;
+ version_ = other.version_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -341,6 +343,17 @@ namespace Tango.PMR.Exports {
}
}
+ /// <summary>Field number for the "Version" field.</summary>
+ public const int VersionFieldNumber = 23;
+ private int version_;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ public int Version {
+ get { return version_; }
+ set {
+ version_ = value;
+ }
+ }
+
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as JobFile);
@@ -376,6 +389,7 @@ namespace Tango.PMR.Exports {
if (LengthPercentageFactor != other.LengthPercentageFactor) return false;
if(!segments_.Equals(other.segments_)) return false;
if (ColorCatalogGuid != other.ColorCatalogGuid) return false;
+ if (Version != other.Version) return false;
return true;
}
@@ -404,6 +418,7 @@ namespace Tango.PMR.Exports {
if (LengthPercentageFactor != 0D) hash ^= LengthPercentageFactor.GetHashCode();
hash ^= segments_.GetHashCode();
if (ColorCatalogGuid.Length != 0) hash ^= ColorCatalogGuid.GetHashCode();
+ if (Version != 0) hash ^= Version.GetHashCode();
return hash;
}
@@ -499,6 +514,10 @@ namespace Tango.PMR.Exports {
output.WriteRawTag(178, 1);
output.WriteString(ColorCatalogGuid);
}
+ if (Version != 0) {
+ output.WriteRawTag(184, 1);
+ output.WriteInt32(Version);
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -568,6 +587,9 @@ namespace Tango.PMR.Exports {
if (ColorCatalogGuid.Length != 0) {
size += 2 + pb::CodedOutputStream.ComputeStringSize(ColorCatalogGuid);
}
+ if (Version != 0) {
+ size += 2 + pb::CodedOutputStream.ComputeInt32Size(Version);
+ }
return size;
}
@@ -640,6 +662,9 @@ namespace Tango.PMR.Exports {
if (other.ColorCatalogGuid.Length != 0) {
ColorCatalogGuid = other.ColorCatalogGuid;
}
+ if (other.Version != 0) {
+ Version = other.Version;
+ }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@@ -738,6 +763,10 @@ namespace Tango.PMR.Exports {
ColorCatalogGuid = input.ReadString();
break;
}
+ case 184: {
+ Version = input.ReadInt32();
+ break;
+ }
}
}
}