Merge branch 'release/UpdateDisplaySvg_03'

This commit is contained in:
Samuele Locatelli
2026-03-20 10:32:52 +01:00
38 changed files with 1851 additions and 1860 deletions
+2 -2
View File
@@ -9,8 +9,8 @@
<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" />
<PackageVersion Include="EgwCoreLib.Lux.Core" Version="1.0.2603.918" />
<PackageVersion Include="EgwCoreLib.Lux.Data" Version="1.0.2603.918" />
<PackageVersion Include="EgwCoreLib.Razor" Version="1.5.2511.312" />
<PackageVersion Include="EgwCoreLib.Utils" Version="1.5.2511.312" />
<PackageVersion Include="Microsoft.AspNetCore.Components.Web" Version="8.0.21" />
+2 -2
View File
@@ -296,9 +296,9 @@ namespace Test.UI.Components.Pages
Random random = new Random();
CalcUid = Convert.ToString(random.Next(1000, 10000));
windowUid = CalcUid;
//InitialJwd = File.ReadAllText("Data\\FinestraSplitGrid.jwd");
//initialJwd = File.ReadAllText("Data\\FinestraSplitGrid.jwd");
InitialJwd = File.ReadAllText("Data\\AntaDoppia.jwd");
//InitialJwd = File.ReadAllText("Data\\ArcoAntaDoppia.jwd");
//initialJwd = File.ReadAllText("Data\\ArcoAntaDoppia.jwd");
currJwd = InitialJwd;
// rileggo altri dati
await ReloadData();
+18 -11
View File
@@ -66,20 +66,27 @@
</div>
</div>
*@
@if(doEdit)
{
<WebWindowComplex.TableComp ListPayload="SetupList"
LiveData="CurrData"
SelectionData="SelectList"
baseUser="User"
EC_ActionReq="DoAction"
EC_DoUpdate="ExecRequest"
EC_OnClose="CloseObj">
</WebWindowComplex.TableComp>
@if (doEdit)
{
<WebWindowComplex.TableComp ListPayload="SetupList"
LiveData="CurrData"
SelectionData="SelectList"
baseUser="User"
EC_ActionReq="DoAction"
EC_DoUpdate="ExecRequest"
EC_OnClose="CloseObj">
</WebWindowComplex.TableComp>
}
else
{
<button class="brn btn-danger" @onclick="SetEdit">Click per editare</button>
<div class="d-flex justify-content-between">
<div class="px-0">
<button class="btn btn-primary" @onclick="SetEdit">Click per editare</button>
</div>
<div class="px-0">
<button class="btn btn-primary" @onclick="() => ToggleJwd()">Toggle JWD</button>
</div>
</div>
}
@if (!string.IsNullOrEmpty(outClose))
+40 -16
View File
@@ -12,12 +12,6 @@ namespace Test.UI.Components.Pages
{
public partial class EditJWD : IDisposable
{
#region Public Fields
public string InitialJwd = "";
#endregion Public Fields
#region Public Methods
public void Dispose()
@@ -144,12 +138,9 @@ namespace Test.UI.Components.Pages
Random random = new Random();
CalcUid = Convert.ToString(random.Next(1000, 10000));
windowUid = CalcUid;
//InitialJwd = File.ReadAllText("Data\\AntaDoppiaInglesine.jwd");
#if false
InitialJwd = File.ReadAllText("Data\\AntaDoppia.jwd");
#endif
InitialJwd = "{}";
currJwd = InitialJwd;
//initialJwd = File.ReadAllText("Data\\AntaDoppiaInglesine.jwd");
//initialJwd = File.ReadAllText("Data\\AntaDoppia.jwd");
currJwd = initialJwd;
// rileggo altri dati
await ReloadData();
// costruisco lista profili
@@ -178,7 +169,7 @@ namespace Test.UI.Components.Pages
};
CurrData = new LivePayload()
{
CurrJwd = InitialJwd,
CurrJwd = currJwd,
SvgPreview = currSvg,
DictShape = currGroupShape,
DictOptionsXml = currHwOption
@@ -418,6 +409,8 @@ namespace Test.UI.Components.Pages
{"Frame_Rail_Bottom_DimMax", 80}
};
private bool startEmpty = true;
private List<Threshold> ThresholdProfilo78 = new List<Threshold>()
{
{ new Threshold(3, "Bottom") },
@@ -435,6 +428,26 @@ namespace Test.UI.Components.Pages
#endregion Private Fields
#region Private Properties
private string initialJwd
{
get
{
if (startEmpty)
{
return "{}";
}
else
{
return File.ReadAllText("Data\\AntaDoppiaInglesine.jwd");
//return File.ReadAllText("Data\\AntaDoppia.jwd");
}
}
}
#endregion Private Properties
#region Private Methods
/// <summary>
@@ -443,9 +456,10 @@ namespace Test.UI.Components.Pages
/// <param name="reqSave"></param>
private void CloseObj(DataSave reqSave)
{
currJwd = reqSave.currJwd;
outClose = !reqSave.ForceSave ? "Richiesto chiusura!" : "";
outSave = reqSave.ForceSave ? "Richiesto salvataggio!" : "";
currJwd = reqSave.ForceSave ? reqSave.currJwd : initialJwd;
outClose = !reqSave.ForceSave ? "Richiesto Close!" : "";
outSave = reqSave.ForceSave ? "Richiesto Close + Save!" : "";
doEdit = false;
}
private void ConfInit()
@@ -624,6 +638,16 @@ namespace Test.UI.Components.Pages
doEdit = true;
}
private Task ToggleJwd()
{
startEmpty = !startEmpty;
currJwd = initialJwd;
currSvg = "";
CurrData.CurrJwd = currJwd;
CurrData.SvgPreview = currSvg;
return InvokeAsync(StateHasChanged);
}
private void updateInfoJwd(string currSer, string? newFamilyHardware, Hardware? newHardware, string? newColorMaterial, string? newMaterial, string? newGlass, string? newProfile)
{
var newJwd = SerialMan.MassUpdate(currSer, newFamilyHardware, newHardware, newColorMaterial, newMaterial, newGlass, newProfile);
@@ -133,7 +133,7 @@ namespace Test.UI.Components.Pages
CalcUid = Convert.ToString(random.Next(1000, 10000));
windowUid = CalcUid;
InitialJwd = File.ReadAllText("Data\\FinestraSplitGrid.jwd");
//InitialJwd = File.ReadAllText("Data\\AntaDoppia.jwd");
//initialJwd = File.ReadAllText("Data\\AntaDoppia.jwd");
currJwd = InitialJwd;
// rileggo altri dati
await ReloadData();
+3 -3
View File
@@ -335,7 +335,7 @@ namespace Test.UI.Components.Pages
Random random = new Random();
CalcUid = Convert.ToString(random.Next(1000, 10000));
windowUid = CalcUid;
//InitialJwd = File.ReadAllText("Data\\AntaDoppiaInglesine.jwd");
//initialJwd = File.ReadAllText("Data\\AntaDoppiaInglesine.jwd");
InitialJwd = File.ReadAllText("Data\\AntaDoppia.jwd");
currJwd = InitialJwd;
// rileggo altri dati
@@ -611,8 +611,8 @@ namespace Test.UI.Components.Pages
}
private Task RemoveJwd()
{
//InitialJwd = "{}";
//currJwd = InitialJwd;
//initialJwd = "{}";
//currJwd = initialJwd;
CurrData.CurrJwd = "{}";
// rileggo altri dati
return ReloadData();
+3 -1
View File
@@ -52,7 +52,9 @@
},
"AllowedHosts": "*",
"ConnectionStrings": {
"Redis": "redis.ufficio:26379, serviceName=devel, DefaultDatabase=6, keepAlive=180, connectTimeout=15000, syncTimeout=15000, asyncTimeout=15000, abortConnect=false, ssl=false, allowAdmin=true"
"Redis": "redis.ufficio:26379, serviceName=devel, DefaultDatabase=6, keepAlive=180, connectTimeout=15000, syncTimeout=15000, asyncTimeout=15000, abortConnect=false, ssl=false, allowAdmin=true",
"DefaultConnection": "Server=mdb.ufficio;port=3306;database=Lux_000;uid=lux_user;pwd=Egal_pwd!;sslmode=None;",
"Lux.All": "Server=mdb.ufficio;port=3306;database=Lux_000;uid=lux_user;pwd=Egal_pwd!;sslmode=None;"
},
"ServerConf": {
"BaseUrl": "/lux/test/",
+1 -1
View File
@@ -5,7 +5,7 @@
<h5>Area frame</h5>
</div>
<div class="col d-flex justify-content-between">
@if (SashList.Count == 0 && SplitList.Count == 0)
@if (SashGroupList.Count == 0 && SplitList.Count == 0)
{
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="RaiseAddSash">Aggiungi sash</button>
+2 -2
View File
@@ -16,8 +16,8 @@ namespace WebWindowComplex.Compo
/// <summary>
/// Lista sash
/// </summary>
[CascadingParameter(Name = "SashList")]
public List<Sash> SashList { get; set; } = null!;
[CascadingParameter(Name = "SashGroupList")]
public List<Sash> SashGroupList { get; set; } = null!;
/// <summary>
/// Lista split
+33 -5
View File
@@ -30,8 +30,8 @@ namespace WebWindowComplex.Compo
/// <summary>
/// Lista delle sash
/// </summary>
[CascadingParameter(Name = "SashList")]
public List<Sash> SashList { get; set; } = null!;
[CascadingParameter(Name = "SashGroupList")]
public List<Sash> SashGroupList { get; set; } = null!;
/// <summary>
/// Livello di accesso (utente base)
@@ -196,8 +196,36 @@ namespace WebWindowComplex.Compo
/// <returns></returns>
private Task ChangeAllJoints(Json.WindowConst.Joints JointType)
{
foreach (var item in CurrSashDim.JointList)
item.SelJointType = JointType;
for (int i = 0; i < CurrSashDim.JointList.Count; i++)
{
Frame? frame = CurrSashGroup.ParentWindow.AreaList.FirstOrDefault();
if (frame != null && (frame.Shape is Json.WindowConst.Shapes.ARC ||
frame.Shape is Json.WindowConst.Shapes.ARC_FULL ||
frame.Shape is Json.WindowConst.Shapes.DOUBLEARC ||
frame.Shape is Json.WindowConst.Shapes.THREECENTERARC) &&
(CurrSashGroup.ParentArea.ParentArea is Split &&
CurrSashGroup.ParentArea.ParentArea.AreaList.LastOrDefault().AreaList.FirstOrDefault().Equals(CurrSashGroup)))
{
if(CurrSashGroup.SashList.Count == 1)
{
if(i == 2 || i == CurrSashDim.JointList.Count - 1)
CurrSashDim.JointList.ElementAt(i).SelJointType = Joints.ANGLED;
else
CurrSashDim.JointList.ElementAt(i).SelJointType = JointType;
}
else
{
if (IndexSash == 0 && i == CurrSashDim.JointList.Count - 1)
CurrSashDim.JointList.ElementAt(i).SelJointType = Joints.ANGLED;
else if(IndexSash == CurrSashGroup.SashList.Count - 1 && i == 2)
CurrSashDim.JointList.ElementAt(i).SelJointType = Joints.ANGLED;
else
CurrSashDim.JointList.ElementAt(i).SelJointType = JointType;
}
}
else
CurrSashDim.JointList.ElementAt(i).SelJointType = JointType;
}
return EC_UpdateSashDim.InvokeAsync(CurrSashDim);
}
@@ -242,7 +270,7 @@ namespace WebWindowComplex.Compo
private Task ChangeHandle()
{
// Cerco la Sash che si sta considerando nella lista Sash
var s = SashList.Where(x => x.GroupId == CurrSashGroup.GroupId).FirstOrDefault();
var s = SashGroupList.Where(x => x.GroupId == CurrSashGroup.GroupId).FirstOrDefault();
if (s != null)
{
// Setto la presenza o meno della maniglia per ogni anta
+2 -2
View File
@@ -10,11 +10,11 @@
</div>
</div>
<div class="col d-flex justify-content-center">
@for (int j = 0; j < SashList.Count; j++)
@for (int j = 0; j < SashGroupList.Count; j++)
{
int Index = j;
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => RaiseCopySash(Index)">Copy Sash @(SashList.Count == 1 ? "" : (Index + 1))</button>
<button class="btn btn-outline-secondary btn-sm" @onclick="() => RaiseCopySash(Index)">Copy Sash @(SashGroupList.Count == 1 ? "" : (Index + 1))</button>
</div>
}
</div>
+2 -2
View File
@@ -12,7 +12,7 @@ namespace WebWindowComplex.Compo
/// Lista delle sash
/// </summary>
[Parameter]
public List<Sash> SashList { get; set; } = null!;
public List<Sash> SashGroupList { get; set; } = null!;
/// <summary>
/// Oggetto splitted corrente
@@ -44,7 +44,7 @@ namespace WebWindowComplex.Compo
private Task RaiseCopySash(int indexCurrSash)
{
CurrSplitted.AreaList.RemoveAll(i => i != null);
Area a = SashList[indexCurrSash].Copy(CurrSplitted);
Area a = SashGroupList[indexCurrSash].Copy(CurrSplitted);
a.SetParentArea(CurrSplitted);
CurrSplitted.AreaList.Add(a);
return EC_UpdateSplitted.InvokeAsync(CurrSplitted);
+2 -21
View File
@@ -73,7 +73,7 @@
</div>
</div>
<div class="col-md-12 col-lg-6">
@if (SashList.Count == 0)
@if (SashGroupList.Count == 0)
{
<div class="d-flex justify-content-start align-items-center" style="min-height: 2.5rem;">
<h6 class="fw-bold">Bottom rail</h6>
@@ -112,25 +112,6 @@
<button type="button" class="@ButtonJointCss(Json.WindowConst.Joints.FULL_V)" @onclick="() => ChangeAllJoints(WebWindowComplex.Json.WindowConst.Joints.FULL_V)">Vertical</button>
</div>
</div>
@* <div class="col d-flex justify-content-end align-items-center">
<button class="btn btn-outline-secondary btn-sm" type="button" @onclick="()=>ChangeAll()">
ChangeAll
</button>
</div>
@if (ForceChangeAll)
{
<div class="row py-2">
<div class="col-md-4">
<button class="@ButtonJointCss(Json.WindowConst.Joints.ANGLED)" @onclick="() => ChangeAllJoints(WebWindowComplex.Json.WindowConst.Joints.ANGLED)">Angled</button>
</div>
<div class="col-md-4">
<button class="@ButtonJointCss(Json.WindowConst.Joints.FULL_H)" @onclick="() => ChangeAllJoints(WebWindowComplex.Json.WindowConst.Joints.FULL_H)">Horizontal</button>
</div>
<div class="col-md-4">
<button class="@ButtonJointCss(Json.WindowConst.Joints.FULL_V)" @onclick="() => ChangeAllJoints(WebWindowComplex.Json.WindowConst.Joints.FULL_V)">Vertical</button>
</div>
</div>
} *@
@* <div class="col d-flex justify-content-end align-items-center">
<div class="dropdown">
<button class="btn btn-outline-secondary dropdown-toggle btn-sm" type="button" data-bs-toggle="dropdown">
@@ -171,7 +152,7 @@
@if (!User)
{
@if (!(CurrFrameWindow.AreaList[0] is Split) || (SashList.Count == 0 && SplitList.Count == 0))
@if (!(CurrFrameWindow.AreaList[0] is Split) || (SashGroupList.Count == 0 && SplitList.Count == 0))
{
<AreaFrame EC_AddSash="AddSash"
EC_AddSplit="AddSplit">
+12 -7
View File
@@ -47,8 +47,8 @@ namespace WebWindowComplex.Compo
/// <summary>
/// Lista di sash
/// </summary>
[CascadingParameter(Name = "SashList")]
public List<Sash> SashList { get; set; } = null!;
[CascadingParameter(Name = "SashGroupList")]
public List<Sash> SashGroupList { get; set; } = null!;
/// <summary>
/// Lista di split
@@ -81,7 +81,7 @@ namespace WebWindowComplex.Compo
_ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetDictShape});
_ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetDimElem });
_ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetHwOpt });
foreach (var s in SashList)
foreach (var s in SashGroupList)
{
s.SelHardwareFromId = "000000";
}
@@ -110,7 +110,7 @@ namespace WebWindowComplex.Compo
string valueName = "";
if (threshold != null)
valueName = threshold.Name;
if (SashList.Count > 0 || (SashList.Count == 0 && !valueName.Equals("Threshold")))
if (SashGroupList.Count > 0 || (SashGroupList.Count == 0 && !valueName.Equals("Threshold")))
{
CurrFrameWindow.SelThresholdFromType = value;
var args = new DataUpdateFrame()
@@ -212,7 +212,7 @@ namespace WebWindowComplex.Compo
svgNoHw = true
};
await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req=LayoutConst.DataAction.ResetDictShape});
if(SashList.Count > 0)
if(SashGroupList.Count > 0)
await EC_ReqOptionHw.InvokeAsync(CurrFrameWindow);
await EC_ReqElement.InvokeAsync(CurrFrameWindow);
await EC_UpdateFrame.InvokeAsync(args);
@@ -225,9 +225,14 @@ namespace WebWindowComplex.Compo
/// <returns></returns>
private Task ChangeAllJoints(Json.WindowConst.Joints JointType)
{
foreach (Joint joint in CurrFrameWindow.JointList)
for (int i = 0; i < CurrFrameWindow.JointList.Count; i++)
{
joint.SelJointType = JointType;
if((CurrFrameWindow.Shape is Json.WindowConst.Shapes.ARC || CurrFrameWindow.Shape is Json.WindowConst.Shapes.ARC_FULL ||
CurrFrameWindow.Shape is Json.WindowConst.Shapes.DOUBLEARC || CurrFrameWindow.Shape is Json.WindowConst.Shapes.THREECENTERARC) &&
(i == 2 || i == CurrFrameWindow.JointList.Count - 1))
CurrFrameWindow.JointList.ElementAt(i).SelJointType = Json.WindowConst.Joints.ANGLED;
else
CurrFrameWindow.JointList.ElementAt(i).SelJointType = JointType;
}
var args = new DataUpdateFrame() { currFrame = CurrFrameWindow, svgNoHw = false };
return EC_UpdateFrame.InvokeAsync(args);
+1 -1
View File
@@ -5,7 +5,7 @@
<div class="card-header bg-light bg-opacity-25">
<div class="d-flex justify-content-between align-items-center">
<div class="px-2">
<h5>Sash group @(SashList.Count > 1 ? (SashList.IndexOf(CurrSashGroup) + 1) : "")</h5>
<h5>Sash group @(SashGroupList.Count > 1 ? (SashGroupList.IndexOf(CurrSashGroup) + 1) : "")</h5>
</div>
@if (!User)
{
@@ -67,8 +67,8 @@ namespace WebWindowComplex.Compo
/// <summary>
/// Lista di sash
/// </summary>
[CascadingParameter(Name = "SashList")]
public List<Sash> SashList { get; set; } = null!;
[CascadingParameter(Name = "SashGroupList")]
public List<Sash> SashGroupList { get; set; } = null!;
/// <summary>
/// Frame corrente
@@ -265,7 +265,7 @@ namespace WebWindowComplex.Compo
protected async Task RemoveArea()
{
CurrSashGroup.Remove();
if (FrameWindow.SelThreshold.Name.Contains("Threshold") && SashList.IndexOf(CurrSashGroup) == 0)
if (FrameWindow.SelThreshold.Name.Contains("Threshold") && SashGroupList.IndexOf(CurrSashGroup) == 0)
{
Threshold? updThreshold = FrameWindow.ThresholdList.FirstOrDefault(x => x.Name != "Threshold");
if(updThreshold != null)
+7 -7
View File
@@ -19,7 +19,7 @@ namespace WebWindowComplex.Compo
/// Lista di sash
/// </summary>
[Parameter]
public List<Sash> SashList { get; set; } = null!;
public List<Sash> SashGroupList { get; set; } = null!;
/// <summary>
/// Lista di split
@@ -306,19 +306,19 @@ namespace WebWindowComplex.Compo
/// <returns></returns>
protected string descParentSplit()
{
if ((CurrSplit.ParentArea is Splitted || CurrSplit.ParentArea is Sash) && SashList.Count > 0)
if ((CurrSplit.ParentArea is Splitted || CurrSplit.ParentArea is Sash) && SashGroupList.Count > 0)
{
for (int j = 0; j < SashList.Count; j++)
for (int j = 0; j < SashGroupList.Count; j++)
{
if (SashList[j].Equals(CurrSplit.ParentArea))
if (SashGroupList[j].Equals(CurrSplit.ParentArea))
{
return "Sash " + (j + 1);
}
else if (SashList[j].Equals(CurrSplit.ParentArea.ParentArea))
else if (SashGroupList[j].Equals(CurrSplit.ParentArea.ParentArea))
{
for (int k = 0; k < SashList[j].AreaList.Count; k++)
for (int k = 0; k < SashGroupList[j].AreaList.Count; k++)
{
if (SashList[j].AreaList[k].AreaList[0].Equals(CurrSplit))
if (SashGroupList[j].AreaList[k].AreaList[0].Equals(CurrSplit))
{
return "Sash group " + (j + 1) + " - sash " + (k + 1);
}
+4 -4
View File
@@ -73,14 +73,14 @@
</button>
}
@if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.FRAME &&
((SashList.Count == 0 && SplitList.Count == 0) || !(FrameWindow.AreaList.First() is Split)))
((SashGroupList.Count == 0 && SplitList.Count == 0) || !(FrameWindow.AreaList.First() is Split)))
{
<div class="dropdown px-4">
<button class="btn btn-sm dropdown-toggle" type="button" @onclick="ToggleDropdownFrame">
<i class="fa-solid fa-plus"></i>
</button>
<ul class="dropdown-menu @(isOpenFrame ? "show" : "")" style="min-width:5rem; max-width:10rem">
@if(SashList.Count == 0 && SplitList.Count == 0)
@if(SashGroupList.Count == 0 && SplitList.Count == 0)
{
<li><button class="dropdown-item" @onclick="RaiseAddSash">Sash</button></li>
}
@@ -105,10 +105,10 @@
</button>
<ul class="dropdown-menu @(isOpenFill.ElementAt(currIndexFill) ? "show" : "")" style="min-width:5rem; max-width:10rem">
<li><button class="dropdown-item" @onclick="() => AddSashIntoFill(currIndexFill)">Add Sash</button></li>
@for (int k = 0; k < SashList.Count; k++)
@for (int k = 0; k < SashGroupList.Count; k++)
{
int Index = k;
<li><button class="dropdown-item" @onclick="() => CopySashIntoFill(Index, currIndexFill)">Copy Sash @(SashList.Count == 1 ? "" : (Index + 1))</button></li>
<li><button class="dropdown-item" @onclick="() => CopySashIntoFill(Index, currIndexFill)">Copy Sash @(SashGroupList.Count == 1 ? "" : (Index + 1))</button></li>
}
</ul>
</div>
+3 -3
View File
@@ -34,7 +34,7 @@ namespace WebWindowComplex.Compo
/// Lista di sash
/// </summary>
[Parameter]
public List<Sash> SashList { get; set; } = null!;
public List<Sash> SashGroupList { get; set; } = null!;
/// <summary>
/// Lista di split
@@ -198,7 +198,7 @@ namespace WebWindowComplex.Compo
svgNoHw = true
};
await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetDictShape });
if (SashList.Count > 0)
if (SashGroupList.Count > 0)
await EC_ReqOptionHw.InvokeAsync(FrameWindow);
await EC_ReqElement.InvokeAsync(FrameWindow);
await EC_UpdateFrame.InvokeAsync(args);
@@ -229,7 +229,7 @@ namespace WebWindowComplex.Compo
if (currSplitted != null)
{
currSplitted.AreaList.RemoveAll(i => i != null);
Area a = SashList[indexCurrSash].Copy(currSplitted);
Area a = SashGroupList[indexCurrSash].Copy(currSplitted);
a.SetParentArea(currSplitted);
currSplitted.AreaList.Add(a);
}
@@ -1,20 +0,0 @@
<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">
@foreach (var item in CurrFrame.BottomRailElemDimList)
{
<EditElement CurrRec="item" EC_Update="UpdateElement"></EditElement>
}
</div>
</div>
</div>
</div>
@@ -1,42 +0,0 @@
using Microsoft.AspNetCore.Components;
using WebWindowComplex.Models;
namespace WebWindowComplex.Compo
{
public partial class FrameBottomRail
{
#region Public Properties
/// <summary>
/// Frame corrente
/// </summary>
[CascadingParameter(Name = "CurrFrameWindow")]
public Frame CurrFrame { get; set; } = null!;
[Parameter]
public EventCallback<Frame> EC_UpdateFrame { 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)
{
// cerco il record
var currRec = CurrFrame.BottomRailElemDimList.FirstOrDefault(x => x.ParentArea == updRec.ParentArea && x.nIndex == updRec.nIndex);
// lo aggiorno
if (updRec != null)
{
currRec = updRec;
await EC_UpdateFrame.InvokeAsync(CurrFrame);
}
}
#endregion Private Properties
}
}
@@ -1,20 +0,0 @@
<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">
@foreach (var item in SashGroup.BottomRailElemDimList)
{
<EditElement CurrRec="item" EC_Update="UpdateElement"></EditElement>
}
</div>
</div>
</div>
</div>
@@ -1,42 +0,0 @@
using Microsoft.AspNetCore.Components;
using WebWindowComplex.Models;
namespace WebWindowComplex.Compo
{
public partial class SashBottomRail
{
#region Public Properties
/// <summary>
/// Sash corrente rispetto alla lista Sash
/// </summary>
[CascadingParameter(Name = "CurrSashGroup")]
public Sash SashGroup { get; set; } = null!;
[Parameter]
public EventCallback<Sash> EC_UpdateSash { get; set; }
#endregion Public Properties
#region Private Properties
/// <summary>
/// Aggiornamento element
/// </summary>
/// <param name="updRec"></param>
/// <returns></returns>
private async Task UpdateElement(ElementDimension updRec)
{
// cerco il record
var currRec = SashGroup.BottomRailElemDimList.FirstOrDefault(x => x.ParentArea == updRec.ParentArea && x.nIndex == updRec.nIndex);
// lo aggiorno
if (updRec != null)
{
currRec = updRec;
await EC_UpdateSash.InvokeAsync(SashGroup);
}
}
#endregion Private Properties
}
}
+12
View File
@@ -0,0 +1,12 @@
namespace WebWindowComplex.DTO
{
public class DataSave
{
#region Public Properties
public string currJwd { get; set; } = "";
public bool ForceSave { get; set; } = true;
#endregion Public Properties
}
}
+22 -127
View File
@@ -131,12 +131,8 @@ namespace WebWindowComplex.Models
{
SashArea.SashList.LastOrDefault()!.JointList.ElementAt(2).SelJointTypeIndex = (int)Joints.ANGLED;
}
// SashArea.SashArcElem = new SashArcElement(SashArea, ParentWindow, 10, true);
}
//if (ParentWindow.AreaList.First().SelShapeIndex == (int)Shapes.ARC ||
// ParentWindow.AreaList.First().SelShapeIndex == (int)Shapes.DOUBLEARC ||
// ParentWindow.AreaList.First().SelShapeIndex == (int)Shapes.ARC_FULL ||
// ParentWindow.AreaList.First().SelShapeIndex == (int)Shapes.THREECENTERARC)
// SashArea.SashArcElem = new SashArcElement(SashArea, ParentWindow, 10, true);
//else
// SashArea.SashArcElem = null;
// Salvo gli oggetti già presenti e li cancello da AreaList
@@ -188,7 +184,16 @@ namespace WebWindowComplex.Models
Frame frame = ParentWindow.AreaList.First();
if(frame != null)
{
//frame.SearchAreaList(frame, frame.AvailWidthArea(), "Width");
// Aggiorno joint di tutte le ante
if(AreaList.FirstOrDefault()!.AreaList.FirstOrDefault()!.AreaList.FirstOrDefault() is Sash sash && sash != null)
{
foreach(var anta in sash.SashList)
{
foreach (var j in anta.JointList)
j.SelJointType = anta.JointList.FirstOrDefault().SelJointType;
}
}
// Aggiorno altezza sotto aree
frame.SearchAreaList(frame, frame.AvailHeightArea(), "Height");
}
}
@@ -237,53 +242,32 @@ namespace WebWindowComplex.Models
}
}
}
string heightName = "Height";
switch (frame.Shape)
{
case Shapes.RECTANGLE:
case Shapes.ARC_FULL:
case Shapes.TRIANGLE:
{
SearchAreaList(this, frame.DimensionList.Where(x => x.sName.Equals("Width")).First().dDimension, "Width");
SearchAreaList(this, frame.DimensionList.Where(x => x.sName.Equals("Height")).First().dDimension, "Height");
break;
}
case Shapes.RIGHTCHAMFER:
{
SearchAreaList(this, frame.DimensionList.Where(x => x.sName.Equals("Width")).First().dDimension, "Width");
SearchAreaList(this, frame.DimensionList.Where(x => x.sName.Equals("Left Height")).First().dDimension, "Left Height");
heightName = "Left Height";
break;
}
case Shapes.LEFTCHAMFER:
{
SearchAreaList(this, frame.DimensionList.Where(x => x.sName.Equals("Width")).First().dDimension, "Width");
SearchAreaList(this, frame.DimensionList.Where(x => x.sName.Equals("Right Height")).First().dDimension, "Right Height");
heightName = "Right Height";
break;
}
case Shapes.DOUBLECHAMFER:
case Shapes.ARC:
{
SearchAreaList(this, frame.DimensionList.Where(x => x.sName.Equals("Width")).First().dDimension, "Width");
SearchAreaList(this, frame.DimensionList.Where(x => x.sName.Equals("Full Height")).First().dDimension, "Full Height");
break;
}
case Shapes.DOUBLEARC:
{
SearchAreaList(this, frame.DimensionList.Where(x => x.sName.Equals("Width")).First().dDimension, "Width");
SearchAreaList(this, frame.DimensionList.Where(x => x.sName.Equals("Full Height")).First().dDimension, "Full Height");
break;
}
case Shapes.THREECENTERARC:
{
SearchAreaList(this, frame.DimensionList.Where(x => x.sName.Equals("Width")).First().dDimension, "Width");
SearchAreaList(this, frame.DimensionList.Where(x => x.sName.Equals("Full Height")).First().dDimension, "Full Height");
heightName = "Full Height";
break;
}
}
SearchAreaList(this, frame.DimensionList.Where(x => x.sName.Equals("Width")).First().dDimension, "Width");
SearchAreaList(this, frame.DimensionList.Where(x => x.sName.Equals(heightName)).First().dDimension, heightName);
}
/// <summary>
@@ -390,7 +374,7 @@ namespace WebWindowComplex.Models
int countAbsolute = sash.SashList.Where(x => x.MeasureType.Equals(MeasureTypes.ABSOLUTE)).Count();
int countProportional = sash.SashList.Where(x => x.MeasureType.Equals(MeasureTypes.PROPORTIONAL)).Count();
int countPercentage = sash.SashList.Where(x => x.MeasureType.Equals(MeasureTypes.PERCENTAGE)).Count();
List<AreaDimension> dimList = new List<AreaDimension>();
List<AreaDimension> dimList = new();
Split split = new Split(null, null);
if (sash.ParentArea.ParentArea is Split)
split = (Split)sash.ParentArea.ParentArea;
@@ -413,12 +397,6 @@ namespace WebWindowComplex.Models
double sum = sash.SashList.Sum(x => x.dDimension);
if ((sash.ParentArea.ParentArea is Split && split.SplitHorizList.Count > 0))
{
//Frame? frame = sash.m_ParentWindow.AreaList.FirstOrDefault();
//if (frame != null)
// dim = dim + frame.ElementDimensionList.ElementAt(1).dOverlap
// + frame.ElementDimensionList.Last().dOverlap;
//if(sash.SashList.Count == 1)
// dim = dim + sash.SashList.First().ElementDimensionList.ElementAt(1).dOverlap;
for (int i = 1; i < sash.SashList.Count; i++)
dim = dim + sash.SashList.ElementAt(i).ElementDimensionList.Last().dOverlap;
}
@@ -432,24 +410,18 @@ namespace WebWindowComplex.Models
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 if (sash.SashList.Count > 1)
{
for (int i = 1; i < sash.SashList.Count; i++)
{
dim = dim + sash.SashList[i].ElementDimensionList.Last().dOverlap;
}
}
double res = dim - sum;
foreach (var sashDim in sash.SashList)
{
sashDim.SetDimension(sashDim.dDimension + res / countAbsolute);
}
}
else if (countAbsolute < sash.SashList.Count && countPercentage != sash.SashList.Count && countProportional != sash.SashList.Count)
{
@@ -458,36 +430,30 @@ namespace WebWindowComplex.Models
double sumAbsolute = sash.SashList.Where(x => x.MeasureType.Equals(MeasureTypes.ABSOLUTE)).Sum(x => x.dDimension);
var percentageList = sash.SashList.Where(x => x.MeasureType.Equals(MeasureTypes.PERCENTAGE)).ToList();
foreach (var i in percentageList)
{
i.SetDimension(i.ConvertIn(dimList, (dim - sumAbsolute) / countPercentage, i.MeasureType, dim));
}
i.SetDimension(i.ConvertAbsoluteIn(dimList, (dim - sumAbsolute) / countPercentage, i.MeasureType, dim));
}
}
}
else if (area is Split split)
{
List<SplitDimension> splitList = new List<SplitDimension>();
List<SplitElementDimension> elemList = new List<SplitElementDimension>();
List<SplitDimension> splitList = new();
List<SplitElementDimension> elemList = new();
double sum = 0;
if (nameDim.Equals("Width"))
{
splitList = split.SplitVertList;
elemList = split.ElemDimVertList;
//foreach (var item in split.ElemDimVertList)
// sum = sum + item.dDimension;
}
else
{
splitList = split.SplitHorizList;
elemList = split.ElemDimHorizList;
//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)
{
sum = sum + splitList.Sum(x => x.dDimension);
List<AreaDimension> dimensionList = new List<AreaDimension>();
List<AreaDimension> dimensionList = new();
foreach (var i in splitList)
dimensionList.Add(new AreaDimension(i.dDimension, i.MeasureType, i.Parent));
double widthGlass = dim;
@@ -517,75 +483,6 @@ namespace WebWindowComplex.Models
m_ParentArea = ParentArea;
}
/// <summary>
/// Metodo per convertire da misura proporzionale a misura assoluta o percentuale
/// </summary>
/// <param name="newType"></param>
/// <returns></returns>
internal double ConvertFromPropVal(Sash sashGroup, double sashDim, MeasureTypes newType, double widthTot)
{
double tot = widthTot;
List<AreaDimension> adList = new List<AreaDimension>();
foreach (var it in sashGroup.SashList)
{
adList.Add(new AreaDimension(it.dDimension, it.SelMeasureType, it.Parent));
}
//Somma misura non proporzionali
double sumNotProp = sashGroup.SashList
.Where(m => m.MeasureType != MeasureTypes.PROPORTIONAL && !m.Equals(this))
.Sum(m => m.CalculateAbsoluteValue(adList, tot));
//Calcolo residuo
double res = tot - sumNotProp;
if (res < 0) res = 0;
//Misure proporzionali
var proportionalList = sashGroup.SashList
.Where(m => m.SelMeasureType == MeasureTypes.PROPORTIONAL)
.ToList();
double sumPesi = proportionalList.Sum(p => p.dDimension);
if (sumPesi == 0) sumPesi = 1;
if (newType.Equals(MeasureTypes.ABSOLUTE))
{
return res / sumPesi * sashDim;
}
else
{
return (res / sumPesi * sashDim) / tot * 100;
}
}
/// <summary>
/// Metodo per convertire da misura proporzionale a misura assoluta o percentuale
/// </summary>
/// <param name="newType"></param>
/// <returns></returns>
internal double ConvertFromPropVal(List<SplitDimension> splitList, double splitDim, MeasureTypes newType, double widthTot)
{
double tot = widthTot;
List<AreaDimension> adList = new List<AreaDimension>();
foreach (var it in splitList)
{
adList.Add(new AreaDimension(it.dDimension, it.SelMeasureType, it.Parent));
}
//Somma misura non proporzionali
double sumNotProp = splitList
.Where(m => m.MeasureType != MeasureTypes.PROPORTIONAL && !m.Equals(this))
.Sum(m => m.CalculateAbsoluteValue(adList, tot));
//Calcolo residuo
double res = tot - sumNotProp;
if (res < 0) res = 0;
//Misure proporzionali
var proportionalList = splitList
.Where(m => m.SelMeasureType == MeasureTypes.PROPORTIONAL)
.ToList();
double sumPesi = proportionalList.Sum(p => p.dDimension);
if (sumPesi == 0)
sumPesi = 1;
return res / sumPesi * splitDim;
}
#endregion Internal Methods
#region Protected Fields
@@ -607,7 +504,5 @@ namespace WebWindowComplex.Models
private Area m_ParentArea;
#endregion Private Fields
}
}
+2 -3
View File
@@ -190,7 +190,7 @@ namespace WebWindowComplex.Models
/// Metodo per ricalcolare i valori proporzionali a causa della modifica di uno
/// </summary>
/// <returns></returns>
internal List<AreaDimension> CalculatePropVal(List<AreaDimension> itemList, int indexArea, double widthTot)
internal List<AreaDimension> RicalculatePropVal(List<AreaDimension> itemList, int indexArea, double widthTot)
{
List <AreaDimension> ans = itemList;
if (itemList.Where(m => m.MeasureType.Equals(MeasureTypes.PROPORTIONAL)).ToList().Count == 0)
@@ -309,7 +309,7 @@ namespace WebWindowComplex.Models
/// <param name="type"> Tipo di misura della dimensione </param>
/// <param name="widthTot"> Larghezza totale </param>
/// <returns></returns>
internal double ConvertIn(List<AreaDimension> itemList, double absoluteVal, MeasureTypes type, double widthTot)
internal double ConvertAbsoluteIn(List<AreaDimension> itemList, double absoluteVal, MeasureTypes type, double widthTot)
{
switch (type)
{
@@ -379,7 +379,6 @@ namespace WebWindowComplex.Models
if (sumPesi == 0) sumPesi = 1;
return res / sumPesi * dimensionProp;
}
#endregion Public Method
}
+8 -3
View File
@@ -71,7 +71,10 @@ namespace WebWindowComplex.Models
// Per calcolare larghezza split gorup mi basta una qualsiasi dimensione
double height = 0;
if (frame != null)
height =split.SplitHorizList.First().CalculateHeightSplitGroup(frame, frame.AvailHeightArea(), new AreaFound(-1, false)).m_Dimension;
{
height = split.CalculateHeightSplitGroup(frame, frame.AvailHeightArea(), new AreaFound(-1, false)).m_Dimension;
//height =split.SplitHorizList.First().CalculateHeightSplitGroup(frame, frame.AvailHeightArea(), new AreaFound(-1, false)).m_Dimension;
}
//double height = ParentArea.CalculateWidthArea(ParentArea.ParentWindow.AreaList[0], ParentArea.ParentWindow.AreaList[0].AvailHeightArea());
List<SplitElementDimension> horizElemList = split.ElemDimHorizList.Where(x=>x.m_nIndex== 1).ToList();
foreach (var elem in horizElemList)
@@ -96,7 +99,7 @@ namespace WebWindowComplex.Models
// Per calcolare larghezza split gorup mi basta una qualsiasi dimensione
double width = 0;
if (frame != null)
width = split.SplitVertList.First().CalculateWidthSplitGroup(frame, frame.AvailWidthArea(), new AreaFound(-1, false)).m_Dimension;
width = split.CalculateWidthSplitGroup(frame, frame.AvailWidthArea(), new AreaFound(-1, false)).m_Dimension;
//double width = ParentArea.CalculateWidthArea(ParentArea.ParentWindow.AreaList[0], ParentArea.ParentWindow.AreaList[0].AvailWidthArea());
List<SplitElementDimension> vertElemList = split.ElemDimVertList.Where(x => x.m_nIndex == 1).ToList();
foreach (var elem in vertElemList)
@@ -262,8 +265,10 @@ namespace WebWindowComplex.Models
return newElementDimension;
}
public override bool Equals(object obj)
public override bool Equals(object? obj)
{
if (obj is null)
return false;
return Equals(obj as ElementDimension);
}
+18 -19
View File
@@ -6,7 +6,6 @@ namespace WebWindowComplex.Models
public class Fill : Area
{
#region Public Constructors
public Fill(Area ParentArea, Window ParentWindow) : base(ParentArea, ParentWindow)
{
}
@@ -23,13 +22,13 @@ namespace WebWindowComplex.Models
}
}
public List<IdNameStruct> FillTypeList
{
get
{
return m_FillTypeList;
}
}
//public List<IdNameStruct> FillTypeList
//{
// get
// {
// return m_FillTypeList;
// }
//}
public FillTypes SelFillType
{
@@ -43,17 +42,17 @@ namespace WebWindowComplex.Models
}
}
public int SelFillTypeIndex
{
get
{
return IdNameStruct.IndFromId((int)m_SelFillType, m_FillTypeList);
}
set
{
m_SelFillType = (FillTypes)IdNameStruct.IdFromInd(value, m_FillTypeList);
}
}
//public int SelFillTypeIndex
//{
// get
// {
// return IdNameStruct.IndFromId((int)m_SelFillType, m_FillTypeList);
// }
// set
// {
// m_SelFillType = (FillTypes)IdNameStruct.IdFromInd(value, m_FillTypeList);
// }
//}
#endregion Public Properties
+5 -18
View File
@@ -397,15 +397,9 @@ namespace WebWindowComplex.Models
if (node != null)
{
if (node.AreaType.Equals(AreaTypes.SASH))
{
sashList.Add((Sash)node);
//Sash s = (Sash)node;
//s.SashArcElem = null;
}
foreach (var item in node.AreaList)
{
SearchSash(sashList, item);
}
}
return sashList;
}
@@ -430,6 +424,11 @@ namespace WebWindowComplex.Models
#region Public Methods
public override Frame Copy(Area ParentArea)
{
return new Frame(null, ParentWindow);
}
public void RefreshThresholdList()
{
m_ThresholdList.Clear();
@@ -478,11 +477,6 @@ namespace WebWindowComplex.Models
overlap;
}
public override Frame Copy(Area ParentArea)
{
return new Frame(null, ParentWindow);
}
/// <summary>
/// Metodo per calcolare l'area disponibile
/// </summary>
@@ -496,12 +490,6 @@ namespace WebWindowComplex.Models
if(AreaList.First() is Sash)
overlap = ElementDimensionList.ElementAt(1).dOverlap +
ElementDimensionList.Last().dOverlap;
//if (AreaList.First() is Split split)
//{
// if(split.SplitHorizList.Count > 0)
// overlap = ElementDimensionList.ElementAt(1).dOverlap +
// ElementDimensionList.Last().dOverlap;
//}
return dim - ElementDimensionList.ElementAt(1).dDimension -
ElementDimensionList.Last().dDimension +
overlap;
@@ -638,7 +626,6 @@ namespace WebWindowComplex.Models
}
}
// aggiungo Joint
//int nJointQty = 4;
switch (Value)
{
case Shapes.RECTANGLE:
-31
View File
@@ -12,7 +12,6 @@ namespace WebWindowComplex.Models
m_ParentFrame = ParentFrame;
m_nIndex = nIndex;
m_sName = sName;
m_bIsLen = bIsLen;
}
#endregion Public Constructors
@@ -36,13 +35,9 @@ namespace WebWindowComplex.Models
ParentFrame.SelShapeIndex == (int)Shapes.TRIANGLE)
{
if (value > MaxDim)
{
m_dDimension = MaxDim;
}
else if (value < MinDim && !m_sName.Equals("Radius") && !m_sName.Equals("Height projection"))
{
m_dDimension = MinDim;
}
else
m_dDimension = value;
}
@@ -53,68 +48,44 @@ namespace WebWindowComplex.Models
{
var height = ParentFrame.DimensionList.First(x => x.sName.Equals("Height")).m_dDimension;
if (sName.Equals("Height") && value > 0.5 * widthArea && value < MaxDim)
{
m_dDimension = value;
}
else if (sName.Equals("Width") && height > 0.5 * value && value > MinDim)
{
m_dDimension = value;
}
}
else if (ParentFrame.SelShapeIndex == (int)Shapes.ARC)
{
var height = ParentFrame.DimensionList.First(x => x.sName.Equals("Height")).m_dDimension;
var fullHeight = ParentFrame.DimensionList.First(x => x.sName.Equals("Full Height")).m_dDimension;
if (sName.Equals("Full Height") && (value - height) < 0.5 * widthArea && value < MaxDim)
{
m_dDimension = value;
}
else if (sName.Equals("Height") && (fullHeight - value) < 0.5 * widthArea && value < MaxDim)
{
m_dDimension = value;
}
else if (sName.Equals("Width") && (fullHeight - height) < 0.5 * value && value < MaxDim)
{
m_dDimension = value;
}
}
else if (ParentFrame.SelShapeIndex == (int)Shapes.THREECENTERARC)
{
var height = ParentFrame.DimensionList.First(x => x.sName.Equals("Height")).m_dDimension;
var fullHeight = ParentFrame.DimensionList.First(x => x.sName.Equals("Full Height")).m_dDimension;
if (sName.Equals("Full Height") && (value - height) < 0.5 * widthArea && value < MaxDim)
{
m_dDimension = value;
}
else if (sName.Equals("Height") && (fullHeight - value) < 0.5 * widthArea && value < MaxDim)
{
m_dDimension = value;
}
else if (sName.Equals("Width") && (fullHeight - height) < 0.5 * value)
{
m_dDimension = value;
}
else if (sName.Equals("Radius") && value < 0.5 * widthArea)
{
m_dDimension = value;
}
}
else if (ParentFrame.SelShapeIndex == (int)Shapes.DOUBLEARC)
{
var height = ParentFrame.DimensionList.First(x => x.sName.Equals("Height")).m_dDimension;
var fullHeight = ParentFrame.DimensionList.First(x => x.sName.Equals("Full Height")).m_dDimension;
if (sName.Equals("Full Height") && (value - height) > 0.5 * widthArea && value < MaxDim)
{
m_dDimension = value;
}
else if (sName.Equals("Height") && (fullHeight - value) > 0.5 * widthArea && value < MaxDim)
{
m_dDimension = value;
}
else if (sName.Equals("Width") && (fullHeight - height) > 0.5 * value && value > MinDim)
{
m_dDimension = value;
}
}
}
if (ParentFrame.AreaList.Count > 0 && sName.Equals("Width") && ParentFrame != null)
@@ -169,8 +140,6 @@ namespace WebWindowComplex.Models
#region Private Fields
private bool m_bIsLen = false;
private int m_nIndex;
private string m_sName;
+50 -61
View File
@@ -642,6 +642,7 @@ namespace WebWindowComplex.Models
#endregion Public Methods
#region Internal Methods
internal void SetIsDimensionLight(bool DimensionLight)
{
m_IsbDimensionLight = DimensionLight;
@@ -670,34 +671,34 @@ namespace WebWindowComplex.Models
return newSash;
}
internal OpeningSides GetOpeningSide(Openings OpeningType)
{
switch (OpeningType)
{
case Openings.TURNONLY_LEFT:
case Openings.TILTTURN_LEFT:
case Openings.TILTONLY_TOP:
case Openings.COMPLANARSLIDE_LEFT:
case Openings.LIFTSLIDE_LEFT:
{
return OpeningSides.LEFT;
}
//internal OpeningSides GetOpeningSide(Openings OpeningType)
//{
// switch (OpeningType)
// {
// case Openings.TURNONLY_LEFT:
// case Openings.TILTTURN_LEFT:
// case Openings.TILTONLY_TOP:
// case Openings.COMPLANARSLIDE_LEFT:
// case Openings.LIFTSLIDE_LEFT:
// {
// return OpeningSides.LEFT;
// }
case Openings.TURNONLY_RIGHT:
case Openings.TILTTURN_RIGHT:
case Openings.TILTONLY_BOTTOM:
case Openings.COMPLANARSLIDE_RIGHT:
case Openings.LIFTSLIDE_RIGHT:
{
return OpeningSides.RIGHT;
}
// case Openings.TURNONLY_RIGHT:
// case Openings.TILTTURN_RIGHT:
// case Openings.TILTONLY_BOTTOM:
// case Openings.COMPLANARSLIDE_RIGHT:
// case Openings.LIFTSLIDE_RIGHT:
// {
// return OpeningSides.RIGHT;
// }
default:
{
return OpeningSides.NULL;
}
}
}
// default:
// {
// return OpeningSides.NULL;
// }
// }
//}
internal Enums.OpeningTypes GetOpeningType(Openings OpeningType)
{
@@ -797,11 +798,6 @@ namespace WebWindowComplex.Models
}
}
internal void SetIsMeasureGlass(bool IsMeasureGlass)
{
m_bIsMeasureGlass = IsMeasureGlass;
}
internal void SetIsSashVertical(bool IsSashVertical)
{
m_bIsSashVertical = IsSashVertical;
@@ -815,6 +811,10 @@ namespace WebWindowComplex.Models
}
}
/// <summary>
/// Metodo per impostare opzioni hardware da xml
/// </summary>
/// <param name="OptionXml"></param>
internal void SetHardwareOption(string OptionXml)
{
if (!string.IsNullOrEmpty(OptionXml))
@@ -928,10 +928,10 @@ namespace WebWindowComplex.Models
}
}
internal void SetSashType(SashTypes SashType)
{
m_SashType = SashType;
}
//internal void SetSashType(SashTypes SashType)
//{
// m_SashType = SashType;
//}
internal string SetSelFamilyHardwareFromIndex(string codHardware)
{
@@ -978,6 +978,11 @@ namespace WebWindowComplex.Models
if (split.SplitVertList.Count > 0)
{
double dim = width;
double widthGlass = width;
foreach (var elem in split.ElemDimVertList)
{
widthGlass = widthGlass - elem.dDimension;
}
switch (split.SplitVertList.ElementAt(i).SelMeasureType)
{
case MeasureTypes.ABSOLUTE:
@@ -987,27 +992,19 @@ namespace WebWindowComplex.Models
}
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;
dim = split.SplitVertList.ElementAt(i).dDimension * widthGlass / 100;
break;
}
}
@@ -1094,6 +1091,12 @@ namespace WebWindowComplex.Models
else
{
double dim = height;
double widthGlass = height;
int minSubArea = split.ElemDimHorizList.Min(x => x.nSubArea);
foreach (var elem in split.ElemDimHorizList.Where(x => x.nSubArea == minSubArea))
{
widthGlass = widthGlass - elem.dDimension;
}
switch (split.SplitHorizList.ElementAt(i).SelMeasureType)
{
case MeasureTypes.ABSOLUTE:
@@ -1103,29 +1106,19 @@ namespace WebWindowComplex.Models
}
case MeasureTypes.PROPORTIONAL:
{
double widthGlass = height;
AreaDimension ad = new AreaDimension(split.SplitHorizList.ElementAt(i).dDimension, split.SplitHorizList.ElementAt(i).SelMeasureType, split.SplitHorizList.ElementAt(i).Parent);
List<AreaDimension> adList = new List<AreaDimension>();
foreach (var it in split.SplitHorizList)
{
adList.Add(new AreaDimension(it.dDimension, it.SelMeasureType, it.Parent));
}
int minSubArea = split.ElemDimHorizList.Min(x=>x.nSubArea);
foreach (var elem in split.ElemDimHorizList.Where(x=>x.nSubArea == minSubArea))
{
widthGlass = widthGlass - elem.dDimension;
}
dim = ad.ConvertFromPropVal(adList, MeasureTypes.ABSOLUTE, widthGlass);
break;
}
case MeasureTypes.PERCENTAGE:
{
int minSubArea = split.ElemDimHorizList.Min(x => x.nSubArea);
foreach (var elem in split.ElemDimHorizList.Where(x => x.nSubArea == minSubArea))
{
dim = dim - elem.dDimension;
}
dim = split.SplitHorizList.ElementAt(i).dDimension * dim / 100;
dim = split.SplitHorizList.ElementAt(i).dDimension * widthGlass / 100;
break;
}
}
@@ -1156,20 +1149,16 @@ namespace WebWindowComplex.Models
/// </summary>
private const string CustomHwId = "000000";
private bool m_bIsMeasureGlass;
private bool m_bIsSashVertical;
private bool m_bSashBottomRail;
private string m_CurrShape = "";
private List<Hardware> m_HardwareList = new List<Hardware>();
private List<AGBOption> m_HwOptionList = new List<AGBOption>();
private Dictionary<string, string> m_SelHwOptionList = new Dictionary<string, string>();
private int m_nSashBottomRailQty;
private List<ElementDimension> m_BottomRailElemDimList = new List<ElementDimension>();
private List<IdNameStruct> m_OrientationSashTypeList = new List<IdNameStruct>
{
+49 -89
View File
@@ -24,23 +24,13 @@ namespace WebWindowComplex.Models
switch (Parent.SashList[0].OpeningType)
{
case Openings.TURNONLY_LEFT:
{
SetOpeningType(Openings.TURNONLY_RIGHT);
break;
}
case Openings.TURNONLY_RIGHT:
{
SetOpeningType(Openings.TURNONLY_LEFT);
break;
}
case Openings.TILTTURN_LEFT:
{
SetOpeningType(Openings.TURNONLY_RIGHT);
break;
}
case Openings.TURNONLY_RIGHT:
case Openings.TILTTURN_RIGHT:
{
SetOpeningType(Openings.TURNONLY_LEFT);
@@ -156,14 +146,12 @@ namespace WebWindowComplex.Models
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;
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;
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;
@@ -308,7 +296,7 @@ namespace WebWindowComplex.Models
for (int i = 0; i < absoluteValList.Count; i++)
{
var item = m_Parent.SashList.ElementAt(i);
item.SetDimension(ad.ConvertIn(adList, absoluteValList[i], (MeasureTypes)item.SelMeasureTypeIndex, widthTot));
item.SetDimension(ad.ConvertAbsoluteIn(adList, absoluteValList[i], (MeasureTypes)item.SelMeasureTypeIndex, widthTot));
}
}
foreach(var item in m_Parent.AreaList)
@@ -430,28 +418,15 @@ namespace WebWindowComplex.Models
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(m_dDimension, SelMeasureType, Parent);
List<AreaDimension> newDimensions = new List<AreaDimension>();
foreach (var it in m_Parent.SashList)
{
newDimensions.Add(new AreaDimension(it.m_dDimension, it.SelMeasureType, it.Parent));
}
//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;
//}
if (newType is MeasureTypes.PROPORTIONAL)
{
newDimensions = ad.CalculatePropVal(newDimensions, nSashId - 1, widthTot);
newDimensions = ad.RicalculatePropVal(newDimensions, nSashId - 1, widthTot);
for (int i = 0; i < newDimensions.Count; i++)
m_Parent.SashList.ElementAt(i).SetDimension(newDimensions.ElementAt(i).dDimension);
}
@@ -509,11 +484,6 @@ namespace WebWindowComplex.Models
return JsonSashDimension;
}
//internal void SetDimension(double dValue)
//{
// m_dDimension = dValue;
//}
internal void SetHasHandle(bool value)
{
m_bHasHandle = value;
@@ -529,57 +499,47 @@ namespace WebWindowComplex.Models
SelMeasureType = value;
}
internal void SetSelMeasureType(MeasureTypes value, int indexSash)
{
if (SelMeasureType != (MeasureTypes)value)
{
MeasureTypes newType = (MeasureTypes)value;
Frame? frame = m_Parent.ParentWindow.AreaList.FirstOrDefault();
if (frame != null)
{
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);
List<AreaDimension> newDimensions = new List<AreaDimension>();
foreach(var item in m_Parent.SashList)
{
newDimensions.Add(new AreaDimension(item.dDimension, item.SelMeasureType, item.Parent));
}
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);
//if (newType is MeasureTypes.PROPORTIONAL)
//{
// for (int i = 0; i < newDimensions.Count; i++)
// m_Parent.SashList.ElementAt(i).SetDimension(newDimensions.ElementAt(i).dDimension);
//}
SelMeasureType = (MeasureTypes)value;
}
}
}
//internal void SetSelMeasureType(MeasureTypes value, int indexSash)
//{
// if (SelMeasureType != (MeasureTypes)value)
// {
// MeasureTypes newType = (MeasureTypes)value;
// Frame? frame = m_Parent.ParentWindow.AreaList.FirstOrDefault();
// if (frame != null)
// {
// 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);
// List<AreaDimension> newDimensions = new List<AreaDimension>();
// foreach(var item in m_Parent.SashList)
// {
// newDimensions.Add(new AreaDimension(item.dDimension, item.SelMeasureType, item.Parent));
// }
// int index = m_Parent.SashList.IndexOf(this);
// m_dDimension = ad.ConvertDimension(newDimensions, SelMeasureType, newType, widthTot, indexSash);
// SelMeasureType = (MeasureTypes)value;
// }
// }
//}
#endregion Internal Methods
+250 -62
View File
@@ -32,12 +32,12 @@ namespace WebWindowComplex.Models
m_ElemDimHorizList.Clear();
double thickness = 78;
if (ParentArea is Sash || ParentArea.ParentArea is Sash)
thickness = 60;
thickness = Window.m_ParameterList.GetValueOrDefault("Sash_Sash_Split_DimStd");
if (value)
{
for (int i = 0; i < nSplitQtyVert; i++)
{
SplitElementDimension newVertElem= elemVertListOld.Where(x=>x.nSubArea==1 && x.nIndex==i+1).First().Copy();
SplitElementDimension newVertElem = elemVertListOld.Where(x => x.nSubArea == 1 && x.nIndex == i + 1).First().Copy();
newVertElem.SetElement(i + 1, thickness, 0);
m_ElemDimVertList.Add(newVertElem);
//m_ElemDimVertList.Add(new SplitElementDimension(this, i + 1, thickness, 0));
@@ -46,7 +46,7 @@ namespace WebWindowComplex.Models
{
for (int index = 0; index < nSplitQtyHoriz; index++)
{
SplitElementDimension newHorizElem = elemHorizListOld.Where(x => x.nIndex == index+1).First().Copy();
SplitElementDimension newHorizElem = elemHorizListOld.Where(x => x.nIndex == index + 1).First().Copy();
newHorizElem.SetElement(index + 1, thickness, subArea + 1);
m_ElemDimHorizList.Add(newHorizElem);
//m_ElemDimHorizList.Add(new SplitElementDimension(this, index + 1, thickness, subArea + 1));
@@ -57,7 +57,7 @@ namespace WebWindowComplex.Models
{
for (int i = 0; i < nSplitQtyHoriz; i++)
{
SplitElementDimension newHorizElem = elemHorizListOld.Where(x => x.nSubArea == 1 && x.nIndex == i+1).First().Copy();
SplitElementDimension newHorizElem = elemHorizListOld.Where(x => x.nSubArea == 1 && x.nIndex == i + 1).First().Copy();
newHorizElem.SetElement(i + 1, thickness, 0);
m_ElemDimHorizList.Add(newHorizElem);
//m_ElemDimHorizList.Add(new SplitElementDimension(this, i + 1, thickness, 0));
@@ -66,7 +66,7 @@ namespace WebWindowComplex.Models
{
for (int index = 0; index < nSplitQtyVert; index++)
{
SplitElementDimension newVertElem = elemVertListOld.Where(x => x.nIndex == index+1).First().Copy();
SplitElementDimension newVertElem = elemVertListOld.Where(x => x.nIndex == index + 1).First().Copy();
newVertElem.SetElement(index + 1, thickness, subArea + 1);
m_ElemDimVertList.Add(newVertElem);
//m_ElemDimVertList.Add(new SplitElementDimension(this, index + 1, thickness, subArea + 1));
@@ -115,8 +115,8 @@ namespace WebWindowComplex.Models
Frame? frame = ParentWindow.AreaList.FirstOrDefault();
if(frame != null)
{
double heightTot = SplitHorizList.First().CalculateHeightSplitGroup(frame, frame.AvailHeightArea(), new AreaFound(-1, false)).m_Dimension;
//double heightTot = CalculateHeightArea(frame, frame.AvailHeightArea());
double heightTot = CalculateHeightSplitGroup(frame, frame.AvailHeightArea(), new AreaFound(-1, false)).m_Dimension;
//double heightTot = SplitHorizList.First().CalculateHeightSplitGroup(frame, frame.AvailHeightArea(), new AreaFound(-1, false)).m_Dimension;
// Ricalcolo dimensioni aggiungendo split
if (value > m_SplitHorizList.Count - 1)
{
@@ -141,7 +141,7 @@ namespace WebWindowComplex.Models
m_SplitHorizList.Add(new SplitDimension(dNewDimension, m_SplitHorizList[m_SplitHorizList.Count - 1].MeasureType, true, this, false));
double thickness = 78;
if (ParentArea is Sash || ParentArea.ParentArea is Sash)
thickness = 60;
thickness = Window.m_ParameterList.GetValueOrDefault("Sash_Sash_Split_DimStd");
if (!m_bSplitStartVert)
{
//Aggiungo un elemento alla sottoarea principale
@@ -287,7 +287,7 @@ namespace WebWindowComplex.Models
Frame? frame = ParentWindow.AreaList.FirstOrDefault();
if (frame != null)
{
double widthTot = SplitVertList.First().CalculateWidthSplitGroup(frame, frame.AvailWidthArea(), new AreaFound(-1, false)).m_Dimension;
double widthTot = CalculateWidthSplitGroup(frame, frame.AvailWidthArea(), new AreaFound(-1, false)).m_Dimension;
//double widthTot = CalculateWidthArea(frame, frame.AvailWidthArea());
// Ricalcolo dimensioni aggiungendo split
if (value > m_SplitVertList.Count - 1)
@@ -313,7 +313,7 @@ namespace WebWindowComplex.Models
m_SplitVertList.Add(new SplitDimension(dNewDimension, m_SplitVertList[m_SplitVertList.Count - 1].MeasureType, true, this, true));
double thickness = 78;
if (ParentArea is Sash || ParentArea.ParentArea is Sash)
thickness = 60;
thickness = Window.m_ParameterList.GetValueOrDefault("Sash_Sash_Split_DimStd");
if (m_bSplitStartVert)
{
//Aggiungo un elemento alla sottoarea principale
@@ -321,7 +321,7 @@ namespace WebWindowComplex.Models
newElemDim.SetElement(ElemDimVertList.Max(x => x.nIndex) + 1, thickness, 0);
ElemDimVertList.Add(newElemDim);
//ElemDimVertList.Add(new SplitElementDimension(this, ElemDimVertList.Max(x => x.nIndex) + 1, 78, 0));
if(nSplitQtyHoriz > 0)
if (nSplitQtyHoriz > 0)
{
// Aggiungo a tutte le sottoaree degli element
int subArea = ElemDimHorizList.Max(x => x.nSubArea) + 1;
@@ -546,12 +546,6 @@ namespace WebWindowComplex.Models
newSplit.SplitVertList.Add(SplitVertList[i].Copy());
for (int i = 0; i < SplitHorizList.Count; i++)
newSplit.SplitHorizList.Add(SplitHorizList[i].Copy());
//newSplit.SetSplitQtyVert(nSplitQtyVert);
//for (int i = 0; i < SplitVertList.Count; i++)
// newSplit.SplitVertList.ElementAt(i).SetDimension(SplitVertList.ElementAt(i).dDimension);
//newSplit.SetSplitQtyHoriz(nSplitQtyHoriz);
//for (int i = 0; i < SplitHorizList.Count; i++)
// newSplit.SplitHorizList.ElementAt(i).SetDimension(SplitHorizList.ElementAt(i).dDimension);
newSplit.SetSplitShape(SelSplitShape);
newSplit.SetAreaType(AreaType);
foreach (var item in ElemDimHorizList)
@@ -627,13 +621,240 @@ namespace WebWindowComplex.Models
return Split;
}
/// <summary>
/// Metodo per calcolare altezza intero split group
/// </summary>
/// <param name="area"> area di partenza </param>
/// <param name="height"> altezza di partenza </param>
/// <param name="res"> area di ritorno </param>
/// <returns></returns>
internal AreaFound CalculateHeightSplitGroup(Area area, double height, AreaFound res)
{
for (int i = 0; i < area.AreaList.Count; i++)
{
if (area.Equals(this))
{
res.m_Dimension = height;
res.m_Found = true;
return res;
}
Area item = area.AreaList[i];
if (area is Split split)
{
if (split.SplitHorizList.Count > 0)
{
double dim = height;
foreach (var elem in split.ElemDimHorizList)
dim = dim - elem.dDimension;
int index = i;
if (split.SelSplitShape is SplitShapes.GRID)
index = i % split.SplitHorizList.Count;
switch (split.SplitHorizList.ElementAt(index).SelMeasureType)
{
case MeasureTypes.ABSOLUTE:
{
dim = split.SplitHorizList.ElementAt(index).dDimension;
break;
}
case MeasureTypes.PROPORTIONAL:
{
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, it.Parent));
dim = ad.ConvertFromPropVal(adList, MeasureTypes.ABSOLUTE, dim);
break;
}
case MeasureTypes.PERCENTAGE:
{
dim = split.SplitHorizList.ElementAt(index).dDimension * dim / 100;
break;
}
}
res = CalculateHeightSplitGroup(item, dim, res);
if (res.m_Dimension != -1 && res.m_Found)
return res;
}
else
{
double dim = height;
res = CalculateHeightSplitGroup(item, dim, res);
if (res.m_Dimension != -1 && res.m_Found)
return res;
}
}
else if (area is Sash sash)
{
double bottomRail = 0;
if (sash.SashBottomRailQty > 0)
{
foreach (var bottom in sash.BottomRailElemDimList)
bottomRail = bottomRail + bottom.dDimension
- bottom.dOverlap;
}
double dim = height - sash.SashList.First().ElementDimensionList.First().dDimension
- sash.SashList.First().ElementDimensionList.ElementAt(sash.SashList.First().ElementDimensionList.Count - 2).dDimension
- bottomRail;
res = CalculateHeightSplitGroup(item, dim, res);
if (res.m_Dimension != -1 && res.m_Found)
return res;
}
else if (area is Splitted splitted)
{
double dim = height;
if (splitted.ParentArea is Split sp && splitted.AreaList.First() is Sash sh)
{
if (sp.SplitHorizList.Count > 0)
{
dim = dim + sh.SashList.First().ElementDimensionList.First().dOverlap
+ sh.SashList.First().ElementDimensionList.ElementAt(sh.SashList.First().ElementDimensionList.Count - 2).dOverlap;
}
}
res = CalculateHeightSplitGroup(item, dim, res);
if (res.m_Dimension != -1 && res.m_Found)
return res;
}
else
{
res = CalculateHeightSplitGroup(item, height, res);
if (res.m_Dimension != -1 && res.m_Found)
return res;
}
}
return res;
}
/// <summary>
/// Metodo per calcolare larghezza intero split group
/// </summary>
/// <param name="area"> area di partenza </param>
/// <param name="width"> larghezza di partenza </param>
/// <param name="res"> area di ritorno </param>
/// <returns></returns>
internal AreaFound CalculateWidthSplitGroup(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)
{
if (split.SplitVertList.Count > 0)
{
int index = i;
double dim = width;
foreach (var elem in split.ElemDimVertList)
dim = dim - elem.dDimension;
if (split.SelSplitShape is SplitShapes.GRID)
index = i % split.SplitHorizList.Count;
switch (split.SplitVertList.ElementAt(index).SelMeasureType)
{
case MeasureTypes.ABSOLUTE:
{
res = CalculateWidthSplitGroup(item, split.SplitVertList.ElementAt(index).dDimension, res);
break;
}
case MeasureTypes.PROPORTIONAL:
{
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, it.Parent));
}
res = CalculateWidthSplitGroup(item, ad.ConvertFromPropVal(adList, MeasureTypes.ABSOLUTE, dim), res);
break;
}
case MeasureTypes.PERCENTAGE:
{
res = CalculateWidthSplitGroup(item, split.SplitVertList.ElementAt(index).dDimension * dim / 100, res);
break;
}
}
if (res.m_Dimension != -1 && res.m_Found)
return res;
}
else
{
res = CalculateWidthSplitGroup(item, width, res);
if (res.m_Dimension != -1 && res.m_Found)
return res;
}
}
else if (area is Sash sash)
{
double widthTot = width;
double dim = 0;
if (sash.ParentArea.ParentArea is Split)
widthTot = widthTot + sash.SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dOverlap
+ sash.SashList.ElementAt(i).ElementDimensionList.Last().dOverlap;
if (sash.bIsDimensionLight)
{
widthTot = widthTot - sash.SashList.First().ElementDimensionList.ElementAt(1).dDimension
- sash.SashList.First().ElementDimensionList.Last().dDimension;
for (int anta = 1; anta < sash.SashList.Count; anta++)
{
widthTot = widthTot - sash.SashList.ElementAt(anta).ElementDimensionList.ElementAt(1).dDimension
- sash.SashList.ElementAt(anta).ElementDimensionList.Last().dDimension
+ sash.SashList.ElementAt(anta).ElementDimensionList.Last().dOverlap;
}
}
else
{
for (int anta = 1; anta < sash.SashList.Count; anta++)
{
widthTot = widthTot + sash.SashList.ElementAt(anta).ElementDimensionList.Last().dOverlap;
}
}
switch (sash.SashList.ElementAt(i).SelMeasureType)
{
case MeasureTypes.ABSOLUTE:
{
dim = sash.SashList.ElementAt(i).dDimension;
break;
}
case MeasureTypes.PROPORTIONAL:
{
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, it.Parent));
dim = ad.ConvertFromPropVal(adList, MeasureTypes.ABSOLUTE, widthTot);
break;
}
case MeasureTypes.PERCENTAGE:
{
dim = sash.SashList.ElementAt(i).dDimension * widthTot / 100;
break;
}
}
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);
if (res.m_Dimension != -1 && res.m_Found)
return res;
}
else
{
res = CalculateWidthSplitGroup(item, width, res);
if (res.m_Dimension != -1 && res.m_Found)
return res;
}
}
return res;
}
internal override JsonArea Serialize(bool hideHw)
{
if (nCounterGroup < GroupId)
Area.nCounterGroup = GroupId;
JsonSplit JsonSplit = new JsonSplit(m_SelSplitShape, GroupId);
//foreach (var SplitPosition in m_SplitPositionList)
// JsonSplit.SplitPositionList.Add(SplitPosition.Serialize());
JsonSplit.SplitStartVert = bSplitStartVert;
foreach (var SplitVert in m_SplitVertList)
JsonSplit.SplitVertList.Add(SplitVert.Serialize());
@@ -690,11 +911,10 @@ namespace WebWindowComplex.Models
{
double thickness = 78;
if (ParentArea is Sash || ParentArea.ParentArea is Sash)
thickness = 60;
thickness = Window.m_ParameterList.GetValueOrDefault("Sash_Sash_Split_DimStd");
// Un Elemento per ogni dimensione principale e per ogni sotto dimensione
if (bSplitStartVert)
{
for (int subArea = 0; subArea <= QtyVert; subArea++)
{
for (int i = 0; i < QtyHoriz; i++)
@@ -741,7 +961,7 @@ namespace WebWindowComplex.Models
{
double thickness = 78;
if (ParentArea is Sash || ParentArea.ParentArea is Sash)
thickness = 60;
thickness = Window.m_ParameterList.GetValueOrDefault("Sash_Sash_Split_DimStd");
// Un Elemento per ogni dimensione principale e per ogni sotto dimensione
if (bSplitStartVert)
{
@@ -769,41 +989,6 @@ namespace WebWindowComplex.Models
m_bSplitStartVert = SplitStartVert;
}
internal double HeightFrame()
{
double dim = 0;
switch (ParentWindow.AreaList.First().SelShapeIndex)
{
case (int)Shapes.RECTANGLE:
case (int)Shapes.TRIANGLE:
case (int)Shapes.ARC_FULL:
{
dim = ParentWindow.AreaList.FirstOrDefault()!.DimensionList.Where(x => x.sName == "Height").First().dDimension;
break;
}
case (int)Shapes.RIGHTCHAMFER:
{
dim = ParentWindow.AreaList.FirstOrDefault()!.DimensionList.Where(x => x.sName == "Left Height").First().dDimension;
break;
}
case (int)Shapes.LEFTCHAMFER:
{
dim = ParentWindow.AreaList.FirstOrDefault()!.DimensionList.Where(x => x.sName == "Right Height").First().dDimension;
break;
}
default:
{
dim = ParentWindow.AreaList.FirstOrDefault()!.DimensionList.Where(x => x.sName == "Full Height").First().dDimension;
break;
}
}
foreach(var elem in ElemDimHorizList)
{
dim = dim - elem.dDimension;
}
return dim;
}
internal void UpdateSubAreaSplit()
{
if (SplitHorizList.Count > 0)
@@ -816,16 +1001,16 @@ namespace WebWindowComplex.Models
List<AreaDimension> dimList = new List<AreaDimension>();
foreach (var itemDim in SplitHorizList)
dimList.Add(new AreaDimension(itemDim.dDimension, itemDim.MeasureType, itemDim.Parent));
//double width = SplitHorizList.First().CalculateWidthSplitGroup(frame, frame.AvailWidthArea(), new AreaFound(-1, false)).m_Dimension;
////double width = ParentArea.CalculateWidthArea(ParentArea.ParentWindow.AreaList[0], ParentArea.ParentWindow.AreaList[0].AvailWidthArea());
//AreaList.ElementAt(i).SearchAreaList(AreaList.ElementAt(i), width, "Width");
double dim = currSplitDim.dDimension;
double height = 0;
if (!(currSplitDim.MeasureType.Equals(MeasureTypes.ABSOLUTE)))
{
Frame frame = ParentArea.ParentWindow.AreaList[0];
if (frame != null)
height = currSplitDim.CalculateHeightSplitGroup(frame, frame.AvailHeightArea(), new AreaFound(-1, false)).m_Dimension;
{
height = CalculateHeightSplitGroup(frame, frame.AvailHeightArea(), new AreaFound(-1, false)).m_Dimension;
//height = currSplitDim.CalculateHeightSplitGroup(frame, frame.AvailHeightArea(), new AreaFound(-1, false)).m_Dimension;
}
foreach (var elem in ElemDimHorizList)
height = height - elem.dDimension;
dim = currSplitDim.ConvertDimension(dimList, currSplitDim.MeasureType, MeasureTypes.ABSOLUTE, height, -1);
@@ -850,7 +1035,10 @@ namespace WebWindowComplex.Models
{
Frame frame = ParentArea.ParentWindow.AreaList[0];
if(frame != null)
width = currSplitDim.CalculateWidthSplitGroup(frame, frame.AvailWidthArea(), new AreaFound(-1, false)).m_Dimension;
{
width = CalculateWidthSplitGroup(frame, frame.AvailWidthArea(), new AreaFound(-1, false)).m_Dimension;
//width = currSplitDim.CalculateWidthSplitGroup(frame, frame.AvailWidthArea(), new AreaFound(-1, false)).m_Dimension;
}
foreach (var elem in ElemDimVertList)
width = width - elem.dDimension;
dim = currSplitDim.ConvertDimension(dimList, currSplitDim.MeasureType, MeasureTypes.ABSOLUTE, width, -1);
+242 -249
View File
@@ -52,12 +52,14 @@ namespace WebWindowComplex.Models
subAreaVert = m_Parent.ElemDimVertList.Min(x => x.nSubArea);
if (m_Parent.ElemDimHorizList.Count > 0)
subAreaHoriz = m_Parent.ElemDimHorizList.Min(x => x.nSubArea);
double width = CalculateWidthSplitGroup(frame, frame.AvailWidthArea(), new AreaFound(-1, false)).m_Dimension;
//double width = CalculateWidthSplitGroup(frame, frame.AvailWidthArea(), new AreaFound(-1, false)).m_Dimension;
double width = Parent.CalculateWidthSplitGroup(frame, frame.AvailWidthArea(), new AreaFound(-1, false)).m_Dimension;
foreach (var item in m_Parent.ElemDimVertList.Where(x=>x.nSubArea == subAreaVert))
{
width = width - item.dDimension;
}
double height = (CalculateHeightSplitGroup(frame, frame.AvailHeightArea(), new AreaFound(-1, false))).m_Dimension;
double height = (Parent.CalculateHeightSplitGroup(frame, frame.AvailHeightArea(), new AreaFound(-1, false))).m_Dimension;
//double height = (CalculateHeightSplitGroup(frame, frame.AvailHeightArea(), new AreaFound(-1, false))).m_Dimension;
foreach (var item in m_Parent.ElemDimHorizList.Where(x => x.nSubArea == subAreaHoriz))
{
height = height - item.dDimension;
@@ -225,7 +227,7 @@ namespace WebWindowComplex.Models
for (int i = 0; i < absoluteValList.Count; i++)
{
var item = dimensions.ElementAt(i);
item.SetDimension(ad.ConvertIn(adList, absoluteValList[i], (MeasureTypes)item.SelMeasureTypeIndex, dimensionTot));
item.SetDimension(ad.ConvertAbsoluteIn(adList, absoluteValList[i], (MeasureTypes)item.SelMeasureTypeIndex, dimensionTot));
}
}
for (int i = 0; i < m_Parent.AreaList.Count; i++)
@@ -293,7 +295,8 @@ namespace WebWindowComplex.Models
splitElemList = m_Parent.ElemDimVertList;
else
splitElemList = m_Parent.ElemDimVertList.Where(x => x.nSubArea == 1).ToList();
dimSplitGroup = CalculateWidthSplitGroup(frame, frame.AvailWidthArea(), new AreaFound(-1, false)).m_Dimension;
//dimSplitGroup = CalculateWidthSplitGroup(frame, frame.AvailWidthArea(), new AreaFound(-1, false)).m_Dimension;
dimSplitGroup = Parent.CalculateWidthSplitGroup(frame, frame.AvailWidthArea(), new AreaFound(-1, false)).m_Dimension;
}
else
{
@@ -302,7 +305,8 @@ namespace WebWindowComplex.Models
splitElemList = m_Parent.ElemDimHorizList.Where(x => x.nSubArea == 1).ToList();
else
splitElemList = m_Parent.ElemDimHorizList;
dimSplitGroup = (CalculateHeightSplitGroup(frame, frame.AvailHeightArea(), new AreaFound(-1, false))).m_Dimension;
dimSplitGroup = (Parent.CalculateHeightSplitGroup(frame, frame.AvailHeightArea(), new AreaFound(-1, false))).m_Dimension;
//dimSplitGroup = (CalculateHeightSplitGroup(frame, frame.AvailHeightArea(), new AreaFound(-1, false))).m_Dimension;
}
AreaDimension ad = new AreaDimension(dDimension, SelMeasureType, Parent);
List<AreaDimension> adList = new List<AreaDimension>();
@@ -316,7 +320,7 @@ namespace WebWindowComplex.Models
}
if (newType is MeasureTypes.PROPORTIONAL)
{
adList = ad.CalculatePropVal(adList, splitList.IndexOf(this), dimSplitGroup);
adList = ad.RicalculatePropVal(adList, splitList.IndexOf(this), dimSplitGroup);
for (int i = 0; i < adList.Count; i++)
splitList.ElementAt(i).SetDimension(adList.ElementAt(i).dDimension);
}
@@ -342,247 +346,234 @@ namespace WebWindowComplex.Models
#region Internal Methods
/// <summary>
/// Metodo per calcolare larghezza intero split group
/// </summary>
/// <param name="area"> area di partenza </param>
/// <param name="width"> larghezza di partenza </param>
/// <param name="res"> area di ritorno </param>
/// <returns></returns>
internal AreaFound CalculateWidthSplitGroup(Area area, double width, AreaFound res)
{
for (int i = 0; i < area.AreaList.Count; i++)
{
if (area.Equals(m_Parent))
{
res.m_Dimension = width;
res.m_Found = true;
return res;
}
Area item = area.AreaList[i];
if (area is Split split)
{
if(split.SplitVertList.Count > 0)
{
int index = i;
double widthGlass = width;
foreach (var elem in split.ElemDimVertList)
widthGlass = widthGlass - elem.dDimension;
if (split.SelSplitShape is SplitShapes.GRID)
index = i % split.SplitHorizList.Count;
switch (split.SplitVertList.ElementAt(index).SelMeasureType)
{
case MeasureTypes.ABSOLUTE:
{
res = CalculateWidthSplitGroup(item, split.SplitVertList.ElementAt(index).dDimension, res);
break;
}
case MeasureTypes.PROPORTIONAL:
{
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, it.Parent));
}
res = CalculateWidthSplitGroup(item, ad.ConvertFromPropVal(adList, MeasureTypes.ABSOLUTE, widthGlass), res);
break;
}
case MeasureTypes.PERCENTAGE:
{
res = CalculateWidthSplitGroup(item, split.SplitVertList.ElementAt(index).dDimension * widthGlass / 100, res);
break;
}
}
if (res.m_Dimension != -1 && res.m_Found)
return res;
}
else
{
res = CalculateWidthSplitGroup(item, width, res);
if (res.m_Dimension != -1 && res.m_Found)
return res;
}
}
else if (area is Sash sash)
{
double widthTot = width;
double dim = 0;
if (sash.ParentArea.ParentArea is Split)
widthTot = widthTot + sash.SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dOverlap
+ sash.SashList.ElementAt(i).ElementDimensionList.Last().dOverlap;
if (sash.bIsDimensionLight)
{
widthTot = widthTot - sash.SashList.First().ElementDimensionList.ElementAt(1).dDimension
- sash.SashList.First().ElementDimensionList.Last().dDimension;
for (int anta = 1; anta < sash.SashList.Count; anta++)
{
widthTot = widthTot - sash.SashList.ElementAt(anta).ElementDimensionList.ElementAt(1).dDimension
- sash.SashList.ElementAt(anta).ElementDimensionList.Last().dDimension
+ sash.SashList.ElementAt(anta).ElementDimensionList.Last().dOverlap;
}
}
else
{
for (int anta = 1; anta < sash.SashList.Count; anta++)
{
widthTot = widthTot + sash.SashList.ElementAt(anta).ElementDimensionList.Last().dOverlap;
}
}
switch (sash.SashList.ElementAt(i).SelMeasureType)
{
case MeasureTypes.ABSOLUTE:
{
dim = sash.SashList.ElementAt(i).dDimension;
break;
}
case MeasureTypes.PROPORTIONAL:
{
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, it.Parent));
dim = ad.ConvertFromPropVal(adList, MeasureTypes.ABSOLUTE, widthTot);
break;
}
case MeasureTypes.PERCENTAGE:
{
dim = sash.SashList.ElementAt(i).dDimension * widthTot / 100;
break;
}
}
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);
if (res.m_Dimension != -1 && res.m_Found)
return res;
}
else
{
res = CalculateWidthSplitGroup(item, width, res);
if (res.m_Dimension != -1 && res.m_Found)
return res;
}
}
return res;
}
///// <summary>
///// Metodo per calcolare larghezza intero split group
///// </summary>
///// <param name="area"> area di partenza </param>
///// <param name="width"> larghezza di partenza </param>
///// <param name="res"> area di ritorno </param>
///// <returns></returns>
//internal AreaFound CalculateWidthSplitGroup(Area area, double width, AreaFound res)
//{
// for (int i = 0; i < area.AreaList.Count; i++)
// {
// if (area.Equals(m_Parent))
// {
// res.m_Dimension = width;
// res.m_Found = true;
// return res;
// }
// Area item = area.AreaList[i];
// if (area is Split split)
// {
// if(split.SplitVertList.Count > 0)
// {
// int index = i;
// double dim = width;
// foreach (var elem in split.ElemDimVertList)
// dim = dim - elem.dDimension;
// if (split.SelSplitShape is SplitShapes.GRID)
// index = i % split.SplitHorizList.Count;
// switch (split.SplitVertList.ElementAt(index).SelMeasureType)
// {
// case MeasureTypes.ABSOLUTE:
// {
// res = CalculateWidthSplitGroup(item, split.SplitVertList.ElementAt(index).dDimension, res);
// break;
// }
// case MeasureTypes.PROPORTIONAL:
// {
// 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, it.Parent));
// }
// res = CalculateWidthSplitGroup(item, ad.ConvertFromPropVal(adList, MeasureTypes.ABSOLUTE, dim), res);
// break;
// }
// case MeasureTypes.PERCENTAGE:
// {
// res = CalculateWidthSplitGroup(item, split.SplitVertList.ElementAt(index).dDimension * dim / 100, res);
// break;
// }
// }
// if (res.m_Dimension != -1 && res.m_Found)
// return res;
// }
// else
// {
// res = CalculateWidthSplitGroup(item, width, res);
// if (res.m_Dimension != -1 && res.m_Found)
// return res;
// }
// }
// else if (area is Sash sash)
// {
// double widthTot = width;
// double dim = 0;
// if (sash.ParentArea.ParentArea is Split)
// widthTot = widthTot + sash.SashList.ElementAt(i).ElementDimensionList.ElementAt(1).dOverlap
// + sash.SashList.ElementAt(i).ElementDimensionList.Last().dOverlap;
// if (sash.bIsDimensionLight)
// {
// widthTot = widthTot - sash.SashList.First().ElementDimensionList.ElementAt(1).dDimension
// - sash.SashList.First().ElementDimensionList.Last().dDimension;
// for (int anta = 1; anta < sash.SashList.Count; anta++)
// {
// widthTot = widthTot - sash.SashList.ElementAt(anta).ElementDimensionList.ElementAt(1).dDimension
// - sash.SashList.ElementAt(anta).ElementDimensionList.Last().dDimension
// + sash.SashList.ElementAt(anta).ElementDimensionList.Last().dOverlap;
// }
// }
// else
// {
// for (int anta = 1; anta < sash.SashList.Count; anta++)
// {
// widthTot = widthTot + sash.SashList.ElementAt(anta).ElementDimensionList.Last().dOverlap;
// }
// }
// switch (sash.SashList.ElementAt(i).SelMeasureType)
// {
// case MeasureTypes.ABSOLUTE:
// {
// dim = sash.SashList.ElementAt(i).dDimension;
// break;
// }
// case MeasureTypes.PROPORTIONAL:
// {
// 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, it.Parent));
// dim = ad.ConvertFromPropVal(adList, MeasureTypes.ABSOLUTE, widthTot);
// break;
// }
// case MeasureTypes.PERCENTAGE:
// {
// dim = sash.SashList.ElementAt(i).dDimension * widthTot / 100;
// break;
// }
// }
// 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);
// if (res.m_Dimension != -1 && res.m_Found)
// return res;
// }
// else
// {
// res = CalculateWidthSplitGroup(item, width, res);
// if (res.m_Dimension != -1 && res.m_Found)
// return res;
// }
// }
// return res;
//}
/// <summary>
/// Metodo per calcolare altezza intero split group
/// </summary>
/// <param name="area"> area di partenza </param>
/// <param name="height"> altezza di partenza </param>
/// <param name="res"> area di ritorno </param>
/// <returns></returns>
internal AreaFound CalculateHeightSplitGroup(Area area, double height, AreaFound res)
{
for (int i = 0; i < area.AreaList.Count; i++)
{
if (area.Equals(m_Parent))
{
res.m_Dimension = height;
res.m_Found = true;
return res;
}
Area item = area.AreaList[i];
if (area is Split split)
{
if (split.SplitHorizList.Count > 0)
{
double dim = height;
int index = i;
if (split.SelSplitShape is SplitShapes.GRID)
index = i % split.SplitHorizList.Count;
switch (split.SplitHorizList.ElementAt(index).SelMeasureType)
{
case MeasureTypes.ABSOLUTE:
{
dim = split.SplitHorizList.ElementAt(index).dDimension;
break;
}
case MeasureTypes.PROPORTIONAL:
{
double heigthGlass = 0;
AreaDimension ad = new AreaDimension(split.SplitHorizList.ElementAt(index).dDimension, split.SplitHorizList.ElementAt(index).SelMeasureType, split.SplitHorizList.ElementAt(index).Parent);
List<AreaDimension> adList = new List<AreaDimension>();
foreach (var it in split.SplitHorizList)
adList.Add(new AreaDimension(it.dDimension, it.SelMeasureType, it.Parent));
foreach (var elem in split.ElemDimHorizList)
heigthGlass = heigthGlass - elem.dDimension;
dim = ad.ConvertFromPropVal(adList, MeasureTypes.ABSOLUTE, heigthGlass);
break;
}
case MeasureTypes.PERCENTAGE:
{
foreach(var elem in split.ElemDimHorizList)
dim = dim - elem.dDimension;
dim = split.SplitHorizList.ElementAt(index).dDimension * dim / 100;
break;
}
}
//if (split.ParentArea is Frame frame && split.AreaList.ElementAt(i).AreaList.First() is Sash sash)
//{
// dim = dim + sash.SashList.First().ElementDimensionList.First().dOverlap
// + sash.SashList.First().ElementDimensionList.ElementAt(sash.SashList.First().ElementDimensionList.Count - 2).dOverlap;
//}
res = CalculateHeightSplitGroup(item, dim, res);
if (res.m_Dimension != -1 && res.m_Found)
return res;
}
else
{
double dim = height;
//if (split.ParentArea is Frame frame && split.AreaList.ElementAt(i).AreaList.First() is Sash sash)
//{
// dim = dim + sash.SashList.First().ElementDimensionList.First().dOverlap
// + sash.SashList.First().ElementDimensionList.ElementAt(sash.SashList.First().ElementDimensionList.Count - 2).dOverlap;
//}
res = CalculateHeightSplitGroup(item, dim, res);
if (res.m_Dimension != -1 && res.m_Found)
return res;
}
}
else if (area is Sash sash)
{
double bottomRail = 0;
if(sash.SashBottomRailQty > 0)
{
foreach (var bottom in sash.BottomRailElemDimList)
bottomRail = bottomRail + bottom.dDimension
- bottom.dOverlap;
}
double dim = height - sash.SashList.First().ElementDimensionList.First().dDimension
- sash.SashList.First().ElementDimensionList.ElementAt(sash.SashList.First().ElementDimensionList.Count - 2).dDimension
- bottomRail;
res = CalculateHeightSplitGroup(item, dim, res);
if (res.m_Dimension != -1 && res.m_Found)
return res;
}
else if (area is Splitted splitted)
{
double dim = height;
if (splitted.ParentArea is Split sp && splitted.AreaList.First() is Sash sh)
{
if (sp.SplitHorizList.Count > 0)
{
dim = dim + sh.SashList.First().ElementDimensionList.First().dOverlap
+ sh.SashList.First().ElementDimensionList.ElementAt(sh.SashList.First().ElementDimensionList.Count - 2).dOverlap;
}
}
res = CalculateHeightSplitGroup(item, dim, res);
if (res.m_Dimension != -1 && res.m_Found)
return res;
}
else
{
res = CalculateHeightSplitGroup(item, height, res);
if (res.m_Dimension != -1 && res.m_Found)
return res;
}
}
return res;
}
///// <summary>
///// Metodo per calcolare altezza intero split group
///// </summary>
///// <param name="area"> area di partenza </param>
///// <param name="height"> altezza di partenza </param>
///// <param name="res"> area di ritorno </param>
///// <returns></returns>
//internal AreaFound CalculateHeightSplitGroup(Area area, double height, AreaFound res)
//{
// for (int i = 0; i < area.AreaList.Count; i++)
// {
// if (area.Equals(m_Parent))
// {
// res.m_Dimension = height;
// res.m_Found = true;
// return res;
// }
// Area item = area.AreaList[i];
// if (area is Split split)
// {
// if (split.SplitHorizList.Count > 0)
// {
// double dim = height;
// foreach (var elem in split.ElemDimHorizList)
// dim = dim - elem.dDimension;
// int index = i;
// if (split.SelSplitShape is SplitShapes.GRID)
// index = i % split.SplitHorizList.Count;
// switch (split.SplitHorizList.ElementAt(index).SelMeasureType)
// {
// case MeasureTypes.ABSOLUTE:
// {
// dim = split.SplitHorizList.ElementAt(index).dDimension;
// break;
// }
// case MeasureTypes.PROPORTIONAL:
// {
// 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, it.Parent));
// dim = ad.ConvertFromPropVal(adList, MeasureTypes.ABSOLUTE, dim);
// break;
// }
// case MeasureTypes.PERCENTAGE:
// {
// dim = split.SplitHorizList.ElementAt(index).dDimension * dim / 100;
// break;
// }
// }
// res = CalculateHeightSplitGroup(item, dim, res);
// if (res.m_Dimension != -1 && res.m_Found)
// return res;
// }
// else
// {
// double dim = height;
// res = CalculateHeightSplitGroup(item, dim, res);
// if (res.m_Dimension != -1 && res.m_Found)
// return res;
// }
// }
// else if (area is Sash sash)
// {
// double bottomRail = 0;
// if(sash.SashBottomRailQty > 0)
// {
// foreach (var bottom in sash.BottomRailElemDimList)
// bottomRail = bottomRail + bottom.dDimension
// - bottom.dOverlap;
// }
// double dim = height - sash.SashList.First().ElementDimensionList.First().dDimension
// - sash.SashList.First().ElementDimensionList.ElementAt(sash.SashList.First().ElementDimensionList.Count - 2).dDimension
// - bottomRail;
// res = CalculateHeightSplitGroup(item, dim, res);
// if (res.m_Dimension != -1 && res.m_Found)
// return res;
// }
// else if (area is Splitted splitted)
// {
// double dim = height;
// if (splitted.ParentArea is Split sp && splitted.AreaList.First() is Sash sh)
// {
// if (sp.SplitHorizList.Count > 0)
// {
// dim = dim + sh.SashList.First().ElementDimensionList.First().dOverlap
// + sh.SashList.First().ElementDimensionList.ElementAt(sh.SashList.First().ElementDimensionList.Count - 2).dOverlap;
// }
// }
// res = CalculateHeightSplitGroup(item, dim, res);
// if (res.m_Dimension != -1 && res.m_Found)
// return res;
// }
// else
// {
// res = CalculateHeightSplitGroup(item, height, res);
// if (res.m_Dimension != -1 && res.m_Found)
// return res;
// }
// }
// return res;
//}
internal JsonSplitDimension Serialize()
{
@@ -623,7 +614,8 @@ namespace WebWindowComplex.Models
splitElemList = m_Parent.ElemDimVertList;
else
splitElemList = m_Parent.ElemDimVertList.Where(x => x.nSubArea == 1).ToList();
dimSplitGroup = CalculateWidthSplitGroup(frame, frame.AvailWidthArea(), new AreaFound(-1, false)).m_Dimension;
//dimSplitGroup = CalculateWidthSplitGroup(frame, frame.AvailWidthArea(), new AreaFound(-1, false)).m_Dimension;
dimSplitGroup = Parent.CalculateWidthSplitGroup(frame, frame.AvailWidthArea(), new AreaFound(-1, false)).m_Dimension;
}
else
{
@@ -632,7 +624,8 @@ namespace WebWindowComplex.Models
splitElemList = m_Parent.ElemDimHorizList.Where(x => x.nSubArea == 1).ToList();
else
splitElemList = m_Parent.ElemDimHorizList;
dimSplitGroup = (CalculateHeightSplitGroup(frame, frame.AvailHeightArea(), new AreaFound(-1, false))).m_Dimension;
//dimSplitGroup = (CalculateHeightSplitGroup(frame, frame.AvailHeightArea(), new AreaFound(-1, false))).m_Dimension;
dimSplitGroup = (Parent.CalculateHeightSplitGroup(frame, frame.AvailHeightArea(), new AreaFound(-1, false))).m_Dimension;
}
AreaDimension ad = new AreaDimension(dDimension, SelMeasureType, Parent);
List<AreaDimension> adList = new List<AreaDimension>();
@@ -646,7 +639,7 @@ namespace WebWindowComplex.Models
}
if (newType is MeasureTypes.PROPORTIONAL)
{
adList = ad.CalculatePropVal(adList, splitList.IndexOf(this), dimSplitGroup);
adList = ad.RicalculatePropVal(adList, splitList.IndexOf(this), dimSplitGroup);
for (int i = 0; i < adList.Count; i++)
splitList.ElementAt(i).SetDimension(adList.ElementAt(i).dDimension);
}
+34 -25
View File
@@ -1,4 +1,5 @@
@using static WebWindowComplex.LayoutConst
@using EgwCoreLib.Razor
@using static WebWindowComplex.LayoutConst
<div class="row">
@if (isLoading)
{
@@ -7,27 +8,27 @@
else if (!okParams)
{
<div class="d-flex flex-column">
<div class="card text-center shadow rounded">
<div class="card text-center shadow rounded">
<div class="col-md-12 d-grid gap-4 p-2 d-md-flex justify-content-end flex-wrap">
<button class="btn btn-lg btn-primary px-4" style="font-size: 1rem;" @onclick="DoClose">Close</button>
</div>
<div class="alert alert-warning">
<div class="fs-3">Parametri Mancanti!</div>
</div>
</div>
</div>
</div>
}
else if (!okJwd)
{
<div class="d-flex flex-column">
<div class="card text-center shadow rounded">
<div class="card text-center shadow rounded">
<div class="col-md-12 d-grid gap-4 p-2 d-md-flex justify-content-end flex-wrap">
<button class="btn btn-lg btn-primary px-4" style="font-size: 1rem;" @onclick="DoClose">Close</button>
</div>
<div class="alert alert-warning">
<div class="fs-3">JWD Mancante!</div>
</div>
</div>
</div>
</div>
}
@@ -99,11 +100,11 @@
<div class="col-md-6 col-lg-6">
@if (currStep == CompileStep.Tree)
{
<CardTree ItemTableList="m_ItemTableList"
maxCol="m_maxCol"
<CardTree ItemTableList="m_ItemTableList"
maxCol="m_maxCol"
RowCollapsedDict="RowCollapsed"
ChildDict="Child"
SashList="SashList"
SashGroupList="SashGroupList"
SplitList="SplitList"
SplittedList="SplittedList"
FillList="FillList"
@@ -126,12 +127,12 @@
}
<CascadingValue Value="baseUser" Name="User">
<CascadingValue Value="FrameWindow" Name="CurrFrameWindow">
<CascadingValue Value="m_SashList" Name="SashList">
<CascadingValue Value="m_SplitList" Name="SplitList">
<CascadingValue Value="SashGroupList" Name="SashGroupList">
<CascadingValue Value="SplitList" Name="SplitList">
<CardFrame EC_ReqResetDict="ReqResetDict"
EC_ReqOptionHw="UpdateHwOptionsFrame"
EC_ReqElement="UpdateElementFrame"
EC_UpdateFrame="UpdatePreviewFrame"
EC_UpdateFrame="UpdatePreviewFrame"
EC_ReqClose="ReturnTree">
</CardFrame>
</CascadingValue>
@@ -149,7 +150,7 @@
{
<CascadingValue Value="baseUser" Name="User">
<CardSplit CurrSplit="SplitList[currSplitIndex]"
SashList="SashList"
SashGroupList="SashGroupList"
SplitList="SplitList"
FrameWindow="FrameWindow"
EC_UpdateFrame="UpdatePreviewFrame"
@@ -163,7 +164,7 @@
}
else if (currStep == CompileStep.Sash)
{
@if (currSashIndex >= SashList.Count || currSashIndex == -1)
@if (currSashIndex >= SashGroupList.Count || currSashIndex == -1)
{
currStep = CompileStep.Tree;
}
@@ -171,8 +172,8 @@
{
<CascadingValue Value="baseUser" Name="User">
<CascadingValue Value="currLoading" Name="IsLoading">
<CascadingValue Value="SashList[currSashIndex]" Name="CurrSashGroup">
<CascadingValue Value="SashList" Name="SashList">
<CascadingValue Value="SashGroupList[currSashIndex]" Name="CurrSashGroup">
<CascadingValue Value="SashGroupList" Name="SashGroupList">
<CardSashGroup FrameWindow="FrameWindow"
EC_UpdateFrame="UpdatePreviewFrame"
EC_UpdateSashGroup="UpdatePreviewSashGroup"
@@ -186,7 +187,7 @@
</CascadingValue>
</CascadingValue>
</CascadingValue>
}
}
}
else if (currStep == CompileStep.Fill)
{
@@ -196,8 +197,8 @@
}
else
{
<CardFill CurrIndex="currFillIndex"
CurrFill="FillList[currFillIndex]"
<CardFill CurrIndex="currFillIndex"
CurrFill="FillList[currFillIndex]"
User="baseUser"
EC_UpdateFill="UpdatePreviewFill"
EC_ReqClose="ReturnTree">
@@ -231,13 +232,14 @@
</div>
</div>
</div>
@if(!baseUser && SplittedList != null && SplittedList.Count > 0)
@if (!baseUser && SplittedList != null && SplittedList.Count > 0)
{
Splitted? currSplitted = SplittedList.Where(x => x.AreaList.First().Equals(FillList[currFillIndex])).FirstOrDefault();
@if(currSplitted != null)
@if (currSplitted != null)
{
@if (currSplitted.ParentArea != null && currSplitted.ParentWindow != null){
<AreaSplit SashList="SashList"
@if (currSplitted.ParentArea != null && currSplitted.ParentWindow != null)
{
<AreaSplit SashGroupList="SashGroupList"
SplittedList="SplittedList"
CurrSplitted="currSplitted"
EC_UpdateSplitted="UpdatePreviewSplitted">
@@ -250,8 +252,8 @@
else if (currStep == CompileStep.General)
{
<General CurrWindow="m_CurrWindow"
ListPayload="ListPayload"
ListWarnings="listWarnings"
ListPayload="ListPayload"
ListWarnings="listWarnings"
User="baseUser"
EC_UpdateGeneral="UpdatePreviewGeneral"
EC_ReqClose="ReturnTree">
@@ -267,7 +269,14 @@
} *@
</div>
<div class="col-md-6 col-lg-6">
@outSvg
@if (string.IsNullOrWhiteSpace(LiveData.SvgPreview))
{
<LoadingData DisplayMode="LoadingData.SpinMode.BounceLine" DisplaySize="LoadingData.CtrlSize.Large"></LoadingData>
}
else
{
@outSvg
}
</div>
</div>
</div>
File diff suppressed because it is too large Load Diff
+26 -1
View File
@@ -6,7 +6,7 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>3.1.3.1815</Version>
<Version>3.1.3.2010</Version>
<Authors>Annamaria Sassi</Authors>
<Company>Egalware</Company>
<Description>Componente gestione Configurazioni avanzate Window per LUX</Description>
@@ -37,3 +37,28 @@
@@ -6,7 +6,7 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>3.1.3.1815</Version>
<Version>3.1.3.2010</Version>
<Authors>Annamaria Sassi</Authors>
<Company>Egalware</Company>
<Description>Componente gestione JWD per LUX</Description>
@@ -38,3 +38,28 @@
</Project>