aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.Common
diff options
context:
space:
mode:
authorRoy <Roy.mail.net@gmail.com>2022-11-02 04:49:10 +0200
committerRoy <Roy.mail.net@gmail.com>2022-11-02 04:49:10 +0200
commit992208add11db73cb1ffb48c5ccedb0c883aafd0 (patch)
treee8b753bca8f341c105b8b1cb7761e2282a13881e /Software/Visual_Studio/PPC/Tango.PPC.Common
parent5ab455fb09c659e92ad4de41ec7472e2b8e48499 (diff)
downloadTango-992208add11db73cb1ffb48c5ccedb0c883aafd0.tar.gz
Tango-992208add11db73cb1ffb48c5ccedb0c883aafd0.zip
PPC multi version support completed on PPC,FSE,MS,DB.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Application/IPPCApplicationManager.cs10
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs9
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PPCPublisher.cs6
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PublishInfo.cs1
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PublishOptions.cs5
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/SystemInfo/DefaultSystemInfoService.cs2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Web/CheckForUpdateRequest.cs2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Web/CheckForUpdateResponse.cs1
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Web/DownloadUpdateResponse.cs2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Web/LatestVersionRequest.cs1
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Web/MachineSetupResponse.cs2
11 files changed, 36 insertions, 5 deletions
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
@@ -111,6 +111,16 @@ namespace Tango.PPC.Common.Application
Version FirmwareVersion { get; }
/// <summary>
+ /// Gets the version tag.
+ /// </summary>
+ String VersionTag { get; }
+
+ /// <summary>
+ /// Gets the version and tag display.
+ /// </summary>
+ String VersionAndTag { get; }
+
+ /// <summary>
/// Gets the application build date.
/// </summary>
String BuildDate { get; }
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<LatestVersionResponse> 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<SystemObjectProperty>()
{
- 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<UpdatedEntity> Catalogs { get; set; }
public DateTime MachineLastUpdated { get; set; }
public List<String> 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; }