FwUpdateBuilder: - FW-package search preset to information from selected Cordonel to simplify the selection

This commit is contained in:
Thomas Wiedebusch
2023-02-21 10:01:42 +01:00
parent 94d9b1f02e
commit f9363f990a
7 changed files with 1371 additions and 1358 deletions
@@ -17,7 +17,7 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile
/// The name of the metrology application.
/// </summary>
public const String MetrologyName = "GENESISFLOW";
/// <summary>
/// Checks if the metrology upgrade is allowed or the version is already installed.
/// The application description file "ADF" has to be read in advance as this contains the "GENSISFLOW" version.
@@ -1748,6 +1748,10 @@ namespace Xylem.ServiceFwUpdate.Ui.FwUpdateBuilder
/// <remarks date="2022-Nov-29" author="Thomas Wiedebusch">
/// - Single FW-Update package.
/// </remarks>
/// <remarks date="2023-Feb-21" author="Thomas Wiedebusch">
/// - Preselect the search mask with last search items set by Cordonel selection to simplify the initial
/// FW-package selection.
/// </remarks>
private void CheckDataCollectionStatus()
{
// Customer Orders ----------------------------------------------------------------------------------------
@@ -1881,62 +1885,67 @@ namespace Xylem.ServiceFwUpdate.Ui.FwUpdateBuilder
if (_radioSearchItems.Count + 1 != cbxFwPackageRadioMask.Items.Count)
{
cbxFwPackageRadioMask.Items.Clear();
cbxFwPackageRadioMask.Text = Constants.StrWildcard;
cbxFwPackageRadioMask.Items.Add(Constants.StrWildcard);
foreach (var item in _radioSearchItems)
{
if (!string.IsNullOrEmpty(item) && item != Constants.StrUnknown)
cbxFwPackageRadioMask.Items.Add(item);
}
var index = cbxFwPackageRadioMask.Items.Count - 1;
cbxFwPackageRadioMask.Text = cbxFwPackageRadioMask.Items[index].ToString();
}
// check if FW packages are loaded from DB and parsed to the search info to extract region info
if (_regionSearchItems.Count + 1 != cbxFwPackageRegionMask.Items.Count)
{
cbxFwPackageRegionMask.Items.Clear();
cbxFwPackageRegionMask.Text = Constants.StrWildcard;
cbxFwPackageRegionMask.Items.Add(Constants.StrWildcard);
foreach (var item in _regionSearchItems)
{
if (!string.IsNullOrEmpty(item) && item != Constants.StrUnknown)
cbxFwPackageRegionMask.Items.Add(item);
}
var index = cbxFwPackageRegionMask.Items.Count - 1;
cbxFwPackageRegionMask.Text = cbxFwPackageRegionMask.Items[index].ToString();
}
// check if FW packages are loaded from DB and parsed to the search info to extract size info
if (_sizeSearchItems.Count + 1 != cbxFwPackageSizeMask.Items.Count)
{
cbxFwPackageSizeMask.Items.Clear();
cbxFwPackageSizeMask.Text = Constants.StrWildcard;
cbxFwPackageSizeMask.Items.Add(Constants.StrWildcard);
foreach (var item in _sizeSearchItems)
{
if (!string.IsNullOrEmpty(item) && item != Constants.StrUnknown)
cbxFwPackageSizeMask.Items.Add(item);
}
var index = cbxFwPackageSizeMask.Items.Count - 1;
cbxFwPackageSizeMask.Text = cbxFwPackageSizeMask.Items[index].ToString();
}
// check if FW packages are loaded from DB and parsed to the search info to extract metrology info
if (_metrologySearchItems.Count + 1 != cbxFwPackageSearchMetrology.Items.Count)
{
cbxFwPackageSearchMetrology.Items.Clear();
cbxFwPackageSearchMetrology.Text = Constants.StrWildcard;
cbxFwPackageSearchMetrology.Items.Add(Constants.StrWildcard);
foreach (var item in _metrologySearchItems)
{
if (!string.IsNullOrEmpty(item) && item != Constants.StrUnknown)
cbxFwPackageSearchMetrology.Items.Add(item);
}
var index = cbxFwPackageSearchMetrology.Items.Count - 1;
cbxFwPackageSearchMetrology.Text = cbxFwPackageSearchMetrology.Items[index].ToString();
}
// check if FW packages are loaded from DB and parsed to the search info to extract core info
if (_coreSearchItems.Count + 1 != cbxFwPackageSearchCore.Items.Count)
{
cbxFwPackageSearchCore.Items.Clear();
cbxFwPackageSearchCore.Text = Constants.StrWildcard;
cbxFwPackageSearchCore.Items.Add(Constants.StrWildcard);
foreach (var item in _coreSearchItems)
{
if (!string.IsNullOrEmpty(item) && item != Constants.StrUnknown)
cbxFwPackageSearchCore.Items.Add(item);
}
var index = cbxFwPackageSearchCore.Items.Count - 1;
cbxFwPackageSearchCore.Text = cbxFwPackageSearchCore.Items[index].ToString();
}
// FW-Update Order Number ---------------------------------------------------------------------------------
@@ -3760,6 +3769,11 @@ namespace Xylem.ServiceFwUpdate.Ui.FwUpdateBuilder
/// - Moved masks from PreBuildSummery tab to Cordonel selection tab,
/// - Removed trigger to update PreBuildSummery.
/// </remarks>
/// <remarks date="2023-Feb-21" author="Thomas Wiedebusch">
/// - Search items for FW-Package selection forced to simply have one core version, one meter size,
/// one region and one metrology version as only identical Cordonels should be placed to one safe
/// according to the one FW-Package policy.
/// </remarks>
private void gridViewCordonelsSelection_CellClick(Object sender, DataGridViewCellEventArgs e)
{
try
@@ -3790,33 +3804,33 @@ namespace Xylem.ServiceFwUpdate.Ui.FwUpdateBuilder
if (cordSearch.PcbId == cordSelect.PcbId)
{
// fill search masks for FW package selection
if (!string.IsNullOrEmpty(cordSearch.Diameter) && cordSearch.Diameter != Constants.StrUnknown &&
!_sizeSearchItems.Contains(cordSearch.Diameter))
if (!string.IsNullOrEmpty(cordSearch.Diameter) && cordSearch.Diameter != Constants.StrUnknown)
{
_sizeSearchItems.Clear();
_sizeSearchItems.Add(cordSearch.Diameter);
}
// fill search masks for FW package selection
if (!string.IsNullOrEmpty(cordSearch.RadioFrequency) && cordSearch.RadioFrequency != Constants.StrUnknown &&
!_radioSearchItems.Contains(cordSearch.RadioFrequency))
if (!string.IsNullOrEmpty(cordSearch.RadioFrequency) && cordSearch.RadioFrequency != Constants.StrUnknown)
{
_radioSearchItems.Clear();
_radioSearchItems.Add(cordSearch.RadioFrequency);
}
// fill search masks for FW package selection
if (!string.IsNullOrEmpty(cordSearch.Region) && cordSearch.Region != Constants.StrUnknown &&
!_regionSearchItems.Contains(cordSearch.Region))
if (!string.IsNullOrEmpty(cordSearch.Region) && cordSearch.Region != Constants.StrUnknown )
{
_regionSearchItems.Clear();
_regionSearchItems.Add(cordSearch.Region);
}
// fill search masks for FW package selection
if (!string.IsNullOrEmpty(cordSearch.CoreRevision) && cordSearch.CoreRevision != Constants.StrUnknown &&
!_coreSearchItems.Contains(cordSearch.CoreRevision))
if (!string.IsNullOrEmpty(cordSearch.CoreRevision) && cordSearch.CoreRevision != Constants.StrUnknown)
{
_coreSearchItems.Clear();
_coreSearchItems.Add(cordSearch.CoreRevision);
}
// fill search masks for FW package selection
if (!string.IsNullOrEmpty(cordSearch.Metrology) && cordSearch.Metrology != Constants.StrUnknown &&
!_metrologySearchItems.Contains(cordSearch.Metrology))
if (!string.IsNullOrEmpty(cordSearch.Metrology) && cordSearch.Metrology != Constants.StrUnknown )
{
_metrologySearchItems.Clear();
_metrologySearchItems.Add(cordSearch.Metrology);
}
@@ -335,7 +335,7 @@
<value>389, 17</value>
</data>
<data name="toolStripStatusLabel1.Text" xml:space="preserve">
<value>© Copyright 2021..2022 Xylem. All Rights Reserved. For internal use only!</value>
<value>© Copyright 2021..2023 Xylem. All Rights Reserved. For internal use only!</value>
</data>
<data name="lblStatusDbConnect.AutoSize" type="System.Boolean, mscorlib">
<value>False</value>
@@ -331,7 +331,7 @@
<value>389, 17</value>
</data>
<data name="toolStripStatusLabel1.Text" xml:space="preserve">
<value>© Copyright 2021..2022 Xylem. All Rights Reserved. For internal use only!</value>
<value>© Copyright 2021..2023 Xylem. All Rights Reserved. For internal use only!</value>
</data>
<data name="lblStatusDbConnect.AutoSize" type="System.Boolean, mscorlib">
<value>False</value>
@@ -138,20 +138,20 @@
//
// grpApplications
//
resources.ApplyResources(this.grpApplications, "grpApplications");
this.grpApplications.Controls.Add(this.gridViewApplic);
resources.ApplyResources(this.grpApplications, "grpApplications");
this.grpApplications.Name = "grpApplications";
this.grpApplications.TabStop = false;
//
// gridViewApplic
//
resources.ApplyResources(this.gridViewApplic, "gridViewApplic");
this.gridViewApplic.AllowUserToAddRows = false;
this.gridViewApplic.AllowUserToDeleteRows = false;
this.gridViewApplic.AllowUserToResizeColumns = false;
this.gridViewApplic.AllowUserToResizeRows = false;
this.gridViewApplic.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
this.gridViewApplic.BackgroundColor = System.Drawing.SystemColors.ControlLight;
resources.ApplyResources(this.gridViewApplic, "gridViewApplic");
this.gridViewApplic.Name = "gridViewApplic";
this.gridViewApplic.ReadOnly = true;
this.gridViewApplic.RowHeadersVisible = false;
@@ -256,9 +256,9 @@
//
// grpLanguageSelection
//
resources.ApplyResources(this.grpLanguageSelection, "grpLanguageSelection");
this.grpLanguageSelection.Controls.Add(this.radioBtnGermanLanguage);
this.grpLanguageSelection.Controls.Add(this.radioBtnEnglishLanguage);
resources.ApplyResources(this.grpLanguageSelection, "grpLanguageSelection");
this.grpLanguageSelection.Name = "grpLanguageSelection";
this.grpLanguageSelection.TabStop = false;
//
@@ -280,8 +280,8 @@
//
// pictureBox1
//
resources.ApplyResources(this.pictureBox1, "pictureBox1");
this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
resources.ApplyResources(this.pictureBox1, "pictureBox1");
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.TabStop = false;
//
@@ -304,8 +304,8 @@
//
// picBoxLogo
//
resources.ApplyResources(this.picBoxLogo, "picBoxLogo");
this.picBoxLogo.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
resources.ApplyResources(this.picBoxLogo, "picBoxLogo");
this.picBoxLogo.Name = "picBoxLogo";
this.picBoxLogo.TabStop = false;
//
@@ -397,8 +397,8 @@
//
// FrmServiceFwUpdateSw
//
resources.ApplyResources(this, "$this");
this.AccessibleRole = System.Windows.Forms.AccessibleRole.Sound;
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.tableLayoutPanel10);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
@@ -1267,16 +1267,16 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw
var retVal = true;
// extract the package information
var region = _cordonelFirmwarePackage.FwPackageInfo.Region;
var meterSize = _cordonelFirmwarePackage.FwPackageInfo.MeterSize;
var radioFrequencyMhz = _cordonelFirmwarePackage.FwPackageInfo.RadioFrequencyMhz;
var fwPackRegion = _cordonelFirmwarePackage.FwPackageInfo.Region;
var fwPackMeterSize = _cordonelFirmwarePackage.FwPackageInfo.MeterSize;
var fwPackRadioFrequencyMhz = _cordonelFirmwarePackage.FwPackageInfo.RadioFrequencyMhz;
// region
if (!string.IsNullOrEmpty(region))
if (!string.IsNullOrEmpty(fwPackRegion))
{
// check the update capability for region, on undefined region accept update
if (_currentGenesis.Region == region
|| Constants.StrUnknown == region
// accept region if identical, on undefined installed region or support for all regions
if (_currentGenesis.Region == fwPackRegion
|| Constants.StrWildcard == fwPackRegion
|| Constants.StrUnknown == _currentGenesis.Region)
{
InfoProcessSuccess(null, Resources.StrCordonelUpdateCapabilityRegionSucceeded);
@@ -1286,21 +1286,19 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw
retVal = false;
// set information of required and detected regions radio, check failed!
LogText(StrSeparator);
LogErrorText(Resources.StrFwPackageInfo + " " + region);
LogErrorText(Resources.StrFwPackageInfo + " " + fwPackRegion);
LogErrorText(@"Cordonel: " + _currentGenesis.Region);
InfoProcessFailed(lblCordonelUpdateCapability, Resources.StrCordonelUpdateCapabilityRegionFailed);
}
}
// meter size
if (!string.IsNullOrEmpty(meterSize))
if (!string.IsNullOrEmpty(fwPackMeterSize))
{
// check the update capability for meter size,
// if fw package supports all meter sizes or the meter size is unknown
// or the meter size of the Cordonel is not logged to DB
if (_currentGenesis.MeterSize == meterSize
|| Constants.StrUnknown == meterSize
|| Constants.StrWildcard == meterSize
if (_currentGenesis.MeterSize == fwPackMeterSize
|| Constants.StrWildcard == fwPackMeterSize
|| Constants.StrUnknown == _currentGenesis.MeterSize)
{
InfoProcessSuccess(null, Resources.StrCordonelUpdateCapabilityMeterSizeSucceeded);
@@ -1310,15 +1308,16 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw
retVal = false;
// set information of required and detected regions check failed!
LogText(StrSeparator);
LogErrorText(Resources.StrFwPackageInfo + " " + meterSize);
LogErrorText(Resources.StrFwPackageInfo + " " + fwPackMeterSize);
LogErrorText(@"Cordonel: " + _currentGenesis.MeterSize);
InfoProcessFailed(lblCordonelUpdateCapability, Resources.StrCordonelUpdateCapabilityMeterSizeFailed);
}
}
// if radio frequency is null the region is "NA" or the fw package serves all frequencies
// if the radio frequency is required, it has to be verified against the preset value in the Cordonel
if (radioFrequencyMhz == null || radioFrequencyMhz == _currentGenesis.RadioFrequencyMhz)
// if radio frequency is null the region is "NA" or the fw package serves all frequencies,
// if the radio frequency is explicit set, it has to be verified against the preset value in the Cordonel
if (fwPackRadioFrequencyMhz == null || fwPackRadioFrequencyMhz == _currentGenesis.RadioFrequencyMhz
|| _currentGenesis.RadioFrequencyMhz == null)
{
InfoProcessSuccess(null, Resources.StrCordonelUpdateCapabilityRadioSucceeded);
}
@@ -1327,7 +1326,7 @@ namespace Xylem.ServiceFwUpdate.Ui.ServiceFwUpdateSw
retVal = false;
// set information of required and detected radio frequency check failed!
LogText(StrSeparator);
LogErrorText(Resources.StrFwPackageInfo + " " + radioFrequencyMhz + " MHz");
LogErrorText(Resources.StrFwPackageInfo + " " + fwPackRadioFrequencyMhz + " MHz");
LogErrorText(@"Cordonel: " + _currentGenesis.RadioFrequencyMhz + " MHz");
InfoProcessFailed(lblCordonelUpdateCapability, Resources.StrCordonelUpdateCapabilityRadioFailed);
}
File diff suppressed because it is too large Load Diff