- Aggiornato passaggio parametri tra componenti

- Aggiornata interfaccia sash
- Aggiornato jwd di base nel caso di sbagliata deserializzazione
- Aggiornato readme
This commit is contained in:
Annamaria Sassi
2025-11-24 14:50:32 +01:00
parent cf912c8f21
commit 1fed423ab0
22 changed files with 617 additions and 448 deletions
+31 -43
View File
@@ -7,23 +7,24 @@ Durante la configurazione ad ogni cambiamento viene aggiornata l'immagine del se
## Requisiti
I requisiti per utilizzare il componente sono:
- JWD da modificare
- Lista delle famiglie hardware
- Lista hardware
- Lista dei materiali
- Lista dei colori dei materiali
- Lista dei vetri ammessi
- Lista dei profili gestiti
- JWD da modificare;
- Lista delle famiglie hardware;
- Lista hardware;
- Lista dei materiali;
- Lista dei colori dei materiali;
- Lista dei vetri ammessi;
- Lista dei profili gestiti.
## Funzionalità componente
Il componente permette i seguenti comportamenti principali:
- Aggiungere un gruppo di ante al telaio,
- Aggiungere uno split al telaio o a un anta,
- Copiare il contenuto di un'anta in un'altra anta,
- Eliminare un gruppo di ante,
- Eliminare uno split
- Aggiungere un gruppo di ante al telaio;
- Aggiungere uno split al telaio o a un anta;
- Copiare il contenuto di un'anta in un'altra anta;
- Eliminare un gruppo di ante;
- Eliminare uno split;
- Cambiare le caratteristiche dei gruppi di ante, delle singole ante, degli split e del frame.
## JWD
@@ -53,17 +54,17 @@ Al frame sono associate le seguenti caratteristiche:
#### Forme Telaio
Le forme ammesse per il telaio sono le seguenti:
- Rectangle
- Right Chamfer
- Left Chamfer
- Double Chamfer
- Arc
- Full Arc
- Fillet
- Double Arc
- Three Center Arc
- Triangle,
- Custom
- Rectangle;
- Right Chamfer;
- Left Chamfer;
- Double Chamfer;
- Arc;
- Full Arc;
- Fillet;
- Double Arc;
- Three Center Arc;
- Triangle;
- Custom.
### Divisione (Split)
@@ -71,9 +72,9 @@ Uno split genera sempre almeno due sottoaree contenenti ognuna un riempimento (F
Se ci sono solo due sottoaree generate da uno split, si possono scambiare tra di loro.
Uno split può essere:
- Orizzontale, definisco il numero di split orizzontali e l'altezza delle nuove aree orizzontali formate;
- Verticale, definisco il numero di split verticali e la larghezza delle nuove aree verticali formate;
- A griglia, definisco il numero di split orizzontali e verticali e l'altezza delle aree orizzontali e la larghezza delle aree verticali.
- Orizzontale, viene definito il numero di split orizzontali e l'altezza delle nuove aree orizzontali formate;
- Verticale, viene definito il numero di split verticali e la larghezza delle nuove aree verticali formate;
- A griglia, viene definito il numero di split orizzontali e verticali e l'altezza delle aree orizzontali e la larghezza delle aree verticali; in questo caso si può scegliere se hanno la precedenza gli split orizzontali o verticali (cambia il modo in cui si esegue l'incrocio tra gli split).
### Gruppo di ante (Sash group)
@@ -81,33 +82,22 @@ Al gruppo di ante sono associate le seguenti caratteristiche:
- Numero di ante;
- Orientamento;
- Quantità bottom rail;
- Giunti;
- Codice hardware.
#### Forme gruppo ante
Le forme ammesse per il telaio sono le seguenti:
- Arc
- Circle
- Custom
- FullArc
- Rectangle
- SemiArc
- SemiFullArc
- Trapezoid
#### Singola anta
La singola anta ha associate le seguenti caratteristiche:
- Tipologia di apertura;
- Dimensione;
- Presenza maniglia.
- Tipo di misura per la dimensione (assoluta, percentuale o proporzionale)
- Presenza maniglia;
- Giunti.
#### Hardware
Per calcolare la lista di hardware ammessi data una famiglia di hardware servono i seguenti dati:
- Forma del gruppo di ante (tramite richiesta al programma di calcolo);
- Apertura dell'anta con la maniglia;
- Tipo di apertura dell'anta con la maniglia;
- Numero di ante;
- Posizione anta battente (nel caso di tre o più ante, bisogna sapere se l'anta con la maniglia è incernierata al telaio o a un'altra anta).
@@ -135,8 +125,6 @@ Vengono richieste nei seguenti casi:
Descrive il tipo di riempimento: vetro o pannello.
## Roadmap
Mancano:
+1 -1
View File
@@ -5,7 +5,7 @@
<h5>Area frame</h5>
</div>
<div class="col d-flex justify-content-between">
@if (CurrSashList.Count == 0 && CurrSplitList.Count == 0)
@if (SashList.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>
+5 -5
View File
@@ -7,14 +7,14 @@ namespace WebWindowComplex.Compo
{
#region Public Properties
[Parameter]
[CascadingParameter(Name = "CurrFrameWindow")]
public Frame CurrFrameWindow { get; set; } = null!;
[Parameter]
public List<Sash> CurrSashList { get; set; } = null!;
[CascadingParameter(Name = "SashList")]
public List<Sash> SashList { get; set; } = null!;
[Parameter]
public List<Split> CurrSplitList { get; set; } = null!;
[CascadingParameter(Name = "SplitList")]
public List<Split> SplitList { get; set; } = null!;
[Parameter]
public EventCallback<bool> EC_AddSash { get; set; }
+2 -2
View File
@@ -5,7 +5,7 @@
<h6 class="fw-bold">Hardware option</h6>
</div>
<div class="col d-flex justify-content-md-end align-items-center">
<button class="btn btn-primary" type="button" @onclick="() => changeCollapsed()">@((MarkupString)hwIcon)</button>
<button class="btn btn-primary btn-sm" type="button" @onclick="() => changeCollapsed()">@((MarkupString)hwIcon)</button>
</div>
</div>
<div class="row mt-2">
@@ -30,7 +30,7 @@
{
<div class="scrollspy my-2" tabindex="0"
style="position: relative; height: 15rem; overflow-y: auto;">
@foreach (var currOpt in CurrSash.HwOptionList)
@foreach (var currOpt in CurrSashGroup.HwOptionList)
{
switch (currOpt.Type)
{
+4 -4
View File
@@ -11,8 +11,8 @@ namespace WebWindowComplex.Compo
/// <summary>
/// Sash corrente rispetto alla lista Sash
/// </summary>
[Parameter]
public Sash CurrSash { get; set; } = null!;
[CascadingParameter(Name = "CurrSashGroup")]
public Sash CurrSashGroup { get; set; } = null!;
/// <summary>
/// Evento per aggiornare gli hardware option di tipo combo
@@ -48,9 +48,9 @@ namespace WebWindowComplex.Compo
private async Task changeCollapsed()
{
hwOptCollapsed = !hwOptCollapsed;
if (CurrSash.HwOptionList.Count == 0)
if (CurrSashGroup.HwOptionList.Count == 0)
{
await EC_FirstHwOptionList.InvokeAsync(CurrSash.GroupId);
await EC_FirstHwOptionList.InvokeAsync(CurrSashGroup.GroupId);
}
}
+247 -117
View File
@@ -4,7 +4,27 @@
<div class="col-sm-6 my-2">
<div class="d-flex justify-content-between align-items-center">
<h6 class="fw-bold">Sash @(CurrSashGroup.SashList.Count == 1 ? "" : (IndexSash + 1))</h6>
<button class="btn btn-primary" type="button" @onclick="() => doEdit()">Edit</button>
<div class="dropdown">
<button class="btn btn-outline-secondary dropdown-toggle btn-sm" type="button" @onclick="ToggleDropdown">
Copy content
</button>
<ul class="dropdown-menu @(isOpen ? "show" : "")" style="min-width:5rem; max-width:10rem">
@for (int k = 0; k <= CurrSashGroup.SashList.Count - 1; k++)
{
@if (k != IndexSash)
{
int IndexCopy = k;
int IndexModify = IndexSash;
<li>
<button class="dropdown-item" @onclick="() => RaiseCopyContentSash(IndexCopy, IndexModify)">
Sash @(k + 1)
</button>
</li>
}
}
</ul>
</div>
<button class="btn btn-primary btn-sm" type="button" @onclick="() => doEdit(IndexSash)">Edit</button>
</div>
<div class="input-group mb-2 mt-2">
<label class="input-group-text">Tipology</label>
@@ -45,7 +65,16 @@
}
</select>
</div>
@* <div class="col">
<div class="d-flex justify-content-start fs-5 mb-2">
<div class="px-1">
<input class="form-check-input ml-auto" type="checkbox" name="Handle" checked="@CurrSashDim.bHasHandle" @onclick="() => RaiseChangeHandle(CurrSashDim, CurrSashGroup)">
</div>
<div class="px-2">
<label class="form-check-label fs-6 text-dark">Handle</label>
</div>
</div>
@*
<div class="col">
<div class="row justify-content-between align-items-center">
<div class="col d-flex justify-content-start align-items-center">
<h6 class="fw-bold">Joints</h6>
@@ -54,6 +83,7 @@
<button class="btn btn-primary" type="button" @onclick="() => changeCollapsed()">@((MarkupString)jointCollapsedIcon)</button>
</div>
</div>
@if (!JointCollapsed)
{
<div class="row justify-content-between align-items-center mt-2">
@@ -82,14 +112,7 @@
}
}
</div>
<div class="d-flex justify-content-start fs-5 mb-2">
<div class="px-1">
<input class="form-check-input ml-auto" type="checkbox" name="Handle" checked="@CurrSashDim.bHasHandle" @onclick="() => RaiseChangeHandle(CurrSashDim, CurrSashGroup)">
</div>
<div class="px-2">
<label class="form-check-label fs-6 text-dark">Handle</label>
</div>
</div>
@if (!(CurrAnta.AreaList[0] is Split))
{
<div class="row">
@@ -124,126 +147,233 @@
}
else
{
<div class="modal" tabindex="-1" style="display:block; background-color: rgba(10,10,10,.6);" role="dialog">
<div class="modal-dialog modal-dialog-centered modal-xl">
<div class="modal-content">
<div class="modal-header">
<div class="col-3 text-start fs-3">
Sash @(CurrSashGroup.SashList.Count == 1 ? "" : (IndexSash + 1))
</div>
@if (!(CurrAnta.AreaList[0] is Split))
{
<div class="col-3 fs-4">
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => CurrAnta.AddSplit()">Add split</button>
</div>
</div>
<div class="col-3 fs-4">
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm">Add inglesina</button>
</div>
</div>
}
<div class="col-3 text-end fs-4">
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" @onclick="ClosePopup">
</button>
</div>
<div class="border rounded py-2 px-3">
<div class="d-flex justify-content-between align-items-center mb-2">
<h6 class="fw-bold text-nowrap">Sash @(CurrSashGroup.SashList.Count == 1 ? "" : (IndexSash + 1))</h6>
@if (!(CurrAnta.AreaList[0] is Split))
{
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => CurrAnta.AddSplit()">Add split</button>
</div>
<div class="modal-body">
<div class="row">
<div class="col-sm-6 my-2">
<div class="input-group mb-2">
<label class="input-group-text">Tipology</label>
<select class="form-select" @bind="@CurrSashDim.SelOpeningTypeIndex">
@foreach (var openingType in CurrSashDim.OpeningTypeList)
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm">Add inglesina</button>
</div>
}
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" @onclick="() => ClosePopup(IndexSash)"></button>
</div>
<div class="row">
<div class="col-sm-6 my-2">
<div class="input-group mb-2">
<label class="input-group-text">Tipology</label>
<select class="form-select" @bind="@CurrSashDim.SelOpeningTypeIndex">
@foreach (var openingType in CurrSashDim.OpeningTypeList)
{
<option value=@(openingType.Id)>@(openingType.Name)</option>
}
</select>
</div>
<div class="input-group mb-2">
<span class="input-group-text">Dimension</span>
<InputDouble CssClass="form-control form-control text-end" Decimals="@CssDecimals()" @bind-Value="@CurrSashDim.dDimension"></InputDouble>
<select class="form-select" style="max-width:6rem; background-color:#e9ecef" @bind="@CurrSashDim.SelMeasureTypeIndex">
@foreach (var mType in CurrSashDim.MeasureTypeList)
{
<option value=@(mType.Id)>
@switch (mType.Name)
{
<option value=@(openingType.Id)>@(openingType.Name)</option>
}
</select>
</div>
<div class="input-group mb-2">
<span class="input-group-text">Dimension</span>
<InputDouble CssClass="form-control form-control text-end" Decimals="@CssDecimals()" @bind-Value="@CurrSashDim.dDimension"></InputDouble>
@* <input type="number" class="form-control" @bind="@CurrSashDim.dDimension"> *@
<select class="form-select" style="max-width:6rem; background-color:#e9ecef" @bind="@CurrSashDim.SelMeasureTypeIndex">
@foreach (var mType in CurrSashDim.MeasureTypeList)
{
<option value=@(mType.Id)>
@switch (mType.Name)
case "Absolut":
{
case "Absolut":
{
<span class="input-group-text">mm</span>
break;
}
case "Proportional":
{
<span class="input-group-text">*</span>
break;
}
case "Percentage":
{
<span class="input-group-text">%</span>
break;
}
<span class="input-group-text">mm</span>
break;
}
case "Proportional":
{
<span class="input-group-text">*</span>
break;
}
case "Percentage":
{
<span class="input-group-text">%</span>
break;
}
</option>
}
</select>
</div>
<div class="d-flex justify-content-start fs-5 mb-2">
<div class="px-1">
<input class="form-check-input ml-auto" type="checkbox" name="Handle" checked="@CurrSashDim.bHasHandle" @onclick="() => RaiseChangeHandle(CurrSashDim, CurrSashGroup)">
</option>
}
</select>
</div>
<div class="d-flex justify-content-start fs-5 mb-2">
<div class="px-1">
<input class="form-check-input ml-auto" type="checkbox" name="Handle" checked="@CurrSashDim.bHasHandle" @onclick="() => RaiseChangeHandle(CurrSashDim, CurrSashGroup)">
</div>
<div class="px-2">
<label class="form-check-label fs-6 text-dark">Handle</label>
</div>
</div>
@* <div class="row d-flex justify-content-center align-items-center">
@for (int k = 0; k <= CurrSashGroup.SashList.Count - 1; k++)
{
@if (k != IndexSash)
{
int IndexCopy = k;
int IndexModify = IndexSash;
<div class="col-md-12 col-lg-6 my-1">
<div class="input-group justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => RaiseCopyContentSash(IndexCopy, IndexModify)">Copy sash @(k + 1)</button>
</div>
</div>
<div class="px-2">
<label class="form-check-label fs-6 text-dark">Handle</label>
</div>
</div>
<div class="row d-flex justify-content-center align-items-center">
@for (int k = 0; k <= CurrSashGroup.SashList.Count - 1; k++)
{
@if (k != IndexSash)
{
int IndexCopy = k;
int IndexModify = IndexSash;
<div class="col-md-12 col-lg-6 my-1">
<div class="input-group justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => RaiseCopyContentSash(IndexCopy, IndexModify)">Copy sash @(k + 1)</button>
</div>
</div>
}
}
}
}
</div> *@
</div>
<div class="col-sm-6">
<div class="row justify-content-between align-items-center">
<div class="col d-flex justify-content-start align-items-center">
<h6>Joints</h6>
</div>
<div class="col d-flex">
<div class="input-group mb-2 justify-content-center">
<button class="@ButtonJointCss(WebWindowComplex.Json.WindowConst.Joints.ANGLED)" @onclick="() => ChangeAllJoints(WebWindowComplex.Json.WindowConst.Joints.ANGLED)">Angled</button>
</div>
</div>
<div class="col-sm-6">
<div class="row justify-content-between align-items-center">
<div class="col d-flex justify-content-start align-items-center">
<h6 class="fw-bold">Joints</h6>
</div>
<div class="col d-flex">
<div class="input-group mb-2 justify-content-center">
<button class="@ButtonJointCss(WebWindowComplex.Json.WindowConst.Joints.ANGLED)" @onclick="() => ChangeAllJoints(WebWindowComplex.Json.WindowConst.Joints.ANGLED)">Angled</button>
</div>
</div>
<div class="col d-flex">
<div class="input-group mb-2 justify-content-center">
<button class="@ButtonJointCss(WebWindowComplex.Json.WindowConst.Joints.FULL_H)" @onclick="() => ChangeAllJoints(WebWindowComplex.Json.WindowConst.Joints.FULL_H)">Horizontal</button>
</div>
</div>
<div class="col d-flex">
<div class="input-group mb-2 justify-content-center">
<button class="@ButtonJointCss(WebWindowComplex.Json.WindowConst.Joints.FULL_V)" @onclick="() => ChangeAllJoints(WebWindowComplex.Json.WindowConst.Joints.FULL_V)">Vertical</button>
</div>
</div>
<div class="col d-flex">
<div class="input-group mb-2 justify-content-center">
<button class="@ButtonJointCss(WebWindowComplex.Json.WindowConst.Joints.FULL_H)" @onclick="() => ChangeAllJoints(WebWindowComplex.Json.WindowConst.Joints.FULL_H)">Horizontal</button>
</div>
@foreach (Joint joint in CurrSashDim.JointList)
</div>
<div class="col d-flex">
<div class="input-group mb-2 justify-content-center">
<button class="@ButtonJointCss(WebWindowComplex.Json.WindowConst.Joints.FULL_V)" @onclick="() => ChangeAllJoints(WebWindowComplex.Json.WindowConst.Joints.FULL_V)">Vertical</button>
</div>
</div>
</div>
@foreach (Joint joint in CurrSashDim.JointList)
{
<EditJoint CurrRec="joint" EC_Update="UpdateJoint"></EditJoint>
}
</div>
</div>
</div>
}
@* <div class="modal" tabindex="-1" style="display:block; background-color: rgba(10,10,10,.6);" role="dialog">
<div class="modal-dialog modal-dialog-centered modal-xl">
<div class="modal-content">
<div class="modal-header">
<div class="col-3 text-start fs-3">
Sash @(CurrSashGroup.SashList.Count == 1 ? "" : (IndexSash + 1))
</div>
@if (!(CurrAnta.AreaList[0] is Split))
{
<div class="col-3 fs-4">
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => CurrAnta.AddSplit()">Add split</button>
</div>
</div>
<div class="col-3 fs-4">
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm">Add inglesina</button>
</div>
</div>
}
<div class="col-3 text-end fs-4">
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" @onclick="ClosePopup">
</button>
</div>
</div>
<div class="modal-body">
<div class="row">
<div class="col-sm-6 my-2">
<div class="input-group mb-2">
<label class="input-group-text">Tipology</label>
<select class="form-select" @bind="@CurrSashDim.SelOpeningTypeIndex">
@foreach (var openingType in CurrSashDim.OpeningTypeList)
{
<option value=@(openingType.Id)>@(openingType.Name)</option>
}
</select>
</div>
<div class="input-group mb-2">
<span class="input-group-text">Dimension</span>
<InputDouble CssClass="form-control form-control text-end" Decimals="@CssDecimals()" @bind-Value="@CurrSashDim.dDimension"></InputDouble>
<select class="form-select" style="max-width:6rem; background-color:#e9ecef" @bind="@CurrSashDim.SelMeasureTypeIndex">
@foreach (var mType in CurrSashDim.MeasureTypeList)
{
<option value=@(mType.Id)>
@switch (mType.Name)
{
case "Absolut":
{
<span class="input-group-text">mm</span>
break;
}
case "Proportional":
{
<span class="input-group-text">*</span>
break;
}
case "Percentage":
{
<span class="input-group-text">%</span>
break;
}
}
</option>
}
</select>
</div>
<div class="d-flex justify-content-start fs-5 mb-2">
<div class="px-1">
<input class="form-check-input ml-auto" type="checkbox" name="Handle" checked="@CurrSashDim.bHasHandle" @onclick="() => RaiseChangeHandle(CurrSashDim, CurrSashGroup)">
</div>
<div class="px-2">
<label class="form-check-label fs-6 text-dark">Handle</label>
</div>
</div>
<div class="row d-flex justify-content-center align-items-center">
@for (int k = 0; k <= CurrSashGroup.SashList.Count - 1; k++)
{
<EditJoint CurrRec="joint" EC_Update="UpdateJoint"></EditJoint>
@if (k != IndexSash)
{
int IndexCopy = k;
int IndexModify = IndexSash;
<div class="col-md-12 col-lg-6 my-1">
<div class="input-group justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => RaiseCopyContentSash(IndexCopy, IndexModify)">Copy sash @(k + 1)</button>
</div>
</div>
}
}
</div>
</div>
<div class="col-sm-6">
<div class="row justify-content-between align-items-center">
<div class="col d-flex justify-content-start align-items-center">
<h6 class="fw-bold">Joints</h6>
</div>
<div class="col d-flex">
<div class="input-group mb-2 justify-content-center">
<button class="@ButtonJointCss(WebWindowComplex.Json.WindowConst.Joints.ANGLED)" @onclick="() => ChangeAllJoints(WebWindowComplex.Json.WindowConst.Joints.ANGLED)">Angled</button>
</div>
</div>
<div class="col d-flex">
<div class="input-group mb-2 justify-content-center">
<button class="@ButtonJointCss(WebWindowComplex.Json.WindowConst.Joints.FULL_H)" @onclick="() => ChangeAllJoints(WebWindowComplex.Json.WindowConst.Joints.FULL_H)">Horizontal</button>
</div>
</div>
<div class="col d-flex">
<div class="input-group mb-2 justify-content-center">
<button class="@ButtonJointCss(WebWindowComplex.Json.WindowConst.Joints.FULL_V)" @onclick="() => ChangeAllJoints(WebWindowComplex.Json.WindowConst.Joints.FULL_V)">Vertical</button>
</div>
</div>
</div>
@foreach (Joint joint in CurrSashDim.JointList)
{
<EditJoint CurrRec="joint" EC_Update="UpdateJoint"></EditJoint>
}
</div>
</div>
</div>
</div>
</div>
}
</div>
</div> *@
+55 -25
View File
@@ -12,7 +12,7 @@ namespace WebWindowComplex.Compo
/// <summary>
/// Sash group corrente
/// </summary>
[Parameter]
[CascadingParameter(Name = "CurrSashGroup")]
public Sash CurrSashGroup { get; set; } = null!;
/// <summary>
@@ -21,6 +21,12 @@ namespace WebWindowComplex.Compo
[Parameter]
public SashDimension CurrSashDim { get; set; } = null!;
/// <summary>
/// Sash dimension corrente
/// </summary>
[Parameter]
public bool EditMode { get; set; } = false;
/// <summary>
/// Indice della sash corrente
/// </summary>
@@ -28,7 +34,7 @@ namespace WebWindowComplex.Compo
public int IndexSash { get; set; } = 0;
/// <summary>
/// Evento per cambiare l'anta su cui è presente la maniglia
/// Evento per cambiare l'anta su cui presente la maniglia
/// </summary>
[Parameter]
public EventCallback<DataChangeHandle> EC_ChangeHandle { get; set; }
@@ -40,19 +46,25 @@ namespace WebWindowComplex.Compo
public EventCallback<SashDimension> EC_UpdateSashDim { get; set; }
/// <summary>
/// Evento per cambiare l'anta su cui è presente la maniglia
/// Evento per cambiare l'anta su cui presente la maniglia
/// </summary>
[Parameter]
public EventCallback<DataCopyContentSash> EC_CopyContentSash { get; set; }
/// <summary>
/// Evento per cambiare modalit di visualizzazione
/// </summary>
[Parameter]
public EventCallback<DataChangeMode> EC_EditView { get; set; }
/// <summary>
/// Anta corrente
/// </summary>
public Area CurrAnta
{
public Area CurrAnta
{
get
{
if(CurrSashGroup.AreaList[IndexSash] is Splitted)
if (CurrSashGroup.AreaList[IndexSash] is Splitted)
{
return CurrSashGroup.AreaList[IndexSash];
}
@@ -93,7 +105,7 @@ namespace WebWindowComplex.Compo
/// <returns></returns>
private async Task ChangeAllJoints(Json.WindowConst.Joints JointType)
{
foreach(var item in CurrSashDim.JointList)
foreach (var item in CurrSashDim.JointList)
item.SetSelJointType(JointType);
await EC_UpdateSashDim.InvokeAsync(CurrSashDim);
}
@@ -116,7 +128,7 @@ namespace WebWindowComplex.Compo
}
/// <summary>
/// Sollevo evento per cambiare l'anta su cui è presente la maniglia
/// Sollevo evento per cambiare l'anta su cui presente la maniglia
/// </summary>
/// <returns></returns>
private async Task RaiseChangeHandle(SashDimension sashDim, Sash currSash)
@@ -130,11 +142,12 @@ namespace WebWindowComplex.Compo
}
/// <summary>
/// Sollevo evento per cambiare l'anta su cui è presente la maniglia
/// Sollevo evento per cambiare l'anta su cui presente la maniglia
/// </summary>
/// <returns></returns>
private async Task RaiseCopyContentSash(int indexC, int indexM)
{
isOpen = !isOpen;
var Args = new DataCopyContentSash
{
currItem = CurrSashGroup,
@@ -144,16 +157,10 @@ namespace WebWindowComplex.Compo
await EC_CopyContentSash.InvokeAsync(Args);
}
private bool JointCollapsed { get; set; } = true;
private async Task changeCollapsed()
private bool isOpen = false;
private void ToggleDropdown()
{
JointCollapsed = !JointCollapsed;
}
private string jointCollapsedIcon
{
get => JointCollapsed ? "&darr;" : "&uarr;";
isOpen = !isOpen;
}
private string ButtonJointCss(WebWindowComplex.Json.WindowConst.Joints type)
@@ -172,17 +179,40 @@ namespace WebWindowComplex.Compo
View = 1,
Edit = 2
}
private ModeView mode = ModeView.View;
private void doEdit()
protected override void OnParametersSet()
{
mode = ModeView.Edit;
StateHasChanged();
if (EditMode)
mode = ModeView.Edit;
else
mode = ModeView.View;
}
protected void ClosePopup()
private ModeView mode { get; set; } = ModeView.View;
private void doEdit(int index)
{
mode = ModeView.View;
var args = new DataChangeMode
{
Edit = true,
IndexSashEdit = index,
IndexSashClose = -1
};
_ = EC_EditView.InvokeAsync(args);
}
protected void ClosePopup(int index)
{
var args = new DataChangeMode
{
Edit = false,
IndexSashEdit = -1,
IndexSashClose = index
};
_ = EC_EditView.InvokeAsync(args);
}
}
public class DataChangeMode {
public bool Edit { get; set; }
public int IndexSashEdit { get; set; }
public int IndexSashClose { get; set; }
}
public class DataChangeHandle
+3 -3
View File
@@ -2,7 +2,7 @@
<div class="card-body py-2">
<div class="d-flex justify-content-between align-items-center">
<div class="col d-flex justify-content-center">
<h5>Area split @(CurrSplittedList.Count > 1 ? (CurrSplittedList.IndexOf(CurrSplitted) + 1) : "")</h5>
<h5>Area split @(SplittedList.Count > 1 ? (SplittedList.IndexOf(CurrSplitted) + 1) : "")</h5>
</div>
<div class="col d-flex justify-content-center">
<div class="input-group mb-2 justify-content-center">
@@ -10,11 +10,11 @@
</div>
</div>
<div class="col d-flex justify-content-center">
@for (int j = 0; j < CurrSashList.Count; j++)
@for (int j = 0; j < SashList.Count; j++)
{
int Index = j;
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => RaiseCopySash(CurrSplitted,Index)">Copy Sash @(CurrSashList.Count == 1 ? "" : (Index + 1))</button>
<button class="btn btn-outline-secondary btn-sm" @onclick="() => RaiseCopySash(CurrSplitted,Index)">Copy Sash @(SashList.Count == 1 ? "" : (Index + 1))</button>
</div>
}
</div>
+4 -4
View File
@@ -11,8 +11,8 @@ namespace WebWindowComplex.Compo
/// <summary>
/// Lista delle sash
/// </summary>
[Parameter]
public List<Sash> CurrSashList { get; set; } = null;
[CascadingParameter(Name = "SashList")]
public List<Sash> SashList { get; set; } = null;
/// <summary>
/// Oggetto splitted corrente
@@ -23,8 +23,8 @@ namespace WebWindowComplex.Compo
/// <summary>
/// Lista degli Splitted
/// </summary>
[Parameter]
public List<Splitted> CurrSplittedList { get; set; } = null;
[CascadingParameter(Name = "SplittedList")]
public List<Splitted> SplittedList { get; set; } = null;
/// <summary>
/// Evento per copiare Sash
+1 -4
View File
@@ -47,12 +47,9 @@
{
@if (currSplitted.AreaList.First().Equals(CurrItem))
{
<AreaSplit CurrSashList="SashList"
CurrSplittedList="SplittedList"
CurrSplitted="currSplitted"
<AreaSplit CurrSplitted="currSplitted"
EC_AddSash="AddSash"
EC_CopySash="CopySash">
</AreaSplit>
}
}
+2 -2
View File
@@ -59,13 +59,13 @@ namespace WebWindowComplex.Compo
/// <summary>
/// Lista delle sash
/// </summary>
[Parameter]
[CascadingParameter(Name = "SashList")]
public List<Sash> SashList { get; set; } = null!;
/// <summary>
/// Lista degli Splitted
/// </summary>
[Parameter]
[CascadingParameter(Name = "SplittedList")]
public List<Splitted> SplittedList { get; set; } = null!;
+15 -12
View File
@@ -17,7 +17,7 @@
<div class="input-group my-2">
<label class="input-group-text">Shape</label>
<select class="form-select" @bind="@SelShapeIndex">
@foreach (var i in FrameWindow.ShapeList)
@foreach (var i in CurrFrameWindow.ShapeList)
{
<option value="@(i.Id)">@(i.Name)</option>
}
@@ -31,7 +31,7 @@
<div class="d-flex justify-content-start align-items-center">
<h6 class="fw-bold">Dimension</h6>
</div>
@foreach (FrameDimension dimension in FrameWindow.DimensionList)
@foreach (FrameDimension dimension in CurrFrameWindow.DimensionList)
{
<EditDimensions CurrRec="dimension" EC_Update="UpdateDim"></EditDimensions>
}
@@ -58,22 +58,22 @@
</div>
<div class="col d-flex">
<div class="input-group mb-2 justify-content-center">
<button class="@ButtonJointCss(Json.WindowConst.Joints.ANGLED)" @onclick="() => ChangeAllJoints(WebWindowComplex.Json.WindowConst.Joints.ANGLED, FrameWindow)">Angled</button>
<button class="@ButtonJointCss(Json.WindowConst.Joints.ANGLED)" @onclick="() => ChangeAllJoints(WebWindowComplex.Json.WindowConst.Joints.ANGLED, CurrFrameWindow)">Angled</button>
</div>
</div>
<div class="col d-flex">
<div class="input-group mb-2 justify-content-center">
<button class="@ButtonJointCss(Json.WindowConst.Joints.FULL_H)" @onclick="() => ChangeAllJoints(WebWindowComplex.Json.WindowConst.Joints.FULL_H, FrameWindow)">Horizontal</button>
<button class="@ButtonJointCss(Json.WindowConst.Joints.FULL_H)" @onclick="() => ChangeAllJoints(WebWindowComplex.Json.WindowConst.Joints.FULL_H, CurrFrameWindow)">Horizontal</button>
</div>
</div>
<div class="col d-flex">
<div class="input-group mb-2 justify-content-center">
<button class="@ButtonJointCss(Json.WindowConst.Joints.FULL_V)" @onclick="() => ChangeAllJoints(WebWindowComplex.Json.WindowConst.Joints.FULL_V, FrameWindow)">Vertical</button>
<button class="@ButtonJointCss(Json.WindowConst.Joints.FULL_V)" @onclick="() => ChangeAllJoints(WebWindowComplex.Json.WindowConst.Joints.FULL_V, CurrFrameWindow)">Vertical</button>
</div>
</div>
</div>
<div class="row">
@foreach (Joint joint in FrameWindow.JointList)
@foreach (Joint joint in CurrFrameWindow.JointList)
{
<EditJoint CurrRec="joint" EC_Update="UpdateJoint"></EditJoint>
}
@@ -88,7 +88,7 @@
<div class="row">
<div class="input-group mb-2">
<span class="input-group-text">Quantity</span>
<input type="number" class="form-control" @bind="@FrameWindow.BottomRailQty">
<input type="number" class="form-control" @bind="@CurrFrameWindow.BottomRailQty">
</div>
</div>
}
@@ -97,12 +97,15 @@
</div>
</div>
@if (!(FrameWindow.AreaList[0] is Split) || (SashList.Count == 0 && SplitList.Count == 0))
@if (!(CurrFrameWindow.AreaList[0] is Split) || (SashList.Count == 0 && SplitList.Count == 0))
{
<AreaFrame CurrFrameWindow="FrameWindow"
CurrSashList="SashList"
CurrSplitList="SplitList"
EC_AddSash="AddSash"
<AreaFrame EC_AddSash="AddSash"
EC_AddSplit="AddSplit">
</AreaFrame>
@* <Arame CurrFrameWindow="CurrFrameWindow"
CurrSashList="SashList"
CurrSplitList="SplitList"
EC_AddSash="AddSash"
EC_AddSplit="AddSplit">
</AreaFrame> *@
}
+15 -15
View File
@@ -52,19 +52,19 @@ namespace WebWindowComplex.Compo
/// <summary>
/// Frame corrente
/// </summary>
[Parameter]
public Frame FrameWindow { get; set; } = null!;
[CascadingParameter(Name = "CurrFrameWindow")]
public Frame CurrFrameWindow { get; set; } = null!;
/// <summary>
/// Lista di sash
/// </summary>
[Parameter]
[CascadingParameter(Name = "SashList")]
public List<Sash> SashList { get; set; } = null!;
/// <summary>
/// Lista di split
/// </summary>
[Parameter]
[CascadingParameter(Name = "SplitList")]
public List<Split> SplitList { get; set; } = null!;
#endregion Public Properties
@@ -73,20 +73,20 @@ namespace WebWindowComplex.Compo
protected int SelShapeIndex
{
get => FrameWindow.SelShapeIndex;
get => CurrFrameWindow.SelShapeIndex;
set
{
if (FrameWindow.SelShapeIndex != value)
if (CurrFrameWindow.SelShapeIndex != value)
{
FrameWindow.SelShapeIndex = value;
CurrFrameWindow.SelShapeIndex = value;
// richiesta reset dict shape
_ = EC_ReqResetDictShape.InvokeAsync(true);
foreach(var s in SashList)
{
s.SelHardwareFromId = "000000";
}
_ = EC_UpdateFrame.InvokeAsync(FrameWindow);
_ = EC_UpdateShape.InvokeAsync(FrameWindow);
_ = EC_UpdateFrame.InvokeAsync(CurrFrameWindow);
_ = EC_UpdateShape.InvokeAsync(CurrFrameWindow);
}
}
}
@@ -143,13 +143,13 @@ namespace WebWindowComplex.Compo
private async Task UpdateDim(FrameDimension updRec)
{
// cerco il record
var currRec = FrameWindow.DimensionList.FirstOrDefault(x => x.ParentFrame == updRec.ParentFrame && x.nIndex == updRec.nIndex);
var currRec = CurrFrameWindow.DimensionList.FirstOrDefault(x => x.ParentFrame == updRec.ParentFrame && x.nIndex == updRec.nIndex);
// lo aggiorno
if (updRec != null)
{
currRec = updRec;
await EC_UpdateShape.InvokeAsync(FrameWindow);
await EC_UpdateFrame.InvokeAsync(FrameWindow);
await EC_UpdateShape.InvokeAsync(CurrFrameWindow);
await EC_UpdateFrame.InvokeAsync(CurrFrameWindow);
}
}
@@ -161,18 +161,18 @@ namespace WebWindowComplex.Compo
private async Task UpdateJoint(Joint updRec)
{
// cerco il record
var currRec = FrameWindow.JointList.FirstOrDefault(x => x.ParentArea == updRec.ParentArea && x.nIndex == updRec.nIndex);
var currRec = CurrFrameWindow.JointList.FirstOrDefault(x => x.ParentArea == updRec.ParentArea && x.nIndex == updRec.nIndex);
// lo aggiorno
if (updRec != null)
{
currRec = updRec;
await EC_UpdateFrame.InvokeAsync(FrameWindow);
await EC_UpdateFrame.InvokeAsync(CurrFrameWindow);
}
}
private string ButtonJointCss(WebWindowComplex.Json.WindowConst.Joints type)
{
foreach (var item in FrameWindow.JointList)
foreach (var item in CurrFrameWindow.JointList)
{
if (!item.SelJointType.Equals(type))
return "btn btn-outline-secondary btn-sm";
+68 -87
View File
@@ -8,7 +8,7 @@
</div>
<div class="px-2">
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => RemoveArea(CurrItem)">Remove sash group</button>
<button class="btn btn-outline-secondary btn-sm" @onclick="() => RemoveArea(CurrSashGroup)">Remove sash group</button>
</div>
</div>
<div class="px-2">
@@ -21,7 +21,7 @@
<div class="col-md-12 col-lg-6">
<div class="input-group mb-2">
<span class="input-group-text">Qty sash</span>
<input type="number" class="form-control" @bind="@CurrItem.nSashQty">
<input type="number" class="form-control" @bind="@CurrSashGroup.nSashQty">
</div>
</div>
</div>
@@ -29,20 +29,18 @@
<div class="col-md-12 col-lg-6">
<div class="input-group mb-2">
<label class="input-group-text">Tipology</label>
<select class="form-select" @bind="@CurrItem.SelOrientationSashTypeIndex">
@foreach (var orientationSash in CurrItem.OrientationSashTypeList)
<select class="form-select" @bind="@CurrSashGroup.SelOrientationSashTypeIndex">
@foreach (var orientationSash in CurrSashGroup.OrientationSashTypeList)
{
<option value="@(orientationSash.Id)">@(orientationSash.Name)</option>
}
@* <option value="0">Vertical</option>
<option value="1">Horizontal</option> *@
</select>
</div>
</div>
<div class="col-md-12 col-lg-6">
<div class="input-group mb-2">
<span class="input-group-text">Qty bottom rail</span>
<input type="number" class="form-control" @bind="@CurrItem.SashBottomRailQty">
<input type="number" class="form-control" @bind="@CurrSashGroup.SashBottomRailQty">
</div>
</div>
</div>
@@ -56,7 +54,7 @@
</div>
<div class="input-group mb-2">
<label class="input-group-text">Family</label>
<select class="form-select" @bind="@CurrItem.SelFamilyHardware">
<select class="form-select" @bind="@CurrSashGroup.SelFamilyHardware">
@if (Sash.s_FamilyHardwareList == null || Sash.s_FamilyHardwareList.Count == 0)
{
<option value="000000">CUSTOM</option>
@@ -70,7 +68,7 @@
}
</select>
</div>
@if (string.IsNullOrEmpty(CurrItem.SashShape))
@if (string.IsNullOrEmpty(CurrSashGroup.SashShape))
{
<div class="input-group mb-2">
<label class="input-group-text">Type</label>
@@ -85,7 +83,7 @@
<label class="input-group-text">Type</label>
<select class="form-select" @bind="SelHwType">
<option value="000000">Custom HW</option>
@foreach (var hlItem in CurrItem.HardwareList)
@foreach (var hlItem in CurrSashGroup.HardwareList)
{
<option value="@hlItem.Id">@hlItem.Description</option>
}
@@ -94,86 +92,69 @@
}
</div>
<div class="col-md-12 col-lg-6">
<AreaHwOption CurrSash="CurrItem"
EC_UpdateHwOptCombo="UpdateOptCombo"
EC_UpdateHwOptText="UpdateOptText"
EC_FirstHwOptionList="FirstHwOptionList">
<AreaHwOption EC_UpdateHwOptCombo="UpdateOptCombo"
EC_UpdateHwOptText="UpdateOptText"
EC_FirstHwOptionList="FirstHwOptionList">
</AreaHwOption>
</div>
@* <div class="col-md-12 col-lg-6">
<div class="row justify-content-between align-items-center">
<div class="col d-flex justify-content-start align-items-center">
<h6 class="fw-bold">Joints</h6>
</div>
<div class="col d-flex">
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => ChangeAllJoints(WebWindowComplex.Json.WindowConst.Joints.ANGLED, CurrItem)">Angled</button>
</div>
</div>
<div class="col d-flex">
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => ChangeAllJoints(WebWindowComplex.Json.WindowConst.Joints.FULL_H, CurrItem)">Horizontal</button>
</div>
</div>
<div class="col d-flex">
<div class="input-group mb-2 justify-content-center">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => ChangeAllJoints(WebWindowComplex.Json.WindowConst.Joints.FULL_V, CurrItem)">Vertical</button>
</div>
</div>
</div>
@foreach (Joint joint in CurrItem.JointList)
{
<EditJoint CurrRec="joint" EC_Update="UpdateJoint"></EditJoint>
}
</div> *@
</div>
</div>
</div>
<div class="card shadow-sm rounded mb-4">
<div class="card-body py-2">
<div class="d-flex justify-content-between align-items-center">
<div class="px-2">
<h5>Measure type</h5>
</div>
<div class="px-2">
<div class="input-group mb-2 justify-content-center">
<button class="@ButtonMeasureCss(MeasureTypes.ABSOLUT)"
title="All measure in absolute"
@onclick="() => SetMeasureType(MeasureTypes.ABSOLUT)">
Absolute
</button>
</div>
</div>
<div class="px-2">
<button class="@ButtonMeasureCss(MeasureTypes.PROPORTIONAL)"
title="All measure in proportional">
Proportional
</button>
@* <button class="@ButtonMeasureCss(MeasureTypes.PROPORTIONAL)" @onclick="() => SetMeasureType(MeasureTypes.PROPORTIONAL)">Proportional</button>
*@ </div>
<div class="px-2">
<button class="@ButtonMeasureCss(MeasureTypes.PERCENTAGE)"
title="All measure in percentage"
@onclick="() => SetMeasureType(MeasureTypes.PERCENTAGE)">
Percentage
</button>
</div>
</div>
<div class="row">
@for (int i = 0; i < CurrItem.SashList.Count; i++)
{
<AreaSash CurrSashDim="CurrItem.SashList[i]"
CurrSashGroup="CurrItem"
IndexSash="i"
EC_ChangeHandle="ChangeHandle"
EC_UpdateSashDim="UpdateSashDimension"
EC_CopyContentSash="CopyContentSash">
</AreaSash>
}
</div>
</div>
</div>
<div class="card shadow-sm rounded mb-4">
<div class="card-body py-2">
<div class="d-flex justify-content-end">
<div class="dropdown">
<button class="btn btn-primary dropdown-toggle btn-sm" type="button" @onclick="ToggleDropdown">
Action
</button>
<ul class="dropdown-menu @(isOpen ? "show" : "")" style="min-width:5rem; max-width:10rem">
<li>
<button class="dropdown-item" @onclick="() => SetMeasureType(MeasureTypes.ABSOLUT)">
Absolute
</button>
</li>
<li>
<button class="dropdown-item">
Proportional
</button>
</li>
<li>
<button class="dropdown-item" @onclick="() => SetMeasureType(MeasureTypes.PERCENTAGE)">
Percentage
</button>
</li>
</ul>
</div>
</div>
<div class="row">
@for (int i = 0; i < CurrSashGroup.SashList.Count; i++)
{
@if (editMode && currSashDimEdit.Contains(i))
{
<div class="col-12 my-2">
<AreaSash CurrSashDim="CurrSashGroup.SashList[i]"
IndexSash="i"
EditMode="editMode"
EC_ChangeHandle="ChangeHandle"
EC_UpdateSashDim="UpdateSashDimension"
EC_CopyContentSash="CopyContentSash"
EC_EditView="EditView">
</AreaSash>
</div>
}
else if(currSashDimEdit.Count == 0)
{
<AreaSash CurrSashDim="CurrSashGroup.SashList[i]"
IndexSash="i"
EditMode="editMode"
EC_ChangeHandle="ChangeHandle"
EC_UpdateSashDim="UpdateSashDimension"
EC_CopyContentSash="CopyContentSash"
EC_EditView="EditView">
</AreaSash>
}
}
</div>
</div>
</div>
+32 -38
View File
@@ -17,14 +17,8 @@ namespace WebWindowComplex.Compo
/// <summary>
/// Sash corrente rispetto alla lista Sash
/// </summary>
[Parameter]
public Sash CurrItem { get; set; } = null!;
///// <summary>
///// Evento per cambiare tutti i Joints
///// </summary>
//[Parameter]
//public EventCallback<DataChangeJoints> EC_ChangeAllJoints { get; set; }
[CascadingParameter(Name = "CurrSashGroup")]
public Sash CurrSashGroup { get; set; } = null!;
/// <summary>
/// Evento per cambiare l'anta su cui è presente la maniglia
@@ -89,13 +83,13 @@ namespace WebWindowComplex.Compo
/// </summary>
protected string SelHwType
{
get => CurrItem.SelHardwareFromId;
get => CurrSashGroup.SelHardwareFromId;
set
{
if (CurrItem.SelHardwareFromId != value)
if (CurrSashGroup.SelHardwareFromId != value)
{
CurrItem.SelHardwareFromId = value;
_ = EC_UpdateSashHardware.InvokeAsync(CurrItem);
CurrSashGroup.SelHardwareFromId = value;
_ = EC_UpdateSashHardware.InvokeAsync(CurrSashGroup);
}
}
}
@@ -118,20 +112,21 @@ namespace WebWindowComplex.Compo
protected async Task SetMeasureType(MeasureTypes type)
{
foreach(var item in CurrItem.SashList)
isOpen = !isOpen;
foreach (var item in CurrSashGroup.SashList)
{
item.SetSelMeasureType(type);
}
await EC_UpdateSash.InvokeAsync(CurrItem);
await EC_UpdateSash.InvokeAsync(CurrSashGroup);
}
protected async Task UpdateSashDimension(SashDimension updateSD)
{
var currRec = CurrItem.SashList.Where(x => x.nSashId == updateSD.nSashId).FirstOrDefault();
var currRec = CurrSashGroup.SashList.Where(x => x.nSashId == updateSD.nSashId).FirstOrDefault();
if(currRec != null)
{
currRec = updateSD;
await EC_UpdateSash.InvokeAsync(CurrItem);
await EC_UpdateSash.InvokeAsync(CurrSashGroup);
}
}
@@ -157,6 +152,17 @@ namespace WebWindowComplex.Compo
await EC_CopyContentSash.InvokeAsync(Args);
}
private bool editMode = false;
private List<int> currSashDimEdit = new List<int>();
private void EditView(DataChangeMode args)
{
editMode = args.Edit;
if(args.IndexSashEdit != -1)
currSashDimEdit.Add(args.IndexSashEdit);
if (args.IndexSashClose != -1)
currSashDimEdit.Remove(args.IndexSashClose);
}
/// <summary>
/// Sollevo evento per tornare alla pagina Tree
/// </summary>
@@ -165,23 +171,6 @@ namespace WebWindowComplex.Compo
_ = EC_ReqClose.InvokeAsync(true);
}
///// <summary>
///// Report aggiornamento joint
///// </summary>
///// <param name="updRec"></param>
///// <returns></returns>
//private async Task UpdateJoint(Joint updRec)
//{
// // cerco il record
// var currRec = CurrItem.JointList.FirstOrDefault(x => x.ParentArea == updRec.ParentArea && x.nIndex == updRec.nIndex);
// // lo aggiorno
// if (updRec != null)
// {
// currRec = updRec;
// await EC_UpdateSash.InvokeAsync(CurrItem);
// }
//}
/// <summary>
/// Report aggiornamento Option Combo
/// </summary>
@@ -190,12 +179,12 @@ namespace WebWindowComplex.Compo
private async Task UpdateOptCombo(AGBOptionCombo updRec)
{
// cerco il record
var currRec = CurrItem.HwOptionList.FirstOrDefault(x => x.sName == updRec.sName && x.sDescription == updRec.sDescription);
var currRec = CurrSashGroup.HwOptionList.FirstOrDefault(x => x.sName == updRec.sName && x.sDescription == updRec.sDescription);
// lo aggiorno
if (updRec != null)
{
currRec = updRec;
await EC_UpdateSashHardware.InvokeAsync(CurrItem);
await EC_UpdateSashHardware.InvokeAsync(CurrSashGroup);
}
}
@@ -207,12 +196,12 @@ namespace WebWindowComplex.Compo
private async Task UpdateOptText(AGBOptionText updRec)
{
// cerco il record
var currRec = CurrItem.HwOptionList.FirstOrDefault(x => x.sName == updRec.sName && x.sDescription == updRec.sDescription);
var currRec = CurrSashGroup.HwOptionList.FirstOrDefault(x => x.sName == updRec.sName && x.sDescription == updRec.sDescription);
// lo aggiorno
if (updRec != null)
{
currRec = updRec;
await EC_UpdateSashHardware.InvokeAsync(CurrItem);
await EC_UpdateSashHardware.InvokeAsync(CurrSashGroup);
}
}
@@ -228,7 +217,7 @@ namespace WebWindowComplex.Compo
private string ButtonMeasureCss(MeasureTypes type)
{
foreach(var item in CurrItem.SashList)
foreach(var item in CurrSashGroup.SashList)
{
if (!item.SelMeasureType.Equals(type))
return "btn btn-outline-secondary btn-sm";
@@ -236,6 +225,11 @@ namespace WebWindowComplex.Compo
return "btn btn-secondary btn-sm";
}
private bool isOpen = false;
private void ToggleDropdown()
{
isOpen = !isOpen;
}
#endregion Private Methods
}
}
-4
View File
@@ -38,10 +38,6 @@
{
<option value=@(shapeType.Id)>@(shapeType.Name)</option>
}
@* <option value="0">Vertical</option>
<option value="1">Horizontal</option>
<option value="2">Grid</option>
<option value="3">Custom</option> *@
</select>
</div>
</div>
+4 -4
View File
@@ -6,13 +6,13 @@ namespace WebWindowComplex.Compo
public partial class CardSplit
{
/// <summary>
/// Indice del fill corrente rispetto alla lista fill
/// Indice dello split corrente rispetto alla lista split
/// </summary>
[Parameter]
public int CurrIndex { get; set; } = 0;
/// <summary>
/// Fill corrente rispetto alla lista fill
/// Split corrente rispetto alla lista split
/// </summary>
[Parameter]
public Split CurrItem { get; set; } = null!;
@@ -20,13 +20,13 @@ namespace WebWindowComplex.Compo
/// <summary>
/// Lista di sash
/// </summary>
[Parameter]
[CascadingParameter(Name = "SashList")]
public List<Sash> SashList { get; set; } = null!;
/// <summary>
/// Lista di split
/// </summary>
[Parameter]
[CascadingParameter(Name = "SplitList")]
public List<Split> SplitList { get; set; } = null!;
/// <summary>
+33 -19
View File
@@ -135,13 +135,17 @@ namespace WebWindowComplex.Models
{
double dLastDimension = 0;
SashDimension itemDelete = null;
double deleteDim;
for (var SplitIndex = m_SashList.Count - 1; SplitIndex >= value; SplitIndex += -1)
{
//dLastDimension += m_SashList[SplitIndex].dDimension;
itemDelete = m_SashList[SplitIndex];
SashList.RemoveAt(SplitIndex);
}
double deleteDim = itemDelete.ConvertDimension(itemDelete.SelMeasureType, m_SashList[SashList.Count - 1].SelMeasureType, widthTot);
if (!itemDelete.SelMeasureType.Equals(m_SashList[SashList.Count - 1].SelMeasureType))
deleteDim = itemDelete.ConvertDimension(itemDelete.SelMeasureType, m_SashList[SashList.Count - 1].SelMeasureType, widthTot);
else
deleteDim = itemDelete.dDimension;
//dLastDimension += m_SashList[SashList.Count - 1].dDimension;
dLastDimension = deleteDim + m_SashList[SashList.Count - 1].dDimension;
SashList[SashList.Count - 1].SetDimension(dLastDimension);
@@ -571,23 +575,30 @@ namespace WebWindowComplex.Models
if (area is Split)
{
Split split = (Split)area;
switch (split.SplitVertList.ElementAt(i).SelMeasureType)
if(split.SplitVertList.Count > 0)
{
case MeasureTypes.ABSOLUT:
{
risultato = CalculateWidthSashGroup(item, split.SplitVertList.ElementAt(i).dDimension);
break;
}
case MeasureTypes.PROPORTIONAL:
{
//risultato = CalculateWidthSashGroup(item, split.SplitVertList.ElementAt(i).dDimension);
break;
}
case MeasureTypes.PERCENTAGE:
{
risultato = CalculateWidthSashGroup(item, split.SplitVertList.ElementAt(i).dDimension * width / 100);
break;
}
switch (split.SplitVertList.ElementAt(i).SelMeasureType)
{
case MeasureTypes.ABSOLUT:
{
risultato = CalculateWidthSashGroup(item, split.SplitVertList.ElementAt(i).dDimension);
break;
}
case MeasureTypes.PROPORTIONAL:
{
//risultato = CalculateWidthSashGroup(item, split.SplitVertList.ElementAt(i).dDimension);
break;
}
case MeasureTypes.PERCENTAGE:
{
risultato = CalculateWidthSashGroup(item, split.SplitVertList.ElementAt(i).dDimension * width / 100);
break;
}
}
}
else
{
risultato = CalculateWidthSashGroup(item, width);
}
if (risultato != -1)
return risultato;
@@ -828,8 +839,11 @@ namespace WebWindowComplex.Models
case HwOptionTypes.COMBO:
{
AGBOptionCombo OptCombo = (AGBOptionCombo)HwOption;
var selValue = OptCombo.ValueList.Where(x => x.sValue == selHwOption).First();
OptCombo.sValue = selValue;
var selValue = OptCombo.ValueList.Where(x => x.sValue == selHwOption).FirstOrDefault();
if (selValue != null)
OptCombo.sValue = selValue;
else
OptCombo.sValue = OptCombo.ValueList.First();
break;
}
case HwOptionTypes.TEXT:
+55 -47
View File
@@ -21,7 +21,7 @@
</div>
</div>
}
else if (listErrLink != null && listErrLink.Count > 0)
@* else if (listErrLink != null && listErrLink.Count > 0)
{
<div class="alert alert-danger">
<div class="fs-3">Errore configurazione:</div>
@@ -34,7 +34,7 @@
</ul>
</div>
</div>
}
} *@
else
{
<div class="col-md-12 col-lg-6 d-flex flex-column">
@@ -78,17 +78,20 @@
{
m_PreviousWindow = m_CurrWindow;
}
<CardFrame FrameWindow="FrameWindow"
SashList="m_SashList"
SplitList="m_SplitList"
EC_ChangeAllJoints="ChangeAllJoints"
EC_AddSash="() => AddSashToFrame(FrameWindow!)"
EC_AddSplit="() => AddSplitToFrame(FrameWindow!)"
EC_ReqClose="ReturnTree"
EC_ReqResetDictShape="ReqResetDict"
EC_UpdateShape="UpdateShape"
EC_UpdateFrame="UpdateFrame">
</CardFrame>
<CascadingValue Value="FrameWindow" Name="CurrFrameWindow">
<CascadingValue Value="m_SashList" Name="SashList">
<CascadingValue Value="m_SplitList" Name="SplitList">
<CardFrame EC_ChangeAllJoints="ChangeAllJoints"
EC_AddSash="() => AddSashToFrame(FrameWindow!)"
EC_AddSplit="() => AddSplitToFrame(FrameWindow!)"
EC_ReqClose="ReturnTree"
EC_ReqResetDictShape="ReqResetDict"
EC_UpdateShape="UpdateShape"
EC_UpdateFrame="UpdateFrame">
</CardFrame>
</CascadingValue>
</CascadingValue>
</CascadingValue>
}
else if (currStep == CompileStep.Split)
{
@@ -98,16 +101,18 @@
}
else
{
<CardSplit SashList="m_SashList"
SplitList="m_SplitList"
CurrIndex="currSplit"
CurrItem="SplitList[currSplit]"
EC_SwapTwoAree="SwapTwoAree"
EC_RemoveArea="RemoveArea"
EC_ReqResetDictShape="ReqResetDict"
EC_ChangeStartVert="changeStartVert"
EC_ReqClose="ReturnTree">
</CardSplit>
<CascadingValue Value="m_SashList" Name="SashList">
<CascadingValue Value="m_SplitList" Name="SplitList">
<CardSplit CurrIndex="currSplit"
CurrItem="SplitList[currSplit]"
EC_SwapTwoAree="SwapTwoAree"
EC_RemoveArea="RemoveArea"
EC_ReqResetDictShape="ReqResetDict"
EC_ChangeStartVert="changeStartVert"
EC_ReqClose="ReturnTree">
</CardSplit>
</CascadingValue>
</CascadingValue>
}
}
else if (currStep == CompileStep.Sash)
@@ -119,20 +124,21 @@
else
{
<CascadingValue Value="currLoading" Name="IsLoading">
<CardSashGroup CurrIndex="currSash"
CurrItem="SashList[currSash]"
SashList="SashList"
EC_ChangeHandle="ChangeHandle"
EC_CopyContentSash="CopyContentSash"
EC_RemoveArea="RemoveArea"
EC_UpdateSash="UpdateSash"
EC_UpdateSashHardware="UpdateHwOptions"
EC_CallFirstHwOpt="CallFirstHwOpt"
EC_ReqResetDictShape="ReqResetDict"
EC_ReqClose="ReturnTree">
</CardSashGroup>
<CascadingValue Value="SashList[currSash]" Name="CurrSashGroup">
<CardSashGroup CurrIndex="currSash"
SashList="SashList"
EC_ChangeHandle="ChangeHandle"
EC_CopyContentSash="CopyContentSash"
EC_RemoveArea="RemoveArea"
EC_UpdateSash="UpdateSash"
EC_UpdateSashHardware="UpdateHwOptions"
EC_CallFirstHwOpt="CallFirstHwOpt"
EC_ReqResetDictShape="ReqResetDict"
EC_ReqClose="ReturnTree">
</CardSashGroup>
</CascadingValue>
</CascadingValue>
}
}
}
else if (currStep == CompileStep.Fill)
{
@@ -142,17 +148,19 @@
}
else
{
<CardFill CurrIndex="currFill"
CurrItem="FillList[currFill]"
FillList="m_FillList"
SashList="m_SashList"
SplittedList="m_SplittedList"
EC_ChangeAllType="ChangeAllFill"
EC_ChangeType="ChangeOneFill"
EC_AddSash="AddSashIntoSplit"
EC_CopySash="CopySash"
EC_ReqClose="ReturnTree">
</CardFill>
<CascadingValue Value="m_SashList" Name="SashList">
<CascadingValue Value="m_SplittedList" Name="SplittedList">
<CardFill CurrIndex="currFill"
CurrItem="FillList[currFill]"
FillList="m_FillList"
EC_ChangeAllType="ChangeAllFill"
EC_ChangeType="ChangeOneFill"
EC_AddSash="AddSashIntoSplit"
EC_CopySash="CopySash"
EC_ReqClose="ReturnTree">
</CardFill>
</CascadingValue>
</CascadingValue>
}
}
else if (currStep == CompileStep.General)
+32 -10
View File
@@ -1,13 +1,12 @@
using Egw.Window.Data;
using Microsoft.AspNetCore.Components;
using Newtonsoft.Json;
using System.Reflection.Metadata;
using WebWindowComplex.Compo;
using WebWindowComplex.DTO;
using WebWindowComplex.Json;
using WebWindowComplex.Models;
using static WebWindowComplex.LayoutConst;
using static WebWindowComplex.Json.WindowConst;
using static WebWindowComplex.LayoutConst;
namespace WebWindowComplex
{
@@ -736,13 +735,36 @@ namespace WebWindowComplex
{
listErrLink.Add("Window", $"Deserializing Error:{Environment.NewLine}{ex}");
// uso un oggetto "basico" per non fermarmi
WindowFromJson = new JsonWindow("", "", "", "");
List<JsonArea> AreaList = new List<JsonArea>();
JsonFrame baseFrame = new JsonFrame();
baseFrame.DimensionList.Add(new JsonFrameDimension(0, "Width", 800));
baseFrame.DimensionList.Add(new JsonFrameDimension(0, "Height", 1200));
AreaList.Add(baseFrame);
WindowFromJson.AreaList = AreaList;
//string jwd = "{\r\n \"ProfilePath\": \"Profilo78\",\r\n \"Material\": \"Pino\",\r\n \"ColorMaterial\": \"Black\",\r\n \"Glass\": \"Vetro BE 2S 4T/16/4T\",\r\n \"AreaList\": [\r\n {\r\n \"Shape\": \"RECTANGLE\",\r\n \"DimensionList\": [\r\n {\r\n \"Index\": 1,\r\n \"Name\": \"Width\",\r\n \"Value\": 800.0\r\n },\r\n {\r\n \"Index\": 2,\r\n \"Name\": \"Height\",\r\n \"Value\": 1200.0\r\n }\r\n ],\r\n \"JointList\": [\r\n {\r\n \"Index\": 1,\r\n \"JointType\": \"FULL_H\"\r\n },\r\n {\r\n \"Index\": 2,\r\n \"JointType\": \"FULL_H\"\r\n },\r\n {\r\n \"Index\": 3,\r\n \"JointType\": \"FULL_H\"\r\n },\r\n {\r\n \"Index\": 4,\r\n \"JointType\": \"FULL_H\"\r\n }\r\n ],\r\n \"BottomRail\": false,\r\n \"BottomRailQty\": 0,\r\n \"GroupId\": 1,\r\n \"AreaList\": [\r\n {\r\n \"FillType\": \"GLASS\",\r\n \"GroupId\": 7,\r\n \"AreaList\": [],\r\n \"AreaType\": \"FILL\"\r\n }\r\n ],\r\n \"AreaType\": \"FRAME\"\r\n }\r\n ]\r\n}";
//WindowFromJson = JsonConvert.DeserializeObject<JsonWindow>(jwd, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", "");
//setCurrWindow(WindowFromJson);
//await DoPreviewSvg(true);
Window window = new Window();
Frame frame = new Frame(null, window);
List<FrameDimension> DimensionList = new List<FrameDimension>
{
new FrameDimension(frame, 1, "Width", 800, false),
new FrameDimension(frame, 1, "Height", 1200, true)
};
List<Joint> JointList = new List<Joint>
{
new Joint(frame, 1, Joints.FULL_H),
new Joint(frame, 2, Joints.FULL_H),
new Joint(frame, 3, Joints.FULL_H),
new Joint(frame, 4, Joints.FULL_H)
};
JsonWindow jsonWindow = new JsonWindow("Profilo78", "Pino", "Black", "Vetro BE 2S 4T/16/4T");
JsonFrame jsonFrame = new JsonFrame(Shapes.RECTANGLE, false, 0, 1);
jsonWindow.AreaList.Add(jsonFrame);
foreach (var Dimension in DimensionList)
jsonFrame.DimensionList.Add(Dimension.Serialize());
foreach (var Joint in JointList)
jsonFrame.JointList.Add(Joint.Serialize());
jsonFrame.AreaList.Add(Fill.CreateFill(frame, FillTypes.GLASS).Serialize(true));
string jwd = JsonConvert.SerializeObject(jsonWindow);
WindowFromJson = JsonConvert.DeserializeObject<JsonWindow>(jwd, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", "");
setCurrWindow(WindowFromJson);
await DoPreviewSvg(true);
}
}
else
@@ -759,7 +781,7 @@ namespace WebWindowComplex
if (updRequested)
{
// se mancasse dizionario forme chiamo quello
if (LiveData.DictShape.Count == 0)
if (LiveData.DictShape.Count == 0 && listErrLink.Count == 0)
{
if (firstDisplay && isRendered)
{
+6 -1
View File
@@ -6,7 +6,7 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>2.7.11.2017</Version>
<Version>2.7.11.2414</Version>
<Authors>Annamaria Sassi</Authors>
<Company>Egalware</Company>
<Description>Componente gestione Configurazioni avanzate Window per LUX</Description>
@@ -144,6 +144,11 @@
@@ -6,7 +6,7 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>2.7.11.2017</Version>
<Version>2.7.11.2414</Version>
<Authors>Annamaria Sassi</Authors>
<Company>Egalware</Company>
<Description>Componente gestione JWD per LUX</Description>
@@ -223,5 +223,6 @@