GTB 2.2.2:

FwUpdate can upload entire 0\\config file
This commit is contained in:
Thomas Wiedebusch
2022-04-26 16:32:15 +02:00
parent 7a197a6793
commit e8ec68dee1
18 changed files with 487 additions and 202 deletions
@@ -8,58 +8,66 @@
/// <summary>
/// FW Update State Idle
/// </summary>
Idle = 0,
Idle,
/// <summary>
/// FW update single step failed
/// </summary>
StepFailed = 1,
StepFailed,
/// <summary>
/// FW update entire process failed
/// </summary>
UpdateFailed = 2,
UpdateFailed,
/// <summary>
/// Start initial FW update
/// </summary>
StartInitial = 3,
StartInitial,
/// <summary>
/// Repeat FW update
/// </summary>
RepeatFwUpdate = 4,
RepeatFwUpdate,
/// <summary>
/// Upload (partial-) update files
/// </summary>
UploadFileApps = 5,
UploadFileApps,
/// <summary>
/// Download (partial-) update files
/// </summary>
DownloadFileApps = 6,
DownloadFileApps,
/// <summary>
/// Compare (partial-) update files
/// </summary>
CompareFileApps = 7,
CompareFileApps,
/// <summary>
/// Download upgrade control file
/// </summary>
DownloadUpgradeControlFile = 8,
DownloadUpgradeControlFile,
/// <summary>
/// Build upgrade control file
/// </summary>
BuildUpgradeControlFile = 9,
BuildUpgradeControlFile,
/// <summary>
/// Build Update Files
/// </summary>
BuildFileApps = 10,
BuildFileApps,
/// <summary>
/// Trigger Upgrade
/// </summary>
TriggerUpgrade = 11,
TriggerUpgrade,
/// <summary>
/// Erase update file
/// </summary>
EraseUpdateFile = 12,
EraseUpdateFile,
/// <summary>
/// Prepare update, read registers for restorer and store configuration
/// </summary>
PrepareUpdate,
/// <summary>
/// Read configuration file from meter
/// </summary>
UploadConfigFile,
/// <summary>
/// Delimiter for list
/// </summary>
FwUpdateStateListDelimiter = 13
FwUpdateStateListDelimiter
}
}
@@ -20,44 +20,50 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile.Consts
static FwUpdateStateInfo()
{
StateInfos = new FwUpdateStateText[(Int32)FwUpdateState.FwUpdateStateListDelimiter];
StateInfos[0].State = FwUpdateState.Idle;
StateInfos[0].Message = Resources.StrFwUpdateStateIdle;
StateInfos[(Int32)FwUpdateState.Idle].State = FwUpdateState.Idle;
StateInfos[(Int32)FwUpdateState.Idle].Message = Resources.StrFwUpdateStateIdle;
StateInfos[1].State = FwUpdateState.StepFailed;
StateInfos[1].Message = Resources.StrFwUpdateStateStepFailed;
StateInfos[(Int32)FwUpdateState.StepFailed].State = FwUpdateState.StepFailed;
StateInfos[(Int32)FwUpdateState.StepFailed].Message = Resources.StrFwUpdateStateStepFailed;
StateInfos[2].State = FwUpdateState.UpdateFailed;
StateInfos[2].Message = Resources.StrFwUpdateStateUpdateFailed;
StateInfos[(Int32)FwUpdateState.UpdateFailed].State = FwUpdateState.UpdateFailed;
StateInfos[(Int32)FwUpdateState.UpdateFailed].Message = Resources.StrFwUpdateStateUpdateFailed;
StateInfos[3].State = FwUpdateState.StartInitial;
StateInfos[3].Message = Resources.StrFwUpdateStateStartInitial;
StateInfos[(Int32)FwUpdateState.StartInitial].State = FwUpdateState.StartInitial;
StateInfos[(Int32)FwUpdateState.StartInitial].Message = Resources.StrFwUpdateStateStartInitial;
StateInfos[4].State = FwUpdateState.RepeatFwUpdate;
StateInfos[4].Message = Resources.StrFwUpdateStateRepeatFwUpdate;
StateInfos[(Int32)FwUpdateState.RepeatFwUpdate].State = FwUpdateState.RepeatFwUpdate;
StateInfos[(Int32)FwUpdateState.RepeatFwUpdate].Message = Resources.StrFwUpdateStateRepeatFwUpdate;
StateInfos[5].State = FwUpdateState.UploadFileApps;
StateInfos[5].Message = Resources.StrFwUpdateStateUploadFileApps;
StateInfos[(Int32)FwUpdateState.UploadFileApps].State = FwUpdateState.UploadFileApps;
StateInfos[(Int32)FwUpdateState.UploadFileApps].Message = Resources.StrFwUpdateStateUploadFileApps;
StateInfos[6].State = FwUpdateState.DownloadFileApps;
StateInfos[6].Message = Resources.StrFwUpdateStateDownloadFileApps;
StateInfos[(Int32)FwUpdateState.DownloadFileApps].State = FwUpdateState.DownloadFileApps;
StateInfos[(Int32)FwUpdateState.DownloadFileApps].Message = Resources.StrFwUpdateStateDownloadFileApps;
StateInfos[7].State = FwUpdateState.CompareFileApps;
StateInfos[7].Message = Resources.StrFwUpdateStateCompareFileApps;
StateInfos[(Int32)FwUpdateState.CompareFileApps].State = FwUpdateState.CompareFileApps;
StateInfos[(Int32)FwUpdateState.CompareFileApps].Message = Resources.StrFwUpdateStateCompareFileApps;
StateInfos[8].State = FwUpdateState.DownloadUpgradeControlFile;
StateInfos[8].Message = Resources.StrFwUpdateStateDownloadUpgradeControlFile;
StateInfos[(Int32)FwUpdateState.DownloadUpgradeControlFile].State = FwUpdateState.DownloadUpgradeControlFile;
StateInfos[(Int32)FwUpdateState.DownloadUpgradeControlFile].Message = Resources.StrFwUpdateStateDownloadUpgradeControlFile;
StateInfos[9].State = FwUpdateState.BuildUpgradeControlFile;
StateInfos[9].Message = Resources.StrFwUpdateStateBuildUpgradeControlFile;
StateInfos[(Int32)FwUpdateState.BuildUpgradeControlFile].State = FwUpdateState.BuildUpgradeControlFile;
StateInfos[(Int32)FwUpdateState.BuildUpgradeControlFile].Message = Resources.StrFwUpdateStateBuildUpgradeControlFile;
StateInfos[10].State = FwUpdateState.BuildFileApps;
StateInfos[10].Message = Resources.StrFwUpdateStateBuildFileApps;
StateInfos[(Int32)FwUpdateState.BuildFileApps].State = FwUpdateState.BuildFileApps;
StateInfos[(Int32)FwUpdateState.BuildFileApps].Message = Resources.StrFwUpdateStateBuildFileApps;
StateInfos[11].State = FwUpdateState.TriggerUpgrade;
StateInfos[11].Message = Resources.StrFwUpdateStateTriggerUpgrade;
StateInfos[(Int32)FwUpdateState.TriggerUpgrade].State = FwUpdateState.TriggerUpgrade;
StateInfos[(Int32)FwUpdateState.TriggerUpgrade].Message = Resources.StrFwUpdateStateTriggerUpgrade;
StateInfos[12].State = FwUpdateState.EraseUpdateFile;
StateInfos[12].Message = Resources.StrFwUpdateStateEraseUpdateFile;
StateInfos[(Int32)FwUpdateState.EraseUpdateFile].State = FwUpdateState.EraseUpdateFile;
StateInfos[(Int32)FwUpdateState.EraseUpdateFile].Message = Resources.StrFwUpdateStateEraseUpdateFile;
StateInfos[(Int32)FwUpdateState.PrepareUpdate].State = FwUpdateState.PrepareUpdate;
StateInfos[(Int32)FwUpdateState.PrepareUpdate].Message = Resources.StrFwUpdateStatePrepareUpdate;
StateInfos[(Int32)FwUpdateState.UploadConfigFile].State = FwUpdateState.UploadConfigFile;
StateInfos[(Int32)FwUpdateState.UploadConfigFile].Message = Resources.StrUploadConfigFile;
}
/// <summary>
@@ -67,7 +73,8 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile.Consts
public static String GetTextFromState(FwUpdateState state)
{
return (from stateInfo in StateInfos
where stateInfo.State == state select stateInfo.Message).FirstOrDefault();
where stateInfo.State == state
select stateInfo.Message).FirstOrDefault();
}
/// <summary>
/// Get the state of the text
@@ -76,7 +83,8 @@ namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisFile.Consts
public static FwUpdateState GetStateFromText(String text)
{
return (from stateInfo in StateInfos
where stateInfo.Message == text select stateInfo.State).FirstOrDefault();
where stateInfo.Message == text
select stateInfo.State).FirstOrDefault();
}
}
}