diff --git a/Test.UI/Components/Pages/EditJWD.razor.cs b/Test.UI/Components/Pages/EditJWD.razor.cs index 86fc4a0..adf65ad 100644 --- a/Test.UI/Components/Pages/EditJWD.razor.cs +++ b/Test.UI/Components/Pages/EditJWD.razor.cs @@ -350,7 +350,7 @@ namespace Test.UI.Components.Pages DLService.PipeSvg.EA_NewMessage += PipeSvg_EA_NewMessage; DLService.PipeShape.EA_NewMessage += PipeShape_EA_NewMessage; DLService.PipeHwOpt.EA_NewMessage += PipeHwOption_EA_NewMessage; - //DLService.PipeAreaProfile.EA_NewMessage += PipeAreaProfile_EA_NewMessage; + DLService.PipeProfElement.EA_NewMessage += PipeProfElement_EA_NewMessage; } #endregion Protected Methods @@ -384,7 +384,8 @@ namespace Test.UI.Components.Pages private string channelHwOpt = ""; private string channelShape = ""; - private string chProfElem = ""; + private string channelProfList = ""; + private string channelProfElem = ""; private string channelSvg = ""; #endregion Private Fields @@ -410,6 +411,8 @@ namespace Test.UI.Components.Pages 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") ?? ""; } /// @@ -516,7 +519,7 @@ namespace Test.UI.Components.Pages // conversione on-the-fly SVG da mostrare if (!string.IsNullOrEmpty(currArgs.newMessage) && currArgs.newMessage.Length > 2) { - if (currArgs.msgUid.StartsWith($"{chProfElem}:{windowUid}")) + if (currArgs.msgUid.StartsWith($"{channelProfElem}:{windowUid}")) { // deserializzo il dizionario delle risposte... var rawDict = JsonConvert.DeserializeObject>(currArgs.newMessage); diff --git a/Test.UI/appsettings.json b/Test.UI/appsettings.json index 92e2391..fcc297e 100644 --- a/Test.UI/appsettings.json +++ b/Test.UI/appsettings.json @@ -17,6 +17,7 @@ "ChannelShape": "lux:shape:curr", "ChannelHwList": "lux:hw:list", "ChannelHwOpt": "lux:hw:opt", + "ChannelProfElem": "lux:prof:elem", "ChannelProfList": "lux:prof:list", "ChannelBom": "lux:bom", "ChannelUpdate": "lux:update", diff --git a/WebWindowComplex/Compo/AreaSash.razor.cs b/WebWindowComplex/Compo/AreaSash.razor.cs index 96899dd..05fa97e 100644 --- a/WebWindowComplex/Compo/AreaSash.razor.cs +++ b/WebWindowComplex/Compo/AreaSash.razor.cs @@ -56,7 +56,7 @@ namespace WebWindowComplex.Compo /// Evento per aggiornare sash /// [Parameter] - public EventCallback EC_UpdateSash { get; set; } + public EventCallback EC_UpdateSash { get; set; } /// /// Evento per cambiare modalità di visualizzazione @@ -209,6 +209,7 @@ namespace WebWindowComplex.Compo await EC_UpdateSashDim.InvokeAsync(CurrSashDim); } } + /// /// Aggiornamento element /// @@ -225,6 +226,7 @@ namespace WebWindowComplex.Compo await EC_UpdateSashDim.InvokeAsync(CurrSashDim); } } + /// /// Metodo per cambiare l'anta su cui è presente la maniglia /// @@ -270,7 +272,12 @@ namespace WebWindowComplex.Compo } CurrSashGroup.RefreshHardwareList(); CurrSashGroup.SetFirstHardware(); - await EC_UpdateSash.InvokeAsync(CurrSashGroup); + DataUpdateProfile args = new DataUpdateProfile() + { + sash = CurrSashGroup, + reqProfile = true + }; + await EC_UpdateSash.InvokeAsync(args); } /// @@ -294,7 +301,11 @@ namespace WebWindowComplex.Compo CurrSashDim.ElementDimensionList.ElementAt(1).dDimension + CurrSashDim.ElementDimensionList.ElementAt(3).dDimension; } - await EC_UpdateSash.InvokeAsync(CurrSashGroup); + DataUpdateProfile args = new DataUpdateProfile() + { + sash = CurrSashGroup + }; + await EC_UpdateSash.InvokeAsync(args); } } @@ -312,8 +323,13 @@ namespace WebWindowComplex.Compo // Creo la copia dell'anta scelta Area a = CurrSashGroup.AreaList[IndexCopy].AreaList.First().Copy(sashSplitted); // Aggiungo copia all'anta selezionata - CurrSashGroup.AreaList[IndexModify].AreaList.Add(a); - await EC_UpdateSash.InvokeAsync(CurrSashGroup); + CurrSashGroup.AreaList[IndexModify].AreaList.Add(a); + DataUpdateProfile args = new DataUpdateProfile() + { + sash = CurrSashGroup, + reqProfile = true + }; + await EC_UpdateSash.InvokeAsync(args); } /// @@ -323,7 +339,12 @@ namespace WebWindowComplex.Compo private async Task AddSplitToSash() { CurrAnta.AddSplit(); - await EC_UpdateSash.InvokeAsync(CurrSashGroup); + DataUpdateProfile args = new DataUpdateProfile() + { + sash = CurrSashGroup, + reqProfile = true + }; + await EC_UpdateSash.InvokeAsync(args); } private bool isOpen = false; @@ -390,4 +411,10 @@ namespace WebWindowComplex.Compo public int IndexSashClose { get; set; } } + public class DataUpdateProfile + { + public Sash sash { get; set; } + public bool reqProfile { get; set; } = false; + } + } \ No newline at end of file diff --git a/WebWindowComplex/Compo/CardFrame.razor.cs b/WebWindowComplex/Compo/CardFrame.razor.cs index e7ce2f2..eb8b167 100644 --- a/WebWindowComplex/Compo/CardFrame.razor.cs +++ b/WebWindowComplex/Compo/CardFrame.razor.cs @@ -33,7 +33,7 @@ namespace WebWindowComplex.Compo public EventCallback EC_UpdateFrame { get; set; } /// - /// Evento per richiesta Element + /// Evento per richiesta profili degli Element /// [Parameter] public EventCallback EC_ReqElement { get; set; } @@ -161,6 +161,7 @@ namespace WebWindowComplex.Compo svgNoHw = true }; await EC_UpdateFrame.InvokeAsync(args); + await EC_ReqElement.InvokeAsync(CurrFrameWindow); } /// @@ -178,6 +179,8 @@ namespace WebWindowComplex.Compo await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req=LayoutConst.DataAction.ResetDictShape}); await EC_ReqOptionHw.InvokeAsync(CurrFrameWindow); await EC_UpdateFrame.InvokeAsync(args); + await EC_ReqElement.InvokeAsync(CurrFrameWindow); + } /// @@ -228,6 +231,7 @@ namespace WebWindowComplex.Compo }; await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetDictShape }); await EC_UpdateFrame.InvokeAsync(args); + await EC_ReqElement.InvokeAsync(CurrFrameWindow); } } diff --git a/WebWindowComplex/Compo/CardSashGroup.razor.cs b/WebWindowComplex/Compo/CardSashGroup.razor.cs index 6848417..7bf630b 100644 --- a/WebWindowComplex/Compo/CardSashGroup.razor.cs +++ b/WebWindowComplex/Compo/CardSashGroup.razor.cs @@ -57,6 +57,12 @@ namespace WebWindowComplex.Compo [Parameter] public EventCallback EC_UpdateSashGroup { get; set; } + /// + /// Evento per richiesta profili degli Element + /// + [Parameter] + public EventCallback EC_ReqElement { get; set; } + /// /// Lista di sash /// @@ -89,8 +95,10 @@ namespace WebWindowComplex.Compo currSash = CurrSashGroup, svgNoHw = true }; + _ = EC_UpdateSashGroup.InvokeAsync(args); _ = EC_ReqOptionHw.InvokeAsync(CurrSashGroup); + _ = EC_ReqElement.InvokeAsync(CurrSashGroup); } } } @@ -242,6 +250,7 @@ namespace WebWindowComplex.Compo currSash = CurrSashGroup }; await EC_UpdateSashGroup.InvokeAsync(args); + await EC_ReqElement.InvokeAsync(CurrSashGroup); } } @@ -250,16 +259,18 @@ namespace WebWindowComplex.Compo /// /// /// - protected async Task UpdateSash(Sash updateS) + protected async Task UpdateSash(DataUpdateProfile updateS) { if (updateS != null) { - CurrSashGroup = updateS; + CurrSashGroup = updateS.sash; var args = new DataUpdateSash { currSash = CurrSashGroup }; await EC_UpdateSashGroup.InvokeAsync(args); + if (updateS.reqProfile) + await EC_ReqElement.InvokeAsync(CurrSashGroup); } } diff --git a/WebWindowComplex/TableComp.razor b/WebWindowComplex/TableComp.razor index f150904..f6200f6 100644 --- a/WebWindowComplex/TableComp.razor +++ b/WebWindowComplex/TableComp.razor @@ -93,7 +93,7 @@ @@ -141,6 +141,7 @@ EC_ReqResetDict="ReqResetDict" EC_ReqOptionHw="UpdateHwOptionsSash" EC_ReqFirstOptionHw="ReqFirstOptionHw" + EC_ReqElement="UpdateElementSash" EC_ReqClose="ReturnTree"> diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index 59cb6bc..a236cfa 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -764,7 +764,7 @@ namespace WebWindowComplex // Inserisco i profili ricevuti nei rispettivi Element foreach (var item in LiveData.ProfElementList) { - UpdateProfileElement(item.Profiles, item.GroupId, item.SashId < 1 ? -1: item.SashId); + UpdateProfileElement(item.Profiles, item.GroupId, item.EntId); } } } @@ -1100,55 +1100,60 @@ namespace WebWindowComplex /// /// Lista dei profili /// Id Area che si sta cercando - /// Id dell'anta (se -1 non usare) + /// Id dell'anta (se -1 non usare) /// - private void UpdateProfileElement(List profileNameList, int GroupIdSearch, int SashIdSearch) + private void UpdateProfileElement(List profileNameList, int GroupIdSearch, int EntityIdSearch) { // Cerco area corrispondente al GroupId - Area found = SearchAreaFromGroupId(FrameWindow, SashIdSearch); - switch (found.AreaType) + Area? found = SearchAreaFromGroupId(FrameWindow, GroupIdSearch); + if(found != null) { - case AreaTypes.FRAME: - { - Frame frame = (Frame)found; - for(int i = 0; i < frame.ElementDimensionList.Count; i++) + switch (found.AreaType) + { + case AreaTypes.FRAME: { - frame.ElementDimensionList.ElementAt(i).SetNameElement(profileNameList.ElementAt(i)); + Frame frame = (Frame)found; + for(int i = 0; i < frame.ElementDimensionList.Count; i++) + { + frame.ElementDimensionList.ElementAt(i).SetNameElement(profileNameList.ElementAt(i)); + } + break; } - break; - } - case AreaTypes.SASH: - { - Sash sash = (Sash)found; - SashDimension anta = sash.SashList.ElementAt(SashIdSearch); - for(int index = anta.ElementDimensionList.Count; index < profileNameList.Count; index++) + case AreaTypes.SASH: { - double valStd = Window.m_ParameterList.GetValueOrDefault(profileNameList.ElementAt(index) + "_DimStd"); - anta.ElementDimensionList.Add(new ElementDimension(sash, index + 1, valStd)); + Sash sash = (Sash)found; + SashDimension anta = sash.SashList.ElementAt(EntityIdSearch - 1); + for(int index = anta.ElementDimensionList.Count; index < profileNameList.Count; index++) + { + double valStd = Window.m_ParameterList.GetValueOrDefault(profileNameList.ElementAt(index) + "_DimStd"); + anta.ElementDimensionList.Add(new ElementDimension(sash, index + 1, valStd)); + } + for (int i = 0; i < anta.ElementDimensionList.Count; i++) + { + anta.ElementDimensionList.ElementAt(i).SetNameElement(profileNameList.ElementAt(i)); + } + break; } - for (int i = 0; i < anta.ElementDimensionList.Count; i++) + case AreaTypes.SPLIT: { - anta.ElementDimensionList.ElementAt(i).SetNameElement(profileNameList.ElementAt(i)); + Split split = (Split)found; + if (split.bSplitStartVert) + { + for (int i = 0; i < split.ElemDimVertList.Count; i++) + { + split.ElemDimVertList.ElementAt(i).SetNameElement(profileNameList.ElementAt(i)); + } + } + else + { + for (int i = 0; i < split.ElemDimHorizList.Count; i++) + { + split.ElemDimHorizList.ElementAt(i).SetNameElement(profileNameList.ElementAt(i)); + } + } + break; } - break; - } - case AreaTypes.SPLIT: - { - Split split = (Split)found; - for (int i = 0; i < split.ElemDimVertList.Count; i++) - { - split.ElemDimVertList.ElementAt(i).SetNameElement(profileNameList.ElementAt(i)); - } - for (int i = split.ElemDimVertList.Count; i < split.ElemDimHorizList.Count; i++) - { - split.ElemDimHorizList.ElementAt(i).SetNameElement(profileNameList.ElementAt(i)); - } - break; - } - } - foreach (Area child in found.AreaList) - { - UpdateProfileElement(profileNameList, GroupIdSearch, SashIdSearch); + } } } @@ -1301,7 +1306,33 @@ namespace WebWindowComplex } } } - + + private async Task UpdateElementSash(Sash newSash) + { + if (newSash != null) + { + Sash currRec = (Sash)SearchAreaFromGroupId(FrameWindow, newSash.GroupId)!; + currRec = newSash; + await UpdateElement(FrameWindow); + } + } + /// + /// Aggiornamento Element della Window + /// + /// nuovo frame + /// + private async Task UpdateElementFrame(Frame newFrame) + { + if (newFrame != null) + { + // cerco il record + var currRec = m_CurrWindow?.AreaList.FirstOrDefault(x => x.GroupId == newFrame.GroupId); + // lo aggiorno + currRec = newFrame; + // richiedo update element del frame + await UpdateElement(FrameWindow); + } + } /// /// Aggiornamento Element della Window /// @@ -1311,14 +1342,10 @@ namespace WebWindowComplex { if (newFrame != null) { - // cerco il record - var currRec = m_CurrWindow?.AreaList.FirstOrDefault(x => x.GroupId == newFrame.GroupId); - // lo aggiorno - currRec = newFrame; // richiedo update element del frame List reqList = new List(); reqList.Add(FrameWindow.GroupId); - // richiedo update element della sash (se presente) + // richiedo update element della sash (se presenti) if(SashList.Count > 0) { foreach(var item in SashList) @@ -1326,6 +1353,14 @@ namespace WebWindowComplex reqList.Add(item.GroupId); } } + // richiedo update element degli split (se presenti) + if (SplitList.Count > 0) + { + foreach (var item in SplitList) + { + reqList.Add(item.GroupId); + } + } await DoReqElement(reqList); } } diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index 23352db..268bbde 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.8.1.2811 + 2.8.1.2816 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -114,6 +114,28 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 2911eae..c263807 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 2.8.1.2811 + 2.8.1.2816 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -176,6 +176,14 @@ + + + + + + + +