- aggiunto bottone di reset dati window
- aggiunti bottoni per modificare i 4 Joint in contemporanea
This commit is contained in:
@@ -17,8 +17,3 @@ else
|
||||
</WebWindowMaker>
|
||||
}
|
||||
|
||||
@if (m_CurrArgs.GetValueOrDefault("Jwd") != null)
|
||||
{
|
||||
<p> @m_CurrArgs["Jwd"]</p>
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>2.7.8.2016</Version>
|
||||
<Version>2.7.8.2517</Version>
|
||||
<Authors>Annamaria Sassi</Authors>
|
||||
<Company>Egalware</Company>
|
||||
<Description>Componente gestione JWD per LUX</Description>
|
||||
@@ -123,6 +123,17 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -39,9 +39,13 @@
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-6 d-grid gap-2 d-md-flex justify-content-md-end">
|
||||
<button class="btn btn-lg btn-primary btn-sm" @onclick="DoSave">Save</button>
|
||||
<button class="btn btn-lg btn-primary btn-sm" @onclick="DoPreviewSvg">Preview Svg</button>
|
||||
<button class="btn btn-lg btn-primary btn-sm" @onclick="DoClose">Close</button>
|
||||
<button class="btn btn-lg btn-primary" style="font-size: 1rem;" @onclick="DoSave">Save</button>
|
||||
@* <button class="btn btn-lg btn-primary btn-sm" @onclick="DoPreviewSvg">Preview Svg</button> *@
|
||||
@if(currStep != CompileStep.Template)
|
||||
{
|
||||
<button class="btn btn-lg btn-primary" style="font-size: 1rem;" @onclick="DoReset">Reset</button>
|
||||
}
|
||||
<button class="btn btn-lg btn-primary" style="font-size: 1rem;" @onclick="DoClose">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -50,7 +54,7 @@
|
||||
@if (currStep == CompileStep.Template)
|
||||
{
|
||||
<table class="table table-hover align-middle">
|
||||
<thead class="table-light fs-5">
|
||||
<thead class="fs-5">
|
||||
<tr>
|
||||
<th scope="col">#</th>
|
||||
<th scope="col" class="col-4">Image</th>
|
||||
@@ -76,9 +80,13 @@
|
||||
}
|
||||
@if (currStep == CompileStep.Frame)
|
||||
{
|
||||
@if(m_CurrWindow != null)
|
||||
{
|
||||
m_PreviousWindow = m_CurrWindow;
|
||||
}
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="text-start p-1 display-4 w-50">
|
||||
<div class="row col-sm-6">
|
||||
<div class="text-start p-1 display-4">
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text" for="FrameShape">Shape</label>
|
||||
<select class="form-select" id="FrameShape" @bind="@FrameWindow.SelShapeIndex">
|
||||
@@ -99,7 +107,7 @@
|
||||
{
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text" id="NameDimFrame@(FrameWindow.DimensionList.IndexOf(dimension) + 1)">@dimension.sName</span>
|
||||
<input type="number" class="form-control" aria-label="@dimension.dValue" min="600" max="4000" @bind="@dimension.dValue" >
|
||||
<input type="number" class="form-control" aria-label="@dimension.dValue" @bind:get="@dimension.dValue" @bind:set="((e) => OnInput(dimension, e))" min="600" max="4000" step="10">
|
||||
<span class="input-group-text">mm</span>
|
||||
</div>
|
||||
}
|
||||
@@ -107,7 +115,18 @@
|
||||
</div>
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5 class="card-title">Joints frame</h5>
|
||||
<h5 class="card-title m-0">Frame joints</h5>
|
||||
<div class="row p-0 m-0 text-center">
|
||||
<div class="col">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => AllJointsFrame(1, 0)">Angled</button>
|
||||
</div>
|
||||
<div class="col">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => AllJointsFrame(2, 0)">Horizontal</button>
|
||||
</div>
|
||||
<div class="col">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => AllJointsFrame(3, 0)">Vertical</button>
|
||||
</div>
|
||||
</div>
|
||||
@foreach (Joint joint in FrameWindow.JointList)
|
||||
{
|
||||
<div class="input-group mb-2">
|
||||
@@ -307,7 +326,7 @@
|
||||
<div class="input-group mb-2">
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text" id="NumberSash@(SashList.IndexOf(item) + 1)">Number</span>
|
||||
<input type="number" class="form-control" aria-label="NumberSash" min="1" max="8" @bind="@item.nSashQty">
|
||||
<input type="number" class="form-control" aria-label="NumberSash@(SashList.IndexOf(item) + 1)" min="1" max="8" @bind="@item.nSashQty">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -489,6 +508,17 @@
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5 class="card-title">Sash joints</h5>
|
||||
<div class="row p-0 m-0 text-center">
|
||||
<div class="col">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => AllJointsFrame(1, 1)">Angled</button>
|
||||
</div>
|
||||
<div class="col">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => AllJointsFrame(2, 1)">Horizontal</button>
|
||||
</div>
|
||||
<div class="col">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => AllJointsFrame(3, 1)">Vertical</button>
|
||||
</div>
|
||||
</div>
|
||||
@foreach (Joint joint in item.JointList)
|
||||
{
|
||||
<div class="input-group mb-2">
|
||||
@@ -512,8 +542,8 @@
|
||||
else if (currStep == CompileStep.Fill)
|
||||
{
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="text-start p-1 display-4 w-50">
|
||||
<div class="row col-sm-6">
|
||||
<div class="text-start p-1 display-4 ">
|
||||
@foreach (var Fill in FillList)
|
||||
{
|
||||
<div class="border mb-2">
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.AspNetCore.Components.Web;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Reflection.Metadata;
|
||||
using WebWindowConfigurator.DTO;
|
||||
using WebWindowConfigurator.Json;
|
||||
@@ -42,6 +43,16 @@ namespace WebWindowConfigurator
|
||||
}
|
||||
m_CurrWindow = WindowFromJson.Deserialize();
|
||||
m_CurrWindow.OnPreview += M_CurrWindow_OnPreview;
|
||||
// recupero dimensioni Frame e Joint Frame della finestra precedente
|
||||
if(m_PreviousWindow != null)
|
||||
{
|
||||
m_CurrWindow.AreaList[0].DimensionList[0] = m_PreviousWindow.AreaList[0].DimensionList[0];
|
||||
m_CurrWindow.AreaList[0].DimensionList[1] = m_PreviousWindow.AreaList[0].DimensionList[1];
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
m_CurrWindow.AreaList[0].JointList[i] = m_PreviousWindow.AreaList[0].JointList[i];
|
||||
}
|
||||
}
|
||||
m_FillList = new List<Fill>();
|
||||
m_SashList = new List<Sash>();
|
||||
m_SplitList = new List<Split>();
|
||||
@@ -148,15 +159,18 @@ namespace WebWindowConfigurator
|
||||
/// <returns></returns>
|
||||
protected async Task changeHandle(SashDimension sashDim)
|
||||
{
|
||||
foreach (SashDimension item in SashList[0].SashList)
|
||||
if(m_SashList[0].AreaList.Count < 3)
|
||||
{
|
||||
if (item.Equals(sashDim))
|
||||
foreach (SashDimension item in SashList[0].SashList)
|
||||
{
|
||||
item.bHasHandle = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
item.bHasHandle = false;
|
||||
if (item.Equals(sashDim))
|
||||
{
|
||||
item.bHasHandle = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
item.bHasHandle = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
await Task.Delay(1);
|
||||
@@ -184,6 +198,27 @@ namespace WebWindowConfigurator
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo di reset dei dati a quelli del template
|
||||
/// </summary>
|
||||
protected async Task DoReset()
|
||||
{
|
||||
JsonWindow WindowFromJson = JsonConvert.DeserializeObject<JsonWindow>(m_SelTemplate.JWD, new PolymorphicJsonConverter()) ?? new JsonWindow("");
|
||||
if (m_CurrWindow != null)
|
||||
{
|
||||
m_CurrWindow.OnPreview -= M_CurrWindow_OnPreview;
|
||||
m_CurrWindow = null;
|
||||
}
|
||||
m_CurrWindow = WindowFromJson.Deserialize();
|
||||
m_CurrWindow.OnPreview += M_CurrWindow_OnPreview;
|
||||
m_FillList = new List<Fill>();
|
||||
m_SashList = new List<Sash>();
|
||||
m_SplitList = new List<Split>();
|
||||
// popolo le liste Fill, Sash e Split
|
||||
CreateWindowsList(m_CurrWindow.AreaList[0]);
|
||||
await DoPreviewSvg();
|
||||
}
|
||||
|
||||
// Ancora da fare..
|
||||
protected async Task DoSave()
|
||||
{
|
||||
@@ -250,6 +285,58 @@ namespace WebWindowConfigurator
|
||||
}
|
||||
}
|
||||
|
||||
// Utilizzo di min e max in input form (WIP)
|
||||
private async Task OnInput(FrameDimension item, double e)
|
||||
{
|
||||
if (e > 4000)
|
||||
{
|
||||
item.dValue = 4000;
|
||||
}
|
||||
else if (e < 600)
|
||||
{
|
||||
item.dValue = 600;
|
||||
}
|
||||
else
|
||||
{
|
||||
item.dValue = e;
|
||||
}
|
||||
StateHasChanged();
|
||||
await DoPreviewSvg();
|
||||
}
|
||||
/// <summary>
|
||||
/// Metodo per settare tutti i Joints di Frame o Sash come ANGLED o FULL_H o FULL_V
|
||||
/// </summary>
|
||||
/// <param name="int_type"> tipo di giunzione (ANGLED o FULL_H o FULL_V)</param>
|
||||
/// <param name="int_place"> oggetto a cui essere applicato (Frame o Sash)</param>
|
||||
/// <returns></returns>
|
||||
private async Task AllJointsFrame(int int_type, int int_place)
|
||||
{
|
||||
Joints type = Joints.ANGLED;
|
||||
if (int_type == 2)
|
||||
{
|
||||
type = Joints.FULL_H;
|
||||
}
|
||||
else if (int_type == 3)
|
||||
{
|
||||
type = Joints.FULL_V;
|
||||
}
|
||||
if(int_place == 0)
|
||||
{
|
||||
foreach (Joint joint in FrameWindow.JointList)
|
||||
{
|
||||
joint.SetSelJointType(type);
|
||||
}
|
||||
}
|
||||
else if(int_place == 1)
|
||||
{
|
||||
foreach (Joint joint in m_SashList[0].JointList)
|
||||
{
|
||||
joint.SetSelJointType(type);
|
||||
}
|
||||
}
|
||||
await DoPreviewSvg();
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
@@ -266,10 +353,10 @@ namespace WebWindowConfigurator
|
||||
|
||||
private enum positionJoints
|
||||
{
|
||||
BL=0,
|
||||
BR=1,
|
||||
TR,
|
||||
TL
|
||||
BL=0, // Bottom Left
|
||||
BR=1, // Bottom Right
|
||||
TR, // Top Right
|
||||
TL // Top Left
|
||||
}
|
||||
|
||||
#endregion Private Fields
|
||||
@@ -278,6 +365,8 @@ namespace WebWindowConfigurator
|
||||
|
||||
private Window? m_CurrWindow { get; set; } = null;
|
||||
|
||||
private Window? m_PreviousWindow { get; set; } = null;
|
||||
|
||||
private Template m_SelTemplate { get; set; } = null!;
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
Reference in New Issue
Block a user