FwUpdateBuilder: - changed single FwUpdate package detect and load
This commit is contained in:
@@ -2191,7 +2191,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
||||
}
|
||||
|
||||
// Wait for storing
|
||||
Thread.Sleep(400);
|
||||
Thread.Sleep(500);
|
||||
//TODO enable this for R1.2.x
|
||||
if (a.Key.AppName == "SENSUSRADIO" || a.Key.AppName == "NA2WALARMS")
|
||||
{
|
||||
@@ -2220,7 +2220,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisCore
|
||||
|
||||
catch (Exception)
|
||||
{
|
||||
// ignored
|
||||
return false;
|
||||
}
|
||||
|
||||
return allConfigRegisters == 0;
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Xylem.Common.Logic.ProductionOrderCore.FW
|
||||
public Int32 Id;
|
||||
|
||||
/// <summary>
|
||||
/// Frequency in MHz, null if not used or not assigned
|
||||
/// Frequency in MHz, null if not used or not assigned or for all frequencies
|
||||
/// </summary>
|
||||
public Int32? RadioFrequencyMhz;
|
||||
|
||||
|
||||
@@ -48,11 +48,6 @@ namespace Xylem.ServiceFwUpdate.Common.FwUpdateDb
|
||||
/// </summary>
|
||||
public List<FilePart> DbFwUpdateConfigFiles { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Cordonel FW packages.
|
||||
/// </summary>
|
||||
public List<ClusteredFile> DbCordonelFwPackages { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Cordonel FW packages information.
|
||||
/// </summary>
|
||||
@@ -363,39 +358,6 @@ namespace Xylem.ServiceFwUpdate.Common.FwUpdateDb
|
||||
}
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// Get all Cordonel FW packages info files from DB.
|
||||
///// </summary>
|
||||
///// <returns>true if successful</returns>
|
||||
///// <remarks date="2021-Apr-08" author="Thomas Wiedebusch">
|
||||
///// - Initial.
|
||||
///// </remarks>
|
||||
//public Boolean GetAllCordonelFwInfoFilesFromDb()
|
||||
//{
|
||||
// if (DbCordonelFwPackages == null) DbCordonelFwPackages = new List<ClusteredFile>();
|
||||
// DbCordonelFwPackages.Clear();
|
||||
|
||||
// try
|
||||
// {
|
||||
// var url = ServiceUrls.ListAllFwPackages();
|
||||
// var requestResponse = LocalWebRequest.GetRequest(url, 10000);
|
||||
// if (string.IsNullOrEmpty(requestResponse))
|
||||
// {
|
||||
// DbIsConnected = false;
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// DbIsConnected = true;
|
||||
// DbCordonelFwPackages = JsonConvert.DeserializeObject<List<ClusteredFile>>(requestResponse);
|
||||
// return DbCordonelFwPackages != null && DbCordonelFwPackages.Count != 0;
|
||||
// }
|
||||
// catch (Exception)
|
||||
// {
|
||||
// DbIsConnected = false;
|
||||
// return false;
|
||||
// }
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// Load the latest FW update SW package from DB.
|
||||
/// </summary>
|
||||
@@ -809,7 +771,7 @@ namespace Xylem.ServiceFwUpdate.Common.FwUpdateDb
|
||||
JsonConvert.DeserializeObject<List<CordonelFwPackageInfo>>(requestResponse);
|
||||
return DbCordonelFwPackagesInfo != null && DbCordonelFwPackagesInfo.Count != 0;
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (Exception)
|
||||
{
|
||||
DbIsConnected = false;
|
||||
return false;
|
||||
|
||||
@@ -78,9 +78,9 @@ namespace Xylem.ServiceFwUpdate.Ui.FwUpdateBuilder.Const
|
||||
GetCordonelSerialNumbersFromDb,
|
||||
|
||||
/// <summary>
|
||||
/// Load all available FW packages from DB
|
||||
/// Load all available FW packages information from DB
|
||||
/// </summary>
|
||||
GetFwPackagesFromDb,
|
||||
GetFwPackagesInfosFromDb,
|
||||
|
||||
/// <summary>
|
||||
/// Load all registered update operators from DB
|
||||
@@ -98,7 +98,7 @@ namespace Xylem.ServiceFwUpdate.Ui.FwUpdateBuilder.Const
|
||||
UserRegistration,
|
||||
|
||||
/// <summary>
|
||||
/// Updatedata tables
|
||||
/// Update data tables
|
||||
/// </summary>
|
||||
UpdateDataTables,
|
||||
|
||||
|
||||
@@ -151,13 +151,12 @@ namespace Xylem.ServiceFwUpdate.Ui.FwUpdateBuilder
|
||||
/// </summary>
|
||||
private readonly List<CordonelDeviceInfo> _cordonelUpdateList = new List<CordonelDeviceInfo>();
|
||||
|
||||
//private String _fwPackageCordonelPcbId;
|
||||
|
||||
///<summary>
|
||||
/// The FW-Update package is a collection of all needed applications and settings to install into the Cordonel!
|
||||
/// This information will be passed to the FW-Update SW if any Cordonel requires this package.
|
||||
/// </summary>
|
||||
private CordonelFirmware _fwUpdatePackage = new CordonelFirmware();
|
||||
|
||||
///<summary>
|
||||
/// All Cordonel FW package information needed to select the right package for installation! This is going to be
|
||||
/// filled with information from the read packages from DB.
|
||||
@@ -170,6 +169,7 @@ namespace Xylem.ServiceFwUpdate.Ui.FwUpdateBuilder
|
||||
private readonly List<String> _regionSearchItems = new List<String>();
|
||||
private readonly List<String> _radioSearchItems = new List<String>();
|
||||
private readonly List<String> _sizeSearchItems = new List<String>();
|
||||
|
||||
///<summary>
|
||||
/// The FW-Update update capability is internally used to check core revision, metrology, region, frequency a.s.o.
|
||||
/// This information will only be used by the FW Update Builder!
|
||||
@@ -186,7 +186,6 @@ namespace Xylem.ServiceFwUpdate.Ui.FwUpdateBuilder
|
||||
private String _fwUpdateSafeName;
|
||||
private FwUpdateSafeDb _fwUpdateSafeDb;
|
||||
private Int32 _updateOperatorId;
|
||||
//private readonly List<MeterFwUpdateRuler> _meterFwUpdateRuler = new List<MeterFwUpdateRuler>();
|
||||
|
||||
/// <summary>
|
||||
/// Reminder to avoid repeated reading of DB contents and reset of selection if item has already been assigned
|
||||
@@ -224,7 +223,7 @@ namespace Xylem.ServiceFwUpdate.Ui.FwUpdateBuilder
|
||||
/// <summary>
|
||||
/// Name for firmware update software including the namespace
|
||||
/// </summary>
|
||||
public const String FwUpdateSwFullName = "Xylem.ServiceFwUpdate.Ui." + FwUpdateProjectName;
|
||||
private const String FwUpdateSwFullName = "Xylem.ServiceFwUpdate.Ui." + FwUpdateProjectName;
|
||||
|
||||
/// <summary>
|
||||
/// Path for FW-Update safes
|
||||
@@ -346,8 +345,8 @@ namespace Xylem.ServiceFwUpdate.Ui.FwUpdateBuilder
|
||||
LoadDbCordonelSerialNumbersTask();
|
||||
break;
|
||||
|
||||
case ProcessState.GetFwPackagesFromDb:
|
||||
LoadDbCordonelFwPackagesTask();
|
||||
case ProcessState.GetFwPackagesInfosFromDb:
|
||||
LoadDbCordonelFwPackagesInfosTask();
|
||||
break;
|
||||
|
||||
case ProcessState.DbAccessLocked:
|
||||
@@ -438,7 +437,7 @@ namespace Xylem.ServiceFwUpdate.Ui.FwUpdateBuilder
|
||||
case ProcessState.GetFwUpdateOperatorsFromDb:
|
||||
case ProcessState.GetCordonelProductionOrdersFromDb:
|
||||
case ProcessState.GetCustomersFromDb:
|
||||
case ProcessState.GetFwPackagesFromDb:
|
||||
case ProcessState.GetFwPackagesInfosFromDb:
|
||||
case ProcessState.GetCordonelSerialNumbersFromDb:
|
||||
case ProcessState.GetFwUpdateSafesInfosFromDb:
|
||||
case ProcessState.GetReportsFromDb:
|
||||
@@ -687,7 +686,7 @@ namespace Xylem.ServiceFwUpdate.Ui.FwUpdateBuilder
|
||||
UiInvoker.ToolStripLabelInvoker(lblStatusDbConnect, ColorSuccess, Resources.StrReadingFwPackages);
|
||||
SetStatusProgressBar();
|
||||
_dbAccessDelayCtrMs = 0;
|
||||
_processState = ProcessState.GetFwPackagesFromDb;
|
||||
_processState = ProcessState.GetFwPackagesInfosFromDb;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -779,7 +778,7 @@ namespace Xylem.ServiceFwUpdate.Ui.FwUpdateBuilder
|
||||
{
|
||||
// Load fw packages only if not selected indicated in count
|
||||
if (_fwUpdatePackage?.FwPackageInfo != null ||
|
||||
(_fwUpdateDbAccess?.DbCordonelFwPackagesInfo != null &&
|
||||
(_fwUpdateDbAccess?.DbCordonelFwPackagesInfo != null &&
|
||||
_fwUpdateDbAccess.DbCordonelFwPackagesInfo.Count > 0))
|
||||
return;
|
||||
|
||||
@@ -788,7 +787,7 @@ namespace Xylem.ServiceFwUpdate.Ui.FwUpdateBuilder
|
||||
UiInvoker.ToolStripLabelInvoker(lblStatusDbConnect, ColorSuccess, Resources.StrReadingFwPackages);
|
||||
SetStatusProgressBar();
|
||||
_dbAccessDelayCtrMs = 0;
|
||||
_processState = ProcessState.GetFwPackagesFromDb;
|
||||
_processState = ProcessState.GetFwPackagesInfosFromDb;
|
||||
}
|
||||
|
||||
if (e.TabPage == tabPageUpdateOperator)
|
||||
@@ -1199,7 +1198,7 @@ namespace Xylem.ServiceFwUpdate.Ui.FwUpdateBuilder
|
||||
/// - Register recovery implemented,
|
||||
/// - FW information taken from fields instead of the name.
|
||||
/// </remarks>
|
||||
public Boolean BuildFwUpdateSafe()
|
||||
private Boolean BuildFwUpdateSafe()
|
||||
{
|
||||
if (string.IsNullOrEmpty(lblUpdateOperator.Text))
|
||||
return false;
|
||||
@@ -1391,7 +1390,7 @@ namespace Xylem.ServiceFwUpdate.Ui.FwUpdateBuilder
|
||||
/// <remarks date="2021-Apr-01" author="Thomas Wiedebusch">
|
||||
/// - Password container directly assigned.
|
||||
/// </remarks>
|
||||
public void CompleteCordonelDeviceInfos()
|
||||
private void CompleteCordonelDeviceInfos()
|
||||
{
|
||||
// establish DB connection with dummy request
|
||||
_fwUpdateDbAccess?.DownloadCordonelPwdFromDb("0", out _);
|
||||
@@ -1512,7 +1511,7 @@ namespace Xylem.ServiceFwUpdate.Ui.FwUpdateBuilder
|
||||
string.IsNullOrEmpty(fw.RadioFrequencyMhz.ToString())) &&
|
||||
requiredCoreVersion <= fw.CoreRevisionMax &&
|
||||
requiredCoreVersion >= fw.CoreRevisionMin &&
|
||||
cordonel.Diameter == fw.MeterSize)
|
||||
cordonel.Diameter == fw.MeterSize)
|
||||
{
|
||||
cordonel.IsRemoved = false;
|
||||
cordonel.IsApproved = true;
|
||||
@@ -1793,7 +1792,7 @@ namespace Xylem.ServiceFwUpdate.Ui.FwUpdateBuilder
|
||||
|
||||
// Selected FW-Packages -----------------------------------------------------------------------------------
|
||||
// Add fw packages to fw package selection combo box for Cordonel FW to install selection
|
||||
if (_fwUpdateDbAccess?.DbCordonelFwPackages != null && _fwUpdatePackage?.FwPackageInfo != null &&
|
||||
if (_fwUpdateDbAccess?.DbCordonelFwPackage != null && _fwUpdatePackage?.FwPackageInfo != null &&
|
||||
_cbxFwReleaseSelection != null)
|
||||
{
|
||||
if (_cbxFwReleaseSelection.Items.Count < 1)
|
||||
@@ -2579,21 +2578,12 @@ namespace Xylem.ServiceFwUpdate.Ui.FwUpdateBuilder
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Acquire all FW packages from DB.
|
||||
/// Acquire all FW packages infos from DB.
|
||||
/// </summary>
|
||||
/// <remarks date="2021-Apr-08" author="Thomas Wiedebusch">
|
||||
/// - Initial
|
||||
/// </remarks>
|
||||
/// <remarks date="2021-Oct-26" author="Thomas Wiedebusch">
|
||||
/// - Load configuration files from DB as the latest MeterFwUpdateRuler.json is needed for the
|
||||
/// FwUpdateBuilder FW package check and validation routine! This step has to be done in advance
|
||||
/// to the FW package load, as the Builder uses the information of the MeterFwUpdateRuler to
|
||||
/// create the package information!
|
||||
/// </remarks>
|
||||
/// <remarks date="2022-Nov-30" author="Thomas Wiedebusch">
|
||||
/// - Load only the information about the FW packages and not the FW package content.
|
||||
/// - Initial.
|
||||
/// </remarks>
|
||||
private void LoadDbCordonelFwPackagesTask()
|
||||
private void LoadDbCordonelFwPackagesInfosTask()
|
||||
{
|
||||
_invokerProcessState = _processState;
|
||||
Task.Factory.StartNew(() =>
|
||||
@@ -2604,10 +2594,8 @@ namespace Xylem.ServiceFwUpdate.Ui.FwUpdateBuilder
|
||||
{
|
||||
// check DB connection in advance to overcome the timing issues for DB service startup
|
||||
_fwUpdateDbAccess.CheckDbConnection();
|
||||
// has to be done first to extract the MeterFwUpdateRuler
|
||||
//GetFwUpdateConfigFilesFromDb();
|
||||
// load the packages and use the MeterFwUpdateRuler to assign the DN, EMEA, NA, 868, 433..
|
||||
GetCordonelFwPackagesFromDb();
|
||||
// load the packages information
|
||||
GetCordonelFwPackagesInfosFromDb();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
@@ -2846,7 +2834,7 @@ namespace Xylem.ServiceFwUpdate.Ui.FwUpdateBuilder
|
||||
try
|
||||
{
|
||||
|
||||
if (e.ColumnIndex < 0 || e.RowIndex < 0 )
|
||||
if (e.ColumnIndex < 0 || e.RowIndex < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -2861,7 +2849,7 @@ namespace Xylem.ServiceFwUpdate.Ui.FwUpdateBuilder
|
||||
for (var columnIndex = 0; columnIndex < gridViewFwPackageSelection.ColumnCount; columnIndex++)
|
||||
{
|
||||
if (gridViewFwPackageSelection.Columns[columnIndex].Name == Resources.StrTableFileId)
|
||||
fwPackage.FwPackageInfo.Id =
|
||||
fwPackage.FwPackageInfo.Id =
|
||||
(Int32)gridViewFwPackageSelection.Rows[e.RowIndex].Cells[columnIndex].Value;
|
||||
}
|
||||
|
||||
@@ -2884,9 +2872,10 @@ namespace Xylem.ServiceFwUpdate.Ui.FwUpdateBuilder
|
||||
{
|
||||
cordonel.RequiredRelease = null;
|
||||
}
|
||||
|
||||
// Search the FW package Id in data table, select if found
|
||||
//foreach (var fw in _cordonelFwPackageInfoSearch)
|
||||
if (_fwUpdateDbAccess?.DbCordonelFwPackagesInfo == null) return;
|
||||
if (_fwUpdateDbAccess?.DbCordonelFwPackagesInfo == null)
|
||||
return;
|
||||
foreach (var fw in _fwUpdateDbAccess.DbCordonelFwPackagesInfo)
|
||||
{
|
||||
if (fw.Id == fwPackage.FwPackageInfo.Id)
|
||||
@@ -2977,7 +2966,8 @@ namespace Xylem.ServiceFwUpdate.Ui.FwUpdateBuilder
|
||||
|
||||
try
|
||||
{
|
||||
if (_fwUpdateDbAccess?.DbCordonelFwPackagesInfo == null) return;
|
||||
if (_fwUpdateDbAccess?.DbCordonelFwPackagesInfo == null)
|
||||
return;
|
||||
foreach (var fw in _fwUpdateDbAccess.DbCordonelFwPackagesInfo)
|
||||
{
|
||||
// pre-selection of displayed FW packages
|
||||
@@ -2992,7 +2982,7 @@ namespace Xylem.ServiceFwUpdate.Ui.FwUpdateBuilder
|
||||
if ((fw.Region != cbxFwPackageRegionMask.Text && cbxFwPackageRegionMask.Text != Constants.StrWildcard) ||
|
||||
(fw.RadioFrequencyMhz.ToString() != cbxFwPackageRadioMask.Text && cbxFwPackageRadioMask.Text != Constants.StrWildcard) ||
|
||||
(fw.MeterSize != cbxFwPackageSizeMask.Text && cbxFwPackageSizeMask.Text != Constants.StrWildcard) ||
|
||||
(((fw.CoreRevisionMin != null && fw.CoreRevisionMin > requiredCoreVersion) ||
|
||||
(((fw.CoreRevisionMin != null && fw.CoreRevisionMin > requiredCoreVersion) ||
|
||||
(fw.CoreRevisionMax != null && requiredCoreVersion > fw.CoreRevisionMax)) &&
|
||||
cbxFwPackageSearchCore.Text != Constants.StrWildcard) ||
|
||||
(fw.MetrologyVersion.ToString() != cbxFwPackageSearchMetrology.Text &&
|
||||
@@ -3009,7 +2999,7 @@ namespace Xylem.ServiceFwUpdate.Ui.FwUpdateBuilder
|
||||
row[Resources.StrTableRadioFrequency] = fw.RadioFrequencyMhz == null ? Constants.StrWildcard : $@"{fw.RadioFrequencyMhz}";
|
||||
row[Resources.StrTableCordonelMetrology] = MeterFwUpdate.ConvertVersionToString(fw.MetrologyVersion);
|
||||
row[Resources.StrTableFwPackageCoreMin] = MeterFwUpdate.ConvertVersionToString(fw.CoreRevisionMin);
|
||||
row[Resources.StrTableFwPackageCoreMax] = MeterFwUpdate.ConvertVersionToString(fw.CoreRevisionMax);
|
||||
row[Resources.StrTableFwPackageCoreMax] = MeterFwUpdate.ConvertVersionToString(fw.CoreRevisionMax);
|
||||
|
||||
row[Resources.StrTableCordonelDiameter] = fw.MeterSize ?? Constants.StrWildcard;
|
||||
if (fw.ReleaseDate != null)
|
||||
@@ -3887,7 +3877,7 @@ namespace Xylem.ServiceFwUpdate.Ui.FwUpdateBuilder
|
||||
var row = _dataTableCordonels.NewRow();
|
||||
row[Resources.StrTableSelect] = cordSearch.IsSelected;
|
||||
|
||||
row[Resources.StrTableCordonelCustomerSerialNumber] = cordSearch.CustomerSerialNumber ??
|
||||
row[Resources.StrTableCordonelCustomerSerialNumber] = cordSearch.CustomerSerialNumber ??
|
||||
Constants.StrUnknown;
|
||||
row[Resources.StrTableCordonelPcbId] = cordSearch.PcbId ?? Constants.StrUnknown;
|
||||
|
||||
@@ -4508,10 +4498,11 @@ namespace Xylem.ServiceFwUpdate.Ui.FwUpdateBuilder
|
||||
/// - Removed FUpdateRuler, all data are going to be taken from DB,
|
||||
/// - file name no longer used to identify capability of release, all information from DB.
|
||||
/// </remarks>
|
||||
private void GetCordonelFwPackagesFromDb()
|
||||
private void GetCordonelFwPackagesInfosFromDb()
|
||||
{
|
||||
if (_fwUpdateDbAccess == null) return;
|
||||
_fwUpdateDbAccess.GetAllCordonelFwPackagesInfoFromDb();
|
||||
if (_fwUpdateDbAccess == null)
|
||||
return;
|
||||
_fwUpdateDbAccess.GetAllCordonelFwPackagesInfoFromDb();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -5155,61 +5146,69 @@ namespace Xylem.ServiceFwUpdate.Ui.FwUpdateBuilder
|
||||
}
|
||||
|
||||
String msg;
|
||||
// search file id in ClusteredFiles but as the name in unambiguous and files are stored several times
|
||||
// with this file name, the last and therefore latest item has to be taken
|
||||
if (_fwUpdateDbAccess?.DbCordonelFwPackages != null)
|
||||
var fileId = 0;
|
||||
// extract the clustered file Id from selected fw package
|
||||
foreach (var packInfo in _fwUpdateDbAccess.DbCordonelFwPackagesInfo)
|
||||
{
|
||||
var fileId = (from cu in _fwUpdateDbAccess.DbCordonelFwPackages
|
||||
where cu.FileName == releaseName
|
||||
select cu.FileId).LastOrDefault();
|
||||
// fill up fw package info
|
||||
if (!packInfo.IsSelected)
|
||||
continue;
|
||||
|
||||
if (_fwUpdateDbAccess.GetCordonelFwPackageFromDb(fileId, out var fwPackage))
|
||||
fileId = packInfo.FileClusterStoreId;
|
||||
_fwUpdatePackage.FwPackageInfo.Name = packInfo.Name;
|
||||
_fwUpdatePackage.FwPackageInfo.RadioFrequencyMhz = packInfo.RadioFrequencyMhz;
|
||||
_fwUpdatePackage.FwPackageInfo.MeterSize = packInfo.MeterSize;
|
||||
_fwUpdatePackage.FwPackageInfo.Region = packInfo.Region;
|
||||
_fwUpdatePackage.FwPackageInfo.CoreRevisionMax = packInfo.CoreRevisionMax;
|
||||
_fwUpdatePackage.FwPackageInfo.CoreRevisionMin = packInfo.CoreRevisionMin;
|
||||
_fwUpdatePackage.FwPackageInfo.MetrologyVersion = packInfo.MetrologyVersion;
|
||||
_fwUpdatePackage.FwPackageInfo.Version = packInfo.Version;
|
||||
_fwUpdatePackage.FwPackageInfo.FileName = packInfo.FileName;
|
||||
break;
|
||||
}
|
||||
if (_fwUpdateDbAccess.GetCordonelFwPackageFromDb(fileId, out var fwPackage))
|
||||
{
|
||||
try
|
||||
{
|
||||
try
|
||||
// search the cordonel firmware
|
||||
_fwUpdatePackage.PackageDescriptionFile = new FilePart();
|
||||
_fwUpdatePackage.BinaryApplicationFiles = new List<FilePart>();
|
||||
|
||||
foreach (var f in fwPackage)
|
||||
{
|
||||
// search the cordonel firmware
|
||||
if (_fwUpdatePackage.FwPackageInfo.Name == releaseName)
|
||||
// load the ADF
|
||||
if (f.FileName.Contains("product") && f.FileName.EndsWith(".txt"))
|
||||
{
|
||||
_fwUpdatePackage.PackageDescriptionFile = new FilePart();
|
||||
_fwUpdatePackage.BinaryApplicationFiles = new List<FilePart>();
|
||||
_fwUpdatePackage.PackageDescriptionFile.FileName = f.FileName;
|
||||
_fwUpdatePackage.PackageDescriptionFile.FileContent = new Byte[f.FileContent.Length];
|
||||
_fwUpdatePackage.PackageDescriptionFile.FileContent = f.FileContent.ToArray();
|
||||
}
|
||||
|
||||
foreach (var f in fwPackage)
|
||||
// load the binaries
|
||||
if (f.FileName.Contains("binfile") && f.FileName.EndsWith(".bin"))
|
||||
{
|
||||
var filePart = new FilePart
|
||||
{
|
||||
// load the ADF
|
||||
if (f.FileName.Contains("product") && f.FileName.EndsWith(".txt"))
|
||||
{
|
||||
_fwUpdatePackage.PackageDescriptionFile.FileName = f.FileName;
|
||||
_fwUpdatePackage.PackageDescriptionFile.FileContent = new Byte[f.FileContent.Length];
|
||||
_fwUpdatePackage.PackageDescriptionFile.FileContent = f.FileContent.ToArray();
|
||||
}
|
||||
|
||||
// load the binaries
|
||||
if (f.FileName.Contains("binfile") && f.FileName.EndsWith(".bin"))
|
||||
{
|
||||
var filePart = new FilePart
|
||||
{
|
||||
FileName = f.FileName,
|
||||
FileContent = new Byte[f.FileContent.Length]
|
||||
};
|
||||
filePart.FileContent = f.FileContent.ToArray();
|
||||
_fwUpdatePackage.BinaryApplicationFiles.Add(filePart);
|
||||
}
|
||||
}
|
||||
|
||||
LogSuccessText(Resources.StrFwPackageLoadSuccess + " " + releaseName);
|
||||
return true;
|
||||
FileName = f.FileName,
|
||||
FileContent = new Byte[f.FileContent.Length]
|
||||
};
|
||||
filePart.FileContent = f.FileContent.ToArray();
|
||||
_fwUpdatePackage.BinaryApplicationFiles.Add(filePart);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
msg = Resources.StrFwPackageLoadFailed + @" " + releaseName;
|
||||
LogErrorText(msg);
|
||||
MessageBoxShow(msg, Resources.StrError, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
MessageBoxShow(e.ToString(), Resources.StrError, MessageBoxButtons.OK,
|
||||
MessageBoxIcon.Error);
|
||||
_processState = ProcessState.Error;
|
||||
return false;
|
||||
}
|
||||
|
||||
LogSuccessText(Resources.StrFwPackageLoadSuccess + " " + releaseName);
|
||||
return true;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
msg = Resources.StrFwPackageLoadFailed + @" " + releaseName;
|
||||
LogErrorText(msg);
|
||||
MessageBoxShow(msg, Resources.StrError, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
MessageBoxShow(e.ToString(), Resources.StrError, MessageBoxButtons.OK,
|
||||
MessageBoxIcon.Error);
|
||||
_processState = ProcessState.Error;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
msg = Resources.StrFwPackageLoadFailed + @" " + releaseName;
|
||||
|
||||
@@ -962,8 +962,9 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw
|
||||
/// <remarks date="2020-Dec-21" author="Thomas Wiedebusch">
|
||||
/// - Error messages exported.
|
||||
/// </remarks>
|
||||
/// <remarks date="2023-Feb-17" author="Thomas Wiedebusch">
|
||||
/// - Removed information like region and size of fw update package from name of package.
|
||||
/// <remarks date="2023-Feb-18" author="Thomas Wiedebusch">
|
||||
/// - Removed information like region and size of fw update package from name of package,
|
||||
/// - Added check for null of FwPackage info, binary content and description file.
|
||||
/// </remarks>
|
||||
private void LoadUpdateFiles(ProcessState successExitState, ProcessState errorExitState = ProcessState.Error)
|
||||
{
|
||||
@@ -979,7 +980,11 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw
|
||||
|
||||
try
|
||||
{
|
||||
if (_cordonelDeviceInfos == null || _cordonelFirmwarePackage == null)
|
||||
if (_cordonelDeviceInfos == null
|
||||
|| _cordonelFirmwarePackage?.FwPackageInfo == null
|
||||
|| _cordonelFirmwarePackage.BinaryApplicationFiles == null
|
||||
|| _cordonelFirmwarePackage.BinaryApplicationFiles.Count == 0
|
||||
|| _cordonelFirmwarePackage.PackageDescriptionFile == null)
|
||||
{
|
||||
InfoProcessFailed(lblUpdateInformationStatus, Resources.StrPackageFileInvalid);
|
||||
_processState = errorExitState;
|
||||
@@ -1240,6 +1245,8 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw
|
||||
/// - MeterSize (DN40, DN50,..., DN300, US1_5, US2, US3,..., US12.
|
||||
/// If any information cannot be read from the meter, it will be assumed, that the FwUpdateBuilder operator
|
||||
/// assembled a correct FwUpdateSafe. Otherwise old devices may be unable to update.
|
||||
/// The FwPackage has to be checked in advance before calling this routine, as all these information is needed
|
||||
/// for this update capability check.
|
||||
/// </summary>
|
||||
/// <returns>true if core revision is valid</returns>
|
||||
/// <remarks date="2021-Apr-26" author="Thomas Wiedebusch">
|
||||
@@ -1257,27 +1264,76 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw
|
||||
Thread.CurrentThread.CurrentUICulture = _cultureInfo;
|
||||
Thread.CurrentThread.CurrentCulture = _cultureInfo;
|
||||
|
||||
Boolean retVal = true;
|
||||
// check the update capability for region
|
||||
var region = Constants.StrUnknown;
|
||||
if (!string.IsNullOrEmpty(_cordonelFirmwarePackage.FwPackageInfo.Region))
|
||||
{
|
||||
region = _cordonelFirmwarePackage.FwPackageInfo.Region;
|
||||
var retVal = true;
|
||||
|
||||
if (_currentGenesis.Region.Contains(region) )
|
||||
// extract the package information
|
||||
var region = _cordonelFirmwarePackage.FwPackageInfo.Region;
|
||||
var meterSize = _cordonelFirmwarePackage.FwPackageInfo.MeterSize;
|
||||
var radioFrequencyMhz = _cordonelFirmwarePackage.FwPackageInfo.RadioFrequencyMhz;
|
||||
|
||||
// region
|
||||
if (!string.IsNullOrEmpty(region))
|
||||
{
|
||||
// check the update capability for region, on undefined region accept update
|
||||
if (_currentGenesis.Region == region
|
||||
|| Constants.StrUnknown == region
|
||||
|| Constants.StrUnknown == _currentGenesis.Region)
|
||||
{
|
||||
InfoProcessSuccess(null, Resources.StrCordonelUpdateCapabilityRegionSucceeded);
|
||||
retVal = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
retVal = false;
|
||||
// set information of required and detected regions radio, check failed!
|
||||
LogText(StrSeparator);
|
||||
LogErrorText(Resources.StrFwPackageInfo + " " + region);
|
||||
LogErrorText(@"Cordonel: " + _currentGenesis.Region);
|
||||
InfoProcessFailed(lblCordonelUpdateCapability, Resources.StrCordonelUpdateCapabilityRegionFailed);
|
||||
}
|
||||
}
|
||||
// set information of required and detected regions radio, check failed!
|
||||
LogText(StrSeparator);
|
||||
LogErrorText(Resources.StrRegionRadio);
|
||||
LogErrorText(Resources.StrFwPackageRegionRadio + " " + region);
|
||||
LogErrorText(@"Cordonel: " + _currentGenesis.Region);
|
||||
InfoProcessFailed(lblCordonelUpdateCapability, Resources.StrCordonelUpdateCapabilityRegionFailed);
|
||||
_processState = ProcessState.Error;
|
||||
return false;
|
||||
|
||||
// meter size
|
||||
if (!string.IsNullOrEmpty(meterSize))
|
||||
{
|
||||
// check the update capability for meter size, on undefined meter size accept update
|
||||
if (_currentGenesis.MeterSize == meterSize
|
||||
|| Constants.StrUnknown == meterSize
|
||||
|| Constants.StrUnknown == _currentGenesis.MeterSize)
|
||||
{
|
||||
InfoProcessSuccess(null, Resources.StrCordonelUpdateCapabilityMeterSizeSucceeded);
|
||||
}
|
||||
else
|
||||
{
|
||||
retVal = false;
|
||||
// set information of required and detected regions check failed!
|
||||
LogText(StrSeparator);
|
||||
LogErrorText(Resources.StrFwPackageInfo + " " + meterSize);
|
||||
LogErrorText(@"Cordonel: " + _currentGenesis.MeterSize);
|
||||
InfoProcessFailed(lblCordonelUpdateCapability, Resources.StrCordonelUpdateCapabilityMeterSizeFailed);
|
||||
}
|
||||
}
|
||||
|
||||
// radio frequency
|
||||
// if radio frequency is null the region is "NA" or the fw package serves all frequencies
|
||||
if (radioFrequencyMhz == null) return retVal;
|
||||
|
||||
// if the radio frequency is required, it has to be verified against the preset value in the Cordonel
|
||||
if (radioFrequencyMhz == _currentGenesis.RadioFrequencyMhz)
|
||||
{
|
||||
InfoProcessSuccess(null, Resources.StrCordonelUpdateCapabilityRadioSucceeded);
|
||||
}
|
||||
else
|
||||
{
|
||||
retVal = false;
|
||||
// set information of required and detected radio frequency check failed!
|
||||
LogText(StrSeparator);
|
||||
LogErrorText(Resources.StrFwPackageInfo + " " + radioFrequencyMhz + " MHz");
|
||||
LogErrorText(@"Cordonel: " + _currentGenesis.RadioFrequencyMhz + " MHz");
|
||||
InfoProcessFailed(lblCordonelUpdateCapability, Resources.StrCordonelUpdateCapabilityRadioFailed);
|
||||
}
|
||||
|
||||
if (!retVal) _processState = ProcessState.Error;
|
||||
return retVal;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1448,7 +1504,7 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw
|
||||
// read initially if radio is already active in customer mode 2
|
||||
if ( 2 == RegisterConverter.ConvertTo<Int32>(_currentGenesis.ReadRegister(Register.Sensusradio.SystemState)))
|
||||
{
|
||||
LogSuccessText(Resources.StrRadioActivationSuccess);
|
||||
LogSuccessText(Resources.StrRadioAlreadyActive);
|
||||
retVal = true;
|
||||
}
|
||||
else // switch radio active
|
||||
|
||||
@@ -170,7 +170,25 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw.Properties {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Update denied due to deviating GENESISFLOW version!.
|
||||
/// Looks up a localized string similar to Update denied: Deviating meter size!.
|
||||
/// </summary>
|
||||
internal static string StrCordonelUpdateCapabilityMeterSizeFailed {
|
||||
get {
|
||||
return ResourceManager.GetString("StrCordonelUpdateCapabilityMeterSizeFailed", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Meter size is approved!.
|
||||
/// </summary>
|
||||
internal static string StrCordonelUpdateCapabilityMeterSizeSucceeded {
|
||||
get {
|
||||
return ResourceManager.GetString("StrCordonelUpdateCapabilityMeterSizeSucceeded", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Update denied: Deviating metrology version!.
|
||||
/// </summary>
|
||||
internal static string StrCordonelUpdateCapabilityMetrologyFailed {
|
||||
get {
|
||||
@@ -188,7 +206,25 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw.Properties {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Update denied due to region or radio frequency!.
|
||||
/// Looks up a localized string similar to Update denied: Deviating radio frequency!.
|
||||
/// </summary>
|
||||
internal static string StrCordonelUpdateCapabilityRadioFailed {
|
||||
get {
|
||||
return ResourceManager.GetString("StrCordonelUpdateCapabilityRadioFailed", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Radio frequency is approved!.
|
||||
/// </summary>
|
||||
internal static string StrCordonelUpdateCapabilityRadioSucceeded {
|
||||
get {
|
||||
return ResourceManager.GetString("StrCordonelUpdateCapabilityRadioSucceeded", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Update denied: Deviating region!.
|
||||
/// </summary>
|
||||
internal static string StrCordonelUpdateCapabilityRegionFailed {
|
||||
get {
|
||||
@@ -197,7 +233,7 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw.Properties {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Region and radio frequency is approved!.
|
||||
/// Looks up a localized string similar to Region is approved!.
|
||||
/// </summary>
|
||||
internal static string StrCordonelUpdateCapabilityRegionSucceeded {
|
||||
get {
|
||||
@@ -242,7 +278,7 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw.Properties {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Display released to normal operation..
|
||||
/// Looks up a localized string similar to Display released to accumulator- and flow-display..
|
||||
/// </summary>
|
||||
internal static string StrDisplayReleased {
|
||||
get {
|
||||
@@ -460,9 +496,9 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw.Properties {
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to FW-Package:.
|
||||
/// </summary>
|
||||
internal static string StrFwPackageRegionRadio {
|
||||
internal static string StrFwPackageInfo {
|
||||
get {
|
||||
return ResourceManager.GetString("StrFwPackageRegionRadio", resourceCulture);
|
||||
return ResourceManager.GetString("StrFwPackageInfo", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -818,7 +854,7 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw.Properties {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Failed to activate the radio!.
|
||||
/// Looks up a localized string similar to Failed to activate the radio in customer mode!.
|
||||
/// </summary>
|
||||
internal static string StrRadioActivationFailed {
|
||||
get {
|
||||
@@ -827,7 +863,7 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw.Properties {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Successfully activated the radio..
|
||||
/// Looks up a localized string similar to Successfully activated the radio in customer mode..
|
||||
/// </summary>
|
||||
internal static string StrRadioActivationSuccess {
|
||||
get {
|
||||
@@ -835,6 +871,15 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Radio is in customer mode..
|
||||
/// </summary>
|
||||
internal static string StrRadioAlreadyActive {
|
||||
get {
|
||||
return ResourceManager.GetString("StrRadioAlreadyActive", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Device reboot timeout! Press [Connect]!.
|
||||
/// </summary>
|
||||
@@ -844,15 +889,6 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Region and radio frequency [MHz]:.
|
||||
/// </summary>
|
||||
internal static string StrRegionRadio {
|
||||
get {
|
||||
return ResourceManager.GetString("StrRegionRadio", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Configuration access active.....
|
||||
/// </summary>
|
||||
|
||||
@@ -154,10 +154,7 @@
|
||||
<data name="StrCoreRevision" xml:space="preserve">
|
||||
<value>Systemkern-Version:</value>
|
||||
</data>
|
||||
<data name="StrRegionRadio" xml:space="preserve">
|
||||
<value>Region und Funkfrequenz [MHz]:</value>
|
||||
</data>
|
||||
<data name="StrFwPackageRegionRadio" xml:space="preserve">
|
||||
<data name="StrFwPackageInfo" xml:space="preserve">
|
||||
<value>FW-Paket:</value>
|
||||
</data>
|
||||
<data name="StrNotConnected" xml:space="preserve">
|
||||
@@ -206,10 +203,22 @@
|
||||
<value>Metrologieversion ist genehmigt.</value>
|
||||
</data>
|
||||
<data name="StrCordonelUpdateCapabilityRegionFailed" xml:space="preserve">
|
||||
<value>Update verweigert: Region oder Funkfrequenz inkompatibel!</value>
|
||||
<value>Update verweigert: Unterschiedliche Region!</value>
|
||||
</data>
|
||||
<data name="StrCordonelUpdateCapabilityRegionSucceeded" xml:space="preserve">
|
||||
<value>Region und Funkfrequenz genehmigt!</value>
|
||||
<value>Region bestätigt!</value>
|
||||
</data>
|
||||
<data name="StrCordonelUpdateCapabilityMeterSizeFailed" xml:space="preserve">
|
||||
<value>Update verweigert: Unterschiedliche Baugröße!</value>
|
||||
</data>
|
||||
<data name="StrCordonelUpdateCapabilityMeterSizeSucceeded" xml:space="preserve">
|
||||
<value>Baugröße bestätigt!</value>
|
||||
</data>
|
||||
<data name="StrCordonelUpdateCapabilityRadioFailed" xml:space="preserve">
|
||||
<value>Update verweigert: Unterschiedliche Funkfrequenz!</value>
|
||||
</data>
|
||||
<data name="StrCordonelUpdateCapabilityRadioSucceeded" xml:space="preserve">
|
||||
<value>Funkfrequenz bestätigt!</value>
|
||||
</data>
|
||||
<data name="StrCordonelUpdateCapabilitySucceeded" xml:space="preserve">
|
||||
<value>Update freigegeben.</value>
|
||||
@@ -509,12 +518,15 @@
|
||||
<value>Einstellungen erfolgreich gesichert.</value>
|
||||
</data>
|
||||
<data name="StrRadioActivationFailed" xml:space="preserve">
|
||||
<value>Funk konnte nicht eingeschaltet werden!</value>
|
||||
<value>Funk konnte nicht in Kundenmodus geschaltet werden!</value>
|
||||
</data>
|
||||
<data name="StrRadioAlreadyActive" xml:space="preserve">
|
||||
<value>Funk ist bereits im Kundenmodus.</value>
|
||||
</data>
|
||||
<data name="StrRadioActivationSuccess" xml:space="preserve">
|
||||
<value>Funk erfolgreich eingeschaltet.</value>
|
||||
<value>Funk erfolgreich auf Kundenmodus geschaltet.</value>
|
||||
</data>
|
||||
<data name="StrDisplayReleased" xml:space="preserve">
|
||||
<value>Display freigegeben für Standardoperation.</value>
|
||||
<value>Display freigegeben für Volumen- und Durchflußanzeige.</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -154,10 +154,7 @@
|
||||
<data name="StrCoreRevision" xml:space="preserve">
|
||||
<value>System core revision:</value>
|
||||
</data>
|
||||
<data name="StrRegionRadio" xml:space="preserve">
|
||||
<value>Region and radio frequency [MHz]:</value>
|
||||
</data>
|
||||
<data name="StrFwPackageRegionRadio" xml:space="preserve">
|
||||
<data name="StrFwPackageInfo" xml:space="preserve">
|
||||
<value>FW-Package:</value>
|
||||
</data>
|
||||
<data name="StrNotConnected" xml:space="preserve">
|
||||
@@ -200,16 +197,28 @@
|
||||
<value>Core version is compatible.</value>
|
||||
</data>
|
||||
<data name="StrCordonelUpdateCapabilityMetrologyFailed" xml:space="preserve">
|
||||
<value>Update denied due to deviating GENESISFLOW version!</value>
|
||||
<value>Update denied: Deviating metrology version!</value>
|
||||
</data>
|
||||
<data name="StrCordonelUpdateCapabilityMetrologySucceeded" xml:space="preserve">
|
||||
<value>Metrology version is approved</value>
|
||||
</data>
|
||||
<data name="StrCordonelUpdateCapabilityRegionFailed" xml:space="preserve">
|
||||
<value>Update denied due to region or radio frequency!</value>
|
||||
<value>Update denied: Deviating region!</value>
|
||||
</data>
|
||||
<data name="StrCordonelUpdateCapabilityRegionSucceeded" xml:space="preserve">
|
||||
<value>Region and radio frequency is approved!</value>
|
||||
<value>Region is approved!</value>
|
||||
</data>
|
||||
<data name="StrCordonelUpdateCapabilityMeterSizeFailed" xml:space="preserve">
|
||||
<value>Update denied: Deviating meter size!</value>
|
||||
</data>
|
||||
<data name="StrCordonelUpdateCapabilityMeterSizeSucceeded" xml:space="preserve">
|
||||
<value>Meter size is approved!</value>
|
||||
</data>
|
||||
<data name="StrCordonelUpdateCapabilityRadioFailed" xml:space="preserve">
|
||||
<value>Update denied: Deviating radio frequency!</value>
|
||||
</data>
|
||||
<data name="StrCordonelUpdateCapabilityRadioSucceeded" xml:space="preserve">
|
||||
<value>Radio frequency is approved!</value>
|
||||
</data>
|
||||
<data name="StrCordonelUpdateCapabilitySucceeded" xml:space="preserve">
|
||||
<value>Update capability validated.</value>
|
||||
@@ -509,12 +518,15 @@
|
||||
<value>Successfully stored configurations.</value>
|
||||
</data>
|
||||
<data name="StrRadioActivationFailed" xml:space="preserve">
|
||||
<value>Failed to activate the radio!</value>
|
||||
<value>Failed to activate the radio in customer mode!</value>
|
||||
</data>
|
||||
<data name="StrRadioAlreadyActive" xml:space="preserve">
|
||||
<value>Radio is in customer mode.</value>
|
||||
</data>
|
||||
<data name="StrRadioActivationSuccess" xml:space="preserve">
|
||||
<value>Successfully activated the radio.</value>
|
||||
<value>Successfully activated the radio in customer mode.</value>
|
||||
</data>
|
||||
<data name="StrDisplayReleased" xml:space="preserve">
|
||||
<value>Display released to normal operation.</value>
|
||||
<value>Display released to accumulator- and flow-display.</value>
|
||||
</data>
|
||||
</root>
|
||||
Reference in New Issue
Block a user