- aggiunto componente configuratore con ingresso JWD
- migliorato aggiunta anta e split
This commit is contained in:
@@ -11,6 +11,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebWindowConfigurator", "We
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebAedificaConfigurator", "WebAedificaConfigurator\WebAedificaConfigurator.csproj", "{BD1F43E8-BE5F-469E-9552-C98CA8639A06}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebWindowJWD", "WebWindowJWD\WebWindowJWD.csproj", "{D32E55D6-8C37-477F-8065-4020EB27900E}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -33,6 +35,10 @@ Global
|
||||
{BD1F43E8-BE5F-469E-9552-C98CA8639A06}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{BD1F43E8-BE5F-469E-9552-C98CA8639A06}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{BD1F43E8-BE5F-469E-9552-C98CA8639A06}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{D32E55D6-8C37-477F-8065-4020EB27900E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D32E55D6-8C37-477F-8065-4020EB27900E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D32E55D6-8C37-477F-8065-4020EB27900E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D32E55D6-8C37-477F-8065-4020EB27900E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -18,6 +18,11 @@
|
||||
<span class="bi bi-plus-square-fill-nav-menu" aria-hidden="true"></span> Test Compo + Serv
|
||||
</NavLink>
|
||||
</div>
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="EditJWD">
|
||||
<span class="bi bi-plus-square-fill-nav-menu" aria-hidden="true"></span> EditJWD
|
||||
</NavLink>
|
||||
</div>
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="Aedifica">
|
||||
<span class="bi bi-plus-square-fill-nav-menu" aria-hidden="true"></span> Aedifica
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
@page "/EditJWD"
|
||||
@rendermode InteractiveServer
|
||||
|
||||
<PageTitle>EditJWD</PageTitle>
|
||||
|
||||
|
||||
<WebWindowJWDInput EC_OnUpdate="SaveJWD"
|
||||
LiveSVG="@currSvg"
|
||||
CurrJwd="@InitialJwd">
|
||||
</WebWindowJWDInput>
|
||||
@@ -0,0 +1,144 @@
|
||||
using EgwCoreLib.Lux.Core;
|
||||
using EgwCoreLib.Lux.Data.Services;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Newtonsoft.Json;
|
||||
using System.Security.AccessControl;
|
||||
using WebWindowConfigurator;
|
||||
using WebWindowConfigurator.DTO;
|
||||
|
||||
namespace Test.UI.Components.Pages
|
||||
{
|
||||
public partial class EditJWD : IDisposable
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public string InitialJwd = "";
|
||||
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
DLService.CalcDonePipe.EA_NewMessage -= CalcDonePipe_EA_NewMessage;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected string currJwd = "";
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
[Inject]
|
||||
protected IConfiguration Config { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected DataLayerServices DLService { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected ImageCacheService ICService { get; set; } = null!;
|
||||
|
||||
protected MarkupString JsonSer
|
||||
{
|
||||
get
|
||||
{
|
||||
string outVal = currJwd;
|
||||
return (MarkupString)outVal.Replace(Environment.NewLine, "<br/>").Replace(" ", " ");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
isLoading = true;
|
||||
ConfInit();
|
||||
InitialJwd = "{\r\n \"ProfilePath\": \"Profilo78\",\r\n \"AreaList\": [\r\n {\r\n \"Shape\": \"RECTANGLE\",\r\n \"DimensionList\": [\r\n {\r\n \"nIndex\": 1,\r\n \"sName\": \"Width\",\r\n \"dValue\": 1200.0\r\n },\r\n {\r\n \"nIndex\": 2,\r\n \"sName\": \"Height\",\r\n \"dValue\": 1500.0\r\n }\r\n ],\r\n \"JointList\": [\r\n {\r\n \"nIndex\": 1,\r\n \"JointType\": \"FULL_V\"\r\n },\r\n {\r\n \"nIndex\": 2,\r\n \"JointType\": \"FULL_V\"\r\n },\r\n {\r\n \"nIndex\": 3,\r\n \"JointType\": \"FULL_V\"\r\n },\r\n {\r\n \"nIndex\": 4,\r\n \"JointType\": \"FULL_V\"\r\n }\r\n ],\r\n \"BottomRail\": false,\r\n \"BottomRailQty\": 0,\r\n \"AreaList\": [\r\n {\r\n \"bIsSashVertical\": true,\r\n \"SashList\": [\r\n {\r\n \"OpeningType\": \"TURNONLY_LEFT\",\r\n \"bHasHandle\": false,\r\n \"dDimension\": 50.0\r\n },\r\n {\r\n \"OpeningType\": \"TILTTURN_RIGHT\",\r\n \"bHasHandle\": true,\r\n \"dDimension\": 50.0\r\n }\r\n ],\r\n \"SashType\": \"NULL\",\r\n \"JointList\": [\r\n {\r\n \"nIndex\": 1,\r\n \"JointType\": \"FULL_V\"\r\n },\r\n {\r\n \"nIndex\": 2,\r\n \"JointType\": \"FULL_V\"\r\n },\r\n {\r\n \"nIndex\": 3,\r\n \"JointType\": \"FULL_V\"\r\n },\r\n {\r\n \"nIndex\": 4,\r\n \"JointType\": \"FULL_V\"\r\n }\r\n ],\r\n \"Hardware\": \"000000\",\r\n \"AreaList\": [\r\n {\r\n \"AreaList\": [\r\n {\r\n \"FillType\": \"GLASS\",\r\n \"AreaList\": [],\r\n \"AreaType\": \"FILL\"\r\n }\r\n ],\r\n \"AreaType\": \"SPLITTED\"\r\n },\r\n {\r\n \"AreaList\": [\r\n {\r\n \"FillType\": \"GLASS\",\r\n \"AreaList\": [],\r\n \"AreaType\": \"FILL\"\r\n }\r\n ],\r\n \"AreaType\": \"SPLITTED\"\r\n }\r\n ],\r\n \"AreaType\": \"SASH\"\r\n }\r\n ],\r\n \"AreaType\": \"FRAME\"\r\n }\r\n ]\r\n}";
|
||||
DLService.CalcDonePipe.EA_NewMessage += CalcDonePipe_EA_NewMessage;
|
||||
await ReloadData();
|
||||
}
|
||||
|
||||
private bool isLoading = false;
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private string apiUrl = "";
|
||||
private string calcTag = "";
|
||||
private string cFile = "Data/Setup.json";
|
||||
private string currSvg = "";
|
||||
|
||||
private string imgBasePath = "";
|
||||
|
||||
private string imgTag = "";
|
||||
|
||||
private string subChannel = "";
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private string windowUid = "CurrWindow";
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private async void CalcDonePipe_EA_NewMessage(object? sender, EventArgs e)
|
||||
{
|
||||
// aggiorno visualizzazione
|
||||
PubSubEventArgs currArgs = (PubSubEventArgs)e;
|
||||
// conversione on-the-fly SVG da mostrare
|
||||
if (!string.IsNullOrEmpty(currArgs.newMessage))
|
||||
{
|
||||
if (currArgs.msgUid.Equals($"{subChannel}:{windowUid}"))
|
||||
{
|
||||
currSvg = currArgs.newMessage;
|
||||
}
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
private void ConfInit()
|
||||
{
|
||||
apiUrl = Config.GetValue<string>("ServerConf:Prog.ApiUrl") ?? "";
|
||||
imgBasePath = Config.GetValue<string>("ServerConf:ImageBaseUrl") ?? "";
|
||||
imgTag = Config.GetValue<string>("ServerConf:ImageFileTag") ?? "";
|
||||
calcTag = Config.GetValue<string>("ServerConf:ImageCalcTag") ?? "";
|
||||
subChannel = Config.GetValue<string>("ServerConf:SvgChannel") ?? "";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Rilettura dati
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private async Task ReloadData()
|
||||
{
|
||||
//return base.OnInitializedAsync();
|
||||
// brutale, da rivedere...
|
||||
if (File.Exists(cFile))
|
||||
{
|
||||
//item.ImageUrl = ICService.ImageUrl($"{apiUrl}/{imgBasePath}", false, item.SVGFileName);
|
||||
}
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
private async Task SaveJWD(string newSerial)
|
||||
{
|
||||
currJwd = newSerial;
|
||||
// chiamo la chiamata POST alla API, che manda la richiesta via REDIS
|
||||
await ICService.CallRestPost($"{apiUrl}/{imgBasePath}", $"{calcTag}/{windowUid}", currJwd);
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -10,10 +10,10 @@
|
||||
else
|
||||
{
|
||||
<WebWindowMaker IN_TemplateDTOList="@AvailTemplateList"
|
||||
IN_SelTemplate="@SelTemplate"
|
||||
EC_OnUpdate="SaveJWD"
|
||||
EC_OnSelectedTemplate="SetTemplate"
|
||||
LiveSVG="@currSvg"
|
||||
CurrJwd="@InitialJwd">
|
||||
LiveSVG="@currSvg">
|
||||
</WebWindowMaker>
|
||||
}
|
||||
|
||||
|
||||
@@ -13,9 +13,7 @@ namespace Test.UI.Components.Pages
|
||||
#region Public Properties
|
||||
|
||||
public Template SelTemplate { get; set; } = new Template(0, "---SELECT---", "", "");
|
||||
public string InitialJwd = "";
|
||||
|
||||
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
@@ -63,7 +61,6 @@ namespace Test.UI.Components.Pages
|
||||
{
|
||||
isLoading = true;
|
||||
ConfInit();
|
||||
InitialJwd = "{\r\n \"ProfilePath\": \"Profilo78\",\r\n \"AreaList\": [\r\n {\r\n \"Shape\": \"RECTANGLE\",\r\n \"DimensionList\": [\r\n {\r\n \"nIndex\": 1,\r\n \"sName\": \"Width\",\r\n \"dValue\": 1200.0\r\n },\r\n {\r\n \"nIndex\": 2,\r\n \"sName\": \"Height\",\r\n \"dValue\": 1500.0\r\n }\r\n ],\r\n \"JointList\": [\r\n {\r\n \"nIndex\": 1,\r\n \"JointType\": \"FULL_V\"\r\n },\r\n {\r\n \"nIndex\": 2,\r\n \"JointType\": \"FULL_V\"\r\n },\r\n {\r\n \"nIndex\": 3,\r\n \"JointType\": \"FULL_V\"\r\n },\r\n {\r\n \"nIndex\": 4,\r\n \"JointType\": \"FULL_V\"\r\n }\r\n ],\r\n \"BottomRail\": false,\r\n \"BottomRailQty\": 0,\r\n \"AreaList\": [\r\n {\r\n \"bIsSashVertical\": true,\r\n \"SashList\": [\r\n {\r\n \"OpeningType\": \"TURNONLY_LEFT\",\r\n \"bHasHandle\": false,\r\n \"dDimension\": 50.0\r\n },\r\n {\r\n \"OpeningType\": \"TILTTURN_RIGHT\",\r\n \"bHasHandle\": true,\r\n \"dDimension\": 50.0\r\n }\r\n ],\r\n \"SashType\": \"NULL\",\r\n \"JointList\": [\r\n {\r\n \"nIndex\": 1,\r\n \"JointType\": \"FULL_V\"\r\n },\r\n {\r\n \"nIndex\": 2,\r\n \"JointType\": \"FULL_V\"\r\n },\r\n {\r\n \"nIndex\": 3,\r\n \"JointType\": \"FULL_V\"\r\n },\r\n {\r\n \"nIndex\": 4,\r\n \"JointType\": \"FULL_V\"\r\n }\r\n ],\r\n \"Hardware\": \"000000\",\r\n \"AreaList\": [\r\n {\r\n \"AreaList\": [\r\n {\r\n \"FillType\": \"GLASS\",\r\n \"AreaList\": [],\r\n \"AreaType\": \"FILL\"\r\n }\r\n ],\r\n \"AreaType\": \"SPLITTED\"\r\n },\r\n {\r\n \"AreaList\": [\r\n {\r\n \"FillType\": \"GLASS\",\r\n \"AreaList\": [],\r\n \"AreaType\": \"FILL\"\r\n }\r\n ],\r\n \"AreaType\": \"SPLITTED\"\r\n }\r\n ],\r\n \"AreaType\": \"SASH\"\r\n }\r\n ],\r\n \"AreaType\": \"FRAME\"\r\n }\r\n ]\r\n}";
|
||||
DLService.CalcDonePipe.EA_NewMessage += CalcDonePipe_EA_NewMessage;
|
||||
await ReloadData();
|
||||
}
|
||||
|
||||
@@ -10,4 +10,5 @@
|
||||
@using Test.UI.Client
|
||||
@using Test.UI.Components
|
||||
@using WebWindowConfigurator
|
||||
@using WebAedificaConfigurator
|
||||
@using WebAedificaConfigurator
|
||||
@using WebWindowJWD
|
||||
@@ -28,6 +28,7 @@
|
||||
<ProjectReference Include="..\Test.UI.Client\Test.UI.Client.csproj" />
|
||||
<ProjectReference Include="..\WebAedificaConfigurator\WebAedificaConfigurator.csproj" />
|
||||
<ProjectReference Include="..\WebWindowConfigurator\WebWindowConfigurator.csproj" />
|
||||
<ProjectReference Include="..\WebWindowJWD\WebWindowJWD.csproj" />
|
||||
<PackageReference Include="EgwCoreLib.Lux.Core" Version="0.9.2508.712" />
|
||||
<PackageReference Include="EgwCoreLib.Lux.Data" Version="0.9.2508.712" />
|
||||
<PackageReference Include="EgwCoreLib.Razor" Version="1.5.2507.1815" />
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>2.7.8.912</Version>
|
||||
<Version>2.7.8.1117</Version>
|
||||
<Authors>Annamaria Sassi</Authors>
|
||||
<Company>Egalware</Company>
|
||||
<Description>Componente gestione JWD per LUX</Description>
|
||||
@@ -53,6 +53,23 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,141 +1,250 @@
|
||||
|
||||
<div class="row">
|
||||
@if (string.IsNullOrEmpty(m_CurrJwd) && m_CurrWindow == null)
|
||||
{
|
||||
<table class="table table-hover align-middle">
|
||||
<thead class="table-light fs-5">
|
||||
<tr>
|
||||
<th scope="col">#</th>
|
||||
<th scope="col" class="col-4">Image</th>
|
||||
<th scope="col" class="text-start">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="table-group-divider fs-5">
|
||||
@foreach (var item in IN_TemplateDTOList)
|
||||
{
|
||||
string colorClass = "";
|
||||
@if (SelTemplateDTO != null && item.Index == SelTemplateDTO.Index)
|
||||
colorClass = "table-success";
|
||||
else
|
||||
colorClass = "";
|
||||
<tr style="height: 150px;" class="@colorClass" @onclick="() => DoSelect(item)">
|
||||
<td>@item.Index</td>
|
||||
<td><img class="img-fluid" width="100" src="@item.ImageUrl" /></td>
|
||||
<td class="text-start">@item.Description</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="col-6">
|
||||
<div class="card text-center table-svg">
|
||||
<div class="card-header" style="background-color: #d5f1f2;">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<ul class="nav nav-tabs card-header-tabs">
|
||||
@* <li class="nav-item">
|
||||
@if (currStep == CompileStep.Template)
|
||||
{
|
||||
<a data-target="#Template" class="nav-link active fw-bold" aria-current="true" @onclick="() => AdvStep(CompileStep.Template)">Template</a>
|
||||
}
|
||||
else
|
||||
{
|
||||
<a data-target="#Template" class="nav-link text-secondary" @onclick="() => AdvStep(CompileStep.Template)">Template</a>
|
||||
}
|
||||
</li> *@
|
||||
<li class="nav-item">
|
||||
<a data-target="#Frame" class="@tabNavCss(CompileStep.Frame)" aria-current="true" @onclick="() => DoSelectAndPreview(CompileStep.Frame)">Frame</a>
|
||||
</li>
|
||||
@if ( m_SplitList.Count > 0)
|
||||
<div class="@mainCss()">
|
||||
<div class="card text-center table-svg">
|
||||
<div class="card-header" style="background-color: #d5f1f2;">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<ul class="nav nav-tabs card-header-tabs">
|
||||
<li class="nav-item">
|
||||
@if (currStep == CompileStep.Template)
|
||||
{
|
||||
<li class="nav-item">
|
||||
<a data-target="#Split" class="@tabNavCss(CompileStep.Split)" aria-current="true" @onclick="() => DoSelectAndPreview(CompileStep.Split)">Split</a>
|
||||
</li>
|
||||
<a data-target="#Template" class="nav-link active fw-bold" aria-current="true" @onclick="() => AdvStep(CompileStep.Template)">Template</a>
|
||||
}
|
||||
@if(m_SashList.Count > 0)
|
||||
else
|
||||
{
|
||||
<li class="nav-item">
|
||||
<a data-target="#Sash" class="@tabNavCss(CompileStep.Sash)" aria-current="true" @onclick="() => DoSelectAndPreview(CompileStep.Sash)">Sash</a>
|
||||
</li>
|
||||
<a data-target="#Template" class="nav-link text-secondary" @onclick="() => AdvStep(CompileStep.Template)">Template</a>
|
||||
}
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a data-target="#Frame" class="@tabNavCss(CompileStep.Frame)" aria-current="true" @onclick="() => DoSelectAndPreview(CompileStep.Frame)">Frame</a>
|
||||
</li>
|
||||
@if ( m_SplitList.Count > 0)
|
||||
{
|
||||
<li class="nav-item">
|
||||
<a data-target="#Fill" class="@tabNavCss(CompileStep.Fill)" aria-current="true" @onclick="() => DoSelectAndPreview(CompileStep.Fill)">Fill</a>
|
||||
<a data-target="#Split" class="@tabNavCss(CompileStep.Split)" aria-current="true" @onclick="() => DoSelectAndPreview(CompileStep.Split)">Split</a>
|
||||
</li>
|
||||
</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>
|
||||
</div>
|
||||
}
|
||||
@if(m_SashList.Count > 0)
|
||||
{
|
||||
<li class="nav-item">
|
||||
<a data-target="#Sash" class="@tabNavCss(CompileStep.Sash)" aria-current="true" @onclick="() => DoSelectAndPreview(CompileStep.Sash)">Sash</a>
|
||||
</li>
|
||||
}
|
||||
<li class="nav-item">
|
||||
<a data-target="#Fill" class="@tabNavCss(CompileStep.Fill)" aria-current="true" @onclick="() => DoSelectAndPreview(CompileStep.Fill)">Fill</a>
|
||||
</li>
|
||||
</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>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body bg-transparent">
|
||||
<div class="alert alert-light text-center display-4">
|
||||
@* @if (currStep == CompileStep.Template)
|
||||
{
|
||||
<table class="table table-hover align-middle">
|
||||
<thead class="table-light fs-5">
|
||||
<tr>
|
||||
<th scope="col">#</th>
|
||||
<th scope="col" class="col-4">Image</th>
|
||||
<th scope="col" class="text-start">Description</th>
|
||||
</div>
|
||||
<div class="card-body bg-transparent">
|
||||
<div class="alert alert-light text-center display-4">
|
||||
@if (currStep == CompileStep.Template)
|
||||
{
|
||||
<table class="table table-hover align-middle">
|
||||
<thead class="table-light fs-5">
|
||||
<tr>
|
||||
<th scope="col">#</th>
|
||||
<th scope="col" class="col-4">Image</th>
|
||||
<th scope="col" class="text-start">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="table-group-divider fs-5">
|
||||
@foreach (var item in IN_TemplateDTOList)
|
||||
{
|
||||
string colorClass = "";
|
||||
@if (SelTemplateDTO != null && item.Index == SelTemplateDTO.Index)
|
||||
colorClass = "table-success";
|
||||
else
|
||||
colorClass = "";
|
||||
<tr style="height: 150px;" class="@colorClass" @onclick="() => DoSelect(item)">
|
||||
<td>@item.Index</td>
|
||||
<td><img class="img-fluid" width="100" src="@item.ImageUrl" /></td>
|
||||
<td class="text-start">@item.Description</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="table-group-divider fs-5">
|
||||
@foreach (var item in IN_TemplateDTOList)
|
||||
{
|
||||
string colorClass = "";
|
||||
@if (SelTemplateDTO != null && item.Index == SelTemplateDTO.Index)
|
||||
colorClass = "table-success";
|
||||
else
|
||||
colorClass = "";
|
||||
<tr style="height: 150px;" class="@colorClass" @onclick="() => DoSelect(item)">
|
||||
<td>@item.Index</td>
|
||||
<td><img class="img-fluid" width="100" src="@item.ImageUrl" /></td>
|
||||
<td class="text-start">@item.Description</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
} *@
|
||||
@if (currStep == CompileStep.Frame)
|
||||
{
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="alert alert-light text-start p-1 display-4 w-50">
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text" for="FrameShape">Shape</label>
|
||||
<select class="form-select" @bind="@m_Frame.SelShapeIndex">
|
||||
<option value="0">Rectangle</option>
|
||||
<option value="1">Right Chamfer</option>
|
||||
<option value="2">Left Chamfer</option>
|
||||
<option value="3">Double Chamfer</option>
|
||||
<option value="4">Arc</option>
|
||||
<option value="5">Arc Full</option>
|
||||
<option value="6">Double Arc</option>
|
||||
<option value="7">Triangle</option>
|
||||
</select>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
@if (currStep == CompileStep.Frame)
|
||||
{
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="alert alert-light text-start p-1 display-4 w-50">
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text" for="FrameShape">Shape</label>
|
||||
<select class="form-select" @bind="@m_Frame.SelShapeIndex">
|
||||
<option value="0">Rectangle</option>
|
||||
<option value="1">Right Chamfer</option>
|
||||
<option value="2">Left Chamfer</option>
|
||||
<option value="3">Double Chamfer</option>
|
||||
<option value="4">Arc</option>
|
||||
<option value="5">Arc Full</option>
|
||||
<option value="6">Double Arc</option>
|
||||
<option value="7">Triangle</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5 class="card-title">Dimension</h5>
|
||||
@foreach (FrameDimension dimension in m_Frame.DimensionList)
|
||||
{
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text" id="IndexDimFrame">@dimension.nIndex</span>
|
||||
<span class="input-group-text" id="NameDimFrame">@dimension.sName</span>
|
||||
<input type="number" class="form-control" aria-label="@dimension.dValue" @bind="@dimension.dValue">
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5 class="card-title">Joints frame</h5>
|
||||
@foreach (Joint joint in m_Frame.JointList)
|
||||
{
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text" for="IndexJoint">@joint.nIndex</label>
|
||||
<select class="form-select" @bind="@joint.SelJointTypeIndex">
|
||||
<option value="0">Angled</option>
|
||||
<option value="1">Full H</option>
|
||||
<option value="2">Full V</option>
|
||||
</select>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
@if (m_SashList.Count == 0)
|
||||
{
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5 class="card-title">Dimension</h5>
|
||||
@foreach (FrameDimension dimension in m_Frame.DimensionList)
|
||||
<h5 class="card-title">Bottom rail</h5>
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text" id="BottomRailQty">Quantity</span>
|
||||
<input type="number" class="form-control" aria-label="BottomRailQty" @bind="@m_Frame.BottomRailQty">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else if (currStep == CompileStep.Split)
|
||||
{
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="alert alert-light text-start p-1 display-4 w-50">
|
||||
@foreach (var item in SplitList)
|
||||
{
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text" id="basic-addon1Split">Number</span>
|
||||
<input type="number" class="form-control" placeholder="0" aria-label="basic-addon1Split" @bind="@item.nSplitQty">
|
||||
</div>
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text" for="basic-addon2Split">Shape</label>
|
||||
<select class="form-select" @bind="@item.SelSplitShapeIndex">
|
||||
<option value="0">Vertical</option>
|
||||
<option value="1">Horizontal</option>
|
||||
<option value="2">Grid</option>
|
||||
<option value="3">Custom</option>
|
||||
</select>
|
||||
</div>
|
||||
@foreach (var dim in item.SplitPositionList)
|
||||
{
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text" id="IndexDimFrame">@dimension.nIndex</span>
|
||||
<span class="input-group-text" id="NameDimFrame">@dimension.sName</span>
|
||||
<input type="number" class="form-control" aria-label="@dimension.dValue" @bind="@dimension.dValue">
|
||||
<span class="input-group-text" id="basic-addon3Split">Altezza area inferiore</span>
|
||||
<input type="number" class="form-control" aria-label="basic-addon2Split" @bind="@dim.dDimension">
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@* <button class="btn btn-sm btn-primary" title="Reset selezione" @onclick="DoReset"><i class="fa-solid fa-arrow-rotate-right"></i></button> *@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else if (currStep == CompileStep.Sash)
|
||||
{
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="alert alert-light text-start p-1 display-4 w-50">
|
||||
@foreach (var item in SashList)
|
||||
{
|
||||
<div class="input-group mb-2">
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text" id="NumberSash">Number</span>
|
||||
<input type="number" class="form-control" aria-label="NumberSash" @bind="@item.nSashQty">
|
||||
</div>
|
||||
</div>
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5 class="card-title">Joints frame</h5>
|
||||
@foreach (Joint joint in m_Frame.JointList)
|
||||
<h5 class="card-title">Orientation</h5>
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text" for="OrientationSash">Tipology</label>
|
||||
<select class="form-select" @bind="@item.SelOrientationSashTypeIndex">
|
||||
<option value="0">Vertical</option>
|
||||
<option value="1">Horizontal</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@foreach (SashDimension sash in item.SashList)
|
||||
{
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
@if(item.SashList.Count == 1)
|
||||
{
|
||||
<h5 class="card-title">Opening</h5>
|
||||
}
|
||||
else
|
||||
{
|
||||
<h5 class="card-title">Sash opening @(item.SashList.IndexOf(sash) + 1)</h5>
|
||||
}
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text" for="OpeningSash">Tipology</label>
|
||||
<select class="form-select" @bind="@sash.SelOpeningTypeIndex">
|
||||
<option value="0">A battente sinistra</option>
|
||||
<option value="1">A battente destra</option>
|
||||
<option value="2">Ad anta-ribalta sinistra</option>
|
||||
<option value="3">Ad anta-ribalta destra</option>
|
||||
<option value="4">5</option>
|
||||
<option value="5">7</option>
|
||||
<option value="6">8</option>
|
||||
<option value="7">9</option>
|
||||
<option value="8">10</option>
|
||||
<option value="9">11</option>
|
||||
<option value="10">12</option>
|
||||
<option value="11">13</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text" id="Dimension">Dimension</span>
|
||||
<input type="number" class="form-control" aria-label="DimensionSash" @bind="@sash.dDimension">
|
||||
</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" id="Handle" @bind="@sash.bHasHandle">
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<label class="form-check-label fs-6 text-dark" for="HandleSashLabel">Handle</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5 class="card-title">Sash joints</h5>
|
||||
@foreach (Joint joint in item.JointList)
|
||||
{
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text" for="IndexJoint">@joint.nIndex</label>
|
||||
@@ -148,194 +257,59 @@
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
@if (m_SashList.Count == 0)
|
||||
{
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5 class="card-title">Bottom rail</h5>
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text" id="BottomRailQty">Quantity</span>
|
||||
<input type="number" class="form-control" aria-label="BottomRailQty" @bind="@m_Frame.BottomRailQty">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else if (currStep == CompileStep.Split)
|
||||
{
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="alert alert-light text-start p-1 display-4 w-50">
|
||||
@foreach (var item in SplitList)
|
||||
{
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text" id="basic-addon1Split">Number</span>
|
||||
<input type="number" class="form-control" placeholder="0" aria-label="basic-addon1Split" @bind="@item.nSplitQty">
|
||||
</div>
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text" for="basic-addon2Split">Shape</label>
|
||||
<select class="form-select" @bind="@item.SelSplitShapeIndex">
|
||||
<option value="0">Vertical</option>
|
||||
<option value="1">Horizontal</option>
|
||||
<option value="2">Grid</option>
|
||||
<option value="3">Custom</option>
|
||||
</select>
|
||||
</div>
|
||||
@foreach (var dim in item.SplitPositionList)
|
||||
{
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text" id="basic-addon3Split">Altezza area inferiore</span>
|
||||
<input type="number" class="form-control" aria-label="basic-addon2Split" @bind="@dim.dDimension">
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@* <button class="btn btn-sm btn-primary" title="Reset selezione" @onclick="DoReset"><i class="fa-solid fa-arrow-rotate-right"></i></button> *@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else if (currStep == CompileStep.Sash)
|
||||
{
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="alert alert-light text-start p-1 display-4 w-50">
|
||||
@foreach (var item in SashList)
|
||||
{
|
||||
<div class="input-group mb-2">
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5 class="card-title">Bottom rail</h5>
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text" id="NumberSash">Number</span>
|
||||
<input type="number" class="form-control" aria-label="NumberSash" @bind="@item.nSashQty">
|
||||
<span class="input-group-text" id="BottomRailQty">Quantity</span>
|
||||
<input type="number" class="form-control" aria-label="BottomRailQty" @bind="@item.SashBottomRailQty">
|
||||
</div>
|
||||
</div>
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5 class="card-title">Orientation</h5>
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text" for="OrientationSash">Tipology</label>
|
||||
<select class="form-select" @bind="@item.SelOrientationSashTypeIndex">
|
||||
<option value="0">Vertical</option>
|
||||
<option value="1">Horizontal</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@foreach (SashDimension sash in item.SashList)
|
||||
{
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
@if(item.SashList.Count == 1)
|
||||
{
|
||||
<h5 class="card-title">Opening</h5>
|
||||
}
|
||||
else
|
||||
{
|
||||
<h5 class="card-title">Sash opening @(item.SashList.IndexOf(sash) + 1)</h5>
|
||||
}
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text" for="OpeningSash">Tipology</label>
|
||||
<select class="form-select" @bind="@sash.SelOpeningTypeIndex">
|
||||
<option value="0">A battente sinistra</option>
|
||||
<option value="1">A battente destra</option>
|
||||
<option value="2">Ad anta-ribalta sinistra</option>
|
||||
<option value="3">Ad anta-ribalta destra</option>
|
||||
<option value="4">5</option>
|
||||
<option value="5">7</option>
|
||||
<option value="6">8</option>
|
||||
<option value="7">9</option>
|
||||
<option value="8">10</option>
|
||||
<option value="9">11</option>
|
||||
<option value="10">12</option>
|
||||
<option value="11">13</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text" id="Dimension">Dimension</span>
|
||||
<input type="number" class="form-control" aria-label="DimensionSash" @bind="@sash.dDimension">
|
||||
</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" id="Handle" @bind="@sash.bHasHandle">
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<label class="form-check-label fs-6 text-dark" for="HandleSashLabel">Handle</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5 class="card-title">Sash joints</h5>
|
||||
@foreach (Joint joint in item.JointList)
|
||||
{
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text" for="IndexJoint">@joint.nIndex</label>
|
||||
<select class="form-select" @bind="@joint.SelJointTypeIndex">
|
||||
<option value="0">Angled</option>
|
||||
<option value="1">Full H</option>
|
||||
<option value="2">Full V</option>
|
||||
</select>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5 class="card-title">Bottom rail</h5>
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text" id="BottomRailQty">Quantity</span>
|
||||
<input type="number" class="form-control" aria-label="BottomRailQty" @bind="@item.SashBottomRailQty">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
@* <button class="btn btn-sm btn-primary" title="Reset selezione" @onclick="DoReset"><i class="fa-solid fa-arrow-rotate-right"></i></button> *@
|
||||
</div>
|
||||
</div>
|
||||
@* <button class="btn btn-sm btn-primary" title="Reset selezione" @onclick="DoReset"><i class="fa-solid fa-arrow-rotate-right"></i></button> *@
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else if (currStep == CompileStep.Fill)
|
||||
{
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="alert alert-light text-start p-1 display-4 w-50">
|
||||
@foreach (var Fill in FillList)
|
||||
{
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
@if(FillList.Count == 1)
|
||||
{
|
||||
<h5 class="card-title">Fill</h5>
|
||||
}
|
||||
else
|
||||
{
|
||||
<h5 class="card-title">Fill @(FillList.IndexOf(Fill) + 1)</h5>
|
||||
}
|
||||
<div class="input-group mb-2">
|
||||
<select class="form-select" @bind="@Fill.SelFillTypeIndex">
|
||||
<option value="0">Glass</option>
|
||||
<option value="1">Wood</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else if (currStep == CompileStep.Fill)
|
||||
{
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="alert alert-light text-start p-1 display-4 w-50">
|
||||
@foreach (var Fill in FillList)
|
||||
{
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
@if (FillList.Count == 1)
|
||||
{
|
||||
<h5 class="card-title">Fill </h5>
|
||||
}
|
||||
else
|
||||
{
|
||||
<h5 class="card-title">Fill @(FillList.IndexOf(Fill) + 1)</h5>
|
||||
}
|
||||
|
||||
<div class="input-group mb-2">
|
||||
<select class="form-select" @bind="@Fill.SelFillTypeIndex">
|
||||
<option value="0">Glass</option>
|
||||
<option value="1">Wood</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if(currStep != CompileStep.Template)
|
||||
{
|
||||
<div class="col-6">
|
||||
@outSvg
|
||||
</div>
|
||||
|
||||
@@ -17,33 +17,6 @@ namespace WebWindowConfigurator
|
||||
[Parameter]
|
||||
public string CssSvg { get; set; } = "responsive-svg";
|
||||
|
||||
[Parameter]
|
||||
public string CurrJwd
|
||||
{
|
||||
get => m_CurrJwd;
|
||||
set
|
||||
{
|
||||
if (m_CurrJwd != value)
|
||||
{
|
||||
m_CurrJwd = value;
|
||||
JsonWindow WindowFromJson = JsonConvert.DeserializeObject<JsonWindow>(m_CurrJwd, 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>();
|
||||
SearchInAreaList(m_CurrWindow.AreaList[0]);
|
||||
EC_OnUpdate.InvokeAsync(m_CurrJwd);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<bool> EC_OnClose { get; set; }
|
||||
|
||||
@@ -238,7 +211,7 @@ namespace WebWindowConfigurator
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private CompileStep currStep = CompileStep.Frame;
|
||||
private CompileStep currStep = CompileStep.Template;
|
||||
|
||||
private List<Fill> m_FillList = new List<Fill>();
|
||||
|
||||
@@ -248,6 +221,8 @@ namespace WebWindowConfigurator
|
||||
|
||||
private List<Split> m_SplitList = new List<Split>();
|
||||
|
||||
private int counter = 0;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
@@ -284,6 +259,11 @@ namespace WebWindowConfigurator
|
||||
return testStep.Equals(currStep) ? "nav-link active fw-bold" : "nav-link text-secondary";
|
||||
}
|
||||
|
||||
private string mainCss()
|
||||
{
|
||||
return currStep == CompileStep.Template ? "col-12" : "col-6";
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -646,14 +646,22 @@ namespace WebWindowConfigurator
|
||||
{
|
||||
if (ContentArea.Count > 0)
|
||||
{
|
||||
foreach (Area SelArea in AreaList)
|
||||
for(int SplitIndex = 0; SplitIndex <= AreaList.Count() - 1; SplitIndex++)
|
||||
{
|
||||
SelArea.AreaList = ContentArea;
|
||||
if(SplitIndex == 0)
|
||||
{
|
||||
AreaList[0].AreaList.Add(ContentArea[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
AreaList[SplitIndex].AreaList.Add(Fill.CreateFill(AreaList[SplitIndex], FillTypes.GLASS));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
AreaList[AreaList.Count - 1] = AreaList[AreaList.Count - 2];
|
||||
AreaList[AreaList.Count - 1].AreaList.Add(Fill.CreateFill(AreaList[AreaList.Count - 1], FillTypes.GLASS));
|
||||
//AreaList[AreaList.Count - 1] = AreaList[AreaList.Count - 2];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1214,6 +1222,15 @@ namespace WebWindowConfigurator
|
||||
dLastDimension += m_SplitPositionList[SplitPositionList.Count - 1].dDimension;
|
||||
SplitPositionList[SplitPositionList.Count - 1].SetDimension(dLastDimension);
|
||||
}
|
||||
for(var SplitIndex = AreaList.Count; SplitIndex <= SplitPositionList.Count - 1; SplitIndex++)
|
||||
{
|
||||
AreaList.Add(Splitted.CreateSplitted(this));
|
||||
AreaList.Last().AreaList.Add(Fill.CreateFill(AreaList.Last(), FillTypes.GLASS));
|
||||
}
|
||||
for (var SplitIndex = SplitPositionList.Count; SplitIndex <= AreaList.Count - 1; SplitIndex++)
|
||||
{
|
||||
AreaList.Remove(AreaList[AreaList.Count - 1]);
|
||||
}
|
||||
m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WebWindowJWD.DTO
|
||||
{
|
||||
public class TemplateSelectDTO
|
||||
{
|
||||
public int Index { get; set; } = 0;
|
||||
public string Description { get; set; } = "";
|
||||
public string JwdFileName { get; set; } = "";
|
||||
public string SVGFileName { get; set; } = "";
|
||||
public string ImageUrl { get; set; } = "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,753 @@
|
||||
using Microsoft.VisualBasic;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using static WebWindowJWD.Json.WindowConst;
|
||||
|
||||
namespace WebWindowJWD.Json
|
||||
{
|
||||
[JsonObject(MemberSerialization.OptIn)]
|
||||
public class JsonWindow
|
||||
{
|
||||
private string m_sProfilePath;
|
||||
[JsonProperty]
|
||||
public string ProfilePath
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_sProfilePath;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_sProfilePath = value;
|
||||
}
|
||||
}
|
||||
|
||||
private List<JsonArea> m_AreaList = new List<JsonArea>();
|
||||
[JsonProperty]
|
||||
public List<JsonArea> AreaList
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_AreaList;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_AreaList = value;
|
||||
}
|
||||
}
|
||||
|
||||
public JsonWindow(string ProfilePath)
|
||||
{
|
||||
m_sProfilePath = ProfilePath;
|
||||
}
|
||||
|
||||
internal Window Deserialize()
|
||||
{
|
||||
Window Window = new Window() { sProfilePath = m_sProfilePath };
|
||||
foreach (var Area in AreaList)
|
||||
Window.AreaList.Add((Frame)Area.Deserialize(null,Window));
|
||||
return Window;
|
||||
}
|
||||
}
|
||||
|
||||
public class JsonArea
|
||||
{
|
||||
private List<JsonArea> m_AreaList = new List<JsonArea>();
|
||||
|
||||
[JsonProperty]
|
||||
public List<JsonArea> AreaList
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_AreaList;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_AreaList = value;
|
||||
}
|
||||
}
|
||||
|
||||
private AreaTypes m_AreaType;
|
||||
[JsonProperty]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public AreaTypes AreaType
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_AreaType;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_AreaType = value;
|
||||
}
|
||||
}
|
||||
|
||||
public JsonArea(AreaTypes AreaType)
|
||||
{
|
||||
m_AreaType = AreaType;
|
||||
}
|
||||
|
||||
internal virtual Area? Deserialize(Area ParentArea, Window ParentWindow)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public class JsonFrame : JsonArea
|
||||
{
|
||||
private Shapes m_Shape;
|
||||
[JsonProperty]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public Shapes Shape
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Shape;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Shape = value;
|
||||
}
|
||||
}
|
||||
|
||||
private List<JsonFrameDimension> m_DimensionList = new List<JsonFrameDimension>();
|
||||
[JsonProperty]
|
||||
public List<JsonFrameDimension> DimensionList
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_DimensionList;
|
||||
}
|
||||
}
|
||||
|
||||
private List<JsonJoint> m_JointList = new List<JsonJoint>();
|
||||
[JsonProperty]
|
||||
public List<JsonJoint> JointList
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_JointList;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_JointList = value;
|
||||
}
|
||||
}
|
||||
|
||||
private bool m_bBottomRail;
|
||||
[JsonProperty]
|
||||
public bool BottomRail
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_bBottomRail;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_bBottomRail = value;
|
||||
}
|
||||
}
|
||||
|
||||
private int m_nBottomRailQty;
|
||||
[JsonProperty]
|
||||
public int BottomRailQty
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_nBottomRailQty;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_nBottomRailQty = value;
|
||||
}
|
||||
}
|
||||
|
||||
public JsonFrame() : base(AreaTypes.FRAME)
|
||||
{
|
||||
}
|
||||
|
||||
public JsonFrame(Shapes Shape, bool BottomRail, int BottomRailQty) : base(AreaTypes.FRAME)
|
||||
{
|
||||
m_Shape = Shape;
|
||||
m_bBottomRail = BottomRail;
|
||||
m_nBottomRailQty = BottomRailQty;
|
||||
}
|
||||
|
||||
internal override Area Deserialize(Area ParentArea, Window ParentWindow)
|
||||
{
|
||||
Frame newFrame = new Frame(null, ParentWindow);
|
||||
newFrame.SetAreaType(AreaTypes.FRAME);
|
||||
newFrame.SetSelShape(m_Shape);
|
||||
newFrame.SetBottomRail(m_bBottomRail);
|
||||
newFrame.SetBottomRailQty(m_nBottomRailQty);
|
||||
//Frame.AppliedDone();
|
||||
for (var DimensionIndex = 0; DimensionIndex <= m_DimensionList.Count - 1; DimensionIndex++)
|
||||
newFrame.DimensionList[DimensionIndex].dValue = m_DimensionList[DimensionIndex].dValue;
|
||||
for (var JointIndex = 0; JointIndex <= m_JointList.Count - 1; JointIndex++)
|
||||
newFrame.JointList[JointIndex].SetSelJointType(m_JointList[JointIndex].JointType);
|
||||
foreach (var Area in AreaList)
|
||||
{
|
||||
var aList = Area.Deserialize(newFrame, ParentWindow);
|
||||
if (aList != null)
|
||||
{
|
||||
newFrame.AreaList.Add(aList);
|
||||
}
|
||||
}
|
||||
return newFrame;
|
||||
}
|
||||
}
|
||||
|
||||
public class JsonSash : JsonArea
|
||||
{
|
||||
private bool m_bIsSashVertical;
|
||||
[JsonProperty]
|
||||
public bool bIsSashVertical
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_bIsSashVertical;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_bIsSashVertical = value;
|
||||
}
|
||||
}
|
||||
|
||||
private List<JsonSashDimension> m_SashList = new List<JsonSashDimension>();
|
||||
[JsonProperty]
|
||||
public List<JsonSashDimension> SashList
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_SashList;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_SashList = value;
|
||||
}
|
||||
}
|
||||
|
||||
private SashTypes m_SashType;
|
||||
[JsonProperty]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public SashTypes SashType
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_SashType;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_SashType = value;
|
||||
}
|
||||
}
|
||||
|
||||
private List<JsonJoint> m_JointList = new List<JsonJoint>();
|
||||
[JsonProperty]
|
||||
public List<JsonJoint> JointList
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_JointList;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_JointList = value;
|
||||
}
|
||||
}
|
||||
|
||||
private bool m_bSashBottomRail;
|
||||
[JsonProperty]
|
||||
public bool SashBottomRail
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_bSashBottomRail;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_bSashBottomRail = value;
|
||||
}
|
||||
}
|
||||
|
||||
private int m_nSashBottomRailQty;
|
||||
[JsonProperty]
|
||||
public int SashBottomRailQty
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_nSashBottomRailQty;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_nSashBottomRailQty = value;
|
||||
}
|
||||
}
|
||||
|
||||
private string m_Hardware;
|
||||
[JsonProperty]
|
||||
public string Hardware
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Hardware;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Hardware = value;
|
||||
}
|
||||
}
|
||||
|
||||
public JsonSash() : base(AreaTypes.SASH)
|
||||
{
|
||||
}
|
||||
|
||||
public JsonSash(bool bIsSashVertical, SashTypes SashType, bool SashBottomRail, int SashBottomRailQty/*, string Hardware*/) : base(AreaTypes.SASH)
|
||||
{
|
||||
m_bIsSashVertical = bIsSashVertical;
|
||||
m_SashType = SashType;
|
||||
m_bSashBottomRail = SashBottomRail;
|
||||
m_nSashBottomRailQty = SashBottomRailQty;
|
||||
m_Hardware = Hardware;
|
||||
}
|
||||
|
||||
internal override Area Deserialize(Area ParentArea, Window ParentWindow)
|
||||
{
|
||||
Sash newSash = new Sash(ParentArea, ParentWindow);
|
||||
newSash.SetAreaType(AreaTypes.SASH);
|
||||
newSash.SetSashQty(m_SashList.Count);
|
||||
newSash.SetIsSashVertical(m_bIsSashVertical);
|
||||
newSash.SetSashBottomRail(m_bSashBottomRail);
|
||||
newSash.SetSashBottomRailQty(m_nSashBottomRailQty);
|
||||
//Sash.AppliedDone();
|
||||
for (var SashIndex = 0; SashIndex <= m_SashList.Count - 1; SashIndex++)
|
||||
{
|
||||
newSash.SashList[SashIndex].SetOpeningType(m_SashList[SashIndex].OpeningType);
|
||||
newSash.SashList[SashIndex].SetHasHandle(m_SashList[SashIndex].bHasHandle);
|
||||
newSash.SashList[SashIndex].SetDimension(m_SashList[SashIndex].dDimension);
|
||||
}
|
||||
foreach (var Joint in m_JointList)
|
||||
newSash.JointList.Add(Joint.Deserialize((Area)ParentArea));
|
||||
//Sash.RefreshHardwareList();
|
||||
//Sash.SetSelHardwareFromId(Hardware);
|
||||
foreach (var Area in AreaList)
|
||||
{
|
||||
var AreaDeserealized = Area.Deserialize(newSash, ParentWindow);
|
||||
if (AreaDeserealized != null)
|
||||
{
|
||||
newSash.AreaList.Add(AreaDeserealized);
|
||||
}
|
||||
}
|
||||
return newSash;
|
||||
}
|
||||
}
|
||||
|
||||
public class JsonSplit : JsonArea
|
||||
{
|
||||
private SplitShapes m_SplitShape;
|
||||
[JsonProperty]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
internal SplitShapes SplitShape
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_SplitShape;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_SplitShape = value;
|
||||
}
|
||||
}
|
||||
|
||||
private List<JsonSplitDimension> m_SplitPositionList = new List<JsonSplitDimension>();
|
||||
[JsonProperty]
|
||||
public List<JsonSplitDimension> SplitPositionList
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_SplitPositionList;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_SplitPositionList = value;
|
||||
}
|
||||
}
|
||||
|
||||
public JsonSplit() : base(AreaTypes.SPLIT)
|
||||
{
|
||||
}
|
||||
|
||||
public JsonSplit(SplitShapes SplitShape) : base(AreaTypes.SPLIT)
|
||||
{
|
||||
m_SplitShape = SplitShape;
|
||||
}
|
||||
|
||||
internal override Area Deserialize(Area ParentArea, Window ParentWindow)
|
||||
{
|
||||
Split Split = new Split(ParentArea, ParentWindow);
|
||||
Split.SetAreaType(AreaTypes.SPLIT);
|
||||
Split.SetSplitShape(m_SplitShape, true);
|
||||
Split.SetSplitQty(m_SplitPositionList.Count - 1, true);
|
||||
//Split.AppliedDone();
|
||||
for (var SplitIndex = 0; SplitIndex <= m_SplitPositionList.Count - 1; SplitIndex++)
|
||||
{
|
||||
Split.SplitPositionList[SplitIndex].SetIsRelative(m_SplitPositionList[SplitIndex].bIsRelative);
|
||||
Split.SplitPositionList[SplitIndex].SetDimension(m_SplitPositionList[SplitIndex].dDimension);
|
||||
}
|
||||
foreach (var Area in AreaList)
|
||||
{
|
||||
var AreaDeserealized = Area.Deserialize(Split, ParentWindow);
|
||||
if (AreaDeserealized != null)
|
||||
{
|
||||
Split.AreaList.Add(AreaDeserealized);
|
||||
}
|
||||
}
|
||||
return Split;
|
||||
}
|
||||
}
|
||||
|
||||
public class JsonSplitted : JsonArea
|
||||
{
|
||||
public JsonSplitted() : base(AreaTypes.SPLITTED)
|
||||
{
|
||||
}
|
||||
|
||||
internal override Area Deserialize(Area ParentArea, Window ParentWindow)
|
||||
{
|
||||
Splitted Split = new Splitted(ParentArea, ParentWindow);
|
||||
Split.SetAreaType(AreaTypes.SPLITTED);
|
||||
//Split.AppliedDone();
|
||||
foreach (var Area in AreaList)
|
||||
{
|
||||
var AreaDeserealized = Area.Deserialize(Split, ParentWindow);
|
||||
if (AreaDeserealized != null)
|
||||
{
|
||||
Split.AreaList.Add(AreaDeserealized);
|
||||
}
|
||||
}
|
||||
|
||||
return Split;
|
||||
}
|
||||
}
|
||||
|
||||
public class JsonFill : JsonArea
|
||||
{
|
||||
private FillTypes m_FillType;
|
||||
[JsonProperty]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public FillTypes FillType
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_FillType;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_FillType = value;
|
||||
}
|
||||
}
|
||||
|
||||
public JsonFill() : base(AreaTypes.FILL)
|
||||
{
|
||||
}
|
||||
|
||||
public JsonFill(FillTypes FillType) : base(AreaTypes.FILL)
|
||||
{
|
||||
m_FillType = FillType;
|
||||
}
|
||||
|
||||
internal override Area Deserialize(Area ParentArea, Window ParentWindow)
|
||||
{
|
||||
Fill Fill = new Fill(ParentArea, ParentWindow);
|
||||
Fill.SetAreaType(AreaTypes.FILL);
|
||||
Fill.SetFillType(m_FillType);
|
||||
//Fill.AppliedDone();
|
||||
foreach (var Area in AreaList)
|
||||
{
|
||||
var AreaDeserealized = Area.Deserialize(Fill, ParentWindow);
|
||||
if (AreaDeserealized != null)
|
||||
{
|
||||
Fill.AreaList.Add(AreaDeserealized);
|
||||
}
|
||||
}
|
||||
return Fill;
|
||||
}
|
||||
}
|
||||
|
||||
public class JsonJoint
|
||||
{
|
||||
private int m_nIndex;
|
||||
[JsonProperty]
|
||||
public int nIndex
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_nIndex;
|
||||
}
|
||||
}
|
||||
|
||||
private Joints m_JointType;
|
||||
[JsonProperty]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public Joints JointType
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_JointType;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_JointType = value;
|
||||
}
|
||||
}
|
||||
|
||||
public JsonJoint(int nIndex, Joints JointType)
|
||||
{
|
||||
m_nIndex = nIndex;
|
||||
m_JointType = JointType;
|
||||
}
|
||||
|
||||
internal Joint Deserialize(Area newArea)
|
||||
{
|
||||
Joint newJoint = new Joint(newArea, m_nIndex, m_JointType);
|
||||
return newJoint;
|
||||
}
|
||||
}
|
||||
|
||||
public class JsonCurve
|
||||
{
|
||||
private GDB_TY m_CurveType;
|
||||
[JsonProperty]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public GDB_TY CurveType
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_CurveType;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_CurveType = value;
|
||||
}
|
||||
}
|
||||
|
||||
private Point3d m_ptStart;
|
||||
[JsonProperty]
|
||||
public Point3d ptStart
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_ptStart;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_ptStart = value;
|
||||
}
|
||||
}
|
||||
|
||||
private Point3d m_ptEnd;
|
||||
[JsonProperty]
|
||||
public Point3d ptEnd
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_ptEnd;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_ptEnd = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class JsonFrameDimension
|
||||
{
|
||||
private int m_nIndex;
|
||||
[JsonProperty]
|
||||
public int nIndex
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_nIndex;
|
||||
}
|
||||
}
|
||||
|
||||
private string m_sName;
|
||||
[JsonProperty]
|
||||
public string sName
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_sName;
|
||||
}
|
||||
}
|
||||
|
||||
private double m_dValue;
|
||||
[JsonProperty]
|
||||
public double dValue
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_dValue;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_dValue = value;
|
||||
}
|
||||
}
|
||||
|
||||
public JsonFrameDimension(int nIndex, string sName, double dValue)
|
||||
{
|
||||
m_nIndex = nIndex;
|
||||
m_sName = sName;
|
||||
m_dValue = dValue;
|
||||
}
|
||||
}
|
||||
|
||||
public class JsonSashDimension
|
||||
{
|
||||
private Openings m_OpeningType;
|
||||
[JsonProperty]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public Openings OpeningType
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_OpeningType;
|
||||
}
|
||||
}
|
||||
|
||||
private bool m_bHasHandle;
|
||||
[JsonProperty]
|
||||
public bool bHasHandle
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_bHasHandle;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_bHasHandle = value;
|
||||
}
|
||||
}
|
||||
|
||||
private double m_dDimension;
|
||||
[JsonProperty]
|
||||
public double dDimension
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_dDimension;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_dDimension = value;
|
||||
}
|
||||
}
|
||||
|
||||
public JsonSashDimension(Openings OpeningType, bool bHasHandle, double dDimension)
|
||||
{
|
||||
m_OpeningType = OpeningType;
|
||||
m_bHasHandle = bHasHandle;
|
||||
m_dDimension = dDimension;
|
||||
}
|
||||
}
|
||||
|
||||
public class JsonSplitDimension
|
||||
{
|
||||
private bool m_bIsRelative = false;
|
||||
[JsonProperty]
|
||||
public bool bIsRelative
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_bIsRelative;
|
||||
}
|
||||
}
|
||||
|
||||
private double m_dDimension;
|
||||
[JsonProperty]
|
||||
public double dDimension
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_dDimension;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_dDimension = value;
|
||||
}
|
||||
}
|
||||
|
||||
public JsonSplitDimension(bool bIsRelative, double dDimension)
|
||||
{
|
||||
m_bIsRelative = bIsRelative;
|
||||
m_dDimension = dDimension;
|
||||
}
|
||||
}
|
||||
|
||||
public class PolymorphicJsonConverter : JsonConverter
|
||||
{
|
||||
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
|
||||
{
|
||||
// disambiguo il tipo JsonArea grazie al capo AreaType nelle classi giuste, e le popolo di dati
|
||||
JObject item = JObject.Load(reader);
|
||||
var RawType = (string?)item["AreaType"];
|
||||
AreaTypes Type = AreaTypes.NULL;
|
||||
Enum.TryParse<AreaTypes>(RawType, out Type);
|
||||
JsonArea JsonArea = null;
|
||||
switch (Type)
|
||||
{
|
||||
case AreaTypes.FRAME:
|
||||
{
|
||||
JsonArea = new JsonFrame();
|
||||
break;
|
||||
}
|
||||
|
||||
case AreaTypes.SASH:
|
||||
{
|
||||
JsonArea = new JsonSash();
|
||||
break;
|
||||
}
|
||||
|
||||
case AreaTypes.FILL:
|
||||
{
|
||||
JsonArea = new JsonFill();
|
||||
break;
|
||||
}
|
||||
|
||||
case AreaTypes.SPLIT:
|
||||
{
|
||||
JsonArea = new JsonSplit();
|
||||
break;
|
||||
}
|
||||
|
||||
case AreaTypes.SPLITTED:
|
||||
{
|
||||
JsonArea = new JsonSplitted();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!Information.IsNothing(JsonArea))
|
||||
{
|
||||
serializer.Populate(item.CreateReader(), JsonArea);
|
||||
return JsonArea;
|
||||
}
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override bool CanConvert(Type objectType)
|
||||
{
|
||||
// gestisco solo i tipi dericati da JsonArea
|
||||
return typeof(JsonArea).IsAssignableFrom(objectType);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WebWindowJWD.Json
|
||||
{
|
||||
public static class WindowConst
|
||||
{
|
||||
public enum AreaTypes
|
||||
{
|
||||
NULL = 0,
|
||||
FRAME = 1,
|
||||
SASH = 2,
|
||||
FILL = 3,
|
||||
SPLIT = 4,
|
||||
SPLITTED = 5
|
||||
}
|
||||
|
||||
public enum FillTypes
|
||||
{
|
||||
NULL = 0,
|
||||
GLASS = 1,
|
||||
WOOD = 2
|
||||
}
|
||||
|
||||
public enum Shapes : int
|
||||
{
|
||||
RECTANGLE = 1,
|
||||
RIGHTCHAMFER = 2,
|
||||
LEFTCHAMFER = 3,
|
||||
DOUBLECHAMFER = 4,
|
||||
ARC = 11,
|
||||
ARC_FULL = 12,
|
||||
FILLET = 13,
|
||||
DOUBLEARC = 14,
|
||||
TRIANGLE = 21,
|
||||
CUSTOM = 100
|
||||
}
|
||||
|
||||
public enum SplitShapes : int
|
||||
{
|
||||
NULL = 0,
|
||||
VERTICAL = 1,
|
||||
HORIZONTAL = 2,
|
||||
GRID = 3,
|
||||
CUSTOM = 100
|
||||
}
|
||||
|
||||
public enum Joints : int
|
||||
{
|
||||
ANGLED = 1,
|
||||
FULL_H = 2,
|
||||
FULL_V = 3
|
||||
}
|
||||
|
||||
public enum SashTypes : int
|
||||
{
|
||||
NULL = 0,
|
||||
ACTIVE = 1,
|
||||
INACTIVE = 2,
|
||||
ACTIVE_IN = 3,
|
||||
ACTIVE_OUT = 4,
|
||||
INACTIVE_IN = 5,
|
||||
INACTIVE_OUT = 6
|
||||
}
|
||||
|
||||
public enum Openings : int
|
||||
{
|
||||
NULL = 0,
|
||||
TURNONLY_LEFT = 1,
|
||||
TURNONLY_RIGHT = 2,
|
||||
TILTTURN_LEFT = 3,
|
||||
TILTTURN_RIGHT = 4,
|
||||
TILTONLY_TOP = 5,
|
||||
TILTONLY_BOTTOM = 6,
|
||||
PIVOT = 7,
|
||||
FIXED = 8,
|
||||
COMPLANARSLIDE_LEFT = 9,
|
||||
COMPLANARSLIDE_RIGHT = 10,
|
||||
LIFTSLIDE_LEFT = 11,
|
||||
LIFTSLIDE_RIGHT = 12
|
||||
}
|
||||
|
||||
public enum OpeningTypes : int
|
||||
{
|
||||
NULL = 0,
|
||||
TURNONLY = 1,
|
||||
TILTTURN = 2,
|
||||
TILTONLY = 3,
|
||||
PIVOT = 4,
|
||||
FIXED = 5,
|
||||
COMPLANARSLIDE = 6,
|
||||
LIFTSLIDE = 7
|
||||
}
|
||||
|
||||
public enum OpeningSides : int
|
||||
{
|
||||
NULL = 0,
|
||||
LEFT = 1,
|
||||
RIGHT = 2
|
||||
}
|
||||
|
||||
public enum OrientationSash : int
|
||||
{
|
||||
NULL = 0,
|
||||
VERTICAL = 1,
|
||||
HORIZONTAL = 2
|
||||
}
|
||||
|
||||
public enum GDB_TY
|
||||
{
|
||||
NONE = 0,
|
||||
GROUP = 2,
|
||||
GEO_VECTOR = 128,
|
||||
GEO_POINT = 129,
|
||||
GEO_FRAME = 130,
|
||||
CRV_LINE = 256,
|
||||
CRV_ARC = 257,
|
||||
CRV_BEZ = 258,
|
||||
CRV_COMPO = 259,
|
||||
SRF_MESH = 512,
|
||||
SRF_FRGN = 513,
|
||||
SRF_BEZ = 514,
|
||||
VOL_ZMAP = 1024,
|
||||
EXT_TEXT = 2048,
|
||||
EXT_DIMENSION = 2049
|
||||
}
|
||||
|
||||
public enum GDB_ID
|
||||
{
|
||||
ROOT = 0,
|
||||
NULL = -1,
|
||||
SEL = -2,
|
||||
GRID = -3,
|
||||
CURRPART = -4,
|
||||
CURRLAYER = -5,
|
||||
SELPART = -6,
|
||||
SELLAYER = -7
|
||||
}
|
||||
|
||||
// Specifies the display state of an element.
|
||||
public enum Visibility
|
||||
{
|
||||
// Display the element.
|
||||
VISIBLE,
|
||||
// Do not display the element, but reserve space for the element in layout.
|
||||
HIDDEN,
|
||||
// Do not display the element, and do not reserve space for it in layout.
|
||||
COLLAPSED
|
||||
}
|
||||
|
||||
//LUA
|
||||
public enum LuaShapes {
|
||||
RECT = 1,
|
||||
CHAMFER_SIDE = 2,
|
||||
CHAMFER = 3,
|
||||
ROUND_ARC = 4,
|
||||
SEGMENTAL_ARC = 5,
|
||||
POINTED_ARC = 6,
|
||||
TRIANGLE = 7
|
||||
}
|
||||
|
||||
public struct Point3d
|
||||
{
|
||||
public double x;
|
||||
|
||||
public double y;
|
||||
|
||||
public double z;
|
||||
|
||||
public Point3d(double dX, double dY, double dZ)
|
||||
{
|
||||
this = default(Point3d);
|
||||
x = dX;
|
||||
y = dY;
|
||||
z = dZ;
|
||||
}
|
||||
|
||||
public Point3d(ref Point3d PtP)
|
||||
{
|
||||
this = default(Point3d);
|
||||
x = PtP.x;
|
||||
y = PtP.y;
|
||||
z = PtP.z;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return x.ToString("F3", CultureInfo.InvariantCulture) + "," + y.ToString("F3", CultureInfo.InvariantCulture) + "," + z.ToString("F3", CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public static Point3d ORIG()
|
||||
{
|
||||
return new Point3d(0.0, 0.0, 0.0);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Razor">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<SupportedPlatform Include="browser" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="EgwCoreLib.Razor" Version="1.5.2507.1815" />
|
||||
<PackageReference Include="EgwCoreLib.Utils" Version="1.5.2507.1815" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.18" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,276 @@
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<div class="card text-center table-svg">
|
||||
<div class="card-header" style="background-color: #d5f1f2;">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<ul class="nav nav-tabs card-header-tabs">
|
||||
<li class="nav-item">
|
||||
<a data-target="#Frame" class="@tabNavCss(CompileStep.Frame)" aria-current="true" @onclick="() => DoSelectAndPreview(CompileStep.Frame)">Frame</a>
|
||||
</li>
|
||||
@if (m_SplitList.Count > 0)
|
||||
{
|
||||
<li class="nav-item">
|
||||
<a data-target="#Split" class="@tabNavCss(CompileStep.Split)" aria-current="true" @onclick="() => DoSelectAndPreview(CompileStep.Split)">Split</a>
|
||||
</li>
|
||||
}
|
||||
@if (m_SashList.Count > 0)
|
||||
{
|
||||
<li class="nav-item">
|
||||
<a data-target="#Sash" class="@tabNavCss(CompileStep.Sash)" aria-current="true" @onclick="() => DoSelectAndPreview(CompileStep.Sash)">Sash</a>
|
||||
</li>
|
||||
}
|
||||
<li class="nav-item">
|
||||
<a data-target="#Fill" class="@tabNavCss(CompileStep.Fill)" aria-current="true" @onclick="() => DoSelectAndPreview(CompileStep.Fill)">Fill</a>
|
||||
</li>
|
||||
</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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body bg-transparent">
|
||||
<div class="alert alert-light text-center display-4">
|
||||
@if (currStep == CompileStep.Frame)
|
||||
{
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="alert alert-light text-start p-1 display-4 w-50">
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text" for="FrameShape">Shape</label>
|
||||
<select class="form-select" @bind="@m_Frame.SelShapeIndex">
|
||||
<option value="0">Rectangle</option>
|
||||
<option value="1">Right Chamfer</option>
|
||||
<option value="2">Left Chamfer</option>
|
||||
<option value="3">Double Chamfer</option>
|
||||
<option value="4">Arc</option>
|
||||
<option value="5">Arc Full</option>
|
||||
<option value="6">Double Arc</option>
|
||||
<option value="7">Triangle</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5 class="card-title">Dimension</h5>
|
||||
@foreach (FrameDimension dimension in m_Frame.DimensionList)
|
||||
{
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text" id="IndexDimFrame">@dimension.nIndex</span>
|
||||
<span class="input-group-text" id="NameDimFrame">@dimension.sName</span>
|
||||
<input type="number" class="form-control" aria-label="@dimension.dValue" @bind="@dimension.dValue">
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5 class="card-title">Joints frame</h5>
|
||||
@foreach (Joint joint in m_Frame.JointList)
|
||||
{
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text" for="IndexJoint">@joint.nIndex</label>
|
||||
<select class="form-select" @bind="@joint.SelJointTypeIndex">
|
||||
<option value="0">Angled</option>
|
||||
<option value="1">Full H</option>
|
||||
<option value="2">Full V</option>
|
||||
</select>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
@if (m_SashList.Count == 0)
|
||||
{
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5 class="card-title">Bottom rail</h5>
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text" id="BottomRailQty">Quantity</span>
|
||||
<input type="number" class="form-control" aria-label="BottomRailQty" @bind="@m_Frame.BottomRailQty">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else if (currStep == CompileStep.Split)
|
||||
{
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="alert alert-light text-start p-1 display-4 w-50">
|
||||
@foreach (var item in SplitList)
|
||||
{
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text" id="basic-addon1Split">Number</span>
|
||||
<input type="number" class="form-control" placeholder="0" aria-label="basic-addon1Split" @bind="@item.nSplitQty">
|
||||
</div>
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text" for="basic-addon2Split">Shape</label>
|
||||
<select class="form-select" @bind="@item.SelSplitShapeIndex">
|
||||
<option value="0">Vertical</option>
|
||||
<option value="1">Horizontal</option>
|
||||
<option value="2">Grid</option>
|
||||
<option value="3">Custom</option>
|
||||
</select>
|
||||
</div>
|
||||
@foreach (var dim in item.SplitPositionList)
|
||||
{
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text" id="basic-addon3Split">Altezza area inferiore</span>
|
||||
<input type="number" class="form-control" aria-label="basic-addon2Split" @bind="@dim.dDimension">
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@* <button class="btn btn-sm btn-primary" title="Reset selezione" @onclick="DoReset"><i class="fa-solid fa-arrow-rotate-right"></i></button> *@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else if (currStep == CompileStep.Sash)
|
||||
{
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="alert alert-light text-start p-1 display-4 w-50">
|
||||
@foreach (var item in SashList)
|
||||
{
|
||||
<div class="input-group mb-2">
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text" id="NumberSash">Number</span>
|
||||
<input type="number" class="form-control" aria-label="NumberSash" @bind="@item.nSashQty">
|
||||
</div>
|
||||
</div>
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5 class="card-title">Orientation</h5>
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text" for="OrientationSash">Tipology</label>
|
||||
<select class="form-select" @bind="@item.SelOrientationSashTypeIndex">
|
||||
<option value="0">Vertical</option>
|
||||
<option value="1">Horizontal</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@foreach (SashDimension sash in item.SashList)
|
||||
{
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
@if (item.SashList.Count == 1)
|
||||
{
|
||||
<h5 class="card-title">Opening</h5>
|
||||
}
|
||||
else
|
||||
{
|
||||
<h5 class="card-title">Sash opening @(item.SashList.IndexOf(sash) + 1)</h5>
|
||||
}
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text" for="OpeningSash">Tipology</label>
|
||||
<select class="form-select" @bind="@sash.SelOpeningTypeIndex">
|
||||
<option value="0">A battente sinistra</option>
|
||||
<option value="1">A battente destra</option>
|
||||
<option value="2">Ad anta-ribalta sinistra</option>
|
||||
<option value="3">Ad anta-ribalta destra</option>
|
||||
<option value="4">5</option>
|
||||
<option value="5">7</option>
|
||||
<option value="6">8</option>
|
||||
<option value="7">9</option>
|
||||
<option value="8">10</option>
|
||||
<option value="9">11</option>
|
||||
<option value="10">12</option>
|
||||
<option value="11">13</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text" id="Dimension">Dimension</span>
|
||||
<input type="number" class="form-control" aria-label="DimensionSash" @bind="@sash.dDimension">
|
||||
</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" id="Handle" @bind="@sash.bHasHandle">
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<label class="form-check-label fs-6 text-dark" for="HandleSashLabel">Handle</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5 class="card-title">Sash joints</h5>
|
||||
@foreach (Joint joint in item.JointList)
|
||||
{
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text" for="IndexJoint">@joint.nIndex</label>
|
||||
<select class="form-select" @bind="@joint.SelJointTypeIndex">
|
||||
<option value="0">Angled</option>
|
||||
<option value="1">Full H</option>
|
||||
<option value="2">Full V</option>
|
||||
</select>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5 class="card-title">Bottom rail</h5>
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text" id="BottomRailQty">Quantity</span>
|
||||
<input type="number" class="form-control" aria-label="BottomRailQty" @bind="@item.SashBottomRailQty">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@* <button class="btn btn-sm btn-primary" title="Reset selezione" @onclick="DoReset"><i class="fa-solid fa-arrow-rotate-right"></i></button> *@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else if (currStep == CompileStep.Fill)
|
||||
{
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="alert alert-light text-start p-1 display-4 w-50">
|
||||
@foreach (var Fill in FillList)
|
||||
{
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
@if (FillList.Count == 1)
|
||||
{
|
||||
<h5 class="card-title">Fill</h5>
|
||||
}
|
||||
else
|
||||
{
|
||||
<h5 class="card-title">Fill @(FillList.IndexOf(Fill) + 1)</h5>
|
||||
}
|
||||
<div class="input-group mb-2">
|
||||
<select class="form-select" @bind="@Fill.SelFillTypeIndex">
|
||||
<option value="0">Glass</option>
|
||||
<option value="1">Wood</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
@outSvg
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,245 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Reflection.Metadata;
|
||||
using System.Runtime.Intrinsics.X86;
|
||||
using System.Text.Json.Serialization;
|
||||
using WebWindowJWD.DTO;
|
||||
using WebWindowJWD.Json;
|
||||
using static WebWindowJWD.Json.WindowConst;
|
||||
|
||||
namespace WebWindowJWD
|
||||
{
|
||||
public partial class WebWindowJWDInput : IDisposable
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Parameter]
|
||||
public string CssSvg { get; set; } = "responsive-svg";
|
||||
|
||||
[Parameter]
|
||||
public string CurrJwd
|
||||
{
|
||||
get => m_CurrJwd;
|
||||
set
|
||||
{
|
||||
if (m_CurrJwd != value)
|
||||
{
|
||||
m_CurrJwd = value;
|
||||
JsonWindow WindowFromJson = JsonConvert.DeserializeObject<JsonWindow>(m_CurrJwd, 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>();
|
||||
SearchInAreaList(m_CurrWindow.AreaList[0]);
|
||||
EC_OnUpdate.InvokeAsync(m_CurrJwd);
|
||||
}
|
||||
if (m_CurrWindow != null)
|
||||
{
|
||||
m_FillList = new List<Fill>();
|
||||
m_SashList = new List<Sash>();
|
||||
m_SplitList = new List<Split>();
|
||||
SearchInAreaList(m_CurrWindow.AreaList[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<bool> EC_OnClose { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<string> EC_OnUpdate { get; set; }
|
||||
|
||||
public List<Fill> FillList
|
||||
{
|
||||
get => m_FillList;
|
||||
}
|
||||
|
||||
[Parameter]
|
||||
public string LiveSVG
|
||||
{
|
||||
get => m_SelSVG;
|
||||
set => m_SelSVG = value;
|
||||
}
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (m_CurrWindow != null)
|
||||
{
|
||||
m_CurrWindow.OnPreview -= M_CurrWindow_OnPreview;
|
||||
m_CurrWindow = null;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Enums
|
||||
|
||||
protected enum CompileStep
|
||||
{
|
||||
Template = 0,
|
||||
Frame = 1,
|
||||
Split,
|
||||
Sash,
|
||||
Fill
|
||||
}
|
||||
|
||||
#endregion Protected Enums
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
protected Frame Frame
|
||||
{
|
||||
get => m_Frame;
|
||||
set => m_Frame = value;
|
||||
}
|
||||
|
||||
protected string m_CurrJwd { get; set; }
|
||||
protected string m_SelSVG { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Componente SVG da mostrare
|
||||
/// </summary>
|
||||
protected MarkupString outSvg
|
||||
{
|
||||
get
|
||||
{
|
||||
// aggiunta gestione classe svg per posizionamento con costraints
|
||||
var newSvg = LiveSVG.Replace("<svg", $"<svg class=\"{CssSvg}\"");
|
||||
return (MarkupString)newSvg;
|
||||
}
|
||||
}
|
||||
|
||||
protected List<Sash> SashList
|
||||
{
|
||||
get => m_SashList;
|
||||
}
|
||||
|
||||
protected List<Split> SplitList
|
||||
{
|
||||
get => m_SplitList;
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected async Task DoClose()
|
||||
{
|
||||
await EC_OnClose.InvokeAsync(true);
|
||||
}
|
||||
|
||||
protected async Task DoPreviewSvg()
|
||||
{
|
||||
var CurrJwd = JsonConvert.SerializeObject(m_CurrWindow.Serialize(), Formatting.Indented);
|
||||
await EC_OnUpdate.InvokeAsync(CurrJwd);
|
||||
}
|
||||
|
||||
protected async Task DoSave()
|
||||
{
|
||||
//manca salvataggio JWD
|
||||
await EC_OnClose.InvokeAsync(true);
|
||||
}
|
||||
|
||||
protected async void DoSelectAndPreview(CompileStep newStep)
|
||||
{
|
||||
currStep = newStep;
|
||||
await DoPreviewSvg();
|
||||
}
|
||||
|
||||
protected void SearchInAreaList(Area node)
|
||||
{
|
||||
if (node != null)
|
||||
{
|
||||
switch (node.AreaType)
|
||||
{
|
||||
case AreaTypes.FRAME:
|
||||
{
|
||||
m_Frame = (Frame)node;
|
||||
break;
|
||||
}
|
||||
case AreaTypes.SASH:
|
||||
{
|
||||
m_SashList.Add((Sash)node);
|
||||
break;
|
||||
}
|
||||
case AreaTypes.FILL:
|
||||
{
|
||||
m_FillList.Add((Fill)node);
|
||||
break;
|
||||
}
|
||||
case AreaTypes.SPLIT:
|
||||
{
|
||||
m_SplitList.Add((Split)node);
|
||||
break;
|
||||
}
|
||||
}
|
||||
foreach (var item in node.AreaList)
|
||||
{
|
||||
SearchInAreaList(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private CompileStep currStep = CompileStep.Frame;
|
||||
|
||||
private List<Fill> m_FillList = new List<Fill>();
|
||||
|
||||
private Frame m_Frame;
|
||||
|
||||
private List<Sash> m_SashList = new List<Sash>();
|
||||
|
||||
private List<Split> m_SplitList = new List<Split>();
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private Window? m_CurrWindow { get; set; } = null;
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private void AdvStep(CompileStep newStep)
|
||||
{
|
||||
currStep = newStep;
|
||||
}
|
||||
|
||||
private void M_CurrWindow_OnPreview(object? sender, OnPreviewEventArgs e)
|
||||
{
|
||||
EC_OnUpdate.InvokeAsync(e.sJwd);
|
||||
#if false
|
||||
var CurrJwd = JsonConvert.SerializeObject(m_CurrWindow.Serialize(), Formatting.Indented);
|
||||
EC_OnUpdate.InvokeAsync(CurrJwd);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calcola il css del tab selezionato
|
||||
/// </summary>
|
||||
/// <param name="testStep"></param>
|
||||
/// <returns></returns>
|
||||
private string tabNavCss(CompileStep testStep)
|
||||
{
|
||||
return testStep.Equals(currStep) ? "nav-link active fw-bold" : "nav-link text-secondary";
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
.my-component {
|
||||
border: 2px dashed red;
|
||||
padding: 1em;
|
||||
margin: 1em 0;
|
||||
background-image: url('background.png');
|
||||
}
|
||||
|
||||
|
||||
/* gestione SVG responsive */
|
||||
.responsive-svg {
|
||||
/* SVG scala a fit del container */
|
||||
width: 100%;
|
||||
/* Altezza massima in rem (caratteri) */
|
||||
height: 40rem;
|
||||
/* Removes extra space below SVG */
|
||||
display: block;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
@using Microsoft.AspNetCore.Components.Web
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 378 B |
@@ -0,0 +1,6 @@
|
||||
// This is a JavaScript module that is loaded on demand. It can export any number of
|
||||
// functions, and may import other JavaScript modules if required.
|
||||
|
||||
export function showPrompt(message) {
|
||||
return prompt(message, 'Type anything here');
|
||||
}
|
||||
Reference in New Issue
Block a user