From dc01eecbfd2f47f739e4ffd8a2a56f3047c66322 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Sun, 19 Jan 2025 17:13:32 +0200 Subject: X1 Startup --- Software/DB/PPC/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/PPC/Tango_log.ldf | Bin 53673984 -> 53673984 bytes Software/DB/TCC/TCC.mdf | Bin 8388608 -> 8388608 bytes Software/DB/TCC/TCC_log.ldf | Bin 8388608 -> 8388608 bytes Software/DB/Tango.mdf | Bin 75497472 -> 75497472 bytes Software/DB/Tango_log.ldf | Bin 22675456 -> 22675456 bytes Software/Graphics/X1/Machine1.png | Bin 0 -> 1415967 bytes Software/Graphics/X1/Machine2.png | Bin 0 -> 678246 bytes Software/PMR/Messages/Common/MachineType.proto | 1 + .../Tango.FSE.Statistics/Models/StopModel.cs | 17 +++++++++-------- .../Tango.FSE.Statistics/ViewModels/MainViewVM.cs | 2 +- .../Models/JobRunModel.cs | 15 ++++++--------- .../TFS/TeamFoundationServicePPCClient.cs | 2 +- .../Connection/DefaultMachineProvider.cs | 2 +- Software/Visual_Studio/Tango.BL/Entities/JobRun.cs | 10 ++++++++++ .../Tango.BL/Entities/MachineVersion.cs | 5 ++++- .../Tango.BL/Enumerations/MachineTypes.cs | 15 +++++++++++++++ .../ExtensionMethods/MachineTypesExtensions.cs | 19 +++++++++++++++++++ Software/Visual_Studio/Tango.BL/Tango.BL.csproj | 3 ++- .../Visual_Studio/Tango.PMR/Common/MachineType.cs | 7 ++++--- Software/Visual_Studio/Tango.TFS/MachineType.cs | 2 ++ 21 files changed, 75 insertions(+), 25 deletions(-) create mode 100644 Software/Graphics/X1/Machine1.png create mode 100644 Software/Graphics/X1/Machine2.png create mode 100644 Software/Visual_Studio/Tango.BL/ExtensionMethods/MachineTypesExtensions.cs (limited to 'Software') diff --git a/Software/DB/PPC/Tango.mdf b/Software/DB/PPC/Tango.mdf index e42900c64..02019bcc2 100644 Binary files a/Software/DB/PPC/Tango.mdf and b/Software/DB/PPC/Tango.mdf differ diff --git a/Software/DB/PPC/Tango_log.ldf b/Software/DB/PPC/Tango_log.ldf index 4b3def1c8..675fa8490 100644 Binary files a/Software/DB/PPC/Tango_log.ldf and b/Software/DB/PPC/Tango_log.ldf differ diff --git a/Software/DB/TCC/TCC.mdf b/Software/DB/TCC/TCC.mdf index e37ef9423..981067be5 100644 Binary files a/Software/DB/TCC/TCC.mdf and b/Software/DB/TCC/TCC.mdf differ diff --git a/Software/DB/TCC/TCC_log.ldf b/Software/DB/TCC/TCC_log.ldf index e40f19b4b..8c4d8d4a7 100644 Binary files a/Software/DB/TCC/TCC_log.ldf and b/Software/DB/TCC/TCC_log.ldf differ diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf index 9edc18c17..46431109e 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 4366afff9..51a0fb481 100644 Binary files a/Software/DB/Tango_log.ldf and b/Software/DB/Tango_log.ldf differ diff --git a/Software/Graphics/X1/Machine1.png b/Software/Graphics/X1/Machine1.png new file mode 100644 index 000000000..c2b82e1ad Binary files /dev/null and b/Software/Graphics/X1/Machine1.png differ diff --git a/Software/Graphics/X1/Machine2.png b/Software/Graphics/X1/Machine2.png new file mode 100644 index 000000000..abd7431dc Binary files /dev/null and b/Software/Graphics/X1/Machine2.png differ diff --git a/Software/PMR/Messages/Common/MachineType.proto b/Software/PMR/Messages/Common/MachineType.proto index 8f80120f0..42d52f751 100644 --- a/Software/PMR/Messages/Common/MachineType.proto +++ b/Software/PMR/Messages/Common/MachineType.proto @@ -7,4 +7,5 @@ enum MachineType { TS1800 = 0; Eureka = 1; + X1 = 2; } 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 527794e75..fe240f18d 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 @@ -29,7 +29,7 @@ namespace Tango.FSE.Statistics.Models public JobRunExtendedInfo ExtendedInfo { get; set; } public bool IsAdvancedMode { get; set; } public VectorFineTuningRunModel FineTuningModel { get; set; } - public bool IsEureka { get; set; } + public MachineTypes MachineType { get; set; } public bool IsFineTuning { @@ -135,7 +135,7 @@ namespace Tango.FSE.Statistics.Models { get { - var length = IsEureka ? JobRun.JobLogicalLength * 4 : JobRun.JobLogicalLength; + var length = MachineType == MachineTypes.Eureka ? JobRun.JobLogicalLength * 4 : JobRun.JobLogicalLength; return JobRun.NumberOfUnits > 1 ? $"{length} x{JobRun.NumberOfUnits}" : length.ToString(); } } @@ -144,23 +144,23 @@ namespace Tango.FSE.Statistics.Models { get { - return (IsEureka ? JobRun.JobLogicalLength * 4 : JobRun.JobLogicalLength); + return (MachineType == MachineTypes.Eureka ? JobRun.JobLogicalLength * 4 : JobRun.JobLogicalLength); } } public double JobLength { - get { return IsEureka ? JobRun.JobLength * 4 : JobRun.JobLength; } + get { return MachineType == MachineTypes.Eureka ? JobRun.JobLength * 4 : JobRun.JobLength; } } public double EndPosition { - get { return IsEureka ? JobRun.EndPosition * 4 : JobRun.EndPosition; } + get { return MachineType == MachineTypes.Eureka ? JobRun.EndPosition * 4 : JobRun.EndPosition; } } public double ActualStartPosition { - get { return IsEureka ? JobRun.ActualStartPosition * 4 : JobRun.ActualStartPosition; } + get { return MachineType == MachineTypes.Eureka ? JobRun.ActualStartPosition * 4 : JobRun.ActualStartPosition; } } public double ActualEndPosition @@ -169,11 +169,11 @@ namespace Tango.FSE.Statistics.Models { if (JobRun.ActualEndPosition > 0) { - return IsEureka ? JobRun.ActualEndPosition * 4 : JobRun.ActualEndPosition; + return MachineType == MachineTypes.Eureka ? JobRun.ActualEndPosition * 4 : JobRun.ActualEndPosition; } else { - return IsEureka ? JobRun.EndPosition * 4 : JobRun.EndPosition; + return MachineType == MachineTypes.Eureka ? JobRun.EndPosition * 4 : JobRun.EndPosition; } } } @@ -257,5 +257,6 @@ namespace Tango.FSE.Statistics.Models return ActualEndPosition - ActualStartPosition; } } + } } 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 cec9551f0..a45f65a54 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 @@ -436,7 +436,7 @@ namespace Tango.FSE.Statistics.ViewModels stop.ThreadName = rmlName; stop.IsAdvancedMode = !BuildProvider.IsTwineRSM && CurrentUser.HasRole(Roles.FSEAdvancedTechnician); stop.FineTuningModel = fineTuningModel; - stop.IsEureka = MachineProvider.MachineOperator.MachineType == MachineTypes.Eureka; + stop.MachineType = MachineProvider.MachineOperator.MachineType; if (fineTuningModel != null) { diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Models/JobRunModel.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Models/JobRunModel.cs index 38005f2bc..7f9d0e57d 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Models/JobRunModel.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Models/JobRunModel.cs @@ -22,19 +22,17 @@ namespace Tango.MachineStudio.Statistics.Models public RmlModel Rml { get; set; } - public bool IsEureka { get; set; } - public String Gen { get { - return JobRun.MachineType == (int)MachineTypes.Eureka ? "X4" : "X1"; + return JobRun.MachineTypeEnum.ToShortName(); } } public double ActualStartPosition { - get { return IsEureka ? JobRun.ActualStartPosition * 4 : JobRun.ActualStartPosition; } + get { return JobRun.MachineTypeEnum == MachineTypes.Eureka ? JobRun.ActualStartPosition * 4 : JobRun.ActualStartPosition; } } public double ActualEndPosition @@ -43,11 +41,11 @@ namespace Tango.MachineStudio.Statistics.Models { if (JobRun.ActualEndPosition > 0) { - return IsEureka ? JobRun.ActualEndPosition * 4 : JobRun.ActualEndPosition; + return JobRun.MachineTypeEnum == MachineTypes.Eureka ? JobRun.ActualEndPosition * 4 : JobRun.ActualEndPosition; } else { - return IsEureka ? JobRun.EndPosition * 4 : JobRun.EndPosition; + return JobRun.MachineTypeEnum == MachineTypes.Eureka ? JobRun.EndPosition * 4 : JobRun.EndPosition; } } } @@ -64,7 +62,7 @@ namespace Tango.MachineStudio.Statistics.Models { get { - return (IsEureka ? JobRun.JobLogicalLength * 4 : JobRun.JobLogicalLength); + return (JobRun.MachineTypeEnum == MachineTypes.Eureka ? JobRun.JobLogicalLength * 4 : JobRun.JobLogicalLength); } } @@ -85,12 +83,11 @@ namespace Tango.MachineStudio.Statistics.Models HeatingDuration = JobRun.ActualStartDate - JobRun.HeatingStartDate; } - if (JobRun.MachineType == (int)MachineTypes.Eureka) + if (JobRun.MachineTypeEnum == MachineTypes.Eureka) { JobRun.JobLogicalLength *= 4; JobRun.JobLength *= 4; JobRun.EndPosition *= 4; - IsEureka = true; } } } 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 c21d56f2a..c9e39b02b 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 @@ -102,7 +102,7 @@ namespace Tango.PPC.BugReporting.TFS item.Type = WorkItemType.Bug; item.Environment = SettingsManager.Default.GetOrCreate().DeploymentSlot.ToDescription(); - item.MachineType = _buildProvider.IsEureka ? MachineType.TwineX4 : MachineType.TS1800; + item.MachineType = (MachineType)_buildProvider.BuildType; FileLogger appFileLogger = LogManager.Default.RegisteredLoggers.FirstOrDefault(x => x.GetType() == typeof(FileLogger)) as FileLogger; FileLogger embeddedFileLogger = MachineOperator.EmbeddedLogManager.RegisteredLoggers.FirstOrDefault(x => x.GetType() == typeof(FileLogger)) as FileLogger; diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs index db5085b09..3446fe55d 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Connection/DefaultMachineProvider.cs @@ -448,7 +448,7 @@ namespace Tango.PPC.Common.Connection MachineConnected?.Invoke(this, new EventArgs()); - if (Machine.Type == BL.Enumerations.MachineTypes.Eureka) + if (Machine.Type.IsXMachine()) { try { diff --git a/Software/Visual_Studio/Tango.BL/Entities/JobRun.cs b/Software/Visual_Studio/Tango.BL/Entities/JobRun.cs index 4aae63562..73be1c9d8 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/JobRun.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/JobRun.cs @@ -169,6 +169,16 @@ namespace Tango.BL.Entities } } + [NotMapped] + [JsonIgnore] + public MachineTypes MachineTypeEnum + { + get + { + return (MachineTypes)MachineType; + } + } + /// /// Initializes a new instance of the class. diff --git a/Software/Visual_Studio/Tango.BL/Entities/MachineVersion.cs b/Software/Visual_Studio/Tango.BL/Entities/MachineVersion.cs index 694ee1f37..501dc7fd9 100644 --- a/Software/Visual_Studio/Tango.BL/Entities/MachineVersion.cs +++ b/Software/Visual_Studio/Tango.BL/Entities/MachineVersion.cs @@ -26,7 +26,10 @@ namespace Tango.BL.Entities [JsonIgnore] public MachineTypes MachineType { - get { return Version == 1 ? MachineTypes.TS1800 : MachineTypes.Eureka; } + get + { + return (MachineTypes)(Version + 1); + } } } } diff --git a/Software/Visual_Studio/Tango.BL/Enumerations/MachineTypes.cs b/Software/Visual_Studio/Tango.BL/Enumerations/MachineTypes.cs index 381b87cbc..1684d14d2 100644 --- a/Software/Visual_Studio/Tango.BL/Enumerations/MachineTypes.cs +++ b/Software/Visual_Studio/Tango.BL/Enumerations/MachineTypes.cs @@ -7,11 +7,26 @@ using System.Threading.Tasks; namespace Tango.BL.Enumerations { + public class MachineTypeAttribute : Attribute + { + public String ShortName { get; set; } + + public MachineTypeAttribute(String shortName) + { + ShortName = shortName; + } + } + public enum MachineTypes { + [MachineType("TS")] [Description("TS-1800")] TS1800 = 0, + [MachineType("X4")] [Description("Twine X4")] Eureka = 1, + [MachineType("X1")] + [Description("Twine X1")] + X1 = 2, } } diff --git a/Software/Visual_Studio/Tango.BL/ExtensionMethods/MachineTypesExtensions.cs b/Software/Visual_Studio/Tango.BL/ExtensionMethods/MachineTypesExtensions.cs new file mode 100644 index 000000000..d8b5b519d --- /dev/null +++ b/Software/Visual_Studio/Tango.BL/ExtensionMethods/MachineTypesExtensions.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.Enumerations; + +public static class MachineTypesExtensions +{ + public static bool IsXMachine(this MachineTypes machineType) + { + return machineType != MachineTypes.TS1800; + } + + public static String ToShortName(this MachineTypes machineType) + { + return machineType.GetAttribute().ShortName; + } +} diff --git a/Software/Visual_Studio/Tango.BL/Tango.BL.csproj b/Software/Visual_Studio/Tango.BL/Tango.BL.csproj index dabc0455e..042105f11 100644 --- a/Software/Visual_Studio/Tango.BL/Tango.BL.csproj +++ b/Software/Visual_Studio/Tango.BL/Tango.BL.csproj @@ -604,6 +604,7 @@ + @@ -837,7 +838,7 @@ - + \ No newline at end of file diff --git a/Software/Visual_Studio/Tango.PMR/Common/MachineType.cs b/Software/Visual_Studio/Tango.PMR/Common/MachineType.cs index 4ef97d168..6049ccefc 100644 --- a/Software/Visual_Studio/Tango.PMR/Common/MachineType.cs +++ b/Software/Visual_Studio/Tango.PMR/Common/MachineType.cs @@ -22,9 +22,9 @@ namespace Tango.PMR.Common { static MachineTypeReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "ChFNYWNoaW5lVHlwZS5wcm90bxIQVGFuZ28uUE1SLkNvbW1vbiolCgtNYWNo", - "aW5lVHlwZRIKCgZUUzE4MDAQABIKCgZFdXJla2EQAUIcChpjb20udHdpbmUu", - "dGFuZ28ucG1yLmNvbW1vbmIGcHJvdG8z")); + "ChFNYWNoaW5lVHlwZS5wcm90bxIQVGFuZ28uUE1SLkNvbW1vbiotCgtNYWNo", + "aW5lVHlwZRIKCgZUUzE4MDAQABIKCgZFdXJla2EQARIGCgJYMRACQhwKGmNv", + "bS50d2luZS50YW5nby5wbXIuY29tbW9uYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Tango.PMR.Common.MachineType), }, null)); @@ -36,6 +36,7 @@ namespace Tango.PMR.Common { public enum MachineType { [pbr::OriginalName("TS1800")] Ts1800 = 0, [pbr::OriginalName("Eureka")] Eureka = 1, + [pbr::OriginalName("X1")] X1 = 2, } #endregion diff --git a/Software/Visual_Studio/Tango.TFS/MachineType.cs b/Software/Visual_Studio/Tango.TFS/MachineType.cs index 044155b2b..9e8b20f3c 100644 --- a/Software/Visual_Studio/Tango.TFS/MachineType.cs +++ b/Software/Visual_Studio/Tango.TFS/MachineType.cs @@ -13,5 +13,7 @@ namespace Tango.TFS TS1800 = 0, [Description("Twine X4")] TwineX4 = 1, + [Description("Twine X1")] + TwineX1 = 2, } } -- cgit v1.3.1