update x dizionario optionsXML

This commit is contained in:
2025-10-29 12:38:46 +01:00
parent eaea52f45d
commit 3f8f97c29e
5 changed files with 85 additions and 24 deletions
+3 -3
View File
@@ -30,9 +30,9 @@ namespace WebWindowComplex.DTO
public Dictionary<int,string> DictShape { get; set; } = new Dictionary<int, string>();
/// <summary>
/// XML opzioni HW da verifica JWD
/// Dizionario XML opzioni HW da verifica JWD x GroupId
/// </summary>
public string OptionsXml { get; set; } = string.Empty;
public Dictionary<int, string> DictOptionsXml { get; set; } = new Dictionary<int, string>();
#endregion Public Properties
@@ -52,7 +52,7 @@ namespace WebWindowComplex.DTO
return false;
if (SvgPreview != item.SvgPreview)
return false;
if (OptionsXml != item.OptionsXml)
if (!DictUtils.DictAreEqual(DictOptionsXml, item.DictOptionsXml))
return false;
if (!DictUtils.DictAreEqual(DictShape, item.DictShape))
return false;
+27 -13
View File
@@ -477,8 +477,9 @@ namespace WebWindowComplex
/// <summary>
/// Richiesta calcolo Options HW da JWD
/// </summary>
/// <param name="groupIdList">Lista degli ID numerici dei gruppi da valutare</param>
/// <returns></returns>
protected async Task DoReqOptHardware()
protected async Task DoReqOptHardware(List<int> groupIdList)
{
if (m_CurrWindow != null)
{
@@ -495,6 +496,8 @@ namespace WebWindowComplex
Args.Add("Mode", $"{(int)Enums.QuestionModes.HARDWARE}");
Args.Add("SubMode", $"{(int)Enums.QuestionHwSubModes.HARDWAREOPTIONS}");
Args.Add("Jwd", CurrJwd);
string listGroupId = JsonConvert.SerializeObject(groupIdList);
Args.Add("GroupId", listGroupId);
await EC_DoUpdate.InvokeAsync(Args);
}
}
@@ -599,7 +602,7 @@ namespace WebWindowComplex
prevLiveData = new LivePayload()
{
CurrJwd = LiveData.CurrJwd,
OptionsXml = LiveData.OptionsXml,
DictOptionsXml = LiveData.DictOptionsXml,
DictShape = LiveData.DictShape,
SvgPreview = LiveData.SvgPreview
};
@@ -695,15 +698,19 @@ namespace WebWindowComplex
if (updRequested)
{
// se mancasse xml opzioni hardware lo chiedo
if (string.IsNullOrEmpty(LiveData.OptionsXml))
if (LiveData.DictOptionsXml.Count == 0)
{
foreach(var item in SashList)
List<int> reqList = SashList.Select(x => x.GroupId).ToList();
//foreach (var item in SashList)
//{
// string req = item.SelHardware.Id;
// if (string.IsNullOrEmpty(req))
// {
// }
//}
if (reqList.Count > 0)
{
string req = item.SelHardware.Id;
if (string.IsNullOrEmpty(req))
{
await DoReqOptHardware();
}
await DoReqOptHardware(reqList);
}
}
// se mancasse dizionario forme chiamo quello
@@ -770,10 +777,15 @@ namespace WebWindowComplex
}
}
// se ho le opzioni hw le aggiungo
if (!string.IsNullOrEmpty(LiveData.OptionsXml))
if (LiveData.DictOptionsXml.Count > 0)
{
foreach (var item in SashList)
item.SetHardwareOption(LiveData.OptionsXml);
{
if (LiveData.DictOptionsXml.ContainsKey(item.GroupId))
{
item.SetHardwareOption(LiveData.DictOptionsXml[item.GroupId]);
}
}
}
}
@@ -1318,10 +1330,12 @@ namespace WebWindowComplex
/// <param name="newSash"> nuova sash </param>
/// <returns></returns>
private async Task UpdateHwOptions(Sash newSash)
{
{
// richiesta calcolo opzioni hardware per la singola sash group
string req = newSash.SelHardware.Id;
await DoReqOptHardware();
List<int> reqList = new List<int>() { newSash.GroupId };
// chiamo con gruppo della nuova sash
await DoReqOptHardware(reqList);
}
/// <summary>
+13 -1
View File
@@ -6,7 +6,7 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>2.7.10.2815</Version>
<Version>2.7.10.2912</Version>
<Authors>Annamaria Sassi</Authors>
<Company>Egalware</Company>
<Description>Componente gestione Configurazioni avanzate Window per LUX</Description>
@@ -153,6 +153,18 @@