Update x gestione ritorno sui channels

This commit is contained in:
Samuele Locatelli
2025-10-21 19:13:08 +02:00
parent 23627e33b2
commit 09f49e6be9
19 changed files with 384 additions and 124 deletions
+46
View File
@@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EgwCoreLib.Lux.Core
{
public class DictUtils
{
#region Public Methods
/// <summary>
/// Comparatore equality obj dizionario
/// </summary>
/// <typeparam name="TKey"></typeparam>
/// <typeparam name="TValue"></typeparam>
/// <param name="dict1"></param>
/// <param name="dict2"></param>
/// <returns></returns>
public static bool DictAreEqual<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;
}
#endregion Public Methods
}
}
@@ -21,8 +21,9 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Egw.Lux.WebWindowComplex" Version="2.7.10.1710" />
<PackageReference Include="Egw.Window.Data" Version="2.7.10.1012" />
<PackageReference Include="Egw.Lux.WebWindow.Base" Version="2.7.10.2117" />
<PackageReference Include="Egw.Lux.WebWindowComplex" Version="2.7.10.2117" />
<PackageReference Include="Egw.Window.Data" Version="2.7.10.2116" />
<PackageReference Include="EgwMultiEngineManager.Data" Version="2.7.10.1" />
</ItemGroup>
</Project>
@@ -27,16 +27,16 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Egw.Lux.WebWindow.Base" Version="2.7.10.1710" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.17" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="8.0.17" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Analyzers" Version="8.0.17" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.17">
<PackageReference Include="Egw.Lux.WebWindow.Base" Version="2.7.10.2117" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.21" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="8.0.21" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Analyzers" Version="8.0.21" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.21">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.17" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.17">
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.21" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.21">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
+64 -13
View File
@@ -14,12 +14,12 @@ using System.Threading.Tasks;
namespace EgwCoreLib.Lux.Data.Services
{
/// <summary>
/// Classe base per i servizi che fornisce funzionalità comuni come
/// Classe base per i servizi che fornisce funzionalità comuni come
/// - connessione a Redis
/// - configurazione
/// - gestione dei messaggi
/// - strategie di caching.
///
/// - gestione dei messaggi
/// - strategie di caching.
///
/// Questa classe agisce come modello per altri servizi derivati.
/// </summary>
public class BaseServ
@@ -41,7 +41,10 @@ namespace EgwCoreLib.Lux.Data.Services
// channel name setup
svgChannel = _config.GetValue<string>("ServerConf:SvgChannel") ?? "Egw:svg:img";
bomChannel = _config.GetValue<string>("ServerConf:BomChannel") ?? "Egw:bom";
updateChannel = _config.GetValue<string>("ServerConf:UpdateChannel") ?? "Egw-update";
updateChannel = _config.GetValue<string>("ServerConf:UpdateChannel") ?? "Egw:update";
shapeChannel = _config.GetValue<string>("ServerConf:ShapeChannel") ?? "Egw:shape:curr";
hwOptChannel = _config.GetValue<string>("ServerConf:HwOptChannel") ?? "Egw:hw:opt";
profListChannel = _config.GetValue<string>("ServerConf:ProfListChannel") ?? "Egw:prof:list";
// Appends ":*" to the channels to enable wildcard subscription for dynamic events
if (!svgChannel.EndsWith(":*"))
{
@@ -55,6 +58,18 @@ namespace EgwCoreLib.Lux.Data.Services
{
updateChannel += ":*";
}
if (!shapeChannel.EndsWith(":*"))
{
shapeChannel += ":*";
}
if (!hwOptChannel.EndsWith(":*"))
{
hwOptChannel += ":*";
}
if (!profListChannel.EndsWith(":*"))
{
profListChannel += ":*";
}
// Configurazione serializzatore JSON per risolvere errore di loop circolare
JSSettings = new JsonSerializerSettings()
@@ -63,9 +78,12 @@ namespace EgwCoreLib.Lux.Data.Services
};
// Configurazione pipe dei messaggi
CalcDonePipe = new MessagePipe(redisConn, svgChannel);
BomPipe = new MessagePipe(RedisConn, bomChannel);
UpdatePipe = new MessagePipe(RedisConn, updateChannel);
PipeSvg = new MessagePipe(redisConn, svgChannel);
PipeBom = new MessagePipe(RedisConn, bomChannel);
PipeUpdate = new MessagePipe(RedisConn, updateChannel);
PipeShape = new MessagePipe(RedisConn, shapeChannel);
PipeHwOpt = new MessagePipe(RedisConn, hwOptChannel);
PipeProfList = new MessagePipe(RedisConn, profListChannel);
}
#endregion Public Constructors
@@ -75,18 +93,36 @@ namespace EgwCoreLib.Lux.Data.Services
/// <summary>
/// Pipe dei messaggi per la comunicazione riguardo update calcolo BOM
/// </summary>
public MessagePipe BomPipe { get; set; } = null!;
public MessagePipe PipeBom { get; set; } = null!;
/// <summary>
/// Pipe dei messaggi per la comunicazione tra servizi di calcolo e interfaccia utente.
/// I messaggi vengono inviati sul canale Redis definito da svgChannel.
/// Pipe dei messaggi per ritorno HwOptions calcolate da Engine di calcolo verso interfaccia utente.
/// I messaggi vengono inviati sul canale Redis definito da HwOptChannel.
/// </summary>
public MessagePipe CalcDonePipe { get; set; } = null!;
public MessagePipe PipeHwOpt { get; set; } = null!;
/// <summary>
/// Pipe dei messaggi per ritorno ProfileList calcolate da Engine di calcolo verso interfaccia utente.
/// I messaggi vengono inviati sul canale Redis definito da ProfListChannel.
/// </summary>
public MessagePipe PipeProfList { get; set; } = null!;
/// <summary>
/// Pipe dei messaggi per ritorno Shape calcolate da Engine di calcolo verso interfaccia utente.
/// I messaggi vengono inviati sul canale Redis definito da ShapeChannel.
/// </summary>
public MessagePipe PipeShape { get; set; } = null!;
/// <summary>
/// Pipe dei messaggi per ritorno SVG calcolati da Engine di calcolo verso interfaccia utente.
/// I messaggi vengono inviati sul canale Redis definito da SvgChannel.
/// </summary>
public MessagePipe PipeSvg { get; set; } = null!;
/// <summary>
/// Pipe dei messaggi per la comunicazione riguardo update generico UI
/// </summary>
public MessagePipe UpdatePipe { get; set; } = null!;
public MessagePipe PipeUpdate { get; set; } = null!;
#endregion Public Properties
@@ -178,12 +214,27 @@ namespace EgwCoreLib.Lux.Data.Services
/// </summary>
private int cacheTtlShort = 60 * 1;
/// <summary>
/// Canale ritorno Hw Options
/// </summary>
private string hwOptChannel = "";
/// <summary>
/// Canale ritorno Profile List
/// </summary>
private string profListChannel = "";
/// <summary>
/// Generatore di numeri casuali utilizzato per introdurre variabilità dinamica nelle durate della cache
/// (simula variazioni reali nella freschezza dei dati e nei tempi di scadenza).
/// </summary>
private Random rnd = new Random();
/// <summary>
/// Canale ritorno shape calcolate
/// </summary>
private string shapeChannel = "";
/// <summary>
/// Nome del canale Redis utilizzato per l'invio/ricezione di messaggi relativi a img svg.
/// Predefinito a "svg:img" con suffisso ":*".
@@ -273,6 +273,9 @@ namespace EgwCoreLib.Lux.Data.Services
private readonly string liveTag = "svg";
private readonly string svgChannel = "svg:img";
private readonly string shapeChannel = "shape:curr";
private readonly string hwOptChannel = "hw:opt";
private readonly string profListChannel = "prof:list";
private IConfiguration _config;
+1 -1
View File
@@ -50,7 +50,7 @@ namespace Lux.API.Controllers
}
if (!DictExec.ContainsKey("SubMode"))
{
DictExec.Add("SubMode", $"{(int)Enums.QuestionSubModes.NULL}");
DictExec.Add("SubMode", $"{(int)Enums.QuestionConfSubModes.NULL}");
}
if (!DictExec.ContainsKey("UID"))
{
+2 -2
View File
@@ -103,10 +103,10 @@ namespace Lux.API.Controllers
private async Task sendHwReq()
{
Dictionary<string, string> DictExec = new Dictionary<string, string>();
DictExec.Add("Mode", $"{(int)Egw.Window.Data.Enums.QuestionModes.HARDWAREMODELLIST}");
DictExec.Add("Mode", $"{(int)Egw.Window.Data.Enums.QuestionModes.HARDWARE}");
// da rivedere?
DictExec.Add("UID", "HW.AGB");
DictExec.Add("SubMode", $"{(int)Egw.Window.Data.Enums.QuestionSubModes.LIST}");
DictExec.Add("SubMode", $"{(int)Egw.Window.Data.Enums.QuestionHwSubModes.LIST}");
DictExec.Add("Manufacturer", $"{(int)Egw.Window.Data.Enums.HardwareManufacturers.AGB}");
int nId = 1;
// da modificare con tipo richiesta...
+1 -1
View File
@@ -4,7 +4,7 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>0.9.2510.2115</Version>
<Version>0.9.2510.2119</Version>
</PropertyGroup>
<ItemGroup>
@@ -43,6 +43,11 @@ namespace Lux.API.Services
{
if (retData.Args != null && retData.Args.Count > 0)
{
/*------------------------------------------
* Richieste "continue" di stato/update *
* ----------------------------------------*/
// gestione ritorno preview SVG
if (retData.Args.ContainsKey("Svg"))
{
// dovrei leggere dagli args l'IUID dell'SVG ritornato...
@@ -51,6 +56,8 @@ namespace Lux.API.Services
string UID = retData.Args["UID"];
await cacheService.SaveSvgAsync(UID, retData.ExecEnvironment, newSvg);
}
// gesitone ritorno BOM
if (retData.Args.ContainsKey("BOM"))
{
string newBom = retData.Args["BOM"];
@@ -63,6 +70,34 @@ namespace Lux.API.Services
// pubblico refresh info così da segnalare richeista di update conseguente
await cacheService.PublishUpdateAsync(UID, retData.ExecEnvironment);
}
// gestione ritorno tipo Shape
if (retData.Args.ContainsKey("SashShape"))
{
//// salvo HardwareList ricevuta
//string newHml = retData.Args["HardwareModelList"];
//string UID = retData.Args["UID"];
//await cacheService.SaveHmlAsync(UID, retData.ExecEnvironment, newHml);
//await dbService.SaveHmlAsync(UID, retData.ExecEnvironment, newHml);
}
// gestione ritorno opzioni HW
if (retData.Args.ContainsKey("HardwareOptions"))
{
//// salvo HardwareList ricevuta
//string newHml = retData.Args["HardwareModelList"];
//string UID = retData.Args["UID"];
//await cacheService.SaveHmlAsync(UID, retData.ExecEnvironment, newHml);
//await dbService.SaveHmlAsync(UID, retData.ExecEnvironment, newHml);
}
/*------------------------------------------
* Richieste "one shot" di configurazione
* - fare 1/gg o su richiesta utente
* ----------------------------------------*/
// Gestione ritorno lista preferiti HW (ammissibili)
if (retData.Args.ContainsKey("HardwareModelList"))
{
// salvo HardwareList ricevuta
@@ -71,6 +106,17 @@ namespace Lux.API.Services
await cacheService.SaveHmlAsync(UID, retData.ExecEnvironment, newHml);
await dbService.SaveHmlAsync(UID, retData.ExecEnvironment, newHml);
}
// gestione ritorno lista profili VALIDI per JWD
if (retData.Args.ContainsKey("ProfileList"))
{
//// salvo HardwareList ricevuta
//string newHml = retData.Args["HardwareModelList"];
//string UID = retData.Args["UID"];
//await cacheService.SaveHmlAsync(UID, retData.ExecEnvironment, newHml);
//await dbService.SaveHmlAsync(UID, retData.ExecEnvironment, newHml);
}
}
}
}
+3
View File
@@ -59,6 +59,9 @@
"PubChannel": "EgwEngineInput",
"SubChannel": "EgwEngineOutput",
"SvgChannel": "Egw:svg:img",
"ShapeChannel": "Egw:shape:curr",
"HwOptChannel": "Egw:hw:opt",
"ProfListChannel": "Egw:prof:list",
"BomChannel": "Egw:bom",
"UpdateChannel": "Egw:update",
"BaseUrl": "/lux/srv/",
+3 -3
View File
@@ -9,9 +9,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Egw.Lux.WebWindowComplex" Version="2.7.10.1710" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.17" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="8.0.17" />
<PackageReference Include="Egw.Lux.WebWindowComplex" Version="2.7.10.2117" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.21" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="8.0.21" />
</ItemGroup>
<ItemGroup>
+1 -1
View File
@@ -2,7 +2,7 @@
{
<WebWindowComplex.TableComp ListPayload="SetupList"
LiveData="CurrData"
EC_OnUpdate="SaveJWD"
EC_DoUpdate="SaveJWD"
EC_OnClose="CloseEdit">
</WebWindowComplex.TableComp>
}
+185 -81
View File
@@ -1,18 +1,13 @@
using EgwCoreLib.Lux.Core;
using EgwCoreLib.Lux.Core.RestPayload;
using EgwCoreLib.Lux.Data;
using EgwCoreLib.Lux.Data.DbModel.Config;
using EgwCoreLib.Lux.Data.DbModel.Sales;
using EgwCoreLib.Lux.Data.DbModel.Utils;
using EgwCoreLib.Lux.Data.Services;
using EgwMultiEngineManager.Data;
using Lux.UI.Components.Compo.Config;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Forms;
using Microsoft.EntityFrameworkCore.Storage.Json;
using Microsoft.JSInterop;
using NLog.LayoutRenderers;
using System.Text;
using Newtonsoft.Json;
using WebWindowComplex;
using WebWindowComplex.DTO;
using static EgwCoreLib.Lux.Core.Enums;
@@ -73,8 +68,11 @@ namespace Lux.UI.Components.Compo
/// </summary>
public void Dispose()
{
DLService.UpdatePipe.EA_NewMessage -= UpdatePipe_EA_NewMessage;
DLService.CalcDonePipe.EA_NewMessage -= CalcDonePipe_EA_NewMessage;
DLService.PipeUpdate.EA_NewMessage -= PipeUpdate_EA_NewMessage;
DLService.PipeSvg.EA_NewMessage -= PipeSvg_EA_NewMessage;
DLService.PipeHwOpt.EA_NewMessage -= PipeHwOpt_EA_NewMessage;
DLService.PipeProfList.EA_NewMessage -= PipeProfList_EA_NewMessage;
DLService.PipeShape.EA_NewMessage -= PipeShape_EA_NewMessage;
}
#endregion Public Methods
@@ -93,14 +91,6 @@ namespace Lux.UI.Components.Compo
#endregion Protected Fields
/// <summary>
/// Formattazione testo come html x display
/// </summary>
protected MarkupString HtmlConv(string rawData)
{
return (MarkupString)rawData.Replace(Environment.NewLine, "<br />").Replace("\n", "<br />");//.Replace(" ", "&nbsp;");
}
#region Protected Properties
[Inject]
@@ -379,6 +369,14 @@ namespace Lux.UI.Components.Compo
return EgwCoreLib.Utils.FileHelpers.SizeSuffix(size, 1);
}
/// <summary>
/// Formattazione testo come html x display
/// </summary>
protected MarkupString HtmlConv(string rawData)
{
return (MarkupString)rawData.Replace(Environment.NewLine, "<br />").Replace("\n", "<br />");//.Replace(" ", "&nbsp;");
}
/// <summary>
/// Calcolo URL immagine
/// </summary>
@@ -495,8 +493,11 @@ namespace Lux.UI.Components.Compo
ConfInit();
prevJwd = "";
await ReloadBaseList();
DLService.UpdatePipe.EA_NewMessage += UpdatePipe_EA_NewMessage;
DLService.CalcDonePipe.EA_NewMessage += CalcDonePipe_EA_NewMessage;
DLService.PipeUpdate.EA_NewMessage += PipeUpdate_EA_NewMessage;
DLService.PipeSvg.EA_NewMessage += PipeSvg_EA_NewMessage;
DLService.PipeHwOpt.EA_NewMessage += PipeHwOpt_EA_NewMessage;
DLService.PipeProfList.EA_NewMessage += PipeProfList_EA_NewMessage;
DLService.PipeShape.EA_NewMessage += PipeShape_EA_NewMessage;
}
protected override async Task OnParametersSetAsync()
@@ -568,8 +569,11 @@ namespace Lux.UI.Components.Compo
/// </summary>
private EditMode CurrEditMode = EditMode.None;
private string currOptXml = "";
private int currPage = 1;
private List<string> currProfList = new List<string>();
private string currShape = "";
private string currSvg = "";
/// <summary>
@@ -581,6 +585,11 @@ namespace Lux.UI.Components.Compo
private string GenericBasePath = "";
/// <summary>
/// Channel update HwOptions
/// </summary>
private string hwOptChannel = "";
private string imgBasePath = "";
private bool isLoading = false;
@@ -599,12 +608,25 @@ namespace Lux.UI.Components.Compo
/// </summary>
private string prevJwd = "";
/// <summary>
/// Channel update Profile List
/// </summary>
private string profListChannel = "";
/// <summary>
/// Dizionario richieste
/// </summary>
private Dictionary<string, string> reqDict = new Dictionary<string, string>();
private string subChannel = "";
/// <summary>
/// Channel update Shape
/// </summary>
private string shapeChannel = "";
/// <summary>
/// Channel update SVG
/// </summary>
private string svgChannel = "";
private int totalCount = 0;
@@ -612,32 +634,6 @@ namespace Lux.UI.Components.Compo
#region Private Methods
/// <summary>
/// Ricevuto SVG, se è il mio lo aggiorno...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private async void CalcDonePipe_EA_NewMessage(object? sender, EventArgs e)
{
// vale SOLO SE sono in editing...
if (EditRecord != null)
{
// aggiorno visualizzazione
PubSubEventArgs currArgs = (PubSubEventArgs)e;
// conversione on-the-fly SVG da mostrare
if (!string.IsNullOrEmpty(currArgs.newMessage))
{
if (currArgs.msgUid.Equals($"{subChannel}:{EditRecord.OfferRowUID}"))
{
currSvg = currArgs.newMessage;
// salvo in live data...
CurrData.SvgPreview = currSvg;
}
await InvokeAsync(StateHasChanged);
}
}
}
/// <summary>
/// Chiude edit andando eventualmente a salvare
/// </summary>
@@ -692,7 +688,10 @@ namespace Lux.UI.Components.Compo
imgBasePath = Config.GetValue<string>("ServerConf:ImageBaseUrl") ?? "";
GenericBasePath = Config.GetValue<string>("ServerConf:GenericBaseUrl") ?? "";
calcTag = Config.GetValue<string>("ServerConf:CalcTag") ?? "calc";
subChannel = Config.GetValue<string>("ServerConf:SvgChannel") ?? "";
svgChannel = Config.GetValue<string>("ServerConf:SvgChannel") ?? "";
shapeChannel = Config.GetValue<string>("ServerConf:ShapeChannel") ?? "";
hwOptChannel = Config.GetValue<string>("ServerConf:HwOptChannel") ?? "";
profListChannel = Config.GetValue<string>("ServerConf:ProfListChannel") ?? "";
}
private async Task DoRecalcOffer()
@@ -726,6 +725,143 @@ namespace Lux.UI.Components.Compo
isLoading = false;
}
/// <summary>
/// Ricevuto HwOpt, processo
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private async void PipeHwOpt_EA_NewMessage(object? sender, EventArgs e)
{
// vale SOLO SE sono in editing...
if (EditRecord != null)
{
// aggiorno visualizzazione
PubSubEventArgs currArgs = (PubSubEventArgs)e;
// conversione on-the-fly SVG da mostrare
if (!string.IsNullOrEmpty(currArgs.newMessage))
{
if (currArgs.msgUid.Equals($"{hwOptChannel}:{EditRecord.OfferRowUID}"))
{
currOptXml = currArgs.newMessage;
// salvo in live data...
CurrData.OptionsXml = currOptXml;
}
await InvokeAsync(StateHasChanged);
}
}
}
/// <summary>
/// Ricevuta profile list, processo
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private async void PipeProfList_EA_NewMessage(object? sender, EventArgs e)
{
// vale SOLO SE sono in editing...
if (EditRecord != null)
{
// aggiorno visualizzazione
PubSubEventArgs currArgs = (PubSubEventArgs)e;
// conversione on-the-fly SVG da mostrare
if (!string.IsNullOrEmpty(currArgs.newMessage))
{
if (currArgs.msgUid.Equals($"{profListChannel}:{EditRecord.OfferRowUID}"))
{
try
{
// new List<string>();
currProfList = JsonConvert.DeserializeObject<List<string>>(currArgs.newMessage) ?? SetupList.Profile;
// salvo in live data...
SetupList.Profile = currProfList;
}
catch
{ }
}
await InvokeAsync(StateHasChanged);
}
}
}
/// <summary>
/// Ricevuta shape, procersso
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private async void PipeShape_EA_NewMessage(object? sender, EventArgs e)
{
// vale SOLO SE sono in editing...
if (EditRecord != null)
{
// aggiorno visualizzazione
PubSubEventArgs currArgs = (PubSubEventArgs)e;
// conversione on-the-fly SVG da mostrare
if (!string.IsNullOrEmpty(currArgs.newMessage))
{
if (currArgs.msgUid.Equals($"{shapeChannel}:{EditRecord.OfferRowUID}"))
{
currShape = currArgs.newMessage;
// salvo in live data...
CurrData.Shape = currShape;
}
await InvokeAsync(StateHasChanged);
}
}
}
/// <summary>
/// Ricevuto SVG, se è il mio lo aggiorno...
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private async void PipeSvg_EA_NewMessage(object? sender, EventArgs e)
{
// vale SOLO SE sono in editing...
if (EditRecord != null)
{
// aggiorno visualizzazione
PubSubEventArgs currArgs = (PubSubEventArgs)e;
// conversione on-the-fly SVG da mostrare
if (!string.IsNullOrEmpty(currArgs.newMessage))
{
if (currArgs.msgUid.Equals($"{svgChannel}:{EditRecord.OfferRowUID}"))
{
currSvg = currArgs.newMessage;
// salvo in live data...
CurrData.SvgPreview = currSvg;
}
await InvokeAsync(StateHasChanged);
}
}
}
/// <summary>
/// Task verifica update ricevuti
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
/// <exception cref="NotImplementedException"></exception>
private async void PipeUpdate_EA_NewMessage(object? sender, EventArgs e)
{
// aggiorno visualizzazione
PubSubEventArgs currArgs = (PubSubEventArgs)e;
// conversione on-the-fly SVG da mostrare
if (!string.IsNullOrEmpty(currArgs.newMessage))
{
// cerco se faccia aprte dei record correnti...
var recFound = AllRecords.Any(x => x.OfferRowUID == currArgs.newMessage);
if (recFound)
{
isLoading = true;
await Task.Delay(10);
// se si tratta dell'UID corrente --> fa update
await DoRecalcOffer();
await InvokeAsync(StateHasChanged);
}
}
await Task.Delay(1);
}
/// <summary>
/// Preparazione dati x componente edit JWD
/// </summary>
@@ -869,12 +1005,12 @@ namespace Lux.UI.Components.Compo
// SE contiene il mio Jwd...
if (args.ContainsKey("Jwd"))
{
reqDict = args;
string serStruct = reqDict["Jwd"];
string serStruct = args["Jwd"];
// controllo SE variato...
if (!prevJwd.Equals(serStruct))
if (!prevJwd.Equals(serStruct) || !DictUtils.DictAreEqual(reqDict, args))
{
// aggiorno val prev
reqDict = args;
prevJwd = serStruct;
// aggiorno live data
CurrData.CurrJwd = serStruct;
@@ -940,38 +1076,6 @@ namespace Lux.UI.Components.Compo
}
}
/// <summary>
/// Task verifica update ricevuti
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
/// <exception cref="NotImplementedException"></exception>
private async void UpdatePipe_EA_NewMessage(object? sender, EventArgs e)
{
// aggiorno visualizzazione
PubSubEventArgs currArgs = (PubSubEventArgs)e;
// conversione on-the-fly SVG da mostrare
if (!string.IsNullOrEmpty(currArgs.newMessage))
{
// cerco se faccia aprte dei record correnti...
var recFound = AllRecords.Any(x => x.OfferRowUID == currArgs.newMessage);
if (recFound)
{
isLoading = true;
await Task.Delay(10);
#if false
if (currArgs.msgUid.Equals($"{subChannel}:{windowUid}"))
{
}
#endif
// se si tratta dell'UID corrente --> fa update
await DoRecalcOffer();
await InvokeAsync(StateHasChanged);
}
}
await Task.Delay(1);
}
/// <summary>
/// Filtro e paginazione
/// </summary>
+3 -3
View File
@@ -11,7 +11,7 @@ namespace Lux.UI.Components.Pages
public void Dispose()
{
DLService.CalcDonePipe.EA_NewMessage -= CalcDonePipe_EA_NewMessage;
DLService.PipeSvg.EA_NewMessage -= PipeSvg_EA_NewMessage;
}
#endregion Public Methods
@@ -50,7 +50,7 @@ namespace Lux.UI.Components.Pages
imgBasePath = Config.GetValue<string>("ServerConf:ImageBaseUrl") ?? "";
calcTag = Config.GetValue<string>("ServerConf:ImageCalcTag") ?? "";
subChannel = Config.GetValue<string>("ServerConf:SvgChannel") ?? "";
DLService.CalcDonePipe.EA_NewMessage += CalcDonePipe_EA_NewMessage;
DLService.PipeSvg.EA_NewMessage += PipeSvg_EA_NewMessage;
}
protected void Reset()
@@ -85,7 +85,7 @@ namespace Lux.UI.Components.Pages
#region Private Methods
private async void CalcDonePipe_EA_NewMessage(object? sender, EventArgs e)
private async void PipeSvg_EA_NewMessage(object? sender, EventArgs e)
{
// aggiorno visualizzazione
PubSubEventArgs currArgs = (PubSubEventArgs)e;
+10 -7
View File
@@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>aspnet-Lux.UI-a758c101-a2f4-4e38-977d-1c4887dbbd50</UserSecretsId>
<Version>0.9.2510.2115</Version>
<Version>0.9.2510.2119</Version>
</PropertyGroup>
<ItemGroup>
@@ -17,14 +17,17 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Egw.Lux.WebWindowComplex" Version="2.7.10.1710" />
<PackageReference Include="Egw.Lux.WebWindowComplex" Version="2.7.10.2117" />
<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.Diagnostics.EntityFrameworkCore" Version="8.0.17" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.17" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.17" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.17" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.21" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="8.0.21" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.21" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.21" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.21">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NLog" Version="6.0.1" />
<PackageReference Include="NLog.Web.AspNetCore" Version="6.0.1" />
</ItemGroup>
+3
View File
@@ -67,6 +67,9 @@
"PubChannel": "EgwEngineInput",
"SubChannel": "EgwEngineOutput",
"SvgChannel": "Egw:svg:img",
"ShapeChannel": "Egw:shape:curr",
"HwOptChannel": "Egw:hw:opt",
"ProfListChannel": "Egw:prof:list",
"BomChannel": "Egw:bom",
"UpdateChannel": "Egw:update",
"BaseUrl": "/lux/ui/"
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>LUX - Web Windows MES</i>
<h4>Versione: 0.9.2510.2115</h4>
<h4>Versione: 0.9.2510.2119</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
0.9.2510.2115
0.9.2510.2119
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>0.9.2510.2115</version>
<version>0.9.2510.2119</version>
<url>http://nexus.steamware.net/repository/SWS/GPW/stable/GPW.UI.zip</url>
<changelog>http://nexus.steamware.net/repository/SWS/GPW/stable/ChangeLog.html</changelog>
<mandatory>false</mandatory>