Merge branch 'develop'

This commit is contained in:
Annamaria Sassi
2026-02-17 10:20:31 +01:00
48 changed files with 1702 additions and 698 deletions
+6
View File
@@ -4,6 +4,10 @@
<CentralPackageTransitivePinningEnabled>false</CentralPackageTransitivePinningEnabled>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="AsyncFixer" Version="2.1.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageVersion>
<PackageVersion Include="Egw.Window.Data" Version="2.8.1.2611" />
<PackageVersion Include="EgwCoreLib.Lux.Core" Version="1.0.2601.2809" />
<PackageVersion Include="EgwCoreLib.Lux.Data" Version="1.0.2601.2809" />
@@ -13,6 +17,8 @@
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.21" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.21" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.4" />
<PackageVersion Include="NLog" Version="6.0.7" />
<PackageVersion Include="NLog.Web.AspNetCore" Version="6.1.0" />
<PackageVersion Include="RestSharp" Version="113.1.0" />
</ItemGroup>
</Project>
+2 -2
View File
@@ -37,12 +37,12 @@ namespace Test.UI.Components.Pages
protected Dictionary<string, string> m_CurrArgs = new Dictionary<string, string>();
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()
+2 -2
View File
@@ -514,7 +514,7 @@ namespace Test.UI.Components.Pages
/// Rilettura dati
/// </summary>
/// <returns></returns>
private async Task ReloadData()
private Task ReloadData()
{
//return base.OnInitializedAsync();
AvailHardwareList = new List<Hardware>();
@@ -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)
+4 -2
View File
@@ -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},
@@ -585,7 +587,7 @@ namespace Test.UI.Components.Pages
/// Rilettura dati
/// </summary>
/// <returns></returns>
private async Task ReloadData()
private Task ReloadData()
{
AvailHardwareList = new List<Hardware>();
if (File.Exists(cFileHardware))
@@ -597,7 +599,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)
+2 -2
View File
@@ -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
@@ -329,7 +329,7 @@ namespace Test.UI.Components.Pages
/// Rilettura dati
/// </summary>
/// <returns></returns>
private async Task ReloadData()
private Task ReloadData()
{
//return base.OnInitializedAsync();
AvailHardwareList = new List<Hardware>();
@@ -342,7 +342,7 @@ namespace Test.UI.Components.Pages
AvailHardwareList.Add(item);
}
}
await Task.Delay(100);
return Task.Delay(100);
}
#endregion Private Methods
+9 -41
View File
@@ -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": 1,
"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": [
{
-10
View File
@@ -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,
+7
View File
@@ -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<string>("ServerConf:BaseUrl") ?? "";
app.UsePathBase(baseUrl);
logger.Info($"BaseUrl: {baseUrl}");
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
+6
View File
@@ -29,6 +29,12 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="AsyncFixer">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="NLog" />
<PackageReference Include="NLog.Web.AspNetCore" />
<ProjectReference Include="..\Test.UI.Client\Test.UI.Client.csproj" />
<ProjectReference Include="..\WebAedificaConfigurator\WebAedificaConfigurator.csproj" />
<ProjectReference Include="..\WebWindowComplex\WebWindowComplex.csproj" />
+44
View File
@@ -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"
+4 -4
View File
@@ -39,18 +39,18 @@ namespace WebWindowComplex.Compo
/// Sollevo evento richiesta aggiunta sash su frame
/// </summary>
/// <returns></returns>
private async Task RaiseAddSash()
private Task RaiseAddSash()
{
await EC_AddSash.InvokeAsync(true);
return EC_AddSash.InvokeAsync(true);
}
/// <summary>
/// Sollevo evento richiesta aggiunta split su frame
/// </summary>
/// <returns></returns>
private async Task RaiseAddSplit()
private Task RaiseAddSplit()
{
await EC_AddSplit.InvokeAsync(true);
return EC_AddSplit.InvokeAsync(true);
}
#endregion Private Methods
+8 -4
View File
@@ -39,6 +39,10 @@ namespace WebWindowComplex.Compo
}
}
/// <summary>
/// Metodo per aprire/chiudere area per hw option
/// </summary>
/// <returns></returns>
private async Task changeCollapsed()
{
hwOptCollapsed = !hwOptCollapsed;
@@ -58,13 +62,13 @@ namespace WebWindowComplex.Compo
/// </summary>
/// <param name="updRec"></param>
/// <returns></returns>
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);
}
/// <summary>
@@ -72,13 +76,13 @@ namespace WebWindowComplex.Compo
/// </summary>
/// <param name="updRec"></param>
/// <returns></returns>
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
+38 -34
View File
@@ -116,29 +116,29 @@ namespace WebWindowComplex.Compo
return 0;
}
/// <summary>
/// Metodo per avere il lo step da usare nella form-input
/// </summary>
/// <returns></returns>
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;
}
///// <summary>
///// Metodo per avere il lo step da usare nella form-input
///// </summary>
///// <returns></returns>
//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;
//}
/// <summary>
/// Selezione tipo di apertura anta
@@ -192,18 +192,19 @@ namespace WebWindowComplex.Compo
/// <summary>
/// Sollevo evento richiesta per cambiare tutti i Joint
/// </summary>
/// <param name="JointType"> Tipo di giunto che si vuole </param>
/// <returns></returns>
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);
}
/// <summary>
/// Aggiornamento joint
/// </summary>
/// <param name="updRec"></param>
/// <param name="updRec"> Tipo di giunto che si vuole </param>
/// <returns></returns>
private async Task UpdateJoint(Joint updRec)
{
@@ -220,7 +221,7 @@ namespace WebWindowComplex.Compo
/// <summary>
/// Aggiornamento element
/// </summary>
/// <param name="updRec"></param>
/// <param name="updRec"> Tipo di giunto che si vuole </param>
/// <returns></returns>
private async Task UpdateElement(ElementDimension updRec)
{
@@ -238,7 +239,7 @@ namespace WebWindowComplex.Compo
/// Metodo per cambiare l'anta su cui è presente la maniglia
/// </summary>
/// <returns></returns>
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 +285,16 @@ namespace WebWindowComplex.Compo
sash = CurrSashGroup,
reqProfile = true
};
await EC_UpdateSash.InvokeAsync(args);
return EC_UpdateSash.InvokeAsync(args);
}
/// <summary>
/// Copio contenuto anta da indexCopy a IndexModify
/// </summary>
/// <param name="IndexCopy"> Indice dell'ante di cui voglio copiare contenuto </param>
/// <param name="IndexModify"> Indice dell'ante di cui voglio modificare contenuto </param>
/// <returns></returns>
private async Task CopyContentSash(int IndexCopy, int IndexModify)
private Task CopyContentSash(int IndexCopy, int IndexModify)
{
isOpen = !isOpen;
// Anta selezionata
@@ -307,14 +310,14 @@ namespace WebWindowComplex.Compo
sash = CurrSashGroup,
reqProfile = true
};
await EC_UpdateSash.InvokeAsync(args);
return EC_UpdateSash.InvokeAsync(args);
}
/// <summary>
/// Metodo per aggiungere lo split nella singola anta
/// </summary>
/// <returns></returns>
private async Task AddSplitToSash()
private Task AddSplitToSash()
{
CurrAnta.AddSplit();
DataUpdateProfile args = new DataUpdateProfile()
@@ -322,7 +325,7 @@ namespace WebWindowComplex.Compo
sash = CurrSashGroup,
reqProfile = true
};
await EC_UpdateSash.InvokeAsync(args);
return EC_UpdateSash.InvokeAsync(args);
}
private bool isOpen = false;
@@ -353,6 +356,7 @@ namespace WebWindowComplex.Compo
View = 1,
Edit = 2
}
protected override void OnParametersSet()
{
if (EditMode)
+5 -7
View File
@@ -39,27 +39,25 @@ namespace WebWindowComplex.Compo
/// <summary>
/// Metodo per copiare sash
/// </summary>
/// <param name="indexCurrSash"> Indice della finestra che si vuole copiare</param>
/// <returns></returns>
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);
}
/// <summary>
/// Metodo per aggiungere prima sash
/// </summary>
/// <returns></returns>
private async Task RaiseAddSash()
private Task RaiseAddSash()
{
CurrSplitted.AddFirstSash();
await EC_UpdateSplitted.InvokeAsync(CurrSplitted);
return EC_UpdateSplitted.InvokeAsync(CurrSplitted);
}
#endregion Private Methods
+30
View File
@@ -0,0 +1,30 @@
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#BottomRail">
<i class="fa-solid fa-pen-to-square"></i>
</button>
<div class="modal fade" id="BottomRail" tabindex="-1" aria-labelledby="BottomRailLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="BottomRailLabel">Bottom Rail</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
@if(CurrFrame() != null)
{
@for (int i = CurrFrame().BottomRailElemDimList.Count - 1; i >= 0; i-- )
{
<EditElement CurrRec="CurrFrame().BottomRailElemDimList.ElementAt(i)" IsBottomRail=true EC_Update="UpdateElement"></EditElement>
}
}
@if (CurrSash() != null)
{
@for (int i = CurrSash().BottomRailElemDimList.Count - 1; i >= 0; i--)
{
<EditElement CurrRec="CurrSash().BottomRailElemDimList.ElementAt(i)" IsBottomRail=true EC_Update="UpdateElement"></EditElement>
}
}
</div>
</div>
</div>
</div>
@@ -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<DataBottomRail> EC_UpdateBottomRail { get; set; }
#endregion Public Properties
#region Private Properties
/// <summary>
/// Aggiornamento element Bottom Rail
/// </summary>
/// <param name="updRec"></param>
/// <returns></returns>
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; }
}
}
@@ -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)
+3 -3
View File
@@ -45,12 +45,12 @@ namespace WebWindowComplex.Compo
/// <summary>
/// Metodo per cambiare solo il Fill corrente
/// </summary>
/// <param name="reqFillType"> tipo di fill richiesto </param>
/// <param name="reqFillType"> Tipo di fill richiesto </param>
/// <returns></returns>
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
+5 -5
View File
@@ -80,11 +80,11 @@
}
else
{
<input type="number" class="form-control" @bind="@FrameBottomRailQty">
@if (CurrFrameWindow.BottomRailQty > 0)
{
<FrameBottomRail EC_UpdateFrame="UpdateFrame"></FrameBottomRail>
<BottomRail CurrArea="CurrFrameWindow" EC_UpdateBottomRail="UpdateFrame"></BottomRail>
}
<input type="number" class="form-control" @bind="@FrameBottomRailQty">
}
</div>
</div>
@@ -102,17 +102,17 @@
{
<div class="col d-flex">
<div class="input-group mb-2 justify-content-center">
<button class="@ButtonJointCss(Json.WindowConst.Joints.ANGLED)" @onclick="() => ChangeAllJoints(WebWindowComplex.Json.WindowConst.Joints.ANGLED, CurrFrameWindow)">Angled</button>
<button class="@ButtonJointCss(Json.WindowConst.Joints.ANGLED)" @onclick="() => ChangeAllJoints(WebWindowComplex.Json.WindowConst.Joints.ANGLED)">Angled</button>
</div>
</div>
<div class="col d-flex">
<div class="input-group mb-2 justify-content-center">
<button class="@ButtonJointCss(Json.WindowConst.Joints.FULL_H)" @onclick="() => ChangeAllJoints(WebWindowComplex.Json.WindowConst.Joints.FULL_H, CurrFrameWindow)">Horizontal</button>
<button class="@ButtonJointCss(Json.WindowConst.Joints.FULL_H)" @onclick="() => ChangeAllJoints(WebWindowComplex.Json.WindowConst.Joints.FULL_H)">Horizontal</button>
</div>
</div>
<div class="col d-flex">
<div class="input-group mb-2 justify-content-center">
<button class="@ButtonJointCss(Json.WindowConst.Joints.FULL_V)" @onclick="() => ChangeAllJoints(WebWindowComplex.Json.WindowConst.Joints.FULL_V, CurrFrameWindow)">Vertical</button>
<button class="@ButtonJointCss(Json.WindowConst.Joints.FULL_V)" @onclick="() => ChangeAllJoints(WebWindowComplex.Json.WindowConst.Joints.FULL_V)">Vertical</button>
</div>
</div>
}
+14 -18
View File
@@ -190,22 +190,16 @@ namespace WebWindowComplex.Compo
/// <summary>
/// Metodo per cambiare tutti i joint
/// </summary>
/// <param name="JointType"></param>
/// <returns></returns>
private async 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
};
await EC_UpdateFrame.InvokeAsync(args);
var args = new DataUpdateFrame() { currFrame = CurrFrameWindow, svgNoHw = false };
return EC_UpdateFrame.InvokeAsync(args);
}
/// <summary>
@@ -219,7 +213,8 @@ namespace WebWindowComplex.Compo
/// <summary>
/// Aggiornamento dimensione editata
/// </summary>
/// <param name="updRec"></param>
/// <param name="updRec"> Dimensione aggiornata </param>
/// <returns></returns>
private async Task UpdateDim(FrameDimension updRec)
{
// cerco il record
@@ -285,15 +280,15 @@ namespace WebWindowComplex.Compo
}
/// <summary>
/// Aggiornamento Bottom Rail
/// Aggiornamento Frame
/// </summary>
/// <param name="updRec"></param>
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,
@@ -308,7 +303,7 @@ namespace WebWindowComplex.Compo
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
private string ButtonJointCss(WebWindowComplex.Json.WindowConst.Joints type)
private string ButtonJointCss(Json.WindowConst.Joints type)
{
foreach (var item in CurrFrameWindow.JointList)
{
@@ -330,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
}
+5 -4
View File
@@ -14,10 +14,10 @@
<button class="btn btn-outline-secondary btn-sm" @onclick="() => RemoveArea()">Remove sash group</button>
</div>
</div>
@* <div class="form-check form-switch">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" checked="@CurrSashGroup.bIsDimensionLight" @onclick="() => ChangeTypeDimension()">
<label class="form-check-label" for="switchCheckDefault">Solo luce</label>
</div> *@
</div>
}
<div class="px-2">
<button class="btn btn-close" @onclick="ReqClose"></button>
@@ -69,11 +69,11 @@
}
else
{
<input type="number" class="form-control" @bind="@SashBottomRailQty">
@if (CurrSashGroup.SashBottomRailQty > 0)
{
<SashBottomRail EC_UpdateSash="UpdateSash"></SashBottomRail>
<BottomRail CurrArea="CurrSashGroup" EC_UpdateBottomRail="UpdateBottomRail"></BottomRail>
}
<input type="number" class="form-control" @bind="@SashBottomRailQty">
}
</div>
</div>
@@ -198,6 +198,7 @@
EditMode="editMode"
EC_UpdateSash="UpdateSash"
EC_UpdateSashDim="UpdateSashDimension"
EC_ReqResetDict="ResetDict"
EC_EditView="EditView">
</AreaSash>
}
+79 -86
View File
@@ -198,9 +198,8 @@ namespace WebWindowComplex.Compo
#region Protected Methods
/// <summary>
/// Metodo per rimuovere area
/// Metodo per rimuovere area corrente
/// </summary>
/// <param name="currArea"> area da rimuovere </param>
/// <returns></returns>
protected async Task RemoveArea()
{
@@ -208,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});
@@ -218,56 +218,52 @@ namespace WebWindowComplex.Compo
}
/// <summary>
/// Metodo per cambiare l'anta su cui è presente la maniglia
/// Metodo per cambiare dimensione solo luce
/// </summary>
/// <returns></returns>
//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);
}
/// <summary>
/// Metodo per scegliere tipo di misura
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
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);
}
/// <summary>
@@ -292,7 +288,7 @@ namespace WebWindowComplex.Compo
}
/// <summary>
/// Metodo per aggiornare sash
/// Metodo per aggiornare sash group
/// </summary>
/// <param name="updateS"></param>
/// <returns></returns>
@@ -313,9 +309,27 @@ namespace WebWindowComplex.Compo
}
/// <summary>
/// Metodo per aggiornare sash
/// Metodo per aggiornare sash group
/// </summary>
/// <param name="updateS"></param>
/// <param name="updRec"></param>
/// <returns></returns>
protected async Task UpdateBottomRail(DataBottomRail updRec)
{
if (updRec.sash != null)
{
CurrSashGroup = updRec.sash;
var args = new DataUpdateSash
{
currSash = CurrSashGroup
};
await EC_UpdateSashGroup.InvokeAsync(args);
}
}
/// <summary>
/// Metodo per aggiornare bottom rail
/// </summary>
/// <param name="updRec"></param>
/// <returns></returns>
protected async Task UpdateBottomRail(ElementDimension updRec)
{
@@ -331,9 +345,14 @@ namespace WebWindowComplex.Compo
}
}
protected async Task ResetDict(DataUpdateRes args)
/// <summary>
/// Metodo per resettare dizionario richiesto
/// </summary>
/// <param name="args"></param>
/// <returns></returns>
protected Task ResetDict(DataUpdateRes args)
{
await EC_ReqResetDict.InvokeAsync(args);
return EC_ReqResetDict.InvokeAsync(args);
}
#endregion Protected Methods
@@ -362,7 +381,7 @@ namespace WebWindowComplex.Compo
/// <summary>
/// Aggiornamento opzioni hardware
/// </summary>
/// <param name="updRec"></param>
/// <param name="argsHw"></param>
/// <returns></returns>
private async Task UpdateOpt(DataUpdateHwOption argsHw)
{
@@ -372,59 +391,33 @@ 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);
}
}
/// <summary>
/// Prima chiamata hw option list
/// </summary>
/// <param name="updRec"></param>
/// <returns></returns>
private async Task FirstHwOptionList()
private Task FirstHwOptionList()
{
var args = new DataUpdateSash
{
currSash = CurrSashGroup
};
//await EC_UpdatePreview.InvokeAsync(args);
await 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";
var args = new DataUpdateSash { currSash = CurrSashGroup };
return EC_ReqFirstOptionHw.InvokeAsync(CurrSashGroup);
}
private bool isOpen = false;
+2 -2
View File
@@ -181,7 +181,7 @@
<div class="d-flex justify-content-start align-items-center px-2">
<h6>Element vert</h6>
</div>
@foreach (var element in CurrSplit.ElemDimVertList)
@foreach (var element in vertList())
{
<EditSplitElement CurrRec="element" EC_Update="UpdateElement"></EditSplitElement>
}
@@ -193,7 +193,7 @@
<div class="d-flex justify-content-start align-items-center px-2">
<h6>Element horiz</h6>
</div>
@foreach (var element in CurrSplit.ElemDimHorizList)
@foreach (var element in horizList())
{
<EditSplitElement CurrRec="element" EC_Update="UpdateElement"></EditSplitElement>
}
+40 -6
View File
@@ -196,12 +196,34 @@ namespace WebWindowComplex.Compo
/// <returns></returns>
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<SplitElementDimension> ElemIndexList = new List<SplitElementDimension>();
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,
@@ -313,7 +335,7 @@ namespace WebWindowComplex.Compo
/// </summary>
/// <param name="type"> nuovo tipo </param>
/// <returns></returns>
protected async Task SetMeasureType(MeasureTypes type)
protected Task SetMeasureType(MeasureTypes type)
{
isOpen = !isOpen;
foreach (var item in CurrSplit.SplitVertList)
@@ -329,7 +351,19 @@ namespace WebWindowComplex.Compo
currSplit = CurrSplit,
noSvg = true
};
await EC_UpdateSplit.InvokeAsync(args);
return EC_UpdateSplit.InvokeAsync(args);
}
private List<SplitElementDimension> horizList()
{
int subAreaMin = CurrSplit.ElemDimHorizList.Min(x => x.nSubArea);
return CurrSplit.ElemDimHorizList.Where(x => x.nSubArea == subAreaMin).ToList();
}
private List<SplitElementDimension> vertList()
{
int subAreaMin = CurrSplit.ElemDimVertList.Min(x => x.nSubArea);
return CurrSplit.ElemDimVertList.Where(x => x.nSubArea == subAreaMin).ToList();
}
}
+72 -37
View File
@@ -7,46 +7,81 @@
<tr>
@for (int j = 0; j < maxCol; 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) : "");
}
<td>
<button class="btn btn-sm btn-secondary" style="font-size: 1rem;" @onclick="() => RaiseNextStep(cs, ind)" title="@(s)">@ItemTableList[i].Desc</button>
@* @if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.SASH ||
ItemTableList[i].Type is Json.WindowConst.AreaTypes.SPLIT)
{
<button class="btn btn-sm btn-secondary" style="font-size: 1rem;" @onclick="() => Remove(cs, ind)" title="Remove">Canc</button>
} *@
</td>
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
{
<td>@FillTable(i, j)</td>
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) : "");
}
<td>
<div class="d-flex flex-row align-items-center justify-content-center">
<div class="card text-center p-1 shadow-sm hover-shadow" >
<button class="btn btn-sm btn-rounded" @onclick="() => RaiseNextStep(cs, ind)" title="@(s)"
style="font-size: 1rem;">
@ItemTableList[i].Desc
</button>
</div>
@if (ItemTableList[row].NumChild > 4)
{
<div class="card border-light text-center">
<button class="btn btn-sm" @onclick="() => ChangeCollapsed(ItemTableList[row].Row)"
style="--bs-btn-padding-y: .25rem; --bs-btn-padding-x: .5rem; --bs-btn-font-size: .75rem;">
<i class="@hwIcon(ItemTableList[i].Row)" style="width:0.5rem;"></i>
</button>
</div>
@* <button class="btn btn-xs btn-light btn-rounded" style="width:2rem;"
@onclick="() => changeCollapsed(ItemTableList[row].Row)">
<i class="@hwIcon(ItemTableList[i].Row)" style="width:0.5rem;"></i>
</button> *@
}
@* <div class="card text-center m-1 p-1 shadow-sm hover-shadow">
<button class="btn btn-sm btn-danger btn-rounded"
style="font-size: 1rem;">
<i class="bi bi-trash3-fill"></i>
</button>
</div> *@
</div>
@* @if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.SASH ||
ItemTableList[i].Type is Json.WindowConst.AreaTypes.SPLIT)
{
<button class="btn btn-sm btn-secondary" style="font-size: 1rem;" @onclick="() => Remove(cs, ind)" title="Remove">Canc</button>
} *@
</td>
}
else
{
<td>@FillTable(i, j)</td>
}
}
}
</tr>
+236 -2
View File
@@ -22,24 +22,106 @@ namespace WebWindowComplex.Compo
[Parameter]
public int maxCol { get; set; } = 0;
/// <summary>
/// Dizionario con elementi che possono collassare
/// </summary>
[Parameter]
public Dictionary<int, bool> RowCollapsedDict { get; set; } = new Dictionary<int, bool>();
/// <summary>
/// Dizionario con numero di figli per elementi che possono collassare
/// </summary>
[Parameter]
public Dictionary<int, int> ChildDict { get; set; } = new Dictionary<int, int>();
/// <summary>
/// Evento richiesta prossimo step
/// </summary>
[Parameter]
public EventCallback<DataNextStep> EC_NextStep { get; set; }
/// <summary>
/// Evento aggiornamento dizionari per collasso righe
/// </summary>
[Parameter]
public EventCallback<Dictionary<int, bool>> EC_Collapsed { get; set; }
/// <summary>
/// Metodo per richiesta prossimo step
/// </summary>
/// <returns></returns>
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 Dictionary<int, bool> RowCollapsedDict { get; set; } = new Dictionary<int, bool>();
//private Dictionary<int, int> Child { get; set; } = new Dictionary<int, int>();
//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);
// }
// }
//}
/// <summary>
/// Metodo per aprire/chiudere sottorighe
/// </summary>
/// <returns></returns>
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)
@@ -136,6 +218,157 @@ namespace WebWindowComplex.Compo
return " ";
}
}
private bool HideRow(int row, int col)
{
List<ItemTable> itemSameCol = new List<ItemTable>();
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<ItemTable> itemSameCol = new List<ItemTable>();
// 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
// });
// }
// }
//}
}
/// <summary>
@@ -146,4 +379,5 @@ namespace WebWindowComplex.Compo
public CompileStep currCompileStep { get; set; }
public int index { get; set; }
}
}
+1 -1
View File
@@ -30,7 +30,7 @@ namespace WebWindowComplex.Compo
#region Private Properties
/// <summary>
/// Metodo per aggiornare element corrente
/// Metodo per aggiornare nome element corrente
/// </summary>
private string name()
{
@@ -1,6 +1,6 @@
@using static WebWindowComplex.LayoutConst
<div class="input-group mb-2">
<span class="input-group-text">@name()</span>
<span class="input-group-text">@CurrRec.nIndex</span>
@if (User)
{
<input type="text" readonly class="form-control" value="@(CurrRec.dDimension)">
@@ -8,7 +8,7 @@ namespace WebWindowComplex.Compo
#region Public Properties
/// <summary>
/// Joint corrente
/// Element corrente
/// </summary>
[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
}
@@ -21,7 +21,7 @@ namespace WebWindowComplex.Compo
#region Private Properties
/// <summary>
/// Aggiornamento element
/// Aggiornamento element Bottom Rail
/// </summary>
/// <param name="updRec"></param>
/// <returns></returns>
@@ -14,7 +14,7 @@ namespace WebWindowComplex.Compo
public Sash SashGroup { get; set; } = null!;
[Parameter]
public EventCallback<DataUpdateProfile> EC_UpdateSash { get; set; }
public EventCallback<Sash> 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);
}
}
+1 -1
View File
@@ -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;
}
+51 -27
View File
@@ -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<JsonSashDimension> m_SashList = new List<JsonSashDimension>();
[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<JsonSplitElementDimension> 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<JsonSplitElementDimension> 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);
+67 -19
View File
@@ -1,4 +1,5 @@
using System.ComponentModel.Design;
using System.Linq;
using WebWindowComplex.Json;
using static WebWindowComplex.Json.WindowConst;
@@ -101,9 +102,18 @@ namespace WebWindowComplex.Models
public void AddFirstSash()
{
// Salvo il parent
Area ParentArea = AreaList[0].ParentArea;
if(this is Frame || ParentArea.AreaList.Last().Equals(this))
{
Frame f = null;
if (this is Frame)
f = (Frame)this;
else
f = (Frame)ParentWindow.AreaList.First();
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
@@ -249,7 +259,7 @@ namespace WebWindowComplex.Models
Sash s = (Sash)node;
List<AreaDimension> dimList = new List<AreaDimension>();
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
@@ -262,7 +272,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
@@ -271,7 +281,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
@@ -279,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), dim, nameDim);
}
}
}
}
@@ -298,23 +322,38 @@ 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));
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));
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
+ sash.SashList[i].ElementDimensionList.Last().dOverlap;
}
}
else
{
for (int i = 1; i < sash.SashList.Count; i++)
dim = dim + sash.SashList[i].ElementDimensionList.Last().dOverlap
+ sash.SashList.First().ElementDimensionList.Last().dOverlap;
}
double res = dim - sum;
if (res > 0)
{
@@ -323,7 +362,7 @@ namespace WebWindowComplex.Models
sashDim.SetDimension(sashDim.dDimension + res / countAbsolute);
}
}
else
else if (res < 0)
{
foreach (var sashDim in sash.SashList)
{
@@ -349,14 +388,23 @@ namespace WebWindowComplex.Models
{
Split split = (Split)area;
List<SplitDimension> splitList = new List<SplitDimension>();
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)
@@ -405,7 +453,7 @@ namespace WebWindowComplex.Models
List<AreaDimension> adList = new List<AreaDimension>();
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
@@ -442,7 +490,7 @@ namespace WebWindowComplex.Models
List<AreaDimension> adList = new List<AreaDimension>();
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
+33 -16
View File
@@ -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
/// <param name="oldType"> Vecchio tipo </param>
/// <param name="newType"> Nuovo tipo </param>
/// <returns></returns>
public double ConvertDimension(List<AreaDimension> itemList, MeasureTypes oldType, MeasureTypes newType, double widthTot, int indexSash)
public double ConvertDimension(List<AreaDimension> itemList, MeasureTypes oldType, MeasureTypes newType, double widthTot, int indexSash, double overlap)
{
switch (oldType)
{
@@ -131,7 +131,7 @@ namespace WebWindowComplex.Models
if (newType.Equals(MeasureTypes.PERCENTAGE))
{
//return Double.Round((m_dDimension / m_Parent.Width) * 100, 1);
return (dDimension / widthTot) * 100;
return (dDimension / widthTot) * 100;
}
else
{
@@ -250,6 +250,23 @@ namespace WebWindowComplex.Models
case MeasureTypes.ABSOLUTE:
{
//return Double.Round(dDimension, 2);
double overlapElem = 0;
if (m_Parent is Sash)
{
// Calcolo overlap
Sash s = (Sash)m_Parent;
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;
}
case MeasureTypes.PROPORTIONAL:
@@ -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<SplitDimension> elemList = new List<SplitDimension>();
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)
+84 -45
View File
@@ -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)
@@ -163,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<FrameDimension> oldDimensionList = new List<FrameDimension>(DimensionList);
// verifico parametri Dimension
@@ -171,15 +190,15 @@ 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:
{
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;
}
@@ -188,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;
}
@@ -198,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;
}
@@ -209,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;
}
@@ -219,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;
}
@@ -230,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;
}
@@ -240,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;
}
@@ -258,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:
@@ -334,7 +353,6 @@ namespace WebWindowComplex.Models
// break;
// }
//}
m_Shape = SelShape;
}
}
}
@@ -383,29 +401,41 @@ namespace WebWindowComplex.Models
m_ThresholdList = m_AllThresholdList;
}
public double HeightFrame()
public double AvailHeightArea()
{
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.First().dOverlap +
ElementDimensionList.ElementAt(ElementDimensionList.Count() - 2).dOverlap;
return dim - ElementDimensionList.ElementAt(0).dDimension -
ElementDimensionList.Last().dDimension +
overlap;
}
public override Frame Copy(Area ParentArea)
@@ -413,6 +443,33 @@ namespace WebWindowComplex.Models
return new Frame(null, ParentWindow);
}
/// <summary>
/// Metodo per calcolare l'area disponibile
/// </summary>
/// <returns></returns>
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;
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;
}
return -1;
}
#endregion Public Methods
#region Internal Methods
@@ -642,24 +699,6 @@ namespace WebWindowComplex.Models
}
}
/// <summary>
/// Metodo per calcolare l'area disponibile
/// </summary>
/// <returns></returns>
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
+13 -5
View File
@@ -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;
@@ -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");
}
}
}
}
+190 -13
View File
@@ -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
+ Window.m_ParameterList.GetValueOrDefault("Sash_Active_Overlap"))/2;
else
dNewDimension = dLastDimension / (value + 1 - nSashQty)
+ (Window.m_ParameterList.GetValueOrDefault("Sash_Active_Overlap"))/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<AreaDimension> adList = new List<AreaDimension>();
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);
@@ -451,11 +480,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)
@@ -722,6 +770,7 @@ namespace WebWindowComplex.Models
{
m_IsbDimensionLight = DimensionLight;
}
internal static Sash CreateSash(Area Area)
{
Sash newSash = new Sash(Area, Area.ParentWindow);
@@ -835,7 +884,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)
@@ -1037,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<AreaDimension> adList = new List<AreaDimension>();
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<AreaDimension> adList = new List<AreaDimension>();
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
@@ -1060,7 +1238,6 @@ namespace WebWindowComplex.Models
private int m_nSashBottomRailQty;
private List<ElementDimension> m_ElementDimensionList = new List<ElementDimension>();
private List<ElementDimension> m_BottomRailElemDimList = new List<ElementDimension>();
private List<IdNameStruct> m_OrientationSashTypeList = new List<IdNameStruct>
{
+115 -162
View File
@@ -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<SashDimension> dimensions = m_Parent.SashList;
List<double> absoluteValList = new List<double>();
AreaDimension ad = new AreaDimension(m_dDimension, SelMeasureType);
AreaDimension ad = new AreaDimension(m_dDimension, SelMeasureType, Parent);
List<AreaDimension> adList = new List<AreaDimension>();
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)
@@ -224,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;
@@ -288,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;
@@ -403,25 +403,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<AreaDimension> adList = new List<AreaDimension>();
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 +480,6 @@ namespace WebWindowComplex.Models
m_dDimension = Dimension;
}
/// <summary>
/// Metodo per calcolare larghezza intera sash group
/// </summary>
/// <param name="area"> area di partenza </param>
/// <param name="width"> larghezza di partenza </param>
/// <returns></returns>
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<AreaDimension> adList = new List<AreaDimension>();
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<AreaDimension> adList = new List<AreaDimension>();
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 +515,48 @@ 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.AvailWidthArea(), 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;
}
}
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);
//else
// ad = new AreaDimension(dDimension, SelMeasureType);
List<AreaDimension> newDimensions = new List<AreaDimension>();
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);
+29 -59
View File
@@ -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;
@@ -409,6 +410,7 @@ namespace WebWindowComplex.Models
m_SplitHorizList = value;
}
}
public List<SplitElementDimension> ElemDimHorizList
{
get
@@ -432,17 +434,6 @@ namespace WebWindowComplex.Models
m_ElemDimVertList = value;
}
}
public List<SplitDimension> SplitPositionList
{
get
{
return m_SplitPositionList;
}
set
{
m_SplitPositionList = value;
}
}
public List<IdNameStruct> SplitShapeList
{
@@ -510,7 +501,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<SplitElementDimension> searchElemFromSubArea(int subArea)
@@ -531,34 +521,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 +559,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<SplitElementDimension> 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<SplitElementDimension> 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 +608,13 @@ namespace WebWindowComplex.Models
}
else
{
// 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 +655,7 @@ namespace WebWindowComplex.Models
}
else
{
// Un Elemento per ogni dimensione principale e per ogni sotto dimensione
if (bSplitStartVert)
{
for (int i = 0; i < QtyVert; i++)
@@ -689,12 +663,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));
}
}
}
}
}
@@ -737,14 +711,12 @@ namespace WebWindowComplex.Models
#region Private Fields
//private bool m_bIsPercentage = true;
private bool m_bSplitStartVert = true;
private SplitShapes m_SelSplitShape;
private List<SplitDimension> m_SplitHorizList = new List<SplitDimension>();
private List<SplitElementDimension> m_ElemDimHorizList = new List<SplitElementDimension>();
private List<SplitElementDimension> m_ElemDimVertList = new List<SplitElementDimension>();
private List<SplitDimension> m_SplitPositionList = new List<SplitDimension>();
private List<IdNameStruct> m_SplitShapeList = new List<IdNameStruct>
{
@@ -756,8 +728,6 @@ namespace WebWindowComplex.Models
private List<SplitDimension> m_SplitVertList = new List<SplitDimension>();
//private double m_Width = 0;
#endregion Private Fields
}
}
+136 -33
View File
@@ -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.AvailHeightArea(), 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<double> absoluteValList = new List<double>();
AreaDimension ad = new AreaDimension(dDimension, SelMeasureType);
AreaDimension ad = new AreaDimension(dDimension, SelMeasureType, Parent);
List<AreaDimension> adList = new List<AreaDimension>();
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.AvailHeightArea(), 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<AreaDimension> adList = new List<AreaDimension>();
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<AreaDimension> adList = new List<AreaDimension>();
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,60 @@ 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<AreaDimension> adList = new List<AreaDimension>();
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);
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;
}
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;
}
}
@@ -417,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;
@@ -424,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:
{
AreaDimension ad = new AreaDimension(split.SplitHorizList.ElementAt(index).dDimension, split.SplitHorizList.ElementAt(index).SelMeasureType);
double heigthGlass = 0;
AreaDimension ad = new AreaDimension(split.SplitHorizList.ElementAt(index).dDimension, split.SplitHorizList.ElementAt(index).SelMeasureType, split.SplitHorizList.ElementAt(index).Parent);
List<AreaDimension> adList = new List<AreaDimension>();
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);
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;
}
@@ -457,6 +533,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 +584,50 @@ 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.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<AreaDimension> newDimensions = new List<AreaDimension>();
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.AvailHeightArea(), new AreaFound(-1, false))).m_Dimension;
List<SplitElementDimension> elemList = new List<SplitElementDimension>();
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;
}
AreaDimension ad = new AreaDimension(dDimension, SelMeasureType, Parent);
List<AreaDimension> newDimensions = new List<AreaDimension>();
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++)
+5 -2
View File
@@ -77,8 +77,11 @@
@if (currStep == CompileStep.Tree)
{
<CardTree ItemTableList="m_ItemTableList"
maxCol="m_maxCol"
EC_NextStep="NextStepArgs">
maxCol="m_maxCol"
RowCollapsedDict="RowCollapsed"
ChildDict="Child"
EC_NextStep="NextStepArgs"
EC_Collapsed="CollapsedRowTree">
</CardTree>
}
else if (currStep == CompileStep.Frame)
+73 -15
View File
@@ -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;
@@ -389,10 +390,11 @@ namespace WebWindowComplex
/// Richiesta chiusura SENZA salvataggio (= restore prev)
/// </summary>
/// <returns></returns>
protected async Task DoClose()
protected Task DoClose()
{
editLock = false;
await EC_OnClose.InvokeAsync(false);
Log.Info("Richietsa Chiusura");
return EC_OnClose.InvokeAsync(false);
}
/// <summary>
@@ -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<string, string> Args = new Dictionary<string, string>();
@@ -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<string, string> Args = new Dictionary<string, string>();
@@ -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<string, string> Args = new Dictionary<string, string>();
@@ -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<string, string> Args = new Dictionary<string, string>();
@@ -519,8 +525,10 @@ namespace WebWindowComplex
/// <summary>
/// Metodo di reset
/// </summary>
protected async Task DoReset()
protected Task DoReset()
{
Log.Info("Richietsa reset");
return Task.CompletedTask;
// Da fare
}
@@ -528,11 +536,12 @@ namespace WebWindowComplex
/// Richiesta chiusura con salvataggio
/// </summary>
/// <returns></returns>
protected async Task DoSave()
protected Task DoSave()
{
editLock = false;
Log.Info("Richietsa Salvataggio");
//manca salvataggio JWD
await EC_OnClose.InvokeAsync(true);
return EC_OnClose.InvokeAsync(true);
}
protected override void OnAfterRender(bool firstRender)
@@ -578,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();
@@ -601,6 +611,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();
}
@@ -628,6 +639,8 @@ namespace WebWindowComplex
firstDisplay = false;
// preview SVG senza HW
await DoPreviewSvg(true, true);
if(LiveData.ProfElementList.Count == 0)
await UpdateElement(FrameWindow);
}
List<int> reqList = SashList.Select(x => x.GroupId).ToList();
if (reqList.Count > 0)
@@ -661,7 +674,7 @@ namespace WebWindowComplex
}
}
private async Task BuildFrameDefault()
private Task BuildFrameDefault()
{
// Costruisco window e setto i parametri
Window window = new Window();
@@ -702,7 +715,7 @@ namespace WebWindowComplex
string jwd = JsonConvert.SerializeObject(jsonWindow);
JsonWindow WindowFromJson = JsonConvert.DeserializeObject<JsonWindow>(jwd, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", "");
setCurrWindow(WindowFromJson);
await DoPreviewSvg(true);
return DoPreviewSvg(true);
}
/// <summary>
@@ -833,6 +846,21 @@ namespace WebWindowComplex
m_ItemTableList = new List<ItemTable>();
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);
}
}
}
/// <summary>
@@ -910,6 +938,11 @@ namespace WebWindowComplex
private List<Fill> m_FillList = new List<Fill>();
private List<Splitted> m_SplittedList = new List<Splitted>();
private Dictionary<int, bool> RowCollapsed { get; set; } = new Dictionary<int, bool>();
private Dictionary<int, int> Child { get; set; } = new Dictionary<int, int>();
private static Logger Log = LogManager.GetCurrentClassLogger();
#endregion Private Fields
#region Private Properties
@@ -954,29 +987,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");
}
}
@@ -1083,13 +1122,29 @@ namespace WebWindowComplex
NextStep(newStep, Index);
}
/// <summary>
/// Metodo per aggiornare il valore collassato degli elementi della gerarchia
/// </summary>
/// <param name="Args"></param>
private void CollapsedRowTree(Dictionary<int,bool> 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;
}
}
}
/// <summary>
/// Richiesta reset dizionario Shape con action
/// </summary>
/// <param name="args"></param>
private async Task ReqResetDict(DataUpdateRes args)
private Task ReqResetDict(DataUpdateRes args)
{
await EC_ActionReq.InvokeAsync(args.req);
return EC_ActionReq.InvokeAsync(args.req);
}
/// <summary>
@@ -1153,7 +1208,7 @@ namespace WebWindowComplex
/// </summary>
/// <param name="profileNameList"> Lista dei profili </param>
/// <param name="GroupIdSearch"> Id Area che si sta cercando </param>
/// <param name="EntityIdSearch"> Id dell'anta (se -1 non usare) </param>
/// <param name="EntityIdSearch"> Id dell'anta o dello split (se -1 non usare) </param>
/// <returns></returns>
private void UpdateProfileElement(List<string> profileNameList, int GroupIdSearch, int EntityIdSearch)
{
@@ -1209,7 +1264,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"));
SpElemList.ElementAt(i).SetOverlapElement(Window.m_ParameterList.GetValueOrDefault(overlapName + "_Overlap"));
}
break;
}
@@ -1284,10 +1339,10 @@ namespace WebWindowComplex
/// </summary>
/// <param name="reqFillType"> tipo di fill richiesto </param>
/// <returns></returns>
protected async Task ChangeAllFill(FillTypes reqFillType)
protected Task ChangeAllFill(FillTypes reqFillType)
{
updateAllFill(FrameWindow, reqFillType);
await DoPreviewSvg();
return DoPreviewSvg();
}
/// <summary>
@@ -1335,6 +1390,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
@@ -1547,6 +1604,7 @@ namespace WebWindowComplex
// richiedo update shape
List<int> reqList = SashList.Select(x => x.GroupId).ToList();
await DoPreviewSvg();
await UpdateElement(FrameWindow);
await DoReqShape(reqList);
}
@@ -1597,7 +1655,6 @@ namespace WebWindowComplex
return "btn btn-secondary btn-sm";
}
/// <summary>
/// Metodo per ottenere lista groupId
/// </summary>
@@ -1614,6 +1671,7 @@ namespace WebWindowComplex
}
}
}
#endregion Private Methods
}
}
+97 -1
View File
@@ -6,7 +6,7 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>3.1.2.417</Version>
<Version>3.1.2.1710</Version>
<Authors>Annamaria Sassi</Authors>
<Company>Egalware</Company>
<Description>Componente gestione Configurazioni avanzate Window per LUX</Description>
@@ -18,11 +18,16 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="AsyncFixer">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Egw.Window.Data" />
<PackageReference Include="EgwCoreLib.Razor" />
<PackageReference Include="EgwCoreLib.Utils" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" />
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="NLog" />
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -File $(ProjectDir)\post-build.ps1 -ProjectPath $(ProjectPath)" />
@@ -55,6 +60,97 @@
@@ -6,7 +6,7 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>3.1.2.417</Version>
<Version>3.1.2.1710</Version>
<Authors>Annamaria Sassi</Authors>
<Company>Egalware</Company>
<Description>Componente gestione JWD per LUX</Description>
@@ -78,6 +78,63 @@
+2 -1
View File
@@ -481,8 +481,9 @@ namespace WebWindowTest
/// <summary>
/// Metodo di reset
/// </summary>
protected async Task DoReset()
protected Task DoReset()
{
return Task.CompletedTask;
// Da fare
}