From 992208add11db73cb1ffb48c5ccedb0c883aafd0 Mon Sep 17 00:00:00 2001 From: Roy Date: Wed, 2 Nov 2022 04:49:10 +0200 Subject: PPC multi version support completed on PPC,FSE,MS,DB. --- .../PPC/Tango.PPC.Common/Application/IPPCApplicationManager.cs | 10 ++++++++++ .../PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs | 9 +++++++++ .../Visual_Studio/PPC/Tango.PPC.Common/Publish/PPCPublisher.cs | 6 ++++-- .../Visual_Studio/PPC/Tango.PPC.Common/Publish/PublishInfo.cs | 1 + .../PPC/Tango.PPC.Common/Publish/PublishOptions.cs | 5 +++-- .../Tango.PPC.Common/SystemInfo/DefaultSystemInfoService.cs | 2 +- .../PPC/Tango.PPC.Common/Web/CheckForUpdateRequest.cs | 2 ++ .../PPC/Tango.PPC.Common/Web/CheckForUpdateResponse.cs | 1 + .../PPC/Tango.PPC.Common/Web/DownloadUpdateResponse.cs | 2 ++ .../PPC/Tango.PPC.Common/Web/LatestVersionRequest.cs | 1 + .../PPC/Tango.PPC.Common/Web/MachineSetupResponse.cs | 2 ++ 11 files changed, 36 insertions(+), 5 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Application/IPPCApplicationManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Application/IPPCApplicationManager.cs index a9d4e7c3a..6002b3809 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Application/IPPCApplicationManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Application/IPPCApplicationManager.cs @@ -110,6 +110,16 @@ namespace Tango.PPC.Common.Application /// Version FirmwareVersion { get; } + /// + /// Gets the version tag. + /// + String VersionTag { get; } + + /// + /// Gets the version and tag display. + /// + String VersionAndTag { get; } + /// /// Gets the application build date. /// diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs index 642707e87..c5412e591 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs @@ -265,6 +265,7 @@ namespace Tango.PPC.Common.MachineUpdate TangoUpdate update = new TangoUpdate(); update.ApplicationVersion = response.Version; update.FirmwareVersion = response.FirmwareVersion; + update.ApplicationVersionTag = response.Tag; update.MachineGuid = _machineProvider.Machine.Guid; update.UpdateStatus = BL.Enumerations.TangoUpdateStatuses.UpdateFailed; update.StartDate = _updateStartDate; @@ -291,6 +292,7 @@ namespace Tango.PPC.Common.MachineUpdate TangoUpdate update = new TangoUpdate(); update.ApplicationVersion = tupPublishInfo.ApplicationVersion; update.FirmwareVersion = tupPublishInfo.GetFirmwareVersion(); + update.ApplicationVersionTag = tupPublishInfo.Tag; update.MachineGuid = _machineProvider.Machine.Guid; update.UpdateStatus = BL.Enumerations.TangoUpdateStatuses.OfflineUpdateFailed; update.StartDate = _updateStartDate; @@ -382,6 +384,7 @@ namespace Tango.PPC.Common.MachineUpdate TangoUpdate update = new TangoUpdate(); update.ApplicationVersion = response.Version; update.FirmwareVersion = response.FirmwareVersion; + update.ApplicationVersionTag = response.Tag; update.MachineGuid = (await db.Machines.FirstAsync()).Guid; update.UpdateStatus = BL.Enumerations.TangoUpdateStatuses.UpdateCompleted; update.StartDate = _updateStartDate; @@ -406,6 +409,7 @@ namespace Tango.PPC.Common.MachineUpdate TangoUpdate update = new TangoUpdate(); update.ApplicationVersion = tupPublishInfo.ApplicationVersion; update.FirmwareVersion = tupPublishInfo.GetFirmwareVersion(); + update.ApplicationVersionTag = tupPublishInfo.Tag; update.MachineGuid = _machineProvider.Machine.Guid; update.UpdateStatus = BL.Enumerations.TangoUpdateStatuses.OfflineUpdateCompleted; update.StartDate = _updateStartDate; @@ -481,6 +485,7 @@ namespace Tango.PPC.Common.MachineUpdate TangoUpdate update = new TangoUpdate(); update.ApplicationVersion = _app_manager.Version.ToString(); update.FirmwareVersion = _app_manager.FirmwareVersion.ToString(); + update.ApplicationVersionTag = _app_manager.VersionTag; update.MachineGuid = _machineProvider.Machine.Guid; update.UpdateStatus = BL.Enumerations.TangoUpdateStatuses.DatabaseFailed; update.StartDate = _updateStartDate; @@ -527,6 +532,7 @@ namespace Tango.PPC.Common.MachineUpdate TangoUpdate update = new TangoUpdate(); update.ApplicationVersion = _app_manager.Version.ToString(); update.FirmwareVersion = _app_manager.FirmwareVersion.ToString(); + update.ApplicationVersionTag = _app_manager.VersionTag; update.MachineGuid = _machineProvider.Machine.Guid; update.UpdateStatus = BL.Enumerations.TangoUpdateStatuses.DatabaseCompleted; update.StartDate = _updateStartDate; @@ -559,6 +565,7 @@ namespace Tango.PPC.Common.MachineUpdate TangoUpdate update = new TangoUpdate(); update.ApplicationVersion = _app_manager.Version.ToString(); update.FirmwareVersion = firmwareVersion; + update.ApplicationVersionTag = _app_manager.VersionTag; update.MachineGuid = _machineProvider.Machine.Guid; update.UpdateStatus = BL.Enumerations.TangoUpdateStatuses.OfflineFirmwareUpgradeFailed; update.StartDate = _updateStartDate; @@ -589,6 +596,7 @@ namespace Tango.PPC.Common.MachineUpdate TangoUpdate update = new TangoUpdate(); update.ApplicationVersion = _app_manager.Version.ToString(); update.FirmwareVersion = firmwareVersion; + update.ApplicationVersionTag = _app_manager.VersionTag; update.MachineGuid = _machineProvider.Machine.Guid; update.UpdateStatus = BL.Enumerations.TangoUpdateStatuses.OfflineFirmwareUpgradeCompleted; update.StartDate = _updateStartDate; @@ -947,6 +955,7 @@ namespace Tango.PPC.Common.MachineUpdate CheckForUpdateRequest request = new CheckForUpdateRequest(); request.Version = _app_manager.Version.ToString(); request.FirmwareVersion = _app_manager.FirmwareVersion?.ToString(); + request.Tag = _app_manager.VersionTag; try { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PPCPublisher.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PPCPublisher.cs index 810c5b3cb..0e6641cfb 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PPCPublisher.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PPCPublisher.cs @@ -63,7 +63,7 @@ namespace Tango.PPC.Common.Publish public async Task GetRemoteVersion(String machineVersionGuid) { _client.Environment = Options.Environment; - var response = await _client.GetLatestVersion(new LatestVersionRequest() { MachineVersionGuid = machineVersionGuid }); + var response = await _client.GetLatestVersion(new LatestVersionRequest() { MachineVersionGuid = machineVersionGuid, Tag = Options.Tag }); return response; } @@ -190,6 +190,7 @@ namespace Tango.PPC.Common.Publish MachineVersionGuid = Options.MachineVersionGuid, WithInstaller = !String.IsNullOrWhiteSpace(Options.InstallerProject), FirmwareVersion = GetVersionInfoFromTFP(Options.TfpPath).FileDescriptors.SingleOrDefault(x => x.Destination == VersionFileDestination.Mcu).Version, + Tag = Options.Tag }).Result; CreateTupPackage(tempFile).Wait(); @@ -199,7 +200,7 @@ namespace Tango.PPC.Common.Publish String output_folder = Options.InstallerOutputFolder; OnPublishProgress(0, 100, $"Building installer project..."); InstallerBuilder installerBuilder = new InstallerBuilder(Options.InstallerProject); - String installer_name = $"PPC Installer_v{Version.Parse(local_version).ToString(3)}.exe"; + String installer_name = $"PPC Installer_v{Version.Parse(local_version).ToString(3) + (Options.Tag.IsNotNullOrEmpty() ? $" [{Options.Tag}]" : String.Empty)}.exe"; String output_file = Path.Combine(output_folder, installer_name); installerBuilder.Build(local_version, output_file).Wait(); @@ -355,6 +356,7 @@ namespace Tango.PPC.Common.Publish versionInfo.ApplicationVersion = GetLocalVersion(); versionInfo.Comments = Options.Comments; versionInfo.Firmware = GetVersionInfoFromTFP(Options.TfpPath); + versionInfo.Tag = Options.Tag; //Validate the package. versionInfo.Firmware.Validate(); diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PublishInfo.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PublishInfo.cs index 1bbdb80d0..b356ac970 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PublishInfo.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PublishInfo.cs @@ -13,6 +13,7 @@ namespace Tango.PPC.Common.Publish { public String ApplicationVersion { get; set; } public VersionPackageDescriptor Firmware { get; set; } + public String Tag { get; set; } public String Comments { get; set; } public bool IsMachineTupPackage { get; set; } public String MachineSerialNumber { get; set; } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PublishOptions.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PublishOptions.cs index 5b43d4b8c..8e81f5e44 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PublishOptions.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PublishOptions.cs @@ -18,6 +18,7 @@ namespace Tango.PPC.Common.Publish public event EventHandler BasicInfoChanged; public event EventHandler MachineVersionGuidChanged; public event EventHandler TfpPathChanged; + public event EventHandler TagChanged; private String basePath; [Option("path", HelpText = "Specifies the application base path.", Required = false)] @@ -62,8 +63,8 @@ namespace Tango.PPC.Common.Publish private String _tag; public String Tag { - get { return _tag; } - set { _tag = value; RaisePropertyChangedAuto(); BasicInfoChanged?.Invoke(this, new EventArgs()); } + get { return _tag.IsNotNullOrEmpty() ? _tag : null; } + set { _tag = value; RaisePropertyChangedAuto(); TagChanged?.Invoke(this, new EventArgs()); } } private DeploymentSlot _environment; diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/SystemInfo/DefaultSystemInfoService.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/SystemInfo/DefaultSystemInfoService.cs index 3c3a0247b..e3030aa9d 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/SystemInfo/DefaultSystemInfoService.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/SystemInfo/DefaultSystemInfoService.cs @@ -66,7 +66,7 @@ namespace Tango.PPC.Common.SystemInfo Name = "Tango PPC", Properties = new List() { - new SystemObjectProperty() { Name = "Version", Value = _applicationManager.Version.ToString(3) }, + new SystemObjectProperty() { Name = "Version", Value = _applicationManager.VersionAndTag }, new SystemObjectProperty() { Name = "Build Date", Value = _applicationManager.BuildDate }, new SystemObjectProperty() { Name = "Previous Version", Value = settings.PreviousApplicationVersion }, new SystemObjectProperty() { Name = "Firmware Version", Value = _applicationManager.FirmwareVersion.ToStringSafe() }, diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/CheckForUpdateRequest.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/CheckForUpdateRequest.cs index 8e13ea7c4..5002d453b 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/CheckForUpdateRequest.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/CheckForUpdateRequest.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.BL.Entities; using Tango.Transport.Web; namespace Tango.PPC.Common.Web @@ -17,6 +18,7 @@ namespace Tango.PPC.Common.Web public List Catalogs { get; set; } public DateTime MachineLastUpdated { get; set; } public List UsedRmlsGuids { get; set; } + public String Tag { get; set; } public CheckForUpdateRequest() { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/CheckForUpdateResponse.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/CheckForUpdateResponse.cs index 2fb33ebdc..df654eb72 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/CheckForUpdateResponse.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/CheckForUpdateResponse.cs @@ -13,6 +13,7 @@ namespace Tango.PPC.Common.Web public bool IsDatabaseUpdateAvailable { get; set; } public String Version { get; set; } public String FirmwareVersion { get; set; } + public String Tag { get; set; } public bool SetupFirmware { get; set; } public bool SetupFPGA { get; set; } public UpdateDBResponse UpdateDBResponse { get; set; } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/DownloadUpdateResponse.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/DownloadUpdateResponse.cs index 2fc7e4810..56e08ba3d 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/DownloadUpdateResponse.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/DownloadUpdateResponse.cs @@ -14,6 +14,8 @@ namespace Tango.PPC.Common.Web public String Version { get; set; } + public String Tag { get; set; } + public String FirmwareVersion { get; set; } public String BlobAddress { get; set; } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/LatestVersionRequest.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/LatestVersionRequest.cs index 400bb315c..5983beafe 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/LatestVersionRequest.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/LatestVersionRequest.cs @@ -11,5 +11,6 @@ namespace Tango.PPC.Common.Web public class LatestVersionRequest : WebRequestMessage { public String MachineVersionGuid { get; set; } + public String Tag { get; set; } } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/MachineSetupResponse.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/MachineSetupResponse.cs index f5d03c6ce..b6a6ddc2c 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/MachineSetupResponse.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/MachineSetupResponse.cs @@ -14,6 +14,8 @@ namespace Tango.PPC.Common.Web public String Version { get; set; } + public String Tag { get; set; } + public String FirmwareVersion { get; set; } public String BlobAddress { get; set; } -- cgit v1.3.1