diff --git a/Test.UI.sln b/Test.UI.sln
index eb5cb29..ca88fe5 100644
--- a/Test.UI.sln
+++ b/Test.UI.sln
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
-VisualStudioVersion = 17.14.36915.13 d17.14
+VisualStudioVersion = 17.14.36915.13
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test.UI", "Test.UI\Test.UI.csproj", "{8F1D6298-C1E6-44E6-82BD-4128AE17C0C7}"
EndProject
diff --git a/Test.UI/Components/Layout/NavMenu.razor b/Test.UI/Components/Layout/NavMenu.razor
index 66c5425..01585bc 100644
--- a/Test.UI/Components/Layout/NavMenu.razor
+++ b/Test.UI/Components/Layout/NavMenu.razor
@@ -34,6 +34,11 @@
BaseEdit
+
+
+ TestError
+
+
@*
EditJWD
diff --git a/Test.UI/Components/Pages/TestError.razor b/Test.UI/Components/Pages/TestError.razor
new file mode 100644
index 0000000..96a47b0
--- /dev/null
+++ b/Test.UI/Components/Pages/TestError.razor
@@ -0,0 +1,41 @@
+@page "/TestError"
+@rendermode InteractiveServer
+
+EditJWD
+
+
+
+
+
+
+
+
+
+
+@if (!string.IsNullOrEmpty(outClose))
+{
+
+ @outClose
+
+}
+else if (!string.IsNullOrEmpty(outSave))
+{
+
+ @outSave
+
+}
+
+
+
+
+
diff --git a/Test.UI/Components/Pages/TestError.razor.cs b/Test.UI/Components/Pages/TestError.razor.cs
new file mode 100644
index 0000000..70cd78b
--- /dev/null
+++ b/Test.UI/Components/Pages/TestError.razor.cs
@@ -0,0 +1,622 @@
+using Egw.Window.Data;
+using EgwCoreLib.Lux.Core;
+using EgwCoreLib.Lux.Core.RestPayload;
+using EgwCoreLib.Lux.Data.Services;
+using Microsoft.AspNetCore.Components;
+using Newtonsoft.Json;
+using WebWindowComplex;
+using WebWindowComplex.DTO;
+using static WebWindowComplex.LayoutConst;
+
+namespace Test.UI.Components.Pages
+{
+ public partial class TestError
+ {
+
+ #region Public Fields
+
+ public string InitialJwd = "";
+
+ #endregion Public Fields
+
+ #region Public Methods
+
+ public void Dispose()
+ {
+ DLService.PipeSvg.EA_NewMessage -= PipeSvg_EA_NewMessage;
+ DLService.PipeShape.EA_NewMessage -= PipeShape_EA_NewMessage;
+ DLService.PipeHwOpt.EA_NewMessage -= PipeHwOption_EA_NewMessage;
+ DLService.PipeProfElement.EA_NewMessage -= PipeProfElement_EA_NewMessage;
+ }
+
+ #endregion Public Methods
+
+ #region Protected Fields
+
+ ///
+ /// Predisposizione valori live SVG/JWD
+ ///
+ protected LivePayload CurrData = new LivePayload();
+
+ ///
+ /// Livello di accesso
+ /// -- true: utente base (versione semplificata)
+ /// -- false: utente avanzato (versione completa)
+ ///
+ protected bool User = false;
+
+ protected Dictionary currGroupShape = new Dictionary();
+ protected List currElement = new List();
+ protected Dictionary currHwOption = new Dictionary();
+ protected string currJwd = "...";
+ protected Dictionary m_CurrArgs = new Dictionary();
+ protected string prevJwd = "";
+
+ ///
+ /// Configurazione elenchi anagrafiche
+ ///
+ protected BaseListPayload SetupList = new BaseListPayload();
+
+ ///
+ /// Configurazione selezionati
+ ///
+ protected SelectPayload SelectList = new SelectPayload();
+
+ #endregion Protected Fields
+
+ #region Protected Properties
+
+ protected List AvailColorMaterialList { get; set; } = new List()
+ {
+ new string("White"),
+ new string("Black"),
+ new string("Blu"),
+ new string("Wood")
+ };
+
+ protected List AvailFamilyHardwareList { get; set; } = new List()
+ {
+ new string("ArTech"),
+ new string("ArTechPlana")
+ };
+
+ protected List AvailGlassList { get; set; } = new List()
+ {
+ new string("Vetro BE 2S 4/12/4"),
+ new string("Vetro BE 2S 4/16/4"),
+ new string("Vetro BE 3S 4/12/4/12/4"),
+ new string("Vetro BE 3S 4/16/4/16/4"),
+ new string("Vetro BE 2S 4T/12/4T"),
+ new string("Vetro BE 2S 4T/16/4T")
+ };
+
+ protected List AvailHardwareList { get; set; } = new List();
+
+ protected List AvailMaterialList { get; set; } = new List()
+ {
+ new string("Pino"),
+ new string("Abete")
+ };
+
+ ///
+ /// Lista profili da DB
+ ///
+ private List AvailProfileList = new List();
+
+
+ private List ThresholdProfilo78 = new List()
+ {
+ { new Threshold(3, "Bottom") },
+ { new Threshold(1, "Threshold") }
+ };
+
+ private List ThresholdProfiloSaomad = new List()
+ {
+ { new Threshold(3, "Bottom") },
+ { new Threshold(2, "BottomWaterdrip") },
+ { new Threshold(1, "Threshold") }
+ };
+
+ private Dictionary ParamProfilo78 = new Dictionary()
+ {
+ {"Frame_Fill_Rail_DimMax", 85},
+ {"Frame_Fill_Rail_DimMin", 70},
+ {"Frame_Fill_Rail_DimStd", 72},
+ {"Frame_Fixed_Bottom_DimMax", 80},
+ {"Frame_Fixed_Bottom_DimMin", 70},
+ {"Frame_Fixed_Bottom_DimStd", 78},
+ {"Frame_Fixed_Top_DimMax", 80},
+ {"Frame_Fixed_Top_DimMin", 70},
+ {"Frame_Fixed_Top_DimStd", 78},
+ {"Frame_Frame_Split_DimMax", 85},
+ {"Frame_Frame_Split_DimMin", 55},
+ {"Frame_Frame_Split_DimStd", 60},
+ {"Frame_Mixed_Bottom_DimMax", 80},
+ {"Frame_Mixed_Bottom_DimMin", 70},
+ {"Frame_Mixed_Bottom_DimStd", 78},
+ {"Frame_Mixed_Split_DimMax", 110},
+ {"Frame_Mixed_Split_DimMin", 70},
+ {"Frame_Mixed_Split_DimStd", 90},
+ {"Frame_Mixed_Top_DimMax", 80},
+ {"Frame_Mixed_Top_DimMin", 70},
+ {"Frame_Mixed_Top_DimStd", 78},
+ {"Frame_Rail_Bottom_DimMax", 80},
+ {"Frame_Rail_Bottom_DimMin", 70},
+ {"Frame_Rail_Bottom_DimStd", 78},
+ {"Frame_Rail_DimMax", 78},
+ {"Frame_Rail_DimMin", 68},
+ {"Frame_Rail_DimStd", 72},
+ {"Frame_Sash_Bottom_DimMax", 80},
+ {"Frame_Sash_Bottom_DimMin", 70},
+ {"Frame_Sash_Bottom_DimStd", 78},
+ {"Frame_Sash_Horizontal_DimMax", 110},
+ {"Frame_Sash_Horizontal_DimMin", 75},
+ {"Frame_Sash_Horizontal_DimStd", 95},
+ {"Frame_Sash_Threshold_DimMax", 26},
+ {"Frame_Sash_Threshold_DimMin", 24},
+ {"Frame_Sash_Threshold_DimStd", 25},
+ {"Frame_Sash_Top_DimMax", 80},
+ {"Frame_Sash_Top_DimMin", 70},
+ {"Frame_Sash_Top_DimStd", 78},
+ {"Frame_Sash_Vertical_DimMax", 110},
+ {"Frame_Sash_Vertical_DimMin", 85},
+ {"Frame_Sash_Vertical_DimStd", 95},
+ {"Frame_Slide_Bottom_DimMax", 60},
+ {"Frame_Slide_Bottom_DimMin", 50},
+ {"Frame_Slide_Bottom_DimStd", 55},
+ {"Frame_Slide_Fixed_DimMax", 60},
+ {"Frame_Slide_Fixed_DimMin", 50},
+ {"Frame_Slide_Fixed_DimStd", 55},
+ {"Frame_Slide_MovableBack_Bottom_DimMax", 60},
+ {"Frame_Slide_MovableBack_Bottom_DimMin", 50},
+ {"Frame_Slide_MovableBack_Bottom_DimStd", 55},
+ {"Frame_Slide_MovableBack_Threshold_DimMax", 10},
+ {"Frame_Slide_MovableBack_Threshold_DimMin", 3},
+ {"Frame_Slide_MovableBack_Threshold_DimStd", 4},
+ {"Frame_Slide_Movable_DimMax", 60},
+ {"Frame_Slide_Movable_DimMin", 50},
+ {"Frame_Slide_Movable_DimStd", 55},
+ {"Frame_Slide_Threshold_DimMax", 10},
+ {"Frame_Slide_Threshold_DimMin", 3},
+ {"Frame_Slide_Threshold_DimStd", 4},
+ {"Frame_Slide_Top_DimMax", 60},
+ {"Frame_Slide_Top_DimMin", 50},
+ {"Frame_Slide_Top_DimStd", 55},
+ {"Sash_Fill_Rail_DimMax", 80},
+ {"Sash_Fill_Rail_DimMin", 70},
+ {"Sash_Fill_Rail_DimStd", 78},
+ {"Sash_Frame_Bottom_DimMax", 80},
+ {"Sash_Frame_Bottom_DimMin", 70},
+ {"Sash_Frame_Bottom_DimStd", 78},
+ {"Sash_Frame_Top_DimMax", 80},
+ {"Sash_Frame_Top_DimMin", 70},
+ {"Sash_Frame_Top_DimStd", 78},
+ {"Sash_French_In_DimMax", 80},
+ {"Sash_French_In_DimMin", 70},
+ {"Sash_French_In_DimStd", 78},
+ {"Sash_French_Out_DimMax", 80},
+ {"Sash_French_Out_DimMin", 70},
+ {"Sash_French_Out_DimStd", 78},
+ {"Sash_Rail_Bottom_DimMax", 80},
+ {"Sash_Rail_Bottom_DimMin", 70},
+ {"Sash_Rail_Bottom_DimStd", 78},
+ {"Sash_Rail_DimMax", 80},
+ {"Sash_Rail_DimMin", 70},
+ {"Sash_Rail_DimStd", 78},
+ {"Sash_Sash_Active_DimMax", 80},
+ {"Sash_Sash_Active_DimMin", 70},
+ {"Sash_Sash_Active_DimStd", 78},
+ {"Sash_Sash_Inactive_DimMax", 80},
+ {"Sash_Sash_Inactive_DimMin", 70},
+ {"Sash_Sash_Inactive_DimStd", 78},
+ {"Sash_Sash_Split_DimMax", 70},
+ {"Sash_Sash_Split_DimMin", 50},
+ {"Sash_Sash_Split_DimStd", 60},
+ {"Sash_Slide_Active_DimMax", 90},
+ {"Sash_Slide_Active_DimMin", 70},
+ {"Sash_Slide_Active_DimStd", 80},
+ {"Sash_Slide_Active_In_DimMax", 90},
+ {"Sash_Slide_Active_In_DimMin", 70},
+ {"Sash_Slide_Active_In_DimStd", 80},
+ {"Sash_Slide_Fixed_Bottom_DimMax", 150},
+ {"Sash_Slide_Fixed_Bottom_DimMin", 120},
+ {"Sash_Slide_Fixed_Bottom_DimStd", 135},
+ {"Sash_Slide_Fixed_Side_DimMax", 90},
+ {"Sash_Slide_Fixed_Side_DimMin", 70},
+ {"Sash_Slide_Fixed_Side_DimStd", 80},
+ {"Sash_Slide_Fixed_Top_DimMax", 90},
+ {"Sash_Slide_Fixed_Top_DimMin", 70},
+ {"Sash_Slide_Fixed_Top_DimStd", 80},
+ {"Sash_Slide_Inactive_DimMax", 90},
+ {"Sash_Slide_Inactive_DimMin", 70},
+ {"Sash_Slide_Inactive_DimStd", 80},
+ {"Sash_Slide_MovableBack_Bottom_DimMax", 150},
+ {"Sash_Slide_MovableBack_Bottom_DimMin", 120},
+ {"Sash_Slide_MovableBack_Bottom_DimStd", 135},
+ {"Sash_Slide_MovableBack_Side_DimMax", 90},
+ {"Sash_Slide_MovableBack_Side_DimMin", 70},
+ {"Sash_Slide_MovableBack_Side_DimStd", 80},
+ {"Sash_Slide_MovableBack_Top_DimMax", 90},
+ {"Sash_Slide_MovableBack_Top_DimMin", 70},
+ {"Sash_Slide_MovableBack_Top_DimStd", 80},
+ {"Sash_Slide_Movable_Bottom_DimMax", 150},
+ {"Sash_Slide_Movable_Bottom_DimMin", 120},
+ {"Sash_Slide_Movable_Bottom_DimStd", 135},
+ {"Sash_Slide_Movable_Side_DimMax", 90},
+ {"Sash_Slide_Movable_Side_DimMin", 70},
+ {"Sash_Slide_Movable_Side_DimStd", 80},
+ {"Sash_Slide_Movable_Top_DimMax", 90},
+ {"Sash_Slide_Movable_Top_DimMin", 70},
+ {"Sash_Slide_Movable_Top_DimStd", 80},
+ {"Frame_BottomRail_Overlap", 33.2},
+ {"French_In_Overlap", 26},
+ {"French_Out_Overlap", 26},
+ {"Mixed_Bottom_Overlap", 26},
+ {"Mixed_Split_Bottom_Overlap", 41},
+ {"Mixed_Split_Top_Overlap", 41},
+ {"Mixed_Top_Overlap", 41},
+ {"NO_Mixed_Bottom_Overlap", 26},
+ {"NO_Mixed_Split_Bottom_Overlap", 41},
+ {"NO_Mixed_Split_Top_Overlap", 41},
+ {"NO_Slide_MovableBack_Threshold_Overlap", 0},
+ {"NO_Slide_Threshold_Overlap", 0},
+ {"Sash_Active_Overlap", 26},
+ {"Sash_Inactive_Overlap", 26},
+ {"Sash_BottomRail_Overlap", 24.5},
+ {"Sash_Bottom_Overlap", 26},
+ {"Sash_Horizontal_Bottom_Overlap", 26},
+ {"Sash_Horizontal_Top_Overlap", 41},
+ {"Sash_Threshold_Overlap", 18},
+ {"Sash_Top_Overlap", 41},
+ {"Sash_Vertical_Overlap", 41},
+ {"Slide_Active_Overlap", 80},
+ {"Slide_Bottom_Overlap", 0},
+ {"Slide_Fixed_Overlap", -5},
+ {"Slide_MovableBack_Bottom_Overlap", 0},
+ {"Slide_MovableBack_Threshold_Overlap", 0},
+ {"Slide_Movable_Overlap", -5},
+ {"Slide_Threshold_Overlap", 0},
+ {"Slide_Top_Overlap", -12}
+ };
+
+ private Dictionary ParamProfiloSaomad = new Dictionary()
+ {
+ {"Frame_Frame_Split_DimMax", 85},
+ {"Frame_Frame_Split_DimMin", 55},
+ {"Frame_Frame_Split_DimStd", 60},
+ {"Frame_Mixed_Bottom_DimMax", 80},
+ {"Frame_Mixed_Bottom_DimMin", 70},
+ {"Frame_Mixed_Bottom_DimStd", 78},
+ {"Frame_Mixed_Split_DimMax", 110},
+ {"Frame_Mixed_Split_DimMin", 70},
+ {"Frame_Mixed_Split_DimStd", 90},
+ {"Frame_Mixed_Top_DimMax", 80},
+ {"Frame_Mixed_Top_DimMin", 70},
+ {"Frame_Mixed_Top_DimStd", 78},
+ {"Frame_Rail_Bottom_DimMax", 80}
+ };
+
+ [Inject]
+ protected IConfiguration Config { get; set; } = null!;
+
+ [Inject]
+ protected DataLayerServices DLService { get; set; } = null!;
+
+ [Inject]
+ protected ImageCacheService ICService { get; set; } = null!;
+
+ protected MarkupString JsonSer
+ {
+ get => (MarkupString)currJwd.Replace(Environment.NewLine, "
").Replace(" ", " ");
+ }
+
+ protected string SelColorMaterial { get; set; } = "";
+ protected string SelFamilyHardware { get; set; } = "";
+ protected string SelGlass { get; set; } = "";
+ protected string SelMaterial { get; set; } = "";
+
+ #endregion Protected Properties
+
+ #region Protected Methods
+
+ protected override void OnAfterRender(bool firstRender)
+ {
+ if (firstRender)
+ {
+ // JS interop or data fetches go here
+ isInteractive = true;
+ }
+ }
+
+ protected override async Task OnInitializedAsync()
+ {
+ ConfInit();
+ User = false;
+ Random random = new Random();
+ CalcUid = Convert.ToString(random.Next(1000, 10000));
+ windowUid = CalcUid;
+ //InitialJwd = File.ReadAllText("Data\\AntaDoppiaInglesine.jwd");
+ InitialJwd = File.ReadAllText("Data\\AntaDoppia.jwd");
+ currJwd = InitialJwd;
+ // rileggo altri dati
+ await ReloadData();
+ // costruisco lista profili
+ ProfilePayload pp1 = new ProfilePayload()
+ {
+ ProfileName = "Profilo78",
+ ThresholdList = ThresholdProfilo78,
+ ParameterDict = ParamProfilo78
+ };
+ ProfilePayload pp2 = new ProfilePayload()
+ {
+ ProfileName = "ProfiloSaomad",
+ ThresholdList = ThresholdProfiloSaomad,
+ ParameterDict = ParamProfiloSaomad
+ };
+ AvailProfileList = new List { pp1, pp2 };
+ // preparo conf oggetti x controllo
+ SetupList = new BaseListPayload()
+ {
+ ColorMaterial = AvailColorMaterialList,
+ FamilyHardware = AvailFamilyHardwareList,
+ Glass = AvailGlassList,
+ Hardware = AvailHardwareList,
+ Material = AvailMaterialList,
+ ProfileList = AvailProfileList
+ };
+ CurrData = new LivePayload()
+ {
+ CurrJwd = InitialJwd,
+ SvgPreview = currSvg,
+ DictShape = currGroupShape,
+ DictOptionsXml = currHwOption
+ };
+ DLService.PipeSvg.EA_NewMessage += PipeSvg_EA_NewMessage;
+ DLService.PipeShape.EA_NewMessage += PipeShape_EA_NewMessage;
+ DLService.PipeHwOpt.EA_NewMessage += PipeHwOption_EA_NewMessage;
+ DLService.PipeProfElement.EA_NewMessage += PipeProfElement_EA_NewMessage;
+ }
+
+ #endregion Protected Methods
+
+ #region Private Fields
+
+ private string apiUrl = "";
+ private string calcTag = "";
+ private string CalcUid = "CurrWindow";
+ private string windowUid = "CurrWindow";
+ private string cFileHardware = "Hardware/Setup.json";
+ private string currSvg = "";
+ private string GenericBasePath = "";
+
+ //private string colorMassUpdate;
+ //private string familyHWMassUpdate;
+ //private string glassMassUpdate;
+ //private Hardware hardwareMassUpdate;
+ //private string materialMassUpdate;
+ //private string profileMassUpdate;
+
+ ///
+ /// Semaforo x definire se sia già in modalità ionterattiva o di prerendering
+ ///
+ private bool isInteractive = false;
+
+ private string outClose = "";
+ private string outSave = "";
+
+ private string imgBasePath = "";
+
+ private string channelHwOpt = "";
+ private string channelShape = "";
+ private string channelProfList = "";
+ private string channelProfElem = "";
+ private string channelSvg = "";
+
+
+ #endregion Private Fields
+
+ #region Private Methods
+
+ ///
+ /// Effettua chiusura oggetto con eventuale save
+ ///
+ ///
+ private void CloseObj(DataSave reqSave)
+ {
+ currJwd = reqSave.currJwd;
+ outClose = !reqSave.ForceSave ? "Richiesto chiusura!" : "";
+ outSave = reqSave.ForceSave ? "Richiesto salvataggio!" : "";
+ }
+
+ private void ConfInit()
+ {
+ apiUrl = Config.GetValue("ServerConf:Prog.ApiUrl") ?? "";
+ imgBasePath = Config.GetValue("ServerConf:ImageBaseUrl") ?? "";
+ GenericBasePath = Config.GetValue("ServerConf:GenericBaseUrl") ?? "";
+ calcTag = Config.GetValue("ServerConf:CalcTag") ?? "";
+ channelSvg = Config.GetValue("ServerConf:ChannelSvg") ?? "";
+ channelShape = Config.GetValue("ServerConf:ChannelShape") ?? "";
+ channelHwOpt = Config.GetValue("ServerConf:ChannelHwOpt") ?? "";
+ channelProfElem = Config.GetValue("ServerConf:ChannelProfElem") ?? "";
+ channelProfList = Config.GetValue("ServerConf:ChannelProfList") ?? "";
+ }
+
+ ///
+ /// Esecuzione azione richiesta
+ ///
+ /// Azione richiesta
+ private void DoAction(DataAction actReq)
+ {
+ switch (actReq)
+ {
+ case DataAction.None:
+ break;
+
+ case DataAction.ResetDictShape:
+ CurrData.DictShape = new Dictionary();
+ break;
+
+ case DataAction.ResetHwOpt:
+ CurrData.DictOptionsXml = new Dictionary();
+ break;
+
+ case DataAction.ResetDimElem:
+ CurrData.ProfElementList = new List();
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ ///
+ /// Esecuzione richiesta
+ ///
+ ///
+ ///
+ private async Task ExecRequest(Dictionary CurrArgs)
+ {
+ // Proseguo solo se sono in interattivo (NO prerender pagina)
+ if (isInteractive)
+ {
+ outClose = "";
+ outSave = "";
+ // verifico se contiene JWD, lo aggiorno
+ if (CurrArgs.ContainsKey("SerializedData"))
+ {
+ currJwd = CurrArgs["SerializedData"];
+ CurrData.CurrJwd = currJwd;
+ }
+ // se il SSE variato --> invio
+ if (!currJwd.Equals(prevJwd) || !EgwCoreLib.Utils.DictUtils.DictAreEqual(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);
+ }
+ }
+ }
+
+ private async void PipeHwOption_EA_NewMessage(object? sender, EventArgs e)
+ {
+ // aggiorno visualizzazione
+ PubSubEventArgs currArgs = (PubSubEventArgs)e;
+ // conversione on-the-fly SVG da mostrare
+ if (!string.IsNullOrEmpty(currArgs.newMessage))
+ {
+ if (currArgs.msgUid.StartsWith($"{channelHwOpt}:{windowUid}") && currArgs.newMessage.Length > 2)
+ {
+ // deserializzo il dizionario delle risposte...
+ Dictionary rawDict = JsonConvert.DeserializeObject>(currArgs.newMessage) ?? new Dictionary();
+ if (rawDict.Count > 0)
+ currHwOption = rawDict;
+ }
+ else
+ {
+ currHwOption = new Dictionary();
+ }
+ CurrData.DictOptionsXml = currHwOption;
+ await InvokeAsync(StateHasChanged);
+ }
+ await Task.Delay(1);
+ }
+
+ private async void PipeShape_EA_NewMessage(object? sender, EventArgs e)
+ {
+ // aggiorno visualizzazione
+ PubSubEventArgs currArgs = (PubSubEventArgs)e;
+ // conversione on-the-fly SVG da mostrare
+ if (!string.IsNullOrEmpty(currArgs.newMessage) && currArgs.newMessage.Length > 2)
+ {
+ if (currArgs.msgUid.StartsWith($"{channelShape}:{windowUid}"))
+ {
+ // deserializzo il dizionario delle risposte...
+ var rawDict = JsonConvert.DeserializeObject>(currArgs.newMessage);
+ currGroupShape = rawDict ?? new Dictionary();
+ CurrData.DictShape = currGroupShape;
+ }
+ await InvokeAsync(StateHasChanged);
+ }
+ await Task.Delay(1);
+ }
+
+ private async void PipeProfElement_EA_NewMessage(object? sender, EventArgs e)
+ {
+ // aggiorno visualizzazione
+ PubSubEventArgs currArgs = (PubSubEventArgs)e;
+ // conversione on-the-fly SVG da mostrare
+ if (!string.IsNullOrEmpty(currArgs.newMessage) && currArgs.newMessage.Length > 2)
+ {
+ if (currArgs.msgUid.StartsWith($"{channelProfElem}:{windowUid}"))
+ {
+ // deserializzo il dizionario delle risposte...
+ var rawDict = JsonConvert.DeserializeObject>(currArgs.newMessage);
+ currElement = rawDict ?? new List();
+ CurrData.ProfElementList = currElement;
+ }
+ await InvokeAsync(StateHasChanged);
+ }
+ await Task.Delay(1);
+ }
+
+ private async void PipeSvg_EA_NewMessage(object? sender, EventArgs e)
+ {
+ // aggiorno visualizzazione
+ PubSubEventArgs currArgs = (PubSubEventArgs)e;
+ // conversione on-the-fly SVG da mostrare
+ if (!string.IsNullOrEmpty(currArgs.newMessage))
+ {
+ if (currArgs.msgUid.Equals($"{channelSvg}:{windowUid}"))
+ {
+ currSvg = currArgs.newMessage;
+ CurrData.SvgPreview = currArgs.newMessage;
+ }
+ await InvokeAsync(StateHasChanged);
+ }
+ await Task.Delay(1);
+ }
+
+ ///
+ /// Rilettura dati
+ ///
+ ///
+ private Task ReloadData()
+ {
+ AvailHardwareList = new List();
+ if (File.Exists(cFileHardware))
+ {
+ string rawValHW = File.ReadAllText(cFileHardware);
+ var rawListHW = JsonConvert.DeserializeObject>(rawValHW) ?? new List();
+ foreach (var item in rawListHW)
+ {
+ AvailHardwareList.Add(item);
+ }
+ }
+ return Task.Delay(100);
+ }
+
+ 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 void RemoveParams(Microsoft.AspNetCore.Components.Web.MouseEventArgs args)
+ {
+ SetupList = new BaseListPayload();
+ }
+ private Task RemoveJwd()
+ {
+ //InitialJwd = "";
+ //currJwd = InitialJwd;
+ CurrData.CurrJwd = "";
+ // rileggo altri dati
+ return ReloadData();
+ }
+ #endregion Private Methods
+ }
+}
\ No newline at end of file
diff --git a/WebWindowComplex/TableComp.razor b/WebWindowComplex/TableComp.razor
index 326fcb8..293ef25 100644
--- a/WebWindowComplex/TableComp.razor
+++ b/WebWindowComplex/TableComp.razor
@@ -4,6 +4,14 @@
{
}
+ else if (!okParams)
+ {
+ Parametri Mancanti!
+ }
+ else if (!okJwd)
+ {
+ JWD Mancante!
+ }
else
{
if (listErrPre != null && listErrPre.Count > 0)
diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs
index f00d73f..fd5a501 100644
--- a/WebWindowComplex/TableComp.razor.cs
+++ b/WebWindowComplex/TableComp.razor.cs
@@ -257,7 +257,7 @@ namespace WebWindowComplex
if (FillList[i].Equals(node))
{
nFill = FillList.Count == 1 ? "" : $"{i + 1}";
- if(node.AreaList.Count == 0)
+ if (node.AreaList.Count == 0)
ItemTableList.Add(new ItemTable(AreaTypes.FILL, "FL" + nFill, maxRow, col, i, 0));
else
ItemTableList.Add(new ItemTable(AreaTypes.FILL, "FL" + nFill, maxRow, col, i, node.AreaList.Count));
@@ -604,7 +604,9 @@ namespace WebWindowComplex
isLoading = true;
// SOLO SE sono presenti...
listErrLink = new Dictionary();
- if (ListPayload.IsPopulated() && LiveData.IsValid())
+ okParams = ListPayload.IsPopulated();
+ okJwd = LiveData.IsValid();
+ if (okParams && okJwd)
{
bool updRequested = false;
listErrPre = new Dictionary();
@@ -650,7 +652,7 @@ namespace WebWindowComplex
listErrLink.Add("Window", $"Deserializing Error:{Environment.NewLine}{ex}");
Log.Error($"Errore nel deserializzare jwd: {ex.Message}");
// uso un oggetto "basico" per non fermarmi
- WindowFromJson =BuildFrameDefault();
+ WindowFromJson = BuildFrameDefault();
await DoPreviewSvg(true);
}
}
@@ -675,7 +677,7 @@ namespace WebWindowComplex
firstDisplay = false;
// preview SVG senza HW
await DoPreviewSvg(true, true);
- if(LiveData.ProfElementList.Count == 0)
+ if (LiveData.ProfElementList.Count == 0)
await UpdateElement(FrameWindow);
}
List reqList = SashList.Select(x => x.GroupId).ToList();
@@ -708,8 +710,8 @@ namespace WebWindowComplex
{
checkErrorPre();
}
- isLoading = false;
}
+ isLoading = false;
}
private JsonWindow BuildFrameDefault()
@@ -751,7 +753,7 @@ namespace WebWindowComplex
frame.AreaList.Add(fill);
JsonWindow jsonWindow = window.Serialize();
string jwd = JsonConvert.SerializeObject(jsonWindow);
- return JsonConvert.DeserializeObject(jwd, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", "");
+ return JsonConvert.DeserializeObject(jwd, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", "");
}
///
@@ -868,7 +870,7 @@ namespace WebWindowComplex
}
}
}
-
+
///
/// Metodo che resetta le liste (sash, split, splitted, fill e itemTable) e le crea nuovamente
///
@@ -893,7 +895,7 @@ namespace WebWindowComplex
Child.Add(item.Row, item.NumChild);
}
}
- else if(RowCollapsed.ContainsKey(item.Row))
+ else if (RowCollapsed.ContainsKey(item.Row))
{
RowCollapsed.Remove(item.Row);
}
@@ -944,6 +946,8 @@ namespace WebWindowComplex
/// Booleana fase loading
///
private bool isLoading = false;
+ private bool okParams = false;
+ private bool okJwd = false;
private bool isRendered = false;
///
@@ -1163,9 +1167,9 @@ namespace WebWindowComplex
/// Metodo per aggiornare il valore collassato degli elementi della gerarchia
///
///
- private void CollapsedRowTree(Dictionary Args)
+ private void CollapsedRowTree(Dictionary Args)
{
- foreach(var item in Args)
+ foreach (var item in Args)
{
RowCollapsed[item.Key] = Args[item.Key] ? true : false;
if (m_ItemTableList.FirstOrDefault(x => x.Row == item.Key) != null)
@@ -1312,7 +1316,7 @@ namespace WebWindowComplex
}
string overlapName = string.Join("_", SpElemList.ElementAt(i).sName.Split('_').Skip(1));
SpElemList.ElementAt(i).SetOverlapElement(Window.m_ParameterList.GetValueOrDefault(overlapName + "_Overlap"));
- }
+ }
break;
}
}
@@ -1343,28 +1347,28 @@ namespace WebWindowComplex
string overlapNameDx = "";
elemList = anta.ElementDimensionList;
List elemOld = elemList;
- foreach(var elem in sash.BottomRailElemDimList)
+ foreach (var elem in sash.BottomRailElemDimList)
{
elem.SetOverlapElement(Window.m_ParameterList.GetValueOrDefault("Sash_BottomRail_Overlap"));
}
if (sash.ParentArea is Frame || (sash.ParentArea.ParentArea is Split split && split.nSplitQtyHoriz == 0))
{
Frame frame = sash.ParentWindow.AreaList.First();
- if(frame.SelThreshold.Name.Contains("Threshold"))
+ if (frame.SelThreshold.Name.Contains("Threshold"))
overlapNameBottom = "Sash_Threshold";
else
overlapNameBottom = "Sash_Bottom";
overlapNameTop = "Sash_Top";
- if(sash.ParentArea is Frame)
+ if (sash.ParentArea is Frame)
{
- if(sash.SashList.Count == 1)
+ if (sash.SashList.Count == 1)
{
overlapNameDx = "Sash_Top";
overlapNameSx = "Sash_Top";
}
else
{
- if(indexAnta == 0)
+ if (indexAnta == 0)
{
overlapNameDx = string.Join("_", elemList.ElementAt(1).sName.Split('_').Skip(1));
overlapNameSx = "Sash_Top";
@@ -1398,7 +1402,7 @@ namespace WebWindowComplex
}
else
{
- if(indexAnta == 0)
+ if (indexAnta == 0)
{
overlapNameDx = string.Join("_", elemList.ElementAt(1).sName.Split('_').Skip(1));
overlapNameSx = "Sash_Top";
@@ -1493,7 +1497,7 @@ namespace WebWindowComplex
else if (sash.ParentArea.ParentArea is Split s && s.nSplitQtyHoriz > 0)
{
int indexAreaSplit = s.AreaList.IndexOf(sash.ParentArea);
- int indexSplit = indexAreaSplit == 0 ? 0 : indexAreaSplit - 1;
+ int indexSplit = indexAreaSplit == 0 ? 0 : indexAreaSplit - 1;
if (indexAreaSplit == 0)
{
overlapNameBottom = "Sash_Bottom";
@@ -1661,7 +1665,7 @@ namespace WebWindowComplex
// cerco il record
var currRec = (Fill?)SearchAreaFromGroupId(FrameWindow, newFill.GroupId);
// lo aggiorno
- if(currRec != null)
+ if (currRec != null)
{
currRec = newFill;
await DoPreviewSvg();
@@ -1794,7 +1798,7 @@ namespace WebWindowComplex
{
if (node.AreaList == null)
return;
- if(node is Sash || node is Split)
+ if (node is Sash || node is Split)
groupId.Add(node.GroupId);
foreach (var child in node.AreaList)
ReqListGroupId(child, groupId);
diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj
index 77cf237..9307516 100644
--- a/WebWindowComplex/WebWindowComplex.csproj
+++ b/WebWindowComplex/WebWindowComplex.csproj
@@ -300,6 +300,8 @@
+
+
diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj
index 1a09ae1..570f86c 100644
--- a/WebWindowConfigurator/WebWindowConfigurator.csproj
+++ b/WebWindowConfigurator/WebWindowConfigurator.csproj
@@ -261,6 +261,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+