From 7fbc1a5598d2d63f98c40d551966395a20ecd26a Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 4 Feb 2026 17:27:40 +0100 Subject: [PATCH 1/9] Aggiunta analizzatore x async compliance --- Directory.Packages.props | 4 ++++ Test.UI/Test.UI.csproj | 4 ++++ WebWindowComplex/WebWindowComplex.csproj | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/Directory.Packages.props b/Directory.Packages.props index cc64997..353f231 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -4,6 +4,10 @@ false + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + diff --git a/Test.UI/Test.UI.csproj b/Test.UI/Test.UI.csproj index 6776bd9..7f471cd 100644 --- a/Test.UI/Test.UI.csproj +++ b/Test.UI/Test.UI.csproj @@ -29,6 +29,10 @@ + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index 6c7bead..fe5b1c6 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -18,6 +18,10 @@ + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + From 62d9d2f5c8571ad899fa03a08bad6df4bf7d54d2 Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Wed, 4 Feb 2026 18:16:30 +0100 Subject: [PATCH 2/9] Aggiornati metodi async --- Test.UI/Components/Pages/Aedifica.razor.cs | 4 +-- Test.UI/Components/Pages/BaseEdit.razor.cs | 4 +-- Test.UI/Components/Pages/EditJWD.razor.cs | 4 +-- Test.UI/Components/Pages/Home.razor.cs | 4 +-- .../Components/Pages/SimpleEditOld.razor.cs | 4 +-- WebWindowComplex/Compo/AreaFrame.razor.cs | 8 +++--- WebWindowComplex/Compo/AreaHwOption.razor.cs | 8 +++--- WebWindowComplex/Compo/AreaSash.razor.cs | 16 ++++++------ WebWindowComplex/Compo/AreaSplit.razor.cs | 11 +++----- .../Compo/CardArcElement.razor.cs | 9 +++---- WebWindowComplex/Compo/CardFill.razor.cs | 4 +-- WebWindowComplex/Compo/CardFrame.razor.cs | 10 +++---- WebWindowComplex/Compo/CardSashGroup.razor.cs | 26 +++++++------------ WebWindowComplex/Compo/CardSplit.razor.cs | 4 +-- WebWindowComplex/Compo/CardTree.razor.cs | 4 +-- WebWindowComplex/TableComp.razor.cs | 23 ++++++++-------- WebWindowComplex/WebWindowComplex.csproj | 6 ++++- .../WebWindowConfigurator.csproj | 4 ++- WebWindowTest/Test.razor.cs | 3 ++- 19 files changed, 73 insertions(+), 83 deletions(-) diff --git a/Test.UI/Components/Pages/Aedifica.razor.cs b/Test.UI/Components/Pages/Aedifica.razor.cs index 02d45aa..faad37c 100644 --- a/Test.UI/Components/Pages/Aedifica.razor.cs +++ b/Test.UI/Components/Pages/Aedifica.razor.cs @@ -37,12 +37,12 @@ namespace Test.UI.Components.Pages protected Dictionary m_CurrArgs = new Dictionary(); - protected override async Task OnInitializedAsync() + protected override Task OnInitializedAsync() { ConfInit(); DLService.PipeSvg.EA_NewMessage += PipeSvg_EA_NewMessage; //await ReloadData(); - await Task.Delay(1); + return Task.Delay(1); } private void ConfInit() diff --git a/Test.UI/Components/Pages/BaseEdit.razor.cs b/Test.UI/Components/Pages/BaseEdit.razor.cs index 96bd8e4..48bd8d7 100644 --- a/Test.UI/Components/Pages/BaseEdit.razor.cs +++ b/Test.UI/Components/Pages/BaseEdit.razor.cs @@ -514,7 +514,7 @@ namespace Test.UI.Components.Pages /// Rilettura dati /// /// - private async Task ReloadData() + private Task ReloadData() { //return base.OnInitializedAsync(); AvailHardwareList = new List(); @@ -527,7 +527,7 @@ namespace Test.UI.Components.Pages AvailHardwareList.Add(item); } } - await Task.Delay(100); + return Task.Delay(100); } private void updateInfoJwd(string currSer, string? newFamilyHardware, Hardware? newHardware, string? newColorMaterial, string? newMaterial, string? newGlass, string? newProfile) diff --git a/Test.UI/Components/Pages/EditJWD.razor.cs b/Test.UI/Components/Pages/EditJWD.razor.cs index 8e1dcad..a9107f6 100644 --- a/Test.UI/Components/Pages/EditJWD.razor.cs +++ b/Test.UI/Components/Pages/EditJWD.razor.cs @@ -585,7 +585,7 @@ namespace Test.UI.Components.Pages /// Rilettura dati /// /// - private async Task ReloadData() + private Task ReloadData() { AvailHardwareList = new List(); if (File.Exists(cFileHardware)) @@ -597,7 +597,7 @@ namespace Test.UI.Components.Pages AvailHardwareList.Add(item); } } - await Task.Delay(100); + return Task.Delay(100); } private void updateInfoJwd(string currSer, string? newFamilyHardware, Hardware? newHardware, string? newColorMaterial, string? newMaterial, string? newGlass, string? newProfile) diff --git a/Test.UI/Components/Pages/Home.razor.cs b/Test.UI/Components/Pages/Home.razor.cs index 9efeaad..09fc270 100644 --- a/Test.UI/Components/Pages/Home.razor.cs +++ b/Test.UI/Components/Pages/Home.razor.cs @@ -115,7 +115,7 @@ namespace Test.UI.Components.Pages isInteractive = true; } } - protected override async Task OnInitializedAsync() + protected override Task OnInitializedAsync() { ConfInit(); Random random = new Random(); @@ -124,7 +124,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; - await ReloadData(); + return ReloadData(); } #endregion Protected Methods diff --git a/Test.UI/Components/Pages/SimpleEditOld.razor.cs b/Test.UI/Components/Pages/SimpleEditOld.razor.cs index 52d2709..292c672 100644 --- a/Test.UI/Components/Pages/SimpleEditOld.razor.cs +++ b/Test.UI/Components/Pages/SimpleEditOld.razor.cs @@ -329,7 +329,7 @@ namespace Test.UI.Components.Pages /// Rilettura dati /// /// - private async Task ReloadData() + private Task ReloadData() { //return base.OnInitializedAsync(); AvailHardwareList = new List(); @@ -342,7 +342,7 @@ namespace Test.UI.Components.Pages AvailHardwareList.Add(item); } } - await Task.Delay(100); + return Task.Delay(100); } #endregion Private Methods diff --git a/WebWindowComplex/Compo/AreaFrame.razor.cs b/WebWindowComplex/Compo/AreaFrame.razor.cs index b4c30d0..48180ac 100644 --- a/WebWindowComplex/Compo/AreaFrame.razor.cs +++ b/WebWindowComplex/Compo/AreaFrame.razor.cs @@ -39,18 +39,18 @@ namespace WebWindowComplex.Compo /// Sollevo evento richiesta aggiunta sash su frame /// /// - private async Task RaiseAddSash() + private Task RaiseAddSash() { - await EC_AddSash.InvokeAsync(true); + return EC_AddSash.InvokeAsync(true); } /// /// Sollevo evento richiesta aggiunta split su frame /// /// - private async Task RaiseAddSplit() + private Task RaiseAddSplit() { - await EC_AddSplit.InvokeAsync(true); + return EC_AddSplit.InvokeAsync(true); } #endregion Private Methods diff --git a/WebWindowComplex/Compo/AreaHwOption.razor.cs b/WebWindowComplex/Compo/AreaHwOption.razor.cs index ecdf397..f184a3d 100644 --- a/WebWindowComplex/Compo/AreaHwOption.razor.cs +++ b/WebWindowComplex/Compo/AreaHwOption.razor.cs @@ -58,13 +58,13 @@ namespace WebWindowComplex.Compo /// /// /// - private async Task RaiseOptCombo(AGBOptionCombo updRec) + private Task RaiseOptCombo(AGBOptionCombo updRec) { var args = new DataUpdateHwOption { AGBOptCombo = updRec }; - await EC_UpdateHwOpt.InvokeAsync(args); + return EC_UpdateHwOpt.InvokeAsync(args); } /// @@ -72,13 +72,13 @@ namespace WebWindowComplex.Compo /// /// /// - private async Task RaiseOptText(AGBOptionText updRec) + private Task RaiseOptText(AGBOptionText updRec) { var args = new DataUpdateHwOption { AGBOptText = updRec }; - await EC_UpdateHwOpt.InvokeAsync(args); + return EC_UpdateHwOpt.InvokeAsync(args); } private bool IsLoadingHwOpt diff --git a/WebWindowComplex/Compo/AreaSash.razor.cs b/WebWindowComplex/Compo/AreaSash.razor.cs index a4eaf32..3ad50dc 100644 --- a/WebWindowComplex/Compo/AreaSash.razor.cs +++ b/WebWindowComplex/Compo/AreaSash.razor.cs @@ -193,11 +193,11 @@ namespace WebWindowComplex.Compo /// Sollevo evento richiesta per cambiare tutti i Joint /// /// - private async Task ChangeAllJoints(Json.WindowConst.Joints JointType) + private Task ChangeAllJoints(Json.WindowConst.Joints JointType) { foreach (var item in CurrSashDim.JointList) item.SetSelJointType(JointType); - await EC_UpdateSashDim.InvokeAsync(CurrSashDim); + return EC_UpdateSashDim.InvokeAsync(CurrSashDim); } /// @@ -238,7 +238,7 @@ namespace WebWindowComplex.Compo /// Metodo per cambiare l'anta su cui è presente la maniglia /// /// - private async Task ChangeHandle() + private Task ChangeHandle() { // Cerco la Sash che si sta considerando nella lista Sash var s = SashList.Where(x => x.GroupId == CurrSashGroup.GroupId).FirstOrDefault(); @@ -284,14 +284,14 @@ namespace WebWindowComplex.Compo sash = CurrSashGroup, reqProfile = true }; - await EC_UpdateSash.InvokeAsync(args); + return EC_UpdateSash.InvokeAsync(args); } /// /// Copio contenuto anta da indexCopy a IndexModify /// /// - private async Task CopyContentSash(int IndexCopy, int IndexModify) + private Task CopyContentSash(int IndexCopy, int IndexModify) { isOpen = !isOpen; // Anta selezionata @@ -307,14 +307,14 @@ namespace WebWindowComplex.Compo sash = CurrSashGroup, reqProfile = true }; - await EC_UpdateSash.InvokeAsync(args); + return EC_UpdateSash.InvokeAsync(args); } /// /// Metodo per aggiungere lo split nella singola anta /// /// - private async Task AddSplitToSash() + private Task AddSplitToSash() { CurrAnta.AddSplit(); DataUpdateProfile args = new DataUpdateProfile() @@ -322,7 +322,7 @@ namespace WebWindowComplex.Compo sash = CurrSashGroup, reqProfile = true }; - await EC_UpdateSash.InvokeAsync(args); + return EC_UpdateSash.InvokeAsync(args); } private bool isOpen = false; diff --git a/WebWindowComplex/Compo/AreaSplit.razor.cs b/WebWindowComplex/Compo/AreaSplit.razor.cs index aba53c8..3594d1a 100644 --- a/WebWindowComplex/Compo/AreaSplit.razor.cs +++ b/WebWindowComplex/Compo/AreaSplit.razor.cs @@ -40,26 +40,23 @@ namespace WebWindowComplex.Compo /// Metodo per copiare sash /// /// - private async Task RaiseCopySash(int indexCurrSash) + private Task RaiseCopySash(int indexCurrSash) { - //Rimuovo contenuto di Splitted e rimuovo area da conteggio gruppi CurrSplitted.AreaList.RemoveAll(i => i != null); - // Copio sash Area a = SashList[indexCurrSash].Copy(CurrSplitted); a.SetParentArea(CurrSplitted); - // Aggiungo copia a Splitted CurrSplitted.AreaList.Add(a); - await EC_UpdateSplitted.InvokeAsync(CurrSplitted); + return EC_UpdateSplitted.InvokeAsync(CurrSplitted); } /// /// Metodo per aggiungere prima sash /// /// - private async Task RaiseAddSash() + private Task RaiseAddSash() { CurrSplitted.AddFirstSash(); - await EC_UpdateSplitted.InvokeAsync(CurrSplitted); + return EC_UpdateSplitted.InvokeAsync(CurrSplitted); } #endregion Private Methods diff --git a/WebWindowComplex/Compo/CardArcElement.razor.cs b/WebWindowComplex/Compo/CardArcElement.razor.cs index 6d9646a..aac2d0e 100644 --- a/WebWindowComplex/Compo/CardArcElement.razor.cs +++ b/WebWindowComplex/Compo/CardArcElement.razor.cs @@ -28,13 +28,10 @@ namespace WebWindowComplex.Compo #endregion Public Properties - private async Task UpdatePreview() + private Task UpdatePreview() { - var args = new DataUpdateFrame - { - currFrame = CurrFrame - }; - await EC_UpdatePreview.InvokeAsync(args); + var args = new DataUpdateFrame { currFrame = CurrFrame }; + return EC_UpdatePreview.InvokeAsync(args); } private async Task UpdatePreviewSash(Sash CurrSashGRoup) diff --git a/WebWindowComplex/Compo/CardFill.razor.cs b/WebWindowComplex/Compo/CardFill.razor.cs index f1e1c36..e392a10 100644 --- a/WebWindowComplex/Compo/CardFill.razor.cs +++ b/WebWindowComplex/Compo/CardFill.razor.cs @@ -47,10 +47,10 @@ namespace WebWindowComplex.Compo /// /// tipo di fill richiesto /// - protected async Task ChangeOneFill(FillTypes reqFillType) + protected Task ChangeOneFill(FillTypes reqFillType) { CurrFill.SetFillType(reqFillType); - await EC_UpdateFill.InvokeAsync(CurrFill); + return EC_UpdateFill.InvokeAsync(CurrFill); } #endregion Protected Methods diff --git a/WebWindowComplex/Compo/CardFrame.razor.cs b/WebWindowComplex/Compo/CardFrame.razor.cs index 72c3603..f5f13ba 100644 --- a/WebWindowComplex/Compo/CardFrame.razor.cs +++ b/WebWindowComplex/Compo/CardFrame.razor.cs @@ -191,7 +191,7 @@ namespace WebWindowComplex.Compo /// Metodo per cambiare tutti i joint /// /// - private async Task ChangeAllJoints(Json.WindowConst.Joints JointType, Area a) + private Task ChangeAllJoints(Json.WindowConst.Joints JointType, Area a) { if (a is Frame) { @@ -200,12 +200,8 @@ namespace WebWindowComplex.Compo joint.SetSelJointType(JointType); } } - var args = new DataUpdateFrame() - { - currFrame = CurrFrameWindow, - svgNoHw = false - }; - await EC_UpdateFrame.InvokeAsync(args); + var args = new DataUpdateFrame() { currFrame = CurrFrameWindow, svgNoHw = false }; + return EC_UpdateFrame.InvokeAsync(args); } /// diff --git a/WebWindowComplex/Compo/CardSashGroup.razor.cs b/WebWindowComplex/Compo/CardSashGroup.razor.cs index da4f366..608ce00 100644 --- a/WebWindowComplex/Compo/CardSashGroup.razor.cs +++ b/WebWindowComplex/Compo/CardSashGroup.razor.cs @@ -255,19 +255,15 @@ namespace WebWindowComplex.Compo /// /// /// - protected async Task SetMeasureType(MeasureTypes type) + protected Task SetMeasureType(MeasureTypes type) { isOpen = !isOpen; - for(int i = 0; i < CurrSashGroup.SashList.Count; i++) + for (int i = 0; i < CurrSashGroup.SashList.Count; i++) { CurrSashGroup.SashList.ElementAt(i).SetSelMeasureType(type, i); } - var args = new DataUpdateSash - { - currSash = CurrSashGroup, - noSvg = true - }; - await EC_UpdateSashGroup.InvokeAsync(args); + var args = new DataUpdateSash { currSash = CurrSashGroup, noSvg = true }; + return EC_UpdateSashGroup.InvokeAsync(args); } /// @@ -331,9 +327,9 @@ namespace WebWindowComplex.Compo } } - protected async Task ResetDict(DataUpdateRes args) + protected Task ResetDict(DataUpdateRes args) { - await EC_ReqResetDict.InvokeAsync(args); + return EC_ReqResetDict.InvokeAsync(args); } #endregion Protected Methods @@ -407,14 +403,10 @@ namespace WebWindowComplex.Compo /// /// /// - private async Task FirstHwOptionList() + private Task FirstHwOptionList() { - var args = new DataUpdateSash - { - currSash = CurrSashGroup - }; - //await EC_UpdatePreview.InvokeAsync(args); - await EC_ReqFirstOptionHw.InvokeAsync(CurrSashGroup); + var args = new DataUpdateSash { currSash = CurrSashGroup }; + return EC_ReqFirstOptionHw.InvokeAsync(CurrSashGroup); } private string ButtonMeasureCss(MeasureTypes type) diff --git a/WebWindowComplex/Compo/CardSplit.razor.cs b/WebWindowComplex/Compo/CardSplit.razor.cs index 40efacc..95c5e5a 100644 --- a/WebWindowComplex/Compo/CardSplit.razor.cs +++ b/WebWindowComplex/Compo/CardSplit.razor.cs @@ -313,7 +313,7 @@ namespace WebWindowComplex.Compo /// /// nuovo tipo /// - protected async Task SetMeasureType(MeasureTypes type) + protected Task SetMeasureType(MeasureTypes type) { isOpen = !isOpen; foreach (var item in CurrSplit.SplitVertList) @@ -329,7 +329,7 @@ namespace WebWindowComplex.Compo currSplit = CurrSplit, noSvg = true }; - await EC_UpdateSplit.InvokeAsync(args); + return EC_UpdateSplit.InvokeAsync(args); } } diff --git a/WebWindowComplex/Compo/CardTree.razor.cs b/WebWindowComplex/Compo/CardTree.razor.cs index ad4d1b5..3309ac6 100644 --- a/WebWindowComplex/Compo/CardTree.razor.cs +++ b/WebWindowComplex/Compo/CardTree.razor.cs @@ -32,14 +32,14 @@ namespace WebWindowComplex.Compo /// Metodo per richiesta prossimo step /// /// - private async Task RaiseNextStep(CompileStep cs, int indexStep) + private Task RaiseNextStep(CompileStep cs, int indexStep) { var Args = new DataNextStep { currCompileStep = cs, index = indexStep, }; - await EC_NextStep.InvokeAsync(Args); + return EC_NextStep.InvokeAsync(Args); } //private async Task Remove(CompileStep cs, int indexStep) diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index 0fb1fe4..042d94e 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -389,10 +389,10 @@ namespace WebWindowComplex /// Richiesta chiusura SENZA salvataggio (= restore prev) /// /// - protected async Task DoClose() + protected Task DoClose() { editLock = false; - await EC_OnClose.InvokeAsync(false); + return EC_OnClose.InvokeAsync(false); } /// @@ -519,8 +519,9 @@ namespace WebWindowComplex /// /// Metodo di reset /// - protected async Task DoReset() + protected Task DoReset() { + return Task.CompletedTask; // Da fare } @@ -528,11 +529,11 @@ namespace WebWindowComplex /// Richiesta chiusura con salvataggio /// /// - protected async Task DoSave() + protected Task DoSave() { editLock = false; //manca salvataggio JWD - await EC_OnClose.InvokeAsync(true); + return EC_OnClose.InvokeAsync(true); } protected override void OnAfterRender(bool firstRender) @@ -661,7 +662,7 @@ namespace WebWindowComplex } } - private async Task BuildFrameDefault() + private Task BuildFrameDefault() { // Costruisco window e setto i parametri Window window = new Window(); @@ -702,7 +703,7 @@ namespace WebWindowComplex string jwd = JsonConvert.SerializeObject(jsonWindow); JsonWindow WindowFromJson = JsonConvert.DeserializeObject(jwd, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", ""); setCurrWindow(WindowFromJson); - await DoPreviewSvg(true); + return DoPreviewSvg(true); } /// @@ -1087,9 +1088,9 @@ namespace WebWindowComplex /// Richiesta reset dizionario Shape con action /// /// - private async Task ReqResetDict(DataUpdateRes args) + private Task ReqResetDict(DataUpdateRes args) { - await EC_ActionReq.InvokeAsync(args.req); + return EC_ActionReq.InvokeAsync(args.req); } /// @@ -1284,10 +1285,10 @@ namespace WebWindowComplex /// /// tipo di fill richiesto /// - protected async Task ChangeAllFill(FillTypes reqFillType) + protected Task ChangeAllFill(FillTypes reqFillType) { updateAllFill(FrameWindow, reqFillType); - await DoPreviewSvg(); + return DoPreviewSvg(); } /// diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index fe5b1c6..521971c 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.2.417 + 3.1.2.418 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -74,6 +74,10 @@ + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index fec646c..902517d 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.2.417 + 3.1.2.418 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -95,6 +95,8 @@ + + diff --git a/WebWindowTest/Test.razor.cs b/WebWindowTest/Test.razor.cs index 1e5be91..10e1484 100644 --- a/WebWindowTest/Test.razor.cs +++ b/WebWindowTest/Test.razor.cs @@ -481,8 +481,9 @@ namespace WebWindowTest /// /// Metodo di reset /// - protected async Task DoReset() + protected Task DoReset() { + return Task.CompletedTask; // Da fare } From 5db36307da90bfbc0e185f617c88d692c7f846f0 Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Thu, 5 Feb 2026 10:50:56 +0100 Subject: [PATCH 3/9] Aggiunto NLog --- Directory.Packages.props | 2 + Test.UI/Program.cs | 7 +++ Test.UI/Test.UI.csproj | 2 + Test.UI/appsettings.json | 44 +++++++++++++++++++ WebWindowComplex/TableComp.razor.cs | 17 +++++++ WebWindowComplex/WebWindowComplex.csproj | 14 +++++- .../WebWindowConfigurator.csproj | 3 +- 7 files changed, 87 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 353f231..8cbcbcc 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -17,6 +17,8 @@ + + \ No newline at end of file diff --git a/Test.UI/Program.cs b/Test.UI/Program.cs index cd7c56c..f7388cb 100644 --- a/Test.UI/Program.cs +++ b/Test.UI/Program.cs @@ -1,6 +1,7 @@ using EgwCoreLib.Lux.Data.Services; using Microsoft.Extensions.Configuration; using NLog; +using NLog.Web; using StackExchange.Redis; using System.Reflection; using Test.UI.Client.Pages; @@ -10,7 +11,12 @@ var builder = WebApplication.CreateBuilder(args); var assemblyVersion = Assembly.GetExecutingAssembly().GetName().Version?.ToString(); +var logger = LogManager.Setup() + .LoadConfigurationFromAppSettings() + .GetCurrentClassLogger(); + ConfigurationManager configuration = builder.Configuration; +logger.Info("Program.cs: startup"); // Add services to the container. builder.Services.AddRazorComponents() @@ -36,6 +42,7 @@ var app = builder.Build(); // aggiunt base URL x routing corretto string baseUrl = configuration.GetValue("ServerConf:BaseUrl") ?? ""; app.UsePathBase(baseUrl); +logger.Info($"BaseUrl: {baseUrl}"); // Configure the HTTP request pipeline. if (app.Environment.IsDevelopment()) diff --git a/Test.UI/Test.UI.csproj b/Test.UI/Test.UI.csproj index 7f471cd..e067628 100644 --- a/Test.UI/Test.UI.csproj +++ b/Test.UI/Test.UI.csproj @@ -33,6 +33,8 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all + + diff --git a/Test.UI/appsettings.json b/Test.UI/appsettings.json index fcc297e..8c5f5d9 100644 --- a/Test.UI/appsettings.json +++ b/Test.UI/appsettings.json @@ -6,6 +6,50 @@ "Microsoft.AspNetCore": "Warning" } }, + "NLog": { + "variables": { + "baseFileDir": "${basedir}/logs/", + "layout": "${longdate} | ${uppercase:${level}} | ${logger:shortName=false} | ${message}" + }, + // "internalLogLevel": "Info", + // "internalLogFile": "c:\\temp\\internal-nlog.txt", + "extensions": [ + { "assembly": "NLog.Extensions.Logging" }, + { "assembly": "NLog.Web.AspNetCore" } + ], + "throwConfigExceptions": true, + "targets": { + "async": true, + "logfile": { + "type": "File", + "fileName": "${basedir}/logs/${shortdate}.log", + "layout": "${layout}", + "archiveEvery": "Day", + "archiveFileName": "${basedir}/logs/old/${shortdate}_{#}.log", + "archiveNumbering": "DateAndSequence", + "archiveAboveSize": "1024000", + "archiveDateFormat": "HH", + "maxArchiveFiles": "60", + "maxArchiveDays": "30" + }, + "logconsole": { + "type": "ColoredConsole", + "layout": "${longdate} | ${uppercase:${level}} | ${logger:shortName=true} | ${message}" + } + }, + "rules": [ + { + "logger": "*", + "minLevel": "Trace", + "writeTo": "logconsole" + }, + { + "logger": "*", + "minLevel": "Info", + "writeTo": "logfile" + } + ] + }, "AllowedHosts": "*", "ConnectionStrings": { "Redis": "redis.ufficio:26379, serviceName=devel, DefaultDatabase=6, keepAlive=180, connectTimeout=15000, syncTimeout=15000, asyncTimeout=15000, abortConnect=false, ssl=false, allowAdmin=true" diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index 042d94e..5900a51 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -1,6 +1,7 @@ using Egw.Window.Data; using Microsoft.AspNetCore.Components; using Newtonsoft.Json; +using NLog; using System.Threading.Tasks; using WebWindowComplex.Compo; using WebWindowComplex.DTO; @@ -392,6 +393,7 @@ namespace WebWindowComplex protected Task DoClose() { editLock = false; + Log.Info("Richietsa Chiusura"); return EC_OnClose.InvokeAsync(false); } @@ -415,6 +417,7 @@ namespace WebWindowComplex // verifico variazione JWD if (!prevJwd.Equals(CurrJwd) || doForce || prevReq != (int)DataReq.ReqSvg) { + Log.Info("Richietsa svg"); prevJwd = CurrJwd; prevReq = (int)DataReq.ReqSvg; Dictionary Args = new Dictionary(); @@ -443,6 +446,7 @@ namespace WebWindowComplex // verifico variazione JWD if (!prevJwd.Equals(CurrJwd) || isFirst || prevReq != (int)DataReq.ReqHwOpt) { + Log.Info("Richietsa Hardware option"); prevJwd = CurrJwd; prevReq = (int)DataReq.ReqHwOpt; Dictionary Args = new Dictionary(); @@ -474,6 +478,7 @@ namespace WebWindowComplex if (!prevJwd.Equals(CurrJwd) || prevReq != (int)DataReq.ReqShape) //if (!prevLiveData.CurrJwd.Equals(CurrJwd)) { + Log.Info("Richietsa shape"); prevJwd = CurrJwd; prevReq = (int)DataReq.ReqShape; Dictionary Args = new Dictionary(); @@ -503,6 +508,7 @@ namespace WebWindowComplex // verifico variazione JWD if (!prevJwd.Equals(CurrJwd) || prevReq != (int)DataReq.ReqElement) { + Log.Info("Richietsa Profili Elementi"); prevJwd = CurrJwd; prevReq = (int)DataReq.ReqElement; Dictionary Args = new Dictionary(); @@ -521,6 +527,7 @@ namespace WebWindowComplex /// protected Task DoReset() { + Log.Info("Richietsa reset"); return Task.CompletedTask; // Da fare } @@ -532,6 +539,7 @@ namespace WebWindowComplex protected Task DoSave() { editLock = false; + Log.Info("Richietsa Salvataggio"); //manca salvataggio JWD return EC_OnClose.InvokeAsync(true); } @@ -602,6 +610,7 @@ namespace WebWindowComplex catch (Exception ex) { listErrLink.Add("Window", $"Deserializing Error:{Environment.NewLine}{ex}"); + Log.Error($"Errore nel deserializzare jwd: {ex.Message}"); // uso un oggetto "basico" per non fermarmi await BuildFrameDefault(); } @@ -911,6 +920,8 @@ namespace WebWindowComplex private List m_FillList = new List(); private List m_SplittedList = new List(); + private static Logger Log = LogManager.GetCurrentClassLogger(); + #endregion Private Fields #region Private Properties @@ -955,29 +966,35 @@ namespace WebWindowComplex if (ListPayload.Hardware == null || ListPayload.Hardware.Count == 0) { listErrPre.Add("Hardware", "Missing Hardware List!"); + Log.Warn("Missing Hardware List"); } else { if (ListPayload.FamilyHardware == null || ListPayload.FamilyHardware.Count == 0) { listErrPre.Add("FamilyHardware", "Missing Family HW List!"); + Log.Warn(" Missing Family HW List"); } } if (ListPayload.Glass == null || ListPayload.Glass.Count == 0) { listErrPre.Add("Glass", "Missing Glass List!"); + Log.Warn(" Missing Glass List"); } if (ListPayload.Material == null || ListPayload.Material.Count == 0) { listErrPre.Add("Material", "Missing Material List!"); + Log.Warn(" Missing Material List"); } if (ListPayload.ColorMaterial == null || ListPayload.ColorMaterial.Count == 0) { listErrPre.Add("ColorMaterial", "Missing ColorMaterial List!"); + Log.Warn("Missing ColorMaterial List"); } if (ListPayload.ProfileList == null || ListPayload.ProfileList.Count == 0) { listErrPre.Add("Profile", "Missing Profile data!"); + Log.Warn("Missing Profile data"); } } diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index 521971c..9c174f1 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.2.418 + 3.1.2.510 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -27,6 +27,7 @@ + @@ -71,6 +72,17 @@ + + + + + + + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 902517d..aaebafe 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.2.418 + 3.1.2.510 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -98,5 +98,6 @@ + From 3d092b53fb6bfa80d7f611e9206d9a14f8e261a4 Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Fri, 6 Feb 2026 17:48:03 +0100 Subject: [PATCH 4/9] - Modificata gestione elementi split (su dimensione secondaria si specifica solo una larghezza per split) - Aggiunta gestione profili bottom rail per sash e frame - Iniziato a gestire dimensione solo luce per sash --- Test.UI/Data/FinestraSplitGrid.jwd | 10 -- WebWindowComplex/Compo/AreaHwOption.razor.cs | 4 + WebWindowComplex/Compo/AreaSash.razor.cs | 56 ++++---- WebWindowComplex/Compo/AreaSplit.razor.cs | 1 + WebWindowComplex/Compo/BottomRail.razor | 30 ++++ WebWindowComplex/Compo/BottomRail.razor.cs | 79 ++++++++++ WebWindowComplex/Compo/CardFill.razor.cs | 2 +- WebWindowComplex/Compo/CardFrame.razor | 10 +- WebWindowComplex/Compo/CardFrame.razor.cs | 23 ++- WebWindowComplex/Compo/CardSashGroup.razor | 9 +- WebWindowComplex/Compo/CardSashGroup.razor.cs | 136 +++++++++--------- WebWindowComplex/Compo/CardSplit.razor | 4 +- WebWindowComplex/Compo/CardSplit.razor.cs | 42 +++++- WebWindowComplex/Compo/EditElement.razor.cs | 2 +- WebWindowComplex/Compo/EditSplitElement.razor | 2 +- .../Compo/EditSplitElement.razor.cs | 19 +-- .../Compo/FrameBottomRail.razor.cs | 2 +- .../Compo/SashBottomRail.razor.cs | 9 +- WebWindowComplex/Json/JsonUtility.cs | 78 ++++++---- WebWindowComplex/Models/Area.cs | 9 +- WebWindowComplex/Models/Frame.cs | 27 +++- WebWindowComplex/Models/Sash.cs | 25 +++- WebWindowComplex/Models/Split.cs | 81 +++++------ WebWindowComplex/TableComp.razor.cs | 4 +- WebWindowComplex/WebWindowComplex.csproj | 22 ++- .../WebWindowConfigurator.csproj | 3 +- 26 files changed, 450 insertions(+), 239 deletions(-) create mode 100644 WebWindowComplex/Compo/BottomRail.razor create mode 100644 WebWindowComplex/Compo/BottomRail.razor.cs diff --git a/Test.UI/Data/FinestraSplitGrid.jwd b/Test.UI/Data/FinestraSplitGrid.jwd index f1d93c7..0df35d6 100644 --- a/Test.UI/Data/FinestraSplitGrid.jwd +++ b/Test.UI/Data/FinestraSplitGrid.jwd @@ -108,16 +108,6 @@ "Index": 2, "Value": 78.0, "Area": 1 - }, - { - "Index": 1, - "Value": 78.0, - "Area": 2 - }, - { - "Index": 2, - "Value": 78.0, - "Area": 2 } ], "GroupId": 2, diff --git a/WebWindowComplex/Compo/AreaHwOption.razor.cs b/WebWindowComplex/Compo/AreaHwOption.razor.cs index f184a3d..e478947 100644 --- a/WebWindowComplex/Compo/AreaHwOption.razor.cs +++ b/WebWindowComplex/Compo/AreaHwOption.razor.cs @@ -39,6 +39,10 @@ namespace WebWindowComplex.Compo } } + /// + /// Metodo per aprire/chiudere area per hw option + /// + /// private async Task changeCollapsed() { hwOptCollapsed = !hwOptCollapsed; diff --git a/WebWindowComplex/Compo/AreaSash.razor.cs b/WebWindowComplex/Compo/AreaSash.razor.cs index 3ad50dc..520d797 100644 --- a/WebWindowComplex/Compo/AreaSash.razor.cs +++ b/WebWindowComplex/Compo/AreaSash.razor.cs @@ -116,29 +116,29 @@ namespace WebWindowComplex.Compo return 0; } - /// - /// Metodo per avere il lo step da usare nella form-input - /// - /// - public double CssStepNumber() - { - switch (CurrSashDim.MeasureType) - { - case Json.WindowConst.MeasureTypes.ABSOLUTE: - { - return 0.5; - } - case Json.WindowConst.MeasureTypes.PROPORTIONAL: - { - return 1; - } - case Json.WindowConst.MeasureTypes.PERCENTAGE: - { - return 0.5; - } - } - return 0; - } + ///// + ///// Metodo per avere il lo step da usare nella form-input + ///// + ///// + //public double CssStepNumber() + //{ + // switch (CurrSashDim.MeasureType) + // { + // case Json.WindowConst.MeasureTypes.ABSOLUTE: + // { + // return 0.5; + // } + // case Json.WindowConst.MeasureTypes.PROPORTIONAL: + // { + // return 1; + // } + // case Json.WindowConst.MeasureTypes.PERCENTAGE: + // { + // return 0.5; + // } + // } + // return 0; + //} /// /// Selezione tipo di apertura anta @@ -192,6 +192,7 @@ namespace WebWindowComplex.Compo /// /// Sollevo evento richiesta per cambiare tutti i Joint /// + /// Tipo di giunto che si vuole /// private Task ChangeAllJoints(Json.WindowConst.Joints JointType) { @@ -203,7 +204,7 @@ namespace WebWindowComplex.Compo /// /// Aggiornamento joint /// - /// + /// Tipo di giunto che si vuole /// private async Task UpdateJoint(Joint updRec) { @@ -220,7 +221,7 @@ namespace WebWindowComplex.Compo /// /// Aggiornamento element /// - /// + /// Tipo di giunto che si vuole /// private async Task UpdateElement(ElementDimension updRec) { @@ -286,10 +287,12 @@ namespace WebWindowComplex.Compo }; return EC_UpdateSash.InvokeAsync(args); } - + /// /// Copio contenuto anta da indexCopy a IndexModify /// + /// Indice dell'ante di cui voglio copiare contenuto + /// Indice dell'ante di cui voglio modificare contenuto /// private Task CopyContentSash(int IndexCopy, int IndexModify) { @@ -353,6 +356,7 @@ namespace WebWindowComplex.Compo View = 1, Edit = 2 } + protected override void OnParametersSet() { if (EditMode) diff --git a/WebWindowComplex/Compo/AreaSplit.razor.cs b/WebWindowComplex/Compo/AreaSplit.razor.cs index 3594d1a..a272dfa 100644 --- a/WebWindowComplex/Compo/AreaSplit.razor.cs +++ b/WebWindowComplex/Compo/AreaSplit.razor.cs @@ -39,6 +39,7 @@ namespace WebWindowComplex.Compo /// /// Metodo per copiare sash /// + /// Indice della finestra che si vuole copiare /// private Task RaiseCopySash(int indexCurrSash) { diff --git a/WebWindowComplex/Compo/BottomRail.razor b/WebWindowComplex/Compo/BottomRail.razor new file mode 100644 index 0000000..97cc835 --- /dev/null +++ b/WebWindowComplex/Compo/BottomRail.razor @@ -0,0 +1,30 @@ + + + \ No newline at end of file diff --git a/WebWindowComplex/Compo/BottomRail.razor.cs b/WebWindowComplex/Compo/BottomRail.razor.cs new file mode 100644 index 0000000..960e105 --- /dev/null +++ b/WebWindowComplex/Compo/BottomRail.razor.cs @@ -0,0 +1,79 @@ +using Microsoft.AspNetCore.Components; +using WebWindowComplex.Models; + +namespace WebWindowComplex.Compo +{ + public partial class BottomRail + { + #region Public Properties + + [Parameter] + public Area CurrArea { get; set; } = null!; + + [Parameter] + public EventCallback EC_UpdateBottomRail { get; set; } + + #endregion Public Properties + + #region Private Properties + + /// + /// Aggiornamento element Bottom Rail + /// + /// + /// + private async Task UpdateElement(ElementDimension updRec) + { + if (updRec != null) + { + DataBottomRail ans = new(); + ElementDimension currRec = new(CurrArea, -1, 0); + if (CurrFrame() != null) + { + // cerco il record + currRec = CurrFrame().BottomRailElemDimList.FirstOrDefault(x => x.ParentArea == updRec.ParentArea && x.nIndex == updRec.nIndex); + + } + else if(CurrSash() != null) + { + // cerco il record + currRec = CurrSash().BottomRailElemDimList.FirstOrDefault(x => x.ParentArea == updRec.ParentArea && x.nIndex == updRec.nIndex); + } + if (currRec != null) + { + currRec = updRec; + ans = new DataBottomRail + { + frame = CurrFrame(), + sash = CurrSash() + }; + } + await EC_UpdateBottomRail.InvokeAsync(ans); + } + } + + private Frame? CurrFrame() + { + if(CurrArea is Frame) + return (Frame)CurrArea; + else + return null; + } + + private Sash? CurrSash() + { + if (CurrArea is Sash) + return (Sash)CurrArea; + else + return null; + } + + #endregion Private Properties + } + + public class DataBottomRail + { + public Sash? sash { get; set; } + public Frame? frame { get; set; } + } +} \ No newline at end of file diff --git a/WebWindowComplex/Compo/CardFill.razor.cs b/WebWindowComplex/Compo/CardFill.razor.cs index e392a10..6ce6aa9 100644 --- a/WebWindowComplex/Compo/CardFill.razor.cs +++ b/WebWindowComplex/Compo/CardFill.razor.cs @@ -45,7 +45,7 @@ namespace WebWindowComplex.Compo /// /// Metodo per cambiare solo il Fill corrente /// - /// tipo di fill richiesto + /// Tipo di fill richiesto /// protected Task ChangeOneFill(FillTypes reqFillType) { diff --git a/WebWindowComplex/Compo/CardFrame.razor b/WebWindowComplex/Compo/CardFrame.razor index 0dcce3a..1c8f405 100644 --- a/WebWindowComplex/Compo/CardFrame.razor +++ b/WebWindowComplex/Compo/CardFrame.razor @@ -80,11 +80,11 @@ } else { - @if (CurrFrameWindow.BottomRailQty > 0) { - + } + } @@ -102,17 +102,17 @@ {
- +
- +
- +
} diff --git a/WebWindowComplex/Compo/CardFrame.razor.cs b/WebWindowComplex/Compo/CardFrame.razor.cs index f5f13ba..1e2fcfb 100644 --- a/WebWindowComplex/Compo/CardFrame.razor.cs +++ b/WebWindowComplex/Compo/CardFrame.razor.cs @@ -190,15 +190,13 @@ namespace WebWindowComplex.Compo /// /// Metodo per cambiare tutti i joint /// + /// /// - private Task ChangeAllJoints(Json.WindowConst.Joints JointType, Area a) + private Task ChangeAllJoints(Json.WindowConst.Joints JointType) { - if (a is Frame) + foreach (Joint joint in CurrFrameWindow.JointList) { - foreach (Joint joint in CurrFrameWindow.JointList) - { - joint.SetSelJointType(JointType); - } + joint.SetSelJointType(JointType); } var args = new DataUpdateFrame() { currFrame = CurrFrameWindow, svgNoHw = false }; return EC_UpdateFrame.InvokeAsync(args); @@ -215,7 +213,8 @@ namespace WebWindowComplex.Compo /// /// Aggiornamento dimensione editata /// - /// + /// Dimensione aggiornata + /// private async Task UpdateDim(FrameDimension updRec) { // cerco il record @@ -281,15 +280,15 @@ namespace WebWindowComplex.Compo } /// - /// Aggiornamento Bottom Rail + /// Aggiornamento Frame /// /// - private async Task UpdateFrame(Frame updRec) + private async Task UpdateFrame(DataBottomRail updRec) { // lo aggiorno - if (updRec != null) + if (updRec.frame != null) { - CurrFrameWindow = updRec; + CurrFrameWindow = updRec.frame; var args = new DataUpdateFrame() { currFrame = CurrFrameWindow, @@ -304,7 +303,7 @@ namespace WebWindowComplex.Compo ///
/// /// - private string ButtonJointCss(WebWindowComplex.Json.WindowConst.Joints type) + private string ButtonJointCss(Json.WindowConst.Joints type) { foreach (var item in CurrFrameWindow.JointList) { diff --git a/WebWindowComplex/Compo/CardSashGroup.razor b/WebWindowComplex/Compo/CardSashGroup.razor index e340b36..e2e88a3 100644 --- a/WebWindowComplex/Compo/CardSashGroup.razor +++ b/WebWindowComplex/Compo/CardSashGroup.razor @@ -14,10 +14,10 @@ - @*
+
-
*@ +
}
@@ -69,11 +69,11 @@ } else { - @if (CurrSashGroup.SashBottomRailQty > 0) { - + } + }
@@ -198,6 +198,7 @@ EditMode="editMode" EC_UpdateSash="UpdateSash" EC_UpdateSashDim="UpdateSashDimension" + EC_ReqResetDict="ResetDict" EC_EditView="EditView"> } diff --git a/WebWindowComplex/Compo/CardSashGroup.razor.cs b/WebWindowComplex/Compo/CardSashGroup.razor.cs index 608ce00..57838a3 100644 --- a/WebWindowComplex/Compo/CardSashGroup.razor.cs +++ b/WebWindowComplex/Compo/CardSashGroup.razor.cs @@ -198,9 +198,8 @@ namespace WebWindowComplex.Compo #region Protected Methods /// - /// Metodo per rimuovere area + /// Metodo per rimuovere area corrente /// - /// area da rimuovere /// protected async Task RemoveArea() { @@ -218,37 +217,37 @@ namespace WebWindowComplex.Compo } /// - /// Metodo per cambiare l'anta su cui è presente la maniglia + /// Metodo per cambiare dimensione solo luce /// /// - //private async Task ChangeTypeDimension() - //{ - // CurrSashGroup.bIsDimensionLight = !CurrSashGroup.bIsDimensionLight; - // foreach(var CurrSashDim in CurrSashGroup.SashList) - // { - // if(CurrSashDim.SelMeasureType is MeasureTypes.ABSOLUTE) - // { - // if (CurrSashGroup.bIsDimensionLight) - // { - // CurrSashDim.SetDimensionLight(CurrSashDim.dDimension - - // CurrSashDim.ElementDimensionList.ElementAt(1).dDimension - - // CurrSashDim.ElementDimensionList.ElementAt(3).dDimension); - // } - // else - // { - // CurrSashDim.SetDimensionLight(CurrSashDim.dDimension + - // CurrSashDim.ElementDimensionList.ElementAt(1).dDimension + - // CurrSashDim.ElementDimensionList.ElementAt(3).dDimension); - // } - // } - // } - // DataUpdateSash args = new DataUpdateSash() - // { - // currSash = CurrSashGroup, - // noSvg = false - // }; - // await EC_UpdateSashGroup.InvokeAsync(args); - //} + private Task ChangeTypeDimension() + { + CurrSashGroup.bIsDimensionLight = !CurrSashGroup.bIsDimensionLight; + foreach (var CurrSashDim in CurrSashGroup.SashList) + { + if (CurrSashDim.SelMeasureType is MeasureTypes.ABSOLUTE) + { + if (CurrSashGroup.bIsDimensionLight) + { + CurrSashDim.SetDimensionLight(CurrSashDim.dDimension - + CurrSashDim.ElementDimensionList.ElementAt(1).dDimension - + CurrSashDim.ElementDimensionList.Last().dDimension); + } + else + { + CurrSashDim.SetDimensionLight(CurrSashDim.dDimension + + CurrSashDim.ElementDimensionList.ElementAt(1).dDimension + + CurrSashDim.ElementDimensionList.Last().dDimension); + } + } + } + DataUpdateSash args = new DataUpdateSash() + { + currSash = CurrSashGroup, + noSvg = false + }; + return EC_UpdateSashGroup.InvokeAsync(args); + } /// /// Metodo per scegliere tipo di misura @@ -288,7 +287,7 @@ namespace WebWindowComplex.Compo } /// - /// Metodo per aggiornare sash + /// Metodo per aggiornare sash group /// /// /// @@ -309,9 +308,27 @@ namespace WebWindowComplex.Compo } /// - /// Metodo per aggiornare sash + /// Metodo per aggiornare sash group /// - /// + /// + /// + protected async Task UpdateBottomRail(DataBottomRail updRec) + { + if (updRec.sash != null) + { + CurrSashGroup = updRec.sash; + var args = new DataUpdateSash + { + currSash = CurrSashGroup + }; + await EC_UpdateSashGroup.InvokeAsync(args); + } + } + + /// + /// Metodo per aggiornare bottom rail + /// + /// /// protected async Task UpdateBottomRail(ElementDimension updRec) { @@ -327,6 +344,11 @@ namespace WebWindowComplex.Compo } } + /// + /// Metodo per resettare dizionario richiesto + /// + /// + /// protected Task ResetDict(DataUpdateRes args) { return EC_ReqResetDict.InvokeAsync(args); @@ -358,7 +380,7 @@ namespace WebWindowComplex.Compo /// /// Aggiornamento opzioni hardware /// - /// + /// /// private async Task UpdateOpt(DataUpdateHwOption argsHw) { @@ -368,40 +390,28 @@ namespace WebWindowComplex.Compo { // cerco il record var currRec = CurrSashGroup.HwOptionList.FirstOrDefault(x => x.sName == AGBOptCombo.sName && x.sDescription == AGBOptCombo.sDescription); - // lo aggiorno - if (AGBOptCombo != null) - { - currRec = AGBOptCombo; - var args = new DataUpdateSash - { - currSash = CurrSashGroup - }; - await EC_UpdateSashGroup.InvokeAsync(args); - await EC_ReqOptionHw.InvokeAsync(CurrSashGroup); - } + currRec = AGBOptCombo; } - else + else if(AGBOptText != null) { // cerco il record var currRec = CurrSashGroup.HwOptionList.FirstOrDefault(x => x.sName == AGBOptText.sName && x.sDescription == AGBOptText.sDescription); - // lo aggiorno - if (AGBOptText != null) + currRec = AGBOptText; + } + if(AGBOptCombo != null || AGBOptText != null) + { + var args = new DataUpdateSash { - currRec = AGBOptText; - var args = new DataUpdateSash - { - currSash = CurrSashGroup - }; - await EC_UpdateSashGroup.InvokeAsync(args); - await EC_ReqOptionHw.InvokeAsync(CurrSashGroup); - } + currSash = CurrSashGroup + }; + await EC_UpdateSashGroup.InvokeAsync(args); + await EC_ReqOptionHw.InvokeAsync(CurrSashGroup); } } /// /// Prima chiamata hw option list /// - /// /// private Task FirstHwOptionList() { @@ -409,16 +419,6 @@ namespace WebWindowComplex.Compo return EC_ReqFirstOptionHw.InvokeAsync(CurrSashGroup); } - private string ButtonMeasureCss(MeasureTypes type) - { - foreach(var item in CurrSashGroup.SashList) - { - if (!item.SelMeasureType.Equals(type)) - return "btn btn-outline-secondary btn-sm"; - } - return "btn btn-secondary btn-sm"; - } - private bool isOpen = false; private void ToggleDropdown() { diff --git a/WebWindowComplex/Compo/CardSplit.razor b/WebWindowComplex/Compo/CardSplit.razor index 7d3f8f9..3f5db0a 100644 --- a/WebWindowComplex/Compo/CardSplit.razor +++ b/WebWindowComplex/Compo/CardSplit.razor @@ -181,7 +181,7 @@
Element vert
- @foreach (var element in CurrSplit.ElemDimVertList) + @foreach (var element in vertList()) { } @@ -193,7 +193,7 @@
Element horiz
- @foreach (var element in CurrSplit.ElemDimHorizList) + @foreach (var element in horizList()) { } diff --git a/WebWindowComplex/Compo/CardSplit.razor.cs b/WebWindowComplex/Compo/CardSplit.razor.cs index 95c5e5a..e80a4db 100644 --- a/WebWindowComplex/Compo/CardSplit.razor.cs +++ b/WebWindowComplex/Compo/CardSplit.razor.cs @@ -196,12 +196,34 @@ namespace WebWindowComplex.Compo /// private async Task UpdateElement(SplitElementDimension updRec) { - // cerco il record - var currRec = CurrSplit.ElemDimHorizList.FirstOrDefault(x => x.ParentArea == updRec.ParentArea && x.nIndex == updRec.nIndex); - // lo aggiorno if (updRec != null) { - currRec = updRec; + SplitElementDimension? currRec = new SplitElementDimension(null, 0,0,-1); + if (updRec.nSubArea != 0) + { + List ElemIndexList = new List(); + if (CurrSplit.bSplitStartVert) + ElemIndexList = CurrSplit.ElemDimHorizList + .Where(x => x.nSubArea != updRec.nSubArea && x.nIndex == updRec.nIndex) + .ToList(); + else + ElemIndexList = CurrSplit.ElemDimVertList + .Where(x => x.nSubArea == updRec.nSubArea && x.nIndex == updRec.nIndex) + .ToList(); + foreach (var item in ElemIndexList) + { + item.dDimension = updRec.dDimension; + } + } + else + { + if(CurrSplit.bSplitStartVert) + currRec = CurrSplit.ElemDimVertList.FirstOrDefault(x => x.ParentArea == updRec.ParentArea && x.nIndex == updRec.nIndex); + else + currRec = CurrSplit.ElemDimHorizList.FirstOrDefault(x => x.ParentArea == updRec.ParentArea && x.nIndex == updRec.nIndex); + // lo aggiorno + currRec = updRec; + } var args = new DataUpdateSplit() { currSplit = CurrSplit, @@ -331,6 +353,18 @@ namespace WebWindowComplex.Compo }; return EC_UpdateSplit.InvokeAsync(args); } + + private List horizList() + { + int subAreaMin = CurrSplit.ElemDimHorizList.Min(x => x.nSubArea); + return CurrSplit.ElemDimHorizList.Where(x => x.nSubArea == subAreaMin).ToList(); + } + + private List vertList() + { + int subAreaMin = CurrSplit.ElemDimVertList.Min(x => x.nSubArea); + return CurrSplit.ElemDimVertList.Where(x => x.nSubArea == subAreaMin).ToList(); + } } /// diff --git a/WebWindowComplex/Compo/EditElement.razor.cs b/WebWindowComplex/Compo/EditElement.razor.cs index 14fd91c..ba82bbd 100644 --- a/WebWindowComplex/Compo/EditElement.razor.cs +++ b/WebWindowComplex/Compo/EditElement.razor.cs @@ -30,7 +30,7 @@ namespace WebWindowComplex.Compo #region Private Properties /// - /// Metodo per aggiornare element corrente + /// Metodo per aggiornare nome element corrente /// private string name() { diff --git a/WebWindowComplex/Compo/EditSplitElement.razor b/WebWindowComplex/Compo/EditSplitElement.razor index d120612..2b7c6fa 100644 --- a/WebWindowComplex/Compo/EditSplitElement.razor +++ b/WebWindowComplex/Compo/EditSplitElement.razor @@ -1,6 +1,6 @@ @using static WebWindowComplex.LayoutConst
- @name() + @CurrRec.nIndex @if (User) { diff --git a/WebWindowComplex/Compo/EditSplitElement.razor.cs b/WebWindowComplex/Compo/EditSplitElement.razor.cs index 2a94a83..8256c5d 100644 --- a/WebWindowComplex/Compo/EditSplitElement.razor.cs +++ b/WebWindowComplex/Compo/EditSplitElement.razor.cs @@ -8,7 +8,7 @@ namespace WebWindowComplex.Compo #region Public Properties /// - /// Joint corrente + /// Element corrente /// [Parameter] public SplitElementDimension CurrRec { get; set; } = null!; @@ -42,14 +42,15 @@ namespace WebWindowComplex.Compo } } } - private string name() - { - string ans = ""; - if (CurrRec.nSubArea > 0) - ans = ans + "A:" + CurrRec.nSubArea + ", "; - ans = ans + "N:" + CurrRec.nIndex; - return ans; - } + + //private string name() + //{ + // string ans = ""; + // if (CurrRec.nSubArea > 0) + // ans = ans + "A:" + CurrRec.nSubArea + ", "; + // ans = ans + "N:" + CurrRec.nIndex; + // return ans; + //} #endregion Private Properties } diff --git a/WebWindowComplex/Compo/FrameBottomRail.razor.cs b/WebWindowComplex/Compo/FrameBottomRail.razor.cs index bf3abbe..ff50155 100644 --- a/WebWindowComplex/Compo/FrameBottomRail.razor.cs +++ b/WebWindowComplex/Compo/FrameBottomRail.razor.cs @@ -21,7 +21,7 @@ namespace WebWindowComplex.Compo #region Private Properties /// - /// Aggiornamento element + /// Aggiornamento element Bottom Rail /// /// /// diff --git a/WebWindowComplex/Compo/SashBottomRail.razor.cs b/WebWindowComplex/Compo/SashBottomRail.razor.cs index 37a7306..4846335 100644 --- a/WebWindowComplex/Compo/SashBottomRail.razor.cs +++ b/WebWindowComplex/Compo/SashBottomRail.razor.cs @@ -14,7 +14,7 @@ namespace WebWindowComplex.Compo public Sash SashGroup { get; set; } = null!; [Parameter] - public EventCallback EC_UpdateSash { get; set; } + public EventCallback EC_UpdateSash { get; set; } #endregion Public Properties @@ -33,12 +33,7 @@ namespace WebWindowComplex.Compo if (updRec != null) { currRec = updRec; - DataUpdateProfile ans = new DataUpdateProfile - { - sash = SashGroup, - reqProfile = false - }; - await EC_UpdateSash.InvokeAsync(ans); + await EC_UpdateSash.InvokeAsync(SashGroup); } } diff --git a/WebWindowComplex/Json/JsonUtility.cs b/WebWindowComplex/Json/JsonUtility.cs index b8cecc9..32e9ffa 100644 --- a/WebWindowComplex/Json/JsonUtility.cs +++ b/WebWindowComplex/Json/JsonUtility.cs @@ -305,13 +305,23 @@ namespace WebWindowComplex.Json newFrame.SetSelThresholdFromName(m_Threshold); newFrame.SetBottomRail(m_bBottomRail); newFrame.SetBottomRailQty(m_nBottomRailQty); - for (int i = 0; i < m_nBottomRailQty; i++) + if(m_nBottomRailQty > 1) { - newFrame.BottomRailElemDimList.Add(new ElementDimension(newFrame, BottomRailElemDimList[i].Index, BottomRailElemDimList[i].Value)); - newFrame.BottomRailElemDimList.ElementAt(i).SetNameElement("Frame_Rail_Bottom"); + for (int i = 0; i < m_nBottomRailQty-1; i++) + { + newFrame.BottomRailElemDimList.Add(new ElementDimension(newFrame, BottomRailElemDimList[i].Index, BottomRailElemDimList[i].Value)); + newFrame.BottomRailElemDimList.ElementAt(i).SetNameElement("Frame_Rail"); + newFrame.BottomRailElemDimList.ElementAt(i).SetMinDimension(Window.m_ParameterList.GetValueOrDefault(newFrame.BottomRailElemDimList.ElementAt(i).sName + "_DimMin")); + newFrame.BottomRailElemDimList.ElementAt(i).SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(newFrame.BottomRailElemDimList.ElementAt(i).sName + "_DimMax")); + } + } + if (m_nBottomRailQty > 0) + { + newFrame.BottomRailElemDimList.Add(new ElementDimension(newFrame, BottomRailElemDimList.Last().Index, BottomRailElemDimList.Last().Value)); + newFrame.BottomRailElemDimList.Last().SetNameElement("Frame_Fill_Rail"); + newFrame.BottomRailElemDimList.Last().SetMinDimension(Window.m_ParameterList.GetValueOrDefault(newFrame.BottomRailElemDimList.Last().sName + "_DimMin")); + newFrame.BottomRailElemDimList.Last().SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(newFrame.BottomRailElemDimList.Last().sName + "_DimMax")); } - if(m_nBottomRailQty > 0) - newFrame.BottomRailElemDimList.ElementAt(m_nBottomRailQty - 1).SetNameElement("Frame_Fill_Rail"); //if(ArcElement != null) // newFrame.SetFrameArcElem(ArcElement.Deserialize(newFrame, ParentWindow)); //Frame.AppliedDone(); @@ -349,19 +359,19 @@ namespace WebWindowComplex.Json } } - //private bool m_bIsDimensionLight; - //[JsonProperty] - //public bool IsDimensionLight - //{ - // get - // { - // return m_bIsDimensionLight; - // } - // set - // { - // m_bIsDimensionLight = value; - // } - //} + private bool m_bIsDimensionLight; + [JsonProperty] + public bool IsDimensionLight + { + get + { + return m_bIsDimensionLight; + } + set + { + m_bIsDimensionLight = value; + } + } private List m_SashList = new List(); [JsonProperty] @@ -476,10 +486,10 @@ namespace WebWindowComplex.Json { } - public JsonSash(bool IsSashVertical, SashTypes SashType, bool SashBottomRail, int SashBottomRailQty, string Hardware, int GroupId) : base(AreaTypes.SASH) + public JsonSash(bool IsSashVertical, SashTypes SashType, bool SashBottomRail, int SashBottomRailQty, string Hardware, int GroupId, bool IsDimensionLight = false) : base(AreaTypes.SASH) { m_bIsSashVertical = IsSashVertical; - //m_bIsDimensionLight = IsDimensionLight; + m_bIsDimensionLight = IsDimensionLight; m_SashType = SashType; m_bBottomRail = SashBottomRail; m_nBottomRailQty = SashBottomRailQty; @@ -492,18 +502,28 @@ namespace WebWindowComplex.Json Sash newSash = new Sash(ParentArea, ParentWindow); newSash.SetGroupId(GroupId); newSash.SetAreaType(AreaTypes.SASH); - //newSash.SetIsDimensionLight(IsDimensionLight); + newSash.SetIsDimensionLight(IsDimensionLight); newSash.SetSashQty(m_SashList.Count); newSash.SetIsSashVertical(m_bIsSashVertical); newSash.SetSashBottomRail(m_bBottomRail); newSash.SetSashBottomRailQty(m_nBottomRailQty); - for(int i = 0; i < m_nBottomRailQty; i++) + if (m_nBottomRailQty > 1) { - newSash.BottomRailElemDimList.Add(new ElementDimension(newSash, BottomRailElemDimList[i].Index, BottomRailElemDimList[i].Value)); - newSash.BottomRailElemDimList.ElementAt(i).SetNameElement("Sash_Rail_Bottom"); + for (int i = 0; i < m_nBottomRailQty - 1; i++) + { + newSash.BottomRailElemDimList.Add(new ElementDimension(newSash, BottomRailElemDimList[i].Index, BottomRailElemDimList[i].Value)); + newSash.BottomRailElemDimList.ElementAt(i).SetNameElement("Sash_Rail"); + newSash.BottomRailElemDimList.ElementAt(i).SetMinDimension(Window.m_ParameterList.GetValueOrDefault(newSash.BottomRailElemDimList.ElementAt(i).sName + "_DimMin")); + newSash.BottomRailElemDimList.ElementAt(i).SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(newSash.BottomRailElemDimList.ElementAt(i).sName + "_DimMax")); + } } if (m_nBottomRailQty > 0) - newSash.BottomRailElemDimList.ElementAt(m_nBottomRailQty - 1).SetNameElement("Sash_Fill_Rail"); + { + newSash.BottomRailElemDimList.Add(new ElementDimension(newSash, BottomRailElemDimList.Last().Index, BottomRailElemDimList.Last().Value)); + newSash.BottomRailElemDimList.Last().SetNameElement("Sash_Fill_Rail"); + newSash.BottomRailElemDimList.Last().SetMinDimension(Window.m_ParameterList.GetValueOrDefault(newSash.BottomRailElemDimList.Last().sName + "_DimMin")); + newSash.BottomRailElemDimList.Last().SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(newSash.BottomRailElemDimList.Last().sName + "_DimMax")); + } for (var SashIndex = 0; SashIndex <= m_SashList.Count - 1; SashIndex++) { newSash.SashList[SashIndex].SetOpeningType(m_SashList[SashIndex].OpeningType); @@ -641,7 +661,9 @@ namespace WebWindowComplex.Json split.SplitVertList[SplitIndex].SetDimension(m_SplitVertList[SplitIndex].Dimension); split.SplitVertList[SplitIndex].SetMeasureType(m_SplitVertList[SplitIndex].MeasureType); } - for (int index = 0; index < ElementDimVertList.Count; index++) + int subAreaMin = ElementDimVertList.Min(x => x.Area); + List vertList = ElementDimVertList.Where(x => x.Area == subAreaMin).ToList(); + for (int index = 0; index < vertList.Count; index++) { split.ElemDimVertList.ElementAt(index).SetSubArea(m_ElemDimVertList[index].Area); split.ElemDimVertList.ElementAt(index).SetIndex(m_ElemDimVertList[index].Index); @@ -659,7 +681,9 @@ namespace WebWindowComplex.Json split.SplitHorizList[SplitIndex].SetDimension(m_SplitHorizList[SplitIndex].Dimension); split.SplitHorizList[SplitIndex].SetMeasureType(m_SplitHorizList[SplitIndex].MeasureType); } - for (int index = 0; index < ElementDimHorizList.Count; index++) + int subAreaMin = ElementDimHorizList.Min(x => x.Area); + List horizList = ElementDimHorizList.Where(x => x.Area == subAreaMin).ToList(); + for (int index = 0; index < horizList.Count; index++) { split.ElemDimHorizList.ElementAt(index).SetSubArea(m_ElemDimHorizList[index].Area); split.ElemDimHorizList.ElementAt(index).SetIndex(m_ElemDimHorizList[index].Index); diff --git a/WebWindowComplex/Models/Area.cs b/WebWindowComplex/Models/Area.cs index 1b521e9..1b3eeef 100644 --- a/WebWindowComplex/Models/Area.cs +++ b/WebWindowComplex/Models/Area.cs @@ -101,9 +101,14 @@ namespace WebWindowComplex.Models public void AddFirstSash() { // Salvo il parent - Area ParentArea = AreaList[0].ParentArea; + if(this is Frame) + { + Frame f = (Frame)this; + f.BottomRailQty = 0; + f.BottomRailElemDimList.Clear(); + } // Creo area sash di default - Sash SashArea = Sash.CreateSash(ParentArea); + Sash SashArea = Sash.CreateSash(this); // Inserisco famiglia hardware vuota SashArea.SetSelFamilyHardware(""); // Inserisco hardware di default diff --git a/WebWindowComplex/Models/Frame.cs b/WebWindowComplex/Models/Frame.cs index e5fae04..25b8a7f 100644 --- a/WebWindowComplex/Models/Frame.cs +++ b/WebWindowComplex/Models/Frame.cs @@ -97,17 +97,36 @@ namespace WebWindowComplex.Models } set { - if (m_nBottomRailQty >= 0) + if (value >= 0) { if(value > m_nBottomRailQty) { - // Aggiungo un element + // Aggiungo un element in coda BottomRailElemDimList.Add(new ElementDimension(this, BottomRailElemDimList.Count + 1, 78)); + BottomRailElemDimList.Last().SetNameElement("Frame_Fill_Rail"); + BottomRailElemDimList.Last().SetMinDimension(Window.m_ParameterList.GetValueOrDefault(BottomRailElemDimList.Last().sName + "_DimMin")); + BottomRailElemDimList.Last().SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(BottomRailElemDimList.Last().sName + "_DimMax")); + BottomRailElemDimList.Last().SetDimension(Window.m_ParameterList.GetValueOrDefault(BottomRailElemDimList.Last().sName + "_DimStd")); + if (value > 1 && BottomRailElemDimList.Count - 2 >= 0) + { + BottomRailElemDimList.ElementAt(BottomRailElemDimList.Count - 2).SetNameElement("Frame_Rail"); + BottomRailElemDimList.ElementAt(BottomRailElemDimList.Count - 2).SetMinDimension(Window.m_ParameterList.GetValueOrDefault(BottomRailElemDimList.ElementAt(BottomRailElemDimList.Count - 2).sName + "_DimMin")); + BottomRailElemDimList.ElementAt(BottomRailElemDimList.Count - 2).SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(BottomRailElemDimList.ElementAt(BottomRailElemDimList.Count - 2).sName + "_DimMax")); + BottomRailElemDimList.ElementAt(BottomRailElemDimList.Count - 2).SetDimension(BottomRailElemDimList.ElementAt(BottomRailElemDimList.Count - 2).dDimension); + } } else if (value < m_nBottomRailQty) { - // Elimino un element - BottomRailElemDimList.RemoveAt(BottomRailElemDimList.Count - 1); + // Elimino gli element + for(int i = BottomRailElemDimList.Count-1; i == value; i--) + BottomRailElemDimList.RemoveAt(i); + if (value >= 1) + { + BottomRailElemDimList.Last().SetNameElement("Frame_Fill_Rail"); + BottomRailElemDimList.Last().SetMinDimension(Window.m_ParameterList.GetValueOrDefault(BottomRailElemDimList.Last().sName + "_DimMin")); + BottomRailElemDimList.Last().SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(BottomRailElemDimList.Last().sName + "_DimMax")); + BottomRailElemDimList.Last().SetDimension(BottomRailElemDimList.Last().dDimension); + } } m_nBottomRailQty = value; if (value > 0) diff --git a/WebWindowComplex/Models/Sash.cs b/WebWindowComplex/Models/Sash.cs index 0695cf6..f58a2f3 100644 --- a/WebWindowComplex/Models/Sash.cs +++ b/WebWindowComplex/Models/Sash.cs @@ -451,11 +451,30 @@ namespace WebWindowComplex.Models { // Aggiungo un element BottomRailElemDimList.Add(new ElementDimension(this, BottomRailElemDimList.Count + 1, 78)); + BottomRailElemDimList.Last().SetNameElement("Sash_Fill_Rail"); + BottomRailElemDimList.Last().SetMinDimension(Window.m_ParameterList.GetValueOrDefault(BottomRailElemDimList.Last().sName + "_DimMin")); + BottomRailElemDimList.Last().SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(BottomRailElemDimList.Last().sName + "_DimMax")); + BottomRailElemDimList.Last().SetDimension(Window.m_ParameterList.GetValueOrDefault(BottomRailElemDimList.Last().sName + "_DimStd")); + if (value > 1 && BottomRailElemDimList.Count - 2 >= 0) + { + BottomRailElemDimList.ElementAt(BottomRailElemDimList.Count - 2).SetNameElement("Sash_Rail"); + BottomRailElemDimList.ElementAt(BottomRailElemDimList.Count - 2).SetMinDimension(Window.m_ParameterList.GetValueOrDefault(BottomRailElemDimList.ElementAt(BottomRailElemDimList.Count - 2).sName + "_DimMin")); + BottomRailElemDimList.ElementAt(BottomRailElemDimList.Count - 2).SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(BottomRailElemDimList.ElementAt(BottomRailElemDimList.Count - 2).sName + "_DimMax")); + BottomRailElemDimList.ElementAt(BottomRailElemDimList.Count - 2).SetDimension(BottomRailElemDimList.ElementAt(BottomRailElemDimList.Count - 2).dDimension); + } } else if (value < m_nSashBottomRailQty) { - // Elimino un element - BottomRailElemDimList.RemoveAt(BottomRailElemDimList.Count - 1); + // Elimino gli element + for (int i = BottomRailElemDimList.Count - 1; i == value; i--) + BottomRailElemDimList.RemoveAt(i); + if (value >= 1) + { + BottomRailElemDimList.Last().SetNameElement("Sash_Fill_Rail"); + BottomRailElemDimList.Last().SetMinDimension(Window.m_ParameterList.GetValueOrDefault(BottomRailElemDimList.Last().sName + "_DimMin")); + BottomRailElemDimList.Last().SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(BottomRailElemDimList.Last().sName + "_DimMax")); + BottomRailElemDimList.Last().SetDimension(BottomRailElemDimList.Last().dDimension); + } } m_nSashBottomRailQty = value; if (m_nSashBottomRailQty > 0) @@ -835,7 +854,7 @@ namespace WebWindowComplex.Models if (nCounterGroup < GroupId) Area.nCounterGroup = GroupId; string currHwId = hideHw ? CustomHwId : m_SelHardware!.Id; - JsonSash JsonSash = new JsonSash(m_bIsSashVertical, m_SashType, m_bSashBottomRail, m_nSashBottomRailQty, currHwId, GroupId); + JsonSash JsonSash = new JsonSash(m_bIsSashVertical, m_SashType, m_bSashBottomRail, m_nSashBottomRailQty, currHwId, GroupId, bIsDimensionLight); foreach (var SashDimension in SashList) JsonSash.SashList.Add(SashDimension.Serialize()); foreach (var BottomRailDim in BottomRailElemDimList) diff --git a/WebWindowComplex/Models/Split.cs b/WebWindowComplex/Models/Split.cs index 14acccb..ebaa969 100644 --- a/WebWindowComplex/Models/Split.cs +++ b/WebWindowComplex/Models/Split.cs @@ -432,17 +432,6 @@ namespace WebWindowComplex.Models m_ElemDimVertList = value; } } - public List SplitPositionList - { - get - { - return m_SplitPositionList; - } - set - { - m_SplitPositionList = value; - } - } public List SplitShapeList { @@ -531,34 +520,6 @@ namespace WebWindowComplex.Models } } - public bool OnlySashChild() - { - foreach (var areaSplitted in AreaList) - { - if (!(areaSplitted.AreaList.FirstOrDefault()?.AreaType is AreaTypes.SASH)) - return false; - } - return true; - } - public bool MinOneSashChild() - { - foreach (var areaSplitted in AreaList) - { - if (areaSplitted.AreaList.FirstOrDefault()?.AreaType is AreaTypes.SASH) - return true; - } - return false; - } - public bool SashChildSxOrDx() - { - foreach (var areaSplitted in AreaList) - { - if (areaSplitted.AreaList.FirstOrDefault()?.AreaType is AreaTypes.SASH) - return true; - } - return false; - } - #endregion Public Methods #region Internal Properties @@ -597,10 +558,20 @@ namespace WebWindowComplex.Models JsonSplit.SplitVertList.Add(SplitVert.Serialize()); foreach (var SplitHoriz in m_SplitHorizList) JsonSplit.SplitHorizList.Add(SplitHoriz.Serialize()); - foreach (var Elem in m_ElemDimHorizList) - JsonSplit.ElementDimHorizList.Add(Elem.Serialize()); - foreach (var Elem in m_ElemDimVertList) - JsonSplit.ElementDimVertList.Add(Elem.Serialize()); + if(m_ElemDimHorizList != null && m_ElemDimHorizList.Count > 0) + { + int subAreaMinHoriz = m_ElemDimHorizList.Min(x => x.nSubArea); + List horizList = m_ElemDimHorizList.Where(x => x.nSubArea == subAreaMinHoriz).ToList(); + foreach (var Elem in horizList) + JsonSplit.ElementDimHorizList.Add(Elem.Serialize()); + } + if (m_ElemDimVertList != null && m_ElemDimVertList.Count > 0) + { + int subAreaMinVert = m_ElemDimVertList.Min(x => x.nSubArea); + List vertList = m_ElemDimVertList.Where(x => x.nSubArea == subAreaMinVert).ToList(); + foreach (var Elem in vertList.ToList()) + JsonSplit.ElementDimVertList.Add(Elem.Serialize()); + } foreach (var Area in AreaList) JsonSplit.AreaList.Add(Area.Serialize(hideHw)); return JsonSplit; @@ -636,12 +607,19 @@ namespace WebWindowComplex.Models } else { + // Un Elemento per ogni dimensione principale e secondaria + //int subArea = 1; + //if (!bSplitStartVert) + // subArea = 0; + //for (int i = 0; i < QtyHoriz; i++) + // ElemDimHorizList.Add(new SplitElementDimension(this, i + 1, 78, subArea)); + // Un Elemento per ogni dimensione principale e per ogni sotto dimensione if (bSplitStartVert) { - for(int subArea = 0; subArea <= QtyVert; subArea++) + for (int subArea = 0; subArea <= QtyVert; subArea++) { for (int i = 0; i < QtyHoriz; i++) - ElemDimHorizList.Add(new SplitElementDimension(this, i + 1, 78, subArea+1)); + ElemDimHorizList.Add(new SplitElementDimension(this, i + 1, 78, subArea + 1)); } } else @@ -682,6 +660,13 @@ namespace WebWindowComplex.Models } else { + // Un Elemento per ogni dimensione principale e secondaria + //int subArea = 0; + //if (!bSplitStartVert) + // subArea = 1; + //for (int i = 0; i < QtyVert; i++) + // ElemDimVertList.Add(new SplitElementDimension(this, i + 1, 78, subArea)); + // Un Elemento per ogni dimensione principale e per ogni sotto dimensione if (bSplitStartVert) { for (int i = 0; i < QtyVert; i++) @@ -689,12 +674,12 @@ namespace WebWindowComplex.Models } else { - for(int subArea = 0; subArea <= QtyHoriz; subArea++) + for (int subArea = 0; subArea <= QtyHoriz; subArea++) { for (int i = 0; i < QtyVert; i++) - ElemDimVertList.Add(new SplitElementDimension(this, i+1, 78, subArea + 1)); + ElemDimVertList.Add(new SplitElementDimension(this, i + 1, 78, subArea + 1)); } - } + } } } diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index 5900a51..1ccc5ba 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -1171,7 +1171,7 @@ namespace WebWindowComplex ///
/// Lista dei profili /// Id Area che si sta cercando - /// Id dell'anta (se -1 non usare) + /// Id dell'anta o dello split (se -1 non usare) /// private void UpdateProfileElement(List profileNameList, int GroupIdSearch, int EntityIdSearch) { @@ -1615,7 +1615,6 @@ namespace WebWindowComplex return "btn btn-secondary btn-sm"; } - /// /// Metodo per ottenere lista groupId /// @@ -1632,6 +1631,7 @@ namespace WebWindowComplex } } } + #endregion Private Methods } } \ No newline at end of file diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index 9c174f1..0e2e989 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.2.510 + 3.1.2.617 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -75,6 +75,26 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index aaebafe..3c163ca 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.2.510 + 3.1.2.617 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -99,5 +99,6 @@ + From a898ccced5e36725d80a24e6d8c7ff94d4e1ff39 Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Tue, 10 Feb 2026 12:17:00 +0100 Subject: [PATCH 5/9] =?UTF-8?q?-=20Possibilit=C3=A0=20di=20nascondere=20fi?= =?UTF-8?q?gli=20multipli=20nella=20pagina=20con=20la=20gerarchia=20-=20Ge?= =?UTF-8?q?stione=20bottom=20rail=20del=20frame?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WebWindowComplex/Compo/CardTree.razor | 111 ++++++--- WebWindowComplex/Compo/CardTree.razor.cs | 234 ++++++++++++++++++ WebWindowComplex/DTO/LivePayload.cs | 2 +- WebWindowComplex/Models/Area.cs | 8 +- WebWindowComplex/Models/Split.cs | 18 +- WebWindowComplex/TableComp.razor | 7 +- WebWindowComplex/TableComp.razor.cs | 47 +++- WebWindowComplex/WebWindowComplex.csproj | 7 +- .../WebWindowConfigurator.csproj | 6 +- 9 files changed, 377 insertions(+), 63 deletions(-) diff --git a/WebWindowComplex/Compo/CardTree.razor b/WebWindowComplex/Compo/CardTree.razor index ad3f3d5..25654c7 100644 --- a/WebWindowComplex/Compo/CardTree.razor +++ b/WebWindowComplex/Compo/CardTree.razor @@ -5,48 +5,83 @@ @for (int i = 0; i < ItemTableList.Count; i++) { - @for (int j = 0; j < maxCol; j++) + @for (int j = 0; j < maxCol - 1; j++) { - CompileStep cs = CompileStep.Frame; - int ind = -1; - string s = "Vai a step "; - @if (j + 1 == ItemTableList[i].Col) - { - @if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.FRAME) - { - cs = CompileStep.Frame; - s = s + cs.ToString(); - } - else if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.SPLIT) - { - cs = CompileStep.Split; - ind = ItemTableList[i].IndexItem; - s = s + cs.ToString() + ((ind + 1) > 0 ? (ind + 1): ""); - } - else if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.SASH) - { - cs = CompileStep.Sash; - ind = ItemTableList[i].IndexItem; - s = s + cs.ToString() + ((ind + 1) > 0 ? (ind + 1) : ""); - } - else if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.FILL) - { - cs = CompileStep.Fill; - ind = ItemTableList[i].IndexItem; - s = s + cs.ToString() + ((ind + 1) > 0 ? (ind + 1) : ""); - } - - - @* @if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.SASH || - ItemTableList[i].Type is Json.WindowConst.AreaTypes.SPLIT) - { - - } *@ - + var index = RowCollapsedDict.Keys.Where(k => k <= i).LastOrDefault(); + @if ((RowCollapsedDict.ContainsValue(true) && RowCollapsedDict.GetValueOrDefault(index)) + && i - 1 > 0 && ItemTableList.ElementAt(i).Col > ItemTableList.ElementAt(index-1).Col){ + continue; } else { - @FillTable(i, j) + CompileStep cs = CompileStep.Frame; + int row = i; + int ind = -1; + string s = "Vai a step "; + @if (j + 1 == ItemTableList[i].Col) + { + @if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.FRAME) + { + cs = CompileStep.Frame; + s = s + cs.ToString(); + } + else if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.SPLIT) + { + cs = CompileStep.Split; + ind = ItemTableList[i].IndexItem; + s = s + cs.ToString() + ((ind + 1) > 0 ? (ind + 1): ""); + } + else if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.SASH) + { + cs = CompileStep.Sash; + ind = ItemTableList[i].IndexItem; + s = s + cs.ToString() + ((ind + 1) > 0 ? (ind + 1) : ""); + } + else if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.FILL) + { + cs = CompileStep.Fill; + ind = ItemTableList[i].IndexItem; + s = s + cs.ToString() + ((ind + 1) > 0 ? (ind + 1) : ""); + } + +
+
+ +
+ @if (ItemTableList[row].NumChild > 4) + { +
+ +
+ @* *@ + } + @*
+ +
*@ +
+ @* @if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.SASH || + ItemTableList[i].Type is Json.WindowConst.AreaTypes.SPLIT) + { + + } *@ + + } + else + { + @FillTable(i, j) + } } } diff --git a/WebWindowComplex/Compo/CardTree.razor.cs b/WebWindowComplex/Compo/CardTree.razor.cs index 3309ac6..233d574 100644 --- a/WebWindowComplex/Compo/CardTree.razor.cs +++ b/WebWindowComplex/Compo/CardTree.razor.cs @@ -22,12 +22,30 @@ namespace WebWindowComplex.Compo [Parameter] public int maxCol { get; set; } = 0; + /// + /// Dizionario con elementi che possono collassare + /// + [Parameter] + public Dictionary RowCollapsedDict { get; set; } = new Dictionary(); + + /// + /// Dizionario con numero di figli per elementi che possono collassare + /// + [Parameter] + public Dictionary ChildDict { get; set; } = new Dictionary(); + /// /// Evento richiesta prossimo step /// [Parameter] public EventCallback EC_NextStep { get; set; } + /// + /// Evento aggiornamento dizionari per collasso righe + /// + [Parameter] + public EventCallback> EC_Collapsed { get; set; } + /// /// Metodo per richiesta prossimo step /// @@ -42,6 +60,70 @@ namespace WebWindowComplex.Compo return EC_NextStep.InvokeAsync(Args); } + //private Dictionary RowCollapsedDict { get; set; } = new Dictionary(); + //private Dictionary Child { get; set; } = new Dictionary(); + + //protected override void OnAfterRender(bool firstRender) + //{ + // if (firstRender) + // { + // foreach (var key in RowCollapsedDict.Keys.ToList()) + // { + // RowCollapsedDict[key] = false; + // Child[key] = -1; + // } + // //for (int i = 0; i < ItemTableList.Count; i++) + // //{ + // // for (int j = 0; j < maxCol; j++) + // // { + // // if (j + 1 == ItemTableList[i].Col) + // // { + // // TableList.Add(new DataTable + // // { + // // item = ItemTableList[i], + // // row = i, + // // col = j, + // // hidden = false + // // }); + // // } + // // else + // // { + // // FillTable(i, j); + // // } + // // } + // //} + // } + //} + + //protected override void OnParametersSet() + //{ + // RowCollapsedDict.Clear(); + // Child.Clear(); + // foreach (var item in ItemTableList) + // { + // if(item.NumChild > 4) + // { + // RowCollapsedDict.Add(item.Row, false); + // Child.Add(item.Row, item.NumChild); + // } + // } + //} + + /// + /// Metodo per aprire/chiudere sottorighe + /// + /// + private Task ChangeCollapsed(int row) + { + RowCollapsedDict[row] = RowCollapsedDict[row] ? false : true; + return EC_Collapsed.InvokeAsync(RowCollapsedDict); + } + + private string hwIcon(int row) + { + return RowCollapsedDict[row] ? "fa-solid fa-chevron-down" : "fa-solid fa-chevron-up"; + } + //private async Task Remove(CompileStep cs, int indexStep) //{ // var Args = new DataNextStep @@ -136,6 +218,157 @@ namespace WebWindowComplex.Compo return " "; } } + + private bool HideRow(int row, int col) + { + List itemSameCol = new List(); + for (int k = 0; k < row; k++) + { + if (ItemTableList[k].Col == col + 1) + { + itemSameCol.Add(ItemTableList[k]); + } + continue; + } + if(itemSameCol.Count > 0) + return RowCollapsedDict.GetValueOrDefault(itemSameCol.First().Row - 1); + return false; + } + + // private void FillTable(int row, int col) + // { + // List itemSameCol = new List(); + // for (int k = 0; k < row; k++) + // { + // if (ItemTableList[k].Col == col + 1) + // { + // itemSameCol.Add(ItemTableList[k]); + // } + // continue; + // } + // int numItemNextCol = 0; + // for (int k = 0; k < row; k++) + // { + // if (ItemTableList[k].Row <= row && ItemTableList[k].Col == col + 2) + // { + // numItemNextCol++; + // } + // continue; + // } + // if (itemSameCol.Count > 1) + // { + // for (int i = 0; i <= itemSameCol.Count - 2; i++) + // { + // if (itemSameCol[i].NumChild > 0) + // numItemNextCol = numItemNextCol - itemSameCol[i].NumChild; + // } + // } + // if (itemSameCol.Count > 0) + // { + // // Sono alla riga successiva di un elemento e nella stessa colonna + // if (itemSameCol.Last().Row == row) + // { + // // se ha un solo figlio + // if (itemSameCol.Last().NumChild == 1) + // { + // TableList.Add(new DataTable + // { + // symbol = "└", + // row = row, + // col = col, + // hidden = false + // }); + // } + // else if (itemSameCol.Last().NumChild == 0) + // { + // TableList.Add(new DataTable + // { + // symbol = " ", + // row = row, + // col = col, + // hidden = false + // }); + // } + // else + // { + // TableList.Add(new DataTable + // { + // symbol = "├", + // row = row, + // col = col, + // hidden = false + // }); + // } + // } + // // Non sono alla riga successiva + // else + // { + // // se ha un solo figlio + // if (itemSameCol.Last().NumChild == 1) + // { + // TableList.Add(new DataTable + // { + // symbol = " ", + // row = row, + // col = col, + // hidden = false + // }); + // } + // else if (col + 2 <= maxCol && ItemTableList[row].Col == col + 2) + // { + // if (numItemNextCol < itemSameCol.Last().NumChild && numItemNextCol != (itemSameCol.Last().NumChild - 1)) + // { + // TableList.Add(new DataTable + // { + // symbol = "├", + // row = row, + // col = col, + // hidden = false + // }); + // } + // TableList.Add(new DataTable + // { + // symbol = "└", + // row = row, + // col = col, + // hidden = false + // }); + // } + // else if (numItemNextCol < itemSameCol.Last().NumChild) + // { + // TableList.Add(new DataTable + // { + // symbol = "│", + // row = row, + // col = col, + // hidden = false + // }); + // } + // else + // { + // TableList.Add(new DataTable + // { + // symbol = " ", + // row = row, + // col = col, + // hidden = false + // }); + // } + // } + // } + // else + // { + // TableList.Add(new DataTable + // { + // symbol = " ", + // row = row, + // col = col, + // hidden = false + // }); + // } + // } + //} + } /// @@ -146,4 +379,5 @@ namespace WebWindowComplex.Compo public CompileStep currCompileStep { get; set; } public int index { get; set; } } + } diff --git a/WebWindowComplex/DTO/LivePayload.cs b/WebWindowComplex/DTO/LivePayload.cs index 9d00a07..946b8b3 100644 --- a/WebWindowComplex/DTO/LivePayload.cs +++ b/WebWindowComplex/DTO/LivePayload.cs @@ -61,7 +61,7 @@ namespace WebWindowComplex.DTO return false; if (!DictUtils.DictAreEqual(DictShape, item.DictShape)) return false; - if (ProfElementList.Count == item.ProfElementList.Count && !ProfElementList.OrderBy(x => x).SequenceEqual(item.ProfElementList.OrderBy(x => x))) + if (ProfElementList.Count != item.ProfElementList.Count || !ProfElementList.OrderBy(x => x.GroupId).SequenceEqual(item.ProfElementList.OrderBy(x => x.GroupId))) return false; return true; } diff --git a/WebWindowComplex/Models/Area.cs b/WebWindowComplex/Models/Area.cs index 1b3eeef..3e0e34f 100644 --- a/WebWindowComplex/Models/Area.cs +++ b/WebWindowComplex/Models/Area.cs @@ -101,9 +101,13 @@ namespace WebWindowComplex.Models public void AddFirstSash() { // Salvo il parent - if(this is Frame) + if(this is Frame || ParentArea.AreaList.Last().Equals(this)) { - Frame f = (Frame)this; + Frame f = null; + if (this is Frame) + f = (Frame)this; + else + f = (Frame)ParentWindow.AreaList.First(); f.BottomRailQty = 0; f.BottomRailElemDimList.Clear(); } diff --git a/WebWindowComplex/Models/Split.cs b/WebWindowComplex/Models/Split.cs index ebaa969..ef880af 100644 --- a/WebWindowComplex/Models/Split.cs +++ b/WebWindowComplex/Models/Split.cs @@ -409,6 +409,7 @@ namespace WebWindowComplex.Models m_SplitHorizList = value; } } + public List ElemDimHorizList { get @@ -499,7 +500,6 @@ namespace WebWindowComplex.Models Fill newFill = Fill.CreateFill(ParentArea, FillTypes.GLASS); newFill.SetAreaType(AreaTypes.FILL); ParentArea.AreaList.Add(newFill); - //m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized()); } public List searchElemFromSubArea(int subArea) @@ -607,12 +607,6 @@ namespace WebWindowComplex.Models } else { - // Un Elemento per ogni dimensione principale e secondaria - //int subArea = 1; - //if (!bSplitStartVert) - // subArea = 0; - //for (int i = 0; i < QtyHoriz; i++) - // ElemDimHorizList.Add(new SplitElementDimension(this, i + 1, 78, subArea)); // Un Elemento per ogni dimensione principale e per ogni sotto dimensione if (bSplitStartVert) { @@ -660,12 +654,6 @@ namespace WebWindowComplex.Models } else { - // Un Elemento per ogni dimensione principale e secondaria - //int subArea = 0; - //if (!bSplitStartVert) - // subArea = 1; - //for (int i = 0; i < QtyVert; i++) - // ElemDimVertList.Add(new SplitElementDimension(this, i + 1, 78, subArea)); // Un Elemento per ogni dimensione principale e per ogni sotto dimensione if (bSplitStartVert) { @@ -722,14 +710,12 @@ namespace WebWindowComplex.Models #region Private Fields - //private bool m_bIsPercentage = true; private bool m_bSplitStartVert = true; private SplitShapes m_SelSplitShape; private List m_SplitHorizList = new List(); private List m_ElemDimHorizList = new List(); private List m_ElemDimVertList = new List(); - private List m_SplitPositionList = new List(); private List m_SplitShapeList = new List { @@ -741,8 +727,6 @@ namespace WebWindowComplex.Models private List m_SplitVertList = new List(); - //private double m_Width = 0; - #endregion Private Fields } } \ No newline at end of file diff --git a/WebWindowComplex/TableComp.razor b/WebWindowComplex/TableComp.razor index 6b9fbe7..dc146dc 100644 --- a/WebWindowComplex/TableComp.razor +++ b/WebWindowComplex/TableComp.razor @@ -77,8 +77,11 @@ @if (currStep == CompileStep.Tree) { + maxCol="m_maxCol" + RowCollapsedDict="RowCollapsed" + ChildDict="Child" + EC_NextStep="NextStepArgs" + EC_Collapsed="CollapsedRowTree"> } else if (currStep == CompileStep.Frame) diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index 1ccc5ba..af6f3cf 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -587,7 +587,8 @@ namespace WebWindowComplex CurrJwd = LiveData.CurrJwd, DictOptionsXml = LiveData.DictOptionsXml, DictShape = LiveData.DictShape, - SvgPreview = LiveData.SvgPreview + SvgPreview = LiveData.SvgPreview, + ProfElementList = LiveData.ProfElementList }; // Aggiornati parametri di ingresso selezionati UpdateSelParameter(); @@ -843,6 +844,21 @@ namespace WebWindowComplex m_ItemTableList = new List(); CreateWindowsList((m_CurrWindow!).AreaList.First(), false); CreateElementTable(m_CurrWindow.AreaList.First(), 1, 1, 1, 1); + foreach (var item in ItemTableList) + { + if (item.NumChild > 4) + { + if (!RowCollapsed.ContainsKey(item.Row)) + { + RowCollapsed.Add(item.Row, false); + Child.Add(item.Row, item.NumChild); + } + } + else if(RowCollapsed.ContainsKey(item.Row)) + { + RowCollapsed.Remove(item.Row); + } + } } /// @@ -920,6 +936,9 @@ namespace WebWindowComplex private List m_FillList = new List(); private List m_SplittedList = new List(); + private Dictionary RowCollapsed { get; set; } = new Dictionary(); + private Dictionary Child { get; set; } = new Dictionary(); + private static Logger Log = LogManager.GetCurrentClassLogger(); #endregion Private Fields @@ -1101,6 +1120,22 @@ namespace WebWindowComplex NextStep(newStep, Index); } + /// + /// Metodo per aggiornare il valore collassato degli elementi della gerarchia + /// + /// + private void CollapsedRowTree(Dictionary Args) + { + foreach(var item in Args) + { + RowCollapsed[item.Key] = Args[item.Key] ? true : false; + if (m_ItemTableList.FirstOrDefault(x => x.Row == item.Key) != null) + { + Child[item.Key] = m_ItemTableList.FirstOrDefault(x => x.Row == item.Key).NumChild; + } + } + } + /// /// Richiesta reset dizionario Shape con action /// @@ -1228,6 +1263,11 @@ namespace WebWindowComplex SpElemList.ElementAt(i).SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(SpElemList.ElementAt(i).sName + "_DimMax")); string overlapName = string.Join("_", SpElemList.ElementAt(i).sName.Split('_').Skip(1)); SpElemList.ElementAt(i).SetOverlapElement(Window.m_ParameterList.GetValueOrDefault(SpElemList.ElementAt(i).sName + "_Overlap")); + //// Se la lista in precedenza era vuota, metto i valori di default + //if (prevLiveData.ProfElementList == null || prevLiveData.ProfElementList.Count == 0) + //{ + // SpElemList.ElementAt(i).SetDimension(Window.m_ParameterList.GetValueOrDefault(SpElemList.ElementAt(i).sName + "_DimStd")); + //} } break; } @@ -1238,6 +1278,11 @@ namespace WebWindowComplex item.SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(item.sName + "_DimMax")); string overlapName = string.Join("_", item.sName.Split('_').Skip(1)); item.SetOverlapElement(Window.m_ParameterList.GetValueOrDefault(overlapName + "_Overlap")); + // Se la lista in precedenza era vuota, metto i valori di default + //if (prevLiveData.ProfElementList == null || prevLiveData.ProfElementList.Count == 0) + //{ + // item.SetDimension(Window.m_ParameterList.GetValueOrDefault(item.sName + "_DimStd")); + //} } } } diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index 0e2e989..c714b55 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.2.617 + 3.1.2.1012 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -109,6 +109,11 @@ + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 3c163ca..712f8cc 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.2.617 + 3.1.2.1012 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -97,6 +97,10 @@ + + + + From 44b1b8bbd3e238f9896959808b0aadfa0a03ab01 Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Thu, 12 Feb 2026 18:26:13 +0100 Subject: [PATCH 6/9] - Gestita dimensione standard e solo luce per i cambi di tipologie di misure per sash e split - Aggiornato metodo per cambiare numero di split - Aggiornato metodo che calcola larghezza sashGroup e splitGroup --- Test.UI/Components/Pages/EditJWD.razor.cs | 2 + Test.UI/Data/AntaDoppia.jwd | 50 +--- WebWindowComplex/Compo/CardFrame.razor.cs | 1 + WebWindowComplex/Compo/CardSashGroup.razor.cs | 3 +- WebWindowComplex/Compo/CardTree.razor | 2 +- WebWindowComplex/Models/Area.cs | 14 +- WebWindowComplex/Models/AreaDimension.cs | 75 ++++-- WebWindowComplex/Models/Frame.cs | 60 +++-- WebWindowComplex/Models/FrameDimension.cs | 2 +- WebWindowComplex/Models/Sash.cs | 178 +++++++++++++- WebWindowComplex/Models/SashDimension.cs | 219 +++++++----------- WebWindowComplex/Models/Split.cs | 13 +- WebWindowComplex/Models/SplitDimension.cs | 99 +++++--- WebWindowComplex/TableComp.razor.cs | 16 +- WebWindowComplex/WebWindowComplex.csproj | 3 +- .../WebWindowConfigurator.csproj | 5 +- 16 files changed, 457 insertions(+), 285 deletions(-) diff --git a/Test.UI/Components/Pages/EditJWD.razor.cs b/Test.UI/Components/Pages/EditJWD.razor.cs index a9107f6..e8f722c 100644 --- a/Test.UI/Components/Pages/EditJWD.razor.cs +++ b/Test.UI/Components/Pages/EditJWD.razor.cs @@ -253,6 +253,7 @@ namespace Test.UI.Components.Pages {"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}, @@ -263,6 +264,7 @@ namespace Test.UI.Components.Pages {"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}, diff --git a/Test.UI/Data/AntaDoppia.jwd b/Test.UI/Data/AntaDoppia.jwd index f78a0d0..4996a9a 100644 --- a/Test.UI/Data/AntaDoppia.jwd +++ b/Test.UI/Data/AntaDoppia.jwd @@ -57,17 +57,19 @@ "Threshold": "Bottom", "BottomRail": false, "BottomRailQty": 0, + "BottomRailElemDimList": [], "GroupId": 1, "AreaList": [ { "IsSashVertical": true, + "IsDimensionLight": true, "SashList": [ { "SashId": 1, "OpeningType": "TILTTURN_LEFT", + "MeasureType": "PROPORTIONAL", + "Dimension": 1, "HasHandle": true, - "Dimension": 50.0, - "MeasureType": "PERCENTAGE", "ElementDimensionList": [ { "Index": 1, @@ -108,9 +110,9 @@ { "SashId": 2, "OpeningType": "TURNONLY_RIGHT", + "MeasureType": "PROPORTIONAL", + "Dimension": 2, "HasHandle": false, - "Dimension": 50.0, - "MeasureType": "PERCENTAGE", "ElementDimensionList": [ { "Index": 1, @@ -152,43 +154,9 @@ "SashType": "NULL", "BottomRail": false, "BottomRailQty": 0, - "BottomRailElemDimList": [ - { - "Index": 1, - "Value": 78.0 - } - ], - "Hardware": "000633", - "HwOptionList": [ - { - "Name": "Entrata", - "Value": "15" - }, - { - "Name": "LavManigliaPassante", - "Value": "false" - }, - { - "Name": "PosizioneForoCilindro", - "Value": "sotto" - }, - { - "Name": "Deviatore", - "Value": "false" - }, - { - "Name": "ModelloCilindro", - "Value": "c999" - }, - { - "Name": "LavCilindroPassante", - "Value": "false" - }, - { - "Name": "HMan", - "Value": "400" - } - ], + "BottomRailElemDimList": [], + "Hardware": "000631", + "HwOptionList": [], "GroupId": 2, "AreaList": [ { diff --git a/WebWindowComplex/Compo/CardFrame.razor.cs b/WebWindowComplex/Compo/CardFrame.razor.cs index 1e2fcfb..c189523 100644 --- a/WebWindowComplex/Compo/CardFrame.razor.cs +++ b/WebWindowComplex/Compo/CardFrame.razor.cs @@ -325,6 +325,7 @@ namespace WebWindowComplex.Compo public Frame currFrame { get; set; } = null!; public bool svgNoHw { get; set; } = false; + public int groupIdDelete { get; set; } = -1; #endregion Public Properties } diff --git a/WebWindowComplex/Compo/CardSashGroup.razor.cs b/WebWindowComplex/Compo/CardSashGroup.razor.cs index 57838a3..1822049 100644 --- a/WebWindowComplex/Compo/CardSashGroup.razor.cs +++ b/WebWindowComplex/Compo/CardSashGroup.razor.cs @@ -207,7 +207,8 @@ namespace WebWindowComplex.Compo FrameWindow.SetSelThresholdFromName(FrameWindow.ThresholdList.FirstOrDefault(x => x.Name != "Threshold")?.Name); var args = new DataUpdateFrame() { - currFrame = FrameWindow + currFrame = FrameWindow, + groupIdDelete = CurrSashGroup.GroupId }; // richiesta reset dict shape await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req=DataAction.ResetDictShape}); diff --git a/WebWindowComplex/Compo/CardTree.razor b/WebWindowComplex/Compo/CardTree.razor index 25654c7..077894d 100644 --- a/WebWindowComplex/Compo/CardTree.razor +++ b/WebWindowComplex/Compo/CardTree.razor @@ -5,7 +5,7 @@ @for (int i = 0; i < ItemTableList.Count; i++) { - @for (int j = 0; j < maxCol - 1; j++) + @for (int j = 0; j < maxCol; j++) { var index = RowCollapsedDict.Keys.Where(k => k <= i).LastOrDefault(); @if ((RowCollapsedDict.ContainsValue(true) && RowCollapsedDict.GetValueOrDefault(index)) diff --git a/WebWindowComplex/Models/Area.cs b/WebWindowComplex/Models/Area.cs index 3e0e34f..858a73f 100644 --- a/WebWindowComplex/Models/Area.cs +++ b/WebWindowComplex/Models/Area.cs @@ -258,7 +258,7 @@ namespace WebWindowComplex.Models Sash s = (Sash)node; List dimList = new List(); foreach (var item in s.SashList) - dimList.Add(new AreaDimension(item.dDimension, item.MeasureType)); + dimList.Add(new AreaDimension(item.dDimension, item.MeasureType, item.Parent)); if(nameDim.Equals("Width")) SearchAreaList(node.AreaList.ElementAt(i), s.SashList.ElementAt(i).CalculateAbsoluteValue(dimList, dim), nameDim); else @@ -271,7 +271,7 @@ namespace WebWindowComplex.Models if (s.SplitHorizList.Count > 0 && i < s.SplitHorizList.Count) { foreach (var item in s.SplitHorizList) - dimList.Add(new AreaDimension(item.dDimension, item.MeasureType)); + dimList.Add(new AreaDimension(item.dDimension, item.MeasureType, item.Parent)); if(nameDim.Equals("Width")) SearchAreaList(node.AreaList.ElementAt(i), dim, nameDim); else @@ -280,7 +280,7 @@ namespace WebWindowComplex.Models if (s.SplitVertList.Count > 0 && i < s.SplitVertList.Count) { foreach (var item in s.SplitVertList) - dimList.Add(new AreaDimension(item.dDimension, item.MeasureType)); + dimList.Add(new AreaDimension(item.dDimension, item.MeasureType, item.Parent)); if(nameDim.Equals("Width")) SearchAreaList(node.AreaList.ElementAt(i), s.SplitVertList.ElementAt(i).CalculateAbsoluteValue(dimList, dim), nameDim); else @@ -313,13 +313,13 @@ namespace WebWindowComplex.Models else frame = (Frame)sash.ParentArea; foreach (var i in frame.DimensionList) - dimList.Add(new AreaDimension(i.dDimension, i.SelMeasureType)); + dimList.Add(new AreaDimension(i.dDimension, i.SelMeasureType, i.Parent)); } else { //Split s = (Split)sash.ParentArea.ParentArea; foreach (var i in split.SplitVertList) - dimList.Add(new AreaDimension(i.dDimension, i.SelMeasureType)); + dimList.Add(new AreaDimension(i.dDimension, i.SelMeasureType, i.Parent)); } if (countAbsolute == sash.SashList.Count) { @@ -414,7 +414,7 @@ namespace WebWindowComplex.Models List adList = new List(); foreach (var it in sashGroup.SashList) { - adList.Add(new AreaDimension(it.dDimension, it.SelMeasureType)); + adList.Add(new AreaDimension(it.dDimension, it.SelMeasureType, it.Parent)); } //Somma misura non proporzionali double sumNotProp = sashGroup.SashList @@ -451,7 +451,7 @@ namespace WebWindowComplex.Models List adList = new List(); foreach (var it in splitList) { - adList.Add(new AreaDimension(it.dDimension, it.SelMeasureType)); + adList.Add(new AreaDimension(it.dDimension, it.SelMeasureType, it.Parent)); } //Somma misura non proporzionali double sumNotProp = splitList diff --git a/WebWindowComplex/Models/AreaDimension.cs b/WebWindowComplex/Models/AreaDimension.cs index 43662ac..d81f37c 100644 --- a/WebWindowComplex/Models/AreaDimension.cs +++ b/WebWindowComplex/Models/AreaDimension.cs @@ -11,11 +11,11 @@ namespace WebWindowComplex.Models { #region Public Constructors - public AreaDimension(double dDimension, MeasureTypes MeasureType) + public AreaDimension(double dDimension, MeasureTypes MeasureType, Area Parent) { m_dDimension = dDimension; m_SelMeasureType = MeasureType; - //m_Parent = Parent; + m_Parent = Parent; } #endregion Public Constructors @@ -34,17 +34,17 @@ namespace WebWindowComplex.Models } } - //public Area Parent - //{ - // get - // { - // return m_Parent; - // } - // set - // { - // m_Parent = value; - // } - //} + public Area Parent + { + get + { + return m_Parent; + } + set + { + m_Parent = value; + } + } public MeasureTypes MeasureType { @@ -105,7 +105,7 @@ namespace WebWindowComplex.Models protected MeasureTypes m_SelMeasureType; // reference - // protected Area m_Parent; + protected Area m_Parent; #endregion Private Fields @@ -122,7 +122,7 @@ namespace WebWindowComplex.Models /// Vecchio tipo /// Nuovo tipo /// - public double ConvertDimension(List itemList, MeasureTypes oldType, MeasureTypes newType, double widthTot, int indexSash) + public double ConvertDimension(List itemList, MeasureTypes oldType, MeasureTypes newType, double widthTot, int indexSash, double overlap) { switch (oldType) { @@ -130,8 +130,17 @@ namespace WebWindowComplex.Models { if (newType.Equals(MeasureTypes.PERCENTAGE)) { + double overlapElem = 0; + if (m_Parent is Sash) + { + // Calcolo overlap + Sash s = (Sash)m_Parent; + int indElem = indexSash == 0 ? 1 : s.SashList.ElementAt(indexSash).ElementDimensionList.Count - 1; + if (!s.bIsDimensionLight) + overlapElem = s.SashList.ElementAt(indexSash).ElementDimensionList.ElementAt(indElem).dOverlap / 2; + } //return Double.Round((m_dDimension / m_Parent.Width) * 100, 1); - return (dDimension / widthTot) * 100; + return ((dDimension - overlapElem) / widthTot) * 100; } else { @@ -142,8 +151,17 @@ namespace WebWindowComplex.Models { if (newType.Equals(MeasureTypes.ABSOLUTE)) { + double overlapElem = 0; + if(m_Parent is Sash) + { + // Calcolo overlap + Sash s = (Sash)m_Parent; + int indElem = indexSash == 0 ? 1 : s.SashList.ElementAt(indexSash).ElementDimensionList.Count - 1; + if (!s.bIsDimensionLight) + overlapElem = s.SashList.ElementAt(indexSash).ElementDimensionList.ElementAt(indElem).dOverlap / 2; + } //return Double.Round(ConvertFromPropVal(newType), 2); - return ConvertFromPropVal(itemList, newType, widthTot); + return ConvertFromPropVal(itemList, newType, widthTot) + overlapElem; } else { @@ -155,8 +173,17 @@ namespace WebWindowComplex.Models { if (newType.Equals(MeasureTypes.ABSOLUTE)) { + double overlapElem = 0; + if (m_Parent is Sash) + { + // Calcolo overlap + Sash s = (Sash)m_Parent; + int indElem = indexSash == 0 ? 1 : s.SashList.ElementAt(indexSash).ElementDimensionList.Count - 1; + if (!s.bIsDimensionLight) + overlapElem = s.SashList.ElementAt(indexSash).ElementDimensionList.ElementAt(indElem).dOverlap; + } //return Double.Round((m_dDimension * m_Parent.Width) / 100, 2); - return (dDimension * widthTot) / 100; + return (dDimension * widthTot) / 100 + overlapElem; } else { @@ -250,7 +277,17 @@ namespace WebWindowComplex.Models case MeasureTypes.ABSOLUTE: { //return Double.Round(dDimension, 2); - return dDimension; + double overlapElem = 0; + if (m_Parent is Sash) + { + // Calcolo overlap + Sash s = (Sash)m_Parent; + int indexSash = itemList.IndexOf(this); + int indElem = indexSash == 0 ? 1 : s.SashList.ElementAt(indexSash).ElementDimensionList.Count - 1; + if (!s.bIsDimensionLight) + overlapElem = s.SashList.ElementAt(indexSash).ElementDimensionList.ElementAt(indElem).dOverlap / 2; + } + return dDimension - overlapElem; } case MeasureTypes.PROPORTIONAL: { diff --git a/WebWindowComplex/Models/Frame.cs b/WebWindowComplex/Models/Frame.cs index 25b8a7f..94c52c6 100644 --- a/WebWindowComplex/Models/Frame.cs +++ b/WebWindowComplex/Models/Frame.cs @@ -402,29 +402,41 @@ namespace WebWindowComplex.Models m_ThresholdList = m_AllThresholdList; } - public double HeightFrame() + public double AvailHeightFrame() { + double dim = 0; switch (SelShapeIndex) { case (int)Shapes.RECTANGLE: case (int)Shapes.TRIANGLE: case (int)Shapes.ARC_FULL: { - return DimensionList.Where(x => x.sName == "Height").First().dDimension; + dim = DimensionList.Where(x => x.sName == "Height").First().dDimension; + break; } case (int)Shapes.RIGHTCHAMFER: { - return DimensionList.Where(x => x.sName == "Left Height").First().dDimension; + dim = DimensionList.Where(x => x.sName == "Left Height").First().dDimension; + break; } case (int)Shapes.LEFTCHAMFER: { - return DimensionList.Where(x => x.sName == "Right Height").First().dDimension; + dim = DimensionList.Where(x => x.sName == "Right Height").First().dDimension; + break; } default: { - return DimensionList.Where(x => x.sName == "Full Height").First().dDimension; + dim = DimensionList.Where(x => x.sName == "Full Height").First().dDimension; + break; } } + double overlap = 0; + if (AreaList.First() is Sash) + overlap = ElementDimensionList.ElementAt(1).dOverlap + + ElementDimensionList.ElementAt(ElementDimensionList.Count() - 2).dOverlap; + return dim - ElementDimensionList.ElementAt(0).dDimension - + ElementDimensionList.Last().dDimension + + overlap; } public override Frame Copy(Area ParentArea) @@ -432,6 +444,26 @@ namespace WebWindowComplex.Models return new Frame(null, ParentWindow); } + /// + /// Metodo per calcolare l'area disponibile + /// + /// + public double AvailWidthArea() + { + if (DimensionList.Count > 0 && DimensionList.FirstOrDefault(x => x.sName.Equals("Width")) != null) + { + double dim = DimensionList.FirstOrDefault(x => x.sName.Equals("Width"))!.dDimension; + double overlap = 0; + if(AreaList.First() is Sash) + overlap = ElementDimensionList.ElementAt(1).dOverlap + + ElementDimensionList.Last().dOverlap; + return dim - ElementDimensionList.ElementAt(0).dDimension - + ElementDimensionList.Last().dDimension + + overlap; + } + return -1; + } + #endregion Public Methods #region Internal Methods @@ -661,24 +693,6 @@ namespace WebWindowComplex.Models } } - /// - /// Metodo per calcolare l'area disponibile - /// - /// - internal double AvailArea() - { - if(DimensionList.Count> 0 && DimensionList.FirstOrDefault(x => x.sName.Equals("Width")) != null) - { - // larghezza - elementDim(1) - elementDim(last) + overlapDd + overlapSx - return DimensionList.FirstOrDefault(x => x.sName.Equals("Width"))!.dDimension - - ElementDimensionList.ElementAt(1).dDimension - - ElementDimensionList.Last().dDimension + - ElementDimensionList.ElementAt(1).dOverlap + - ElementDimensionList.Last().dOverlap; - } - return -1; - } - #endregion Internal Methods #region Private Fields diff --git a/WebWindowComplex/Models/FrameDimension.cs b/WebWindowComplex/Models/FrameDimension.cs index da3f8ac..9ee1a43 100644 --- a/WebWindowComplex/Models/FrameDimension.cs +++ b/WebWindowComplex/Models/FrameDimension.cs @@ -13,7 +13,7 @@ namespace WebWindowComplex.Models { #region Public Constructors - public FrameDimension(Frame ParentFrame, int nIndex, string sName, double dDimension, bool bIsLen) : base(dDimension, MeasureTypes.ABSOLUTE) + public FrameDimension(Frame ParentFrame, int nIndex, string sName, double dDimension, bool bIsLen) : base(dDimension, MeasureTypes.ABSOLUTE, ParentFrame) { m_ParentFrame = ParentFrame; m_nIndex = nIndex; diff --git a/WebWindowComplex/Models/Sash.cs b/WebWindowComplex/Models/Sash.cs index f58a2f3..a57396a 100644 --- a/WebWindowComplex/Models/Sash.cs +++ b/WebWindowComplex/Models/Sash.cs @@ -267,8 +267,17 @@ namespace WebWindowComplex.Models { if (value > 0 && value <= 3) { - double widthTot = CalculateWidthArea(ParentWindow.AreaList.First(), ParentWindow.AreaList.FirstOrDefault().DimensionList.Where(x => x.sName == "Width").First().dDimension); // TODO: width se anta è in un'area di split - //double widthTot = ((Frame)ParentArea).AvailArea(); + Frame frame = (Frame)ParentWindow.AreaList.First(); + double widthTot = 0; + if (bIsDimensionLight) + { + foreach (var item in m_SashList) + widthTot = widthTot + item.dDimension; + } + else + { + widthTot = CalculateWidthSashGroup(frame, frame.DimensionList.Where(x => x.sName == "Width").First().dDimension, new AreaFound(-1, false)).m_Dimension; + } if (value > m_SashList.Count) { // recupero larghezza ultimo @@ -277,9 +286,20 @@ namespace WebWindowComplex.Models if (m_SashList.Count > 0) { dLastDimension = m_SashList[m_SashList.Count - 1].dDimension; - dNewDimension = dLastDimension / (value + 1 - nSashQty); if (m_SashList[m_SashList.Count - 1].MeasureType.Equals(MeasureTypes.PROPORTIONAL)) dNewDimension = 1; + else if (m_SashList[m_SashList.Count - 1].MeasureType is MeasureTypes.PERCENTAGE) + dNewDimension = dLastDimension / (value + 1 - nSashQty); + else + { + if (bIsDimensionLight) + dNewDimension = (dLastDimension - m_SashList.Last().ElementDimensionList.ElementAt(1).dDimension + - m_SashList.Last().ElementDimensionList.Last().dDimension + + m_SashList.Last().ElementDimensionList.Last().dOverlap) / 2; + else + dNewDimension = dLastDimension / (value + 1 - nSashQty) + + (m_SashList.Last().ElementDimensionList.Last().dOverlap / 2); + } m_SashList[m_SashList.Count - 1].SetDimension(dNewDimension); } else @@ -301,28 +321,37 @@ namespace WebWindowComplex.Models { double dLastDimension = 0; SashDimension itemDelete = new SashDimension(0, MeasureTypes.NULL, this, 0); - double deleteDim; + double deleteDim = 0; + double splitDelete = 0; for (var SplitIndex = m_SashList.Count - 1; SplitIndex >= value; SplitIndex += -1) { - //dLastDimension += m_SashList[SplitIndex].dDimension; itemDelete = m_SashList[SplitIndex]; + if(itemDelete.SelMeasureType is MeasureTypes.ABSOLUTE) + { + if (bIsDimensionLight) + splitDelete = m_SashList[m_SashList.Count - 2].ElementDimensionList.ElementAt(1).dDimension + + m_SashList.Last().ElementDimensionList.Last().dDimension + - m_SashList.Last().ElementDimensionList.Last().dOverlap; + else + splitDelete = - m_SashList.Last().ElementDimensionList.Last().dOverlap; + } SashList.RemoveAt(SplitIndex); } if (!itemDelete.SelMeasureType.Equals(m_SashList[SashList.Count - 1].SelMeasureType)) { - AreaDimension ad = new AreaDimension(itemDelete.dDimension, itemDelete.SelMeasureType); + AreaDimension ad = new AreaDimension(itemDelete.dDimension, itemDelete.SelMeasureType, itemDelete.Parent); List adList = new List(); foreach (var it in SashList) { - adList.Add(new AreaDimension(it.dDimension, it.SelMeasureType)); + adList.Add(new AreaDimension(it.dDimension, it.SelMeasureType, it.Parent)); } - deleteDim = ad.ConvertDimension(adList, itemDelete.SelMeasureType, m_SashList[SashList.Count - 1].SelMeasureType, widthTot, m_SashList.IndexOf(itemDelete)); + deleteDim = ad.ConvertDimension(adList, itemDelete.SelMeasureType, m_SashList[SashList.Count - 1].SelMeasureType, widthTot, m_SashList.IndexOf(itemDelete), SashList.Last().ElementDimensionList.Last().dOverlap); } else { deleteDim = itemDelete.dDimension; } - dLastDimension = deleteDim + m_SashList[SashList.Count - 1].dDimension; + dLastDimension = deleteDim + m_SashList[SashList.Count - 1].dDimension + splitDelete; SashList[SashList.Count - 1].SetDimension(dLastDimension); if (value == 1) SashList.First().SetHasHandle(true); @@ -741,6 +770,7 @@ namespace WebWindowComplex.Models { m_IsbDimensionLight = DimensionLight; } + internal static Sash CreateSash(Area Area) { Sash newSash = new Sash(Area, Area.ParentWindow); @@ -1056,6 +1086,135 @@ namespace WebWindowComplex.Models } } + internal AreaFound CalculateWidthSashGroup(Area area, double width, AreaFound res) + { + for (int i = 0; i < area.AreaList.Count; i++) + { + if (area.Equals(this)) + { + res.m_Dimension = width; + res.m_Found = true; + return res; + } + Area item = area.AreaList[i]; + if (area is Split) + { + Split split = (Split)area; + if (split.SplitVertList.Count > 0) + { + double dim = width; + switch (split.SplitVertList.ElementAt(i).SelMeasureType) + { + case MeasureTypes.ABSOLUTE: + { + dim = split.SplitVertList.ElementAt(i).dDimension; + break; + } + case MeasureTypes.PROPORTIONAL: + { + double widthGlass = width; + AreaDimension ad = new AreaDimension(split.SplitVertList.ElementAt(i).dDimension, split.SplitVertList.ElementAt(i).SelMeasureType, split.SplitVertList.ElementAt(i).Parent); + List adList = new List(); + foreach (var it in split.SplitVertList) + { + adList.Add(new AreaDimension(it.dDimension, it.SelMeasureType, it.Parent)); + } + foreach (var elem in split.ElemDimVertList) + { + widthGlass = widthGlass - elem.dDimension; + } + dim = ad.ConvertFromPropVal(adList, MeasureTypes.ABSOLUTE, widthGlass); + break; + } + case MeasureTypes.PERCENTAGE: + { + foreach (var elem in split.ElemDimVertList) + { + dim = dim - elem.dDimension; + } + dim = split.SplitVertList.ElementAt(i).dDimension * dim / 100; + break; + } + } + if (split.ParentArea is Frame && split.AreaList.ElementAt(i).AreaList.First() is Sash) + { + Frame frame = (Frame)split.ParentArea; + string overlapName = string.Join("_", split.ElemDimVertList.First().sName.Split('_').Skip(1)) + "_Top_Overlap"; + if (i == 0) + { + dim = dim + frame.ElementDimensionList.Last().dOverlap + + Window.m_ParameterList.GetValueOrDefault(overlapName); + } + else if (i == split.SplitVertList.Count - 1) + { + dim = dim + frame.ElementDimensionList.ElementAt(1).dOverlap + + Window.m_ParameterList.GetValueOrDefault(overlapName); + } + else + { + dim = dim + Window.m_ParameterList.GetValueOrDefault(overlapName) + + Window.m_ParameterList.GetValueOrDefault(overlapName); + } + } + res = CalculateWidthSashGroup(item, dim, res); + if (res.m_Dimension != -1 && res.m_Found) + return res; + } + else + { + res = CalculateWidthSashGroup(item, width, res); + if (res.m_Dimension != -1 && res.m_Found) + return res; + } + } + else if (area is Sash) + { + Sash sash = (Sash)area; + switch (sash.SashList.ElementAt(i).SelMeasureType) + { + case MeasureTypes.ABSOLUTE: + { + res = CalculateWidthSashGroup(item, sash.SashList.ElementAt(i).dDimension, res); + break; + } + case MeasureTypes.PROPORTIONAL: + { + SashDimension anta = sash.SashList.ElementAt(i); + AreaDimension ad = new AreaDimension(anta.dDimension, anta.SelMeasureType, anta.Parent); + List adList = new List(); + foreach (var it in sash.SashList) + { + adList.Add(new AreaDimension(it.dDimension, it.SelMeasureType, it.Parent)); + } + res = CalculateWidthSashGroup(item, ad.ConvertFromPropVal(adList, MeasureTypes.ABSOLUTE, width), res); + break; + } + case MeasureTypes.PERCENTAGE: + { + res = CalculateWidthSashGroup(item, sash.SashList.ElementAt(i).dDimension * width / 100, res); + break; + } + } + if (res.m_Dimension != -1 && res.m_Found) + return res; + } + else if (area is Frame) + { + Frame f = (Frame)area; + res = CalculateWidthSashGroup(item, f.AvailWidthArea(), res); + if (res.m_Dimension != -1 && res.m_Found) + return res; + } + else + { + res = CalculateWidthSashGroup(item, width, res); + if (res.m_Dimension != -1 && res.m_Found) + return res; + } + } + return res; + } + #endregion Internal Methods #region Private Fields @@ -1079,7 +1238,6 @@ namespace WebWindowComplex.Models private int m_nSashBottomRailQty; - private List m_ElementDimensionList = new List(); private List m_BottomRailElemDimList = new List(); private List m_OrientationSashTypeList = new List { diff --git a/WebWindowComplex/Models/SashDimension.cs b/WebWindowComplex/Models/SashDimension.cs index 8ff5213..2573aeb 100644 --- a/WebWindowComplex/Models/SashDimension.cs +++ b/WebWindowComplex/Models/SashDimension.cs @@ -1,4 +1,5 @@ -using System.Runtime.InteropServices; +using System; +using System.Runtime.InteropServices; using System.Security.Principal; using WebWindowComplex.Json; using static WebWindowComplex.Json.WindowConst; @@ -9,7 +10,7 @@ namespace WebWindowComplex.Models { #region Public Constructors - public SashDimension(double dDimension, MeasureTypes MeasureType, Sash Parent, int nSashId):base(dDimension, MeasureType) + public SashDimension(double dDimension, MeasureTypes MeasureType, Sash Parent, int nSashId):base(dDimension, MeasureType, Parent) { m_dDimension = dDimension; m_nSashId = nSashId; @@ -149,25 +150,25 @@ namespace WebWindowComplex.Models } set { - if(m_Parent.ParentWindow.AreaList.FirstOrDefault() != null) + Frame? frame = m_Parent.ParentWindow.AreaList.FirstOrDefault(); + if (frame != null) { - double widthTot = CalculateWidthSashGroup(m_Parent.ParentWindow.AreaList.FirstOrDefault()!, m_Parent.ParentWindow.AreaList.FirstOrDefault()!.DimensionList.Where(x => x.sName == "Width").First().dDimension); - //double widthTot = ((Frame)m_Parent.ParentArea).AvailArea(); - //if (m_Parent.bIsDimensionLight) - //{ - // for (int i = 0; i < m_Parent.SashList.Count; i++) - // { - // if(i == 0) - // widthTot = widthTot - // - m_Parent.SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dDimension - // - m_Parent.SashList.ElementAt(i).ElementDimensionList.Last().dDimension; - // else - // widthTot = widthTot - // - m_Parent.SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dDimension - // - m_Parent.SashList.ElementAt(i).ElementDimensionList.Last().dDimension - // + m_Parent.SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dOverlap; - // } - //} + double widthTot = (Parent.CalculateWidthSashGroup(frame, frame.AvailWidthArea(), new AreaFound(-1, false))).m_Dimension; + if (m_Parent.bIsDimensionLight) + { + for (int i = 0; i < m_Parent.SashList.Count; i++) + { + if (i == 0) + widthTot = widthTot + - m_Parent.SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dDimension + - m_Parent.SashList.ElementAt(i).ElementDimensionList.Last().dDimension; + else + widthTot = widthTot + - m_Parent.SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dDimension + - m_Parent.SashList.ElementAt(i).ElementDimensionList.Last().dDimension + + m_Parent.SashList.ElementAt(i).ElementDimensionList.Last().dOverlap; + } + } double valMinAbsolute = 100; double valMaxAbsolute = widthTot - valMinAbsolute * (m_Parent.SashList.Count - 1); bool valueAccept = false; @@ -196,11 +197,11 @@ namespace WebWindowComplex.Models { List dimensions = m_Parent.SashList; List absoluteValList = new List(); - AreaDimension ad = new AreaDimension(m_dDimension, SelMeasureType); + AreaDimension ad = new AreaDimension(m_dDimension, SelMeasureType, Parent); List adList = new List(); foreach (var it in m_Parent.SashList) { - adList.Add(new AreaDimension(it.m_dDimension, it.SelMeasureType)); + adList.Add(new AreaDimension(it.m_dDimension, it.SelMeasureType, it.Parent)); } int index = 0; foreach (var item in m_Parent.SashList) @@ -403,25 +404,41 @@ namespace WebWindowComplex.Models if(SelMeasureType != (MeasureTypes)value) { MeasureTypes newType = (MeasureTypes)value; - if (m_Parent.ParentWindow.AreaList.FirstOrDefault() != null) + Frame? frame = m_Parent.ParentWindow.AreaList.FirstOrDefault(); + if (frame != null) { - double widthTot = CalculateWidthSashGroup(m_Parent.ParentWindow.AreaList.FirstOrDefault()!, m_Parent.ParentWindow.AreaList.FirstOrDefault()!.DimensionList.Where(x => x.sName == "Width").First().dDimension); - // TODO: availArea per aree che non sono frame - //double widthTot = ((Frame)m_Parent.ParentArea).AvailArea(); - AreaDimension ad = new AreaDimension(m_dDimension, SelMeasureType); + double widthTot = Parent.CalculateWidthSashGroup(frame!, frame!.DimensionList.Where(x => x.sName == "Width").First().dDimension, new AreaFound(-1, false)).m_Dimension; + if (Parent.bIsDimensionLight) + { + for (int i = 0; i < m_Parent.SashList.Count; i++) + { + if (i == 0) + widthTot = widthTot + - m_Parent.SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dDimension + - m_Parent.SashList.ElementAt(i).ElementDimensionList.Last().dDimension; + else + widthTot = widthTot + - m_Parent.SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dDimension + - m_Parent.SashList.ElementAt(i).ElementDimensionList.Last().dDimension + + m_Parent.SashList.ElementAt(i).ElementDimensionList.Last().dOverlap; + } + } + AreaDimension ad = new AreaDimension(m_dDimension, SelMeasureType, Parent); List adList = new List(); foreach (var it in m_Parent.SashList) { - adList.Add(new AreaDimension(it.m_dDimension, it.SelMeasureType)); - //if (it.SelMeasureType is MeasureTypes.ABSOLUTE) - //{ - // if (it.bHasHandle) - // adList.Add(new AreaDimension(it.m_dDimension - (it.ElementDimensionList.ElementAt(1).dOverlap) / 2, it.SelMeasureType)); - // else - // adList.Add(new AreaDimension(it.m_dDimension - (it.ElementDimensionList.Last().dOverlap) / 2, it.SelMeasureType)); - //} + adList.Add(new AreaDimension(it.m_dDimension, it.SelMeasureType, it.Parent)); } - m_dDimension = ad.ConvertDimension(adList, SelMeasureType, newType, widthTot, nSashId-1); + double overlap = 0; + if (!Parent.bIsDimensionLight) + { + int index = m_Parent.SashList.IndexOf(this); + if (index == 0) + overlap = m_Parent.SashList.ElementAt(index).ElementDimensionList.ElementAt(1).dOverlap; + else + overlap = m_Parent.SashList.ElementAt(index).ElementDimensionList.Last().dOverlap; + } + m_dDimension = ad.ConvertDimension(adList, SelMeasureType, newType, widthTot, nSashId - 1, overlap); SelMeasureType = (MeasureTypes)value; } } @@ -464,100 +481,6 @@ namespace WebWindowComplex.Models m_dDimension = Dimension; } - /// - /// Metodo per calcolare larghezza intera sash group - /// - /// area di partenza - /// larghezza di partenza - /// - internal double CalculateWidthSashGroup(Area area, double width) - { - if (width < 1) - return width; - for(int i = 0; i < area.AreaList.Count; i++) - { - double risultato = -1; - if (area.Equals(m_Parent)) - return width; - Area item = area.AreaList[i]; - if (area is Split) - { - Split split = (Split)area; - if (split.SplitVertList.Count > 0) - { - switch (split.SplitVertList.ElementAt(i).SelMeasureType) - { - case MeasureTypes.ABSOLUTE: - { - risultato = CalculateWidthSashGroup(item, split.SplitVertList.ElementAt(i).dDimension); - break; - } - case MeasureTypes.PROPORTIONAL: - { - AreaDimension ad = new AreaDimension(split.SplitVertList.ElementAt(i).dDimension, split.SplitVertList.ElementAt(i).SelMeasureType); - List adList = new List(); - foreach(var it in split.SplitVertList) - { - adList.Add(new AreaDimension(it.dDimension, it.SelMeasureType)); - } - risultato = CalculateWidthSashGroup(item, ad.ConvertFromPropVal(adList, MeasureTypes.ABSOLUTE, width)); - break; - } - case MeasureTypes.PERCENTAGE: - { - risultato = CalculateWidthSashGroup(item, split.SplitVertList.ElementAt(i).dDimension * width / 100); - break; - } - } - if (risultato != -1) - return risultato; - } - else - { - risultato = CalculateWidthSashGroup(item, width); - } - } - else if (area is Sash) - { - Sash sash = (Sash)area; - switch (sash.SashList.ElementAt(i).SelMeasureType) - { - case MeasureTypes.ABSOLUTE: - { - risultato = CalculateWidthSashGroup(item, sash.SashList.ElementAt(i).dDimension); - break; - } - case MeasureTypes.PROPORTIONAL: - { - //risultato = CalculateWidthSashGroup(item, ConvertFromPropVal(MeasureTypes.ABSOLUTE, width, sash.SashList.ElementAt(i).dDimension)); - AreaDimension ad = new AreaDimension(sash.SashList.ElementAt(i).dDimension, sash.SashList.ElementAt(i).SelMeasureType); - List adList = new List(); - foreach (var it in sash.SashList) - { - adList.Add(new AreaDimension(it.dDimension, it.SelMeasureType)); - } - risultato = CalculateWidthSashGroup(item, ad.ConvertFromPropVal(adList, MeasureTypes.ABSOLUTE, width)); - break; - } - case MeasureTypes.PERCENTAGE: - { - risultato = CalculateWidthSashGroup(item, sash.SashList.ElementAt(i).dDimension * width / 100); - break; - } - } - if (risultato != -1) - return risultato; - } - else - { - risultato = CalculateWidthSashGroup(item, width); - if (risultato != -1) - return risultato; - } - } - return width; - } - internal JsonSashDimension Serialize() { JsonSashDimension JsonSashDimension = new JsonSashDimension(OpeningType, MeasureType, m_bHasHandle, dDimension, m_nSashId); @@ -593,17 +516,41 @@ namespace WebWindowComplex.Models if (SelMeasureType != (MeasureTypes)value) { MeasureTypes newType = (MeasureTypes)value; - if(m_Parent.ParentWindow.AreaList.FirstOrDefault() != null) + Frame frame = m_Parent.ParentWindow.AreaList.FirstOrDefault(); + if (frame != null) { - double widthTot = CalculateWidthSashGroup(m_Parent.ParentWindow.AreaList.FirstOrDefault()!, m_Parent.ParentWindow.AreaList.FirstOrDefault()!.DimensionList.Where(x => x.sName == "Width").First().dDimension); - AreaDimension ad = new AreaDimension(dDimension, SelMeasureType); + double widthTot = Parent.CalculateWidthSashGroup(frame!, frame!.DimensionList.Where(x => x.sName == "Width").First().dDimension, new AreaFound(-1, false)).m_Dimension; + if (Parent.bIsDimensionLight) + { + for(int i = 0; i < Parent.SashList.Count; i++) + { + if (i == 0) + widthTot = widthTot - Parent.SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dDimension + - Parent.SashList.ElementAt(i).ElementDimensionList.Last().dDimension; + else + widthTot = widthTot - Parent.SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dDimension + - Parent.SashList.ElementAt(i).ElementDimensionList.Last().dDimension + + Parent.SashList.ElementAt(i).ElementDimensionList.Last().dOverlap; + } + } + AreaDimension ad = new AreaDimension(dDimension, SelMeasureType, Parent); + //if(SelMeasureType is MeasureTypes.ABSOLUTE) + // ad = new AreaDimension(dDimension - ElementDimensionList.ElementAt(1).dOverlap, SelMeasureType); + //else + // ad = new AreaDimension(dDimension, SelMeasureType); List newDimensions = new List(); foreach(var item in m_Parent.SashList) { - newDimensions.Add(new AreaDimension(item.dDimension, item.SelMeasureType)); + newDimensions.Add(new AreaDimension(item.dDimension, item.SelMeasureType, item.Parent)); } - m_dDimension = ad.ConvertDimension(newDimensions, SelMeasureType, newType, widthTot, indexSash); - if(newType is MeasureTypes.PROPORTIONAL) + int index = m_Parent.SashList.IndexOf(this); + double overlap = 0; + if (index == 0) + overlap = m_Parent.SashList.ElementAt(index).ElementDimensionList.ElementAt(1).dOverlap; + else + overlap = m_Parent.SashList.ElementAt(index).ElementDimensionList.Last().dOverlap; + m_dDimension = ad.ConvertDimension(newDimensions, SelMeasureType, newType, widthTot, indexSash, overlap); + if (newType is MeasureTypes.PROPORTIONAL) { for (int i = 0; i < newDimensions.Count; i++) m_Parent.SashList.ElementAt(i).SetDimension(newDimensions.ElementAt(i).dDimension); diff --git a/WebWindowComplex/Models/Split.cs b/WebWindowComplex/Models/Split.cs index ef880af..94500a6 100644 --- a/WebWindowComplex/Models/Split.cs +++ b/WebWindowComplex/Models/Split.cs @@ -95,7 +95,7 @@ namespace WebWindowComplex.Models if (m_SplitHorizList.Count > 0) { dLastDimension = m_SplitHorizList[m_SplitHorizList.Count - 1].dDimension; - dNewDimension = dLastDimension / (value + 1 - nSplitQtyHoriz); + dNewDimension = (dLastDimension - m_ElemDimHorizList.Last().dDimension) / (value + 1 - nSplitQtyHoriz); if (m_SplitHorizList[m_SplitHorizList.Count - 1].MeasureType.Equals(MeasureTypes.PROPORTIONAL)) dNewDimension = 1; m_SplitHorizList[m_SplitHorizList.Count - 1].SetDimension(dNewDimension); @@ -133,7 +133,7 @@ namespace WebWindowComplex.Models double dLastDimension = 0; for (var SplitIndex = m_SplitHorizList.Count - 1; SplitIndex >= value + 1; SplitIndex += -1) { - dLastDimension += m_SplitHorizList[SplitIndex].dDimension; + dLastDimension += m_SplitHorizList[SplitIndex].dDimension + m_ElemDimHorizList[SplitIndex - 1].dDimension; m_SplitHorizList.RemoveAt(SplitIndex); } dLastDimension += m_SplitHorizList[m_SplitHorizList.Count - 1].dDimension; @@ -213,9 +213,10 @@ namespace WebWindowComplex.Models } else { - if(ParentWindow.AreaList.FirstOrDefault() != null) + Frame? frame = ParentWindow.AreaList.FirstOrDefault(); + if (frame != null) { - double widthTot = CalculateWidthArea(ParentWindow.AreaList.First(), ParentWindow.AreaList.FirstOrDefault()!.DimensionList.Where(x => x.sName == "Width").First().dDimension); + double widthTot = CalculateWidthArea(frame, frame.DimensionList.Where(x => x.sName == "Width").First().dDimension); // Ricalcolo dimensioni aggiungendo split if (value > m_SplitVertList.Count - 1) { @@ -225,7 +226,7 @@ namespace WebWindowComplex.Models if (m_SplitVertList.Count > 0) { dLastDimension = m_SplitVertList[m_SplitVertList.Count - 1].dDimension; - dNewDimension = dLastDimension / (value + 1 - nSplitQtyVert); + dNewDimension = (dLastDimension - ElemDimVertList.Last().dDimension) / (value + 1 - nSplitQtyVert); if (m_SplitVertList[m_SplitVertList.Count - 1].MeasureType.Equals(MeasureTypes.PROPORTIONAL)) dNewDimension = 1; m_SplitVertList[m_SplitVertList.Count - 1].SetDimension(dNewDimension); @@ -276,7 +277,7 @@ namespace WebWindowComplex.Models double dLastDimension = 0; for (var SplitIndex = m_SplitVertList.Count - 1; SplitIndex >= value + 1; SplitIndex += -1) { - dLastDimension += m_SplitVertList[SplitIndex].dDimension; + dLastDimension += m_SplitVertList[SplitIndex].dDimension + ElemDimVertList[SplitIndex - 1].dDimension; m_SplitVertList.RemoveAt(SplitIndex); } dLastDimension += m_SplitVertList[m_SplitVertList.Count - 1].dDimension; diff --git a/WebWindowComplex/Models/SplitDimension.cs b/WebWindowComplex/Models/SplitDimension.cs index 15e1c5a..f5a9a01 100644 --- a/WebWindowComplex/Models/SplitDimension.cs +++ b/WebWindowComplex/Models/SplitDimension.cs @@ -13,7 +13,7 @@ namespace WebWindowComplex.Models { #region Public Constructors - public SplitDimension(double dDimension, MeasureTypes MeasureType, bool bIsRelative, Split Parent, bool IsVertList):base(dDimension, MeasureType) + public SplitDimension(double dDimension, MeasureTypes MeasureType, bool bIsRelative, Split Parent, bool IsVertList):base(dDimension, MeasureType, Parent) { m_dDimension = dDimension; m_bIsRelative = bIsRelative; @@ -61,7 +61,7 @@ namespace WebWindowComplex.Models { dimensions = m_Parent.SplitHorizList; //dimensionTot = (CalculateHeightSplitGroup(m_Parent, HeightTot(), new AreaFound(-1, false))).m_Dimension; - dimensionTot = (CalculateHeightSplitGroup(frame, frame.HeightFrame(), new AreaFound(-1, false))).m_Dimension; + dimensionTot = (CalculateHeightSplitGroup(frame, frame.AvailHeightFrame(), new AreaFound(-1, false))).m_Dimension; } double valMinAbsolute = 100; double valMaxAbsolute = dimensionTot - valMinAbsolute * (dimensions.Count - 1); @@ -90,11 +90,11 @@ namespace WebWindowComplex.Models if (valueAccept) { List absoluteValList = new List(); - AreaDimension ad = new AreaDimension(dDimension, SelMeasureType); + AreaDimension ad = new AreaDimension(dDimension, SelMeasureType, Parent); List adList = new List(); foreach (var it in dimensions) { - adList.Add(new AreaDimension(it.dDimension, it.SelMeasureType)); + adList.Add(new AreaDimension(it.dDimension, it.SelMeasureType, it.Parent)); } foreach (var item in dimensions) { @@ -260,20 +260,29 @@ namespace WebWindowComplex.Models if (bIsVertListDim) { splitList = m_Parent.SplitVertList; - tot = CalculateWidthSplitGroup(frame, frame.DimensionList.Where(x => x.sName == "Width").First().dDimension, new AreaFound(-1, false)).m_Dimension; + //tot = CalculateWidthSplitGroup(frame, frame.DimensionList.Where(x => x.sName == "Width").First().dDimension, new AreaFound(-1, false)).m_Dimension; + tot = CalculateWidthSplitGroup(frame, frame.AvailWidthArea(), new AreaFound(-1, false)).m_Dimension; + foreach (var item in m_Parent.ElemDimVertList) + { + tot = tot - item.dDimension; + } } else { splitList = m_Parent.SplitHorizList; - tot = (CalculateHeightSplitGroup(frame, frame.HeightFrame(), new AreaFound(-1, false))).m_Dimension; + tot = (CalculateHeightSplitGroup(frame, frame.AvailHeightFrame(), new AreaFound(-1, false))).m_Dimension; + foreach (var item in m_Parent.ElemDimHorizList) + { + tot = tot - item.dDimension; + } } - AreaDimension ad = new AreaDimension(dDimension, SelMeasureType); + AreaDimension ad = new AreaDimension(dDimension, SelMeasureType, Parent); List adList = new List(); foreach (var it in splitList) { - adList.Add(new AreaDimension(it.dDimension, it.SelMeasureType)); + adList.Add(new AreaDimension(it.dDimension, it.SelMeasureType, it.Parent)); } - m_dDimension = ad.ConvertDimension(adList, m_SelMeasureType, newType, tot, splitList.IndexOf(this)); + m_dDimension = ad.ConvertDimension(adList, m_SelMeasureType, newType, tot, splitList.IndexOf(this), 0); m_SelMeasureType = (MeasureTypes)value; } } @@ -329,11 +338,11 @@ namespace WebWindowComplex.Models } case MeasureTypes.PROPORTIONAL: { - AreaDimension ad = new AreaDimension(split.SplitVertList.ElementAt(index).dDimension, split.SplitVertList.ElementAt(index).SelMeasureType); + AreaDimension ad = new AreaDimension(split.SplitVertList.ElementAt(index).dDimension, split.SplitVertList.ElementAt(index).SelMeasureType, split.SplitVertList.ElementAt(index).Parent); List adList = new List(); foreach (var it in split.SplitVertList) { - adList.Add(new AreaDimension(it.dDimension, it.SelMeasureType)); + adList.Add(new AreaDimension(it.dDimension, it.SelMeasureType, it.Parent)); } res = CalculateWidthSplitGroup(item, ad.ConvertFromPropVal(adList, MeasureTypes.ABSOLUTE, width), res); break; @@ -361,23 +370,40 @@ namespace WebWindowComplex.Models { case MeasureTypes.ABSOLUTE: { - res = CalculateWidthSplitGroup(item, sash.SashList.ElementAt(i).dDimension, res); + double dim = sash.SashList.ElementAt(i).dDimension; + if (!sash.bIsDimensionLight) + dim = dim - + sash.SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dDimension - + sash.SashList.ElementAt(i).ElementDimensionList.Last().dDimension; + res = CalculateWidthSplitGroup(item, dim, res); break; } case MeasureTypes.PROPORTIONAL: { - AreaDimension ad = new AreaDimension(sash.SashList.ElementAt(i).dDimension, sash.SashList.ElementAt(i).SelMeasureType); + AreaDimension ad = new AreaDimension(sash.SashList.ElementAt(i).dDimension, sash.SashList.ElementAt(i).SelMeasureType, sash.SashList.ElementAt(i).Parent); List adList = new List(); foreach (var it in sash.SashList) { - adList.Add(new AreaDimension(it.dDimension, it.SelMeasureType)); + adList.Add(new AreaDimension(it.dDimension, it.SelMeasureType, it.Parent)); } - res = CalculateWidthSplitGroup(item, ad.ConvertFromPropVal(adList, MeasureTypes.ABSOLUTE, width), res); + int index = adList.IndexOf(ad) == 0 ? 1 : adList.Count - 1; + double dim = ad.ConvertFromPropVal(adList, MeasureTypes.ABSOLUTE, width) + sash.SashList.ElementAt(i).ElementDimensionList.ElementAt(index).dOverlap / 2; + dim = dim - + sash.SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dDimension - + sash.SashList.ElementAt(i).ElementDimensionList.Last().dDimension; + res = CalculateWidthSplitGroup(item, dim, res); break; } case MeasureTypes.PERCENTAGE: { - res = CalculateWidthSplitGroup(item, sash.SashList.ElementAt(i).dDimension * width / 100, res); + double overlapElem = 0; + int indElem = i == 0 ? 1 : sash.SashList.ElementAt(i).ElementDimensionList.Count - 1; + if (!sash.bIsDimensionLight) + overlapElem = sash.SashList.ElementAt(i).ElementDimensionList.ElementAt(indElem).dOverlap / 2; + double dim = sash.SashList.ElementAt(i).dDimension * width / 100 + overlapElem - + sash.SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dDimension - + sash.SashList.ElementAt(i).ElementDimensionList.Last().dDimension; + res = CalculateWidthSplitGroup(item, dim, res); break; } } @@ -430,11 +456,11 @@ namespace WebWindowComplex.Models } case MeasureTypes.PROPORTIONAL: { - AreaDimension ad = new AreaDimension(split.SplitHorizList.ElementAt(index).dDimension, split.SplitHorizList.ElementAt(index).SelMeasureType); + AreaDimension ad = new AreaDimension(split.SplitHorizList.ElementAt(index).dDimension, split.SplitHorizList.ElementAt(index).SelMeasureType, split.SplitHorizList.ElementAt(index).Parent); List adList = new List(); foreach (var it in split.SplitHorizList) { - adList.Add(new AreaDimension(it.dDimension, it.SelMeasureType)); + adList.Add(new AreaDimension(it.dDimension, it.SelMeasureType, it.Parent)); } double heightItemGroup = ad.ConvertFromPropVal(adList, MeasureTypes.ABSOLUTE, height); res = CalculateHeightSplitGroup(item, heightItemGroup, res); @@ -457,6 +483,15 @@ namespace WebWindowComplex.Models return res; } } + else if (area is Sash) + { + Sash s = (Sash)area; + height = height - s.SashList.First().ElementDimensionList.First().dDimension + - s.SashList.First().ElementDimensionList.ElementAt(s.SashList.First().ElementDimensionList.Count - 2).dDimension; + res = CalculateHeightSplitGroup(item, height, res); + if (res.m_Dimension != -1 && res.m_Found) + return res; + } else { res = CalculateHeightSplitGroup(item, height, res); @@ -499,32 +534,42 @@ namespace WebWindowComplex.Models double dimSplitGroup = 0; if (bIsVertListDim) { - dimSplitGroup = (CalculateWidthSplitGroup(frame, frame.DimensionList.Where(x => x.sName == "Width").First().dDimension, new AreaFound(-1, false))).m_Dimension; - AreaDimension ad = new AreaDimension(dDimension, SelMeasureType); + //dimSplitGroup = (CalculateWidthSplitGroup(frame, frame.DimensionList.Where(x => x.sName == "Width").First().dDimension, new AreaFound(-1, false))).m_Dimension; + dimSplitGroup = (CalculateWidthSplitGroup(frame, frame.AvailWidthArea(), new AreaFound(-1, false))).m_Dimension; + foreach (var item in m_Parent.ElemDimVertList) + { + dimSplitGroup = dimSplitGroup - item.dDimension; + } + AreaDimension ad = new AreaDimension(dDimension, SelMeasureType, Parent); List newDimensions = new List(); foreach (var item in m_Parent.SplitVertList) { - newDimensions.Add(new AreaDimension(item.dDimension, item.SelMeasureType)); + newDimensions.Add(new AreaDimension(item.dDimension, item.SelMeasureType, item.Parent)); } - m_dDimension = ad.ConvertDimension(newDimensions, m_SelMeasureType, newType, dimSplitGroup, m_Parent.SplitVertList.IndexOf(this)); + m_dDimension = ad.ConvertDimension(newDimensions, m_SelMeasureType, newType, dimSplitGroup, m_Parent.SplitVertList.IndexOf(this), 0); if (newType is MeasureTypes.PROPORTIONAL) { for (int i = 0; i < m_Parent.SplitVertList.Count; i++) { m_Parent.SplitVertList.ElementAt(i).SetDimension(newDimensions.ElementAt(i).dDimension); } - } } + } + } else { //tot = (CalculateHeightSplitGroup(m_Parent, HeightTot(), new AreaFound(-1, false))).m_Dimension; - dimSplitGroup = (CalculateHeightSplitGroup(frame, frame.HeightFrame(), new AreaFound(-1, false))).m_Dimension; - AreaDimension ad = new AreaDimension(dDimension, SelMeasureType); + dimSplitGroup = (CalculateHeightSplitGroup(frame, frame.AvailHeightFrame(), new AreaFound(-1, false))).m_Dimension; + foreach (var item in m_Parent.ElemDimHorizList) + { + dimSplitGroup = dimSplitGroup - item.dDimension; + } + AreaDimension ad = new AreaDimension(dDimension, SelMeasureType, Parent); List newDimensions = new List(); foreach (var item in m_Parent.SplitHorizList) { - newDimensions.Add(new AreaDimension(item.dDimension, item.SelMeasureType)); + newDimensions.Add(new AreaDimension(item.dDimension, item.SelMeasureType, item.Parent)); } - m_dDimension = ad.ConvertDimension(newDimensions, m_SelMeasureType, newType, dimSplitGroup, m_Parent.SplitHorizList.IndexOf(this)); + m_dDimension = ad.ConvertDimension(newDimensions, m_SelMeasureType, newType, dimSplitGroup, m_Parent.SplitHorizList.IndexOf(this), 0); if(newType is MeasureTypes.PROPORTIONAL) { for(int i = 0; i < m_Parent.SplitHorizList.Count; i++) diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index af6f3cf..7e08e13 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -638,6 +638,7 @@ namespace WebWindowComplex { firstDisplay = false; // preview SVG senza HW + await UpdateElement(FrameWindow); await DoPreviewSvg(true, true); } List reqList = SashList.Select(x => x.GroupId).ToList(); @@ -1262,12 +1263,7 @@ namespace WebWindowComplex SpElemList.ElementAt(i).SetMinDimension(Window.m_ParameterList.GetValueOrDefault(SpElemList.ElementAt(i).sName + "_DimMin")); SpElemList.ElementAt(i).SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(SpElemList.ElementAt(i).sName + "_DimMax")); string overlapName = string.Join("_", SpElemList.ElementAt(i).sName.Split('_').Skip(1)); - SpElemList.ElementAt(i).SetOverlapElement(Window.m_ParameterList.GetValueOrDefault(SpElemList.ElementAt(i).sName + "_Overlap")); - //// Se la lista in precedenza era vuota, metto i valori di default - //if (prevLiveData.ProfElementList == null || prevLiveData.ProfElementList.Count == 0) - //{ - // SpElemList.ElementAt(i).SetDimension(Window.m_ParameterList.GetValueOrDefault(SpElemList.ElementAt(i).sName + "_DimStd")); - //} + SpElemList.ElementAt(i).SetOverlapElement(Window.m_ParameterList.GetValueOrDefault(overlapName + "_Overlap")); } break; } @@ -1278,11 +1274,6 @@ namespace WebWindowComplex item.SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(item.sName + "_DimMax")); string overlapName = string.Join("_", item.sName.Split('_').Skip(1)); item.SetOverlapElement(Window.m_ParameterList.GetValueOrDefault(overlapName + "_Overlap")); - // Se la lista in precedenza era vuota, metto i valori di default - //if (prevLiveData.ProfElementList == null || prevLiveData.ProfElementList.Count == 0) - //{ - // item.SetDimension(Window.m_ParameterList.GetValueOrDefault(item.sName + "_DimStd")); - //} } } } @@ -1398,6 +1389,8 @@ namespace WebWindowComplex { Frame newFrame = args.currFrame; bool forceSvgNoHw = args.svgNoHw; + if (args.groupIdDelete != -1) + RowCollapsed.Remove(args.groupIdDelete); if (newFrame != null) { // cerco il record @@ -1610,6 +1603,7 @@ namespace WebWindowComplex // richiedo update shape List reqList = SashList.Select(x => x.GroupId).ToList(); await DoPreviewSvg(); + await UpdateElement(FrameWindow); await DoReqShape(reqList); } diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index c714b55..b302bba 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.2.1012 + 3.1.2.1218 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -118,5 +118,6 @@ + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 712f8cc..dc73505 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.2.1012 + 3.1.2.1218 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -102,6 +102,9 @@ + + + From a886e7f3243c59966759a8f383ac8fbb578ab370 Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Mon, 16 Feb 2026 17:55:45 +0100 Subject: [PATCH 7/9] - Modificato calcolo altezza split group - Modificato aggiornamento dimensioni per cambio forma frame --- Test.UI/Data/AntaDoppia.jwd | 2 +- WebWindowComplex/Models/Area.cs | 29 ++++-- WebWindowComplex/Models/AreaDimension.cs | 44 +++------ WebWindowComplex/Models/ElementDimension.cs | 26 ++++++ WebWindowComplex/Models/Frame.cs | 39 ++++---- WebWindowComplex/Models/Sash.cs | 4 +- WebWindowComplex/Models/SashDimension.cs | 82 +++++++++-------- WebWindowComplex/Models/SplitDimension.cs | 90 +++++++++++++++---- WebWindowComplex/TableComp.razor.cs | 3 +- WebWindowComplex/WebWindowComplex.csproj | 43 ++++++++- .../WebWindowConfigurator.csproj | 37 +++++++- 11 files changed, 283 insertions(+), 116 deletions(-) diff --git a/Test.UI/Data/AntaDoppia.jwd b/Test.UI/Data/AntaDoppia.jwd index 4996a9a..9e2534c 100644 --- a/Test.UI/Data/AntaDoppia.jwd +++ b/Test.UI/Data/AntaDoppia.jwd @@ -111,7 +111,7 @@ "SashId": 2, "OpeningType": "TURNONLY_RIGHT", "MeasureType": "PROPORTIONAL", - "Dimension": 2, + "Dimension": 1, "HasHandle": false, "ElementDimensionList": [ { diff --git a/WebWindowComplex/Models/Area.cs b/WebWindowComplex/Models/Area.cs index 858a73f..72c2a3f 100644 --- a/WebWindowComplex/Models/Area.cs +++ b/WebWindowComplex/Models/Area.cs @@ -307,23 +307,36 @@ namespace WebWindowComplex.Models split = (Split)sash.ParentArea.ParentArea; if (sash.ParentArea is Frame || (sash.ParentArea.ParentArea is Split && split.SplitHorizList.Count > 0)) { - Frame frame = new Frame(null, null); - if(split.SplitHorizList.Count > 0) - frame = (Frame)sash.ParentArea.ParentArea.ParentArea; - else - frame = (Frame)sash.ParentArea; - foreach (var i in frame.DimensionList) - dimList.Add(new AreaDimension(i.dDimension, i.SelMeasureType, i.Parent)); + Frame? frame = sash.m_ParentWindow.AreaList.FirstOrDefault(); + if(frame != null) + { + foreach (var i in frame.DimensionList) + dimList.Add(new AreaDimension(i.dDimension, i.SelMeasureType, i.Parent)); + } } else { - //Split s = (Split)sash.ParentArea.ParentArea; foreach (var i in split.SplitVertList) dimList.Add(new AreaDimension(i.dDimension, i.SelMeasureType, i.Parent)); } if (countAbsolute == sash.SashList.Count) { double sum = sash.SashList.Sum(x => x.dDimension); + if (sash.bIsDimensionLight) + { + dim = dim - sash.SashList.First().ElementDimensionList.ElementAt(1).dDimension + - sash.SashList.First().ElementDimensionList.Last().dDimension; + for (int i = 1; i < sash.SashList.Count; i++) + { + dim = dim - sash.SashList[i].ElementDimensionList.ElementAt(1).dDimension + - sash.SashList[i].ElementDimensionList.Last().dDimension; + } + } + else + { + for (int i = 1; i < sash.SashList.Count; i++) + dim = dim + sash.SashList[i].ElementDimensionList.Last().dOverlap; + } double res = dim - sum; if (res > 0) { diff --git a/WebWindowComplex/Models/AreaDimension.cs b/WebWindowComplex/Models/AreaDimension.cs index d81f37c..4d97fb7 100644 --- a/WebWindowComplex/Models/AreaDimension.cs +++ b/WebWindowComplex/Models/AreaDimension.cs @@ -130,17 +130,8 @@ namespace WebWindowComplex.Models { if (newType.Equals(MeasureTypes.PERCENTAGE)) { - double overlapElem = 0; - if (m_Parent is Sash) - { - // Calcolo overlap - Sash s = (Sash)m_Parent; - int indElem = indexSash == 0 ? 1 : s.SashList.ElementAt(indexSash).ElementDimensionList.Count - 1; - if (!s.bIsDimensionLight) - overlapElem = s.SashList.ElementAt(indexSash).ElementDimensionList.ElementAt(indElem).dOverlap / 2; - } //return Double.Round((m_dDimension / m_Parent.Width) * 100, 1); - return ((dDimension - overlapElem) / widthTot) * 100; + return (dDimension / widthTot) * 100; } else { @@ -151,17 +142,8 @@ namespace WebWindowComplex.Models { if (newType.Equals(MeasureTypes.ABSOLUTE)) { - double overlapElem = 0; - if(m_Parent is Sash) - { - // Calcolo overlap - Sash s = (Sash)m_Parent; - int indElem = indexSash == 0 ? 1 : s.SashList.ElementAt(indexSash).ElementDimensionList.Count - 1; - if (!s.bIsDimensionLight) - overlapElem = s.SashList.ElementAt(indexSash).ElementDimensionList.ElementAt(indElem).dOverlap / 2; - } //return Double.Round(ConvertFromPropVal(newType), 2); - return ConvertFromPropVal(itemList, newType, widthTot) + overlapElem; + return ConvertFromPropVal(itemList, newType, widthTot); } else { @@ -173,17 +155,8 @@ namespace WebWindowComplex.Models { if (newType.Equals(MeasureTypes.ABSOLUTE)) { - double overlapElem = 0; - if (m_Parent is Sash) - { - // Calcolo overlap - Sash s = (Sash)m_Parent; - int indElem = indexSash == 0 ? 1 : s.SashList.ElementAt(indexSash).ElementDimensionList.Count - 1; - if (!s.bIsDimensionLight) - overlapElem = s.SashList.ElementAt(indexSash).ElementDimensionList.ElementAt(indElem).dOverlap; - } //return Double.Round((m_dDimension * m_Parent.Width) / 100, 2); - return (dDimension * widthTot) / 100 + overlapElem; + return (dDimension * widthTot) / 100; } else { @@ -282,12 +255,19 @@ namespace WebWindowComplex.Models { // Calcolo overlap Sash s = (Sash)m_Parent; - int indexSash = itemList.IndexOf(this); + int indexSash = -1; + if (this is SashDimension) + { + SashDimension sashDimCurr = (SashDimension)this; + indexSash = s.SashList.IndexOf(sashDimCurr); + } + else + indexSash = itemList.IndexOf(this); int indElem = indexSash == 0 ? 1 : s.SashList.ElementAt(indexSash).ElementDimensionList.Count - 1; if (!s.bIsDimensionLight) overlapElem = s.SashList.ElementAt(indexSash).ElementDimensionList.ElementAt(indElem).dOverlap / 2; } - return dDimension - overlapElem; + return dDimension; } case MeasureTypes.PROPORTIONAL: { diff --git a/WebWindowComplex/Models/ElementDimension.cs b/WebWindowComplex/Models/ElementDimension.cs index 7798ab5..2047e21 100644 --- a/WebWindowComplex/Models/ElementDimension.cs +++ b/WebWindowComplex/Models/ElementDimension.cs @@ -34,6 +34,32 @@ namespace WebWindowComplex.Models { if(dDimension != value) { + if(m_ParentArea is Split) + { + if (value > m_dMax) + value = m_dMax; + else if (value < m_dMin) + value = m_dMin; + Split s = (Split)m_ParentArea; + SplitElementDimension splitElem = (SplitElementDimension)this; + List elemList = new List(); + if (s.ElemDimVertList.Contains(splitElem)) + elemList = s.SplitVertList; + else if (s.ElemDimHorizList.Contains(splitElem)) + elemList = s.SplitHorizList; + if (value > m_dDimension) + { + double diff = (value - m_dDimension)/2; + elemList.ElementAt(m_nIndex - 1).SetDimension(elemList.ElementAt(m_nIndex - 1).dDimension - diff); + elemList.ElementAt(m_nIndex ).SetDimension(elemList.ElementAt(m_nIndex).dDimension - diff); + } + else + { + double diff = (m_dDimension - value)/2; + elemList.ElementAt(m_nIndex - 1).SetDimension(elemList.ElementAt(m_nIndex - 1).dDimension + diff); + elemList.ElementAt(m_nIndex).SetDimension(elemList.ElementAt(m_nIndex).dDimension + diff); + } + } if (value > m_dMax) m_dDimension = m_dMax; else if (value < m_dMin) diff --git a/WebWindowComplex/Models/Frame.cs b/WebWindowComplex/Models/Frame.cs index 94c52c6..b96adcd 100644 --- a/WebWindowComplex/Models/Frame.cs +++ b/WebWindowComplex/Models/Frame.cs @@ -197,8 +197,8 @@ namespace WebWindowComplex.Models { DimensionList.Add(new FrameDimension(this, 1, "Width", widthVal, true)); DimensionList.Add(new FrameDimension(this, 2, "Height", 1400, true)); - foreach (var dim in DimensionList) - SearchAreaList(this, dim.dDimension, dim.sName); + SearchAreaList(this, AvailWidthArea(), "Width"); + SearchAreaList(this, AvailHeightArea(), "Height"); break; } @@ -207,8 +207,8 @@ namespace WebWindowComplex.Models DimensionList.Add(new FrameDimension(this, 1, "Width", widthVal, true)); DimensionList.Add(new FrameDimension(this, 2, "Left Height", 1800, true)); DimensionList.Add(new FrameDimension(this, 3, "Right Height", 1500, true)); - SearchAreaList(this, widthVal, "Width"); - SearchAreaList(this, 1800, "Left Height"); + SearchAreaList(this, AvailWidthArea(), "Width"); + SearchAreaList(this, AvailHeightArea(), "Left Height"); break; } @@ -217,8 +217,8 @@ namespace WebWindowComplex.Models DimensionList.Add(new FrameDimension(this, 1, "Width", widthVal, true)); DimensionList.Add(new FrameDimension(this, 2, "Left Height", 1500, true)); DimensionList.Add(new FrameDimension(this, 3, "Right Height", 1800, true)); - SearchAreaList(this, widthVal, "Width"); - SearchAreaList(this, 1800, "Right Height"); + SearchAreaList(this, AvailWidthArea(), "Width"); + SearchAreaList(this, AvailHeightArea(), "Right Height"); break; } @@ -228,8 +228,8 @@ namespace WebWindowComplex.Models DimensionList.Add(new FrameDimension(this, 1, "Width", widthVal, true)); DimensionList.Add(new FrameDimension(this, 2, "Height", 1800 - (0.4 * widthVal), true)); DimensionList.Add(new FrameDimension(this, 3, "Full Height", 1800, true)); - SearchAreaList(this, widthVal, "Width"); - SearchAreaList(this, 1800, "Full Height"); + SearchAreaList(this, AvailWidthArea(), "Width"); + SearchAreaList(this, AvailHeightArea(), "Full Height"); break; } @@ -238,8 +238,8 @@ namespace WebWindowComplex.Models DimensionList.Add(new FrameDimension(this, 1, "Width", widthVal, true)); DimensionList.Add(new FrameDimension(this, 2, "Height", 2400 - (0.6 * widthVal), true)); DimensionList.Add(new FrameDimension(this, 3, "Full Height", 2400, true)); - SearchAreaList(this, widthVal, "Width"); - SearchAreaList(this, 2400, "Full Height"); + SearchAreaList(this, AvailWidthArea(), "Width"); + SearchAreaList(this, AvailHeightArea(), "Full Height"); break; } @@ -249,8 +249,8 @@ namespace WebWindowComplex.Models DimensionList.Add(new FrameDimension(this, 2, "Height", 2400 - (0.4 * widthVal), true)); DimensionList.Add(new FrameDimension(this, 3, "Full Height", 2400, true)); DimensionList.Add(new FrameDimension(this, 4, "Radius", 200, true)); - SearchAreaList(this, 2000, "Width"); - SearchAreaList(this, 2400, "Full Height"); + SearchAreaList(this, AvailWidthArea(), "Width"); + SearchAreaList(this, AvailHeightArea(), "Full Height"); break; } @@ -259,8 +259,8 @@ namespace WebWindowComplex.Models DimensionList.Add(new FrameDimension(this, 1, "Width", widthVal, true)); DimensionList.Add(new FrameDimension(this, 2, "Height", 1500, true)); DimensionList.Add(new FrameDimension(this, 3, "Height projection", 0, true)); - SearchAreaList(this, widthVal, "Width"); - SearchAreaList(this, 1500, "Height"); + SearchAreaList(this, AvailWidthArea(), "Width"); + SearchAreaList(this, AvailHeightArea(), "Height"); break; } @@ -402,7 +402,7 @@ namespace WebWindowComplex.Models m_ThresholdList = m_AllThresholdList; } - public double AvailHeightFrame() + public double AvailHeightArea() { double dim = 0; switch (SelShapeIndex) @@ -432,7 +432,7 @@ namespace WebWindowComplex.Models } double overlap = 0; if (AreaList.First() is Sash) - overlap = ElementDimensionList.ElementAt(1).dOverlap + + overlap = ElementDimensionList.First().dOverlap + ElementDimensionList.ElementAt(ElementDimensionList.Count() - 2).dOverlap; return dim - ElementDimensionList.ElementAt(0).dDimension - ElementDimensionList.Last().dDimension + @@ -457,6 +457,13 @@ namespace WebWindowComplex.Models if(AreaList.First() is Sash) overlap = ElementDimensionList.ElementAt(1).dOverlap + ElementDimensionList.Last().dOverlap; + if (AreaList.First() is Split) + { + Split s = (Split)AreaList.First(); + if(s.SplitHorizList.Count > 0) + overlap = ElementDimensionList.ElementAt(1).dOverlap + + ElementDimensionList.Last().dOverlap; + } return dim - ElementDimensionList.ElementAt(0).dDimension - ElementDimensionList.Last().dDimension + overlap; diff --git a/WebWindowComplex/Models/Sash.cs b/WebWindowComplex/Models/Sash.cs index a57396a..9daa17b 100644 --- a/WebWindowComplex/Models/Sash.cs +++ b/WebWindowComplex/Models/Sash.cs @@ -295,10 +295,10 @@ namespace WebWindowComplex.Models if (bIsDimensionLight) dNewDimension = (dLastDimension - m_SashList.Last().ElementDimensionList.ElementAt(1).dDimension - m_SashList.Last().ElementDimensionList.Last().dDimension - + m_SashList.Last().ElementDimensionList.Last().dOverlap) / 2; + + Window.m_ParameterList.GetValueOrDefault("Sash_Active_Overlap"))/2; else dNewDimension = dLastDimension / (value + 1 - nSashQty) - + (m_SashList.Last().ElementDimensionList.Last().dOverlap / 2); + + (Window.m_ParameterList.GetValueOrDefault("Sash_Active_Overlap"))/2; } m_SashList[m_SashList.Count - 1].SetDimension(dNewDimension); } diff --git a/WebWindowComplex/Models/SashDimension.cs b/WebWindowComplex/Models/SashDimension.cs index 2573aeb..ca93f50 100644 --- a/WebWindowComplex/Models/SashDimension.cs +++ b/WebWindowComplex/Models/SashDimension.cs @@ -225,9 +225,9 @@ namespace WebWindowComplex.Models { // L'anta modificata non è l'ultima if (nIndex < dimensions.Count - 1) - dimensions[nIndex + 1].SetDimension(dimensions[nIndex + 1].m_dDimension + (m_dDimension - value)); + dimensions[nIndex + 1].SetDimension(Math.Round(dimensions[nIndex + 1].m_dDimension + (m_dDimension - value), 2)); else if (dimensions.Count > 1) - dimensions[nIndex - 1].SetDimension(dimensions[nIndex - 1].m_dDimension + (m_dDimension - value)); + dimensions[nIndex - 1].SetDimension(Math.Round(dimensions[nIndex - 1].m_dDimension + (m_dDimension - value), 2)); else { m_dDimension = 100; @@ -289,35 +289,34 @@ namespace WebWindowComplex.Models break; } } + double overlapCurrSash = 0; + if (!Parent.bIsDimensionLight) + { + int j = nIndex == 0 ? 1 : Parent.SashList.ElementAt(nIndex).ElementDimensionList.Count - 1; + overlapCurrSash = Parent.SashList.ElementAt(nIndex).ElementDimensionList.ElementAt(j).dOverlap / 2; + } + int indexDimChange = 0; + // L'anta modificata non è l'ultima + if (nIndex < absoluteValList.Count - 1) + indexDimChange = nIndex + 1; + // L'anta modificata è l'ultima + else if (dimensions.Count > 1) + indexDimChange = nIndex - 1; + double overlap = 0; + if (!Parent.bIsDimensionLight) + { + int j = indexDimChange == 0 ? 1 : Parent.SashList.ElementAt(nIndex + 1).ElementDimensionList.Count - 1; + overlap = Parent.SashList.ElementAt(indexDimChange).ElementDimensionList.ElementAt(j).dOverlap / 2; + } if (value < m_dDimension) { - // L'anta modificata non è l'ultima - if (nIndex < absoluteValList.Count - 1) - { - absoluteValList[nIndex + 1] = absoluteValList[nIndex + 1] + (absoluteValList[nIndex] - valueInAbsolute); - absoluteValList[nIndex] = valueInAbsolute; - } - // L'anta modificata è l'ultima - else if (dimensions.Count > 1) - { - absoluteValList[nIndex - 1] = absoluteValList[nIndex - 1] + (absoluteValList[nIndex] - valueInAbsolute); - absoluteValList[nIndex] = valueInAbsolute; - } + absoluteValList[indexDimChange] = absoluteValList[indexDimChange] + (absoluteValList[nIndex] - (valueInAbsolute - overlapCurrSash)) + overlap; + absoluteValList[nIndex] = valueInAbsolute; } else { - // L'anta modificata non è l'ultima - if (nIndex < absoluteValList.Count - 1) - { - absoluteValList[nIndex + 1] = absoluteValList[nIndex + 1] - (valueInAbsolute - absoluteValList[nIndex]); - absoluteValList[nIndex] = valueInAbsolute; - } - // L'anta modificata è l'ultima - else if (dimensions.Count > 1) - { - absoluteValList[nIndex - 1] = absoluteValList[nIndex - 1] - (valueInAbsolute - absoluteValList[nIndex]); - absoluteValList[nIndex] = valueInAbsolute; - } + absoluteValList[indexDimChange] = absoluteValList[indexDimChange] - ((valueInAbsolute - overlapCurrSash) - absoluteValList[nIndex]) + overlap; + absoluteValList[nIndex] = valueInAbsolute; } if (MeasureType.Equals(MeasureTypes.PROPORTIONAL)) m_dDimension = value; @@ -516,23 +515,30 @@ namespace WebWindowComplex.Models if (SelMeasureType != (MeasureTypes)value) { MeasureTypes newType = (MeasureTypes)value; - Frame frame = m_Parent.ParentWindow.AreaList.FirstOrDefault(); + Frame? frame = m_Parent.ParentWindow.AreaList.FirstOrDefault(); if (frame != null) { - double widthTot = Parent.CalculateWidthSashGroup(frame!, frame!.DimensionList.Where(x => x.sName == "Width").First().dDimension, new AreaFound(-1, false)).m_Dimension; + double widthTot = Parent.CalculateWidthSashGroup(frame, frame.AvailWidthArea(), new AreaFound(-1, false)).m_Dimension; if (Parent.bIsDimensionLight) + { + for(int i = 0; i < Parent.SashList.Count; i++) { - for(int i = 0; i < Parent.SashList.Count; i++) - { - if (i == 0) - widthTot = widthTot - Parent.SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dDimension - - Parent.SashList.ElementAt(i).ElementDimensionList.Last().dDimension; - else - widthTot = widthTot - Parent.SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dDimension - - Parent.SashList.ElementAt(i).ElementDimensionList.Last().dDimension - + Parent.SashList.ElementAt(i).ElementDimensionList.Last().dOverlap; - } + if (i == 0) + widthTot = widthTot - Parent.SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dDimension + - Parent.SashList.ElementAt(i).ElementDimensionList.Last().dDimension; + else + widthTot = widthTot - Parent.SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dDimension + - Parent.SashList.ElementAt(i).ElementDimensionList.Last().dDimension + + Parent.SashList.ElementAt(i).ElementDimensionList.Last().dOverlap; } + } + else + { + for (int i = 0; i < m_Parent.SashList.Count - 1; i++) + { + widthTot = widthTot + m_Parent.SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dOverlap; + } + } AreaDimension ad = new AreaDimension(dDimension, SelMeasureType, Parent); //if(SelMeasureType is MeasureTypes.ABSOLUTE) // ad = new AreaDimension(dDimension - ElementDimensionList.ElementAt(1).dOverlap, SelMeasureType); diff --git a/WebWindowComplex/Models/SplitDimension.cs b/WebWindowComplex/Models/SplitDimension.cs index f5a9a01..4b0c2b8 100644 --- a/WebWindowComplex/Models/SplitDimension.cs +++ b/WebWindowComplex/Models/SplitDimension.cs @@ -61,7 +61,7 @@ namespace WebWindowComplex.Models { dimensions = m_Parent.SplitHorizList; //dimensionTot = (CalculateHeightSplitGroup(m_Parent, HeightTot(), new AreaFound(-1, false))).m_Dimension; - dimensionTot = (CalculateHeightSplitGroup(frame, frame.AvailHeightFrame(), new AreaFound(-1, false))).m_Dimension; + dimensionTot = (CalculateHeightSplitGroup(frame, frame.AvailHeightArea(), new AreaFound(-1, false))).m_Dimension; } double valMinAbsolute = 100; double valMaxAbsolute = dimensionTot - valMinAbsolute * (dimensions.Count - 1); @@ -270,7 +270,7 @@ namespace WebWindowComplex.Models else { splitList = m_Parent.SplitHorizList; - tot = (CalculateHeightSplitGroup(frame, frame.AvailHeightFrame(), new AreaFound(-1, false))).m_Dimension; + tot = (CalculateHeightSplitGroup(frame, frame.AvailHeightArea(), new AreaFound(-1, false))).m_Dimension; foreach (var item in m_Parent.ElemDimHorizList) { tot = tot - item.dDimension; @@ -386,11 +386,31 @@ namespace WebWindowComplex.Models { adList.Add(new AreaDimension(it.dDimension, it.SelMeasureType, it.Parent)); } - int index = adList.IndexOf(ad) == 0 ? 1 : adList.Count - 1; - double dim = ad.ConvertFromPropVal(adList, MeasureTypes.ABSOLUTE, width) + sash.SashList.ElementAt(i).ElementDimensionList.ElementAt(index).dOverlap / 2; - dim = dim - - sash.SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dDimension - - sash.SashList.ElementAt(i).ElementDimensionList.Last().dDimension; + double widthTot = width; + int index = adList.IndexOf(ad) == 0 ? 1 : adList.Count - 1; ; + double dim = 0; + if (sash.bIsDimensionLight) + { + for (int anta = 0; anta < sash.SashList.Count; anta++) + { + if (anta == 0) + widthTot = widthTot - sash.SashList.ElementAt(anta).ElementDimensionList.ElementAt(1).dDimension + - sash.SashList.ElementAt(anta).ElementDimensionList.Last().dDimension; + else + widthTot = widthTot - sash.SashList.ElementAt(anta).ElementDimensionList.ElementAt(1).dDimension + - sash.SashList.ElementAt(anta).ElementDimensionList.Last().dDimension + + sash.SashList.ElementAt(anta).ElementDimensionList.Last().dOverlap; + } + dim = ad.ConvertFromPropVal(adList, MeasureTypes.ABSOLUTE, widthTot); + } + else + { + dim = ad.ConvertFromPropVal(adList, MeasureTypes.ABSOLUTE, widthTot) + + sash.SashList.ElementAt(i).ElementDimensionList.ElementAt(index).dOverlap / 2; + dim = dim - + sash.SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dDimension - + sash.SashList.ElementAt(i).ElementDimensionList.Last().dDimension; + } res = CalculateWidthSplitGroup(item, dim, res); break; } @@ -443,6 +463,7 @@ namespace WebWindowComplex.Models Split split = (Split)area; if (split.SplitHorizList.Count > 0) { + double dim = height; int index = i; if (split.SelSplitShape is SplitShapes.GRID) index = i % split.SplitHorizList.Count; @@ -450,29 +471,58 @@ namespace WebWindowComplex.Models { case MeasureTypes.ABSOLUTE: { - double heightItemGroup = split.SplitHorizList.ElementAt(index).dDimension; - res = CalculateHeightSplitGroup(item, heightItemGroup, res); + dim = split.SplitHorizList.ElementAt(index).dDimension; + //res = CalculateHeightSplitGroup(item, heightItemGroup, res); break; } case MeasureTypes.PROPORTIONAL: { + double heigthGlass = 0; AreaDimension ad = new AreaDimension(split.SplitHorizList.ElementAt(index).dDimension, split.SplitHorizList.ElementAt(index).SelMeasureType, split.SplitHorizList.ElementAt(index).Parent); List adList = new List(); foreach (var it in split.SplitHorizList) { adList.Add(new AreaDimension(it.dDimension, it.SelMeasureType, it.Parent)); } - double heightItemGroup = ad.ConvertFromPropVal(adList, MeasureTypes.ABSOLUTE, height); - res = CalculateHeightSplitGroup(item, heightItemGroup, res); + foreach (var elem in split.ElemDimHorizList) + { + heigthGlass = heigthGlass - elem.dDimension; + } + dim = ad.ConvertFromPropVal(adList, MeasureTypes.ABSOLUTE, heigthGlass); + //res = CalculateHeightSplitGroup(item, heightItemGroup, res); break; } case MeasureTypes.PERCENTAGE: { - double heightItemGroup = split.SplitHorizList.ElementAt(index).dDimension * height / 100; - res = CalculateHeightSplitGroup(item, heightItemGroup, res); + foreach(var elem in split.ElemDimHorizList) + dim = dim - elem.dDimension; + dim = split.SplitHorizList.ElementAt(index).dDimension * dim / 100; + //res = CalculateHeightSplitGroup(item, heightItemGroup, res); break; } } + if (split.ParentArea is Frame && split.AreaList.ElementAt(i).AreaList.First() is Sash) + { + Frame frame = (Frame)split.ParentArea; + string pos = i == 0 ? "_Top_Overlap" : "_Bottom_Overlap"; + string overlapName = string.Join("_", split.ElemDimHorizList.First().sName.Split('_').Skip(1)); + if (i == 0) + { + dim = dim + frame.ElementDimensionList.First().dOverlap + + Window.m_ParameterList.GetValueOrDefault(overlapName + "_Bottom_Overlap"); + } + else if (i == split.SplitHorizList.Count - 1) + { + dim = dim + frame.ElementDimensionList.ElementAt(frame.ElementDimensionList.Count - 2).dOverlap + + Window.m_ParameterList.GetValueOrDefault(overlapName + "_Top_Overlap"); + } + else + { + dim = dim + Window.m_ParameterList.GetValueOrDefault(overlapName + "_Top_Overlap") + + Window.m_ParameterList.GetValueOrDefault(overlapName + "_Bottom_Overlap"); + } + } + res = CalculateHeightSplitGroup(item, dim, res); if (res.m_Dimension != -1 && res.m_Found) return res; } @@ -534,7 +584,6 @@ namespace WebWindowComplex.Models double dimSplitGroup = 0; if (bIsVertListDim) { - //dimSplitGroup = (CalculateWidthSplitGroup(frame, frame.DimensionList.Where(x => x.sName == "Width").First().dDimension, new AreaFound(-1, false))).m_Dimension; dimSplitGroup = (CalculateWidthSplitGroup(frame, frame.AvailWidthArea(), new AreaFound(-1, false))).m_Dimension; foreach (var item in m_Parent.ElemDimVertList) { @@ -558,8 +607,17 @@ namespace WebWindowComplex.Models else { //tot = (CalculateHeightSplitGroup(m_Parent, HeightTot(), new AreaFound(-1, false))).m_Dimension; - dimSplitGroup = (CalculateHeightSplitGroup(frame, frame.AvailHeightFrame(), new AreaFound(-1, false))).m_Dimension; - foreach (var item in m_Parent.ElemDimHorizList) + dimSplitGroup = (CalculateHeightSplitGroup(frame, frame.AvailHeightArea(), new AreaFound(-1, false))).m_Dimension; + List elemList = new List(); + if (Parent.bSplitStartVert || Parent.nSplitQtyVert == 0) + { + for (int i = 0; i < m_Parent.ElemDimHorizList.Count; i++) + { + if( i == i + m_Parent.ElemDimVertList.Count * i) + elemList.Add(m_Parent.ElemDimHorizList.ElementAtOrDefault(i)); + } + } + foreach (var item in elemList) { dimSplitGroup = dimSplitGroup - item.dDimension; } diff --git a/WebWindowComplex/TableComp.razor.cs b/WebWindowComplex/TableComp.razor.cs index 7e08e13..ee45d3a 100644 --- a/WebWindowComplex/TableComp.razor.cs +++ b/WebWindowComplex/TableComp.razor.cs @@ -638,8 +638,9 @@ namespace WebWindowComplex { firstDisplay = false; // preview SVG senza HW - await UpdateElement(FrameWindow); await DoPreviewSvg(true, true); + if(LiveData.ProfElementList.Count == 0) + await UpdateElement(FrameWindow); } List reqList = SashList.Select(x => x.GroupId).ToList(); if (reqList.Count > 0) diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index b302bba..0a02c32 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.2.1218 + 3.1.2.1617 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -101,6 +101,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index dc73505..bd76ea0 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.2.1218 + 3.1.2.1617 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -89,6 +89,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 9cbe6df807d826945814fcd3b4aa8aa09b3121dd Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Tue, 17 Feb 2026 09:47:10 +0100 Subject: [PATCH 8/9] Modificato aggiornamento dimensioni split a causa di una variazione delle dimensioni del frame --- WebWindowComplex/Models/Area.cs | 33 ++++++++++++++++--- WebWindowComplex/Models/Frame.cs | 7 ++-- WebWindowComplex/WebWindowComplex.csproj | 5 ++- .../WebWindowConfigurator.csproj | 6 +++- 4 files changed, 41 insertions(+), 10 deletions(-) diff --git a/WebWindowComplex/Models/Area.cs b/WebWindowComplex/Models/Area.cs index 72c2a3f..bf1bf16 100644 --- a/WebWindowComplex/Models/Area.cs +++ b/WebWindowComplex/Models/Area.cs @@ -1,4 +1,5 @@ using System.ComponentModel.Design; +using System.Linq; using WebWindowComplex.Json; using static WebWindowComplex.Json.WindowConst; @@ -288,7 +289,21 @@ namespace WebWindowComplex.Models } } else - SearchAreaList(node.AreaList.ElementAt(i), dim, nameDim); + { + Frame? f = node.ParentWindow.AreaList.First(); + double dimAvail = 0; + if (nameDim.Equals("Width")) + dimAvail = dim - f.ElementDimensionList.ElementAt(1).dDimension + - f.ElementDimensionList.Last().dDimension + + f.ElementDimensionList.ElementAt(1).dOverlap + + f.ElementDimensionList.Last().dOverlap; + else + dimAvail = dim - f.ElementDimensionList.First().dDimension + - f.ElementDimensionList.ElementAt(f.ElementDimensionList.Count - 2).dDimension + + f.ElementDimensionList.First().dOverlap + + f.ElementDimensionList.ElementAt(f.ElementDimensionList.Count - 2).dOverlap; + SearchAreaList(node.AreaList.ElementAt(i), dimAvail, nameDim); + } } } } @@ -335,7 +350,8 @@ namespace WebWindowComplex.Models else { for (int i = 1; i < sash.SashList.Count; i++) - dim = dim + sash.SashList[i].ElementDimensionList.Last().dOverlap; + dim = dim + sash.SashList[i].ElementDimensionList.Last().dOverlap + + sash.SashList.First().ElementDimensionList.Last().dOverlap; } double res = dim - sum; if (res > 0) @@ -345,7 +361,7 @@ namespace WebWindowComplex.Models sashDim.SetDimension(sashDim.dDimension + res / countAbsolute); } } - else + else if (res < 0) { foreach (var sashDim in sash.SashList) { @@ -371,14 +387,23 @@ namespace WebWindowComplex.Models { Split split = (Split)area; List splitList = new List(); + double sum = 0; if (nameDim.Equals("Width")) + { splitList = split.SplitVertList; + foreach (var item in split.ElemDimVertList) + sum = sum + item.dDimension; + } else + { splitList = split.SplitHorizList; + foreach (var item in split.ElemDimHorizList) + sum = sum + item.dDimension; + } int countAbsolute = splitList.Where(x => x.MeasureType.Equals(MeasureTypes.ABSOLUTE)).Count(); if (countAbsolute != 0 && countAbsolute == splitList.Count) { - double sum = splitList.Sum(x => x.dDimension); + sum = sum + splitList.Sum(x => x.dDimension); double res = 0; res = dim - sum; if (res > 0) diff --git a/WebWindowComplex/Models/Frame.cs b/WebWindowComplex/Models/Frame.cs index b96adcd..92c3454 100644 --- a/WebWindowComplex/Models/Frame.cs +++ b/WebWindowComplex/Models/Frame.cs @@ -182,7 +182,7 @@ namespace WebWindowComplex.Models if (m_Shape != (Shapes)value) { Shapes oldShape = m_Shape; - Shapes SelShape = (Shapes)value; + m_Shape = (Shapes)value; // salvo vecchie dimensioni List oldDimensionList = new List(DimensionList); // verifico parametri Dimension @@ -190,7 +190,7 @@ namespace WebWindowComplex.Models //double widthVal = oldDimensionList.Where(x => x.sName.Equals("Width")).Select(x => x.dValue).First(); double widthVal = oldDimensionList.Where(x => x.sName.Equals("Width")).Select(x => x.dDimension).First(); // aggiungo Dimensioni - switch (SelShape) + switch (m_Shape) { case Shapes.RECTANGLE: case Shapes.ARC_FULL: @@ -277,7 +277,7 @@ namespace WebWindowComplex.Models SearchSash(sashList, this); // aggiungo Joint m_JointList.Clear(); - switch (SelShape) + switch (m_Shape) { case Shapes.RECTANGLE: case Shapes.RIGHTCHAMFER: @@ -353,7 +353,6 @@ namespace WebWindowComplex.Models // break; // } //} - m_Shape = SelShape; } } } diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index 0a02c32..a64879d 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.2.1617 + 3.1.2.1709 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -158,6 +158,9 @@ + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index bd76ea0..d585018 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.2.1617 + 3.1.2.1709 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -139,6 +139,10 @@ + + + + From c59585e25b1f81c37cacc90eb347377b30d79bf6 Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Tue, 17 Feb 2026 10:19:45 +0100 Subject: [PATCH 9/9] Fix aggiornamento dimensioni a causa di una variazione delle dimensioni del frame --- WebWindowComplex/Models/Area.cs | 29 ++++++++++--------- WebWindowComplex/Models/FrameDimension.cs | 16 +++++++--- WebWindowComplex/WebWindowComplex.csproj | 8 ++++- .../WebWindowConfigurator.csproj | 9 +++++- 4 files changed, 42 insertions(+), 20 deletions(-) diff --git a/WebWindowComplex/Models/Area.cs b/WebWindowComplex/Models/Area.cs index bf1bf16..46ea61b 100644 --- a/WebWindowComplex/Models/Area.cs +++ b/WebWindowComplex/Models/Area.cs @@ -290,19 +290,19 @@ namespace WebWindowComplex.Models } else { - Frame? f = node.ParentWindow.AreaList.First(); - double dimAvail = 0; - if (nameDim.Equals("Width")) - dimAvail = dim - f.ElementDimensionList.ElementAt(1).dDimension - - f.ElementDimensionList.Last().dDimension - + f.ElementDimensionList.ElementAt(1).dOverlap - + f.ElementDimensionList.Last().dOverlap; - else - dimAvail = dim - f.ElementDimensionList.First().dDimension - - f.ElementDimensionList.ElementAt(f.ElementDimensionList.Count - 2).dDimension - + f.ElementDimensionList.First().dOverlap - + f.ElementDimensionList.ElementAt(f.ElementDimensionList.Count - 2).dOverlap; - SearchAreaList(node.AreaList.ElementAt(i), dimAvail, nameDim); + //Frame? f = node.ParentWindow.AreaList.First(); + //double dimAvail = 0; + //if (nameDim.Equals("Width")) + // dimAvail = dim - f.ElementDimensionList.ElementAt(1).dDimension + // - f.ElementDimensionList.Last().dDimension + // + f.ElementDimensionList.ElementAt(1).dOverlap + // + f.ElementDimensionList.Last().dOverlap; + //else + // dimAvail = dim - f.ElementDimensionList.First().dDimension + // - f.ElementDimensionList.ElementAt(f.ElementDimensionList.Count - 2).dDimension + // + f.ElementDimensionList.First().dOverlap + // + f.ElementDimensionList.ElementAt(f.ElementDimensionList.Count - 2).dOverlap; + SearchAreaList(node.AreaList.ElementAt(i), dim, nameDim); } } } @@ -344,7 +344,8 @@ namespace WebWindowComplex.Models for (int i = 1; i < sash.SashList.Count; i++) { dim = dim - sash.SashList[i].ElementDimensionList.ElementAt(1).dDimension - - sash.SashList[i].ElementDimensionList.Last().dDimension; + - sash.SashList[i].ElementDimensionList.Last().dDimension + + sash.SashList[i].ElementDimensionList.Last().dOverlap; } } else diff --git a/WebWindowComplex/Models/FrameDimension.cs b/WebWindowComplex/Models/FrameDimension.cs index 9ee1a43..67a4a68 100644 --- a/WebWindowComplex/Models/FrameDimension.cs +++ b/WebWindowComplex/Models/FrameDimension.cs @@ -123,10 +123,18 @@ namespace WebWindowComplex.Models } } } - if (ParentFrame.AreaList.Count > 0 && sName.Equals("Width")) - ParentFrame.SearchAreaList(ParentFrame, dDimension, "Width"); - else - ParentFrame.SearchAreaList(ParentFrame, dDimension, "Height"); + Frame? f = (Frame)Parent; + double dimAvail = 0; + if (ParentFrame.AreaList.Count > 0 && sName.Equals("Width") && f != null) + { + dimAvail = f.AvailWidthArea(); + ParentFrame.SearchAreaList(ParentFrame, dimAvail, "Width"); + } + else if(f != null) + { + dimAvail = f.AvailHeightArea(); + ParentFrame.SearchAreaList(ParentFrame, dimAvail, "Height"); + } } } } diff --git a/WebWindowComplex/WebWindowComplex.csproj b/WebWindowComplex/WebWindowComplex.csproj index a64879d..76d5b81 100644 --- a/WebWindowComplex/WebWindowComplex.csproj +++ b/WebWindowComplex/WebWindowComplex.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.2.1709 + 3.1.2.1710 Annamaria Sassi Egalware Componente gestione Configurazioni avanzate Window per LUX @@ -158,6 +158,12 @@ + + + + + + diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index d585018..6b35485 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -6,7 +6,7 @@ net8.0 enable enable - 3.1.2.1709 + 3.1.2.1710 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -140,6 +140,13 @@ + + + + + + +