Merge branch 'develop'
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
|
||||
<PageTitle>EditJWD</PageTitle>
|
||||
|
||||
<div class="row mb-2">
|
||||
@* <div class="col-6">
|
||||
@* <div class="row mb-2">
|
||||
<div class="col-6">
|
||||
<div class="input-group mb-2 justify-content-center">
|
||||
<span class="input-group-text">FamilyHw</span>
|
||||
<select class="form-select" @bind="familyHWMassUpdate">
|
||||
@@ -15,7 +15,7 @@
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div> *@
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div class="input-group mb-2 justify-content-center">
|
||||
<span class="input-group-text">Color</span>
|
||||
@@ -65,13 +65,12 @@
|
||||
<div class="col-2">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => UpdateInfoJwdAsync(CurrData.CurrJwd, familyHWMassUpdate, colorMassUpdate, woodMassUpdate, glassMassUpdate, profileMassUpdate)">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</div> *@
|
||||
|
||||
@if (doEdit)
|
||||
{
|
||||
<WebWindowComplex.TableComp ListPayload="SetupList"
|
||||
LiveData="CurrData"
|
||||
SelectionData="SelectList"
|
||||
PendReq="DictPendReq"
|
||||
baseUser="User"
|
||||
EC_ActionReq="DoAction"
|
||||
|
||||
@@ -30,11 +30,6 @@ namespace Test.UI.Components.Pages
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
/// <summary>
|
||||
/// Configurazione selezionati
|
||||
/// </summary>
|
||||
protected SelectPayload SelectList = new SelectPayload();
|
||||
|
||||
/// <summary>
|
||||
/// Configurazione elenchi anagrafiche
|
||||
/// </summary>
|
||||
@@ -253,7 +248,7 @@ namespace Test.UI.Components.Pages
|
||||
}
|
||||
else
|
||||
{
|
||||
string fullPath = Path.Combine("Data", "PortafineestraTreAnte.jwd");
|
||||
string fullPath = Path.Combine("Data", "AntaDoppia.jwd");
|
||||
return File.ReadAllText(fullPath);
|
||||
//return File.ReadAllText("Data\\AntaDoppia.jwd");
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
|
||||
<WebWindowComplex.TableComp ListPayload="SetupList"
|
||||
LiveData="CurrData"
|
||||
SelectionData="SelectList"
|
||||
baseUser="User"
|
||||
EC_ActionReq="DoAction"
|
||||
EC_DoUpdate="ExecRequest"
|
||||
|
||||
@@ -57,11 +57,6 @@ namespace Test.UI.Components.Pages
|
||||
/// </summary>
|
||||
protected BaseListPayload SetupList = new BaseListPayload();
|
||||
|
||||
/// <summary>
|
||||
/// Configurazione selezionati
|
||||
/// </summary>
|
||||
protected SelectPayload SelectList = new SelectPayload();
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
@@ -0,0 +1,209 @@
|
||||
@using static WebWindowComplex.Json.WindowConst
|
||||
|
||||
<div class="card shadow-sm rounded mb-4">
|
||||
<div class="card-header bg-light bg-opacity-25">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div class="px-2">
|
||||
<h5>@(descParentSplit())</h5>
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<button class="btn btn-close" @onclick="ReqClose"></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body py-2">
|
||||
<div class="d-flex justify-content-end align-items-center">
|
||||
<div class="col-md-3">
|
||||
<select class="form-select" @bind="@MeasureType">
|
||||
<option value="@MeasureTypes.ABSOLUTE">Absolute (mm)</option>
|
||||
<option value="@MeasureTypes.PROPORTIONAL">Proportional (*)</option>
|
||||
<option value="@MeasureTypes.PERCENTAGE">Percentage (%)</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<select class="form-select">
|
||||
<option value="1">Glass</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between align-items-center pt-2">
|
||||
<h5>Inglesina</h5>
|
||||
@if (!User)
|
||||
{
|
||||
<div class="input-group mb-2 justify-content-center">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => RemoveArea()">Remove split</button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-6">
|
||||
<div class="input-group mb-2">
|
||||
@if (User)
|
||||
{
|
||||
<span class="input-group-text">Shape</span>
|
||||
<input type="text" readonly class="form-control" value="@(CurrInglesina.SplitShapeList.FirstOrDefault(x => x.Id == SplitShapeIndex))">
|
||||
}
|
||||
else
|
||||
{
|
||||
<label class="input-group-text">Shape</label>
|
||||
<select class="form-select" @bind="@SplitShapeIndex">
|
||||
@foreach (var shapeType in CurrInglesina.SplitShapeList)
|
||||
{
|
||||
<option value=@(shapeType.Id)>@(shapeType.Name)</option>
|
||||
}
|
||||
</select>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-6">
|
||||
<div class="input-group mb-2">
|
||||
@if (User)
|
||||
{
|
||||
<span class="input-group-text">Side</span>
|
||||
<input type="text" readonly class="form-control" value="@(CurrInglesina.SideList.FirstOrDefault(x => x.Id == SideIndex))">
|
||||
}
|
||||
else
|
||||
{
|
||||
<label class="input-group-text">Side</label>
|
||||
<select class="form-select" @bind="@SideIndex">
|
||||
@foreach (var sideType in CurrInglesina.SideList)
|
||||
{
|
||||
<option value=@(sideType.Id)>@(sideType.Name)</option>
|
||||
}
|
||||
</select>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
@if (CurrInglesina.nSplitQtyVert > 0)
|
||||
{
|
||||
<div class="col-md-12 col-lg-6">
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text">QtyVert</span>
|
||||
@if (User)
|
||||
{
|
||||
<input type="number" readonly class="form-control" value="@SplitQtyVert">
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="number" class="form-control" @bind="@SplitQtyVert">
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (CurrInglesina.nSplitQtyHoriz > 0)
|
||||
{
|
||||
<div class="col-md-12 col-lg-6">
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text">QtyHoriz</span>
|
||||
@if (User)
|
||||
{
|
||||
<input type="number" readonly class="form-control" value="@SplitQtyHoriz">
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="number" class="form-control" @bind="@SplitQtyHoriz">
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="row">
|
||||
@if (CurrInglesina.SplitVertList.Count > 0 && CurrInglesina.SplitHorizList.Count > 0)
|
||||
{
|
||||
<div class="col-md-12 col-lg-6">
|
||||
@for (int i = 0; i < CurrInglesina.SplitVertList.Count; i++)
|
||||
{
|
||||
<EditSplitDimensions CurrRec="CurrInglesina.SplitVertList[i]"
|
||||
Name="Width"
|
||||
Index="i"
|
||||
EC_Update="UpdateDimension">
|
||||
</EditSplitDimensions>
|
||||
}
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-6">
|
||||
@for (int i = 0; i < CurrInglesina.SplitHorizList.Count; i++)
|
||||
{
|
||||
<EditSplitDimensions CurrRec="CurrInglesina.SplitHorizList[i]"
|
||||
Name="Height"
|
||||
Index="i"
|
||||
EC_Update="UpdateDimension">
|
||||
</EditSplitDimensions>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
else if (CurrInglesina.SplitHorizList.Count > 0)
|
||||
{
|
||||
@for (int i = 0; i < CurrInglesina.SplitHorizList.Count; i++)
|
||||
{
|
||||
<EditSplitDimensions CurrRec="CurrInglesina.SplitHorizList[i]"
|
||||
Name="Height"
|
||||
Index="i"
|
||||
EC_Update="UpdateDimension">
|
||||
</EditSplitDimensions>
|
||||
}
|
||||
}
|
||||
else if (CurrInglesina.SplitVertList.Count > 0)
|
||||
{
|
||||
@for (int i = 0; i < CurrInglesina.SplitVertList.Count; i++)
|
||||
{
|
||||
<EditSplitDimensions CurrRec="CurrInglesina.SplitVertList[i]"
|
||||
Name="Width"
|
||||
Index="i"
|
||||
EC_Update="UpdateDimension">
|
||||
</EditSplitDimensions>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
@if (CurrInglesina.SelSplitShape == Json.WindowConst.SplitShapes.GRID)
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-6">
|
||||
<div class="d-flex justify-content-start fs-5 mb-2">
|
||||
<div class="px-1">
|
||||
@if (User)
|
||||
{
|
||||
<input class="form-check-input ml-auto" disabled="disabled" type="checkbox" name="SplitStartVert" checked="@CurrInglesina.bSplitStartVert">
|
||||
}
|
||||
else
|
||||
{
|
||||
<input class="form-check-input ml-auto" type="checkbox" name="SplitStartVert" checked="@CurrInglesina.bSplitStartVert" @oninput="(ChangeEventArgs e) => ChangeStartVert(e)">
|
||||
}
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<label class="form-check-label fs-6 text-dark">StartVert</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
<hr/>
|
||||
<div class="row">
|
||||
@if (CurrInglesina.nSplitQtyVert > 0)
|
||||
{
|
||||
<div class="col-md-12 col-lg-6">
|
||||
<div class="d-flex justify-content-start align-items-center px-2">
|
||||
<h6>Element vert</h6>
|
||||
</div>
|
||||
@foreach (var element in vertList())
|
||||
{
|
||||
<EditSplitElement CurrRec="element" EC_Update="UpdateElement"></EditSplitElement>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
@if (CurrInglesina.nSplitQtyHoriz > 0)
|
||||
{
|
||||
<div class="col-md-12 col-lg-6">
|
||||
<div class="d-flex justify-content-start align-items-center px-2">
|
||||
<h6>Element horiz</h6>
|
||||
</div>
|
||||
@foreach (var element in horizList())
|
||||
{
|
||||
<EditSplitElement CurrRec="element" EC_Update="UpdateElement"></EditSplitElement>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,463 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using WebWindowComplex.Models;
|
||||
using static WebWindowComplex.Json.WindowConst;
|
||||
using static WebWindowComplex.LayoutConst;
|
||||
|
||||
namespace WebWindowComplex.Compo
|
||||
{
|
||||
public partial class CardInglesina
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Inglesina corrente rispetto alla lista inglesine
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public Inglesina CurrInglesina { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Lista di sash
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public List<Sash> SashGroupList { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Lista di inglesine
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public List<Inglesina> InglesinaList { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Frame
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public Frame FrameWindow { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Livello di accesso (utente base)
|
||||
/// </summary>
|
||||
[CascadingParameter(Name = "User")]
|
||||
public bool User { get; set; } = false!;
|
||||
|
||||
/// <summary>
|
||||
/// Evento per richiedere reset dizionario
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<DataUpdateRes> EC_ReqResetDict { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Evento per aggiornare Inglesina
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<DataUpdateInglesina> EC_UpdateInglesina { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Evento per aggiornare Frame
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<DataUpdateFrame> EC_UpdateFrame { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Evento per richiesta profili degli Element
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<Split> EC_ReqElement { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Evento per tornare nella pagine Tree
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<bool> EC_ReqClose { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per rimuovere split
|
||||
/// </summary>
|
||||
/// <param name="item"> split corrente </param>
|
||||
/// <returns></returns>
|
||||
protected async Task RemoveArea()
|
||||
{
|
||||
CurrInglesina.Remove();
|
||||
var args = new DataUpdateFrame()
|
||||
{
|
||||
currFrame = FrameWindow
|
||||
};
|
||||
// richiesta reset dict shape
|
||||
await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDictShape });
|
||||
await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDictShape });
|
||||
await EC_UpdateFrame.InvokeAsync(args);
|
||||
await EC_ReqClose.InvokeAsync(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Proprietà per selezionare shape split
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected int SplitShapeIndex
|
||||
{
|
||||
get => CurrInglesina.SelSplitShapeIndex;
|
||||
set
|
||||
{
|
||||
if (CurrInglesina.SelSplitShapeIndex != value)
|
||||
{
|
||||
CurrInglesina.SelSplitShapeIndex = value;
|
||||
var args = new DataUpdateInglesina()
|
||||
{
|
||||
currInglesina = CurrInglesina
|
||||
};
|
||||
_ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetDimElem });
|
||||
if(!(CurrInglesina.ParentArea.ParentArea is Sash))
|
||||
{
|
||||
// Se la shape selezionata è grid o custom, richiede reset shape
|
||||
if (value == (int)SplitShapes.GRID || value == (int)SplitShapes.CUSTOM)
|
||||
_ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDictShape });
|
||||
if (SearchSash(CurrInglesina))
|
||||
_ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetHwOpt });
|
||||
}
|
||||
_ = EC_ReqElement.InvokeAsync(CurrInglesina);
|
||||
_ = EC_UpdateInglesina.InvokeAsync(args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Proprietà per selezionare shape split
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected int SideIndex
|
||||
{
|
||||
get => CurrInglesina.SelSideIndex;
|
||||
set
|
||||
{
|
||||
if (CurrInglesina.SelSideIndex != value)
|
||||
{
|
||||
CurrInglesina.SelSideIndex = value;
|
||||
var args = new DataUpdateInglesina()
|
||||
{
|
||||
currInglesina = CurrInglesina
|
||||
};
|
||||
_ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetDimElem });
|
||||
_ = EC_ReqElement.InvokeAsync(CurrInglesina);
|
||||
_ = EC_UpdateInglesina.InvokeAsync(args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private bool SearchSash(Area area)
|
||||
{
|
||||
if (area is Sash)
|
||||
return true;
|
||||
foreach (var item in area.AreaList)
|
||||
return SearchSash(item);
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Proprietà per selezionare numero di split verticali
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected int SplitQtyVert
|
||||
{
|
||||
get => CurrInglesina.nSplitQtyVert;
|
||||
set
|
||||
{
|
||||
if (CurrInglesina.nSplitQtyVert != value)
|
||||
{
|
||||
CurrInglesina.nSplitQtyVert = value;
|
||||
_ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDimElem });
|
||||
var args = new DataUpdateInglesina()
|
||||
{
|
||||
currInglesina = CurrInglesina
|
||||
};
|
||||
_ = EC_ReqElement.InvokeAsync(CurrInglesina);
|
||||
_ = EC_UpdateInglesina.InvokeAsync(args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Proprietà per selezionare numero di split verticali
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected int SplitQtyHoriz
|
||||
{
|
||||
get => CurrInglesina.nSplitQtyHoriz;
|
||||
set
|
||||
{
|
||||
if (CurrInglesina.nSplitQtyHoriz != value)
|
||||
{
|
||||
CurrInglesina.nSplitQtyHoriz = value;
|
||||
_ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetDimElem });
|
||||
var args = new DataUpdateInglesina()
|
||||
{
|
||||
currInglesina = CurrInglesina
|
||||
};
|
||||
_ = EC_ReqElement.InvokeAsync(CurrInglesina);
|
||||
_ = EC_UpdateInglesina.InvokeAsync(args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Aggiornamento element
|
||||
/// </summary>
|
||||
/// <param name="updRec"></param>
|
||||
/// <returns></returns>
|
||||
private async Task UpdateElement(SplitElementDimension updRec)
|
||||
{
|
||||
if (updRec != null)
|
||||
{
|
||||
SplitElementDimension? currRec = new SplitElementDimension(updRec.ParentArea, 0,0,-1);
|
||||
if (updRec.nSubArea != 0)
|
||||
{
|
||||
List<SplitElementDimension> ElemIndexList = new List<SplitElementDimension>();
|
||||
if (CurrInglesina.bSplitStartVert)
|
||||
ElemIndexList = CurrInglesina.ElemDimHorizList
|
||||
.Where(x => x.nSubArea != updRec.nSubArea && x.nIndex == updRec.nIndex)
|
||||
.ToList();
|
||||
else
|
||||
ElemIndexList = CurrInglesina.ElemDimVertList
|
||||
.Where(x => x.nSubArea == updRec.nSubArea && x.nIndex == updRec.nIndex)
|
||||
.ToList();
|
||||
foreach (var item in ElemIndexList)
|
||||
{
|
||||
item.SetDimension(updRec.dDimension);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(CurrInglesina.bSplitStartVert)
|
||||
currRec = CurrInglesina.ElemDimVertList.FirstOrDefault(x => x.ParentArea == updRec.ParentArea && x.nIndex == updRec.nIndex);
|
||||
else
|
||||
currRec = CurrInglesina.ElemDimHorizList.FirstOrDefault(x => x.ParentArea == updRec.ParentArea && x.nIndex == updRec.nIndex);
|
||||
// lo aggiorno
|
||||
currRec = updRec;
|
||||
}
|
||||
var args = new DataUpdateInglesina()
|
||||
{
|
||||
currInglesina = CurrInglesina,
|
||||
svgNoHw = true
|
||||
};
|
||||
await EC_UpdateInglesina.InvokeAsync(args);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per aggiornare la dimensione dello split
|
||||
/// </summary>
|
||||
/// <param name="updRec"></param>
|
||||
/// <returns></returns>
|
||||
protected async Task UpdateDimension(DataUpdateSplitDimension updRec)
|
||||
{
|
||||
SplitDimension currSplitDim = updRec.currSplit;
|
||||
SplitDimension currRec = new SplitDimension(0, MeasureTypes.NULL, false, updRec.currSplit.Parent, false);
|
||||
// cerco il record
|
||||
if (currSplitDim.bIsVertListDim)
|
||||
currRec = CurrInglesina.SplitVertList.ElementAt(updRec.index);
|
||||
else
|
||||
currRec = CurrInglesina.SplitHorizList.ElementAt(updRec.index);
|
||||
// lo aggiorno
|
||||
if (currSplitDim != null)
|
||||
{
|
||||
currRec = currSplitDim;
|
||||
var args = new DataUpdateInglesina()
|
||||
{
|
||||
currInglesina = CurrInglesina,
|
||||
noSvg = updRec.noSvg
|
||||
};
|
||||
//await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDictShape });
|
||||
await EC_UpdateInglesina.InvokeAsync(args);
|
||||
}
|
||||
}
|
||||
|
||||
protected async Task UpdateInglesina(DataUpdateInglesina updRec)
|
||||
{
|
||||
if (updRec.currInglesina != null)
|
||||
{
|
||||
CurrInglesina = updRec.currInglesina;
|
||||
var args = new DataUpdateInglesina()
|
||||
{
|
||||
currInglesina = CurrInglesina,
|
||||
noSvg = updRec.noSvg
|
||||
};
|
||||
//await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDictShape });
|
||||
await EC_UpdateInglesina.InvokeAsync(args);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per cambiare la dimensione principale
|
||||
/// </summary>
|
||||
/// <param name="e"></param>
|
||||
/// <returns></returns>
|
||||
protected async Task ChangeStartVert(ChangeEventArgs e)
|
||||
{
|
||||
foreach (Split s in InglesinaList)
|
||||
{
|
||||
if (s.Equals(CurrInglesina) && e.Value != null)
|
||||
{
|
||||
s.bSplitStartVert = (bool)e.Value;
|
||||
//s.SetSplitStartVert((bool)e.Value);
|
||||
}
|
||||
}
|
||||
await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDimElem });
|
||||
var args = new DataUpdateInglesina()
|
||||
{
|
||||
currInglesina = CurrInglesina
|
||||
};
|
||||
await EC_ReqElement.InvokeAsync(CurrInglesina);
|
||||
await EC_UpdateInglesina.InvokeAsync(args);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per determinare la descrizione del parent dello split corrente
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected string descParentSplit()
|
||||
{
|
||||
if ((CurrInglesina.ParentArea.ParentArea is Splitted || CurrInglesina.ParentArea.ParentArea.ParentArea is Sash) && SashGroupList.Count > 0)
|
||||
{
|
||||
for (int j = 0; j < SashGroupList.Count; j++)
|
||||
{
|
||||
if (SashGroupList[j].Equals(CurrInglesina.ParentArea.ParentArea))
|
||||
{
|
||||
return "Sash " + (j + 1);
|
||||
}
|
||||
else if (SashGroupList[j].Equals(CurrInglesina.ParentArea.ParentArea.ParentArea))
|
||||
{
|
||||
for (int k = 0; k < SashGroupList[j].AreaList.Count; k++)
|
||||
{
|
||||
if (SashGroupList[j].AreaList[k].AreaList[0].AreaList[0].Equals(CurrInglesina))
|
||||
{
|
||||
return "Sash group " + (j + 1) + " - sash " + (k + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "Frame";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sollevo evento per tornare alla pagina Tree
|
||||
/// </summary>
|
||||
private void ReqClose()
|
||||
{
|
||||
_ = EC_ReqClose.InvokeAsync(true);
|
||||
}
|
||||
|
||||
private bool isOpen = false;
|
||||
private void ToggleDropdown()
|
||||
{
|
||||
isOpen = !isOpen;
|
||||
}
|
||||
|
||||
protected MeasureTypes MeasureType
|
||||
{
|
||||
get
|
||||
{
|
||||
MeasureTypes type = MeasureTypes.NULL;
|
||||
if (CurrInglesina.SplitVertList.Count > 0)
|
||||
type = CurrInglesina.SplitVertList.First().SelMeasureType;
|
||||
else
|
||||
type = CurrInglesina.SplitHorizList.First().SelMeasureType;
|
||||
for (int i = 1; i < CurrInglesina.SplitVertList.Count; i++)
|
||||
{
|
||||
if (CurrInglesina.SplitVertList.ElementAt(i).SelMeasureType != type)
|
||||
return MeasureTypes.NULL;
|
||||
}
|
||||
for (int i = 1; i < CurrInglesina.SplitHorizList.Count; i++)
|
||||
{
|
||||
if (CurrInglesina.SplitHorizList.ElementAt(i).SelMeasureType != type)
|
||||
return MeasureTypes.NULL;
|
||||
}
|
||||
return type;
|
||||
}
|
||||
set
|
||||
{
|
||||
foreach (var item in CurrInglesina.SplitVertList)
|
||||
{
|
||||
item.SelMeasureTypeIndex = (int)value;
|
||||
//item.SetSelMeasureType(value);
|
||||
}
|
||||
foreach (var item in CurrInglesina.SplitHorizList)
|
||||
{
|
||||
item.SelMeasureTypeIndex = (int)value;
|
||||
//item.SetSelMeasureType(value);
|
||||
}
|
||||
var args = new DataUpdateInglesina()
|
||||
{
|
||||
currInglesina = CurrInglesina,
|
||||
noSvg = true
|
||||
};
|
||||
_ = EC_UpdateInglesina.InvokeAsync(args);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per cambiare il tipo di misura di tutti gli SplitDimension
|
||||
/// </summary>
|
||||
/// <param name="type"> nuovo tipo </param>
|
||||
/// <returns></returns>
|
||||
protected Task SetMeasureType(MeasureTypes type)
|
||||
{
|
||||
isOpen = !isOpen;
|
||||
foreach (var item in CurrInglesina.SplitVertList)
|
||||
{
|
||||
item.SelMeasureTypeIndex = (int)type;
|
||||
//item.SetSelMeasureType(type);
|
||||
}
|
||||
foreach (var item in CurrInglesina.SplitHorizList)
|
||||
{
|
||||
item.SelMeasureTypeIndex = (int)type;
|
||||
//item.SetSelMeasureType(type);
|
||||
}
|
||||
var args = new DataUpdateInglesina()
|
||||
{
|
||||
currInglesina = CurrInglesina,
|
||||
noSvg = true
|
||||
};
|
||||
return EC_UpdateInglesina.InvokeAsync(args);
|
||||
}
|
||||
|
||||
private List<SplitElementDimension> horizList()
|
||||
{
|
||||
int subAreaMin = CurrInglesina.ElemDimHorizList.Min(x => x.nSubArea);
|
||||
return CurrInglesina.ElemDimHorizList.Where(x => x.nSubArea == subAreaMin).ToList();
|
||||
}
|
||||
|
||||
private List<SplitElementDimension> vertList()
|
||||
{
|
||||
int subAreaMin = CurrInglesina.ElemDimVertList.Min(x => x.nSubArea);
|
||||
return CurrInglesina.ElemDimVertList.Where(x => x.nSubArea == subAreaMin).ToList();
|
||||
}
|
||||
|
||||
private string MeasureTypeCss(MeasureTypes type)
|
||||
{
|
||||
for (int i = 0; i < CurrInglesina.SplitVertList.Count; i++)
|
||||
{
|
||||
if (!CurrInglesina.SplitVertList.ElementAt(i).MeasureType.Equals(type))
|
||||
return "btn btn-outline-secondary";
|
||||
}
|
||||
for (int i = 0; i < CurrInglesina.SplitHorizList.Count; i++)
|
||||
{
|
||||
if (!CurrInglesina.SplitHorizList.ElementAt(i).MeasureType.Equals(type))
|
||||
return "btn btn-outline-secondary";
|
||||
}
|
||||
return "btn btn-secondary";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Classe per raggruppare oggetti che servono per aggiornare split
|
||||
/// </summary>
|
||||
public class DataUpdateInglesina
|
||||
{
|
||||
public Inglesina currInglesina { get; set; } = null!;
|
||||
public bool svgNoHw { get; set; } = false;
|
||||
public bool noSvg { get; set; } = false;
|
||||
}
|
||||
}
|
||||
@@ -50,6 +50,12 @@
|
||||
ind = ItemTableList[i].IndexItem;
|
||||
s = s + cs.ToString() + ((ind + 1) > 0 ? (ind + 1) : "");
|
||||
}
|
||||
else if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.INGLESINA)
|
||||
{
|
||||
cs = CompileStep.Inglesina;
|
||||
ind = ItemTableList[i].IndexItem;
|
||||
s = s + cs.ToString() + ((ind + 1) > 0 ? (ind + 1) : "");
|
||||
}
|
||||
<td colspan="2">
|
||||
@* <div class="d-flex flex-row align-items-center justify-content-center">*@
|
||||
<div class="card text-center p-1 shadow-sm hover-shadow w-100">
|
||||
@@ -66,7 +72,8 @@
|
||||
</button>
|
||||
}
|
||||
@if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.SASH ||
|
||||
ItemTableList[i].Type is Json.WindowConst.AreaTypes.SPLIT)
|
||||
ItemTableList[i].Type is Json.WindowConst.AreaTypes.SPLIT ||
|
||||
ItemTableList[i].Type is Json.WindowConst.AreaTypes.INGLESINA)
|
||||
{
|
||||
<button class="btn btn-sm" style="font-size: 1rem; flex-basis: 20%;" @onclick="() => Remove(cs, ind)" title="Remove">
|
||||
<i class="fa-solid fa-trash"></i>
|
||||
|
||||
@@ -556,7 +556,7 @@ namespace WebWindowComplex.Json
|
||||
|
||||
public class JsonSplit : JsonArea
|
||||
{
|
||||
private SplitShapes m_SplitShape;
|
||||
protected SplitShapes m_SplitShape;
|
||||
[JsonProperty]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
internal SplitShapes SplitShape
|
||||
@@ -571,7 +571,7 @@ namespace WebWindowComplex.Json
|
||||
}
|
||||
}
|
||||
|
||||
private bool m_SplitStartVert;
|
||||
protected bool m_SplitStartVert;
|
||||
[JsonProperty]
|
||||
public bool SplitStartVert
|
||||
{
|
||||
@@ -585,7 +585,7 @@ namespace WebWindowComplex.Json
|
||||
}
|
||||
}
|
||||
|
||||
private List<JsonSplitDimension> m_SplitVertList = new List<JsonSplitDimension>();
|
||||
protected List<JsonSplitDimension> m_SplitVertList = new List<JsonSplitDimension>();
|
||||
[JsonProperty]
|
||||
public List<JsonSplitDimension> SplitVertList
|
||||
{
|
||||
@@ -599,7 +599,7 @@ namespace WebWindowComplex.Json
|
||||
}
|
||||
}
|
||||
|
||||
private List<JsonSplitDimension> m_SplitHorizList = new List<JsonSplitDimension>();
|
||||
protected List<JsonSplitDimension> m_SplitHorizList = new List<JsonSplitDimension>();
|
||||
[JsonProperty]
|
||||
public List<JsonSplitDimension> SplitHorizList
|
||||
{
|
||||
@@ -614,7 +614,7 @@ namespace WebWindowComplex.Json
|
||||
}
|
||||
|
||||
|
||||
private List<JsonSplitElementDimension> m_ElemDimVertList = new List<JsonSplitElementDimension>();
|
||||
protected List<JsonSplitElementDimension> m_ElemDimVertList = new List<JsonSplitElementDimension>();
|
||||
[JsonProperty]
|
||||
public List<JsonSplitElementDimension> ElementDimVertList
|
||||
{
|
||||
@@ -624,7 +624,7 @@ namespace WebWindowComplex.Json
|
||||
}
|
||||
}
|
||||
|
||||
private List<JsonSplitElementDimension> m_ElemDimHorizList = new List<JsonSplitElementDimension>();
|
||||
protected List<JsonSplitElementDimension> m_ElemDimHorizList = new List<JsonSplitElementDimension>();
|
||||
[JsonProperty]
|
||||
public List<JsonSplitElementDimension> ElementDimHorizList
|
||||
{
|
||||
@@ -702,7 +702,96 @@ namespace WebWindowComplex.Json
|
||||
}
|
||||
}
|
||||
|
||||
public class JsonSplitted : JsonArea
|
||||
public class JsonInglesina : JsonSplit
|
||||
{
|
||||
private SideInglesina m_Side;
|
||||
[JsonProperty]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public SideInglesina Side
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Side;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Side = value;
|
||||
}
|
||||
}
|
||||
public JsonInglesina() : base(SplitShapes.NULL, 0)
|
||||
{
|
||||
AreaType = AreaTypes.INGLESINA;
|
||||
}
|
||||
|
||||
public JsonInglesina(SideInglesina Side, SplitShapes SplitShape, int GroupId) : base(SplitShapes.NULL, GroupId)
|
||||
{
|
||||
m_Side = Side;
|
||||
base.SplitShape = SplitShape;
|
||||
AreaType = AreaTypes.INGLESINA;
|
||||
base.GroupId = GroupId;
|
||||
}
|
||||
|
||||
internal override Area Deserialize(Area ParentArea, Window ParentWindow)
|
||||
{
|
||||
Inglesina inglesina = new Inglesina(ParentArea, ParentWindow);
|
||||
inglesina.SetGroupId(GroupId);
|
||||
inglesina.SetAreaType(AreaTypes.INGLESINA);
|
||||
inglesina.SetSelSide(m_Side);
|
||||
inglesina.SetSplitShape(m_SplitShape);
|
||||
inglesina.SetSplitStartVert(m_SplitStartVert);
|
||||
if (m_SplitVertList.Count == 0)
|
||||
inglesina.SetSplitQtyVert(0, m_SplitHorizList.Count - 1);
|
||||
else
|
||||
{
|
||||
inglesina.SetSplitQtyVert(m_SplitVertList.Count - 1, m_SplitHorizList.Count - 1);
|
||||
for (var SplitIndex = 0; SplitIndex <= m_SplitVertList.Count - 1; SplitIndex++)
|
||||
{
|
||||
inglesina.SplitVertList[SplitIndex].SetIsRelative(m_SplitVertList[SplitIndex].IsRelative);
|
||||
inglesina.SplitVertList[SplitIndex].SetDimension(m_SplitVertList[SplitIndex].Dimension);
|
||||
inglesina.SplitVertList[SplitIndex].SetMeasureType(m_SplitVertList[SplitIndex].MeasureType);
|
||||
}
|
||||
int subAreaMin = ElementDimVertList.Min(x => x.Area);
|
||||
List<JsonSplitElementDimension> vertList = ElementDimVertList.Where(x => x.Area == subAreaMin).ToList();
|
||||
for (int index = 0; index < vertList.Count; index++)
|
||||
{
|
||||
inglesina.ElemDimVertList.ElementAt(index).SetSubArea(m_ElemDimVertList[index].Area);
|
||||
inglesina.ElemDimVertList.ElementAt(index).SetIndex(m_ElemDimVertList[index].Index);
|
||||
inglesina.ElemDimVertList.ElementAt(index).SetDimension(m_ElemDimVertList[index].Value);
|
||||
}
|
||||
}
|
||||
if (m_SplitHorizList.Count == 0)
|
||||
inglesina.SetSplitQtyHoriz(0, m_SplitVertList.Count);
|
||||
else
|
||||
{
|
||||
inglesina.SetSplitQtyHoriz(m_SplitHorizList.Count - 1, m_SplitVertList.Count - 1);
|
||||
for (var SplitIndex = 0; SplitIndex <= m_SplitHorizList.Count - 1; SplitIndex++)
|
||||
{
|
||||
inglesina.SplitHorizList[SplitIndex].SetIsRelative(m_SplitHorizList[SplitIndex].IsRelative);
|
||||
inglesina.SplitHorizList[SplitIndex].SetDimension(m_SplitHorizList[SplitIndex].Dimension);
|
||||
inglesina.SplitHorizList[SplitIndex].SetMeasureType(m_SplitHorizList[SplitIndex].MeasureType);
|
||||
}
|
||||
int subAreaMin = ElementDimHorizList.Min(x => x.Area);
|
||||
List<JsonSplitElementDimension> horizList = ElementDimHorizList.Where(x => x.Area == subAreaMin).ToList();
|
||||
for (int index = 0; index < horizList.Count; index++)
|
||||
{
|
||||
inglesina.ElemDimHorizList.ElementAt(index).SetSubArea(m_ElemDimHorizList[index].Area);
|
||||
inglesina.ElemDimHorizList.ElementAt(index).SetIndex(m_ElemDimHorizList[index].Index);
|
||||
inglesina.ElemDimHorizList.ElementAt(index).SetDimension(m_ElemDimHorizList[index].Value);
|
||||
}
|
||||
}
|
||||
foreach (var Area in AreaList)
|
||||
{
|
||||
var AreaDeserealized = Area.Deserialize(inglesina, ParentWindow);
|
||||
if (AreaDeserealized != null)
|
||||
{
|
||||
inglesina.AreaList.Add(AreaDeserealized);
|
||||
}
|
||||
}
|
||||
return inglesina;
|
||||
}
|
||||
}
|
||||
|
||||
public class JsonSplitted : JsonArea
|
||||
{
|
||||
public JsonSplitted() : base(AreaTypes.SPLITTED)
|
||||
{
|
||||
@@ -1274,6 +1363,12 @@ namespace WebWindowComplex.Json
|
||||
break;
|
||||
}
|
||||
|
||||
case AreaTypes.INGLESINA:
|
||||
{
|
||||
JsonArea = new JsonInglesina();
|
||||
break;
|
||||
}
|
||||
|
||||
case AreaTypes.SPLITTED:
|
||||
{
|
||||
JsonArea = new JsonSplitted();
|
||||
|
||||
@@ -16,7 +16,8 @@ namespace WebWindowComplex.Json
|
||||
SASH = 2,
|
||||
FILL = 3,
|
||||
SPLIT = 4,
|
||||
SPLITTED = 5
|
||||
SPLITTED = 5,
|
||||
INGLESINA = 6
|
||||
}
|
||||
|
||||
public enum FillTypes
|
||||
@@ -126,6 +127,14 @@ namespace WebWindowComplex.Json
|
||||
PERCENTAGE = 3
|
||||
}
|
||||
|
||||
public enum SideInglesina : int
|
||||
{
|
||||
NULL = 0,
|
||||
INTERNAL = 1,
|
||||
EXTERNAL = 2,
|
||||
BOTH = 3
|
||||
}
|
||||
|
||||
// Specifies the display state of an element.
|
||||
public enum Visibility
|
||||
{
|
||||
|
||||
@@ -15,6 +15,7 @@ namespace WebWindowComplex
|
||||
Split,
|
||||
Sash,
|
||||
Fill,
|
||||
Inglesina,
|
||||
General,
|
||||
ArcElement
|
||||
}
|
||||
|
||||
@@ -201,10 +201,12 @@ namespace WebWindowComplex.Models
|
||||
public void AddInglesina()
|
||||
{
|
||||
// Creo l'inglesina
|
||||
Split InglesinaArea = Split.CreateSplit(this, SplitShapes.HORIZONTAL);
|
||||
//Split InglesinaArea = Split.CreateSplit(this, SplitShapes.HORIZONTAL);
|
||||
Inglesina InglesinaArea = Inglesina.CreateInglesina(this.AreaList[0], SplitShapes.HORIZONTAL);
|
||||
// imposto i parametri di default
|
||||
InglesinaArea.SetSplitStartVert(false);
|
||||
InglesinaArea.SetSplitQtyHoriz(1, 0);
|
||||
InglesinaArea.ElemDimHorizList.FirstOrDefault().SetDimension(60);
|
||||
// Aggiungo l'inglesina nell'AreaList del Fill
|
||||
Fill fill = (Fill)AreaList.First();
|
||||
fill.AreaList.Add(InglesinaArea);
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
|
||||
using WebWindowComplex.Json;
|
||||
using static WebWindowComplex.Json.WindowConst;
|
||||
|
||||
namespace WebWindowComplex.Models
|
||||
{
|
||||
public class Inglesina : Split
|
||||
{
|
||||
public Inglesina(Area ParentArea, Window ParentWindow) : base(ParentArea, ParentWindow)
|
||||
{
|
||||
}
|
||||
|
||||
public int SelSideIndex
|
||||
{
|
||||
get
|
||||
{
|
||||
return (int)m_SelSide;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_SelSide = (SideInglesina)value;
|
||||
}
|
||||
}
|
||||
internal override JsonArea Serialize(bool hideHw)
|
||||
{
|
||||
if (nCounterGroup < GroupId)
|
||||
Area.nCounterGroup = GroupId;
|
||||
JsonInglesina JsonInglesina = new JsonInglesina(m_SelSide, SelSplitShape, GroupId);
|
||||
JsonInglesina.SplitStartVert = bSplitStartVert;
|
||||
foreach (var SplitVert in SplitVertList)
|
||||
JsonInglesina.SplitVertList.Add(SplitVert.Serialize());
|
||||
foreach (var SplitHoriz in SplitHorizList)
|
||||
JsonInglesina.SplitHorizList.Add(SplitHoriz.Serialize());
|
||||
if (ElemDimHorizList != null && ElemDimHorizList.Count > 0)
|
||||
{
|
||||
int subAreaMinHoriz = ElemDimHorizList.Min(x => x.nSubArea);
|
||||
List<SplitElementDimension> horizList = ElemDimHorizList.Where(x => x.nSubArea == subAreaMinHoriz).ToList();
|
||||
foreach (var Elem in horizList)
|
||||
JsonInglesina.ElementDimHorizList.Add(Elem.Serialize());
|
||||
}
|
||||
if (ElemDimVertList != null && ElemDimVertList.Count > 0)
|
||||
{
|
||||
int subAreaMinVert = ElemDimVertList.Min(x => x.nSubArea);
|
||||
List<SplitElementDimension> vertList = ElemDimVertList.Where(x => x.nSubArea == subAreaMinVert).ToList();
|
||||
foreach (var Elem in vertList.ToList())
|
||||
JsonInglesina.ElementDimVertList.Add(Elem.Serialize());
|
||||
}
|
||||
foreach (var Area in AreaList)
|
||||
JsonInglesina.AreaList.Add(Area.Serialize(hideHw));
|
||||
return JsonInglesina;
|
||||
}
|
||||
internal static Inglesina CreateInglesina(Area Area, SplitShapes SplitShape)
|
||||
{
|
||||
Inglesina inglesina = new Inglesina(Area, Area.ParentWindow);
|
||||
AddCounterGroup();
|
||||
inglesina.SetGroupId(nCounterGroup);
|
||||
inglesina.SetAreaType(AreaTypes.INGLESINA);
|
||||
inglesina.SetSplitShape(SplitShape);
|
||||
inglesina.SetSelSide(SideInglesina.BOTH);
|
||||
return inglesina;
|
||||
}
|
||||
|
||||
internal void SetSelSide(SideInglesina side)
|
||||
{
|
||||
m_SelSide = side;
|
||||
}
|
||||
public List<IdNameStruct> SideList
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_SideList;
|
||||
}
|
||||
}
|
||||
|
||||
private List<IdNameStruct> m_SideList = new List<IdNameStruct>
|
||||
{
|
||||
new IdNameStruct((int)SideInglesina.INTERNAL, "Internal"),
|
||||
new IdNameStruct((int)SideInglesina.EXTERNAL, "External"),
|
||||
new IdNameStruct((int)SideInglesina.BOTH, "Both")
|
||||
};
|
||||
|
||||
private SideInglesina m_SelSide;
|
||||
}
|
||||
}
|
||||
@@ -193,6 +193,28 @@
|
||||
</CascadingValue>
|
||||
}
|
||||
}
|
||||
else if (currStep == CompileStep.Inglesina)
|
||||
{
|
||||
@if (currInglesinaIndex >= InglesinaList.Count || currInglesinaIndex == -1)
|
||||
{
|
||||
currStep = CompileStep.Tree;
|
||||
}
|
||||
else
|
||||
{
|
||||
<CascadingValue Value="baseUser" Name="User">
|
||||
<CardInglesina CurrInglesina="InglesinaList[currInglesinaIndex]"
|
||||
SashGroupList="SashGroupList"
|
||||
InglesinaList="InglesinaList"
|
||||
FrameWindow="FrameWindow"
|
||||
EC_UpdateFrame="UpdatePreviewFrame"
|
||||
EC_ReqResetDict="ReqResetDict"
|
||||
EC_UpdateInglesina="UpdatePreviewInglesina"
|
||||
EC_ReqElement="UpdateElementSplit"
|
||||
EC_ReqClose="ReturnTree">
|
||||
</CardInglesina>
|
||||
</CascadingValue>
|
||||
}
|
||||
}
|
||||
else if (currStep == CompileStep.Fill)
|
||||
{
|
||||
@if (currFillIndex >= FillList.Count || currFillIndex == -1)
|
||||
|
||||
@@ -108,12 +108,6 @@ namespace WebWindowComplex
|
||||
[Parameter]
|
||||
public LivePayload LiveData { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Preselezione valori
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public SelectPayload? SelectionData { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// Preselezione valori
|
||||
/// </summary>
|
||||
@@ -196,8 +190,6 @@ namespace WebWindowComplex
|
||||
SvgPreview = LiveData.SvgPreview,
|
||||
ProfElementList = LiveData.ProfElementList
|
||||
};
|
||||
// Aggiornati parametri di ingresso selezionati
|
||||
UpdateSelParameter();
|
||||
// provo a deserializzare SE necessario
|
||||
if (needDeser)
|
||||
{
|
||||
@@ -320,6 +312,8 @@ namespace WebWindowComplex
|
||||
|
||||
private int currSplitIndex = -1;
|
||||
|
||||
private int currInglesinaIndex = -1;
|
||||
|
||||
private CompileStep currStep;
|
||||
|
||||
private bool editLock = false;
|
||||
@@ -368,6 +362,8 @@ namespace WebWindowComplex
|
||||
|
||||
private List<Splitted> m_SplittedList = new List<Splitted>();
|
||||
|
||||
private List<Inglesina> m_InglesinaList = new List<Inglesina>();
|
||||
|
||||
private bool okJwd = false;
|
||||
|
||||
private bool okParams = false;
|
||||
@@ -452,6 +448,11 @@ namespace WebWindowComplex
|
||||
get => m_SplitList;
|
||||
}
|
||||
|
||||
private List<Inglesina> InglesinaList
|
||||
{
|
||||
get => m_InglesinaList;
|
||||
}
|
||||
|
||||
private List<Splitted> SplittedList
|
||||
{
|
||||
get => m_SplittedList;
|
||||
@@ -498,6 +499,7 @@ namespace WebWindowComplex
|
||||
currSashIndex = -1;
|
||||
currFillIndex = -1;
|
||||
currSplitIndex = -1;
|
||||
currInglesinaIndex = -1;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -814,6 +816,39 @@ namespace WebWindowComplex
|
||||
maxRow++;
|
||||
break;
|
||||
}
|
||||
case AreaTypes.INGLESINA:
|
||||
{
|
||||
// Se il nodo ha fratelli o cugini
|
||||
if (node.ParentArea.AreaList.Count > 1 || (node.ParentArea.ParentArea != null && node.ParentArea.ParentArea.AreaList.Count > 1))
|
||||
{
|
||||
if (node.ParentArea.AreaList.First().Equals(node) || node.ParentArea.ParentArea.AreaList.First().Equals(node))
|
||||
maxCol++;
|
||||
for (int i = 0; i < InglesinaList.Count; i++)
|
||||
{
|
||||
if (InglesinaList[i].Equals(node))
|
||||
{
|
||||
string nInglesina = InglesinaList.Count == 1 ? "" : $"{i + 1}";
|
||||
ItemTableList.Add(new ItemTable(AreaTypes.INGLESINA, "IN" + nInglesina, maxRow, col, i, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < InglesinaList.Count; i++)
|
||||
{
|
||||
if (InglesinaList[i].Equals(node))
|
||||
{
|
||||
string nInglesina = InglesinaList.Count == 1 ? "" : $"{i + 1}";
|
||||
ItemTableList.Add(new ItemTable(AreaTypes.INGLESINA, "IN" + nInglesina, row, col, i, 0));
|
||||
maxCol++;
|
||||
}
|
||||
}
|
||||
}
|
||||
row++;
|
||||
col++;
|
||||
maxRow++;
|
||||
break;
|
||||
}
|
||||
case AreaTypes.SPLITTED:
|
||||
{
|
||||
break;
|
||||
@@ -870,6 +905,11 @@ namespace WebWindowComplex
|
||||
m_SplitList.Add((Split)node);
|
||||
break;
|
||||
}
|
||||
case AreaTypes.INGLESINA:
|
||||
{
|
||||
m_InglesinaList.Add((Inglesina)node);
|
||||
break;
|
||||
}
|
||||
case AreaTypes.SPLITTED:
|
||||
{
|
||||
if (node.ParentArea is Split && !IntoSash && node.AreaList.First() is Fill)
|
||||
@@ -1124,6 +1164,7 @@ namespace WebWindowComplex
|
||||
currSashIndex = Index;
|
||||
currFillIndex = -1;
|
||||
currSplitIndex = -1;
|
||||
currInglesinaIndex = -1;
|
||||
break;
|
||||
}
|
||||
case CompileStep.Fill:
|
||||
@@ -1131,6 +1172,7 @@ namespace WebWindowComplex
|
||||
currFillIndex = Index;
|
||||
currSashIndex = -1;
|
||||
currSplitIndex = -1;
|
||||
currInglesinaIndex = -1;
|
||||
break;
|
||||
}
|
||||
case CompileStep.Split:
|
||||
@@ -1138,6 +1180,15 @@ namespace WebWindowComplex
|
||||
currSplitIndex = Index;
|
||||
currSashIndex = -1;
|
||||
currFillIndex = -1;
|
||||
currInglesinaIndex = -1;
|
||||
break;
|
||||
}
|
||||
case CompileStep.Inglesina:
|
||||
{
|
||||
currInglesinaIndex = Index;
|
||||
currSashIndex = -1;
|
||||
currFillIndex = -1;
|
||||
currSplitIndex = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1566,6 +1617,13 @@ namespace WebWindowComplex
|
||||
else
|
||||
return "nav-link text-dark";
|
||||
}
|
||||
else if (testStep == CompileStep.Inglesina)
|
||||
{
|
||||
if ((currInglesinaIndex == 0 && Index == 0) || (currInglesinaIndex == 1 && Index == 1))
|
||||
return "nav-link active fw-bold";
|
||||
else
|
||||
return "nav-link text-dark";
|
||||
}
|
||||
return (testStep == currStep) ? "nav-link active fw-bold" : "nav-link text-dark";
|
||||
}
|
||||
|
||||
@@ -1658,6 +1716,7 @@ namespace WebWindowComplex
|
||||
m_SashGroupList = new List<Sash>();
|
||||
m_SplitList = new List<Split>();
|
||||
m_SplittedList = new List<Splitted>();
|
||||
m_InglesinaList = new List<Inglesina>();
|
||||
CreateWindowsList((m_CurrWindow!).AreaList.First(), false);
|
||||
ReqGroupIdList(FrameWindow, reqList);
|
||||
await DoReqElement(reqList);
|
||||
@@ -1802,6 +1861,7 @@ namespace WebWindowComplex
|
||||
m_FillList = new List<Fill>();
|
||||
m_SashGroupList = new List<Sash>();
|
||||
m_SplitList = new List<Split>();
|
||||
m_InglesinaList = new List<Inglesina>();
|
||||
m_SplittedList = new List<Splitted>();
|
||||
m_ItemTableList = new List<ItemTable>();
|
||||
CreateWindowsList((m_CurrWindow!).AreaList.First(), false);
|
||||
@@ -1943,6 +2003,27 @@ namespace WebWindowComplex
|
||||
}
|
||||
}
|
||||
|
||||
private async Task UpdatePreviewInglesina(DataUpdateInglesina args)
|
||||
{
|
||||
Inglesina newInglesina = args.currInglesina;
|
||||
bool forceSvgNoHw = args.svgNoHw;
|
||||
bool noSvg = args.noSvg;
|
||||
if (newInglesina != null)
|
||||
{
|
||||
// cerco il record
|
||||
var currRec = SearchAreaFromGroupId(FrameWindow, newInglesina.GroupId);
|
||||
// lo aggiorno
|
||||
currRec = newInglesina;
|
||||
if (!noSvg)
|
||||
{
|
||||
if (forceSvgNoHw)
|
||||
await DoPreviewSvg(true, true);
|
||||
else
|
||||
await DoPreviewSvg();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per aggiornare Splitted
|
||||
/// </summary>
|
||||
@@ -2063,6 +2144,40 @@ namespace WebWindowComplex
|
||||
}
|
||||
break;
|
||||
}
|
||||
case AreaTypes.INGLESINA:
|
||||
{
|
||||
Inglesina inglesina = (Inglesina)found;
|
||||
List<SplitElementDimension> IngElemList = inglesina.searchElemFromSubArea(EntityIdSearch);
|
||||
for (int i = 0; i < IngElemList.Count; i++)
|
||||
{
|
||||
IngElemList.ElementAt(i).SetNameElement(profileNameList.ElementAt(i));
|
||||
IngElemList.ElementAt(i).SetMinDimension(Window.m_ParameterList.GetValueOrDefault(IngElemList.ElementAt(i).sName + "_DimMin"));
|
||||
IngElemList.ElementAt(i).SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(IngElemList.ElementAt(i).sName + "_DimMax"));
|
||||
if (IngElemList.ElementAt(i).dDimension > IngElemList.ElementAt(i).dMaxDim)
|
||||
{
|
||||
IngElemList.ElementAt(i).SetDimension(IngElemList.ElementAt(i).dMaxDim);
|
||||
Frame frame = inglesina.ParentWindow.AreaList.First();
|
||||
if (frame != null)
|
||||
{
|
||||
frame.SearchAreaList(frame, frame.AvailWidthArea(), "Width");
|
||||
frame.SearchAreaList(frame, frame.AvailHeightArea(), "Height");
|
||||
}
|
||||
}
|
||||
else if (IngElemList.ElementAt(i).dDimension < IngElemList.ElementAt(i).dMinDim)
|
||||
{
|
||||
IngElemList.ElementAt(i).SetDimension(IngElemList.ElementAt(i).dMinDim);
|
||||
Frame frame = inglesina.ParentWindow.AreaList.First();
|
||||
if (frame != null)
|
||||
{
|
||||
frame.SearchAreaList(frame, frame.AvailWidthArea(), "Width");
|
||||
frame.SearchAreaList(frame, frame.AvailHeightArea(), "Height");
|
||||
}
|
||||
}
|
||||
//string overlapName = string.Join("_", IngElemList.ElementAt(i).sName.Split('_').Skip(1));
|
||||
//IngElemList.ElementAt(i).SetOverlapElement(Window.m_ParameterList.GetValueOrDefault(overlapName + "_Overlap"));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
foreach (var item in elemList)
|
||||
{
|
||||
@@ -2076,21 +2191,6 @@ namespace WebWindowComplex
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per settare i parmateri di ingresso selezionati
|
||||
/// </summary>
|
||||
private void UpdateSelParameter()
|
||||
{
|
||||
if (SelectionData != null && SelectionData.IsValid())
|
||||
{
|
||||
SelFamilyHardware = SelectionData.FamilyHardware ?? "";
|
||||
SelColorMaterial = SelectionData.ColorMaterial ?? "";
|
||||
SelWood = SelectionData.Wood ?? "";
|
||||
SelGlass = SelectionData.Glass ?? "";
|
||||
SelProfile = SelectionData.Profile ?? "";
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>3.1.3.3016</Version>
|
||||
<Version>3.1.4.1313</Version>
|
||||
<Authors>Annamaria Sassi</Authors>
|
||||
<Company>Egalware</Company>
|
||||
<Description>Componente gestione Configurazioni avanzate Window per LUX</Description>
|
||||
@@ -118,6 +118,12 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>3.1.3.3016</Version>
|
||||
<Version>3.1.4.1313</Version>
|
||||
<Authors>Annamaria Sassi</Authors>
|
||||
<Company>Egalware</Company>
|
||||
<Description>Componente gestione JWD per LUX</Description>
|
||||
@@ -142,6 +142,35 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user