diff --git a/WebWindowComplex/Compo/CardFrame.razor.cs b/WebWindowComplex/Compo/CardFrame.razor.cs index 8c2e350..374dd52 100644 --- a/WebWindowComplex/Compo/CardFrame.razor.cs +++ b/WebWindowComplex/Compo/CardFrame.razor.cs @@ -377,6 +377,7 @@ namespace WebWindowComplex.Compo public Frame currFrame { get; set; } = null!; public bool svgNoHw { get; set; } = false; public int groupIdDelete { get; set; } = -1; + public bool reqShape { get; set; } = false; #endregion Public Properties } diff --git a/WebWindowComplex/Compo/CardSashGroup.razor.cs b/WebWindowComplex/Compo/CardSashGroup.razor.cs index 157e26d..685a071 100644 --- a/WebWindowComplex/Compo/CardSashGroup.razor.cs +++ b/WebWindowComplex/Compo/CardSashGroup.razor.cs @@ -81,7 +81,7 @@ namespace WebWindowComplex.Compo #region Protected Properties /// - /// Selezione quantità di ante + /// Selezione quantità di ante /// protected int SashQty { @@ -107,7 +107,7 @@ namespace WebWindowComplex.Compo } /// - /// Selezione quantità bottom rail + /// Selezione quantit� bottom rail /// protected int SashBottomRailQty { diff --git a/WebWindowComplex/Compo/CardTree.razor.cs b/WebWindowComplex/Compo/CardTree.razor.cs index d7a9933..e6bd09c 100644 --- a/WebWindowComplex/Compo/CardTree.razor.cs +++ b/WebWindowComplex/Compo/CardTree.razor.cs @@ -172,7 +172,8 @@ namespace WebWindowComplex.Compo var args = new DataUpdateFrame() { currFrame = FrameWindow, - svgNoHw = true + svgNoHw = true, + reqShape = true }; await EC_ReqElement.InvokeAsync(FrameWindow); await EC_UpdateFrame.InvokeAsync(args); diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index 330397e..bb67bc9 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -28,9 +28,14 @@ namespace WebWindowComplex ReqHwOpt, /// - /// Richiesta svg + /// Richiesta svg senza hw /// - ReqSvg, + ReqSvgNoHw, + + /// + /// Richiesta svg con hw + /// + ReqSvgWithHw, /// /// Richiesta shape sash group @@ -121,11 +126,12 @@ namespace WebWindowComplex protected override async Task OnAfterRenderAsync(bool firstRender) { - if (forceSvgUpdate) + if (forceSvgUpdate && prevReq != (int)DataReq.ReqSvgNoHw && prevReq != (int)DataReq.ReqElement) { firstDisplay = false; forceSvgUpdate = false; // preview SVG senza HW + if(prevReq != (int)DataReq.ReqSvgWithHw) await DoPreviewSvg(true, true); if (LiveData.ProfElementList.Count == 0) await UpdateElement(FrameWindow); @@ -163,10 +169,12 @@ namespace WebWindowComplex // controllo elenchi BasePayload siano validi... if (ListPayload.IsValid()) { + bool calculateSvg = false; // SOLO SE modificato live data... if (prevLiveData == null || !prevLiveData.Equals(LiveData)) { bool needDeser = prevLiveData == null || !prevLiveData.JwdEqual(LiveData); + calculateSvg = prevLiveData == null || !prevLiveData.DictShape.Equals(LiveData.DictShape); updRequested = true; prevLiveData = new LivePayload() { @@ -205,7 +213,7 @@ namespace WebWindowComplex Log.Error($"Errore nel deserializzare jwd: {ex.Message}"); // costruisco una finestra base WindowFromJson = BuildWindowDefault(); - await DoPreviewSvg(true); + await DoPreviewSvg(false); } } else @@ -222,9 +230,10 @@ namespace WebWindowComplex if (updRequested) { // se mancasse dizionario forme chiamo quello - if (LiveData.DictShape.Count == 0 && listErrLink.Count == 0) + if (LiveData.DictShape.Count == 0 && listErrLink.Count == 0 && !waitShape) { - if (firstDisplay && isRendered) + waitShape = true; + if (firstDisplay && isRendered && prevReq!=(int)DataReq.ReqSvgNoHw) { firstDisplay = false; // preview SVG senza HW @@ -242,16 +251,14 @@ namespace WebWindowComplex await DoReqShape(reqList); } } + else if (LiveData.DictShape.Count > 0 && calculateSvg) + { + await DoPreviewSvg(); + } else { - // chiedo SVG - if (prevReq != (int)DataReq.ReqSvg || !prevLiveData.JwdEqual(LiveData.CurrJwd)) - { - if (prevReq != (int)DataReq.ReqHwOpt) - await DoPreviewSvg(true); - else if (LiveData.DictOptionsXml.Count > 0) - await DoPreviewSvg(true); - } + if(prevReq != (int)DataReq.ReqSvgWithHw && SashGroupList.Count > 0) + await DoPreviewSvg(); } } } @@ -274,6 +281,8 @@ namespace WebWindowComplex #region Private Fields + private bool waitShape = false; + private static Logger Log = LogManager.GetCurrentClassLogger(); private int currAntaIndex = 0; @@ -881,11 +890,12 @@ namespace WebWindowComplex var CalcJwd = JsonConvert.SerializeObject(m_CurrWindow.Serialize(hideHw)); #endif // verifico variazione JWD - if (!prevJwd.Equals(CurrJwd) || doForce || prevReq != (int)DataReq.ReqSvg) + if (!prevJwd.Equals(CurrJwd) || doForce || (prevReq != (int)DataReq.ReqSvgWithHw && prevReq != (int)DataReq.ReqSvgNoHw)) { - Log.Info("Richiesta svg"); + string stringLog = "Richiesta svg " + (hideHw ? "senza" : "con") + " hw"; + Log.Info(stringLog); prevJwd = CurrJwd; - prevReq = (int)DataReq.ReqSvg; + prevReq = hideHw ? (int)DataReq.ReqSvgNoHw : (int)DataReq.ReqSvgWithHw; Dictionary Args = new Dictionary(); Args.Add("Mode", $"{(int)Enums.QuestionModes.PREVIEW}"); Args.Add("SerializedData", CalcJwd); @@ -1533,6 +1543,7 @@ namespace WebWindowComplex // se ho i dizionari delle forme le aggiungo if (LiveData.DictShape.Count > 0) { + waitShape = false; // Inserisco le forme ricevuto nei sash group foreach (var item in LiveData.DictShape) { @@ -1772,6 +1783,10 @@ namespace WebWindowComplex RowCollapsed.Remove(args.groupIdDelete); if (newFrame != null) { + // richiedo update shape + List reqList = SashGroupList.Select(x => x.GroupId).ToList(); + if (args.reqShape) + await DoReqShape(reqList); // cerco il record var currRec = m_CurrWindow?.AreaList.FirstOrDefault(x => x.GroupId == newFrame.GroupId); // lo aggiorno @@ -1869,7 +1884,7 @@ namespace WebWindowComplex UpdateLists(); // richiedo update shape List reqList = SashGroupList.Select(x => x.GroupId).ToList(); - await DoPreviewSvg(); + //await DoPreviewSvg(); await UpdateElement(FrameWindow); await DoReqShape(reqList); } diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index 8b02bb2..0a17b20 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.3.2010 + 3.1.3.2016 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -59,6 +59,8 @@ + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 9d35a03..7d810dc 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.3.2010 + 3.1.3.2016 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -55,6 +55,13 @@ + + + + + + +