Merge branch 'release/AddOtherCalcUpdate_01'

This commit is contained in:
Samuele Locatelli
2025-10-21 17:49:41 +02:00
15 changed files with 269 additions and 93 deletions
+1 -1
View File
@@ -9,7 +9,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.17" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.21" />
</ItemGroup>
</Project>
+1 -1
View File
@@ -68,7 +68,7 @@
<WebWindowComplex.TableComp ListPayload="SetupList"
LiveData="CurrData"
EC_OnUpdate="SaveJWD"
EC_DoUpdate="ExecRequest"
EC_OnClose="CloseObj">
</WebWindowComplex.TableComp>
+65 -33
View File
@@ -14,7 +14,6 @@ namespace Test.UI.Components.Pages
{
public partial class EditJWD : IDisposable
{
#region Public Fields
public string InitialJwd = "";
@@ -29,6 +28,37 @@ namespace Test.UI.Components.Pages
#region Public Methods
/// <summary>
/// Comparatore euqlity obj dizionario
/// </summary>
/// <typeparam name="TKey"></typeparam>
/// <typeparam name="TValue"></typeparam>
/// <param name="dict1"></param>
/// <param name="dict2"></param>
/// <returns></returns>
public bool DictionariesEqual<TKey, TValue>(Dictionary<TKey, TValue> dict1, Dictionary<TKey, TValue> dict2)
{
// Handle null cases
if (dict1 == null || dict2 == null)
return dict1 == dict2;
// Quick size check
if (dict1.Count != dict2.Count)
return false;
// Compare each key-value pair
foreach (var kvp in dict1)
{
if (!dict2.TryGetValue(kvp.Key, out TValue value))
return false; // Key missing in dict2
if (!EqualityComparer<TValue>.Default.Equals(kvp.Value, value))
return false; // Value mismatch
}
return true;
}
public void Dispose()
{
DLService.CalcDonePipe.EA_NewMessage -= CalcDonePipe_EA_NewMessage;
@@ -46,6 +76,7 @@ namespace Test.UI.Components.Pages
protected string currJwd = "...";
protected Dictionary<string, string> m_CurrArgs = new Dictionary<string, string>();
protected string prevJwd = "";
/// <summary>
/// Configurazione elenchi anagrafiche
/// </summary>
@@ -79,6 +110,7 @@ namespace Test.UI.Components.Pages
};
protected List<Hardware> AvailHardwareList { get; set; } = new List<Hardware>();
protected List<string> AvailMaterialList { get; set; } = new List<string>()
{
new string("Pino"),
@@ -93,6 +125,7 @@ namespace Test.UI.Components.Pages
};
protected List<TemplateSelectDTO> AvailTemplateList { get; set; } = new List<TemplateSelectDTO>();
[Inject]
protected IConfiguration Config { get; set; } = null!;
@@ -153,13 +186,19 @@ namespace Test.UI.Components.Pages
private string CalcUid = "CurrWindow";
private string cFileHardware = "Hardware/Setup.json";
private string cFileTemplate = "Data/Setup.json";
private string colorMassUpdate;
private TemplateSelectDTO? currSel = null;
private string currSvg = "";
private string familyHWMassUpdate;
private string GenericBasePath = "";
private string glassMassUpdate;
private Hardware hardwareMassUpdate;
private string imgBasePath = "";
private string materialMassUpdate;
private string outClose = "";
private string outSave = "";
private string profileMassUpdate;
private string subChannel = "";
private string windowUid = "CurrWindow";
@@ -204,6 +243,29 @@ namespace Test.UI.Components.Pages
subChannel = Config.GetValue<string>("ServerConf:SvgChannel") ?? "";
}
private async Task ExecRequest(Dictionary<string, string> CurrArgs)
{
outClose = "";
outSave = "";
// verifico se contiene JWD, lo aggiorno
if (CurrArgs.ContainsKey("Jwd"))
{
currJwd = CurrArgs["Jwd"];
CurrData.CurrJwd = currJwd;
}
// se il SSE variato --> invio
if (!currJwd.Equals(prevJwd) || !DictionariesEqual(m_CurrArgs, CurrArgs))
{
m_CurrArgs = CurrArgs;
prevJwd = currJwd;
CalcRequestDTO calcRequestDTO = new CalcRequestDTO();
calcRequestDTO.EnvType = EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW;
calcRequestDTO.DictExec = m_CurrArgs;
// chiamo la chiamata POST alla API, che manda la richiesta via REDIS
await ICService.CallRestPost($"{apiUrl}/{GenericBasePath}", $"{calcTag}/{CalcUid}", calcRequestDTO);
}
}
/// <summary>
/// Rilettura dati
/// </summary>
@@ -241,30 +303,6 @@ namespace Test.UI.Components.Pages
await Task.Delay(100);
}
private async Task SaveJWD(Dictionary<string, string> CurrArgs)
{
outClose = "";
outSave = "";
m_CurrArgs = CurrArgs;
// verifico se contiene JWD, lo aggiorno
if (CurrArgs.ContainsKey("Jwd"))
{
currJwd = CurrArgs["Jwd"];
CurrData.CurrJwd = currJwd;
}
// se il SSE variato --> invio
if (!currJwd.Equals(prevJwd))
{
prevJwd = currJwd;
CalcRequestDTO calcRequestDTO = new CalcRequestDTO();
calcRequestDTO.EnvType = EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW;
calcRequestDTO.DictExec = m_CurrArgs;
// chiamo la chiamata POST alla API, che manda la richiesta via REDIS
await ICService.CallRestPost($"{apiUrl}/{GenericBasePath}", $"{calcTag}/{CalcUid}", calcRequestDTO);
}
}
private void SetTemplate(TemplateSelectDTO selTemp)
{
string rawVal = "";
@@ -277,18 +315,12 @@ namespace Test.UI.Components.Pages
SelTemplate = new Template(selTemp.Index, selTemp.Description, selTemp.SVGFileName, rawVal);
}
#endregion Private Methods
private void updateInfoJwd(string currSer, string? newFamilyHardware, Hardware? newHardware, string? newColorMaterial, string? newMaterial, string? newGlass, string? newProfile)
{
var newJwd = SerialMan.MassUpdate(currSer, newFamilyHardware, newHardware, newColorMaterial, newMaterial, newGlass, newProfile);
CurrData.CurrJwd = newJwd;
}
private string familyHWMassUpdate;
private Hardware hardwareMassUpdate;
private string materialMassUpdate;
private string colorMassUpdate;
private string glassMassUpdate;
private string profileMassUpdate;
#endregion Private Methods
}
}
+1 -1
View File
@@ -14,7 +14,7 @@
IN_SelMaterial="@SelMaterial"
IN_GlassList="@AvailGlassList"
IN_SelGlass="@SelGlass"
EC_OnUpdate="SaveJWD"
EC_req="SaveJWD"
EC_OnSelectedTemplate="SetTemplate"
LiveSVG="@currSvg">
</WebWindowComplex.TableComp>
+3 -3
View File
@@ -34,11 +34,11 @@
<ProjectReference Include="..\WebWindowComplex\WebWindowComplex.csproj" />
<ProjectReference Include="..\WebWindowConfigurator\WebWindowConfigurator.csproj" />
<ProjectReference Include="..\WebWindowTest\WebWindowTest.csproj" />
<PackageReference Include="EgwCoreLib.Lux.Core" Version="1.0.2510.2014" />
<PackageReference Include="EgwCoreLib.Lux.Data" Version="1.0.2510.2014" />
<PackageReference Include="EgwCoreLib.Lux.Core" Version="1.0.2510.2109" />
<PackageReference Include="EgwCoreLib.Lux.Data" Version="1.0.2510.2109" />
<PackageReference Include="EgwCoreLib.Razor" Version="1.5.2510.610" />
<PackageReference Include="EgwCoreLib.Utils" Version="1.5.2510.610" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.17" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.21" />
<PackageReference Include="RestSharp" Version="112.1.0" />
</ItemGroup>
+13 -12
View File
@@ -9,16 +9,17 @@
"ConnectionStrings": {
"Redis": "redis.ufficio:26379, serviceName=devel, DefaultDatabase=6, keepAlive=180, connectTimeout=15000, syncTimeout=15000, asyncTimeout=15000, abortConnect=false, ssl=false, allowAdmin=true"
},
"ServerConf": {
"PubChannel": "EgwEngineInput",
"SubChannel": "EgwEngineOutput",
"SvgChannel": "svg:img",
"Prog.ApiUrl": "https://office.egalware.com/lux/srv/api",
"ImageBaseUrl": "window",
"GenericBaseUrl": "generic",
"ImageLiveTag": "svg",
"ImageFileTag": "svgfile",
"ImageCalcTag": "svg-preview",
"CalcTag": "calc"
}
"ServerConf": {
"PubChannel": "EgwEngineInput",
"SubChannel": "EgwEngineOutput",
"SvgChannel": "Egw:svg:img",
"BomChannel": "Egw:bom",
"Prog.ApiUrl": "https://office.egalware.com/lux/srv/api",
"ImageBaseUrl": "window",
"GenericBaseUrl": "generic",
"ImageLiveTag": "svg",
"ImageFileTag": "svgfile",
"ImageCalcTag": "svg-preview",
"CalcTag": "calc"
}
}
@@ -12,8 +12,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Egw.Window.Data" Version="2.7.10.1012" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.19" />
<PackageReference Include="Egw.Window.Data" Version="2.7.10.2116" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.21" />
</ItemGroup>
</Project>
+1 -1
View File
@@ -94,7 +94,7 @@
</div>
<div class="input-group mb-2">
<label class="input-group-text" for="Hardware">Type</label>
<select class="form-select" id="Hardware" @bind="@CurrItem.SelHardwareFromId">
<select class="form-select" id="Hardware" @bind="SelHwType">
@if (CurrItem.HardwareList == null || CurrItem.HardwareList.Count == 0)
{
<option value="000000">ERROR - Missing HW List</option>
+59 -23
View File
@@ -5,6 +5,8 @@ namespace WebWindowComplex.Compo
{
public partial class CardSashGroup
{
#region Public Properties
/// <summary>
/// Indice della sash corrente rispetto alla lista sash
/// </summary>
@@ -17,18 +19,6 @@ namespace WebWindowComplex.Compo
[Parameter]
public Sash CurrItem { get; set; } = null!;
/// <summary>
/// Lista di sash
/// </summary>
[Parameter]
public List<Sash> SashList { get; set; } = null!;
/// <summary>
/// Evento per cambiare tutti i fill
/// </summary>
[Parameter]
public EventCallback<Area> EC_RemoveArea { get; set; }
/// <summary>
/// Evento per cambiare tutti i Joints
/// </summary>
@@ -48,10 +38,10 @@ namespace WebWindowComplex.Compo
public EventCallback<DataCopyContentSash> EC_CopyContentSash { get; set; }
/// <summary>
/// Evento per cambiare tutti i Joints
/// Evento per cambiare tutti i fill
/// </summary>
[Parameter]
public EventCallback<Sash> EC_UpdateSash { get; set; }
public EventCallback<Area> EC_RemoveArea { get; set; }
/// <summary>
/// Evento per tornare nella pagine Tree
@@ -59,6 +49,48 @@ namespace WebWindowComplex.Compo
[Parameter]
public EventCallback<bool> EC_ReqClose { get; set; }
/// <summary>
/// Evento per cambiare tutti i Joints
/// </summary>
[Parameter]
public EventCallback<Sash> EC_UpdateSash { get; set; }
/// <summary>
/// Evento per segnalare cambio hw e richiesta calcolo
/// </summary>
[Parameter]
public EventCallback<Sash> EC_UpdateSashHardware { get; set; }
/// <summary>
/// Lista di sash
/// </summary>
[Parameter]
public List<Sash> SashList { get; set; } = null!;
#endregion Public Properties
#region Protected Properties
/// <summary>
///
/// </summary>
protected string SelHwType
{
get => CurrItem.SelHardwareFromId;
set
{
if (CurrItem.SelHardwareFromId != value)
{
CurrItem.SelHardwareFromId = value;
_ = EC_UpdateSashHardware.InvokeAsync(CurrItem);
}
}
}
#endregion Protected Properties
#region Protected Methods
/// <summary>
/// Sollevo evento per rimuovere area
/// </summary>
@@ -69,6 +101,10 @@ namespace WebWindowComplex.Compo
await EC_RemoveArea.InvokeAsync(currArea);
}
#endregion Protected Methods
#region Private Methods
/// <summary>
/// Sollevo evento richiesta per cambiare tutti i Joint
/// </summary>
@@ -101,6 +137,14 @@ namespace WebWindowComplex.Compo
await EC_CopyContentSash.InvokeAsync(Args);
}
/// <summary>
/// Sollevo evento per tornare alla pagina Tree
/// </summary>
private void ReqClose()
{
_ = EC_ReqClose.InvokeAsync(true);
}
/// <summary>
/// Report aggiornamento joint
/// </summary>
@@ -118,14 +162,6 @@ namespace WebWindowComplex.Compo
}
}
/// <summary>
/// Sollevo evento per tornare alla pagina Tree
/// </summary>
private void ReqClose()
{
_ = EC_ReqClose.InvokeAsync(true);
}
#endregion Private Methods
}
}
+14
View File
@@ -23,6 +23,16 @@ namespace WebWindowComplex.DTO
/// </summary>
public string SvgPreview { get; set; } = string.Empty;
/// <summary>
/// Shape da verifica JWD
/// </summary>
public string Shape { get; set; } = string.Empty;
/// <summary>
/// XML opzioni HW da verifica JWD
/// </summary>
public string OptionsXml { get; set; } = string.Empty;
#endregion Public Properties
#region Public Methods
@@ -41,6 +51,10 @@ namespace WebWindowComplex.DTO
return false;
if (SvgPreview != item.SvgPreview)
return false;
if (Shape != item.Shape)
return false;
if (OptionsXml != item.OptionsXml)
return false;
return true;
}
+11 -1
View File
@@ -145,7 +145,17 @@
}
else
{
<CardSashGroup CurrIndex="currSash" CurrItem="SashList[currSash]" SashList="m_SashList" EC_ChangeAllJoints="ChangeAllJoints" EC_ChangeHandle="changeHandle" EC_CopyContentSash="CopyContentSash" EC_RemoveArea="RemoveArea" EC_UpdateSash="UpdateSash" EC_ReqClose="ReturnTree"></CardSashGroup>
<CardSashGroup CurrIndex="currSash"
CurrItem="SashList[currSash]"
SashList="m_SashList"
EC_ChangeAllJoints="ChangeAllJoints"
EC_ChangeHandle="changeHandle"
EC_CopyContentSash="CopyContentSash"
EC_RemoveArea="RemoveArea"
EC_UpdateSash="UpdateSash"
EC_UpdateSashHardware="UpdateHwOptions"
EC_ReqClose="ReturnTree">
</CardSashGroup>
}
}
else if (currStep == CompileStep.Fill)
+70 -7
View File
@@ -42,10 +42,10 @@ namespace WebWindowComplex
public EventCallback<TemplateSelectDTO> EC_OnSelectedTemplate { get; set; }
/// <summary>
/// Richiesta refresh SVG da JWD
/// Richiesta update da JWD (SVG, calcoli vari...)
/// </summary>
[Parameter]
public EventCallback<Dictionary<string, string>> EC_OnUpdate { get; set; }
public EventCallback<Dictionary<string, string>> EC_DoUpdate { get; set; }
/// <summary>
/// Sollevo evento errore validazione con una lista di errori rilevati
@@ -429,7 +429,7 @@ namespace WebWindowComplex
}
/// <summary>
/// Anteprima SVG
/// Richiesta update anteprima SVG
/// </summary>
/// <returns></returns>
protected async Task DoPreviewSvg()
@@ -443,13 +443,64 @@ namespace WebWindowComplex
#endif
// verifico variazione JWD
if (!prevJwd.Equals(CurrJwd))
//if (!prevJwd.Equals(LiveData.CurrJwd) || !prevJwd.Equals(CurrJwd))
{
prevJwd = CurrJwd;
Dictionary<string, string> Args = new Dictionary<string, string>();
Args.Add("Mode", $"{(int)Enums.QuestionModes.PREVIEW}");
Args.Add("Jwd", CurrJwd);
await EC_OnUpdate.InvokeAsync(Args);
await EC_DoUpdate.InvokeAsync(Args);
}
}
}
/// <summary>
/// Richiesta calcolo Options HW da JWD
/// </summary>
/// <returns></returns>
protected async Task DoReqOptHardware()
{
if (m_CurrWindow != null)
{
#if DEBUG
var CurrJwd = JsonConvert.SerializeObject(m_CurrWindow.Serialize(), Formatting.Indented);
#else
var CurrJwd = JsonConvert.SerializeObject(m_CurrWindow.Serialize());
#endif
// verifico variazione JWD
if (!prevJwd.Equals(CurrJwd))
{
prevJwd = CurrJwd;
Dictionary<string, string> Args = new Dictionary<string, string>();
Args.Add("Mode", $"{(int)Enums.QuestionModes.HARDWARE}");
Args.Add("SubMode", $"{(int)Enums.QuestionHwSubModes.HARDWAREOPTIONS}");
Args.Add("Jwd", CurrJwd);
await EC_DoUpdate.InvokeAsync(Args);
}
}
}
/// <summary>
/// Richiesta Shape compatibile da JWD
/// </summary>
/// <returns></returns>
protected async Task DoReqShape()
{
if (m_CurrWindow != null)
{
#if DEBUG
var CurrJwd = JsonConvert.SerializeObject(m_CurrWindow.Serialize(), Formatting.Indented);
#else
var CurrJwd = JsonConvert.SerializeObject(m_CurrWindow.Serialize());
#endif
// verifico variazione JWD
if (!prevJwd.Equals(CurrJwd))
{
prevJwd = CurrJwd;
Dictionary<string, string> Args = new Dictionary<string, string>();
Args.Add("Mode", $"{(int)Enums.QuestionModes.HARDWARE}");
Args.Add("SubMode", $"{(int)Enums.QuestionHwSubModes.SASHSHAPE}");
Args.Add("Jwd", CurrJwd);
await EC_DoUpdate.InvokeAsync(Args);
}
}
}
@@ -458,7 +509,7 @@ namespace WebWindowComplex
/// Metodo di reset dei dati a quelli del template
/// </summary>
protected async Task DoReset()
{
{
// Da fare
}
@@ -528,6 +579,8 @@ namespace WebWindowComplex
prevLiveData = new LivePayload()
{
CurrJwd = LiveData.CurrJwd,
OptionsXml = LiveData.OptionsXml,
Shape = LiveData.Shape,
SvgPreview = LiveData.SvgPreview
};
m_SelSVG = LiveData.SvgPreview;
@@ -940,7 +993,7 @@ namespace WebWindowComplex
Dictionary<string, string> Args = new Dictionary<string, string>();
Args.Add("Mode", $"{(int)Enums.QuestionModes.PREVIEW}");
Args.Add("Jwd", e.sJwd);
EC_OnUpdate.InvokeAsync(Args);
_ = EC_DoUpdate.InvokeAsync(Args);
}
/// <summary>
@@ -1134,6 +1187,16 @@ namespace WebWindowComplex
await DoPreviewSvg();
}
/// <summary>
/// Aggiornamento opzioni dato update sash
/// </summary>
/// <param name="newSash"> nuova sash </param>
/// <returns></returns>
private async Task UpdateHwOptions(Sash newSash)
{
await DoReqOptHardware();
}
/// <summary>
/// Cerca e aggiorna la sash
/// </summary>
+13 -3
View File
@@ -6,7 +6,7 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>2.7.10.2014</Version>
<Version>2.7.10.2117</Version>
<Authors>Annamaria Sassi</Authors>
<Company>Egalware</Company>
<Description>Componente gestione Configurazioni avanzate Window per LUX</Description>
@@ -18,10 +18,10 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Egw.Window.Data" Version="2.7.10.1012" />
<PackageReference Include="Egw.Window.Data" Version="2.7.10.2116" />
<PackageReference Include="EgwCoreLib.Razor" Version="1.5.2510.610" />
<PackageReference Include="EgwCoreLib.Utils" Version="1.5.2510.610" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.19" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.21" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
@@ -29,3 +29,13 @@
</Target>
</Project>
@@ -6,7 +6,7 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>2.7.10.2014</Version>
<Version>2.7.10.2117</Version>
<Authors>Annamaria Sassi</Authors>
<Company>Egalware</Company>
<Description>Componente gestione JWD per LUX</Description>
@@ -26,10 +26,10 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Egw.Window.Data" Version="2.7.10.1012" />
<PackageReference Include="Egw.Window.Data" Version="2.7.10.2116" />
<PackageReference Include="EgwCoreLib.Razor" Version="1.5.2510.610" />
<PackageReference Include="EgwCoreLib.Utils" Version="1.5.2510.610" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.19" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.21" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
@@ -98,6 +98,16 @@
+2 -2
View File
@@ -12,10 +12,10 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Egw.Window.Data" Version="2.7.10.1012" />
<PackageReference Include="Egw.Window.Data" Version="2.7.10.2116" />
<PackageReference Include="EgwCoreLib.Razor" Version="1.5.2510.610" />
<PackageReference Include="EgwCoreLib.Utils" Version="1.5.2510.610" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.19" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.21" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>