Merge branch 'release/GestioneSoglie_04'
This commit is contained in:
@@ -21,43 +21,23 @@
|
||||
<div class="@NavMenuCssClass" @onclick="ToggleNavMenu">
|
||||
<nav class="flex-column">
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="Home" Match="NavLinkMatch.All">
|
||||
<span class="bi bi-house-fill px-2 fs-4" aria-hidden="true"></span>
|
||||
<NavLink class="nav-link" href="EditJWD" Match="NavLinkMatch.All">
|
||||
<span class="fa-solid fa-gear px-2 fs-4" aria-hidden="true"></span>
|
||||
@if (showText)
|
||||
{
|
||||
<span class="@hideText">Home</span>
|
||||
<span class="@hideText">EditJWD</span>
|
||||
}
|
||||
</NavLink>
|
||||
</div>
|
||||
@* <div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="TestComponentTemplate">
|
||||
<span class="bi bi-house-fill px-2 fs-4" aria-hidden="true"></span> <span class="@hideText">TestTemplate</span>
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="BaseEdit">
|
||||
<span class="fa-solid fa-pencil px-2 fs-4" aria-hidden="true"></span> <span class="@hideText">BaseEdit</span>
|
||||
</NavLink>
|
||||
</div>
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="TestComponentJWD">
|
||||
<span class="bi bi-house-fill px-2 fs-4" aria-hidden="true"></span> <span class="@hideText">TestJWD</span>
|
||||
</NavLink>
|
||||
</div>
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="Gerarchia">
|
||||
<span class="bi bi-house-fill px-2 fs-4" aria-hidden="true"></span> <span class="@hideText"> Gerarchia</span>
|
||||
</NavLink>
|
||||
</div> *@
|
||||
<div class="nav-item px-3">
|
||||
@* <div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="EditJWD">
|
||||
<span class="fa-solid fa-gear px-2 fs-4" aria-hidden="true"></span> <span class="@hideText">EditJWD</span>
|
||||
</NavLink>
|
||||
</div>
|
||||
@* <div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="Aedifica">
|
||||
<span class="bi bi-house-fill px-2 fs-4" aria-hidden="true"></span> <span class="@hideText">Aedifica</span>
|
||||
</NavLink>
|
||||
</div>
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="uitest">
|
||||
<span class="bi bi-house-fill px-2 fs-4" aria-hidden="true"></span> <span class="@hideText">UI Testing</span>
|
||||
</NavLink>
|
||||
</div> *@
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
@page "/BaseEdit"
|
||||
@rendermode InteractiveServer
|
||||
|
||||
<PageTitle>BaseEdit</PageTitle>
|
||||
|
||||
<WebWindowComplex.TableComp ListPayload="SetupList"
|
||||
LiveData="CurrData"
|
||||
baseUser="User"
|
||||
EC_ActionReq="DoAction"
|
||||
EC_DoUpdate="ExecRequest"
|
||||
EC_OnClose="CloseObj">
|
||||
</WebWindowComplex.TableComp>
|
||||
|
||||
|
||||
@if (!string.IsNullOrEmpty(outClose))
|
||||
{
|
||||
<div class="alert alert-danger fs-4">
|
||||
@outClose
|
||||
</div>
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(outSave))
|
||||
{
|
||||
<div class="alert alert-success fs-4">
|
||||
@outSave
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body small">
|
||||
@JsonSer
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,372 @@
|
||||
using Egw.Window.Data;
|
||||
using EgwCoreLib.Lux.Core;
|
||||
using EgwCoreLib.Lux.Core.RestPayload;
|
||||
using EgwCoreLib.Lux.Data.Services;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Newtonsoft.Json;
|
||||
using WebWindowComplex;
|
||||
using WebWindowComplex.DTO;
|
||||
using static WebWindowComplex.LayoutConst;
|
||||
|
||||
namespace Test.UI.Components.Pages
|
||||
{
|
||||
public partial class BaseEdit
|
||||
{
|
||||
#region Public Fields
|
||||
|
||||
public string InitialJwd = "";
|
||||
|
||||
#endregion Public Fields
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
DLService.PipeSvg.EA_NewMessage -= PipeSvg_EA_NewMessage;
|
||||
DLService.PipeShape.EA_NewMessage -= PipeShape_EA_NewMessage;
|
||||
DLService.PipeHwOpt.EA_NewMessage -= PipeHwOption_EA_NewMessage;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
/// <summary>
|
||||
/// Predisposizione valori live SVG/JWD
|
||||
/// </summary>
|
||||
protected LivePayload CurrData = new LivePayload();
|
||||
|
||||
/// <summary>
|
||||
/// Livello di accesso
|
||||
/// -- true: utente base (versione semplificata)
|
||||
/// -- false: utente avanzato (versione completa)
|
||||
/// </summary>
|
||||
protected bool User = false;
|
||||
|
||||
protected Dictionary<int, string> currGroupShape = new Dictionary<int, string>();
|
||||
protected Dictionary<int, string> currHwOption = new Dictionary<int, string>();
|
||||
protected string currJwd = "...";
|
||||
protected Dictionary<string, string> m_CurrArgs = new Dictionary<string, string>();
|
||||
protected string prevJwd = "";
|
||||
|
||||
/// <summary>
|
||||
/// Configurazione elenchi anagrafiche
|
||||
/// </summary>
|
||||
protected BaseListPayload SetupList = new BaseListPayload();
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
protected List<string> AvailColorMaterialList { get; set; } = new List<string>()
|
||||
{
|
||||
new string("White"),
|
||||
new string("Black"),
|
||||
new string("Blu")
|
||||
};
|
||||
|
||||
protected List<string> AvailFamilyHardwareList { get; set; } = new List<string>()
|
||||
{
|
||||
new string("ArTech"),
|
||||
new string("ArTechPlana")
|
||||
};
|
||||
|
||||
protected List<string> AvailGlassList { get; set; } = new List<string>()
|
||||
{
|
||||
new string("Vetro BE 2S 4/12/4"),
|
||||
new string("Vetro BE 2S 4/16/4"),
|
||||
new string("Vetro BE 3S 4/12/4/12/4"),
|
||||
new string("Vetro BE 3S 4/16/4/16/4"),
|
||||
new string("Vetro BE 2S 4T/12/4T"),
|
||||
new string("Vetro BE 2S 4T/16/4T")
|
||||
};
|
||||
|
||||
protected List<Hardware> AvailHardwareList { get; set; } = new List<Hardware>();
|
||||
|
||||
protected List<string> AvailMaterialList { get; set; } = new List<string>()
|
||||
{
|
||||
new string("Pino"),
|
||||
new string("Abete")
|
||||
};
|
||||
|
||||
protected List<string> AvailProfileList { get; set; } = new List<string>()
|
||||
{
|
||||
new string("Profilo78"),
|
||||
new string("ProfiloSaomad")
|
||||
};
|
||||
|
||||
protected Dictionary<string, List<Threshold>> AvailThreshold { get; set; } = new Dictionary<string, List<Threshold>>()
|
||||
{
|
||||
{"Profilo78", new List<Threshold>() { new Threshold(3, "Bottom"), new Threshold(1, "Threshold")}},
|
||||
{"ProfiloSaomad", new List<Threshold>(){ new Threshold(3, "Bottom"), new Threshold(2, "BottomWaterdrip"), new Threshold(1, "Threshold")}}
|
||||
};
|
||||
|
||||
[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 => (MarkupString)currJwd.Replace(Environment.NewLine, "<br/>").Replace(" ", " ");
|
||||
}
|
||||
|
||||
protected string SelColorMaterial { get; set; } = "";
|
||||
protected string SelFamilyHardware { get; set; } = "";
|
||||
protected string SelGlass { get; set; } = "";
|
||||
protected string SelMaterial { get; set; } = "";
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected override void OnAfterRender(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
{
|
||||
// JS interop or data fetches go here
|
||||
isInteractive = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
ConfInit();
|
||||
User = true;
|
||||
Random random = new Random();
|
||||
CalcUid = Convert.ToString(random.Next(1000, 10000));
|
||||
windowUid = CalcUid;
|
||||
//InitialJwd = File.ReadAllText("Data\\FinestraSplitGrid.jwd");
|
||||
InitialJwd = File.ReadAllText("Data\\AntaDoppia.jwd");
|
||||
//InitialJwd = File.ReadAllText("Data\\ArcoAntaDoppia.jwd");
|
||||
currJwd = InitialJwd;
|
||||
// rileggo altri dati
|
||||
await ReloadData();
|
||||
// preparo conf oggetti x controllo
|
||||
SetupList = new BaseListPayload()
|
||||
{
|
||||
ColorMaterial = AvailColorMaterialList,
|
||||
FamilyHardware = AvailFamilyHardwareList,
|
||||
Glass = AvailGlassList,
|
||||
Hardware = AvailHardwareList,
|
||||
Material = AvailMaterialList,
|
||||
Profile = AvailProfileList,
|
||||
Threshold = AvailThreshold
|
||||
};
|
||||
CurrData = new LivePayload()
|
||||
{
|
||||
CurrJwd = InitialJwd,
|
||||
SvgPreview = currSvg,
|
||||
DictShape = currGroupShape,
|
||||
DictOptionsXml = currHwOption
|
||||
};
|
||||
DLService.PipeSvg.EA_NewMessage += PipeSvg_EA_NewMessage;
|
||||
DLService.PipeShape.EA_NewMessage += PipeShape_EA_NewMessage;
|
||||
DLService.PipeHwOpt.EA_NewMessage += PipeHwOption_EA_NewMessage;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private string apiUrl = "";
|
||||
private string calcTag = "";
|
||||
private string CalcUid = "CurrWindow";
|
||||
private string windowUid = "CurrWindow";
|
||||
private string cFileHardware = "Hardware/Setup.json";
|
||||
private string currSvg = "";
|
||||
private string GenericBasePath = "";
|
||||
|
||||
private string colorMassUpdate;
|
||||
private string familyHWMassUpdate;
|
||||
private string glassMassUpdate;
|
||||
private Hardware hardwareMassUpdate;
|
||||
private string materialMassUpdate;
|
||||
private string profileMassUpdate;
|
||||
|
||||
/// <summary>
|
||||
/// Semaforo x definire se sia già in modalità ionterattiva o di prerendering
|
||||
/// </summary>
|
||||
private bool isInteractive = false;
|
||||
|
||||
private string outClose = "";
|
||||
private string outSave = "";
|
||||
|
||||
private string imgBasePath = "";
|
||||
|
||||
private string channelHwOpt = "";
|
||||
private string channelShape = "";
|
||||
private string channelSvg = "";
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Effettua chiusura oggetto con eventuale save
|
||||
/// </summary>
|
||||
/// <param name="reqSave"></param>
|
||||
private void CloseObj(bool reqSave)
|
||||
{
|
||||
outClose = !reqSave ? "Richiesto chiusura!" : "";
|
||||
outSave = reqSave ? "Richiesto salvataggio!" : "";
|
||||
}
|
||||
|
||||
private void ConfInit()
|
||||
{
|
||||
apiUrl = Config.GetValue<string>("ServerConf:Prog.ApiUrl") ?? "";
|
||||
imgBasePath = Config.GetValue<string>("ServerConf:ImageBaseUrl") ?? "";
|
||||
GenericBasePath = Config.GetValue<string>("ServerConf:GenericBaseUrl") ?? "";
|
||||
calcTag = Config.GetValue<string>("ServerConf:CalcTag") ?? "";
|
||||
channelSvg = Config.GetValue<string>("ServerConf:ChannelSvg") ?? "";
|
||||
channelShape = Config.GetValue<string>("ServerConf:ChannelShape") ?? "";
|
||||
channelHwOpt = Config.GetValue<string>("ServerConf:ChannelHwOpt") ?? "";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Esecuzione azione richiesta
|
||||
/// </summary>
|
||||
/// <param name="actReq">Azione richiesta</param>
|
||||
private void DoAction(DataAction actReq)
|
||||
{
|
||||
switch (actReq)
|
||||
{
|
||||
case DataAction.None:
|
||||
break;
|
||||
|
||||
case DataAction.ResetDictShape:
|
||||
CurrData.DictShape = new Dictionary<int, string>();
|
||||
break;
|
||||
|
||||
case DataAction.ResetHwOpt:
|
||||
CurrData.DictOptionsXml = new Dictionary<int, string>();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Esecuzione richiesta
|
||||
/// </summary>
|
||||
/// <param name="CurrArgs"></param>
|
||||
/// <returns></returns>
|
||||
private async Task ExecRequest(Dictionary<string, string> CurrArgs)
|
||||
{
|
||||
// Proseguo solo se sono in interattivo (NO prerender pagina)
|
||||
if (isInteractive)
|
||||
{
|
||||
outClose = "";
|
||||
outSave = "";
|
||||
// verifico se contiene JWD, lo aggiorno
|
||||
if (CurrArgs.ContainsKey("SerializedData"))
|
||||
{
|
||||
currJwd = CurrArgs["SerializedData"];
|
||||
CurrData.CurrJwd = currJwd;
|
||||
}
|
||||
// se il SSE variato --> invio
|
||||
if (!currJwd.Equals(prevJwd) || !EgwCoreLib.Utils.DictUtils.DictAreEqual(m_CurrArgs, CurrArgs))
|
||||
{
|
||||
m_CurrArgs = CurrArgs;
|
||||
prevJwd = currJwd;
|
||||
CalcRequestDTO calcRequestDTO = new CalcRequestDTO();
|
||||
calcRequestDTO.EnvType = EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW;
|
||||
calcRequestDTO.DictExec = m_CurrArgs;
|
||||
// chiamo la chiamata POST alla API, che manda la richiesta via REDIS
|
||||
await ICService.CallRestPost($"{apiUrl}/{GenericBasePath}", $"{calcTag}/{CalcUid}", calcRequestDTO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async void PipeHwOption_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.StartsWith($"{channelHwOpt}:{windowUid}") && currArgs.newMessage.Length > 2)
|
||||
{
|
||||
// deserializzo il dizionario delle risposte...
|
||||
Dictionary<int, string> rawDict = JsonConvert.DeserializeObject<Dictionary<int, string>>(currArgs.newMessage) ?? new Dictionary<int, string>();
|
||||
if (rawDict.Count > 0)
|
||||
{
|
||||
currHwOption = rawDict;
|
||||
CurrData.DictOptionsXml = currHwOption;
|
||||
}
|
||||
}
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
private async void PipeShape_EA_NewMessage(object? sender, EventArgs e)
|
||||
{
|
||||
// aggiorno visualizzazione
|
||||
PubSubEventArgs currArgs = (PubSubEventArgs)e;
|
||||
// conversione on-the-fly SVG da mostrare
|
||||
if (!string.IsNullOrEmpty(currArgs.newMessage) && currArgs.newMessage.Length > 2)
|
||||
{
|
||||
if (currArgs.msgUid.StartsWith($"{channelShape}:{windowUid}"))
|
||||
{
|
||||
// deserializzo il dizionario delle risposte...
|
||||
var rawDict = JsonConvert.DeserializeObject<Dictionary<int, string>>(currArgs.newMessage);
|
||||
currGroupShape = rawDict ?? new Dictionary<int, string>();
|
||||
CurrData.DictShape = currGroupShape;
|
||||
}
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
private async void PipeSvg_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($"{channelSvg}:{windowUid}"))
|
||||
{
|
||||
currSvg = currArgs.newMessage;
|
||||
CurrData.SvgPreview = currArgs.newMessage;
|
||||
}
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Rilettura dati
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private async Task ReloadData()
|
||||
{
|
||||
//return base.OnInitializedAsync();
|
||||
AvailHardwareList = new List<Hardware>();
|
||||
if (File.Exists(cFileHardware))
|
||||
{
|
||||
string rawValHW = File.ReadAllText(cFileHardware);
|
||||
var rawListHW = JsonConvert.DeserializeObject<List<Hardware>>(rawValHW) ?? new List<Hardware>();
|
||||
foreach (var item in rawListHW)
|
||||
{
|
||||
AvailHardwareList.Add(item);
|
||||
}
|
||||
}
|
||||
await Task.Delay(100);
|
||||
}
|
||||
|
||||
private void updateInfoJwd(string currSer, string? newFamilyHardware, Hardware? newHardware, string? newColorMaterial, string? newMaterial, string? newGlass, string? newProfile)
|
||||
{
|
||||
var newJwd = SerialMan.MassUpdate(currSer, newFamilyHardware, newHardware, newColorMaterial, newMaterial, newGlass, newProfile);
|
||||
CurrData.CurrJwd = newJwd;
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
@page "/EditJWD"
|
||||
@page "/"
|
||||
@page "/EditJWD"
|
||||
@rendermode InteractiveServer
|
||||
|
||||
<PageTitle>EditJWD</PageTitle>
|
||||
@@ -68,6 +69,7 @@
|
||||
|
||||
<WebWindowComplex.TableComp ListPayload="SetupList"
|
||||
LiveData="CurrData"
|
||||
baseUser="User"
|
||||
EC_ActionReq="DoAction"
|
||||
EC_DoUpdate="ExecRequest"
|
||||
EC_OnClose="CloseObj">
|
||||
|
||||
@@ -39,6 +39,13 @@ namespace Test.UI.Components.Pages
|
||||
/// </summary>
|
||||
protected LivePayload CurrData = new LivePayload();
|
||||
|
||||
/// <summary>
|
||||
/// Livello di accesso
|
||||
/// -- true: utente base (versione semplificata)
|
||||
/// -- false: utente avanzato (versione completa)
|
||||
/// </summary>
|
||||
protected bool User = false;
|
||||
|
||||
protected Dictionary<int, string> currGroupShape = new Dictionary<int, string>();
|
||||
protected Dictionary<int, string> currHwOption = new Dictionary<int, string>();
|
||||
protected string currJwd = "...";
|
||||
@@ -132,10 +139,12 @@ namespace Test.UI.Components.Pages
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
ConfInit();
|
||||
User = false;
|
||||
Random random = new Random();
|
||||
CalcUid = Convert.ToString(random.Next(1000, 10000));
|
||||
windowUid = CalcUid;
|
||||
//InitialJwd = File.ReadAllText("Data\\FinestraSplitGrid.jwd");
|
||||
//InitialJwd = File.ReadAllText("Data\\FinestraSplitVert.jwd");
|
||||
//InitialJwd = File.ReadAllText("Data\\FinestraSplitHoriz.jwd");
|
||||
InitialJwd = File.ReadAllText("Data\\AntaDoppia.jwd");
|
||||
//InitialJwd = File.ReadAllText("Data\\ArcoAntaDoppia.jwd");
|
||||
currJwd = InitialJwd;
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
@page "/Error"
|
||||
@using System.Diagnostics
|
||||
|
||||
<PageTitle>Error</PageTitle>
|
||||
|
||||
<h1 class="text-danger">Error.</h1>
|
||||
<h2 class="text-danger">An error occurred while processing your request.</h2>
|
||||
|
||||
@if (ShowRequestId)
|
||||
{
|
||||
<p>
|
||||
<strong>Request ID:</strong> <code>@RequestId</code>
|
||||
</p>
|
||||
}
|
||||
|
||||
<h3>Development Mode</h3>
|
||||
<p>
|
||||
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
|
||||
</p>
|
||||
<p>
|
||||
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
|
||||
It can result in displaying sensitive information from exceptions to end users.
|
||||
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
|
||||
and restarting the app.
|
||||
</p>
|
||||
|
||||
@code{
|
||||
[CascadingParameter]
|
||||
private HttpContext? HttpContext { get; set; }
|
||||
|
||||
private string? RequestId { get; set; }
|
||||
private bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
||||
|
||||
protected override void OnInitialized() =>
|
||||
RequestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier;
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
@page "/Gerarchia"
|
||||
@rendermode InteractiveServer
|
||||
|
||||
<PageTitle>Gerarchia</PageTitle>
|
||||
|
||||
<WebWindowComplex.TableComp IN_FamilyHardwareList="@AvailFamilyHardwareList"
|
||||
IN_SelFamilyHardware="@SelFamilyHardware"
|
||||
IN_HardwareList="@AvailHardwareList"
|
||||
IN_ColorMaterialList="@AvailColorMaterialList"
|
||||
IN_SelColorMaterial="@SelColorMaterial"
|
||||
IN_MaterialList="@AvailMaterialList"
|
||||
IN_SelMaterial="@SelMaterial"
|
||||
IN_GlassList="@AvailGlassList"
|
||||
IN_SelGlass="@SelGlass"
|
||||
EC_req="SaveJWD"
|
||||
EC_OnSelectedTemplate="SetTemplate"
|
||||
LiveSVG="@currSvg">
|
||||
</WebWindowComplex.TableComp>
|
||||
@*
|
||||
<p>
|
||||
@m_CurrArgs.GetValueOrDefault("Jwd")
|
||||
</p> *@
|
||||
@@ -1,182 +0,0 @@
|
||||
using EgwCoreLib.Lux.Core;
|
||||
using EgwCoreLib.Lux.Core.RestPayload;
|
||||
using EgwCoreLib.Lux.Data.Services;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Newtonsoft.Json;
|
||||
using NLog;
|
||||
using System.Diagnostics;
|
||||
using System.Security.AccessControl;
|
||||
using Egw.Window.Data;
|
||||
using WebWindowComplex;
|
||||
using WebWindowComplex.DTO;
|
||||
|
||||
namespace Test.UI.Components.Pages
|
||||
{
|
||||
public partial class Gerarchia : IDisposable
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public string InitialJwd = "";
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
DLService.PipeSvg.EA_NewMessage -= PipeSvg_EA_NewMessage;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected string currJwd = "...";
|
||||
protected Dictionary<string, string> m_CurrArgs = new Dictionary<string, string>();
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Protected Properties
|
||||
protected List<Hardware> AvailHardwareList { get; set; } = new List<Hardware>();
|
||||
protected List<string> AvailFamilyHardwareList { get; set; } = new List<string>()
|
||||
{
|
||||
new string("Natura"),
|
||||
new string("Optima")
|
||||
};
|
||||
protected List<string> AvailColorMaterialList { get; set; } = new List<string>()
|
||||
{
|
||||
new string("White"),
|
||||
new string("Black"),
|
||||
new string("Blu")
|
||||
};
|
||||
protected List<string> AvailMaterialList { get; set; } = new List<string>()
|
||||
{
|
||||
new string("Pine"),
|
||||
new string("Fir")
|
||||
};
|
||||
protected List<string> AvailGlassList { get; set; } = new List<string>()
|
||||
{
|
||||
new string("4/12/4"),
|
||||
new string("4/16/4"),
|
||||
new string("4/12/4/12/4"),
|
||||
new string("4/16/4/16/4"),
|
||||
new string("4T/12/4T"),
|
||||
new string("4T/16/4T")
|
||||
};
|
||||
protected string SelFamilyHardware { get; set; } = "";
|
||||
protected string SelColorMaterial { get; set; } = "";
|
||||
protected string SelMaterial { get; set; } = "";
|
||||
protected string SelGlass { get; set; } = "";
|
||||
|
||||
[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 => (MarkupString)currJwd.Replace(Environment.NewLine, "<br/>").Replace(" ", " ");
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
ConfInit();
|
||||
SelFamilyHardware = "Natura";
|
||||
SelColorMaterial = "Black";
|
||||
SelMaterial = "Pine";
|
||||
SelGlass = "4T/16/4T";
|
||||
DLService.PipeSvg.EA_NewMessage += PipeSvg_EA_NewMessage;
|
||||
await ReloadData();
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private string apiUrl = "";
|
||||
private string calcTag = "";
|
||||
private string CalcUid = "CurrWindow";
|
||||
private string cFileTemplate = "Data/Setup.json";
|
||||
private string cFileHardware = "Hardware/Setup.json";
|
||||
private string currSvg = "";
|
||||
|
||||
private string imgBasePath = "";
|
||||
private string GenericBasePath = "";
|
||||
|
||||
private string subChannel = "";
|
||||
|
||||
private string windowUid = "CurrWindow";
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private async void PipeSvg_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") ?? "";
|
||||
GenericBasePath = Config.GetValue<string>("ServerConf:GenericBaseUrl") ?? "";
|
||||
calcTag = Config.GetValue<string>("ServerConf:CalcTag") ?? "";
|
||||
subChannel = Config.GetValue<string>("ServerConf:SvgChannel") ?? "";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Rilettura dati
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private async Task ReloadData()
|
||||
{
|
||||
//return base.OnInitializedAsync();
|
||||
AvailHardwareList = new List<Hardware>();
|
||||
if (File.Exists(cFileHardware))
|
||||
{
|
||||
string rawValHW = File.ReadAllText(cFileHardware);
|
||||
var rawListHW = JsonConvert.DeserializeObject<List<Hardware>>(rawValHW) ?? new List<Hardware>();
|
||||
foreach (var item in rawListHW)
|
||||
{
|
||||
AvailHardwareList.Add(item);
|
||||
}
|
||||
}
|
||||
await Task.Delay(100);
|
||||
}
|
||||
|
||||
private async Task SaveJWD(Dictionary<string, string> CurrArgs)
|
||||
{
|
||||
m_CurrArgs = CurrArgs;
|
||||
// chiamo la chiamata POST alla API, che manda la richiesta via REDIS
|
||||
if (currJwd != null)
|
||||
{
|
||||
CalcRequestDTO calcRequestDTO = new CalcRequestDTO();
|
||||
calcRequestDTO.EnvType = EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW;
|
||||
calcRequestDTO.DictExec = m_CurrArgs;
|
||||
await ICService.CallRestPost($"{apiUrl}/{GenericBasePath}", $"{calcTag}/{CalcUid}", calcRequestDTO);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
@page "/"
|
||||
@page "/Home"
|
||||
@page "/Home"
|
||||
@rendermode InteractiveServer
|
||||
|
||||
<PageTitle>Select template</PageTitle>
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
@page "/SimpleEditOld"
|
||||
@rendermode InteractiveServer
|
||||
|
||||
<PageTitle>SimpleEditOld</PageTitle>
|
||||
|
||||
<WebWindowTest.Test ListPayload="SetupList"
|
||||
LiveData="CurrData"
|
||||
EC_ActionReq="DoAction"
|
||||
EC_DoUpdate="ExecRequest"
|
||||
EC_OnClose="CloseObj">
|
||||
</WebWindowTest.Test>
|
||||
|
||||
|
||||
@if (!string.IsNullOrEmpty(outClose))
|
||||
{
|
||||
<div class="alert alert-danger fs-4">
|
||||
@outClose
|
||||
</div>
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(outSave))
|
||||
{
|
||||
<div class="alert alert-success fs-4">
|
||||
@outSave
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body small">
|
||||
@JsonSer
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,350 @@
|
||||
using Egw.Window.Data;
|
||||
using EgwCoreLib.Lux.Core;
|
||||
using EgwCoreLib.Lux.Core.RestPayload;
|
||||
using EgwCoreLib.Lux.Data.Services;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Newtonsoft.Json;
|
||||
using WebWindowTest.DTO;
|
||||
using static WebWindowTest.LayoutConst;
|
||||
|
||||
namespace Test.UI.Components.Pages
|
||||
{
|
||||
public partial class SimpleEditOld : IDisposable
|
||||
{
|
||||
#region Public Fields
|
||||
|
||||
public string InitialJwd = "";
|
||||
|
||||
#endregion Public Fields
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
DLService.PipeSvg.EA_NewMessage -= PipeSvg_EA_NewMessage;
|
||||
DLService.PipeShape.EA_NewMessage -= PipeShape_EA_NewMessage;
|
||||
DLService.PipeHwOpt.EA_NewMessage -= PipeHwOption_EA_NewMessage;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
/// <summary>
|
||||
/// Predisposizione valori live SVG/JWD
|
||||
/// </summary>
|
||||
protected LivePayload CurrData = new LivePayload();
|
||||
|
||||
protected Dictionary<int, string> currGroupShape = new Dictionary<int, string>();
|
||||
protected Dictionary<int, string> currHwOption = new Dictionary<int, string>();
|
||||
protected string currJwd = "...";
|
||||
protected Dictionary<string, string> m_CurrArgs = new Dictionary<string, string>();
|
||||
protected string prevJwd = "";
|
||||
|
||||
/// <summary>
|
||||
/// Configurazione elenchi anagrafiche
|
||||
/// </summary>
|
||||
protected BaseListPayload SetupList = new BaseListPayload();
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
protected List<string> AvailColorMaterialList { get; set; } = new List<string>()
|
||||
{
|
||||
new string("White"),
|
||||
new string("Wood"),
|
||||
new string("Black"),
|
||||
new string("Blu")
|
||||
};
|
||||
|
||||
protected List<string> AvailFamilyHardwareList { get; set; } = new List<string>()
|
||||
{
|
||||
new string("ArTech"),
|
||||
new string("ArTechPlana")
|
||||
};
|
||||
|
||||
protected List<string> AvailGlassList { get; set; } = new List<string>()
|
||||
{
|
||||
new string("Vetro BE 2S 4/12/4"),
|
||||
new string("Vetro BE 2S 4/16/4"),
|
||||
new string("Vetro BE 3S 4/12/4/12/4"),
|
||||
new string("Vetro BE 3S 4/16/4/16/4"),
|
||||
new string("Vetro BE 2S 4T/12/4T"),
|
||||
new string("Vetro BE 2S 4T/16/4T")
|
||||
};
|
||||
|
||||
protected List<Hardware> AvailHardwareList { get; set; } = new List<Hardware>();
|
||||
|
||||
protected List<string> AvailMaterialList { get; set; } = new List<string>()
|
||||
{
|
||||
new string("Pino"),
|
||||
new string("Abete")
|
||||
};
|
||||
|
||||
protected List<string> AvailProfileList { get; set; } = new List<string>()
|
||||
{
|
||||
new string("Profilo78"),
|
||||
new string("ProfiloSaomad")
|
||||
};
|
||||
|
||||
protected Dictionary<string, List<Threshold>> AvailThreshold { get; set; } = new Dictionary<string, List<Threshold>>()
|
||||
{
|
||||
{"Profilo78", new List<Threshold>() { new Threshold(3, "Bottom"), new Threshold(1, "Threshold")}},
|
||||
{"ProfiloSaomad", new List<Threshold>(){ new Threshold(3, "Bottom"), new Threshold(2, "BottomWaterdrip"), new Threshold(1, "Threshold")}}
|
||||
};
|
||||
|
||||
[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 => (MarkupString)currJwd.Replace(Environment.NewLine, "<br/>").Replace(" ", " ");
|
||||
}
|
||||
|
||||
protected string SelColorMaterial { get; set; } = "";
|
||||
protected string SelFamilyHardware { get; set; } = "";
|
||||
protected string SelGlass { get; set; } = "";
|
||||
protected string SelMaterial { get; set; } = "";
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected override void OnAfterRender(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
{
|
||||
// JS interop or data fetches go here
|
||||
isInteractive = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
ConfInit();
|
||||
Random random = new Random();
|
||||
CalcUid = Convert.ToString(random.Next(1000, 10000));
|
||||
windowUid = CalcUid;
|
||||
InitialJwd = File.ReadAllText("Data\\FinestraSplitGrid.jwd");
|
||||
//InitialJwd = File.ReadAllText("Data\\AntaDoppia.jwd");
|
||||
currJwd = InitialJwd;
|
||||
// rileggo altri dati
|
||||
await ReloadData();
|
||||
// preparo conf oggetti x controllo
|
||||
SetupList = new BaseListPayload()
|
||||
{
|
||||
ColorMaterial = AvailColorMaterialList,
|
||||
FamilyHardware = AvailFamilyHardwareList,
|
||||
Glass = AvailGlassList,
|
||||
Hardware = AvailHardwareList,
|
||||
Material = AvailMaterialList,
|
||||
Profile = AvailProfileList,
|
||||
Threshold = AvailThreshold
|
||||
};
|
||||
CurrData = new LivePayload()
|
||||
{
|
||||
CurrJwd = InitialJwd,
|
||||
SvgPreview = currSvg,
|
||||
DictShape = currGroupShape,
|
||||
DictOptionsXml = currHwOption
|
||||
};
|
||||
DLService.PipeSvg.EA_NewMessage += PipeSvg_EA_NewMessage;
|
||||
DLService.PipeShape.EA_NewMessage += PipeShape_EA_NewMessage;
|
||||
DLService.PipeHwOpt.EA_NewMessage += PipeHwOption_EA_NewMessage;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private string apiUrl = "";
|
||||
private string calcTag = "";
|
||||
private string CalcUid = "CurrWindow";
|
||||
private string windowUid = "CurrWindow";
|
||||
private string cFileHardware = "Hardware/Setup.json";
|
||||
private string currSvg = "";
|
||||
private string GenericBasePath = "";
|
||||
|
||||
/// <summary>
|
||||
/// Semaforo x definire se sia già in modalità ionterattiva o di prerendering
|
||||
/// </summary>
|
||||
private bool isInteractive = false;
|
||||
|
||||
private string outClose = "";
|
||||
private string outSave = "";
|
||||
|
||||
private string imgBasePath = "";
|
||||
|
||||
private string channelHwOpt = "";
|
||||
private string channelShape = "";
|
||||
private string channelSvg = "";
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Effettua chiusura oggetto con eventuale save
|
||||
/// </summary>
|
||||
/// <param name="reqSave"></param>
|
||||
private void CloseObj(bool reqSave)
|
||||
{
|
||||
outClose = !reqSave ? "Richiesto chiusura!" : "";
|
||||
outSave = reqSave ? "Richiesto salvataggio!" : "";
|
||||
}
|
||||
|
||||
private void ConfInit()
|
||||
{
|
||||
apiUrl = Config.GetValue<string>("ServerConf:Prog.ApiUrl") ?? "";
|
||||
imgBasePath = Config.GetValue<string>("ServerConf:ImageBaseUrl") ?? "";
|
||||
GenericBasePath = Config.GetValue<string>("ServerConf:GenericBaseUrl") ?? "";
|
||||
calcTag = Config.GetValue<string>("ServerConf:CalcTag") ?? "";
|
||||
channelSvg = Config.GetValue<string>("ServerConf:ChannelSvg") ?? "";
|
||||
channelShape = Config.GetValue<string>("ServerConf:ChannelShape") ?? "";
|
||||
channelHwOpt = Config.GetValue<string>("ServerConf:ChannelHwOpt") ?? "";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Esecuzione azione richiesta
|
||||
/// </summary>
|
||||
/// <param name="actReq">Azione richiesta</param>
|
||||
private void DoAction(DataAction actReq)
|
||||
{
|
||||
switch (actReq)
|
||||
{
|
||||
case DataAction.None:
|
||||
break;
|
||||
|
||||
case DataAction.ResetDictShape:
|
||||
CurrData.DictShape = new Dictionary<int, string>();
|
||||
break;
|
||||
|
||||
case DataAction.ResetHwOpt:
|
||||
CurrData.DictOptionsXml = new Dictionary<int, string>();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Esecuzione richiesta
|
||||
/// </summary>
|
||||
/// <param name="CurrArgs"></param>
|
||||
/// <returns></returns>
|
||||
private async Task ExecRequest(Dictionary<string, string> CurrArgs)
|
||||
{
|
||||
// Proseguo solo se sono in interattivo (NO prerender pagina)
|
||||
if (isInteractive)
|
||||
{
|
||||
outClose = "";
|
||||
outSave = "";
|
||||
// verifico se contiene JWD, lo aggiorno
|
||||
if (CurrArgs.ContainsKey("SerializedData"))
|
||||
{
|
||||
currJwd = CurrArgs["SerializedData"];
|
||||
CurrData.CurrJwd = currJwd;
|
||||
}
|
||||
// se il SSE variato --> invio
|
||||
if (!currJwd.Equals(prevJwd) || !EgwCoreLib.Utils.DictUtils.DictAreEqual(m_CurrArgs, CurrArgs))
|
||||
{
|
||||
m_CurrArgs = CurrArgs;
|
||||
prevJwd = currJwd;
|
||||
CalcRequestDTO calcRequestDTO = new CalcRequestDTO();
|
||||
calcRequestDTO.EnvType = EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW;
|
||||
calcRequestDTO.DictExec = m_CurrArgs;
|
||||
// chiamo la chiamata POST alla API, che manda la richiesta via REDIS
|
||||
await ICService.CallRestPost($"{apiUrl}/{GenericBasePath}", $"{calcTag}/{CalcUid}", calcRequestDTO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async void PipeHwOption_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.StartsWith($"{channelHwOpt}:{windowUid}") && currArgs.newMessage.Length > 2)
|
||||
{
|
||||
// deserializzo il dizionario delle risposte...
|
||||
Dictionary<int, string> rawDict = JsonConvert.DeserializeObject<Dictionary<int, string>>(currArgs.newMessage) ?? new Dictionary<int, string>();
|
||||
if (rawDict.Count > 0)
|
||||
{
|
||||
currHwOption = rawDict;
|
||||
CurrData.DictOptionsXml = currHwOption;
|
||||
}
|
||||
}
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
private async void PipeShape_EA_NewMessage(object? sender, EventArgs e)
|
||||
{
|
||||
// aggiorno visualizzazione
|
||||
PubSubEventArgs currArgs = (PubSubEventArgs)e;
|
||||
// conversione on-the-fly SVG da mostrare
|
||||
if (!string.IsNullOrEmpty(currArgs.newMessage) && currArgs.newMessage.Length > 2)
|
||||
{
|
||||
if (currArgs.msgUid.StartsWith($"{channelShape}:{windowUid}"))
|
||||
{
|
||||
// deserializzo il dizionario delle risposte...
|
||||
var rawDict = JsonConvert.DeserializeObject<Dictionary<int, string>>(currArgs.newMessage);
|
||||
currGroupShape = rawDict ?? new Dictionary<int, string>();
|
||||
CurrData.DictShape = currGroupShape;
|
||||
}
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
private async void PipeSvg_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($"{channelSvg}:{windowUid}"))
|
||||
{
|
||||
currSvg = currArgs.newMessage;
|
||||
CurrData.SvgPreview = currArgs.newMessage;
|
||||
}
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Rilettura dati
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private async Task ReloadData()
|
||||
{
|
||||
//return base.OnInitializedAsync();
|
||||
AvailHardwareList = new List<Hardware>();
|
||||
if (File.Exists(cFileHardware))
|
||||
{
|
||||
string rawValHW = File.ReadAllText(cFileHardware);
|
||||
var rawListHW = JsonConvert.DeserializeObject<List<Hardware>>(rawValHW) ?? new List<Hardware>();
|
||||
foreach (var item in rawListHW)
|
||||
{
|
||||
AvailHardwareList.Add(item);
|
||||
}
|
||||
}
|
||||
await Task.Delay(100);
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
@page "/TestComponentJWD"
|
||||
@rendermode InteractiveServer
|
||||
|
||||
<PageTitle>TestComponent</PageTitle>
|
||||
|
||||
<WebWindowTest.Test IN_FamilyHardwareList="@AvailFamilyHardwareList"
|
||||
IN_HardwareList="@AvailHardwareList"
|
||||
IN_ColorMaterialList="@AvailColorMaterialList"
|
||||
IN_MaterialList="@AvailMaterialList"
|
||||
IN_GlassList="@AvailGlassList"
|
||||
EC_OnUpdate="SaveJWD"
|
||||
LiveSVG="@currSvg"
|
||||
CurrJwd="@InitialJwd">
|
||||
</WebWindowTest.Test>
|
||||
|
||||
@*
|
||||
IN_SelGlass="@SelGlass"
|
||||
IN_SelFamilyHardware="@SelFamilyHardware"
|
||||
IN_SelColorMaterial="@SelColorMaterial"
|
||||
IN_SelMaterial="@SelMaterial"
|
||||
*@
|
||||
|
||||
<p>
|
||||
@m_CurrArgs.GetValueOrDefault("Jwd")
|
||||
</p>
|
||||
@@ -1,217 +0,0 @@
|
||||
using EgwCoreLib.Lux.Core;
|
||||
using EgwCoreLib.Lux.Core.RestPayload;
|
||||
using EgwCoreLib.Lux.Data.Services;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Newtonsoft.Json;
|
||||
using NLog;
|
||||
using System.Diagnostics;
|
||||
using System.Security.AccessControl;
|
||||
using Egw.Window.Data;
|
||||
using WebWindowTest;
|
||||
using WebWindowTest.DTO;
|
||||
|
||||
namespace Test.UI.Components.Pages
|
||||
{
|
||||
public partial class TestComponentJWD : IDisposable
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public string InitialJwd = "";
|
||||
public Template SelTemplate { get; set; } = new Template(0, "---SELECT---", "", "");
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
DLService.PipeSvg.EA_NewMessage -= PipeSvg_EA_NewMessage;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected string currJwd = "...";
|
||||
protected Dictionary<string, string> m_CurrArgs = new Dictionary<string, string>();
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
protected List<TemplateSelectDTO> AvailTemplateList { get; set; } = new List<TemplateSelectDTO>();
|
||||
protected List<Hardware> AvailHardwareList { get; set; } = new List<Hardware>();
|
||||
protected List<string> AvailFamilyHardwareList { get; set; } = new List<string>()
|
||||
{
|
||||
new string("Natura"),
|
||||
new string("Optima")
|
||||
};
|
||||
protected List<string> AvailColorMaterialList { get; set; } = new List<string>()
|
||||
{
|
||||
new string("White"),
|
||||
new string("Black"),
|
||||
new string("Blu")
|
||||
};
|
||||
protected List<string> AvailMaterialList { get; set; } = new List<string>()
|
||||
{
|
||||
new string("Pine"),
|
||||
new string("Fir")
|
||||
};
|
||||
protected List<string> AvailGlassList { get; set; } = new List<string>()
|
||||
{
|
||||
new string("4/12/4"),
|
||||
new string("4/16/4"),
|
||||
new string("4/12/4/12/4"),
|
||||
new string("4/16/4/16/4"),
|
||||
new string("4T/12/4T"),
|
||||
new string("4T/16/4T")
|
||||
};
|
||||
protected string SelFamilyHardware { get; set; } = "";
|
||||
protected string SelColorMaterial { get; set; } = "";
|
||||
protected string SelMaterial { get; set; } = "";
|
||||
protected string SelGlass { get; set; } = "";
|
||||
|
||||
[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 => (MarkupString)currJwd.Replace(Environment.NewLine, "<br/>").Replace(" ", " ");
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
ConfInit();
|
||||
SelFamilyHardware = "Natura";
|
||||
//SelColorMaterial = "Black";
|
||||
//SelColorMaterial = "Pine";
|
||||
//SelGlass = "4T/16/4T";
|
||||
InitialJwd = File.ReadAllText("Data\\FinDueAnteBottomFisso.jwd");
|
||||
currJwd = InitialJwd;
|
||||
DLService.PipeSvg.EA_NewMessage += PipeSvg_EA_NewMessage;
|
||||
await ReloadData();
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private string apiUrl = "";
|
||||
private string calcTag = "";
|
||||
private string CalcUid = "CurrWindow";
|
||||
private string cFileTemplate = "Data/Setup.json";
|
||||
private string cFileHardware = "Hardware/Setup.json";
|
||||
private TemplateSelectDTO? currSel = null;
|
||||
private string currSvg = "";
|
||||
|
||||
private string imgBasePath = "";
|
||||
private string GenericBasePath = "";
|
||||
|
||||
private string subChannel = "";
|
||||
|
||||
private string windowUid = "CurrWindow";
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private async void PipeSvg_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") ?? "";
|
||||
GenericBasePath = Config.GetValue<string>("ServerConf:GenericBaseUrl") ?? "";
|
||||
calcTag = Config.GetValue<string>("ServerConf:CalcTag") ?? "";
|
||||
subChannel = Config.GetValue<string>("ServerConf:SvgChannel") ?? "";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Rilettura dati
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private async Task ReloadData()
|
||||
{
|
||||
//return base.OnInitializedAsync();
|
||||
AvailTemplateList = new List<TemplateSelectDTO>();
|
||||
AvailHardwareList = new List<Hardware>();
|
||||
// brutale, da rivedere...
|
||||
if (string.IsNullOrEmpty(InitialJwd))
|
||||
{
|
||||
if (File.Exists(cFileTemplate))
|
||||
{
|
||||
string rawVal = File.ReadAllText(cFileTemplate);
|
||||
var rawList = JsonConvert.DeserializeObject<List<TemplateSelectDTO>>(rawVal) ?? new List<TemplateSelectDTO>();
|
||||
|
||||
// calcolo URL immagini... DTO interno da rivedere?
|
||||
foreach (var item in rawList)
|
||||
{
|
||||
item.ImageUrl = ICService.ImageUrl($"{apiUrl}/{imgBasePath}", false, item.SVGFileName);
|
||||
AvailTemplateList.Add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (File.Exists(cFileHardware))
|
||||
{
|
||||
string rawValHW = File.ReadAllText(cFileHardware);
|
||||
var rawListHW = JsonConvert.DeserializeObject<List<Hardware>>(rawValHW) ?? new List<Hardware>();
|
||||
foreach (var item in rawListHW)
|
||||
{
|
||||
AvailHardwareList.Add(item);
|
||||
}
|
||||
}
|
||||
await Task.Delay(100);
|
||||
}
|
||||
|
||||
private async Task SaveJWD(Dictionary<string, string> CurrArgs)
|
||||
{
|
||||
m_CurrArgs = CurrArgs;
|
||||
// chiamo la chiamata POST alla API, che manda la richiesta via REDIS
|
||||
if (currJwd != null)
|
||||
{
|
||||
CalcRequestDTO calcRequestDTO = new CalcRequestDTO();
|
||||
calcRequestDTO.EnvType = EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW;
|
||||
calcRequestDTO.DictExec = m_CurrArgs;
|
||||
await ICService.CallRestPost($"{apiUrl}/{GenericBasePath}", $"{calcTag}/{CalcUid}", calcRequestDTO);
|
||||
}
|
||||
}
|
||||
|
||||
private void SetTemplate(TemplateSelectDTO selTemp)
|
||||
{
|
||||
string rawVal = "";
|
||||
currSel = selTemp;
|
||||
// brutale,d a rivedere...
|
||||
if (File.Exists(selTemp.JwdFileName))
|
||||
{
|
||||
rawVal = File.ReadAllText(selTemp.JwdFileName);
|
||||
}
|
||||
SelTemplate = new Template(selTemp.Index, selTemp.Description, selTemp.SVGFileName, rawVal);
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
@page "/TestComponentTemplate"
|
||||
@rendermode InteractiveServer
|
||||
|
||||
<PageTitle>TestComponent</PageTitle>
|
||||
|
||||
<WebWindowTest.Test IN_TemplateDTOList="@AvailTemplateList"
|
||||
IN_SelTemplate="@SelTemplate"
|
||||
IN_FamilyHardwareList="@AvailFamilyHardwareList"
|
||||
IN_SelFamilyHardware="@SelFamilyHardware"
|
||||
IN_HardwareList="@AvailHardwareList"
|
||||
IN_ColorMaterialList="@AvailColorMaterialList"
|
||||
IN_SelColorMaterial="@SelColorMaterial"
|
||||
IN_MaterialList="@AvailMaterialList"
|
||||
IN_SelMaterial="@SelMaterial"
|
||||
IN_GlassList="@AvailGlassList"
|
||||
IN_SelGlass="@SelGlass"
|
||||
EC_OnUpdate="SaveJWD"
|
||||
EC_OnSelectedTemplate="SetTemplate"
|
||||
LiveSVG="@currSvg">
|
||||
</WebWindowTest.Test>
|
||||
|
||||
<p>
|
||||
@m_CurrArgs.GetValueOrDefault("Jwd")
|
||||
</p>
|
||||
@@ -1,215 +0,0 @@
|
||||
using EgwCoreLib.Lux.Core;
|
||||
using EgwCoreLib.Lux.Core.RestPayload;
|
||||
using EgwCoreLib.Lux.Data.Services;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Newtonsoft.Json;
|
||||
using NLog;
|
||||
using System.Diagnostics;
|
||||
using System.Security.AccessControl;
|
||||
using Egw.Window.Data;
|
||||
using WebWindowTest;
|
||||
using WebWindowTest.DTO;
|
||||
|
||||
namespace Test.UI.Components.Pages
|
||||
{
|
||||
public partial class TestComponentTemplate : IDisposable
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public string InitialJwd = "";
|
||||
public Template SelTemplate { get; set; } = new Template(0, "---SELECT---", "", "");
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
DLService.PipeSvg.EA_NewMessage -= PipeSvg_EA_NewMessage;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected string currJwd = "...";
|
||||
protected Dictionary<string, string> m_CurrArgs = new Dictionary<string, string>();
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
protected List<TemplateSelectDTO> AvailTemplateList { get; set; } = new List<TemplateSelectDTO>();
|
||||
protected List<Hardware> AvailHardwareList { get; set; } = new List<Hardware>();
|
||||
protected List<string> AvailFamilyHardwareList { get; set; } = new List<string>()
|
||||
{
|
||||
new string("Natura"),
|
||||
new string("Optima")
|
||||
};
|
||||
protected List<string> AvailColorMaterialList { get; set; } = new List<string>()
|
||||
{
|
||||
new string("White"),
|
||||
new string("Black"),
|
||||
new string("Blu")
|
||||
};
|
||||
protected List<string> AvailMaterialList { get; set; } = new List<string>()
|
||||
{
|
||||
new string("Pine"),
|
||||
new string("Fir")
|
||||
};
|
||||
protected List<string> AvailGlassList { get; set; } = new List<string>()
|
||||
{
|
||||
new string("4/12/4"),
|
||||
new string("4/16/4"),
|
||||
new string("4/12/4/12/4"),
|
||||
new string("4/16/4/16/4"),
|
||||
new string("4T/12/4T"),
|
||||
new string("4T/16/4T")
|
||||
};
|
||||
protected string SelFamilyHardware { get; set; } = "";
|
||||
protected string SelColorMaterial { get; set; } = "";
|
||||
protected string SelMaterial { get; set; } = "";
|
||||
protected string SelGlass { get; set; } = "";
|
||||
|
||||
[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 => (MarkupString)currJwd.Replace(Environment.NewLine, "<br/>").Replace(" ", " ");
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
ConfInit();
|
||||
SelFamilyHardware = "Natura";
|
||||
SelColorMaterial = "Black";
|
||||
SelMaterial = "Pine";
|
||||
SelGlass = "4T/16/4T";
|
||||
DLService.PipeSvg.EA_NewMessage += PipeSvg_EA_NewMessage;
|
||||
await ReloadData();
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private string apiUrl = "";
|
||||
private string calcTag = "";
|
||||
private string CalcUid = "CurrWindow";
|
||||
private string cFileTemplate = "Data/Setup.json";
|
||||
private string cFileHardware = "Hardware/Setup.json";
|
||||
private TemplateSelectDTO? currSel = null;
|
||||
private string currSvg = "";
|
||||
|
||||
private string imgBasePath = "";
|
||||
private string GenericBasePath = "";
|
||||
|
||||
private string subChannel = "";
|
||||
|
||||
private string windowUid = "CurrWindow";
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private async void PipeSvg_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") ?? "";
|
||||
GenericBasePath = Config.GetValue<string>("ServerConf:GenericBaseUrl") ?? "";
|
||||
calcTag = Config.GetValue<string>("ServerConf:CalcTag") ?? "";
|
||||
subChannel = Config.GetValue<string>("ServerConf:SvgChannel") ?? "";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Rilettura dati
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private async Task ReloadData()
|
||||
{
|
||||
//return base.OnInitializedAsync();
|
||||
AvailTemplateList = new List<TemplateSelectDTO>();
|
||||
AvailHardwareList = new List<Hardware>();
|
||||
// brutale, da rivedere...
|
||||
if(string.IsNullOrEmpty(InitialJwd))
|
||||
{
|
||||
if (File.Exists(cFileTemplate))
|
||||
{
|
||||
string rawVal = File.ReadAllText(cFileTemplate);
|
||||
var rawList = JsonConvert.DeserializeObject<List<TemplateSelectDTO>>(rawVal) ?? new List<TemplateSelectDTO>();
|
||||
|
||||
// calcolo URL immagini... DTO interno da rivedere?
|
||||
foreach (var item in rawList)
|
||||
{
|
||||
item.ImageUrl = ICService.ImageUrl($"{apiUrl}/{imgBasePath}", false, item.SVGFileName);
|
||||
AvailTemplateList.Add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (File.Exists(cFileHardware))
|
||||
{
|
||||
string rawValHW = File.ReadAllText(cFileHardware);
|
||||
var rawListHW = JsonConvert.DeserializeObject<List<Hardware>>(rawValHW) ?? new List<Hardware>();
|
||||
foreach (var item in rawListHW)
|
||||
{
|
||||
AvailHardwareList.Add(item);
|
||||
}
|
||||
}
|
||||
await Task.Delay(100);
|
||||
}
|
||||
|
||||
private async Task SaveJWD(Dictionary<string, string> CurrArgs)
|
||||
{
|
||||
m_CurrArgs = CurrArgs;
|
||||
// chiamo la chiamata POST alla API, che manda la richiesta via REDIS
|
||||
if (currJwd != null)
|
||||
{
|
||||
CalcRequestDTO calcRequestDTO = new CalcRequestDTO();
|
||||
calcRequestDTO.EnvType = EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW;
|
||||
calcRequestDTO.DictExec = m_CurrArgs;
|
||||
await ICService.CallRestPost($"{apiUrl}/{GenericBasePath}", $"{calcTag}/{CalcUid}", calcRequestDTO);
|
||||
}
|
||||
}
|
||||
|
||||
private void SetTemplate(TemplateSelectDTO selTemp)
|
||||
{
|
||||
string rawVal = "";
|
||||
currSel = selTemp;
|
||||
// brutale,d a rivedere...
|
||||
if (File.Exists(selTemp.JwdFileName))
|
||||
{
|
||||
rawVal = File.ReadAllText(selTemp.JwdFileName);
|
||||
}
|
||||
SelTemplate = new Template(selTemp.Index, selTemp.Description, selTemp.SVGFileName, rawVal);
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,24 @@
|
||||
"Value": 1200.0
|
||||
}
|
||||
],
|
||||
"ElementDimensionList": [
|
||||
{
|
||||
"Index": 1,
|
||||
"Value": 78.0
|
||||
},
|
||||
{
|
||||
"Index": 2,
|
||||
"Value": 78.0
|
||||
},
|
||||
{
|
||||
"Index": 3,
|
||||
"Value": 78.0
|
||||
},
|
||||
{
|
||||
"Index": 4,
|
||||
"Value": 78.0
|
||||
}
|
||||
],
|
||||
"JointList": [
|
||||
{
|
||||
"Index": 1,
|
||||
@@ -50,6 +68,24 @@
|
||||
"HasHandle": true,
|
||||
"Dimension": 50.0,
|
||||
"MeasureType": "PERCENTAGE",
|
||||
"ElementDimensionList": [
|
||||
{
|
||||
"Index": 1,
|
||||
"Value": 78.0
|
||||
},
|
||||
{
|
||||
"Index": 2,
|
||||
"Value": 78.0
|
||||
},
|
||||
{
|
||||
"Index": 3,
|
||||
"Value": 78.0
|
||||
},
|
||||
{
|
||||
"Index": 4,
|
||||
"Value": 78.0
|
||||
}
|
||||
],
|
||||
"JointList": [
|
||||
{
|
||||
"Index": 1,
|
||||
@@ -75,6 +111,24 @@
|
||||
"HasHandle": false,
|
||||
"Dimension": 50.0,
|
||||
"MeasureType": "PERCENTAGE",
|
||||
"ElementDimensionList": [
|
||||
{
|
||||
"Index": 1,
|
||||
"Value": 78.0
|
||||
},
|
||||
{
|
||||
"Index": 2,
|
||||
"Value": 78.0
|
||||
},
|
||||
{
|
||||
"Index": 3,
|
||||
"Value": 78.0
|
||||
},
|
||||
{
|
||||
"Index": 4,
|
||||
"Value": 78.0
|
||||
}
|
||||
],
|
||||
"JointList": [
|
||||
{
|
||||
"Index": 1,
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
{
|
||||
"ProfilePath": "Profilo78",
|
||||
"Material": "Pino",
|
||||
"ColorMaterial": "Black",
|
||||
"Glass": "Vetro BE 2S 4T/16/4T",
|
||||
"AreaList": [
|
||||
{
|
||||
"Shape": "RECTANGLE",
|
||||
"DimensionList": [
|
||||
{
|
||||
"Index": 1,
|
||||
"Name": "Width",
|
||||
"Value": 1500.0
|
||||
},
|
||||
{
|
||||
"Index": 2,
|
||||
"Name": "Height",
|
||||
"Value": 1800.0
|
||||
}
|
||||
],
|
||||
"JointList": [
|
||||
{
|
||||
"Index": 1,
|
||||
"JointType": "FULL_H"
|
||||
},
|
||||
{
|
||||
"Index": 2,
|
||||
"JointType": "FULL_H"
|
||||
},
|
||||
{
|
||||
"Index": 3,
|
||||
"JointType": "FULL_V"
|
||||
},
|
||||
{
|
||||
"Index": 4,
|
||||
"JointType": "FULL_V"
|
||||
}
|
||||
],
|
||||
"Threshold": "Bottom",
|
||||
"BottomRail": false,
|
||||
"BottomRailQty": 0,
|
||||
"GroupId": 1,
|
||||
"AreaList": [
|
||||
{
|
||||
"SplitShape": "HORIZONTAL",
|
||||
"SplitStartVert": false,
|
||||
"SplitVertList": [],
|
||||
"SplitHorizList": [
|
||||
{
|
||||
"IsRelative": true,
|
||||
"Dimension": 50.0,
|
||||
"MeasureType": "PERCENTAGE"
|
||||
},
|
||||
{
|
||||
"IsRelative": true,
|
||||
"Dimension": 50.0,
|
||||
"MeasureType": "PERCENTAGE"
|
||||
}
|
||||
],
|
||||
"ElementDimHorizList": [
|
||||
{
|
||||
"Index": 1,
|
||||
"Value": 78.0
|
||||
}
|
||||
],
|
||||
"GroupId": 2,
|
||||
"AreaList": [
|
||||
{
|
||||
"GroupId": 3,
|
||||
"AreaList": [
|
||||
{
|
||||
"FillType": "GLASS",
|
||||
"GroupId": 4,
|
||||
"AreaList": [],
|
||||
"AreaType": "FILL"
|
||||
}
|
||||
],
|
||||
"AreaType": "SPLITTED"
|
||||
},
|
||||
{
|
||||
"GroupId": 5,
|
||||
"AreaList": [
|
||||
{
|
||||
"FillType": "GLASS",
|
||||
"GroupId": 6,
|
||||
"AreaList": [],
|
||||
"AreaType": "FILL"
|
||||
}
|
||||
],
|
||||
"AreaType": "SPLITTED"
|
||||
}
|
||||
],
|
||||
"AreaType": "SPLIT"
|
||||
}
|
||||
],
|
||||
"AreaType": "FRAME"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -57,6 +57,12 @@
|
||||
}
|
||||
],
|
||||
"SplitHorizList": [],
|
||||
"ElemDimVertList": [
|
||||
{
|
||||
"Index": 1,
|
||||
"Value": 78.0
|
||||
}
|
||||
],
|
||||
"GroupId": 2,
|
||||
"AreaList": [
|
||||
{
|
||||
|
||||
@@ -40,5 +40,11 @@
|
||||
"Description": "Finestra con split verticale",
|
||||
"SVGFileName": "FinestraSplitVert.svg",
|
||||
"JwdFileName": "Data/FinestraSplitVert.jwd"
|
||||
},
|
||||
{
|
||||
"Index": 8,
|
||||
"Description": "Finestra con split orizzontale",
|
||||
"SVGFileName": "FinestraSplitHoriz.svg",
|
||||
"JwdFileName": "Data/FinestraSplitHoriz.jwd"
|
||||
}
|
||||
]
|
||||
@@ -34,8 +34,8 @@
|
||||
<ProjectReference Include="..\WebWindowComplex\WebWindowComplex.csproj" />
|
||||
<ProjectReference Include="..\WebWindowConfigurator\WebWindowConfigurator.csproj" />
|
||||
<ProjectReference Include="..\WebWindowTest\WebWindowTest.csproj" />
|
||||
<PackageReference Include="EgwCoreLib.Lux.Core" Version="1.0.2512.1910" />
|
||||
<PackageReference Include="EgwCoreLib.Lux.Data" Version="1.0.2512.1910" />
|
||||
<PackageReference Include="EgwCoreLib.Lux.Core" Version="1.0.2601.2119" />
|
||||
<PackageReference Include="EgwCoreLib.Lux.Data" Version="1.0.2601.2119" />
|
||||
<PackageReference Include="EgwCoreLib.Razor" Version="1.5.2511.312" />
|
||||
<PackageReference Include="EgwCoreLib.Utils" Version="1.5.2511.312" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.21" />
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Egw.Window.Data" Version="2.7.12.2312" />
|
||||
<PackageReference Include="Egw.Window.Data" Version="2.8.1.2116" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.21" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>2.7.10.313</Version>
|
||||
<Version>2.8.1.101</Version>
|
||||
<Authors>Annamaria Sassi</Authors>
|
||||
<Company>Egalware</Company>
|
||||
<Description>Componente gestione JWD per LUX</Description>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<div class="col-lg-6 col-md-12 my-2">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<h6 class="fw-bold">Sash @(CurrSashGroup.SashList.Count == 1 ? "" : (IndexSash + 1))</h6>
|
||||
@if(CurrSashGroup.SashList.Count > 1)
|
||||
@if(!User && CurrSashGroup.SashList.Count > 1)
|
||||
{
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-outline-secondary dropdown-toggle btn-sm" type="button" @onclick="ToggleDropdown">
|
||||
@@ -30,13 +30,21 @@
|
||||
<button class="btn btn-outline-secondary 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>
|
||||
<select class="form-select" @bind="@OpeningTypeIndex">
|
||||
@foreach (var openingType in CurrSashDim.OpeningTypeList)
|
||||
{
|
||||
<option value=@(openingType.Id)>@(openingType.Name)</option>
|
||||
}
|
||||
</select>
|
||||
@if(User)
|
||||
{
|
||||
<span class="input-group-text">Tipology</span>
|
||||
<input type="text" readonly class="form-control" value="@(CurrSashDim.OpeningTypeList.ElementAt(OpeningTypeIndex - 1))">
|
||||
}
|
||||
else
|
||||
{
|
||||
<label class="input-group-text">Tipology</label>
|
||||
<select class="form-select" @bind="@OpeningTypeIndex">
|
||||
@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>
|
||||
@@ -82,7 +90,7 @@ else
|
||||
{
|
||||
<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))
|
||||
@if (!User && !(CurrAnta.AreaList[0] is Split))
|
||||
{
|
||||
<div class="input-group mb-2 justify-content-center">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => AddSplitToSash()">Add split</button>
|
||||
@@ -91,11 +99,18 @@ else
|
||||
<button class="btn btn-outline-secondary btn-sm">Add inglesina</button>
|
||||
</div>
|
||||
}
|
||||
<button type="button" class="btn-close" aria-label="Close" @onclick="() => ClosePopup(IndexSash)"></button>
|
||||
<button type="button" class="btn-close" aria-label="Close" @onclick="() => ClosePopup(IndexSash)"></button>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-12 my-2">
|
||||
<div class="input-group mb-2">
|
||||
<div class="input-group mb-2">
|
||||
@if(User)
|
||||
{
|
||||
<span class="input-group-text">Tipology</span>
|
||||
<input type="text" readonly class="form-control" value="@(CurrSashDim.OpeningTypeList.ElementAt(OpeningTypeIndex - 1))">
|
||||
}
|
||||
else
|
||||
{
|
||||
<label class="input-group-text">Tipology</label>
|
||||
<select class="form-select" @bind="@OpeningTypeIndex">
|
||||
@foreach (var openingType in CurrSashDim.OpeningTypeList)
|
||||
@@ -103,38 +118,10 @@ else
|
||||
<option value=@(openingType.Id)>@(openingType.Name)</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text">Dimension</span>
|
||||
<input type="number" class="form-control" @bind="@Dimension">
|
||||
@* <InputDouble CssClass="form-control form-control text-end" Decimals="@CssDecimals()" Step="@CssStepNumber()" @bind-Value="@Dimension"></InputDouble> *@
|
||||
<select class="form-select" style="max-width:6rem; background-color:#e9ecef" @bind="@MeasureTypeIndex">
|
||||
@foreach (var mType in CurrSashDim.MeasureTypeList)
|
||||
{
|
||||
<option value=@(mType.Id)>
|
||||
@switch (mType.Name)
|
||||
{
|
||||
case "Absolute":
|
||||
{
|
||||
<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>
|
||||
<div class="input-group">
|
||||
<div class="d-flex justify-content-start fs-5">
|
||||
<div class="px-1">
|
||||
<input class="form-check-input ml-auto" type="checkbox" name="Handle" checked="@CurrSashDim.bHasHandle" @onclick="() => ChangeHandle()">
|
||||
</div>
|
||||
@@ -143,11 +130,62 @@ else
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-12">
|
||||
<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>
|
||||
<div class="col-lg-6 col-md-12 my-2">
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text">Dimension</span>
|
||||
<input type="number" class="form-control" @bind="@Dimension">
|
||||
@* <InputDouble CssClass="form-control form-control text-end" Decimals="@CssDecimals()" Step="@CssStepNumber()" @bind-Value="@Dimension"></InputDouble> *@
|
||||
<select class="form-select" style="max-width:6rem; background-color:#e9ecef" @bind="@MeasureTypeIndex">
|
||||
@foreach (var mType in CurrSashDim.MeasureTypeList)
|
||||
{
|
||||
<option value=@(mType.Id)>
|
||||
@switch (mType.Name)
|
||||
{
|
||||
case "Absolute":
|
||||
{
|
||||
<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>
|
||||
</div>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-12 my-2">
|
||||
<div class="row justify-content-between align-items-center">
|
||||
<div class="col d-flex justify-content-start align-items-center">
|
||||
<h6>Element</h6>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group mb-2">
|
||||
@foreach (var element in CurrSashDim.ElementDimensionList)
|
||||
{
|
||||
<EditElement CurrRec="element" EC_Update="UpdateElement"></EditElement>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-12">
|
||||
<div class="row justify-content-between align-items-center">
|
||||
<div class="col d-flex justify-content-start align-items-center">
|
||||
<h6>Joints</h6>
|
||||
</div>
|
||||
@if (!User)
|
||||
{
|
||||
<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>
|
||||
@@ -163,11 +201,12 @@ else
|
||||
<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>
|
||||
@foreach (Joint joint in CurrSashDim.JointList)
|
||||
{
|
||||
<EditJoint CurrRec="joint" EC_Update="UpdateJoint"></EditJoint>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -27,6 +27,12 @@ namespace WebWindowComplex.Compo
|
||||
[CascadingParameter(Name = "SashList")]
|
||||
public List<Sash> SashList { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Livello di accesso (utente base)
|
||||
/// </summary>
|
||||
[CascadingParameter(Name = "User")]
|
||||
public bool User { get; set; } = false!;
|
||||
|
||||
/// <summary>
|
||||
/// Modalità di visualizzazione (view /edit)
|
||||
/// </summary>
|
||||
@@ -203,6 +209,22 @@ namespace WebWindowComplex.Compo
|
||||
await EC_UpdateSashDim.InvokeAsync(CurrSashDim);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Aggiornamento element
|
||||
/// </summary>
|
||||
/// <param name="updRec"></param>
|
||||
/// <returns></returns>
|
||||
private async Task UpdateElement(ElementDimension updRec)
|
||||
{
|
||||
// cerco il record
|
||||
var currRec = CurrSashDim.ElementDimensionList.FirstOrDefault(x => x.ParentArea == updRec.ParentArea && x.nIndex == updRec.nIndex);
|
||||
// lo aggiorno
|
||||
if (updRec != null)
|
||||
{
|
||||
currRec = updRec;
|
||||
await EC_UpdateSashDim.InvokeAsync(CurrSashDim);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per cambiare l'anta su cui è presente la maniglia
|
||||
@@ -292,7 +314,7 @@ namespace WebWindowComplex.Compo
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
/// <returns></returns>
|
||||
private string ButtonJointCss(WebWindowComplex.Json.WindowConst.Joints type)
|
||||
private string ButtonJointCss(Json.WindowConst.Joints type)
|
||||
{
|
||||
foreach (var item in CurrSashDim.JointList)
|
||||
{
|
||||
|
||||
@@ -17,39 +17,28 @@
|
||||
</div>
|
||||
<div class="col d-flex">
|
||||
<div class="input-group mb-2 justify-content-center">
|
||||
<button class="@buttonFillCss(WebWindowComplex.Json.WindowConst.FillTypes.GLASS)" @onclick="() => ChangeOneFill(WebWindowComplex.Json.WindowConst.FillTypes.GLASS)">Glass</button>
|
||||
@if (User)
|
||||
{
|
||||
<button class="@buttonFillCss(WebWindowComplex.Json.WindowConst.FillTypes.GLASS)">Glass</button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button class="@buttonFillCss(WebWindowComplex.Json.WindowConst.FillTypes.GLASS)" @onclick="() => ChangeOneFill(WebWindowComplex.Json.WindowConst.FillTypes.GLASS)">Glass</button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col d-flex">
|
||||
<div class="input-group mb-2 justify-content-center">
|
||||
<button class="@buttonFillCss(WebWindowComplex.Json.WindowConst.FillTypes.WOOD)" @onclick="() => ChangeOneFill(WebWindowComplex.Json.WindowConst.FillTypes.WOOD)">Wood</button>
|
||||
@if (User)
|
||||
{
|
||||
<button class="@buttonFillCss(WebWindowComplex.Json.WindowConst.FillTypes.WOOD)">Wood</button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button class="@buttonFillCss(WebWindowComplex.Json.WindowConst.FillTypes.WOOD)" @onclick="() => ChangeOneFill(WebWindowComplex.Json.WindowConst.FillTypes.WOOD)">Wood</button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@* <div class="d-flex justify-content-between align-items-center">
|
||||
<div class="col d-flex justify-content-center">
|
||||
<h6 class="text-center">Selected all fill</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="() => ChangeAllFill(WebWindowComplex.Json.WindowConst.FillTypes.GLASS)">All glass</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="() => ChangeAllFill(WebWindowComplex.Json.WindowConst.FillTypes.WOOD)">All wood</button>
|
||||
</div>
|
||||
</div>
|
||||
</div> *@
|
||||
</div>
|
||||
</div>
|
||||
@* @foreach (var currSplitted in SplittedList)
|
||||
{
|
||||
@if (currSplitted.AreaList.First().Equals(CurrFill))
|
||||
{
|
||||
<AreaSplit CurrSplitted="currSplitted"
|
||||
EC_AddSash="AddSash"
|
||||
EC_CopySash="CopySash">
|
||||
</AreaSplit>
|
||||
}
|
||||
} *@
|
||||
|
||||
@@ -20,6 +20,12 @@ namespace WebWindowComplex.Compo
|
||||
[Parameter]
|
||||
public Fill CurrFill { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Livello di accesso (utente base)
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public bool User { get; set; } = false!;
|
||||
|
||||
/// <summary>
|
||||
/// Evento per cambiare tutti i fill
|
||||
/// </summary>
|
||||
|
||||
@@ -15,13 +15,21 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-6">
|
||||
<div class="input-group my-2">
|
||||
<label class="input-group-text">Shape</label>
|
||||
<select class="form-select" @bind="@SelShapeIndex">
|
||||
@foreach (var i in CurrFrameWindow.ShapeList)
|
||||
{
|
||||
<option value="@(i.Id)">@(i.Name)</option>
|
||||
}
|
||||
</select>
|
||||
@if (User)
|
||||
{
|
||||
<span class="input-group-text">Shape</span>
|
||||
<input type="text" readonly class="form-control" value="@(CurrFrameWindow.ShapeList.ElementAt(SelShapeIndex - 1))">
|
||||
}
|
||||
else
|
||||
{
|
||||
<label class="input-group-text">Shape</label>
|
||||
<select class="form-select" @bind="@SelShapeIndex">
|
||||
@foreach (var i in CurrFrameWindow.ShapeList)
|
||||
{
|
||||
<option value="@(i.Id)">@(i.Name)</option>
|
||||
}
|
||||
</select>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -41,18 +49,42 @@
|
||||
<h6 class="fw-bold">Threshold</h6>
|
||||
</div>
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text">Tipology</label>
|
||||
<select class="form-select" @bind="SelThreshold">
|
||||
@foreach (var item in CurrFrameWindow.ThresholdList)
|
||||
{
|
||||
<option value="@(item.Type)">@(item.Name)</option>
|
||||
}
|
||||
</select>
|
||||
@* <select class="form-select">
|
||||
<option value="0">Soglia</option>
|
||||
<option value="1">Sgocciolatoio</option>
|
||||
</select> *@
|
||||
@if (User)
|
||||
{
|
||||
<span class="input-group-text">Tipology</span>
|
||||
<input type="text" readonly class="form-control" value="@(CurrFrameWindow.ThresholdList.FirstOrDefault(x => x.Type == SelThreshold).Name)">
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
<label class="input-group-text">Tipology</label>
|
||||
<select class="form-select" @bind="SelThreshold">
|
||||
@foreach (var item in CurrFrameWindow.ThresholdList)
|
||||
{
|
||||
<option value="@(item.Type)">@(item.Name)</option>
|
||||
}
|
||||
</select>
|
||||
}
|
||||
</div>
|
||||
@if (SashList.Count == 0)
|
||||
{
|
||||
<div class="d-flex justify-content-start align-items-center mt-2">
|
||||
<h6 class="fw-bold">Bottom rail</h6>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text">Quantity</span>
|
||||
@if (User)
|
||||
{
|
||||
<input type="number" readonly class="form-control" value="@FrameBottomRailQty">
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="number" class="form-control" @bind="@FrameBottomRailQty">
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
@@ -62,21 +94,24 @@
|
||||
<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(Json.WindowConst.Joints.ANGLED)" @onclick="() => ChangeAllJoints(WebWindowComplex.Json.WindowConst.Joints.ANGLED, CurrFrameWindow)">Angled</button>
|
||||
@if (!User)
|
||||
{
|
||||
<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, CurrFrameWindow)">Angled</button>
|
||||
</div>
|
||||
</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, CurrFrameWindow)">Horizontal</button>
|
||||
<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, CurrFrameWindow)">Horizontal</button>
|
||||
</div>
|
||||
</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, CurrFrameWindow)">Vertical</button>
|
||||
<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, CurrFrameWindow)">Vertical</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="row">
|
||||
@foreach (Joint joint in CurrFrameWindow.JointList)
|
||||
@@ -85,27 +120,29 @@
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-6">
|
||||
@if (SashList.Count == 0)
|
||||
{
|
||||
<div class="d-flex justify-content-start align-items-center">
|
||||
<h6 class="fw-bold">Bottom rail</h6>
|
||||
<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">Element</h6>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text">Quantity</span>
|
||||
<input type="number" class="form-control" @bind="@FrameBottomRailQty">
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
@foreach (var element in CurrFrameWindow.ElementDimensionList)
|
||||
{
|
||||
<EditElement CurrRec="element" EC_Update="UpdateElement"></EditElement>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (!(CurrFrameWindow.AreaList[0] is Split) || (SashList.Count == 0 && SplitList.Count == 0))
|
||||
@if (!User)
|
||||
{
|
||||
<AreaFrame EC_AddSash="AddSash"
|
||||
EC_AddSplit="AddSplit">
|
||||
</AreaFrame>
|
||||
@if (!(CurrFrameWindow.AreaList[0] is Split) || (SashList.Count == 0 && SplitList.Count == 0))
|
||||
{
|
||||
<AreaFrame EC_AddSash="AddSash"
|
||||
EC_AddSplit="AddSplit">
|
||||
</AreaFrame>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,6 +50,12 @@ namespace WebWindowComplex.Compo
|
||||
[CascadingParameter(Name = "SplitList")]
|
||||
public List<Split> SplitList { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Livello di accesso (utente base)
|
||||
/// </summary>
|
||||
[CascadingParameter(Name = "User")]
|
||||
public bool User { get; set; } = false!;
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Protected Properties
|
||||
@@ -236,6 +242,28 @@ namespace WebWindowComplex.Compo
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Aggiornamento element
|
||||
/// </summary>
|
||||
/// <param name="updRec"></param>
|
||||
/// <returns></returns>
|
||||
private async Task UpdateElement(ElementDimension updRec)
|
||||
{
|
||||
// cerco il record
|
||||
var currRec = CurrFrameWindow.ElementDimensionList.FirstOrDefault(x => x.ParentArea == updRec.ParentArea && x.nIndex == updRec.nIndex);
|
||||
// lo aggiorno
|
||||
if (updRec != null)
|
||||
{
|
||||
currRec = updRec;
|
||||
var args = new DataUpdateFrame()
|
||||
{
|
||||
currFrame = CurrFrameWindow,
|
||||
svgNoHw = true
|
||||
};
|
||||
await EC_UpdateFrame.InvokeAsync(args);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per la visualizzazione dei pulsanti joint
|
||||
/// </summary>
|
||||
|
||||
@@ -7,11 +7,14 @@
|
||||
<div class="px-2">
|
||||
<h5>Sash group @(SashList.Count > 1 ? (SashList.IndexOf(CurrSashGroup) + 1) : "")</h5>
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<div class="input-group mb-2 justify-content-center">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => RemoveArea()">Remove sash group</button>
|
||||
@if (!User)
|
||||
{
|
||||
<div class="px-2">
|
||||
<div class="input-group mb-2 justify-content-center">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => RemoveArea()">Remove sash group</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
<div class="px-2">
|
||||
<button class="btn btn-close" @onclick="ReqClose"></button>
|
||||
</div>
|
||||
@@ -22,26 +25,48 @@
|
||||
<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="@SashQty">
|
||||
@if (User)
|
||||
{
|
||||
<input type="number" readonly class="form-control" value="@SashQty">
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="number" class="form-control" @bind="@SashQty">
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<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="@OrientationSashTypeIndex">
|
||||
@foreach (var orientationSash in CurrSashGroup.OrientationSashTypeList)
|
||||
{
|
||||
<option value="@(orientationSash.Id)">@(orientationSash.Name)</option>
|
||||
}
|
||||
</select>
|
||||
@if(User)
|
||||
{
|
||||
<span class="input-group-text">Tipology</span>
|
||||
<input type="text" readonly class="form-control" value="@(CurrSashGroup.OrientationSashTypeList.FirstOrDefault(x => x.Id == OrientationSashTypeIndex).Name)">
|
||||
}
|
||||
else
|
||||
{
|
||||
<label class="input-group-text">Tipology</label>
|
||||
<select class="form-select" @bind="@OrientationSashTypeIndex">
|
||||
@foreach (var orientationSash in CurrSashGroup.OrientationSashTypeList)
|
||||
{
|
||||
<option value="@(orientationSash.Id)">@(orientationSash.Name)</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="@SashBottomRailQty">
|
||||
@if (User)
|
||||
{
|
||||
<input type="number" readonly class="form-control" value="@SashBottomRailQty">
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="number" class="form-control" @bind="@SashBottomRailQty">
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -53,43 +78,58 @@
|
||||
<h6 class="fw-bold">Hardware</h6>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text">Family</label>
|
||||
<select class="form-select" @bind="@FamilyHardware">
|
||||
@if (Sash.s_FamilyHardwareList == null || Sash.s_FamilyHardwareList.Count == 0)
|
||||
{
|
||||
<option value="000000">CUSTOM</option>
|
||||
}
|
||||
else
|
||||
{
|
||||
@foreach (var familyHw in Sash.s_FamilyHardwareList)
|
||||
{
|
||||
<option value="@familyHw">@familyHw</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
@if (string.IsNullOrEmpty(CurrSashGroup.SashShape))
|
||||
@if (User)
|
||||
{
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text">Type</label>
|
||||
<select class="form-select">
|
||||
<option value="000000">Custom HW</option>
|
||||
</select>
|
||||
<span class="input-group-text">Family</span>
|
||||
<input type="text" readonly class="form-control" value="@FamilyHardware">
|
||||
</div>
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text">Type</span>
|
||||
<input type="text" readonly class="form-control" value="@SelHwType">
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text">Type</label>
|
||||
<select class="form-select" @bind="SelHwType">
|
||||
<option value="000000">Custom HW</option>
|
||||
@foreach (var hlItem in CurrSashGroup.HardwareList)
|
||||
<label class="input-group-text">Family</label>
|
||||
<select class="form-select" @bind="@FamilyHardware">
|
||||
@if (Sash.s_FamilyHardwareList == null || Sash.s_FamilyHardwareList.Count == 0)
|
||||
{
|
||||
<option value="@hlItem.Id">@hlItem.Description</option>
|
||||
<option value="000000">CUSTOM</option>
|
||||
}
|
||||
else
|
||||
{
|
||||
@foreach (var familyHw in Sash.s_FamilyHardwareList)
|
||||
{
|
||||
<option value="@familyHw">@familyHw</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
@if (string.IsNullOrEmpty(CurrSashGroup.SashShape))
|
||||
{
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text">Type</label>
|
||||
<select class="form-select">
|
||||
<option value="000000">Custom HW</option>
|
||||
</select>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text">Type</label>
|
||||
<select class="form-select" @bind="SelHwType">
|
||||
<option value="000000">Custom HW</option>
|
||||
@foreach (var hlItem in CurrSashGroup.HardwareList)
|
||||
{
|
||||
<option value="@hlItem.Id">@hlItem.Description</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
}
|
||||
|
||||
}
|
||||
</div>
|
||||
<div class="col-md-12 col-lg-6">
|
||||
|
||||
@@ -15,6 +15,12 @@ namespace WebWindowComplex.Compo
|
||||
[CascadingParameter(Name = "CurrSashGroup")]
|
||||
public Sash CurrSashGroup { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Livello di accesso (utente base)
|
||||
/// </summary>
|
||||
[CascadingParameter(Name = "User")]
|
||||
public bool User { get; set; } = false!;
|
||||
|
||||
/// <summary>
|
||||
/// Evento per cambiare tutti i fill
|
||||
/// </summary>
|
||||
@@ -213,7 +219,8 @@ namespace WebWindowComplex.Compo
|
||||
}
|
||||
var args = new DataUpdateSash
|
||||
{
|
||||
currSash = CurrSashGroup
|
||||
currSash = CurrSashGroup,
|
||||
noSvg = true
|
||||
};
|
||||
await EC_UpdateSashGroup.InvokeAsync(args);
|
||||
}
|
||||
@@ -358,6 +365,7 @@ namespace WebWindowComplex.Compo
|
||||
{
|
||||
public Sash currSash { get; set; } = null!;
|
||||
public bool svgNoHw { get; set; } = false;
|
||||
public bool noSvg { get; set; } = false;
|
||||
}
|
||||
|
||||
public class DataUpdateRes
|
||||
|
||||
@@ -14,15 +14,18 @@
|
||||
<div class="card-body py-2">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<h5>Split</h5>
|
||||
@if ((CurrSplit.nSplitQtyVert == 1 && CurrSplit.nSplitQtyHoriz == 0) || (CurrSplit.nSplitQtyVert == 0 && CurrSplit.nSplitQtyHoriz == 1))
|
||||
@if (!User)
|
||||
{
|
||||
@if ((CurrSplit.nSplitQtyVert == 1 && CurrSplit.nSplitQtyHoriz == 0) || (CurrSplit.nSplitQtyVert == 0 && CurrSplit.nSplitQtyHoriz == 1))
|
||||
{
|
||||
<div class="input-group mb-2 justify-content-center">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => SwapTwoAree()">Swap Aree</button>
|
||||
</div>
|
||||
}
|
||||
<div class="input-group mb-2 justify-content-center">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => SwapTwoAree()">Swap Aree</button>
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => RemoveArea()">Remove split</button>
|
||||
</div>
|
||||
}
|
||||
<div class="input-group mb-2 justify-content-center">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => RemoveArea()">Remove split</button>
|
||||
</div>
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-outline-secondary dropdown-toggle btn-sm" type="button" @onclick="ToggleDropdown">
|
||||
Measure
|
||||
@@ -49,13 +52,21 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-6">
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text">Shape</label>
|
||||
<select class="form-select" @bind="@SplitShapeIndex">
|
||||
@foreach (var shapeType in CurrSplit.SplitShapeList)
|
||||
{
|
||||
<option value=@(shapeType.Id)>@(shapeType.Name)</option>
|
||||
}
|
||||
</select>
|
||||
@if (User)
|
||||
{
|
||||
<span class="input-group-text">Shape</span>
|
||||
<input type="text" readonly class="form-control" value="@(CurrSplit.SplitShapeList.FirstOrDefault(x => x.Id == SplitShapeIndex))">
|
||||
}
|
||||
else
|
||||
{
|
||||
<label class="input-group-text">Shape</label>
|
||||
<select class="form-select" @bind="@SplitShapeIndex">
|
||||
@foreach (var shapeType in CurrSplit.SplitShapeList)
|
||||
{
|
||||
<option value=@(shapeType.Id)>@(shapeType.Name)</option>
|
||||
}
|
||||
</select>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -65,7 +76,14 @@
|
||||
<div class="col-md-12 col-lg-6">
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text">QtyVert</span>
|
||||
<input type="number" class="form-control" @bind="@SplitQtyVert">
|
||||
@if (User)
|
||||
{
|
||||
<input type="number" readonly class="form-control" value="@SplitQtyVert">
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="number" class="form-control" @bind="@SplitQtyVert">
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@@ -74,7 +92,14 @@
|
||||
<div class="col-md-12 col-lg-6">
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text">QtyHoriz</span>
|
||||
<input type="number" class="form-control" @bind="@SplitQtyHoriz">
|
||||
@if (User)
|
||||
{
|
||||
<input type="number" readonly class="form-control" value="@SplitQtyHoriz">
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="number" class="form-control" @bind="@SplitQtyHoriz">
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@@ -90,35 +115,6 @@
|
||||
Index="i"
|
||||
EC_Update="UpdateDimension">
|
||||
</EditSplitDimensions>
|
||||
@* <div class="input-group mb-2">
|
||||
<span class="input-group-text">Width</span>
|
||||
<input type="number" class="form-control" @bind="@dim.dDimension">
|
||||
<select class="form-select" style="max-width:6rem; background-color:#e9ecef" @bind="@dim.SelMeasureTypeIndex">
|
||||
@foreach (var mType in dim.MeasureTypeList)
|
||||
{
|
||||
<option value=@(mType.Id)>
|
||||
@switch (mType.Name)
|
||||
{
|
||||
case "Absolute":
|
||||
{
|
||||
<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>
|
||||
<div class="col-md-12 col-lg-6">
|
||||
@@ -129,35 +125,6 @@
|
||||
Index="i"
|
||||
EC_Update="UpdateDimension">
|
||||
</EditSplitDimensions>
|
||||
@* <div class="input-group mb-2">
|
||||
<span class="input-group-text">Height</span>
|
||||
<input type="number" class="form-control" @bind="@dim.dDimension">
|
||||
<select class="form-select" style="max-width:6rem; background-color:#e9ecef" @bind="@dim.SelMeasureTypeIndex">
|
||||
@foreach (var mType in dim.MeasureTypeList)
|
||||
{
|
||||
<option value=@(mType.Id)>
|
||||
@switch (mType.Name)
|
||||
{
|
||||
case "Absolute":
|
||||
{
|
||||
<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>
|
||||
}
|
||||
@@ -170,37 +137,6 @@
|
||||
Index="i"
|
||||
EC_Update="UpdateDimension">
|
||||
</EditSplitDimensions>
|
||||
@* <div class="col-md-12 col-lg-6">
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text">Height</span>
|
||||
<input type="number" class="form-control" @bind="@dim.dDimension">
|
||||
<select class="form-select" style="max-width:6rem; background-color:#e9ecef" @bind="@dim.SelMeasureTypeIndex">
|
||||
@foreach (var mType in dim.MeasureTypeList)
|
||||
{
|
||||
<option value=@(mType.Id)>
|
||||
@switch (mType.Name)
|
||||
{
|
||||
case "Absolute":
|
||||
{
|
||||
<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> *@
|
||||
}
|
||||
}
|
||||
else if (CurrSplit.SplitVertList.Count > 0)
|
||||
@@ -212,37 +148,6 @@
|
||||
Index="i"
|
||||
EC_Update="UpdateDimension">
|
||||
</EditSplitDimensions>
|
||||
@* <div class="col-md-12 col-lg-6">
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text">Width</span>
|
||||
<input type="number" class="form-control" @bind="@dim.dDimension">
|
||||
<select class="form-select" style="max-width:6rem; background-color:#e9ecef" @bind="@dim.SelMeasureTypeIndex">
|
||||
@foreach (var mType in dim.MeasureTypeList)
|
||||
{
|
||||
<option value=@(mType.Id)>
|
||||
@switch (mType.Name)
|
||||
{
|
||||
case "Absolute":
|
||||
{
|
||||
<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> *@
|
||||
}
|
||||
}
|
||||
</div>
|
||||
@@ -252,7 +157,14 @@
|
||||
<div class="col-md-12 col-lg-6">
|
||||
<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="SplitStartVert" checked="@CurrSplit.bSplitStartVert" @oninput="(ChangeEventArgs e) => ChangeStartVert(e)">
|
||||
@if (User)
|
||||
{
|
||||
<input class="form-check-input ml-auto" disabled="disabled" type="checkbox" name="SplitStartVert" checked="@CurrSplit.bSplitStartVert">
|
||||
}
|
||||
else
|
||||
{
|
||||
<input class="form-check-input ml-auto" type="checkbox" name="SplitStartVert" checked="@CurrSplit.bSplitStartVert" @oninput="(ChangeEventArgs e) => ChangeStartVert(e)">
|
||||
}
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<label class="form-check-label fs-6 text-dark">StartVert</label>
|
||||
@@ -261,5 +173,13 @@
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-6">
|
||||
@foreach (var element in CurrSplit.ElemDimHorizList)
|
||||
{
|
||||
<EditElement CurrRec="element" EC_Update="UpdateElement"></EditElement>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -33,6 +33,12 @@ namespace WebWindowComplex.Compo
|
||||
[Parameter]
|
||||
public Frame FrameWindow { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Livello di accesso (utente base)
|
||||
/// </summary>
|
||||
[CascadingParameter(Name = "User")]
|
||||
public bool User { get; set; } = false!;
|
||||
|
||||
/// <summary>
|
||||
/// Evento per richiedere reset dizionario
|
||||
/// </summary>
|
||||
@@ -107,11 +113,11 @@ namespace WebWindowComplex.Compo
|
||||
{
|
||||
currSplit = CurrSplit
|
||||
};
|
||||
if (SearchSash(CurrSplit))
|
||||
{
|
||||
// Se la shape selezionata è grid o custom, richiede reset shape
|
||||
if(value > 2)
|
||||
_ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDictShape });
|
||||
if (SearchSash(CurrSplit))
|
||||
_ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetHwOpt });
|
||||
}
|
||||
_ = EC_UpdateSplit.InvokeAsync(args);
|
||||
}
|
||||
}
|
||||
@@ -168,6 +174,28 @@ namespace WebWindowComplex.Compo
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Aggiornamento element
|
||||
/// </summary>
|
||||
/// <param name="updRec"></param>
|
||||
/// <returns></returns>
|
||||
private async Task UpdateElement(ElementDimension updRec)
|
||||
{
|
||||
// cerco il record
|
||||
var currRec = CurrSplit.ElemDimHorizList.FirstOrDefault(x => x.ParentArea == updRec.ParentArea && x.nIndex == updRec.nIndex);
|
||||
// lo aggiorno
|
||||
if (updRec != null)
|
||||
{
|
||||
currRec = updRec;
|
||||
var args = new DataUpdateSplit()
|
||||
{
|
||||
currSplit = CurrSplit,
|
||||
svgNoHw = true
|
||||
};
|
||||
await EC_UpdateSplit.InvokeAsync(args);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per aggiornare la dimensione dello split
|
||||
/// </summary>
|
||||
@@ -188,9 +216,10 @@ namespace WebWindowComplex.Compo
|
||||
currRec = currSplitDim;
|
||||
var args = new DataUpdateSplit()
|
||||
{
|
||||
currSplit = CurrSplit
|
||||
currSplit = CurrSplit,
|
||||
noSvg = updRec.noSvg
|
||||
};
|
||||
await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDictShape });
|
||||
//await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDictShape });
|
||||
await EC_UpdateSplit.InvokeAsync(args);
|
||||
}
|
||||
}
|
||||
@@ -281,7 +310,8 @@ namespace WebWindowComplex.Compo
|
||||
}
|
||||
var args = new DataUpdateSplit()
|
||||
{
|
||||
currSplit = CurrSplit
|
||||
currSplit = CurrSplit,
|
||||
noSvg = true
|
||||
};
|
||||
await EC_UpdateSplit.InvokeAsync(args);
|
||||
}
|
||||
@@ -294,5 +324,6 @@ namespace WebWindowComplex.Compo
|
||||
{
|
||||
public Split currSplit { get; set; } = null!;
|
||||
public bool svgNoHw { get; set; } = false;
|
||||
public bool noSvg { get; set; } = false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
@using static WebWindowComplex.LayoutConst
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text">@(CurrRec.nIndex)</span>
|
||||
@if (User)
|
||||
{
|
||||
<input type="text" readonly class="form-control" value="@(CurrRec.dDimension)">
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="text" class="form-control" @bind="@(updateVal)">
|
||||
}
|
||||
</div>
|
||||
@@ -0,0 +1,48 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using WebWindowComplex.Models;
|
||||
|
||||
namespace WebWindowComplex.Compo
|
||||
{
|
||||
public partial class EditElement
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Joint corrente
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public ElementDimension CurrRec { get; set; } = null!;
|
||||
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<ElementDimension> EC_Update { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Livello di accesso (utente base)
|
||||
/// </summary>
|
||||
[CascadingParameter(Name = "User")]
|
||||
public bool User { get; set; } = false!;
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Private Properties
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per aggiornare element corrente
|
||||
/// </summary>
|
||||
private double updateVal
|
||||
{
|
||||
get => CurrRec.dDimension;
|
||||
set
|
||||
{
|
||||
if (CurrRec.dDimension != value)
|
||||
{
|
||||
CurrRec.SetDimension(value);
|
||||
_ = EC_Update.InvokeAsync(CurrRec);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Private Properties
|
||||
}
|
||||
}
|
||||
@@ -1,23 +1,31 @@
|
||||
@using static WebWindowComplex.LayoutConst
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text">@((PositionJoints)(CurrRec.nIndex - 1))</label>
|
||||
@if (CurrRec.ParentArea is Frame &&
|
||||
(CurrRec.ParentArea.ParentWindow.AreaList.First().SelShapeIndex == (int)Json.WindowConst.Shapes.DOUBLEARC ||
|
||||
CurrRec.ParentArea.ParentWindow.AreaList.First().SelShapeIndex == (int)Json.WindowConst.Shapes.ARC_FULL ||
|
||||
CurrRec.ParentArea.ParentWindow.AreaList.First().SelShapeIndex == (int)Json.WindowConst.Shapes.THREECENTERARC) &&
|
||||
(CurrRec.nIndex == 3 || CurrRec.nIndex == 4))
|
||||
@if (User)
|
||||
{
|
||||
<select class="form-select" @bind="@CurrJoint">
|
||||
<option value="@(CurrJoint)">@(CurrRec.JointTypeList.First(x => x.Id == CurrJoint).Name)</option>
|
||||
</select>
|
||||
<span class="input-group-text">@((PositionJoints)(CurrRec.nIndex - 1))</span>
|
||||
<input type="text" readonly class="form-control" value="@(CurrRec.JointTypeList.FirstOrDefault(x => x.Id == (int)CurrRec.SelJointType))">
|
||||
}
|
||||
else
|
||||
{
|
||||
<select class="form-select" @bind="@CurrJoint">
|
||||
@foreach (var typeJoint in CurrRec.JointTypeList)
|
||||
{
|
||||
<option value="@(typeJoint.Id)">@(typeJoint.Name)</option>
|
||||
}
|
||||
</select>
|
||||
<label class="input-group-text">@((PositionJoints)(CurrRec.nIndex - 1))</label>
|
||||
@if (CurrRec.ParentArea is Frame &&
|
||||
(CurrRec.ParentArea.ParentWindow.AreaList.First().SelShapeIndex == (int)Json.WindowConst.Shapes.DOUBLEARC ||
|
||||
CurrRec.ParentArea.ParentWindow.AreaList.First().SelShapeIndex == (int)Json.WindowConst.Shapes.ARC_FULL ||
|
||||
CurrRec.ParentArea.ParentWindow.AreaList.First().SelShapeIndex == (int)Json.WindowConst.Shapes.THREECENTERARC) &&
|
||||
(CurrRec.nIndex == 3 || CurrRec.nIndex == 4))
|
||||
{
|
||||
<select class="form-select" @bind="@CurrJoint">
|
||||
<option value="@(CurrJoint)">@(CurrRec.JointTypeList.First(x => x.Id == CurrJoint).Name)</option>
|
||||
</select>
|
||||
}
|
||||
else
|
||||
{
|
||||
<select class="form-select" @bind="@CurrJoint">
|
||||
@foreach (var typeJoint in CurrRec.JointTypeList)
|
||||
{
|
||||
<option value="@(typeJoint.Id)">@(typeJoint.Name)</option>
|
||||
}
|
||||
</select>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
@@ -17,6 +17,12 @@ namespace WebWindowComplex.Compo
|
||||
[Parameter]
|
||||
public EventCallback<Joint> EC_Update { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Livello di accesso (utente base)
|
||||
/// </summary>
|
||||
[CascadingParameter(Name = "User")]
|
||||
public bool User { get; set; } = false!;
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Private Properties
|
||||
|
||||
@@ -1,9 +1,24 @@
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text">@(CurrOpt.sName)</label>
|
||||
<select class="form-select" @bind="CurrValue">
|
||||
@foreach (var currValueCombo in CurrOpt.ValueList)
|
||||
@if (User)
|
||||
{
|
||||
<span class="input-group-text">@(CurrOpt.sName)</span>
|
||||
@if (CurrValue is String)
|
||||
{
|
||||
<option value="@currValueCombo.sValue">@currValueCombo.sDescription</option>
|
||||
<input type="text" readonly class="form-control" value="@CurrOpt.ValueList.FirstOrDefault(x => x.sValue.Equals(CurrValue)).sDescription">
|
||||
}
|
||||
</select>
|
||||
else
|
||||
{
|
||||
<input type="number" readonly class="form-control" value="@CurrOpt.ValueList.FirstOrDefault(x => x.sValue == CurrValue).sDescription">
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<label class="input-group-text">@(CurrOpt.sName)</label>
|
||||
<select class="form-select" @bind="CurrValue">
|
||||
@foreach (var currValueCombo in CurrOpt.ValueList)
|
||||
{
|
||||
<option value="@currValueCombo.sValue">@currValueCombo.sDescription</option>
|
||||
}
|
||||
</select>
|
||||
}
|
||||
</div>
|
||||
@@ -13,6 +13,12 @@ namespace WebWindowComplex.Compo
|
||||
[Parameter]
|
||||
public AGBOptionCombo CurrOpt { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Livello di accesso (utente base)
|
||||
/// </summary>
|
||||
[CascadingParameter(Name = "User")]
|
||||
public bool User { get; set; } = false!;
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<AGBOptionCombo> EC_Update { get; set; }
|
||||
|
||||
|
||||
@@ -1,22 +1,56 @@
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text">@(CurrOpt.sName)</label>
|
||||
@if (CurrOpt.sName.Equals("HMan"))
|
||||
@if (User)
|
||||
{
|
||||
<input type="number" class="form-control" @bind="@CurrValue">
|
||||
}
|
||||
else if (CurrOpt.ValueList.Count > 0)
|
||||
{
|
||||
<select class="form-select" @bind="CurrValue">
|
||||
@foreach (var currValueCombo in CurrOpt.ValueList)
|
||||
<span class="input-group-text">@(CurrOpt.sName)</span>
|
||||
@if (CurrOpt.sName.Equals("HMan"))
|
||||
{
|
||||
<input type="number" readonly class="form-control" value="@CurrValue">
|
||||
}
|
||||
else if (CurrOpt.ValueList.Count > 0)
|
||||
{
|
||||
if (CurrValue is String)
|
||||
{
|
||||
<option value="@currValueCombo">@currValueCombo</option>
|
||||
<input type="text" readonly class="form-control" value="@CurrValue">
|
||||
}
|
||||
</select>
|
||||
else
|
||||
{
|
||||
<input type="number" readonly class="form-control" value="@CurrValue">
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (CurrValue is String)
|
||||
{
|
||||
<input type="text" readonly class="form-control" value="@CurrValue">
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="number" readonly class="form-control" value="@CurrValue">
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<select class="form-select" @bind="CurrValue">
|
||||
<option value="@CurrOpt.sValue">@CurrOpt.sValue</option>
|
||||
</select>
|
||||
<label class="input-group-text">@(CurrOpt.sName)</label>
|
||||
@if (CurrOpt.sName.Equals("HMan"))
|
||||
{
|
||||
<input type="number" class="form-control" @bind="@CurrValue">
|
||||
}
|
||||
else if (CurrOpt.ValueList.Count > 0)
|
||||
{
|
||||
<select class="form-select" @bind="CurrValue">
|
||||
@foreach (var currValueCombo in CurrOpt.ValueList)
|
||||
{
|
||||
<option value="@currValueCombo">@currValueCombo</option>
|
||||
}
|
||||
</select>
|
||||
}
|
||||
else
|
||||
{
|
||||
<select class="form-select" @bind="CurrValue">
|
||||
<option value="@CurrOpt.sValue">@CurrOpt.sValue</option>
|
||||
</select>
|
||||
}
|
||||
|
||||
}
|
||||
</div>
|
||||
@@ -13,6 +13,12 @@ namespace WebWindowComplex.Compo
|
||||
[Parameter]
|
||||
public AGBOptionText CurrOpt { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Livello di accesso (utente base)
|
||||
/// </summary>
|
||||
[CascadingParameter(Name = "User")]
|
||||
public bool User { get; set; } = false!;
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<AGBOptionText> EC_Update { get; set; }
|
||||
|
||||
|
||||
@@ -67,7 +67,8 @@ namespace WebWindowComplex.Compo
|
||||
var args = new DataUpdateSplitDimension()
|
||||
{
|
||||
currSplit = CurrRec,
|
||||
index=Index
|
||||
index=Index,
|
||||
noSvg = true
|
||||
};
|
||||
_ = EC_Update.InvokeAsync(args);
|
||||
}
|
||||
@@ -145,5 +146,6 @@ namespace WebWindowComplex.Compo
|
||||
{
|
||||
public SplitDimension currSplit { get; set; } = null!;
|
||||
public int index { get; set; } = -1;
|
||||
public bool noSvg { get; set; } = false;
|
||||
}
|
||||
}
|
||||
@@ -14,22 +14,38 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-6 d-flex flex-column gap-2 flex-wrap">
|
||||
<div class="input-group mb-2 justify-content-center">
|
||||
<label class="input-group-text">Material</label>
|
||||
<select class="form-select @(cssValid("Material"))" @bind="CurrMaterial">
|
||||
@foreach (var item in ListPayload.Material)
|
||||
{
|
||||
<option value="@item">@item</option>
|
||||
}
|
||||
</select>
|
||||
@if (User)
|
||||
{
|
||||
<span class="input-group-text">Material</span>
|
||||
<input type="text" readonly class="form-control" value="@(CurrMaterial)">
|
||||
}
|
||||
else
|
||||
{
|
||||
<label class="input-group-text">Material</label>
|
||||
<select class="form-select @(cssValid("Material"))" @bind="CurrMaterial">
|
||||
@foreach (var item in ListPayload.Material)
|
||||
{
|
||||
<option value="@item">@item</option>
|
||||
}
|
||||
</select>
|
||||
}
|
||||
</div>
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text">Profile</label>
|
||||
<select class="form-select @(cssValid("Profile"))" @bind="@CurrProfile">
|
||||
@foreach (string profile in ListPayload.Profile)
|
||||
{
|
||||
<option value="@profile">@profile</option>
|
||||
}
|
||||
</select>
|
||||
@if (User)
|
||||
{
|
||||
<span class="input-group-text">Profile</span>
|
||||
<input type="text" readonly class="form-control" value="@(CurrProfile)">
|
||||
}
|
||||
else
|
||||
{
|
||||
<label class="input-group-text">Profile</label>
|
||||
<select class="form-select @(cssValid("Profile"))" @bind="@CurrProfile">
|
||||
@foreach (string profile in ListPayload.Profile)
|
||||
{
|
||||
<option value="@profile">@profile</option>
|
||||
}
|
||||
</select>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -41,13 +57,21 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text">Glass</label>
|
||||
<select class="form-select @(cssValid("Glass"))" @bind="@CurrGlass">
|
||||
@foreach (string glass in ListPayload.Glass)
|
||||
{
|
||||
<option value="@glass">@glass</option>
|
||||
}
|
||||
</select>
|
||||
@if (User)
|
||||
{
|
||||
<span class="input-group-text">Glass</span>
|
||||
<input type="text" readonly class="form-control" value="@(CurrGlass)">
|
||||
}
|
||||
else
|
||||
{
|
||||
<label class="input-group-text">Glass</label>
|
||||
<select class="form-select @(cssValid("Glass"))" @bind="@CurrGlass">
|
||||
@foreach (string glass in ListPayload.Glass)
|
||||
{
|
||||
<option value="@glass">@glass</option>
|
||||
}
|
||||
</select>
|
||||
}
|
||||
</div>
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text">Pannello</label>
|
||||
@@ -65,13 +89,21 @@
|
||||
</div>
|
||||
<div class ="row">
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text">Window</label>
|
||||
<select class="form-select @(cssValid("ColorMaterial"))" @bind="@CurrColor">
|
||||
@foreach (string colorMaterial in ListPayload.ColorMaterial)
|
||||
{
|
||||
<option value="@colorMaterial">@colorMaterial</option>
|
||||
}
|
||||
</select>
|
||||
@if (User)
|
||||
{
|
||||
<span class="input-group-text">Window</span>
|
||||
<input type="text" readonly class="form-control" value="@(CurrColor)">
|
||||
}
|
||||
else
|
||||
{
|
||||
<label class="input-group-text">Window</label>
|
||||
<select class="form-select @(cssValid("ColorMaterial"))" @bind="@CurrColor">
|
||||
@foreach (string colorMaterial in ListPayload.ColorMaterial)
|
||||
{
|
||||
<option value="@colorMaterial">@colorMaterial</option>
|
||||
}
|
||||
</select>
|
||||
}
|
||||
</div>
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text">Trunking</label>
|
||||
|
||||
@@ -14,6 +14,9 @@ namespace WebWindowComplex.Compo
|
||||
[Parameter]
|
||||
public Window CurrWindow { get; set; } = null!;
|
||||
|
||||
[Parameter]
|
||||
public bool User { get; set; } = false!;
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<DataUpdateGeneral> EC_UpdateGeneral { get; set; }
|
||||
|
||||
|
||||
@@ -42,12 +42,19 @@ namespace WebWindowComplex.DTO
|
||||
/// <summary>
|
||||
/// Elenco profili ammessi
|
||||
/// </summary>
|
||||
public List<string> Profile { get; set; } = null!;
|
||||
[Obsolete("Sostituire con info ProfileList")]
|
||||
public List<string>? Profile { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// Elenco profili ammessi
|
||||
/// </summary>
|
||||
public Dictionary<string,List<Threshold>> Threshold { get; set; } = null!;
|
||||
[Obsolete("Sostituire con info ProfileList")]
|
||||
public Dictionary<string,List<Threshold>>? Threshold { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// Lista info profili nel nuovo formato compatto
|
||||
/// </summary>
|
||||
public List<ProfilePayload>? ProfileList { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// Verifica di validità dell'intero Payload
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
using Egw.Window.Data;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WebWindowComplex.DTO
|
||||
{
|
||||
/// <summary>
|
||||
/// Payload info del profilo
|
||||
/// </summary>
|
||||
public class ProfilePayload
|
||||
{
|
||||
/// <summary>
|
||||
/// Nome profilo
|
||||
/// </summary>
|
||||
public string ProfileName { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Soglie del profilo
|
||||
/// </summary>
|
||||
public List<Threshold> ThresholdList { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Dizionario dei parametri del profilo
|
||||
/// </summary>
|
||||
public Dictionary<string, double> ParameterDict { get; set; } = new Dictionary<string, double>();
|
||||
}
|
||||
}
|
||||
@@ -188,6 +188,16 @@ namespace WebWindowComplex.Json
|
||||
}
|
||||
}
|
||||
|
||||
private List<JsonElementDimension> m_ElementDimensionList = new List<JsonElementDimension>();
|
||||
[JsonProperty]
|
||||
public List<JsonElementDimension> ElementDimensionList
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_ElementDimensionList;
|
||||
}
|
||||
}
|
||||
|
||||
private List<JsonJoint> m_JointList = new List<JsonJoint>();
|
||||
[JsonProperty]
|
||||
public List<JsonJoint> JointList
|
||||
@@ -286,6 +296,8 @@ namespace WebWindowComplex.Json
|
||||
//Frame.AppliedDone();
|
||||
for (var DimensionIndex = 0; DimensionIndex <= m_DimensionList.Count - 1; DimensionIndex++)
|
||||
newFrame.DimensionList[DimensionIndex].SetDimension(m_DimensionList[DimensionIndex].Value);
|
||||
for (var ElementIndex = 0; ElementIndex <= m_ElementDimensionList.Count - 1; ElementIndex++)
|
||||
newFrame.ElementDimensionList[ElementIndex].SetDimension(ElementDimensionList[ElementIndex].Value);
|
||||
for (var JointIndex = 0; JointIndex <= m_JointList.Count - 1; JointIndex++)
|
||||
newFrame.JointList[JointIndex].SetSelJointType(m_JointList[JointIndex].JointType);
|
||||
foreach (var Area in AreaList)
|
||||
@@ -446,6 +458,8 @@ namespace WebWindowComplex.Json
|
||||
newSash.SashList[SashIndex].SetMeasureType(m_SashList[SashIndex].MeasureType);
|
||||
foreach (var Joint in m_SashList[SashIndex].JointList)
|
||||
newSash.SashList[SashIndex].JointList.Add(Joint.Deserialize((Area)ParentArea));
|
||||
foreach (var ElementDimension in m_SashList[SashIndex].ElementDimensionList)
|
||||
newSash.SashList[SashIndex].ElementDimensionList.Add(ElementDimension.Deserialize((Area)ParentArea));
|
||||
}
|
||||
newSash.SetSelFamilyHardwareFromIndex(Hardware);
|
||||
//newSash.ReqRefreshShape();
|
||||
@@ -525,6 +539,16 @@ namespace WebWindowComplex.Json
|
||||
}
|
||||
}
|
||||
|
||||
private List<JsonElementDimension> m_ElemDimHorizList = new List<JsonElementDimension>();
|
||||
[JsonProperty]
|
||||
public List<JsonElementDimension> ElementDimHorizList
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_ElemDimHorizList;
|
||||
}
|
||||
}
|
||||
|
||||
public JsonSplit() : base(AreaTypes.SPLIT)
|
||||
{
|
||||
}
|
||||
@@ -565,6 +589,8 @@ namespace WebWindowComplex.Json
|
||||
Split.SplitHorizList[SplitIndex].SetDimension(m_SplitHorizList[SplitIndex].Dimension);
|
||||
Split.SplitHorizList[SplitIndex].SetMeasureType(m_SplitHorizList[SplitIndex].MeasureType);
|
||||
}
|
||||
foreach (var ElementDimension in ElementDimHorizList)
|
||||
Split.ElemDimHorizList.Add(ElementDimension.Deserialize((Area)ParentArea));
|
||||
}
|
||||
foreach (var Area in AreaList)
|
||||
{
|
||||
@@ -838,6 +864,45 @@ namespace WebWindowComplex.Json
|
||||
|
||||
}
|
||||
|
||||
public class JsonElementDimension
|
||||
{
|
||||
private int m_nIndex;
|
||||
[JsonProperty]
|
||||
public int Index
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_nIndex;
|
||||
}
|
||||
}
|
||||
|
||||
private double m_dValue;
|
||||
[JsonProperty]
|
||||
public double Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_dValue;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_dValue = value;
|
||||
}
|
||||
}
|
||||
|
||||
public JsonElementDimension(int Index, double Value)
|
||||
{
|
||||
m_nIndex = Index;
|
||||
m_dValue = Value;
|
||||
}
|
||||
|
||||
internal ElementDimension Deserialize(Area newArea)
|
||||
{
|
||||
ElementDimension newElementDimension = new ElementDimension(newArea, m_nIndex, m_dValue);
|
||||
return newElementDimension;
|
||||
}
|
||||
}
|
||||
|
||||
public class JsonFrameDimension
|
||||
{
|
||||
private int m_nIndex;
|
||||
@@ -944,6 +1009,16 @@ namespace WebWindowComplex.Json
|
||||
}
|
||||
}
|
||||
|
||||
private List<JsonElementDimension> m_ElementDimensionList = new List<JsonElementDimension>();
|
||||
[JsonProperty]
|
||||
public List<JsonElementDimension> ElementDimensionList
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_ElementDimensionList;
|
||||
}
|
||||
}
|
||||
|
||||
private List<JsonJoint> m_JointList = new List<JsonJoint>();
|
||||
[JsonProperty]
|
||||
public List<JsonJoint> JointList
|
||||
|
||||
@@ -145,19 +145,19 @@ namespace WebWindowComplex.Models
|
||||
List<Splitted> newSplittedList = new List<Splitted>();
|
||||
for (int i = 0; i < 2; i++)
|
||||
newSplittedList.Add(Splitted.CreateSplitted(SplitArea));
|
||||
// Inserisco nelle aree Splitted il Fill salvato e un Fill uguale (e setto ParentArea del fill)
|
||||
ContentArea[0].SetParentArea(newSplittedList[0]);
|
||||
newSplittedList[0].AreaList.Add(ContentArea[0]);
|
||||
// Inserisco nelle aree Splitted Fill e la struttura precedente (e setto ParentArea del fill)
|
||||
ContentArea[0].SetParentArea(newSplittedList[1]);
|
||||
newSplittedList[1].AreaList.Add(ContentArea[0]);
|
||||
if (ContentArea[0] is Fill)
|
||||
{
|
||||
Fill fill1 = (Fill)ContentArea[0];
|
||||
Fill fill2 = Fill.CreateFill(newSplittedList[1], fill1.FillType);
|
||||
newSplittedList[1].AreaList.Add(fill2);
|
||||
Fill fill2 = Fill.CreateFill(newSplittedList[0], fill1.FillType);
|
||||
newSplittedList[0].AreaList.Add(fill2);
|
||||
}
|
||||
else
|
||||
{
|
||||
Fill fill2 = Fill.CreateFill(newSplittedList[1], FillTypes.GLASS);
|
||||
newSplittedList[1].AreaList.Add(fill2);
|
||||
Fill fill2 = Fill.CreateFill(newSplittedList[0], FillTypes.GLASS);
|
||||
newSplittedList[0].AreaList.Add(fill2);
|
||||
}
|
||||
// All'area Split aggiunto le due aree Splitted
|
||||
for (int i = 0; i < 2; i++)
|
||||
@@ -180,51 +180,51 @@ namespace WebWindowComplex.Models
|
||||
AreaList[0] = AreaList[1];
|
||||
AreaList[1] = tempArea;
|
||||
}
|
||||
Frame f = ParentWindow.AreaList.First();
|
||||
switch (f.Shape)
|
||||
Frame frame = ParentWindow.AreaList.First();
|
||||
switch (frame.Shape)
|
||||
{
|
||||
case Shapes.RECTANGLE:
|
||||
case Shapes.ARC_FULL:
|
||||
case Shapes.TRIANGLE:
|
||||
{
|
||||
SearchAreaList(this, f.DimensionList.Where(x => x.sName.Equals("Width")).First().dDimension, "Width");
|
||||
SearchAreaList(this, f.DimensionList.Where(x => x.sName.Equals("Height")).First().dDimension, "Height");
|
||||
SearchAreaList(this, frame.DimensionList.Where(x => x.sName.Equals("Width")).First().dDimension, "Width");
|
||||
SearchAreaList(this, frame.DimensionList.Where(x => x.sName.Equals("Height")).First().dDimension, "Height");
|
||||
break;
|
||||
}
|
||||
|
||||
case Shapes.RIGHTCHAMFER:
|
||||
{
|
||||
SearchAreaList(this, f.DimensionList.Where(x => x.sName.Equals("Width")).First().dDimension, "Width");
|
||||
SearchAreaList(this, f.DimensionList.Where(x => x.sName.Equals("Left Height")).First().dDimension, "Left Height");
|
||||
SearchAreaList(this, frame.DimensionList.Where(x => x.sName.Equals("Width")).First().dDimension, "Width");
|
||||
SearchAreaList(this, frame.DimensionList.Where(x => x.sName.Equals("Left Height")).First().dDimension, "Left Height");
|
||||
break;
|
||||
}
|
||||
|
||||
case Shapes.LEFTCHAMFER:
|
||||
{
|
||||
SearchAreaList(this, f.DimensionList.Where(x => x.sName.Equals("Width")).First().dDimension, "Width");
|
||||
SearchAreaList(this, f.DimensionList.Where(x => x.sName.Equals("Right Height")).First().dDimension, "Right Height");
|
||||
SearchAreaList(this, frame.DimensionList.Where(x => x.sName.Equals("Width")).First().dDimension, "Width");
|
||||
SearchAreaList(this, frame.DimensionList.Where(x => x.sName.Equals("Right Height")).First().dDimension, "Right Height");
|
||||
break;
|
||||
}
|
||||
|
||||
case Shapes.DOUBLECHAMFER:
|
||||
case Shapes.ARC:
|
||||
{
|
||||
SearchAreaList(this, f.DimensionList.Where(x => x.sName.Equals("Width")).First().dDimension, "Width");
|
||||
SearchAreaList(this, f.DimensionList.Where(x => x.sName.Equals("Full Height")).First().dDimension, "Full Height");
|
||||
SearchAreaList(this, frame.DimensionList.Where(x => x.sName.Equals("Width")).First().dDimension, "Width");
|
||||
SearchAreaList(this, frame.DimensionList.Where(x => x.sName.Equals("Full Height")).First().dDimension, "Full Height");
|
||||
break;
|
||||
}
|
||||
|
||||
case Shapes.DOUBLEARC:
|
||||
{
|
||||
SearchAreaList(this, f.DimensionList.Where(x => x.sName.Equals("Width")).First().dDimension, "Width");
|
||||
SearchAreaList(this, f.DimensionList.Where(x => x.sName.Equals("Full Height")).First().dDimension, "Full Height");
|
||||
SearchAreaList(this, frame.DimensionList.Where(x => x.sName.Equals("Width")).First().dDimension, "Width");
|
||||
SearchAreaList(this, frame.DimensionList.Where(x => x.sName.Equals("Full Height")).First().dDimension, "Full Height");
|
||||
break;
|
||||
}
|
||||
|
||||
case Shapes.THREECENTERARC:
|
||||
{
|
||||
SearchAreaList(this, f.DimensionList.Where(x => x.sName.Equals("Width")).First().dDimension, "Width");
|
||||
SearchAreaList(this, f.DimensionList.Where(x => x.sName.Equals("Full Height")).First().dDimension, "Full Height");
|
||||
SearchAreaList(this, frame.DimensionList.Where(x => x.sName.Equals("Width")).First().dDimension, "Width");
|
||||
SearchAreaList(this, frame.DimensionList.Where(x => x.sName.Equals("Full Height")).First().dDimension, "Full Height");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -293,23 +293,23 @@ namespace WebWindowComplex.Models
|
||||
int countProportional = sash.SashList.Where(x => x.MeasureType.Equals(MeasureTypes.PROPORTIONAL)).Count();
|
||||
int countPercentage = sash.SashList.Where(x => x.MeasureType.Equals(MeasureTypes.PERCENTAGE)).Count();
|
||||
List<AreaDimension> dimList = new List<AreaDimension>();
|
||||
Split temp = new Split(null, null);
|
||||
Split split = new Split(null, null);
|
||||
if (sash.ParentArea.ParentArea is Split)
|
||||
temp = (Split)sash.ParentArea.ParentArea;
|
||||
if (sash.ParentArea is Frame || (sash.ParentArea.ParentArea is Split && temp.SplitHorizList.Count > 0))
|
||||
split = (Split)sash.ParentArea.ParentArea;
|
||||
if (sash.ParentArea is Frame || (sash.ParentArea.ParentArea is Split && split.SplitHorizList.Count > 0))
|
||||
{
|
||||
Frame f = null;
|
||||
if(temp.SplitHorizList.Count > 0)
|
||||
f = (Frame)sash.ParentArea.ParentArea.ParentArea;
|
||||
Frame frame = new Frame(null, null);
|
||||
if(split.SplitHorizList.Count > 0)
|
||||
frame = (Frame)sash.ParentArea.ParentArea.ParentArea;
|
||||
else
|
||||
f = (Frame)sash.ParentArea;
|
||||
foreach (var i in f.DimensionList)
|
||||
frame = (Frame)sash.ParentArea;
|
||||
foreach (var i in frame.DimensionList)
|
||||
dimList.Add(new AreaDimension(i.dDimension, i.SelMeasureType));
|
||||
}
|
||||
else
|
||||
{
|
||||
Split s = (Split)sash.ParentArea.ParentArea;
|
||||
foreach (var i in s.SplitVertList)
|
||||
//Split s = (Split)sash.ParentArea.ParentArea;
|
||||
foreach (var i in split.SplitVertList)
|
||||
dimList.Add(new AreaDimension(i.dDimension, i.SelMeasureType));
|
||||
}
|
||||
if (countAbsolute == sash.SashList.Count)
|
||||
@@ -348,7 +348,7 @@ namespace WebWindowComplex.Models
|
||||
else if (area is Split)
|
||||
{
|
||||
Split split = (Split)area;
|
||||
List<SplitDimension> splitList = null;
|
||||
List<SplitDimension> splitList = new List<SplitDimension>();
|
||||
if (nameDim.Equals("Width"))
|
||||
splitList = split.SplitVertList;
|
||||
else
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WebWindowComplex.Json;
|
||||
using static WebWindowComplex.Json.WindowConst;
|
||||
|
||||
namespace WebWindowComplex.Models
|
||||
{
|
||||
public class ElementDimension
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
public ElementDimension(Area ParentArea, int nIndex, double dDimension)
|
||||
{
|
||||
m_ParentArea = ParentArea;
|
||||
m_nIndex = nIndex;
|
||||
m_dDimension = dDimension;
|
||||
}
|
||||
|
||||
public ElementDimension(Area ParentArea, int nIndex, double dDimension, double dMin, double dMax)
|
||||
{
|
||||
m_ParentArea = ParentArea;
|
||||
m_nIndex = nIndex;
|
||||
m_dDimension = dDimension;
|
||||
m_dMin = dMin;
|
||||
m_dMax = dMax;
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public double dDimension
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_dDimension;
|
||||
}
|
||||
set
|
||||
{
|
||||
if(dDimension != value)
|
||||
{
|
||||
if (value > MaxDim)
|
||||
m_dDimension = MaxDim;
|
||||
else if (value < MinDim)
|
||||
m_dDimension = MinDim;
|
||||
else
|
||||
m_dDimension = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int nIndex
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_nIndex;
|
||||
}
|
||||
}
|
||||
|
||||
public Area ParentArea
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_ParentArea;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public void SetDimension(double dValue)
|
||||
{
|
||||
m_dDimension = dValue;
|
||||
}
|
||||
|
||||
public ElementDimension Copy()
|
||||
{
|
||||
ElementDimension newElementDimension = new ElementDimension(ParentArea, nIndex, dDimension);
|
||||
return newElementDimension;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Internal Methods
|
||||
|
||||
internal JsonElementDimension Serialize()
|
||||
{
|
||||
JsonElementDimension JsonElementDimension = new JsonElementDimension(m_nIndex, m_dDimension);
|
||||
return JsonElementDimension;
|
||||
}
|
||||
|
||||
#endregion Internal Methods
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected Area m_ParentArea;
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private double m_dDimension;
|
||||
|
||||
private int m_nIndex;
|
||||
|
||||
private double m_dMin;
|
||||
|
||||
private double m_dMax;
|
||||
// valore massimo della dimensione del frame
|
||||
private int MaxDim = 200;
|
||||
// valore minimo della dimensione del frame
|
||||
private int MinDim = 50;
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
@@ -117,6 +117,12 @@ namespace WebWindowComplex.Models
|
||||
set => m_DimensionList = value;
|
||||
}
|
||||
|
||||
public List<ElementDimension> ElementDimensionList
|
||||
{
|
||||
get => m_ElementDimensionList;
|
||||
set => m_ElementDimensionList = value;
|
||||
}
|
||||
|
||||
public List<Joint> JointList
|
||||
{
|
||||
get
|
||||
@@ -357,6 +363,32 @@ namespace WebWindowComplex.Models
|
||||
m_ThresholdList.Clear();
|
||||
m_ThresholdList = m_AllThresholdList.GetValueOrDefault(ParentWindow.sProfilePath);
|
||||
}
|
||||
|
||||
public double HeightFrame()
|
||||
{
|
||||
switch (SelShapeIndex)
|
||||
{
|
||||
case (int)Shapes.RECTANGLE:
|
||||
case (int)Shapes.TRIANGLE:
|
||||
case (int)Shapes.ARC_FULL:
|
||||
{
|
||||
return DimensionList.Where(x => x.sName == "Height").First().dDimension;
|
||||
}
|
||||
case (int)Shapes.RIGHTCHAMFER:
|
||||
{
|
||||
return DimensionList.Where(x => x.sName == "Left Height").First().dDimension;
|
||||
}
|
||||
case (int)Shapes.LEFTCHAMFER:
|
||||
{
|
||||
return DimensionList.Where(x => x.sName == "Right Height").First().dDimension;
|
||||
}
|
||||
default:
|
||||
{
|
||||
return DimensionList.Where(x => x.sName == "Full Height").First().dDimension;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override Frame Copy(Area ParentArea)
|
||||
{
|
||||
return null;
|
||||
@@ -399,6 +431,8 @@ namespace WebWindowComplex.Models
|
||||
// JsonFrame.ArcElement = null;
|
||||
foreach (var Dimension in DimensionList)
|
||||
JsonFrame.DimensionList.Add(Dimension.Serialize());
|
||||
foreach (var ElementDimension in ElementDimensionList)
|
||||
JsonFrame.ElementDimensionList.Add(ElementDimension.Serialize());
|
||||
foreach (var Joint in JointList)
|
||||
JsonFrame.JointList.Add(Joint.Serialize());
|
||||
foreach (var Area in AreaList)
|
||||
@@ -528,6 +562,49 @@ namespace WebWindowComplex.Models
|
||||
break;
|
||||
}
|
||||
}
|
||||
ElementDimensionList.Clear();
|
||||
// aggiungo Element Dimension
|
||||
switch (Value)
|
||||
{
|
||||
case Shapes.RECTANGLE:
|
||||
case Shapes.ARC_FULL:
|
||||
case Shapes.RIGHTCHAMFER:
|
||||
case Shapes.LEFTCHAMFER:
|
||||
case Shapes.ARC:
|
||||
{
|
||||
for(int i = 0; i < 4; i++)
|
||||
ElementDimensionList.Add(new ElementDimension(this, i + 1, 78));
|
||||
break;
|
||||
}
|
||||
|
||||
case Shapes.DOUBLECHAMFER:
|
||||
case Shapes.DOUBLEARC:
|
||||
{
|
||||
for (int i = 0; i < 5; i++)
|
||||
ElementDimensionList.Add(new ElementDimension(this, i + 1, 78));
|
||||
break;
|
||||
}
|
||||
|
||||
case Shapes.THREECENTERARC:
|
||||
{
|
||||
for (int i = 0; i < 6; i++)
|
||||
ElementDimensionList.Add(new ElementDimension(this, i + 1, 78));
|
||||
break;
|
||||
}
|
||||
|
||||
case Shapes.TRIANGLE:
|
||||
{
|
||||
for (int i = 0; i < 3; i++)
|
||||
ElementDimensionList.Add(new ElementDimension(this, i + 1, 78));
|
||||
break;
|
||||
}
|
||||
|
||||
case Shapes.CUSTOM:
|
||||
{
|
||||
ElementDimensionList.Clear();
|
||||
break;
|
||||
}
|
||||
}
|
||||
m_Shape = Value;
|
||||
}
|
||||
|
||||
@@ -557,6 +634,8 @@ namespace WebWindowComplex.Models
|
||||
private List<Threshold> m_ThresholdList = new List<Threshold>();
|
||||
|
||||
private List<FrameDimension> m_DimensionList = new List<FrameDimension>();
|
||||
|
||||
private List<ElementDimension> m_ElementDimensionList = new List<ElementDimension>();
|
||||
|
||||
private List<Joint> m_JointList = new List<Joint>();
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace WebWindowComplex.Models
|
||||
// Lista hardware completa passata dal chiamante del componente
|
||||
public static List<Hardware> m_HardwareCompleteList = new List<Hardware>();
|
||||
|
||||
// Lista hardware completa passata dal chiamante del componente
|
||||
// Lista famiglia hardware completa passata dal chiamante del componente
|
||||
public static List<string> s_FamilyHardwareList = new List<string>();
|
||||
|
||||
#endregion Public Fields
|
||||
@@ -34,18 +34,6 @@ namespace WebWindowComplex.Models
|
||||
|
||||
#region Public Properties
|
||||
|
||||
//public bool bIsMeasureGlass
|
||||
//{
|
||||
// get
|
||||
// {
|
||||
// return m_bIsMeasureGlass;
|
||||
// }
|
||||
// set
|
||||
// {
|
||||
// m_bIsMeasureGlass = value;
|
||||
// }
|
||||
//}
|
||||
|
||||
public bool bIsSashVertical
|
||||
{
|
||||
get
|
||||
@@ -261,6 +249,12 @@ namespace WebWindowComplex.Models
|
||||
}
|
||||
}
|
||||
|
||||
public List<ElementDimension> ElementDimensionList
|
||||
{
|
||||
get => m_ElementDimensionList;
|
||||
set => m_ElementDimensionList = value;
|
||||
}
|
||||
|
||||
public bool SashBottomRail
|
||||
{
|
||||
get
|
||||
@@ -485,7 +479,6 @@ namespace WebWindowComplex.Models
|
||||
Fill newFill = Fill.CreateFill(ParentArea, FillTypes.GLASS);
|
||||
newFill.SetAreaType(AreaTypes.FILL);
|
||||
ParentArea.AreaList.Add(newFill);
|
||||
//m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized());
|
||||
}
|
||||
|
||||
public void SetSelFamilyHardware(string sFamilyHw)
|
||||
@@ -508,7 +501,6 @@ namespace WebWindowComplex.Models
|
||||
public void UpdateShape(string newShape)
|
||||
{
|
||||
m_CurrShape = newShape;
|
||||
bool noHwValid = false;
|
||||
// la famiglia hw è vuota seleziono il primo hardware valido e utilizzo la sua famiglia
|
||||
if(string.IsNullOrEmpty(m_SelFamilyHardware) || m_SelFamilyHardware == "")
|
||||
{
|
||||
@@ -519,7 +511,6 @@ namespace WebWindowComplex.Models
|
||||
);
|
||||
if(listHwValid == null)
|
||||
{
|
||||
noHwValid = true;
|
||||
var familyHwValid = Sash.m_HardwareCompleteList
|
||||
.Select(x => x.FamilyName)
|
||||
.First();
|
||||
@@ -663,7 +654,7 @@ namespace WebWindowComplex.Models
|
||||
JsonSash JsonSash = new JsonSash(m_bIsSashVertical, m_SashType, m_bSashBottomRail, m_nSashBottomRailQty, currHwId, GroupId);
|
||||
foreach (var SashDimension in SashList)
|
||||
JsonSash.SashList.Add(SashDimension.Serialize());
|
||||
if(HwOptionList.Count > 0)
|
||||
if (HwOptionList.Count > 0)
|
||||
{
|
||||
foreach (var HwOption in HwOptionList)
|
||||
JsonSash.HwOptionList.Add(HwOption.Serialize());
|
||||
@@ -815,8 +806,6 @@ namespace WebWindowComplex.Models
|
||||
for (var SplitIndex = m_SashList.Count; SplitIndex <= Qty - 1; SplitIndex++)
|
||||
{
|
||||
SashDimension newSashDim = new SashDimension(dNewDimension, MeasureTypes.PERCENTAGE, this, SplitIndex + 1);
|
||||
//for (var JointIndex = 0; JointIndex <= 3; JointIndex++)
|
||||
// newSashDim.JointList.Add(new Joint(this, JointIndex + 1, Joints.FULL_H));
|
||||
SashList.Add(newSashDim);
|
||||
}
|
||||
}
|
||||
@@ -883,10 +872,10 @@ namespace WebWindowComplex.Models
|
||||
private List<AGBOption> m_HwOptionList = new List<AGBOption>();
|
||||
private Dictionary<string, string> m_SelHwOptionList = new Dictionary<string, string>();
|
||||
|
||||
//private List<Joint> m_JointList = new List<Joint>();
|
||||
|
||||
private int m_nSashBottomRailQty;
|
||||
|
||||
private List<ElementDimension> m_ElementDimensionList = new List<ElementDimension>();
|
||||
|
||||
private List<IdNameStruct> m_OrientationSashTypeList = new List<IdNameStruct>
|
||||
{
|
||||
new IdNameStruct((int)OrientationSash.VERTICAL, "Vertical"),
|
||||
|
||||
@@ -117,6 +117,17 @@ namespace WebWindowComplex.Models
|
||||
m_Parent = value;
|
||||
}
|
||||
}
|
||||
public List<ElementDimension> ElementDimensionList
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_ElementDimensionList;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_ElementDimensionList = value;
|
||||
}
|
||||
}
|
||||
|
||||
public List<Joint> JointList
|
||||
{
|
||||
@@ -362,34 +373,6 @@ namespace WebWindowComplex.Models
|
||||
}
|
||||
}
|
||||
|
||||
//public MeasureTypes MeasureType
|
||||
//{
|
||||
// get
|
||||
// {
|
||||
// return m_SelMeasureType;
|
||||
// }
|
||||
//}
|
||||
|
||||
//public List<IdNameStruct> MeasureTypeList
|
||||
//{
|
||||
// get
|
||||
// {
|
||||
// return m_MeasureTypeList;
|
||||
// }
|
||||
//}
|
||||
|
||||
//public MeasureTypes SelMeasureType
|
||||
//{
|
||||
// get
|
||||
// {
|
||||
// return m_SelMeasureType;
|
||||
// }
|
||||
// set
|
||||
// {
|
||||
// m_SelMeasureType = value;
|
||||
// }
|
||||
//}
|
||||
|
||||
public override int SelMeasureTypeIndex
|
||||
{
|
||||
get
|
||||
@@ -419,57 +402,6 @@ namespace WebWindowComplex.Models
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per convertire la dimensione dal vecchio tipo al nuovo tipo
|
||||
/// </summary>
|
||||
/// <param name="oldType"> Vecchio tipo </param>
|
||||
/// <param name="newType"> Nuovo tipo </param>
|
||||
/// <returns></returns>
|
||||
//public double ConvertDimension(MeasureTypes oldType, MeasureTypes newType, double widthTot)
|
||||
//{
|
||||
// switch (oldType)
|
||||
// {
|
||||
// case MeasureTypes.ABSOLUTE:
|
||||
// {
|
||||
// if (newType.Equals(MeasureTypes.PERCENTAGE))
|
||||
// {
|
||||
// //return Double.Round((m_dDimension / m_Parent.Width) * 100, 1);
|
||||
// return (m_dDimension / widthTot) * 100;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return CalculatePropVal(widthTot);
|
||||
// }
|
||||
// }
|
||||
// case MeasureTypes.PROPORTIONAL:
|
||||
// {
|
||||
// if (newType.Equals(MeasureTypes.ABSOLUTE))
|
||||
// {
|
||||
// //return Double.Round(ConvertFromPropVal(newType), 2);
|
||||
// return ConvertFromPropVal(newType, widthTot, dDimension);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// //return Double.Round(ConvertFromPropVal(newType), 1);
|
||||
// return ConvertFromPropVal(newType, widthTot, dDimension);
|
||||
// }
|
||||
// }
|
||||
// case MeasureTypes.PERCENTAGE:
|
||||
// {
|
||||
// if (newType.Equals(MeasureTypes.ABSOLUTE))
|
||||
// {
|
||||
// //return Double.Round((m_dDimension * m_Parent.Width) / 100, 2);
|
||||
// return (m_dDimension * widthTot) / 100;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return CalculatePropVal(widthTot);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return -1;
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per copiare l'intero oggetto
|
||||
/// </summary>
|
||||
@@ -480,6 +412,11 @@ namespace WebWindowComplex.Models
|
||||
newSashDim.SetMeasureType(MeasureType);
|
||||
newSashDim.SetOpeningType(SelOpeningType);
|
||||
newSashDim.SetHasHandle(bHasHandle);
|
||||
foreach (var item in ElementDimensionList)
|
||||
{
|
||||
ElementDimension newElementDimension = item.Copy();
|
||||
newSashDim.ElementDimensionList.Add(newElementDimension);
|
||||
}
|
||||
foreach (var item in JointList)
|
||||
{
|
||||
Joint newJoint = item.Copy();
|
||||
@@ -584,178 +521,13 @@ namespace WebWindowComplex.Models
|
||||
return width;
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// Calcolo MCD
|
||||
///// </summary>
|
||||
///// <param name="a"></param>
|
||||
///// <param name="b"></param>
|
||||
///// <returns></returns>
|
||||
//internal static double CalculateMCD(double a, double b)
|
||||
//{
|
||||
// while (b >= 0.01)
|
||||
// {
|
||||
// double temp = b;
|
||||
// b = a % b;
|
||||
// a = temp;
|
||||
// }
|
||||
// //return Double.Round(a,2);
|
||||
// return a;
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// Metodo per ricalcolare i valori proporzionali a causa della modifica di uno
|
||||
///// </summary>
|
||||
///// <returns></returns>
|
||||
//internal double CalculatePropVal(double widthTot)
|
||||
//{
|
||||
// if (m_Parent.SashList.Where(m => m.MeasureType.Equals(MeasureTypes.PROPORTIONAL)).ToList().Count == 0)
|
||||
// {
|
||||
// return 1;
|
||||
// }
|
||||
// List<double> absoluteValue = new List<double>();
|
||||
// foreach (var item in m_Parent.SashList)
|
||||
// {
|
||||
// absoluteValue.Add(item.CalculateAbsoluteValue(widthTot));
|
||||
// }
|
||||
// for (int i = 0; i < m_Parent.SashList.Count; i++)
|
||||
// {
|
||||
// if (!m_Parent.SashList.ElementAt(i).Equals(this) &&
|
||||
// m_Parent.SashList.ElementAt(i).MeasureType.Equals(MeasureTypes.PROPORTIONAL))
|
||||
// {
|
||||
// int nIndex = m_Parent.SashList.IndexOf(this);
|
||||
// if (absoluteValue.ElementAt(nIndex) <= absoluteValue.ElementAt(i))
|
||||
// {
|
||||
// var mcd = CalculateMCD(absoluteValue.ElementAt(nIndex), absoluteValue.ElementAt(i));
|
||||
// m_Parent.SashList.ElementAt(i).m_dDimension = absoluteValue.ElementAt(i) / mcd;
|
||||
// m_dDimension = absoluteValue.ElementAt(nIndex) / mcd;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// var mcd = CalculateMCD(absoluteValue.ElementAt(nIndex), absoluteValue.ElementAt(i));
|
||||
// m_Parent.SashList.ElementAt(i).m_dDimension = absoluteValue.ElementAt(i) / mcd;
|
||||
// m_dDimension = absoluteValue.ElementAt(nIndex) / mcd;
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// return m_dDimension;
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// Metodo per trasformare una dimensione in valore assoluto rispetto alla larghezza totale
|
||||
///// </summary>
|
||||
///// <param name="widthTot"> Larghezza totale </param>
|
||||
///// <returns></returns>
|
||||
//internal double CalculateAbsoluteValue(double widthTot)
|
||||
//{
|
||||
// switch (MeasureType)
|
||||
// {
|
||||
// case MeasureTypes.ABSOLUTE:
|
||||
// {
|
||||
// //return Double.Round(dDimension, 2);
|
||||
// return dDimension;
|
||||
// }
|
||||
// case MeasureTypes.PROPORTIONAL:
|
||||
// {
|
||||
// //return Double.Round(Proportional2AbsolutVal(), 2);
|
||||
// return ProportionalFromAbsoluteVal(widthTot);
|
||||
// }
|
||||
// case MeasureTypes.PERCENTAGE:
|
||||
// {
|
||||
// //return Double.Round((dDimension / 100) * widthTot, 1);
|
||||
// return (dDimension / 100) * widthTot;
|
||||
// }
|
||||
// }
|
||||
// return 0;
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// Metodo per convertire una dimensione da un valore assoluto al suo rispettivo tipo
|
||||
///// </summary>
|
||||
///// <param name="absoluteVal"> Valore assoluto </param>
|
||||
///// <param name="type"> Tipo di misura della dimensione </param>
|
||||
///// <param name="widthTot"> Larghezza totale </param>
|
||||
///// <returns></returns>
|
||||
//internal double ConvertIn(double absoluteVal, MeasureTypes type, double widthTot)
|
||||
//{
|
||||
// switch (type)
|
||||
// {
|
||||
// case MeasureTypes.ABSOLUTE:
|
||||
// {
|
||||
// return absoluteVal;
|
||||
// }
|
||||
// case MeasureTypes.PROPORTIONAL:
|
||||
// {
|
||||
// return ProportionalFromAbsoluteVal(widthTot);
|
||||
// }
|
||||
// case MeasureTypes.PERCENTAGE:
|
||||
// {
|
||||
// return (absoluteVal / widthTot) * 100;
|
||||
// }
|
||||
// }
|
||||
// return -1;
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// Metodo per convertire da misura proporzionale a misura assoluta o percentuale
|
||||
///// </summary>
|
||||
///// <param name="newType"></param>
|
||||
///// <returns></returns>
|
||||
//internal double ConvertFromPropVal(MeasureTypes newType, double widthTot, double dim)
|
||||
//{
|
||||
// double tot = widthTot;
|
||||
// //Somma misura non proporzionali
|
||||
// double sumNotProp = m_Parent.SashList
|
||||
// .Where(m => m.MeasureType != MeasureTypes.PROPORTIONAL && !m.Equals(this))
|
||||
// .Sum(m => m.CalculateAbsoluteValue(tot));
|
||||
// //Calcolo residuo
|
||||
// double res = tot - sumNotProp;
|
||||
// if (res < 0) res = 0;
|
||||
// //Misure proporzionali
|
||||
// var proportionalList = m_Parent.SashList
|
||||
// .Where(m => m.SelMeasureType == MeasureTypes.PROPORTIONAL)
|
||||
// .ToList();
|
||||
|
||||
// double sumPesi = proportionalList.Sum(p => p.dDimension);
|
||||
// if (sumPesi == 0) sumPesi = 1;
|
||||
// if (newType.Equals(MeasureTypes.ABSOLUTE))
|
||||
// {
|
||||
// return res / sumPesi * dim;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return (res / sumPesi * dim) / tot * 100;
|
||||
// }
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// Metodo per trasformare il valore proporzionale in assoluto
|
||||
///// </summary>
|
||||
///// <returns></returns>
|
||||
//internal double ProportionalFromAbsoluteVal(double widthTot)
|
||||
//{
|
||||
// double tot = widthTot;
|
||||
// //Somma misura non proporzionali
|
||||
// double sumNotProp = m_Parent.SashList
|
||||
// .Where(m => m.MeasureType != MeasureTypes.PROPORTIONAL)
|
||||
// .Sum(m => m.CalculateAbsoluteValue(tot));
|
||||
// //Calcolo residuo
|
||||
// double res = tot - sumNotProp;
|
||||
// if (res < 0) res = 0;
|
||||
// //Misure proporzionali
|
||||
// var proportionalList = m_Parent.SashList
|
||||
// .Where(m => m.SelMeasureType == MeasureTypes.PROPORTIONAL)
|
||||
// .ToList();
|
||||
// double sumPesi = proportionalList.Sum(p => p.dDimension);
|
||||
// if (sumPesi == 0) sumPesi = 1;
|
||||
// return res / sumPesi * dDimension;
|
||||
//}
|
||||
|
||||
internal JsonSashDimension Serialize()
|
||||
{
|
||||
JsonSashDimension JsonSashDimension = new JsonSashDimension(OpeningType, MeasureType, m_bHasHandle, dDimension, m_nSashId);
|
||||
foreach (var Joint in JointList)
|
||||
JsonSashDimension.JointList.Add(Joint.Serialize());
|
||||
foreach (var Elem in ElementDimensionList)
|
||||
JsonSashDimension.ElementDimensionList.Add(Elem.Serialize());
|
||||
return JsonSashDimension;
|
||||
}
|
||||
|
||||
@@ -851,7 +623,7 @@ namespace WebWindowComplex.Models
|
||||
private Sash m_Parent;
|
||||
|
||||
private List<Joint> m_JointList = new List<Joint>();
|
||||
|
||||
private List<ElementDimension> m_ElementDimensionList = new List<ElementDimension>();
|
||||
private Openings m_SelOpeningType;
|
||||
|
||||
//private MeasureTypes m_SelMeasureType;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -20,14 +21,6 @@ namespace WebWindowComplex.Models
|
||||
|
||||
#region Public Properties
|
||||
|
||||
//public bool bIsPercentage
|
||||
//{
|
||||
// get
|
||||
// {
|
||||
// return m_bIsPercentage;
|
||||
// }
|
||||
//}
|
||||
|
||||
public bool bSplitStartVert
|
||||
{
|
||||
get
|
||||
@@ -86,6 +79,7 @@ namespace WebWindowComplex.Models
|
||||
// aggiungo area Split di default
|
||||
for (var SplitIndex = m_SplitHorizList.Count; SplitIndex <= value; SplitIndex++)
|
||||
m_SplitHorizList.Add(new SplitDimension(dNewDimension, m_SplitHorizList[m_SplitHorizList.Count - 1].MeasureType, true, this, false));
|
||||
ElemDimHorizList.Add(new ElementDimension(this, ElemDimHorizList.Count, 78));
|
||||
}
|
||||
// Ricalcolo dimensioni rimuovendo split
|
||||
else
|
||||
@@ -98,6 +92,7 @@ namespace WebWindowComplex.Models
|
||||
}
|
||||
dLastDimension += m_SplitHorizList[m_SplitHorizList.Count - 1].dDimension;
|
||||
m_SplitHorizList[m_SplitHorizList.Count - 1].SetDimension(dLastDimension);
|
||||
ElemDimHorizList.RemoveAt(ElemDimHorizList.Count);
|
||||
}
|
||||
// Controllo quanti split verticali ci sono
|
||||
int nVert = m_SplitVertList.Count > 0 ? m_SplitVertList.Count : 1;
|
||||
@@ -186,14 +181,23 @@ namespace WebWindowComplex.Models
|
||||
// Ricalcolo dimensioni rimuovendo split
|
||||
else
|
||||
{
|
||||
double dLastDimension = 0;
|
||||
for (var SplitIndex = m_SplitVertList.Count - 1; SplitIndex >= value + 1; SplitIndex += -1)
|
||||
int countProportional = m_SplitVertList.Count(x => x.MeasureType.Equals(MeasureTypes.PROPORTIONAL));
|
||||
if(m_SplitVertList.Last().MeasureType.Equals(MeasureTypes.PROPORTIONAL) && countProportional - 1 == 1)
|
||||
{
|
||||
dLastDimension += m_SplitVertList[SplitIndex].dDimension;
|
||||
m_SplitVertList.RemoveAt(SplitIndex);
|
||||
m_SplitVertList.RemoveAt(m_SplitVertList.Count() - 1);
|
||||
m_SplitVertList.Where(x => x.MeasureType.Equals(MeasureTypes.PROPORTIONAL)).FirstOrDefault().SetDimension(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
double dLastDimension = 0;
|
||||
for (var SplitIndex = m_SplitVertList.Count - 1; SplitIndex >= value + 1; SplitIndex += -1)
|
||||
{
|
||||
dLastDimension += m_SplitVertList[SplitIndex].dDimension;
|
||||
m_SplitVertList.RemoveAt(SplitIndex);
|
||||
}
|
||||
dLastDimension += m_SplitVertList[m_SplitVertList.Count - 1].dDimension;
|
||||
m_SplitVertList[m_SplitVertList.Count - 1].SetDimension(dLastDimension);
|
||||
}
|
||||
dLastDimension += m_SplitVertList[m_SplitVertList.Count - 1].dDimension;
|
||||
m_SplitVertList[m_SplitVertList.Count - 1].SetDimension(dLastDimension);
|
||||
}
|
||||
// Controllo quanti split orizzontali ci sono
|
||||
int nHoriz = m_SplitHorizList.Count > 0 ? m_SplitHorizList.Count : 1;
|
||||
@@ -251,9 +255,9 @@ namespace WebWindowComplex.Models
|
||||
}
|
||||
set
|
||||
{
|
||||
SplitShapes OldSelShapeSplit = m_SelSplitShape;
|
||||
m_SelSplitShape = (SplitShapes)value;
|
||||
// Cancello elementi nello split e azzero quantità orizzontale e verticale
|
||||
AreaList.Clear();
|
||||
// Azzero quantità orizzontale e verticale
|
||||
SetSplitQtyVert(0);
|
||||
SetSplitQtyHoriz(0);
|
||||
if (m_SelSplitShape == SplitShapes.VERTICAL)
|
||||
@@ -275,15 +279,20 @@ namespace WebWindowComplex.Models
|
||||
SetSplitQtyHoriz(1);
|
||||
SetSplitStartVert(true);
|
||||
}
|
||||
// Aggiungo area Splitted e vetro
|
||||
int nVert = m_SplitVertList.Count > 0 ? m_SplitVertList.Count : 1;
|
||||
int nHoriz = m_SplitHorizList.Count > 0 ? m_SplitHorizList.Count : 1;
|
||||
for (var SplitIndex = 0; SplitIndex <= (nVert * nHoriz) - 1; SplitIndex++)
|
||||
if(OldSelShapeSplit == SplitShapes.GRID || m_SelSplitShape == SplitShapes.GRID)
|
||||
{
|
||||
AreaList.Add(Splitted.CreateSplitted(this));
|
||||
Fill newFill = Fill.CreateFill(AreaList[SplitIndex], FillTypes.GLASS);
|
||||
newFill.SetAreaType(AreaTypes.FILL);
|
||||
AreaList[SplitIndex].AreaList.Add(newFill);
|
||||
// Cancello vecchio contenuto dello split
|
||||
AreaList.Clear();
|
||||
// Aggiungo area Splitted e vetro
|
||||
int nVert = m_SplitVertList.Count > 0 ? m_SplitVertList.Count : 1;
|
||||
int nHoriz = m_SplitHorizList.Count > 0 ? m_SplitHorizList.Count : 1;
|
||||
for (var SplitIndex = 0; SplitIndex <= (nVert * nHoriz) - 1; SplitIndex++)
|
||||
{
|
||||
AreaList.Add(Splitted.CreateSplitted(this));
|
||||
Fill newFill = Fill.CreateFill(AreaList[SplitIndex], FillTypes.GLASS);
|
||||
newFill.SetAreaType(AreaTypes.FILL);
|
||||
AreaList[SplitIndex].AreaList.Add(newFill);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -299,7 +308,17 @@ namespace WebWindowComplex.Models
|
||||
m_SplitHorizList = value;
|
||||
}
|
||||
}
|
||||
|
||||
public List<ElementDimension> ElemDimHorizList
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_ElemDimHorizList;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_ElemDimHorizList = value;
|
||||
}
|
||||
}
|
||||
public List<SplitDimension> SplitPositionList
|
||||
{
|
||||
get
|
||||
@@ -354,6 +373,11 @@ namespace WebWindowComplex.Models
|
||||
// newSplit.SplitHorizList.ElementAt(i).SetDimension(SplitHorizList.ElementAt(i).dDimension);
|
||||
newSplit.SetSplitShape(SelSplitShape);
|
||||
newSplit.SetAreaType(AreaType);
|
||||
foreach (var item in ElemDimHorizList)
|
||||
{
|
||||
ElementDimension newElementDimension = item.Copy();
|
||||
newSplit.ElemDimHorizList.Add(newElementDimension);
|
||||
}
|
||||
foreach (var item in AreaList)
|
||||
{
|
||||
Area a = item.Copy(newSplit);
|
||||
@@ -409,6 +433,8 @@ namespace WebWindowComplex.Models
|
||||
JsonSplit.SplitVertList.Add(SplitVert.Serialize());
|
||||
foreach (var SplitHoriz in m_SplitHorizList)
|
||||
JsonSplit.SplitHorizList.Add(SplitHoriz.Serialize());
|
||||
foreach (var Elem in m_ElemDimHorizList)
|
||||
JsonSplit.ElementDimHorizList.Add(Elem.Serialize());
|
||||
foreach (var Area in AreaList)
|
||||
JsonSplit.AreaList.Add(Area.Serialize(hideHw));
|
||||
return JsonSplit;
|
||||
@@ -438,6 +464,8 @@ namespace WebWindowComplex.Models
|
||||
for (var SplitIndex = m_SplitHorizList.Count - 1; SplitIndex >= QtyHoriz; SplitIndex += -1)
|
||||
m_SplitHorizList.RemoveAt(SplitIndex);
|
||||
}
|
||||
for (int i = 0; i < QtyHoriz; i++)
|
||||
ElemDimHorizList.Add(new ElementDimension(this, i + 1, 78));
|
||||
}
|
||||
|
||||
internal void SetSplitQtyVert(int QtyVert)
|
||||
@@ -510,7 +538,7 @@ namespace WebWindowComplex.Models
|
||||
private SplitShapes m_SelSplitShape;
|
||||
|
||||
private List<SplitDimension> m_SplitHorizList = new List<SplitDimension>();
|
||||
|
||||
private List<ElementDimension> m_ElemDimHorizList = new List<ElementDimension>();
|
||||
private List<SplitDimension> m_SplitPositionList = new List<SplitDimension>();
|
||||
|
||||
private List<IdNameStruct> m_SplitShapeList = new List<IdNameStruct>
|
||||
|
||||
@@ -51,16 +51,17 @@ namespace WebWindowComplex.Models
|
||||
{
|
||||
double dimensionTot = 0;
|
||||
List<SplitDimension> dimensions = null;
|
||||
List<Frame> frames = m_Parent.ParentWindow.AreaList;
|
||||
Frame frame = m_Parent.ParentWindow.AreaList.FirstOrDefault();
|
||||
if (bIsVertListDim)
|
||||
{
|
||||
dimensions = m_Parent.SplitVertList;
|
||||
dimensionTot = CalculateWidthSplitGroup(frames.FirstOrDefault(), frames.FirstOrDefault().DimensionList.Where(x => x.sName == "Width").First().dDimension, new AreaFound(-1, false)).m_Dimension;
|
||||
dimensionTot = CalculateWidthSplitGroup(frame, frame.DimensionList.Where(x => x.sName == "Width").First().dDimension, new AreaFound(-1, false)).m_Dimension;
|
||||
}
|
||||
else
|
||||
{
|
||||
dimensions = m_Parent.SplitHorizList;
|
||||
dimensionTot = (CalculateHeightSplitGroup(m_Parent, HeightTot(), new AreaFound(-1, false))).m_Dimension;
|
||||
//dimensionTot = (CalculateHeightSplitGroup(m_Parent, HeightTot(), new AreaFound(-1, false))).m_Dimension;
|
||||
dimensionTot = (CalculateHeightSplitGroup(frame, frame.HeightFrame(), new AreaFound(-1, false))).m_Dimension;
|
||||
}
|
||||
double valMinAbsolute = 100;
|
||||
double valMaxAbsolute = dimensionTot - valMinAbsolute * (dimensions.Count - 1);
|
||||
@@ -214,7 +215,6 @@ namespace WebWindowComplex.Models
|
||||
for (int i = 0; i < absoluteValList.Count; i++)
|
||||
{
|
||||
var item = dimensions.ElementAt(i);
|
||||
//item.SetDimension(ConvertIn(absoluteValList[i], (MeasureTypes)item.SelMeasureTypeIndex, dimensionTot, dimensions));
|
||||
item.SetDimension(ad.ConvertIn(adList, absoluteValList[i], (MeasureTypes)item.SelMeasureTypeIndex, dimensionTot));
|
||||
}
|
||||
}
|
||||
@@ -240,35 +240,7 @@ namespace WebWindowComplex.Models
|
||||
m_Parent = value;
|
||||
}
|
||||
}
|
||||
|
||||
//public MeasureTypes MeasureType
|
||||
//{
|
||||
// get
|
||||
// {
|
||||
// return m_SelMeasureType;
|
||||
// }
|
||||
//}
|
||||
|
||||
//public List<IdNameStruct> MeasureTypeList
|
||||
//{
|
||||
// get
|
||||
// {
|
||||
// return m_MeasureTypeList;
|
||||
// }
|
||||
//}
|
||||
|
||||
//public MeasureTypes SelMeasureType
|
||||
//{
|
||||
// get
|
||||
// {
|
||||
// return m_SelMeasureType;
|
||||
// }
|
||||
// set
|
||||
// {
|
||||
// m_SelMeasureType = value;
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
public override int SelMeasureTypeIndex
|
||||
{
|
||||
get
|
||||
@@ -281,17 +253,17 @@ namespace WebWindowComplex.Models
|
||||
{
|
||||
MeasureTypes newType = (MeasureTypes)value;
|
||||
List<SplitDimension> splitList = null;
|
||||
List<Frame> frameList = m_Parent.ParentWindow.AreaList;
|
||||
Frame frame = m_Parent.ParentWindow.AreaList.FirstOrDefault();
|
||||
double tot = 0;
|
||||
if (bIsVertListDim)
|
||||
{
|
||||
splitList = m_Parent.SplitVertList;
|
||||
tot = CalculateWidthSplitGroup(frameList.FirstOrDefault(), frameList.FirstOrDefault().DimensionList.Where(x => x.sName == "Width").First().dDimension, new AreaFound(-1, false)).m_Dimension;
|
||||
tot = CalculateWidthSplitGroup(frame, frame.DimensionList.Where(x => x.sName == "Width").First().dDimension, new AreaFound(-1, false)).m_Dimension;
|
||||
}
|
||||
else
|
||||
{
|
||||
splitList = m_Parent.SplitHorizList;
|
||||
tot = (CalculateHeightSplitGroup(frameList.FirstOrDefault(), HeightTot(), new AreaFound(-1, false))).m_Dimension;
|
||||
tot = (CalculateHeightSplitGroup(frame, frame.HeightFrame(), new AreaFound(-1, false))).m_Dimension;
|
||||
}
|
||||
AreaDimension ad = new AreaDimension(dDimension, SelMeasureType);
|
||||
List<AreaDimension> adList = new List<AreaDimension>();
|
||||
@@ -301,7 +273,6 @@ namespace WebWindowComplex.Models
|
||||
}
|
||||
m_dDimension = ad.ConvertDimension(adList, m_SelMeasureType, newType, tot, splitList.IndexOf(this));
|
||||
m_SelMeasureType = (MeasureTypes)value;
|
||||
//m_Parent.ParentWindow.OnUpdatePreview(m_Parent.ParentWindow.sSerialized());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -310,57 +281,6 @@ namespace WebWindowComplex.Models
|
||||
|
||||
#region Public Methods
|
||||
|
||||
///// <summary>
|
||||
///// Metodo per convertire la dimensione dal vecchio tipo al nuovo tipo
|
||||
///// </summary>
|
||||
///// <param name="oldType"> Vecchio tipo </param>
|
||||
///// <param name="newType"> Nuovo tipo </param>
|
||||
///// <returns></returns>
|
||||
//public double ConvertDimension(MeasureTypes oldType, MeasureTypes newType, double widthTot, List<SplitDimension> splitList)
|
||||
//{
|
||||
// switch (oldType)
|
||||
// {
|
||||
// case MeasureTypes.ABSOLUTE:
|
||||
// {
|
||||
// if (newType.Equals(MeasureTypes.PERCENTAGE))
|
||||
// {
|
||||
// //return Double.Round((m_dDimension / m_Parent.Width) * 100, 1);
|
||||
// return (m_dDimension / widthTot) * 100;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return CalculatePropVal(widthTot, splitList);
|
||||
// }
|
||||
// }
|
||||
// case MeasureTypes.PROPORTIONAL:
|
||||
// {
|
||||
// if (newType.Equals(MeasureTypes.ABSOLUTE))
|
||||
// {
|
||||
// //return Double.Round(ConvertFromPropVal(newType), 2);
|
||||
// return ConvertFromPropVal(newType, widthTot, splitList);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// //return Double.Round(ConvertFromPropVal(newType), 1);
|
||||
// return ConvertFromPropVal(newType, widthTot, splitList);
|
||||
// }
|
||||
// }
|
||||
// case MeasureTypes.PERCENTAGE:
|
||||
// {
|
||||
// if (newType.Equals(MeasureTypes.ABSOLUTE))
|
||||
// {
|
||||
// //return Double.Round((m_dDimension * m_Parent.Width) / 100, 2);
|
||||
// return (m_dDimension * widthTot) / 100;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return CalculatePropVal(widthTot, splitList);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return -1;
|
||||
//}
|
||||
|
||||
public SplitDimension Copy()
|
||||
{
|
||||
SplitDimension newSplitDim = new SplitDimension(dDimension, MeasureType, bIsRelative, m_Parent, bIsVertListDim);
|
||||
@@ -376,6 +296,7 @@ namespace WebWindowComplex.Models
|
||||
/// </summary>
|
||||
/// <param name="area"> area di partenza </param>
|
||||
/// <param name="width"> larghezza di partenza </param>
|
||||
/// <param name="res"> area di ritorno </param>
|
||||
/// <returns></returns>
|
||||
internal AreaFound CalculateWidthSplitGroup(Area area, double width, AreaFound res)
|
||||
{
|
||||
@@ -422,8 +343,6 @@ namespace WebWindowComplex.Models
|
||||
}
|
||||
if (res.m_Dimension != -1 && res.m_Found)
|
||||
return res;
|
||||
//if (risultato != -1)
|
||||
// return risultato;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -477,6 +396,7 @@ namespace WebWindowComplex.Models
|
||||
/// </summary>
|
||||
/// <param name="area"> area di partenza </param>
|
||||
/// <param name="height"> altezza di partenza </param>
|
||||
/// <param name="res"> area di ritorno </param>
|
||||
/// <returns></returns>
|
||||
internal AreaFound CalculateHeightSplitGroup(Area area, double height, AreaFound res)
|
||||
{
|
||||
@@ -501,7 +421,8 @@ namespace WebWindowComplex.Models
|
||||
{
|
||||
case MeasureTypes.ABSOLUTE:
|
||||
{
|
||||
res = CalculateHeightSplitGroup(item, split.SplitHorizList.ElementAt(index).dDimension, res);
|
||||
double heightItemGroup = split.SplitHorizList.ElementAt(index).dDimension;
|
||||
res = CalculateHeightSplitGroup(item, heightItemGroup, res);
|
||||
break;
|
||||
}
|
||||
case MeasureTypes.PROPORTIONAL:
|
||||
@@ -512,19 +433,19 @@ namespace WebWindowComplex.Models
|
||||
{
|
||||
adList.Add(new AreaDimension(it.dDimension, it.SelMeasureType));
|
||||
}
|
||||
res = CalculateHeightSplitGroup(item, ad.ConvertFromPropVal(adList, MeasureTypes.ABSOLUTE, height), res);
|
||||
double heightItemGroup = ad.ConvertFromPropVal(adList, MeasureTypes.ABSOLUTE, height);
|
||||
res = CalculateHeightSplitGroup(item, heightItemGroup, res);
|
||||
break;
|
||||
}
|
||||
case MeasureTypes.PERCENTAGE:
|
||||
{
|
||||
res = CalculateHeightSplitGroup(item, split.SplitHorizList.ElementAt(index).dDimension * height / 100, res);
|
||||
double heightItemGroup = split.SplitHorizList.ElementAt(index).dDimension * height / 100;
|
||||
res = CalculateHeightSplitGroup(item, heightItemGroup, res);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (res.m_Dimension != -1 && res.m_Found)
|
||||
return res;
|
||||
//if (risultato != -1 && foundObj)
|
||||
// return risultato;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -543,173 +464,6 @@ namespace WebWindowComplex.Models
|
||||
return res;
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// Calcolo MCD
|
||||
///// </summary>
|
||||
///// <param name="a"></param>
|
||||
///// <param name="b"></param>
|
||||
///// <returns></returns>
|
||||
//internal static double CalculateMCD(double a, double b)
|
||||
//{
|
||||
// while (b >= 0.01)
|
||||
// {
|
||||
// double temp = b;
|
||||
// b = a % b;
|
||||
// a = temp;
|
||||
// }
|
||||
// //return Double.Round(a,2);
|
||||
// return a;
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// Metodo per ricalcolare i valori proporzionali a causa della modifica di uno
|
||||
///// </summary>
|
||||
///// <returns></returns>
|
||||
//internal double CalculatePropVal(double widthTot, List<SplitDimension> splitList)
|
||||
//{
|
||||
// if (splitList.Where(m => m.MeasureType.Equals(MeasureTypes.PROPORTIONAL)).ToList().Count == 0)
|
||||
// {
|
||||
// return 1;
|
||||
// }
|
||||
// List<double> absoluteValue = new List<double>();
|
||||
// foreach (var item in splitList)
|
||||
// {
|
||||
// absoluteValue.Add(item.CalculateAbsoluteValue(widthTot, splitList));
|
||||
// }
|
||||
// for (int i = 0; i < splitList.Count; i++)
|
||||
// {
|
||||
// if (!splitList.ElementAt(i).Equals(this) &&
|
||||
// splitList.ElementAt(i).MeasureType.Equals(MeasureTypes.PROPORTIONAL))
|
||||
// {
|
||||
// int nIndex = splitList.IndexOf(this);
|
||||
// if (absoluteValue.ElementAt(nIndex) <= absoluteValue.ElementAt(i))
|
||||
// {
|
||||
// var mcd = CalculateMCD(absoluteValue.ElementAt(nIndex), absoluteValue.ElementAt(i));
|
||||
// splitList.ElementAt(i).m_dDimension = absoluteValue.ElementAt(i) / mcd;
|
||||
// m_dDimension = absoluteValue.ElementAt(nIndex) / mcd;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// var mcd = CalculateMCD(absoluteValue.ElementAt(nIndex), absoluteValue.ElementAt(i));
|
||||
// splitList.ElementAt(i).m_dDimension = absoluteValue.ElementAt(i) / mcd;
|
||||
// m_dDimension = absoluteValue.ElementAt(nIndex) / mcd;
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// return m_dDimension;
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// Metodo per trasformare una dimensione in valore assoluto rispetto alla larghezza totale
|
||||
///// </summary>
|
||||
///// <param name="widthTot"> Larghezza totale </param>
|
||||
///// <returns></returns>
|
||||
//internal double CalculateAbsoluteValue(double widthTot, List<SplitDimension> splitList)
|
||||
//{
|
||||
// switch (MeasureType)
|
||||
// {
|
||||
// case MeasureTypes.ABSOLUTE:
|
||||
// {
|
||||
// //return Double.Round(dDimension, 2);
|
||||
// return dDimension;
|
||||
// }
|
||||
// case MeasureTypes.PROPORTIONAL:
|
||||
// {
|
||||
// //return Double.Round(Proportional2AbsolutVal(), 2);
|
||||
// return Proportional2AbsoluteVal(widthTot, splitList);
|
||||
// }
|
||||
// case MeasureTypes.PERCENTAGE:
|
||||
// {
|
||||
// //return Double.Round((dDimension / 100) * widthTot, 1);
|
||||
// return (dDimension / 100) * widthTot;
|
||||
// }
|
||||
// }
|
||||
// return 0;
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// Metodo per convertire una dimensione da un valore assoluto al suo rispettivo tipo
|
||||
///// </summary>
|
||||
///// <param name="absoluteVal"> Valore assoluto </param>
|
||||
///// <param name="type"> Tipo di misura della dimensione </param>
|
||||
///// <param name="widthTot"> Larghezza totale </param>
|
||||
///// <returns></returns>
|
||||
//internal double ConvertIn(double absoluteVal, MeasureTypes type, double widthTot, List<SplitDimension> splitList)
|
||||
//{
|
||||
// switch (type)
|
||||
// {
|
||||
// case MeasureTypes.ABSOLUTE:
|
||||
// {
|
||||
// return absoluteVal;
|
||||
// }
|
||||
// case MeasureTypes.PROPORTIONAL:
|
||||
// {
|
||||
// return Proportional2AbsoluteVal(widthTot, splitList);
|
||||
// }
|
||||
// case MeasureTypes.PERCENTAGE:
|
||||
// {
|
||||
// return (absoluteVal / widthTot) * 100;
|
||||
// }
|
||||
// }
|
||||
// return -1;
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// Metodo per convertire da misura proporzionale a misura assoluta o percentuale
|
||||
///// </summary>
|
||||
///// <param name="newType"></param>
|
||||
///// <returns></returns>
|
||||
//internal double ConvertFromPropVal(MeasureTypes newType, double widthTot, List<SplitDimension> splitList)
|
||||
//{
|
||||
// double tot = widthTot;
|
||||
// //Somma misura non proporzionali
|
||||
// double sumNotProp = splitList
|
||||
// .Where(m => m.MeasureType != MeasureTypes.PROPORTIONAL && !m.Equals(this))
|
||||
// .Sum(m => m.CalculateAbsoluteValue(tot, splitList));
|
||||
// //Calcolo residuo
|
||||
// double res = tot - sumNotProp;
|
||||
// if (res < 0) res = 0;
|
||||
// //Misure proporzionali
|
||||
// var proportionalList = splitList
|
||||
// .Where(m => m.SelMeasureType == MeasureTypes.PROPORTIONAL)
|
||||
// .ToList();
|
||||
|
||||
// double sumPesi = proportionalList.Sum(p => p.dDimension);
|
||||
// if (sumPesi == 0) sumPesi = 1;
|
||||
// if (newType.Equals(MeasureTypes.ABSOLUTE))
|
||||
// {
|
||||
// return res / sumPesi * dDimension;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return (res / sumPesi * dDimension) / tot * 100;
|
||||
// }
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// Metodo per trasformare il valore proporzionale in assoluto
|
||||
///// </summary>
|
||||
///// <returns></returns>
|
||||
//internal double Proportional2AbsoluteVal(double widthTot, List<SplitDimension> splitList)
|
||||
//{
|
||||
// double tot = widthTot;
|
||||
// //Somma misura non proporzionali
|
||||
// double sumNotProp = splitList
|
||||
// .Where(m => m.MeasureType != MeasureTypes.PROPORTIONAL)
|
||||
// .Sum(m => m.CalculateAbsoluteValue(tot, splitList));
|
||||
// //Calcolo residuo
|
||||
// double res = tot - sumNotProp;
|
||||
// if (res < 0) res = 0;
|
||||
// //Misure proporzionali
|
||||
// var proportionalList = splitList
|
||||
// .Where(m => m.SelMeasureType == MeasureTypes.PROPORTIONAL)
|
||||
// .ToList();
|
||||
// double sumPesi = proportionalList.Sum(p => p.dDimension);
|
||||
// if (sumPesi == 0) sumPesi = 1;
|
||||
// return res / sumPesi * dDimension;
|
||||
//}
|
||||
|
||||
internal JsonSplitDimension Serialize()
|
||||
{
|
||||
JsonSplitDimension JsonSplitDimension = new JsonSplitDimension(m_bIsRelative, m_dDimension, MeasureType);
|
||||
@@ -741,18 +495,18 @@ namespace WebWindowComplex.Models
|
||||
if (m_SelMeasureType != (MeasureTypes)value)
|
||||
{
|
||||
MeasureTypes newType = (MeasureTypes)value;
|
||||
List<Frame> frames = m_Parent.ParentWindow.AreaList;
|
||||
double tot = 0;
|
||||
Frame frame = m_Parent.ParentWindow.AreaList.FirstOrDefault();
|
||||
double dimSplitGroup = 0;
|
||||
if (bIsVertListDim)
|
||||
{
|
||||
tot = (CalculateWidthSplitGroup(frames.FirstOrDefault(), frames.FirstOrDefault().DimensionList.Where(x => x.sName == "Width").First().dDimension, new AreaFound(-1, false))).m_Dimension;
|
||||
dimSplitGroup = (CalculateWidthSplitGroup(frame, frame.DimensionList.Where(x => x.sName == "Width").First().dDimension, new AreaFound(-1, false))).m_Dimension;
|
||||
AreaDimension ad = new AreaDimension(dDimension, SelMeasureType);
|
||||
List<AreaDimension> newDimensions = new List<AreaDimension>();
|
||||
foreach (var item in m_Parent.SplitVertList)
|
||||
{
|
||||
newDimensions.Add(new AreaDimension(item.dDimension, item.SelMeasureType));
|
||||
}
|
||||
m_dDimension = ad.ConvertDimension(newDimensions, m_SelMeasureType, newType, tot, m_Parent.SplitVertList.IndexOf(this));
|
||||
m_dDimension = ad.ConvertDimension(newDimensions, m_SelMeasureType, newType, dimSplitGroup, m_Parent.SplitVertList.IndexOf(this));
|
||||
if (newType is MeasureTypes.PROPORTIONAL)
|
||||
{
|
||||
for (int i = 0; i < m_Parent.SplitVertList.Count; i++)
|
||||
@@ -762,14 +516,15 @@ namespace WebWindowComplex.Models
|
||||
} }
|
||||
else
|
||||
{
|
||||
tot = (CalculateHeightSplitGroup(m_Parent, HeightTot(), new AreaFound(-1, false))).m_Dimension;
|
||||
//tot = (CalculateHeightSplitGroup(m_Parent, HeightTot(), new AreaFound(-1, false))).m_Dimension;
|
||||
dimSplitGroup = (CalculateHeightSplitGroup(frame, frame.HeightFrame(), new AreaFound(-1, false))).m_Dimension;
|
||||
AreaDimension ad = new AreaDimension(dDimension, SelMeasureType);
|
||||
List<AreaDimension> newDimensions = new List<AreaDimension>();
|
||||
foreach (var item in m_Parent.SplitHorizList)
|
||||
{
|
||||
newDimensions.Add(new AreaDimension(item.dDimension, item.SelMeasureType));
|
||||
}
|
||||
m_dDimension = ad.ConvertDimension(newDimensions, m_SelMeasureType, newType, tot, m_Parent.SplitHorizList.IndexOf(this));
|
||||
m_dDimension = ad.ConvertDimension(newDimensions, m_SelMeasureType, newType, dimSplitGroup, m_Parent.SplitHorizList.IndexOf(this));
|
||||
if(newType is MeasureTypes.PROPORTIONAL)
|
||||
{
|
||||
for(int i = 0; i < m_Parent.SplitHorizList.Count; i++)
|
||||
@@ -782,32 +537,6 @@ namespace WebWindowComplex.Models
|
||||
}
|
||||
}
|
||||
|
||||
internal double HeightTot()
|
||||
{
|
||||
List<Frame> frames = m_Parent.ParentWindow.AreaList;
|
||||
switch (frames.First().SelShapeIndex)
|
||||
{
|
||||
case (int)Shapes.RECTANGLE:
|
||||
case (int)Shapes.TRIANGLE:
|
||||
case (int)Shapes.ARC_FULL:
|
||||
{
|
||||
return (CalculateHeightSplitGroup(frames.FirstOrDefault(), frames.FirstOrDefault().DimensionList.Where(x => x.sName == "Height").First().dDimension, new AreaFound(-1, false))).m_Dimension;
|
||||
}
|
||||
case (int)Shapes.RIGHTCHAMFER:
|
||||
{
|
||||
return (CalculateHeightSplitGroup(frames.FirstOrDefault(), frames.FirstOrDefault().DimensionList.Where(x => x.sName == "Left Height").First().dDimension, new AreaFound(-1, false))).m_Dimension;
|
||||
}
|
||||
case (int)Shapes.LEFTCHAMFER:
|
||||
{
|
||||
return (CalculateHeightSplitGroup(frames.FirstOrDefault(), frames.FirstOrDefault().DimensionList.Where(x => x.sName == "Right Height").First().dDimension, new AreaFound(-1, false))).m_Dimension;
|
||||
}
|
||||
default:
|
||||
{
|
||||
return (CalculateHeightSplitGroup(frames.FirstOrDefault(), frames.FirstOrDefault().DimensionList.Where(x => x.sName == "Full Height").First().dDimension, new AreaFound(-1, false))).m_Dimension;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Internal Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
@@ -77,8 +77,8 @@
|
||||
@if (currStep == CompileStep.Tree)
|
||||
{
|
||||
<CardTree ItemTableList="m_ItemTableList"
|
||||
maxCol="m_maxCol"
|
||||
EC_NextStep="NextStepArgs">
|
||||
maxCol="m_maxCol"
|
||||
EC_NextStep="NextStepArgs">
|
||||
</CardTree>
|
||||
}
|
||||
else if (currStep == CompileStep.Frame)
|
||||
@@ -87,14 +87,16 @@
|
||||
{
|
||||
m_PreviousWindow = m_CurrWindow;
|
||||
}
|
||||
<CascadingValue Value="FrameWindow" Name="CurrFrameWindow">
|
||||
<CascadingValue Value="m_SashList" Name="SashList">
|
||||
<CascadingValue Value="m_SplitList" Name="SplitList">
|
||||
<CardFrame EC_ReqResetDict="ReqResetDict"
|
||||
EC_ReqOptionHw="UpdateHwOptionsFrame"
|
||||
EC_UpdateFrame="UpdatePreviewFrame"
|
||||
EC_ReqClose="ReturnTree">
|
||||
</CardFrame>
|
||||
<CascadingValue Value="baseUser" Name="User">
|
||||
<CascadingValue Value="FrameWindow" Name="CurrFrameWindow">
|
||||
<CascadingValue Value="m_SashList" Name="SashList">
|
||||
<CascadingValue Value="m_SplitList" Name="SplitList">
|
||||
<CardFrame EC_ReqResetDict="ReqResetDict"
|
||||
EC_ReqOptionHw="UpdateHwOptionsFrame"
|
||||
EC_UpdateFrame="UpdatePreviewFrame"
|
||||
EC_ReqClose="ReturnTree">
|
||||
</CardFrame>
|
||||
</CascadingValue>
|
||||
</CascadingValue>
|
||||
</CascadingValue>
|
||||
</CascadingValue>
|
||||
@@ -107,15 +109,17 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
<CardSplit CurrSplit="SplitList[currSplitIndex]"
|
||||
SashList="SashList"
|
||||
SplitList="SplitList"
|
||||
FrameWindow="FrameWindow"
|
||||
EC_UpdateFrame="UpdatePreviewFrame"
|
||||
EC_ReqResetDict="ReqResetDict"
|
||||
EC_UpdateSplit="UpdatePreviewSplit"
|
||||
EC_ReqClose="ReturnTree">
|
||||
</CardSplit>
|
||||
<CascadingValue Value="baseUser" Name="User">
|
||||
<CardSplit CurrSplit="SplitList[currSplitIndex]"
|
||||
SashList="SashList"
|
||||
SplitList="SplitList"
|
||||
FrameWindow="FrameWindow"
|
||||
EC_UpdateFrame="UpdatePreviewFrame"
|
||||
EC_ReqResetDict="ReqResetDict"
|
||||
EC_UpdateSplit="UpdatePreviewSplit"
|
||||
EC_ReqClose="ReturnTree">
|
||||
</CardSplit>
|
||||
</CascadingValue>
|
||||
}
|
||||
}
|
||||
else if (currStep == CompileStep.Sash)
|
||||
@@ -126,17 +130,19 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
<CascadingValue Value="currLoading" Name="IsLoading">
|
||||
<CascadingValue Value="SashList[currSashIndex]" Name="CurrSashGroup">
|
||||
<CascadingValue Value="SashList" Name="SashList">
|
||||
<CardSashGroup FrameWindow="FrameWindow"
|
||||
EC_UpdateFrame="UpdatePreviewFrame"
|
||||
EC_UpdateSashGroup="UpdatePreviewSashGroup"
|
||||
EC_ReqResetDict="ReqResetDict"
|
||||
EC_ReqOptionHw="UpdateHwOptionsSash"
|
||||
EC_ReqFirstOptionHw="ReqFirstOptionHw"
|
||||
EC_ReqClose="ReturnTree">
|
||||
</CardSashGroup>
|
||||
<CascadingValue Value="baseUser" Name="User">
|
||||
<CascadingValue Value="currLoading" Name="IsLoading">
|
||||
<CascadingValue Value="SashList[currSashIndex]" Name="CurrSashGroup">
|
||||
<CascadingValue Value="SashList" Name="SashList">
|
||||
<CardSashGroup FrameWindow="FrameWindow"
|
||||
EC_UpdateFrame="UpdatePreviewFrame"
|
||||
EC_UpdateSashGroup="UpdatePreviewSashGroup"
|
||||
EC_ReqResetDict="ReqResetDict"
|
||||
EC_ReqOptionHw="UpdateHwOptionsSash"
|
||||
EC_ReqFirstOptionHw="ReqFirstOptionHw"
|
||||
EC_ReqClose="ReturnTree">
|
||||
</CardSashGroup>
|
||||
</CascadingValue>
|
||||
</CascadingValue>
|
||||
</CascadingValue>
|
||||
</CascadingValue>
|
||||
@@ -151,9 +157,10 @@
|
||||
else
|
||||
{
|
||||
<CardFill CurrIndex="currFillIndex"
|
||||
CurrFill="FillList[currFillIndex]"
|
||||
EC_UpdateFill="UpdatePreviewFill"
|
||||
EC_ReqClose="ReturnTree">
|
||||
CurrFill="FillList[currFillIndex]"
|
||||
User="baseUser"
|
||||
EC_UpdateFill="UpdatePreviewFill"
|
||||
EC_ReqClose="ReturnTree">
|
||||
</CardFill>
|
||||
<div class="card shadow-sm rounded mb-2">
|
||||
<div class="card-body py-2">
|
||||
@@ -162,18 +169,32 @@
|
||||
<h5 class="text-center text-nowrap">All fill</h5>
|
||||
</div>
|
||||
<div class="input-group mb-2 justify-content-center">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => ChangeAllFill(WebWindowComplex.Json.WindowConst.FillTypes.GLASS)">All glass</button>
|
||||
@if (baseUser)
|
||||
{
|
||||
<button class="@buttonFillCss(Json.WindowConst.FillTypes.GLASS)">All glass</button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button class="@buttonFillCss(Json.WindowConst.FillTypes.GLASS)" @onclick="() => ChangeAllFill(WebWindowComplex.Json.WindowConst.FillTypes.GLASS)">All glass</button>
|
||||
}
|
||||
</div>
|
||||
<div class="input-group mb-2 justify-content-center">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => ChangeAllFill(WebWindowComplex.Json.WindowConst.FillTypes.WOOD)">All wood</button>
|
||||
@if (baseUser)
|
||||
{
|
||||
<button class="@buttonFillCss(Json.WindowConst.FillTypes.WOOD)">All wood</button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button class="@buttonFillCss(Json.WindowConst.FillTypes.WOOD)" @onclick="() => ChangeAllFill(WebWindowComplex.Json.WindowConst.FillTypes.WOOD)">All wood</button>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if(SplittedList != null && SplittedList.Count > 0)
|
||||
@if(!baseUser && SplittedList != null && SplittedList.Count > 0)
|
||||
{
|
||||
Splitted currSplitted = SplittedList.Where(x => x.AreaList.First().Equals(FillList[currFillIndex])).FirstOrDefault();
|
||||
@if (currSplitted != null) {
|
||||
Splitted currSplitted = SplittedList.Where(x => x.AreaList.First().Equals(FillList[currFillIndex])).FirstOrDefault()?? new Splitted(null, null);
|
||||
@if (currSplitted.ParentArea != null && currSplitted.ParentWindow != null){
|
||||
<AreaSplit SashList="SashList"
|
||||
SplittedList="SplittedList"
|
||||
CurrSplitted="currSplitted"
|
||||
@@ -181,13 +202,6 @@
|
||||
</AreaSplit>
|
||||
}
|
||||
}
|
||||
@* @foreach (var currSplitted in m_SplittedList)
|
||||
{
|
||||
@if (currSplitted.AreaList.First().Equals(FillList[currFillIndex]))
|
||||
{
|
||||
|
||||
}
|
||||
} *@
|
||||
}
|
||||
}
|
||||
else if (currStep == CompileStep.General)
|
||||
@@ -195,6 +209,7 @@
|
||||
<General CurrWindow="m_CurrWindow"
|
||||
ListPayload="ListPayload"
|
||||
ListWarnings="listWarnings"
|
||||
User="baseUser"
|
||||
EC_UpdateGeneral="UpdatePreviewGeneral"
|
||||
EC_ReqClose="ReturnTree">
|
||||
</General>
|
||||
|
||||
@@ -92,6 +92,12 @@ namespace WebWindowComplex
|
||||
[Parameter]
|
||||
public LivePayload LiveData { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Livello di accesso (utente base)
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public bool baseUser { get; set; } = false!;
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
@@ -1225,16 +1231,20 @@ namespace WebWindowComplex
|
||||
{
|
||||
Split newSplit = args.currSplit;
|
||||
bool forceSvgNoHw = args.svgNoHw;
|
||||
bool noSvg = args.noSvg;
|
||||
if (newSplit != null)
|
||||
{
|
||||
// cerco il record
|
||||
var currRec = SearchArea(FrameWindow, newSplit.GroupId, newSplit);
|
||||
// lo aggiorno
|
||||
currRec = newSplit;
|
||||
if(forceSvgNoHw)
|
||||
await DoPreviewSvg(true,true);
|
||||
else
|
||||
await DoPreviewSvg();
|
||||
if (!noSvg)
|
||||
{
|
||||
if (forceSvgNoHw)
|
||||
await DoPreviewSvg(true, true);
|
||||
else
|
||||
await DoPreviewSvg();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1268,6 +1278,7 @@ namespace WebWindowComplex
|
||||
{
|
||||
Sash newSash = args.currSash;
|
||||
bool svgNoHw = args.svgNoHw;
|
||||
bool noSvg = args.noSvg;
|
||||
if (svgNoHw)
|
||||
{
|
||||
Sash item = (Sash)SearchArea(FrameWindow, newSash.GroupId, newSash);
|
||||
@@ -1283,11 +1294,26 @@ namespace WebWindowComplex
|
||||
if (newSash != null && item != null)
|
||||
{
|
||||
item = newSash;
|
||||
await DoPreviewSvg();
|
||||
if(!noSvg)
|
||||
await DoPreviewSvg();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calcola bottone per tutti i Fill
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string buttonFillCss(FillTypes reqFillTypes)
|
||||
{
|
||||
foreach (var fill in FillList)
|
||||
{
|
||||
if (!fill.FillType.Equals(reqFillTypes))
|
||||
return "btn btn-outline-secondary btn-sm";
|
||||
}
|
||||
return "btn btn-secondary btn-sm";
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>2.7.12.2316</Version>
|
||||
<Version>2.8.1.2209</Version>
|
||||
<Authors>Annamaria Sassi</Authors>
|
||||
<Company>Egalware</Company>
|
||||
<Description>Componente gestione Configurazioni avanzate Window per LUX</Description>
|
||||
@@ -18,11 +18,11 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Egw.Window.Data" Version="2.7.12.2312" />
|
||||
<PackageReference Include="Egw.Window.Data" Version="2.8.1.2116" />
|
||||
<PackageReference Include="EgwCoreLib.Razor" Version="1.5.2511.312" />
|
||||
<PackageReference Include="EgwCoreLib.Utils" Version="1.5.2511.312" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.21" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
|
||||
</ItemGroup>
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -File $(ProjectDir)\post-build.ps1 -ProjectPath $(ProjectPath)" />
|
||||
@@ -49,401 +49,4 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>2.7.12.2316</Version>
|
||||
<Version>2.8.1.2209</Version>
|
||||
<Authors>Annamaria Sassi</Authors>
|
||||
<Company>Egalware</Company>
|
||||
<Description>Componente gestione JWD per LUX</Description>
|
||||
@@ -26,11 +26,11 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Egw.Window.Data" Version="2.7.12.2312" />
|
||||
<PackageReference Include="Egw.Window.Data" Version="2.8.1.2116" />
|
||||
<PackageReference Include="EgwCoreLib.Razor" Version="1.5.2511.312" />
|
||||
<PackageReference Include="EgwCoreLib.Utils" Version="1.5.2511.312" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.21" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
|
||||
</ItemGroup>
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -File $(ProjectDir)\post-build.ps1 -ProjectPath $(ProjectPath)" />
|
||||
@@ -56,505 +56,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
@using WebWindowTest.Models
|
||||
<div class="card shadow-sm rounded">
|
||||
<div class="card-header bg-light bg-opacity-25">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div class="col d-flex justify-content-between">
|
||||
<h5>Area frame</h5>
|
||||
</div>
|
||||
<div class="col d-flex justify-content-between">
|
||||
@if (CurrSashList.Count == 0 && CurrSplitList.Count == 0)
|
||||
{
|
||||
<div class="input-group mb-2 justify-content-center">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="RaiseAddSash">Aggiungi sash</button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="col d-flex justify-content-between">
|
||||
@if (!(CurrFrameWindow.AreaList[0] is Split))
|
||||
{
|
||||
<div class="input-group mb-2 justify-content-center">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="RaiseAddSplit">Aggiungi split</button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,49 +0,0 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using WebWindowTest.Models;
|
||||
|
||||
namespace WebWindowTest.Compo
|
||||
{
|
||||
public partial class AreaFrame
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Parameter]
|
||||
public Frame CurrFrameWindow { get; set; } = null!;
|
||||
|
||||
[Parameter]
|
||||
public List<Sash> CurrSashList { get; set; } = null!;
|
||||
|
||||
[Parameter]
|
||||
public List<Split> CurrSplitList { get; set; } = null!;
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<bool> EC_AddSash { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<bool> EC_AddSplit { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Sollevo evento richiesta aggiunta sash
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private async Task RaiseAddSash()
|
||||
{
|
||||
await EC_AddSash.InvokeAsync(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sollevo evento richiesta aggiunta window
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private async Task RaiseAddSplit()
|
||||
{
|
||||
await EC_AddSplit.InvokeAsync(true);
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
|
||||
<div class="col-sm-6 my-2">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<h6 class="fw-bold">Frame</h6>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body py-2">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<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="NumTrochetti" checked="@insertQty" @onclick="() => IsCheckedQty()">
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text">Qty element</span>
|
||||
@if (insertQty)
|
||||
{
|
||||
@* <input type="number" class="form-control" @bind="@ArcElementQty"> *@
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="number" class="form-control" disabled>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</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="Estremità" checked="@CurrFrame.FrameArcElem.bCutEdge" @onclick="() => IsCheckCutEdge()"> *@
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<label class="form-check-label fs-6 text-dark">Taglio estremità</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<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="Sezione" checked="@(!insertQty)" @onclick="() => IsCheckedQty()">
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text">Section</span>
|
||||
@if (!insertQty)
|
||||
{
|
||||
@* <input type="number" class="form-control" @bind="@ArcSection"> *@
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="number" class="form-control" disabled>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</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="Allineamento" checked="@CurrFrame.FrameArcElem.bIsAlign" @onclick="() => IsCheckAlign()"> *@
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<label class="form-check-label fs-6 text-dark">Allineamento</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,84 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using System.Runtime.CompilerServices;
|
||||
using WebWindowTest.DTO;
|
||||
using WebWindowTest.Models;
|
||||
|
||||
namespace WebWindowTest.Compo
|
||||
{
|
||||
public partial class AreaFrameArcElem
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Frame corrente
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public Frame CurrFrame { get; set; } = null!;
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<Frame> EC_UpdatePreview { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
//protected int ArcElementQty
|
||||
//{
|
||||
// get => CurrFrame.FrameArcElem.nQty;
|
||||
// set
|
||||
// {
|
||||
// CurrFrame.FrameArcElem.nQty = value;
|
||||
// _ = EC_UpdatePreview.InvokeAsync(CurrFrame);
|
||||
// }
|
||||
//}
|
||||
|
||||
//protected double ArcSection
|
||||
//{
|
||||
// get => CurrFrame.FrameArcElem.nSection;
|
||||
// set
|
||||
// {
|
||||
// CurrFrame.FrameArcElem.nSection = value;
|
||||
// _ = EC_UpdatePreview.InvokeAsync(CurrFrame);
|
||||
// }
|
||||
//}
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected void IsCheckedQty()
|
||||
{
|
||||
insertQty = !insertQty;
|
||||
}
|
||||
|
||||
//protected void IsCheckCutEdge()
|
||||
//{
|
||||
// CurrFrame.FrameArcElem.bCutEdge = !CurrFrame.FrameArcElem.bCutEdge;
|
||||
// _ = EC_UpdatePreview.InvokeAsync(CurrFrame);
|
||||
//}
|
||||
|
||||
//protected void IsCheckAlign()
|
||||
//{
|
||||
// CurrFrame.FrameArcElem.bIsAlign = !CurrFrame.FrameArcElem.bIsAlign;
|
||||
// _ = EC_UpdatePreview.InvokeAsync(CurrFrame);
|
||||
//}
|
||||
|
||||
protected string IsUsedQty()
|
||||
{
|
||||
if (insertQty)
|
||||
return "form-control";
|
||||
else
|
||||
return "form-control disabled";
|
||||
}
|
||||
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private bool insertQty = false;
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,38 +1,54 @@
|
||||
@using static WebWindowTest.Json.WindowConst
|
||||
|
||||
<div class="row mt-2">
|
||||
<div class="row">
|
||||
<div class="col d-flex justify-content-start align-items-center">
|
||||
<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()">+</button>
|
||||
<button class="btn btn-primary btn-sm" type="button" @onclick="() => changeCollapsed()"><i class="@hwIcon"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-2">
|
||||
@if (isLoadingHwOpt && CurrSash.HwOptionList.Count == 0)
|
||||
@if (!hwOptCollapsed)
|
||||
{
|
||||
<button class="btn btn-secondary" type="button" disabled>Loading</button>
|
||||
}
|
||||
@if (!hwOptCollapsed || !isLoadingHwOpt)
|
||||
{
|
||||
@foreach (var currOpt in CurrSash.HwOptionList)
|
||||
@if (IsLoadingHwOpt)
|
||||
{
|
||||
switch (currOpt.Type)
|
||||
{
|
||||
case HwOptionTypes.COMBO:
|
||||
<div class="col justify-content-start">
|
||||
<p class="placeholder-glow">
|
||||
<span class="placeholder col-12 bg-secondary placeholder-lg my-2"></span>
|
||||
<span class="placeholder col-4 bg-secondary placeholder-lg my-2"></span>
|
||||
<span class="placeholder col-6 bg-secondary placeholder-lg my-2"></span>
|
||||
<span class="placeholder col-7 bg-secondary placeholder-lg my-2"></span>
|
||||
<span class="placeholder col-6 bg-secondary placeholder-lg my-2"></span>
|
||||
<span class="placeholder col-4 bg-secondary placeholder-lg my-2"></span>
|
||||
<span class="placeholder col-8 bg-secondary placeholder-lg my-2"></span>
|
||||
<span class="placeholder col-12 bg-secondary placeholder-lg my-2"></span>
|
||||
</p>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="scrollspy my-2" tabindex="0"
|
||||
style="position: relative; height: 15rem; overflow-y: auto;">
|
||||
@foreach (var currOpt in CurrSashGroup.HwOptionList)
|
||||
{
|
||||
switch (currOpt.Type)
|
||||
{
|
||||
AGBOptionCombo currOptCombo = (AGBOptionCombo)currOpt;
|
||||
<EditOptionCombo CurrOpt="currOptCombo" EC_Update="RaiseOptCombo"></EditOptionCombo>
|
||||
break;
|
||||
case HwOptionTypes.COMBO:
|
||||
{
|
||||
AGBOptionCombo currOptCombo = (AGBOptionCombo)currOpt;
|
||||
<EditOptionCombo CurrOpt="currOptCombo"></EditOptionCombo>
|
||||
break;
|
||||
}
|
||||
case HwOptionTypes.TEXT:
|
||||
{
|
||||
AGBOptionText currOptText = (AGBOptionText)currOpt;
|
||||
<EditOptionText CurrOpt="currOptText"></EditOptionText>
|
||||
break;
|
||||
}
|
||||
}
|
||||
case HwOptionTypes.TEXT:
|
||||
{
|
||||
AGBOptionText currOptText = (AGBOptionText)currOpt;
|
||||
<EditOptionText CurrOpt="currOptText" EC_Update="RaiseOptText"></EditOptionText>
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
</div>
|
||||
@@ -11,60 +11,45 @@ namespace WebWindowTest.Compo
|
||||
/// <summary>
|
||||
/// Sash corrente rispetto alla lista Sash
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public Sash CurrSash { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Evento per aggiornare gli hardware option di tipo combo
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<AGBOptionCombo> EC_UpdateHwOptCombo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Evento per aggiornare gli hardware option di tipo text
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<AGBOptionText> EC_UpdateHwOptText { get; set; }
|
||||
[CascadingParameter(Name = "CurrSashGroup")]
|
||||
public Sash CurrSashGroup { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Evento per chiamare la prima volta la lista delle opzioni
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<int> EC_FirstHwOptionList { get; set; }
|
||||
|
||||
private bool isLoadingHwOpt { get; set; }
|
||||
|
||||
private bool hwOptCollapsed { get; set; }
|
||||
[CascadingParameter(Name = "IsLoading")]
|
||||
public List<string> IsLoading { get; set; } = new List<string>();
|
||||
|
||||
private bool hwOptCollapsed { get; set; } = true;
|
||||
|
||||
protected override void OnAfterRender(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
{
|
||||
hwOptCollapsed = true;
|
||||
}
|
||||
}
|
||||
|
||||
private async Task changeCollapsed()
|
||||
{
|
||||
hwOptCollapsed = !hwOptCollapsed;
|
||||
if(CurrSash.HwOptionList.Count == 0)
|
||||
if (CurrSashGroup.HwOptionList.Count == 0)
|
||||
{
|
||||
isLoadingHwOpt = true;
|
||||
await EC_FirstHwOptionList.InvokeAsync(CurrSash.GroupId);
|
||||
await EC_FirstHwOptionList.InvokeAsync();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Report aggiornamento Option Combo
|
||||
/// </summary>
|
||||
/// <param name="updRec"></param>
|
||||
/// <returns></returns>
|
||||
private async Task RaiseOptCombo(AGBOptionCombo updRec)
|
||||
private string hwIcon
|
||||
{
|
||||
await EC_UpdateHwOptCombo.InvokeAsync(updRec);
|
||||
get => hwOptCollapsed ? "fa-solid fa-chevron-down" : "fa-solid fa-chevron-up";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Report aggiornamento Option Text
|
||||
/// </summary>
|
||||
/// <param name="updRec"></param>
|
||||
/// <returns></returns>
|
||||
private async Task RaiseOptText(AGBOptionText updRec)
|
||||
private bool IsLoadingHwOpt
|
||||
{
|
||||
await EC_UpdateHwOptText.InvokeAsync(updRec);
|
||||
get => IsLoading != null && IsLoading.Count > 0 && IsLoading.Contains("LoadHwOpt");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,70 +1,114 @@
|
||||
@using WebWindowTest.Models
|
||||
<div class="col-sm-6 my-2">
|
||||
<div class="d-flex justify-content-start align-items-center">
|
||||
<h6 class="fw-bold">Sash @(CurrSashGroup.SashList.Count == 1 ? "" : (IndexSash + 1))</h6>
|
||||
</div>
|
||||
<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>
|
||||
}
|
||||
@* <option value="0">A bandiera sinistra</option>
|
||||
<option value="1">A bandiera destra</option>
|
||||
<option value="2">Ad anta-ribalta sinistra</option>
|
||||
<option value="3">Ad anta-ribalta destra</option>
|
||||
<option value="4">Solo verso alto</option>
|
||||
<option value="5">Solo verso basso</option>
|
||||
<option value="6">Pivot</option>
|
||||
<option value="7">Fissa</option>
|
||||
<option value="8">Complanare sinistra</option>
|
||||
<option value="9">Complanare destra</option>
|
||||
<option value="10">Scorrevole sinistra</option>
|
||||
<option value="11">Scorrevole destra</option> *@
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text">Dimension</span>
|
||||
<input type="number" class="form-control" @bind="@CurrSashDim.dDimension">
|
||||
<span class="input-group-text">%</span>
|
||||
</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)">
|
||||
@using EgwCoreLib.Razor
|
||||
@if(mode == ModeView.View)
|
||||
{
|
||||
<div class="col-lg-6 col-md-12 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-outline-secondary btn-sm" type="button" @onclick="() => doEdit(IndexSash)">Edit</button>
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<label class="form-check-label fs-6 text-dark">Handle</label>
|
||||
<div class="input-group mb-2 mt-2">
|
||||
<span class="input-group-text">Tipology</span>
|
||||
<input type="text" readonly class="form-control" value="@(CurrSashDim.OpeningTypeList.ElementAt(OpeningTypeIndex - 1))">
|
||||
</div>
|
||||
</div>
|
||||
@if (!(CurrAnta.AreaList[0] is Split))
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="input-group mb-2 justify-content-center">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => CurrAnta.AddSplit()">Aggiungi split</button>
|
||||
</div>
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text">Dimension</span>
|
||||
<input type="number" class="form-control" @bind="@Dimension">
|
||||
<select class="form-select" style="max-width:6rem; background-color:#e9ecef" @bind="@MeasureTypeIndex">
|
||||
@foreach (var mType in CurrSashDim.MeasureTypeList)
|
||||
{
|
||||
<option value=@(mType.Id)>
|
||||
@switch (mType.Name)
|
||||
{
|
||||
case "Absolute":
|
||||
{
|
||||
<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="() => ChangeHandle()">
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="input-group mb-2 justify-content-center">
|
||||
<button class="btn btn-outline-secondary btn-sm">Aggiungi inglesina</button>
|
||||
</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-sm-6 my-1">
|
||||
<div class="input-group justify-content-center">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => RaiseCopyContentSash(CurrSashGroup, IndexCopy, IndexModify)">Copy sash @(k + 1)</button>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<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>
|
||||
<button type="button" class="btn-close" aria-label="Close" @onclick="() => ClosePopup(IndexSash)"></button>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-12 my-2">
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text">Tipology</span>
|
||||
<input type="text" readonly class="form-control" value="@(CurrSashDim.OpeningTypeList.ElementAt(OpeningTypeIndex - 1))">
|
||||
</div>
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text">Dimension</span>
|
||||
<input type="number" class="form-control" @bind="@Dimension">
|
||||
<select class="form-select" style="max-width:6rem; background-color:#e9ecef" @bind="@MeasureTypeIndex">
|
||||
@foreach (var mType in CurrSashDim.MeasureTypeList)
|
||||
{
|
||||
<option value=@(mType.Id)>
|
||||
@switch (mType.Name)
|
||||
{
|
||||
case "Absolute":
|
||||
{
|
||||
<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="() => ChangeHandle()">
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<label class="form-check-label fs-6 text-dark">Handle</label>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-12">
|
||||
<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>
|
||||
@foreach (Joint joint in CurrSashDim.JointList)
|
||||
{
|
||||
<EditJoint CurrRec="joint"></EditJoint>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
using EgwCoreLib.Razor;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using WebWindowTest.Models;
|
||||
using static WebWindowTest.Json.WindowConst;
|
||||
|
||||
namespace WebWindowTest.Compo
|
||||
{
|
||||
@@ -8,7 +12,7 @@ namespace WebWindowTest.Compo
|
||||
/// <summary>
|
||||
/// Sash group corrente
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
[CascadingParameter(Name = "CurrSashGroup")]
|
||||
public Sash CurrSashGroup { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
@@ -17,6 +21,18 @@ namespace WebWindowTest.Compo
|
||||
[Parameter]
|
||||
public SashDimension CurrSashDim { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Lista delle sash
|
||||
/// </summary>
|
||||
[CascadingParameter(Name = "SashList")]
|
||||
public List<Sash> SashList { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Modalità di visualizzazione (view /edit)
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public bool EditMode { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Indice della sash corrente
|
||||
/// </summary>
|
||||
@@ -24,26 +40,33 @@ namespace WebWindowTest.Compo
|
||||
public int IndexSash { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Evento per cambiare l'anta su cui è presente la maniglia
|
||||
/// Evento per aggiornare sash dimension
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<DataChangeHandle> EC_ChangeHandle { get; set; }
|
||||
public EventCallback<SashDimension> EC_UpdateSashDim { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Evento per cambiare l'anta su cui è presente la maniglia
|
||||
/// Evento per aggiornare sash
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<DataCopyContentSash> EC_CopyContentSash { get; set; }
|
||||
public EventCallback<Sash> EC_UpdateSash { 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];
|
||||
}
|
||||
else
|
||||
@@ -58,49 +81,196 @@ namespace WebWindowTest.Compo
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sollevo evento per cambiare l'anta su cui è presente la maniglia
|
||||
/// Metodo per avere il numero di decimali da usare nella form-input
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private async Task RaiseChangeHandle(SashDimension sashDim, Sash currSash)
|
||||
public int CssDecimals()
|
||||
{
|
||||
var Args = new DataChangeHandle
|
||||
switch (CurrSashDim.MeasureType)
|
||||
{
|
||||
currSashDimension = sashDim,
|
||||
currItem = currSash,
|
||||
};
|
||||
await EC_ChangeHandle.InvokeAsync(Args);
|
||||
case Json.WindowConst.MeasureTypes.ABSOLUTE:
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
case Json.WindowConst.MeasureTypes.PROPORTIONAL:
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
case Json.WindowConst.MeasureTypes.PERCENTAGE:
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sollevo evento per cambiare l'anta su cui è presente la maniglia
|
||||
/// Metodo per avere il lo step da usare nella form-input
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private async Task RaiseCopyContentSash(Sash currSash, int indexC, int indexM)
|
||||
public double CssStepNumber()
|
||||
{
|
||||
var Args = new DataCopyContentSash
|
||||
switch (CurrSashDim.MeasureType)
|
||||
{
|
||||
currItem = currSash,
|
||||
indexCopy = indexC,
|
||||
indexModify = indexM,
|
||||
case Json.WindowConst.MeasureTypes.ABSOLUTE:
|
||||
{
|
||||
return 0.5;
|
||||
}
|
||||
case Json.WindowConst.MeasureTypes.PROPORTIONAL:
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
case Json.WindowConst.MeasureTypes.PERCENTAGE:
|
||||
{
|
||||
return 0.5;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Selezione tipo di apertura anta
|
||||
/// </summary>
|
||||
protected int OpeningTypeIndex
|
||||
{
|
||||
get => CurrSashDim.SelOpeningTypeIndex;
|
||||
set
|
||||
{
|
||||
if (CurrSashDim.SelOpeningTypeIndex != value)
|
||||
{
|
||||
CurrSashDim.SelOpeningTypeIndex = value;
|
||||
_ = EC_UpdateSashDim.InvokeAsync(CurrSashDim);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Selezione tipo di misura della dimensione dell'anta
|
||||
/// </summary>
|
||||
protected int MeasureTypeIndex
|
||||
{
|
||||
get => CurrSashDim.SelMeasureTypeIndex;
|
||||
set
|
||||
{
|
||||
if (CurrSashDim.SelMeasureTypeIndex != value)
|
||||
{
|
||||
CurrSashDim.SelMeasureTypeIndex = value;
|
||||
_ = EC_UpdateSashDim.InvokeAsync(CurrSashDim);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Inserimento dimensione anta
|
||||
/// </summary>
|
||||
protected double Dimension
|
||||
{
|
||||
get => CurrSashDim.dDimension;
|
||||
set
|
||||
{
|
||||
if (CurrSashDim.dDimension != value)
|
||||
{
|
||||
CurrSashDim.dDimension = (double)Math.Round((decimal)value, CssDecimals());
|
||||
_ = EC_UpdateSashDim.InvokeAsync(CurrSashDim);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per cambiare l'anta su cui è presente la maniglia
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private async Task ChangeHandle()
|
||||
{
|
||||
// Cerco la Sash che si sta considerando nella lista Sash
|
||||
var s = SashList.Where(x => x.GroupId == CurrSashGroup.GroupId).FirstOrDefault();
|
||||
if (s != null)
|
||||
{
|
||||
// Setto la presenza o meno della maniglia per ogni anta
|
||||
foreach (SashDimension item in s.SashList)
|
||||
{
|
||||
if (item.Equals(CurrSashDim))
|
||||
{
|
||||
item.bHasHandle = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (item.bHasHandle)
|
||||
{
|
||||
switch (item.SelOpeningType)
|
||||
{
|
||||
case Openings.TILTTURN_LEFT:
|
||||
{
|
||||
item.SetOpeningType(Openings.TURNONLY_LEFT);
|
||||
break;
|
||||
}
|
||||
case Openings.TILTTURN_RIGHT:
|
||||
{
|
||||
item.SetOpeningType(Openings.TURNONLY_RIGHT);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
item.bHasHandle = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
CurrSashGroup.RefreshHardwareList();
|
||||
CurrSashGroup.SetFirstHardware();
|
||||
await EC_UpdateSash.InvokeAsync(CurrSashGroup);
|
||||
}
|
||||
|
||||
private bool isOpen = false;
|
||||
|
||||
private void ToggleDropdown()
|
||||
{
|
||||
isOpen = !isOpen;
|
||||
}
|
||||
|
||||
private enum ModeView
|
||||
{
|
||||
NULL = 0,
|
||||
View = 1,
|
||||
Edit = 2
|
||||
}
|
||||
protected override void OnParametersSet()
|
||||
{
|
||||
if (EditMode)
|
||||
mode = ModeView.Edit;
|
||||
else
|
||||
mode = ModeView.View;
|
||||
}
|
||||
private ModeView mode { get; set; } = ModeView.View;
|
||||
private void doEdit(int index)
|
||||
{
|
||||
var args = new DataChangeMode
|
||||
{
|
||||
Edit = true,
|
||||
IndexSashEdit = index,
|
||||
IndexSashClose = -1
|
||||
};
|
||||
await EC_CopyContentSash.InvokeAsync(Args);
|
||||
_ = 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 DataChangeHandle
|
||||
{
|
||||
public SashDimension currSashDimension { get; set; } = null!;
|
||||
public Sash currItem { get; set; } = null!;
|
||||
|
||||
public class DataChangeMode {
|
||||
public bool Edit { get; set; }
|
||||
public int IndexSashEdit { get; set; }
|
||||
public int IndexSashClose { get; set; }
|
||||
}
|
||||
|
||||
public class DataCopyContentSash
|
||||
{
|
||||
public Sash currItem { get; set; } = null!;
|
||||
|
||||
public int indexCopy { get; set; } = 0;
|
||||
|
||||
public int indexModify { get; set; } = 0;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
|
||||
<div class="col-sm-6 my-2">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<h6 class="fw-bold">Sash</h6>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body py-2">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<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="NumTrochetti" checked="@insertQty" @onclick="() => IsCheckedQty()">
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text">Qty element</span>
|
||||
@if (insertQty)
|
||||
{
|
||||
@* <input type="number" class="form-control" @bind="@ArcElementQty"> *@
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="number" class="form-control" disabled>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</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="Estremità" checked="@CurrSashGroup.SashArcElem.bCutEdge" @onclick="() => IsCheckCutEdge()"> *@
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<label class="form-check-label fs-6 text-dark">Taglio estremità</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<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="Sezione" checked="@(!insertQty)" @onclick="() => IsCheckedQty()">
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text">Section</span>
|
||||
@if (!insertQty)
|
||||
{
|
||||
@* <input type="number" class="form-control" @bind="@ArcSection"> *@
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="number" class="form-control" disabled>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,78 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using System.Runtime.CompilerServices;
|
||||
using WebWindowTest.DTO;
|
||||
using WebWindowTest.Models;
|
||||
|
||||
namespace WebWindowTest.Compo
|
||||
{
|
||||
public partial class AreaSashArcElem
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Sash corrente
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public Sash CurrSashGroup { get; set; } = null!;
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<Sash> EC_UpdatePreview { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
//protected int ArcElementQty
|
||||
//{
|
||||
// get => CurrSashGroup.SashArcElem.nQty;
|
||||
// set
|
||||
// {
|
||||
// CurrSashGroup.SashArcElem.nQty = value;
|
||||
// _ = EC_UpdatePreview.InvokeAsync(CurrSashGroup);
|
||||
// }
|
||||
//}
|
||||
|
||||
//protected double ArcSection
|
||||
//{
|
||||
// get => CurrSashGroup.SashArcElem.nSection;
|
||||
// set
|
||||
// {
|
||||
// CurrSashGroup.SashArcElem.nSection = value;
|
||||
// _ = EC_UpdatePreview.InvokeAsync(CurrSashGroup);
|
||||
// }
|
||||
//}
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected void IsCheckedQty()
|
||||
{
|
||||
insertQty = !insertQty;
|
||||
}
|
||||
|
||||
//protected void IsCheckCutEdge()
|
||||
//{
|
||||
// CurrSashGroup.SashArcElem.bCutEdge = !CurrSashGroup.SashArcElem.bCutEdge;
|
||||
// _ = EC_UpdatePreview.InvokeAsync(CurrSashGroup);
|
||||
//}
|
||||
|
||||
protected string IsUsedQty()
|
||||
{
|
||||
if (insertQty)
|
||||
return "form-control";
|
||||
else
|
||||
return "form-control disabled";
|
||||
}
|
||||
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private bool insertQty = false;
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,20 +1,20 @@
|
||||
<div class="card shadow-sm rounded">
|
||||
<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>
|
||||
<div class="col-4 d-flex justify-content-left">
|
||||
<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">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => RaiseAddSash(CurrSplitted)">Add Sash</button>
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => RaiseAddSash()">Add Sash</button>
|
||||
</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(Index)">Copy Sash @(SashList.Count == 1 ? "" : (Index + 1))</button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -12,80 +12,56 @@ namespace WebWindowTest.Compo
|
||||
/// Lista delle sash
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public List<Sash> CurrSashList { get; set; } = null;
|
||||
public List<Sash> SashList { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto splitted corrente
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public Splitted CurrSplitted { get; set; } = null;
|
||||
public Splitted CurrSplitted { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Lista degli Splitted
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public List<Splitted> CurrSplittedList { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// Evento per copiare Sash
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<DataAreaSplit> EC_CopySash { get; set; }
|
||||
public List<Splitted> SplittedList { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Evento per aggiungere Sash
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<DataAreaSplitted> EC_AddSash { get; set; }
|
||||
public EventCallback<Splitted> EC_UpdateSplitted { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Sollevo evento richiesta copia sash
|
||||
/// Metodo per copiare sash
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private async Task RaiseCopySash(Splitted item, int indexCurrSash)
|
||||
private async Task RaiseCopySash(int indexCurrSash)
|
||||
{
|
||||
var Args = new DataAreaSplit
|
||||
{
|
||||
splitted = item,
|
||||
index = indexCurrSash,
|
||||
};
|
||||
await EC_CopySash.InvokeAsync(Args);
|
||||
//Rimuovo contenuto di Splitted e rimuovo area da conteggio gruppi
|
||||
CurrSplitted.AreaList.RemoveAll(i => i != null);
|
||||
// Copio sash
|
||||
Area a = SashList[indexCurrSash].Copy(CurrSplitted);
|
||||
a.SetParentArea(CurrSplitted);
|
||||
// Aggiungo copia a Splitted
|
||||
CurrSplitted.AreaList.Add(a);
|
||||
await EC_UpdateSplitted.InvokeAsync(CurrSplitted);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sollevo evento richiesta copia sash
|
||||
/// Metodo per aggiungere prima sash
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private async Task RaiseAddSash(Splitted item)
|
||||
private async Task RaiseAddSash()
|
||||
{
|
||||
var Args = new DataAreaSplitted
|
||||
{
|
||||
splitted = item
|
||||
};
|
||||
await EC_AddSash.InvokeAsync(Args);
|
||||
CurrSplitted.AddFirstSash();
|
||||
await EC_UpdateSplitted.InvokeAsync(CurrSplitted);
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Classe per raggruppare oggetti che servono per copiare Sash
|
||||
/// </summary>
|
||||
public class DataAreaSplit
|
||||
{
|
||||
public Splitted splitted { get; set; }
|
||||
public int index { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Classe per raggruppare oggetti che servono per aggiungere Sash
|
||||
/// </summary>
|
||||
public class DataAreaSplitted
|
||||
{
|
||||
public Splitted splitted { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<div class="card shadow-sm rounded">
|
||||
<div class="card-header bg-light bg-opacity-25">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div class="px-2">
|
||||
<h5>Arc Element</h5>
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<button class="btn btn-close" @onclick="ReqClose"></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body py-2">
|
||||
<div class="row">
|
||||
<AreaFrameArcElem CurrFrame="CurrFrame"
|
||||
EC_UpdatePreview ="UpdatePreview">
|
||||
</AreaFrameArcElem>
|
||||
|
||||
@foreach (var sashGroup in SashList)
|
||||
{
|
||||
<hr />
|
||||
<AreaSashArcElem CurrSashGroup="sashGroup"
|
||||
EC_UpdatePreview="UpdatePreviewSash">
|
||||
</AreaSashArcElem>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,60 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using WebWindowTest.DTO;
|
||||
using WebWindowTest.Models;
|
||||
|
||||
namespace WebWindowTest.Compo
|
||||
{
|
||||
public partial class CardArcElement
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Frame corrente
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public Frame CurrFrame { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Lista sash group
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public List<Sash> SashList { get; set; } = null!;
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<DataUpdateFrame> EC_UpdatePreview { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<bool> EC_ReqClose { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
private async Task UpdatePreview()
|
||||
{
|
||||
var args = new DataUpdateFrame
|
||||
{
|
||||
currFrame = CurrFrame
|
||||
};
|
||||
await EC_UpdatePreview.InvokeAsync(args);
|
||||
}
|
||||
|
||||
private async Task UpdatePreviewSash(Sash CurrSashGRoup)
|
||||
{
|
||||
var currRec = SashList.First(x => x.GroupId == CurrSashGRoup.GroupId);
|
||||
if (currRec != null)
|
||||
{
|
||||
currRec = CurrSashGRoup;
|
||||
var args = new DataUpdateFrame
|
||||
{
|
||||
currFrame = CurrFrame
|
||||
};
|
||||
await EC_UpdatePreview.InvokeAsync(args);
|
||||
}
|
||||
}
|
||||
|
||||
private void ReqClose()
|
||||
{
|
||||
_ = EC_ReqClose.InvokeAsync(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
<div class="card shadow-sm rounded mb-4">
|
||||
<div class="card-header bg-light bg-opacity-25">
|
||||
<div class="d-flex justify-content-between align-middle">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div class="px-2">
|
||||
<h5>Fill @(CurrIndex + 1)</h5>
|
||||
</div>
|
||||
@@ -11,48 +11,20 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body py-2">
|
||||
<div class="d-flex justify-content-between align-center my-2">
|
||||
<div class="col d-flex justify-content-center">
|
||||
<div class="d-flex justify-content-between align-items-center my-2">
|
||||
<div class="col d-flex justify-content-left">
|
||||
<h6>Select only current fill</h6>
|
||||
</div>
|
||||
<div class="col d-flex">
|
||||
<div class="input-group mb-2 justify-content-center">
|
||||
<button class="@buttonFillCss(WebWindowTest.Json.WindowConst.FillTypes.GLASS)" @onclick="() => ChangeOneFill(WebWindowTest.Json.WindowConst.FillTypes.GLASS)">Glass</button>
|
||||
<button class="@buttonFillCss(WebWindowTest.Json.WindowConst.FillTypes.GLASS)">Glass</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col d-flex">
|
||||
<div class="input-group mb-2 justify-content-center">
|
||||
<button class="@buttonFillCss(WebWindowTest.Json.WindowConst.FillTypes.WOOD)" @onclick="() => ChangeOneFill(WebWindowTest.Json.WindowConst.FillTypes.WOOD)">Wood</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div class="col d-flex justify-content-center">
|
||||
<h6 class="text-center">Selected all fill</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="() => ChangeAllFill(WebWindowTest.Json.WindowConst.FillTypes.GLASS)">All glass</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="() => ChangeAllFill(WebWindowTest.Json.WindowConst.FillTypes.WOOD)">All wood</button>
|
||||
<button class="@buttonFillCss(WebWindowTest.Json.WindowConst.FillTypes.WOOD)">Wood</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@foreach (var currSplitted in SplittedList)
|
||||
{
|
||||
@if (currSplitted.AreaList.First().Equals(CurrItem))
|
||||
{
|
||||
<AreaSplit CurrSashList="SashList"
|
||||
CurrSplittedList="SplittedList"
|
||||
CurrSplitted="currSplitted"
|
||||
EC_AddSash="AddSash"
|
||||
EC_CopySash="CopySash">
|
||||
</AreaSplit>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,31 +18,7 @@ namespace WebWindowTest.Compo
|
||||
/// Fill corrente rispetto alla lista fill
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public Fill CurrItem { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Evento per cambiare tutti i fill
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<FillTypes> EC_ChangeAllType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Evento per cambiare solo il fill corrente
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<FillTypes> EC_ChangeType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Evento per copiare sash
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<DataAreaSplit> EC_CopySash { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Evento per aggiungere sash
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<DataAreaSplitted> EC_AddSash { get; set; }
|
||||
public Fill CurrFill { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Evento per tornare nella pagine Tree
|
||||
@@ -50,75 +26,12 @@ namespace WebWindowTest.Compo
|
||||
[Parameter]
|
||||
public EventCallback<bool> EC_ReqClose { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Lista dei Fill
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public List<Fill> FillList { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Lista delle sash
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public List<Sash> SashList { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Lista degli Splitted
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public List<Splitted> SplittedList { get; set; } = null!;
|
||||
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
/// <summary>
|
||||
/// Sollevo evento per cambiare tutti i Fill
|
||||
/// </summary>
|
||||
/// <param name="reqFillType"> tipo di fill richiesto </param>
|
||||
/// <returns></returns>
|
||||
protected async Task ChangeAllFill(FillTypes reqFillType)
|
||||
{
|
||||
await EC_ChangeAllType.InvokeAsync(reqFillType);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sollevo evento per cambiare solo il Fill corrente
|
||||
/// </summary>
|
||||
/// <param name="reqFillType"> tipo di fill richiesto </param>
|
||||
/// <returns></returns>
|
||||
protected async Task ChangeOneFill(FillTypes reqFillType)
|
||||
{
|
||||
await EC_ChangeType.InvokeAsync(reqFillType);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sollevo evento per copiare sash
|
||||
/// </summary>
|
||||
/// <param name="Args"></param>
|
||||
/// <returns></returns>
|
||||
protected async Task CopySash(DataAreaSplit Args)
|
||||
{
|
||||
await EC_CopySash.InvokeAsync(Args);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sollevo evento per aggiungere sash
|
||||
/// </summary>
|
||||
/// <param name="Args"></param>
|
||||
/// <returns></returns>
|
||||
protected async Task AddSash(DataAreaSplitted Args)
|
||||
{
|
||||
await EC_AddSash.InvokeAsync(Args);
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Sollevo evento per tornare alla pagina Tree
|
||||
/// Metodo per tornare alla pagina Tree
|
||||
/// </summary>
|
||||
private void ReqClose()
|
||||
{
|
||||
@@ -131,7 +44,7 @@ namespace WebWindowTest.Compo
|
||||
/// <returns></returns>
|
||||
private string buttonFillCss(FillTypes reqFillTypes)
|
||||
{
|
||||
return (FillList.ElementAt(CurrIndex).SelFillType == reqFillTypes) ? "btn btn-secondary btn-sm" : "btn btn-outline-secondary btn-sm";
|
||||
return (CurrFill.SelFillType == reqFillTypes) ? "btn btn-secondary btn-sm" : "btn btn-outline-secondary btn-sm";
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
@using WebWindowTest.Models
|
||||
@using static WebWindowTest.LayoutConst
|
||||
@using static WebWindowTest.LayoutConst
|
||||
|
||||
<div class="card shadow-sm rounded mb-4">
|
||||
<div class="card-header bg-light bg-opacity-25">
|
||||
@@ -14,81 +13,50 @@
|
||||
</div>
|
||||
<div class="card-body py-2">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="col-md-12 col-lg-6">
|
||||
<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)
|
||||
{
|
||||
<option value="@(i.Id)">@(i.Name)</option>
|
||||
}
|
||||
@* <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>
|
||||
<span class="input-group-text">Shape</span>
|
||||
<input type="text" readonly class="form-control" value="@(CurrFrameWindow.ShapeList.ElementAt(SelShapeIndex - 1))">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="col-md-12 col-lg-6">
|
||||
<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>
|
||||
<EditFrameDimensions CurrRec="dimension" EC_Update="UpdateDim"></EditFrameDimensions>
|
||||
}
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="col-md-12 col-lg-6">
|
||||
<div class="d-flex justify-content-start align-items-center">
|
||||
<h6 class="fw-bold">Threshold</h6>
|
||||
</div>
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text">Tipology</label>
|
||||
<select class="form-select">
|
||||
<option value="0">Soglia</option>
|
||||
<option value="1">Sgocciolatoio</option>
|
||||
</select>
|
||||
<span class="input-group-text">Tipology</span>
|
||||
<input type="text" readonly class="form-control" value="@(CurrFrameWindow.ThresholdList.FirstOrDefault(x => x.Type == SelThreshold).Name)">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<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(WebWindowTest.Json.WindowConst.Joints.ANGLED, FrameWindow)">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(WebWindowTest.Json.WindowConst.Joints.FULL_H, FrameWindow)">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(WebWindowTest.Json.WindowConst.Joints.FULL_V, FrameWindow)">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>
|
||||
<EditJoint CurrRec="joint"></EditJoint>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="col-md-12 col-lg-6">
|
||||
@if (SashList.Count == 0)
|
||||
{
|
||||
<div class="d-flex justify-content-start align-items-center">
|
||||
@@ -97,7 +65,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" readonly class="form-control" value="@FrameBottomRailQty">
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@@ -105,13 +73,3 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (!(FrameWindow.AreaList[0] is Split) || (SashList.Count == 0 && SplitList.Count == 0))
|
||||
{
|
||||
<AreaFrame CurrFrameWindow="FrameWindow"
|
||||
CurrSashList="SashList"
|
||||
CurrSplitList="SplitList"
|
||||
EC_AddSash="AddSash"
|
||||
EC_AddSplit="AddSplit">
|
||||
</AreaFrame>
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Egw.Window.Data;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using WebWindowTest.Models;
|
||||
|
||||
@@ -7,24 +8,6 @@ namespace WebWindowTest.Compo
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Evento per aggiungere sash
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<bool> EC_AddSash { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Evento per aggiungere split
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<bool> EC_AddSplit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Evento per cambiare tutti i Joints
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<DataChangeJoints> EC_ChangeAllJoints { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Evento per tornare nella pagine Tree
|
||||
/// </summary>
|
||||
@@ -35,58 +18,98 @@ namespace WebWindowTest.Compo
|
||||
/// Evento per richiedere reset dizionario Shape
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<bool> EC_ReqResetDictShape { get; set; }
|
||||
public EventCallback<DataUpdateRes> EC_ReqResetDict { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Evento per aggiornare info frame (es cambaire tutti i Joints)
|
||||
/// Evento per richiedere opzioni hardware
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<Frame> EC_UpdateFrame { get; set; }
|
||||
|
||||
public EventCallback<Frame> EC_ReqOptionHw { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Evento per richiesta calcolo Shape
|
||||
/// Evento per richiesta calcolo preview
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<Frame> EC_UpdateShape { get; set; }
|
||||
public EventCallback<DataUpdateFrame> EC_UpdateFrame { get; set; }
|
||||
|
||||
/// <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
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per selezionare shape
|
||||
/// </summary>
|
||||
protected int SelShapeIndex
|
||||
{
|
||||
get => FrameWindow.SelShapeIndex;
|
||||
get => CurrFrameWindow.SelShapeIndex;
|
||||
set
|
||||
{
|
||||
if (FrameWindow.SelShapeIndex != value)
|
||||
if (CurrFrameWindow.SelShapeIndex != value)
|
||||
{
|
||||
CurrFrameWindow.SelShapeIndex = value;
|
||||
// richiesta reset dict shape
|
||||
_ = EC_ReqResetDictShape.InvokeAsync(true);
|
||||
FrameWindow.SelShapeIndex = value;
|
||||
_ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetDictShape});
|
||||
foreach(var s in SashList)
|
||||
{
|
||||
s.SelHardwareFromId = "000000";
|
||||
}
|
||||
_ = EC_UpdateFrame.InvokeAsync(FrameWindow);
|
||||
_ = EC_UpdateShape.InvokeAsync(FrameWindow);
|
||||
var args = new DataUpdateFrame()
|
||||
{
|
||||
currFrame = CurrFrameWindow,
|
||||
svgNoHw = true
|
||||
};
|
||||
_ = EC_UpdateFrame.InvokeAsync(args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per selezionare threshold
|
||||
/// </summary>
|
||||
protected int SelThreshold
|
||||
{
|
||||
get => CurrFrameWindow.SelThresholdFromType;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Selezione quantità bottom rail
|
||||
/// </summary>
|
||||
protected int FrameBottomRailQty
|
||||
{
|
||||
get => CurrFrameWindow.BottomRailQty;
|
||||
set
|
||||
{
|
||||
if (CurrFrameWindow.BottomRailQty != value)
|
||||
{
|
||||
CurrFrameWindow.BottomRailQty = value;
|
||||
if (CurrFrameWindow.BottomRailQty > 0)
|
||||
CurrFrameWindow.SetBottomRail(true);
|
||||
else
|
||||
CurrFrameWindow.SetBottomRail(false);
|
||||
var args = new DataUpdateFrame()
|
||||
{
|
||||
currFrame = CurrFrameWindow,
|
||||
svgNoHw = false
|
||||
};
|
||||
_ = EC_UpdateFrame.InvokeAsync(args);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -96,36 +119,24 @@ namespace WebWindowTest.Compo
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Sollevo evento richiesta aggiunta sash
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private async Task AddSash()
|
||||
{
|
||||
//await EC_UpdateShape.InvokeAsync(FrameWindow);
|
||||
await EC_AddSash.InvokeAsync(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sollevo evento richiesta aggiunta window
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private async Task AddSplit()
|
||||
{
|
||||
await EC_AddSplit.InvokeAsync(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sollevo evento richiesta copia sash
|
||||
/// Metodo per cambiare tutti i joint
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private async Task ChangeAllJoints(Json.WindowConst.Joints JointType, Area a)
|
||||
{
|
||||
var Args = new DataChangeJoints
|
||||
if (a is Frame)
|
||||
{
|
||||
currJointType = JointType,
|
||||
currArea = a,
|
||||
foreach (Joint joint in CurrFrameWindow.JointList)
|
||||
{
|
||||
joint.SetSelJointType(JointType);
|
||||
}
|
||||
}
|
||||
var args = new DataUpdateFrame()
|
||||
{
|
||||
currFrame = CurrFrameWindow,
|
||||
svgNoHw = false
|
||||
};
|
||||
await EC_ChangeAllJoints.InvokeAsync(Args);
|
||||
await EC_UpdateFrame.InvokeAsync(args);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -143,45 +154,70 @@ namespace WebWindowTest.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);
|
||||
var args = new DataUpdateFrame()
|
||||
{
|
||||
currFrame = CurrFrameWindow,
|
||||
svgNoHw = true
|
||||
};
|
||||
await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetDictShape });
|
||||
await EC_UpdateFrame.InvokeAsync(args);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Report aggiornamento joint
|
||||
/// Aggiornamento joint
|
||||
/// </summary>
|
||||
/// <param name="updRec"></param>
|
||||
/// <returns></returns>
|
||||
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);
|
||||
var args = new DataUpdateFrame()
|
||||
{
|
||||
currFrame = CurrFrameWindow,
|
||||
svgNoHw = false
|
||||
};
|
||||
await EC_UpdateFrame.InvokeAsync(args);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per la visualizzazione dei pulsanti joint
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
/// <returns></returns>
|
||||
private string ButtonJointCss(WebWindowTest.Json.WindowConst.Joints type)
|
||||
{
|
||||
foreach (var item in CurrFrameWindow.JointList)
|
||||
{
|
||||
if (!item.SelJointType.Equals(type))
|
||||
return "btn btn-outline-secondary btn-sm";
|
||||
}
|
||||
return "btn btn-secondary btn-sm";
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Classe per raggruppare oggetti che servono per copiare Sash
|
||||
/// Classe per raggruppare oggetti che servono per aggiornare frame
|
||||
/// </summary>
|
||||
public class DataChangeJoints
|
||||
public class DataUpdateFrame
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public Area currArea { get; set; } = null!;
|
||||
public Json.WindowConst.Joints currJointType { get; set; }
|
||||
public Frame currFrame { get; set; } = null!;
|
||||
public bool svgNoHw { get; set; } = false;
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
@@ -5,12 +5,7 @@
|
||||
<div class="card-header bg-light bg-opacity-25">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div class="px-2">
|
||||
<h5>Sash group @(SashList.Count > 1 ? (CurrIndex + 1) : "")</h5>
|
||||
</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>
|
||||
</div>
|
||||
<h5>Sash group @(SashList.Count > 1 ? (SashList.IndexOf(CurrSashGroup) + 1) : "")</h5>
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<button class="btn btn-close" @onclick="ReqClose"></button>
|
||||
@@ -19,131 +14,103 @@
|
||||
</div>
|
||||
<div class="card-body py-2">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<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" readonly class="form-control" value="@SashQty">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<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)
|
||||
{
|
||||
<option value="@(orientationSash.Id)">@(orientationSash.Name)</option>
|
||||
}
|
||||
@* <option value="0">Vertical</option>
|
||||
<option value="1">Horizontal</option> *@
|
||||
</select>
|
||||
<span class="input-group-text">Tipology</span>
|
||||
<input type="text" readonly class="form-control" value="@(CurrSashGroup.OrientationSashTypeList.FirstOrDefault(x => x.Id == OrientationSashTypeIndex).Name)">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<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" readonly class="form-control" value="@SashBottomRailQty">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<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">Hardware</h6>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text">Family</label>
|
||||
<select class="form-select" @bind="@CurrItem.SelFamilyHardware">
|
||||
@if (Sash.s_FamilyHardwareList == null || Sash.s_FamilyHardwareList.Count == 0)
|
||||
{
|
||||
<option value="000000">CUSTOM</option>
|
||||
}
|
||||
else
|
||||
{
|
||||
@foreach (var familyHw in Sash.s_FamilyHardwareList)
|
||||
{
|
||||
<option value="@familyHw">@familyHw</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
<span class="input-group-text">Family</span>
|
||||
<input type="text" readonly class="form-control" value="@FamilyHardware">
|
||||
</div>
|
||||
@if (string.IsNullOrEmpty(CurrItem.SashShape))
|
||||
{
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text">Type</label>
|
||||
<select class="form-select">
|
||||
<option value="000000">Custom HW</option>
|
||||
</select>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="input-group mb-2">
|
||||
<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)
|
||||
{
|
||||
<option value="@hlItem.Id">@hlItem.Description</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
<AreaHwOption CurrSash="CurrItem"
|
||||
EC_UpdateHwOptCombo="UpdateOptCombo"
|
||||
EC_UpdateHwOptText="UpdateOptText"
|
||||
EC_FirstHwOptionList="FirstHwOptionList">
|
||||
</AreaHwOption>
|
||||
}
|
||||
</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="btn btn-outline-secondary btn-sm" @onclick="() => ChangeAllJoints(WebWindowTest.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(WebWindowTest.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(WebWindowTest.Json.WindowConst.Joints.FULL_V, CurrItem)">Vertical</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text">Type</span>
|
||||
<input type="text" readonly class="form-control" value="@SelHwType">
|
||||
</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="row">
|
||||
@for (int i = 0; i < CurrItem.SashList.Count; i++)
|
||||
{
|
||||
<AreaSash CurrSashDim="CurrItem.SashList[i]"
|
||||
CurrSashGroup="CurrItem"
|
||||
IndexSash="i"
|
||||
EC_ChangeHandle="ChangeHandle"
|
||||
EC_CopyContentSash="CopyContentSash">
|
||||
</AreaSash>
|
||||
}
|
||||
<div class="col-md-12 col-lg-6">
|
||||
<AreaHwOption EC_FirstHwOptionList="FirstHwOptionList"></AreaHwOption>
|
||||
</div>
|
||||
</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-outline-secondary dropdown-toggle btn-sm" type="button" @onclick="ToggleDropdown">
|
||||
Measure
|
||||
</button>
|
||||
<ul class="dropdown-menu @(isOpen ? "show" : "")" style="min-width:5rem; max-width:10rem">
|
||||
<li>
|
||||
<button class="dropdown-item" @onclick="() => SetMeasureType(MeasureTypes.ABSOLUTE)">
|
||||
Absolute
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button class="dropdown-item" @onclick="() => SetMeasureType(MeasureTypes.PROPORTIONAL)">
|
||||
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_UpdateSash="UpdateSash"
|
||||
EC_UpdateSashDim="UpdateSashDimension"
|
||||
EC_EditView="EditView">
|
||||
</AreaSash>
|
||||
</div>
|
||||
}
|
||||
else if(currSashDimEdit.Count == 0)
|
||||
{
|
||||
<AreaSash CurrSashDim="CurrSashGroup.SashList[i]"
|
||||
IndexSash="i"
|
||||
EditMode="editMode"
|
||||
EC_UpdateSash="UpdateSash"
|
||||
EC_UpdateSashDim="UpdateSashDimension"
|
||||
EC_EditView="EditView">
|
||||
</AreaSash>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,6 +1,7 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using WebWindowTest.Models;
|
||||
using static WebWindowTest.Json.WindowConst;
|
||||
using static WebWindowTest.LayoutConst;
|
||||
|
||||
namespace WebWindowTest.Compo
|
||||
{
|
||||
@@ -8,41 +9,17 @@ namespace WebWindowTest.Compo
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Indice della sash corrente rispetto alla lista sash
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public int CurrIndex { get; set; } = 0;
|
||||
|
||||
/// <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; }
|
||||
|
||||
/// <summary>
|
||||
/// Evento per cambiare l'anta su cui è presente la maniglia
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<DataChangeHandle> EC_ChangeHandle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Evento per cambiare l'anta su cui è presente la maniglia
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<DataCopyContentSash> EC_CopyContentSash { get; set; }
|
||||
[CascadingParameter(Name = "CurrSashGroup")]
|
||||
public Sash CurrSashGroup { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Evento per cambiare tutti i fill
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<Area> EC_RemoveArea { get; set; }
|
||||
public EventCallback<DataUpdateFrame> EC_UpdateFrame { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Evento per tornare nella pagine Tree
|
||||
@@ -54,102 +31,163 @@ namespace WebWindowTest.Compo
|
||||
/// Evento per richiedere reset dizionario Shape
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<bool> EC_ReqResetDictShape { get; set; }
|
||||
public EventCallback<DataUpdateRes> EC_ReqResetDict { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Evento per cambiare tutti i Joints
|
||||
/// Evento per richiedere per la prima volta opzioni hardware
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<Sash> EC_UpdateSash { get; set; }
|
||||
public EventCallback<Sash> EC_ReqFirstOptionHw { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Evento per segnalare cambio hw e richiesta calcolo
|
||||
/// Evento per segnalare aggiornamento
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<Sash> EC_UpdateSashHardware { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Evento per richiedere la prima volta le opzioni hardware
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<int> EC_CallFirstHwOpt { get; set; }
|
||||
public EventCallback<DataUpdateSash> EC_UpdateSashGroup { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Lista di sash
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
[CascadingParameter(Name = "SashList")]
|
||||
public List<Sash> SashList { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Frame corrente
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public Frame FrameWindow { get; set; } = null!;
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
/// <summary>
|
||||
/// Selezione hardware
|
||||
/// Selezione quantità di ante
|
||||
/// </summary>
|
||||
protected string SelHwType
|
||||
protected int SashQty
|
||||
{
|
||||
get => CurrItem.SelHardwareFromId;
|
||||
get => CurrSashGroup.nSashQty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Selezione quantità bottom rail
|
||||
/// </summary>
|
||||
protected int SashBottomRailQty
|
||||
{
|
||||
get => CurrSashGroup.SashBottomRailQty;
|
||||
set
|
||||
{
|
||||
if (CurrItem.SelHardwareFromId != value)
|
||||
if (CurrSashGroup.SashBottomRailQty != value)
|
||||
{
|
||||
CurrItem.SelHardwareFromId = value;
|
||||
_ = EC_UpdateSashHardware.InvokeAsync(CurrItem);
|
||||
CurrSashGroup.SashBottomRailQty = value;
|
||||
if (CurrSashGroup.SashBottomRailQty > 0)
|
||||
CurrSashGroup.SetSashBottomRail(true);
|
||||
else
|
||||
CurrSashGroup.SetSashBottomRail(false);
|
||||
var args = new DataUpdateSash()
|
||||
{
|
||||
currSash = CurrSashGroup
|
||||
};
|
||||
_ = EC_UpdateSashGroup.InvokeAsync(args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Selezione tipo di orientamento della sash
|
||||
/// </summary>
|
||||
protected int OrientationSashTypeIndex
|
||||
{
|
||||
get => CurrSashGroup.SelOrientationSashTypeIndex;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Selezione famiglia hardware
|
||||
/// </summary>
|
||||
protected string FamilyHardware
|
||||
{
|
||||
get => CurrSashGroup.SelFamilyHardware;
|
||||
}
|
||||
|
||||
protected string SelHwType
|
||||
{
|
||||
get => CurrSashGroup.GetHardwareDescription;
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
/// <summary>
|
||||
/// Sollevo evento per rimuovere area
|
||||
/// Metodo per scegliere tipo di misura
|
||||
/// </summary>
|
||||
/// <param name="currArea"> area da rimuovere </param>
|
||||
/// <param name="type"></param>
|
||||
/// <returns></returns>
|
||||
protected async Task RemoveArea(Area currArea)
|
||||
protected async Task SetMeasureType(MeasureTypes type)
|
||||
{
|
||||
// richiesta reset dict shape
|
||||
await EC_ReqResetDictShape.InvokeAsync(true);
|
||||
await EC_RemoveArea.InvokeAsync(currArea);
|
||||
isOpen = !isOpen;
|
||||
for(int i = 0; i < CurrSashGroup.SashList.Count; i++)
|
||||
{
|
||||
CurrSashGroup.SashList.ElementAt(i).SetSelMeasureType(type, i);
|
||||
}
|
||||
var args = new DataUpdateSash
|
||||
{
|
||||
currSash = CurrSashGroup,
|
||||
noSvg = true
|
||||
};
|
||||
await EC_UpdateSashGroup.InvokeAsync(args);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per aggiornare la sash dimension
|
||||
/// </summary>
|
||||
/// <param name="updateSD"></param>
|
||||
/// <returns></returns>
|
||||
protected async Task UpdateSashDimension(SashDimension updateSD)
|
||||
{
|
||||
var currRec = CurrSashGroup.SashList.First(x => x.nSashId == updateSD.nSashId);
|
||||
if(currRec != null)
|
||||
{
|
||||
currRec = updateSD;
|
||||
var args = new DataUpdateSash
|
||||
{
|
||||
currSash = CurrSashGroup
|
||||
};
|
||||
await EC_UpdateSashGroup.InvokeAsync(args);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per aggiornare sash
|
||||
/// </summary>
|
||||
/// <param name="updateS"></param>
|
||||
/// <returns></returns>
|
||||
protected async Task UpdateSash(Sash updateS)
|
||||
{
|
||||
if (updateS != null)
|
||||
{
|
||||
CurrSashGroup = updateS;
|
||||
var args = new DataUpdateSash
|
||||
{
|
||||
currSash = CurrSashGroup
|
||||
};
|
||||
await EC_UpdateSashGroup.InvokeAsync(args);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Sollevo evento richiesta per cambiare tutti i Joint
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private async Task ChangeAllJoints(Json.WindowConst.Joints JointType, Area a)
|
||||
private bool editMode = false;
|
||||
private List<int> currSashDimEdit = new List<int>();
|
||||
private void EditView(DataChangeMode args)
|
||||
{
|
||||
var Args = new DataChangeJoints
|
||||
{
|
||||
currJointType = JointType,
|
||||
currArea = a,
|
||||
};
|
||||
await EC_ChangeAllJoints.InvokeAsync(Args);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sollevo evento per cambiare l'anta su cui è presente la maniglia
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private async Task ChangeHandle(DataChangeHandle Args)
|
||||
{
|
||||
await EC_ChangeHandle.InvokeAsync(Args);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sollevo evento per cambiare l'anta su cui è presente la maniglia
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private async Task CopyContentSash(DataCopyContentSash Args)
|
||||
{
|
||||
await EC_CopyContentSash.InvokeAsync(Args);
|
||||
editMode = args.Edit;
|
||||
if(args.IndexSashEdit != -1)
|
||||
currSashDimEdit.Add(args.IndexSashEdit);
|
||||
if (args.IndexSashClose != -1)
|
||||
currSashDimEdit.Remove(args.IndexSashClose);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -160,67 +198,48 @@ namespace WebWindowTest.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>
|
||||
/// <param name="updRec"></param>
|
||||
/// <returns></returns>
|
||||
private async Task UpdateOptCombo(AGBOptionCombo updRec)
|
||||
{
|
||||
// cerco il record
|
||||
var currRec = CurrItem.HwOptionList.FirstOrDefault(x => x.sName == updRec.sName && x.sDescription == updRec.sDescription);
|
||||
// lo aggiorno
|
||||
if (updRec != null)
|
||||
{
|
||||
currRec = updRec;
|
||||
await EC_UpdateSashHardware.InvokeAsync(CurrItem);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Report aggiornamento Option Text
|
||||
/// </summary>
|
||||
/// <param name="updRec"></param>
|
||||
/// <returns></returns>
|
||||
private async Task UpdateOptText(AGBOptionText updRec)
|
||||
{
|
||||
// cerco il record
|
||||
var currRec = CurrItem.HwOptionList.FirstOrDefault(x => x.sName == updRec.sName && x.sDescription == updRec.sDescription);
|
||||
// lo aggiorno
|
||||
if (updRec != null)
|
||||
{
|
||||
currRec = updRec;
|
||||
await EC_UpdateSashHardware.InvokeAsync(CurrItem);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Prima chiamata hw option list
|
||||
/// </summary>
|
||||
/// <param name="updRec"></param>
|
||||
/// <returns></returns>
|
||||
private async Task FirstHwOptionList(int groupId)
|
||||
private async Task FirstHwOptionList()
|
||||
{
|
||||
await EC_CallFirstHwOpt.InvokeAsync(groupId);
|
||||
var args = new DataUpdateSash
|
||||
{
|
||||
currSash = CurrSashGroup
|
||||
};
|
||||
//await EC_UpdatePreview.InvokeAsync(args);
|
||||
await EC_ReqFirstOptionHw.InvokeAsync(CurrSashGroup);
|
||||
}
|
||||
|
||||
private string ButtonMeasureCss(MeasureTypes type)
|
||||
{
|
||||
foreach(var item in CurrSashGroup.SashList)
|
||||
{
|
||||
if (!item.SelMeasureType.Equals(type))
|
||||
return "btn btn-outline-secondary btn-sm";
|
||||
}
|
||||
return "btn btn-secondary btn-sm";
|
||||
}
|
||||
|
||||
private bool isOpen = false;
|
||||
private void ToggleDropdown()
|
||||
{
|
||||
isOpen = !isOpen;
|
||||
}
|
||||
#endregion Private Methods
|
||||
}
|
||||
|
||||
public class DataUpdateSash
|
||||
{
|
||||
public Sash currSash { get; set; } = null!;
|
||||
public bool svgNoHw { get; set; } = false;
|
||||
public bool noSvg { get; set; } = false;
|
||||
}
|
||||
|
||||
public class DataUpdateRes
|
||||
{
|
||||
public DataAction req { get; set; } = DataAction.None;
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,10 @@
|
||||
|
||||
@using static WebWindowTest.Json.WindowConst
|
||||
|
||||
<div class="card shadow-sm rounded mb-4">
|
||||
<div class="card-header bg-light bg-opacity-25">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div class="px-2">
|
||||
<h5>@(descParentSplit(CurrItem))</h5>
|
||||
<h5>@(descParentSplit())</h5>
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<button class="btn btn-close" @onclick="ReqClose"></button>
|
||||
@@ -11,119 +12,113 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body py-2">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<h5>Split</h5>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
@if ((CurrItem.nSplitQtyVert == 1 && CurrItem.nSplitQtyHoriz == 0) || (CurrItem.nSplitQtyVert == 0 && CurrItem.nSplitQtyHoriz == 1))
|
||||
{
|
||||
<div class="input-group mb-2 justify-content-center">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => SwapTwoAree(CurrItem)">Swap Aree</button>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="input-group mb-2 justify-content-center">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => RemoveArea(CurrItem)">Remove split</button>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<h5>Split</h5>
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-outline-secondary dropdown-toggle btn-sm" type="button" @onclick="ToggleDropdown">
|
||||
Measure
|
||||
</button>
|
||||
<ul class="dropdown-menu @(isOpen ? "show" : "")" style="min-width:5rem; max-width:10rem">
|
||||
<li>
|
||||
<button class="dropdown-item" @onclick="() => SetMeasureType(MeasureTypes.ABSOLUTE)">
|
||||
Absolute
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button class="dropdown-item" @onclick="() => SetMeasureType(MeasureTypes.PROPORTIONAL)">
|
||||
Proportional
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button class="dropdown-item" @onclick="() => SetMeasureType(MeasureTypes.PERCENTAGE)">
|
||||
Percentage
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="col-md-12 col-lg-6">
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text">Shape</label>
|
||||
<select class="form-select" @bind="@CurrItem.SelSplitShapeIndex">
|
||||
@foreach (var shapeType in CurrItem.SplitShapeList)
|
||||
{
|
||||
<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>
|
||||
<span class="input-group-text">Shape</span>
|
||||
<input type="text" readonly class="form-control" value="@(CurrSplit.SplitShapeList.FirstOrDefault(x => x.Id == SplitShapeIndex))">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
@if (CurrItem.nSplitQtyVert > 0)
|
||||
@if (CurrSplit.nSplitQtyVert > 0)
|
||||
{
|
||||
<div class="col-sm-6">
|
||||
<div class="col-md-12 col-lg-6">
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text">QtyVert</span>
|
||||
<input type="number" class="form-control" @bind="@CurrItem.nSplitQtyVert">
|
||||
<input type="number" readonly class="form-control" value="@SplitQtyVert">
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@if (CurrItem.nSplitQtyHoriz > 0)
|
||||
@if (CurrSplit.nSplitQtyHoriz > 0)
|
||||
{
|
||||
<div class="col-sm-6">
|
||||
<div class="col-md-12 col-lg-6">
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text">QtyHoriz</span>
|
||||
<input type="number" class="form-control" @bind="@CurrItem.nSplitQtyHoriz">
|
||||
<input type="number" readonly class="form-control" value="@SplitQtyHoriz">
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="row">
|
||||
@if (CurrItem.SplitVertList.Count > 0 && CurrItem.SplitHorizList.Count > 0)
|
||||
@if (CurrSplit.SplitVertList.Count > 0 && CurrSplit.SplitHorizList.Count > 0)
|
||||
{
|
||||
<div class="col-sm-6">
|
||||
@foreach (var dim in CurrItem.SplitVertList)
|
||||
<div class="col-md-12 col-lg-6">
|
||||
@for (int i = 0; i < CurrSplit.SplitVertList.Count; i++)
|
||||
{
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text">Width</span>
|
||||
<input type="number" class="form-control" @bind="@dim.dDimension">
|
||||
<span class="input-group-text">%</span>
|
||||
</div>
|
||||
<EditSplitDimensions CurrRec="CurrSplit.SplitVertList[i]"
|
||||
Name="Width"
|
||||
Index="i"
|
||||
EC_Update="UpdateDimension">
|
||||
</EditSplitDimensions>
|
||||
}
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
@foreach (var dim in CurrItem.SplitHorizList)
|
||||
<div class="col-md-12 col-lg-6">
|
||||
@for (int i = 0; i < CurrSplit.SplitHorizList.Count; i++)
|
||||
{
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text">Height</span>
|
||||
<input type="number" class="form-control" @bind="@dim.dDimension">
|
||||
<span class="input-group-text">%</span>
|
||||
</div>
|
||||
<EditSplitDimensions CurrRec="CurrSplit.SplitHorizList[i]"
|
||||
Name="Height"
|
||||
Index="i"
|
||||
EC_Update="UpdateDimension">
|
||||
</EditSplitDimensions>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else if (CurrItem.SplitHorizList.Count > 0)
|
||||
else if (CurrSplit.SplitHorizList.Count > 0)
|
||||
{
|
||||
@foreach (var dim in CurrItem.SplitHorizList)
|
||||
@for (int i = 0; i < CurrSplit.SplitHorizList.Count; i++)
|
||||
{
|
||||
<div class="col-sm-6">
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text">Height</span>
|
||||
<input type="number" class="form-control" @bind="@dim.dDimension">
|
||||
<span class="input-group-text">%</span>
|
||||
</div>
|
||||
</div>
|
||||
<EditSplitDimensions CurrRec="CurrSplit.SplitHorizList[i]"
|
||||
Name="Height"
|
||||
Index="i"
|
||||
EC_Update="UpdateDimension">
|
||||
</EditSplitDimensions>
|
||||
}
|
||||
}
|
||||
else if (CurrItem.SplitVertList.Count > 0)
|
||||
else if (CurrSplit.SplitVertList.Count > 0)
|
||||
{
|
||||
@foreach (var dim in CurrItem.SplitVertList)
|
||||
@for (int i = 0; i < CurrSplit.SplitVertList.Count; i++)
|
||||
{
|
||||
<div class="col-sm-6">
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text">Width</span>
|
||||
<input type="number" class="form-control" @bind="@dim.dDimension">
|
||||
<span class="input-group-text">%</span>
|
||||
</div>
|
||||
</div>
|
||||
<EditSplitDimensions CurrRec="CurrSplit.SplitVertList[i]"
|
||||
Name="Width"
|
||||
Index="i"
|
||||
EC_Update="UpdateDimension">
|
||||
</EditSplitDimensions>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
@if (CurrItem.SelSplitShape == Json.WindowConst.SplitShapes.GRID)
|
||||
@if (CurrSplit.SelSplitShape == Json.WindowConst.SplitShapes.GRID)
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="col-md-12 col-lg-6">
|
||||
<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="SplitStartVert" checked="@CurrItem.bSplitStartVert" @oninput="(ChangeEventArgs e) => ChangeStartVert(e, CurrItem)">
|
||||
<input class="form-check-input ml-auto" disabled="disabled" type="checkbox" name="SplitStartVert" checked="@CurrSplit.bSplitStartVert">
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<label class="form-check-label fs-6 text-dark">StartVert</label>
|
||||
|
||||
@@ -1,21 +1,19 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using WebWindowTest.Models;
|
||||
using static WebWindowTest.Json.WindowConst;
|
||||
using static WebWindowTest.LayoutConst;
|
||||
|
||||
namespace WebWindowTest.Compo
|
||||
{
|
||||
public partial class CardSplit
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Indice del fill corrente rispetto alla lista fill
|
||||
/// Split corrente rispetto alla lista split
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public int CurrIndex { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Fill corrente rispetto alla lista fill
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public Split CurrItem { get; set; } = null!;
|
||||
public Split CurrSplit { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Lista di sash
|
||||
@@ -30,28 +28,28 @@ namespace WebWindowTest.Compo
|
||||
public List<Split> SplitList { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Evento per scambiare le aree di uno split
|
||||
/// Frame
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<Area> EC_SwapTwoAree { get; set; }
|
||||
public Frame FrameWindow { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Evento per rimuovere split
|
||||
/// Evento per richiedere reset dizionario
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<Area> EC_RemoveArea { get; set; }
|
||||
public EventCallback<DataUpdateRes> EC_ReqResetDict { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Evento per cambiare nel caso di split a griglia se inizia con lo split verticale
|
||||
/// Evento per aggiornare Split
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<DataChangeStartVert> EC_ChangeStartVert { get; set; }
|
||||
public EventCallback<DataUpdateSplit> EC_UpdateSplit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Evento per richiedere reset dizionario Shape
|
||||
/// Evento per aggiornare Frame
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<bool> EC_ReqResetDictShape { get; set; }
|
||||
public EventCallback<DataUpdateFrame> EC_UpdateFrame { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Evento per tornare nella pagine Tree
|
||||
@@ -60,64 +58,78 @@ namespace WebWindowTest.Compo
|
||||
public EventCallback<bool> EC_ReqClose { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Sollevo evento per scambiare le aree di uno split
|
||||
/// Proprietà per selezionare shape split
|
||||
/// </summary>
|
||||
/// <param name="item"> split corrente </param>
|
||||
/// <returns></returns>
|
||||
protected async Task SwapTwoAree(Split item)
|
||||
protected int SplitShapeIndex
|
||||
{
|
||||
// richiesta reset dict shape
|
||||
_ = EC_ReqResetDictShape.InvokeAsync(true);
|
||||
await EC_SwapTwoAree.InvokeAsync(item);
|
||||
get => CurrSplit.SelSplitShapeIndex;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sollevo evento per rimuovere split
|
||||
/// Proprietà per selezionare numero di split verticali
|
||||
/// </summary>
|
||||
/// <param name="item"> split corrente </param>
|
||||
/// <returns></returns>
|
||||
protected async Task RemoveArea(Split item)
|
||||
protected int SplitQtyVert
|
||||
{
|
||||
// richiesta reset dict shape
|
||||
await EC_ReqResetDictShape.InvokeAsync(true);
|
||||
await EC_RemoveArea.InvokeAsync(item);
|
||||
get => CurrSplit.nSplitQtyVert;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sollevo evento per rimuovere split
|
||||
/// Proprietà per selezionare numero di split verticali
|
||||
/// </summary>
|
||||
/// <param name="item"> split corrente </param>
|
||||
/// <returns></returns>
|
||||
protected async Task ChangeStartVert(ChangeEventArgs e, Split item)
|
||||
protected int SplitQtyHoriz
|
||||
{
|
||||
var Args = new DataChangeStartVert
|
||||
get => CurrSplit.nSplitQtyHoriz;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per aggiornare la dimensione dello split
|
||||
/// </summary>
|
||||
/// <param name="updRec"></param>
|
||||
/// <returns></returns>
|
||||
protected async Task UpdateDimension(DataUpdateSplitDimension updRec)
|
||||
{
|
||||
SplitDimension currSplitDim = updRec.currSplit;
|
||||
SplitDimension currRec = null;
|
||||
// cerco il record
|
||||
if (currSplitDim.bIsVertListDim)
|
||||
currRec = CurrSplit.SplitVertList.ElementAt(updRec.index);
|
||||
else
|
||||
currRec = CurrSplit.SplitHorizList.ElementAt(updRec.index);
|
||||
// lo aggiorno
|
||||
if (currSplitDim != null)
|
||||
{
|
||||
eventArg = e,
|
||||
currItem = item,
|
||||
};
|
||||
await EC_ChangeStartVert.InvokeAsync(Args);
|
||||
currRec = currSplitDim;
|
||||
var args = new DataUpdateSplit()
|
||||
{
|
||||
currSplit = CurrSplit,
|
||||
noSvg = updRec.noSvg
|
||||
};
|
||||
await EC_UpdateSplit.InvokeAsync(args);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per determinare la descrizione del parent dello split corrente
|
||||
/// </summary>
|
||||
/// <param name="currSplit"> split corrente </param>
|
||||
/// <returns></returns>
|
||||
protected string descParentSplit(Split currSplit)
|
||||
protected string descParentSplit()
|
||||
{
|
||||
if ((currSplit.ParentArea is Splitted || currSplit.ParentArea is Sash) && SashList.Count > 0)
|
||||
if ((CurrSplit.ParentArea is Splitted || CurrSplit.ParentArea is Sash) && SashList.Count > 0)
|
||||
{
|
||||
for (int j = 0; j < SashList.Count; j++)
|
||||
{
|
||||
if (SashList[j].Equals(currSplit.ParentArea))
|
||||
if (SashList[j].Equals(CurrSplit.ParentArea))
|
||||
{
|
||||
return "Sash " + (j + 1);
|
||||
}
|
||||
else if (SashList[j].Equals(currSplit.ParentArea.ParentArea))
|
||||
else if (SashList[j].Equals(CurrSplit.ParentArea.ParentArea))
|
||||
{
|
||||
for (int k = 0; k < SashList[j].AreaList.Count; k++)
|
||||
{
|
||||
if (SashList[j].AreaList[k].AreaList[0].Equals(currSplit))
|
||||
if (SashList[j].AreaList[k].AreaList[0].Equals(CurrSplit))
|
||||
{
|
||||
return "Sash group " + (j + 1) + " - sash " + (k + 1);
|
||||
}
|
||||
@@ -139,11 +151,45 @@ namespace WebWindowTest.Compo
|
||||
{
|
||||
_ = EC_ReqClose.InvokeAsync(true);
|
||||
}
|
||||
|
||||
private bool isOpen = false;
|
||||
private void ToggleDropdown()
|
||||
{
|
||||
isOpen = !isOpen;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per cambiare il tipo di misura di tutti gli SplitDimension
|
||||
/// </summary>
|
||||
/// <param name="type"> nuovo tipo </param>
|
||||
/// <returns></returns>
|
||||
protected async Task SetMeasureType(MeasureTypes type)
|
||||
{
|
||||
isOpen = !isOpen;
|
||||
foreach (var item in CurrSplit.SplitVertList)
|
||||
{
|
||||
item.SetSelMeasureType(type);
|
||||
}
|
||||
foreach (var item in CurrSplit.SplitHorizList)
|
||||
{
|
||||
item.SetSelMeasureType(type);
|
||||
}
|
||||
var args = new DataUpdateSplit()
|
||||
{
|
||||
currSplit = CurrSplit,
|
||||
noSvg = true
|
||||
};
|
||||
await EC_UpdateSplit.InvokeAsync(args);
|
||||
}
|
||||
}
|
||||
|
||||
public class DataChangeStartVert
|
||||
/// <summary>
|
||||
/// Classe per raggruppare oggetti che servono per aggiornare split
|
||||
/// </summary>
|
||||
public class DataUpdateSplit
|
||||
{
|
||||
public ChangeEventArgs eventArg { get; set; } = null!;
|
||||
public Split currItem { get; set; }
|
||||
public Split currSplit { get; set; } = null!;
|
||||
public bool svgNoHw { get; set; } = false;
|
||||
public bool noSvg { get; set; } = false;
|
||||
}
|
||||
}
|
||||
@@ -37,6 +37,11 @@
|
||||
}
|
||||
<td>
|
||||
<button class="btn btn-sm btn-secondary" style="font-size: 1rem;" @onclick="() => RaiseNextStep(cs, ind)" title="@(s)">@ItemTableList[i].Desc</button>
|
||||
@* @if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.SASH ||
|
||||
ItemTableList[i].Type is Json.WindowConst.AreaTypes.SPLIT)
|
||||
{
|
||||
<button class="btn btn-sm btn-secondary" style="font-size: 1rem;" @onclick="() => Remove(cs, ind)" title="Remove">Canc</button>
|
||||
} *@
|
||||
</td>
|
||||
}
|
||||
else
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace WebWindowTest.Compo
|
||||
public EventCallback<DataNextStep> EC_NextStep { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Sollevo evento richiesta prossimo step
|
||||
/// Metodo per richiesta prossimo step
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private async Task RaiseNextStep(CompileStep cs, int indexStep)
|
||||
@@ -42,6 +42,16 @@ namespace WebWindowTest.Compo
|
||||
await EC_NextStep.InvokeAsync(Args);
|
||||
}
|
||||
|
||||
//private async Task Remove(CompileStep cs, int indexStep)
|
||||
//{
|
||||
// var Args = new DataNextStep
|
||||
// {
|
||||
// currCompileStep = cs,
|
||||
// index = indexStep,
|
||||
// };
|
||||
// await EC_NextStep.InvokeAsync(Args);
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per riempire tabella con contenuto vuoto o con i simboli per rappresentare la struttura
|
||||
/// </summary>
|
||||
|
||||
+11
-4
@@ -3,10 +3,13 @@ using WebWindowTest.Models;
|
||||
|
||||
namespace WebWindowTest.Compo
|
||||
{
|
||||
public partial class EditDimensions
|
||||
public partial class EditFrameDimensions
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Frame dimension corrente
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public FrameDimension CurrRec { get; set; } = null!;
|
||||
|
||||
@@ -17,14 +20,18 @@ namespace WebWindowTest.Compo
|
||||
|
||||
#region Private Properties
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per aggiornare valore dimension
|
||||
/// </summary>
|
||||
private double CurrVal
|
||||
{
|
||||
get => CurrRec.dValue;
|
||||
get => CurrRec.dDimension;
|
||||
set
|
||||
{
|
||||
if (CurrRec.dValue != value)
|
||||
if (CurrRec.dDimension != value)
|
||||
{
|
||||
CurrRec.dValue = value;
|
||||
CurrRec.dDimension = value;
|
||||
CurrRec.dDimension = value;
|
||||
_ = EC_Update.InvokeAsync(CurrRec);
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,5 @@
|
||||
@using static WebWindowTest.LayoutConst
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text">@((PositionJoints)(CurrRec.nIndex - 1))</label>
|
||||
<select class="form-select" @bind="@CurrVal">
|
||||
@foreach (var typeJoint in CurrRec.JointTypeList)
|
||||
{
|
||||
<option value="@(typeJoint.Id)">@(typeJoint.Name)</option>
|
||||
}
|
||||
@* <option value="0">Angled</option>
|
||||
<option value="1">Full H</option>
|
||||
<option value="2">Full V</option> *@
|
||||
</select>
|
||||
<span class="input-group-text">@((PositionJoints)(CurrRec.nIndex - 1))</span>
|
||||
<input type="text" readonly class="form-control" value="@(CurrRec.JointTypeList.FirstOrDefault(x => x.Id == (int)CurrRec.SelJointType))">
|
||||
</div>
|
||||
@@ -7,29 +7,13 @@ namespace WebWindowTest.Compo
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Joint corrente
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public Joint CurrRec { get; set; } = null!;
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<Joint> EC_Update { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private int CurrVal
|
||||
{
|
||||
get => CurrRec.SelJointTypeIndex;
|
||||
set
|
||||
{
|
||||
if (CurrRec.SelJointTypeIndex != value)
|
||||
{
|
||||
CurrRec.SelJointTypeIndex = value;
|
||||
_ = EC_Update.InvokeAsync(CurrRec);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Private Properties
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,11 @@
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text">@(CurrOpt.sName)</label>
|
||||
<select class="form-select" @bind="CurrValue">
|
||||
@foreach (var currValueCombo in CurrOpt.ValueList)
|
||||
{
|
||||
<option value="@currValueCombo.sValue">@currValueCombo.sDescription</option>
|
||||
}
|
||||
</select>
|
||||
<span class="input-group-text">@(CurrOpt.sName)</span>
|
||||
@if(CurrValue is String)
|
||||
{
|
||||
<input type="text" readonly class="form-control" value="@CurrOpt.ValueList.FirstOrDefault(x => x.sValue.Equals(CurrValue)).sDescription">
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="number" readonly class="form-control" value="@CurrOpt.ValueList.FirstOrDefault(x => x.sValue == CurrValue).sDescription">
|
||||
}
|
||||
</div>
|
||||
@@ -7,27 +7,22 @@ namespace WebWindowTest.Compo
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Opzione hardware combo corrente
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public AGBOptionCombo CurrOpt { get; set; } = null!;
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<AGBOptionCombo> EC_Update { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Private Properties
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per aggiornare opzione hardware corrente
|
||||
/// </summary>
|
||||
private string CurrValue
|
||||
{
|
||||
get => CurrOpt.sValue.sValue;
|
||||
set
|
||||
{
|
||||
if (CurrOpt.sValue.sValue != value)
|
||||
{
|
||||
CurrOpt.sValue = CurrOpt.ValueList.FirstOrDefault(x => x.sValue == value);
|
||||
_ = EC_Update.InvokeAsync(CurrOpt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
@@ -1,9 +1,29 @@
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text">@(CurrOpt.sName)</label>
|
||||
<select class="form-select" @bind="CurrValue">
|
||||
@foreach (var currValueCombo in CurrOpt.ValueList)
|
||||
<span class="input-group-text">@(CurrOpt.sName)</span>
|
||||
@if (CurrOpt.sName.Equals("HMan"))
|
||||
{
|
||||
<input type="number" readonly class="form-control" value="@CurrValue">
|
||||
}
|
||||
else if (CurrOpt.ValueList.Count > 0)
|
||||
{
|
||||
if(CurrValue is String)
|
||||
{
|
||||
<option value="@currValueCombo">@currValueCombo</option>
|
||||
<input type="text" readonly class="form-control" value="@CurrValue">
|
||||
}
|
||||
</select>
|
||||
else
|
||||
{
|
||||
<input type="number" readonly class="form-control" value="@CurrValue">
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (CurrValue is String)
|
||||
{
|
||||
<input type="text" readonly class="form-control" value="@CurrValue">
|
||||
}
|
||||
else
|
||||
{
|
||||
<input type="number" readonly class="form-control" value="@CurrValue">
|
||||
}
|
||||
}
|
||||
</div>
|
||||
@@ -7,27 +7,22 @@ namespace WebWindowTest.Compo
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Opzione hardware text corrente
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public AGBOptionText CurrOpt { get; set; } = null!;
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<AGBOptionText> EC_Update { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Private Properties
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per aggiornare opzione hardware text corrente
|
||||
/// </summary>
|
||||
private string CurrValue
|
||||
{
|
||||
get => CurrOpt.sValue;
|
||||
set
|
||||
{
|
||||
if (CurrOpt.sValue != value)
|
||||
{
|
||||
CurrOpt.sValue = CurrOpt.ValueList.FirstOrDefault(x => x == value);
|
||||
_ = EC_Update.InvokeAsync(CurrOpt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
@using EgwCoreLib.Razor
|
||||
|
||||
<div class="@SplitDimCss()">
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text">@Name</span>
|
||||
<input type="number" class="form-control" @bind="@CurrVal">
|
||||
<select class="form-select" style="max-width:6rem; background-color:#e9ecef" @bind="@CurrType">
|
||||
@foreach (var mType in CurrRec.MeasureTypeList)
|
||||
{
|
||||
<option value=@(mType.Id)>
|
||||
@switch (mType.Name)
|
||||
{
|
||||
case "Absolute":
|
||||
{
|
||||
<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>
|
||||
@@ -0,0 +1,127 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using WebWindowTest.Models;
|
||||
|
||||
namespace WebWindowTest.Compo
|
||||
{
|
||||
public partial class EditSplitDimensions
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
/// <summary>
|
||||
/// Split dimension corrente
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public SplitDimension CurrRec { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Nome dello split dimension corrente
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public string Name { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Indice dello split dimension
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public int Index { get; set; } = -1;
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<DataUpdateSplitDimension> EC_Update { get; set; }
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Private Properties
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per aggiornare la dimensione
|
||||
/// </summary>
|
||||
private double CurrVal
|
||||
{
|
||||
get => CurrRec.dDimension;
|
||||
set
|
||||
{
|
||||
if (CurrRec.dDimension != value)
|
||||
{
|
||||
CurrRec.dDimension = (double)Math.Round((decimal)value, CssDecimals());
|
||||
var args = new DataUpdateSplitDimension()
|
||||
{
|
||||
currSplit = CurrRec,
|
||||
index = Index
|
||||
};
|
||||
_ = EC_Update.InvokeAsync(args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per aggiornare il tipo della dimensione
|
||||
/// </summary>
|
||||
private int CurrType
|
||||
{
|
||||
get => CurrRec.SelMeasureTypeIndex;
|
||||
set
|
||||
{
|
||||
if (CurrRec.SelMeasureTypeIndex != value)
|
||||
{
|
||||
CurrRec.SelMeasureTypeIndex = value;
|
||||
var args = new DataUpdateSplitDimension()
|
||||
{
|
||||
currSplit = CurrRec,
|
||||
index=Index,
|
||||
noSvg = true
|
||||
};
|
||||
_ = EC_Update.InvokeAsync(args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private string SplitDimCss()
|
||||
{
|
||||
if(CurrRec.Parent is Split)
|
||||
{
|
||||
Split s = (Split)CurrRec.Parent;
|
||||
if (s.SelSplitShape.Equals(Json.WindowConst.SplitShapes.GRID))
|
||||
return "";
|
||||
else
|
||||
return "col-md-12 col-lg-6";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per avere il numero di decimali da usare nella form-input
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public int CssDecimals()
|
||||
{
|
||||
switch (CurrRec.MeasureType)
|
||||
{
|
||||
case Json.WindowConst.MeasureTypes.ABSOLUTE:
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
case Json.WindowConst.MeasureTypes.PROPORTIONAL:
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
case Json.WindowConst.MeasureTypes.PERCENTAGE:
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endregion Private Properties
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Classe per aggiornare split dimension
|
||||
/// </summary>
|
||||
public class DataUpdateSplitDimension
|
||||
{
|
||||
public SplitDimension currSplit { get; set; } = null!;
|
||||
public int index { get; set; } = -1;
|
||||
public bool noSvg { get; set; } = false;
|
||||
}
|
||||
}
|
||||
@@ -12,42 +12,27 @@
|
||||
</div>
|
||||
<div class="card-body py-2">
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-sm-12 d-flex flex-column gap-2">
|
||||
<div class="col-md-12 col-lg-6 d-flex flex-column gap-2 flex-wrap">
|
||||
<div class="input-group mb-2 justify-content-center">
|
||||
<label class="input-group-text">Material</label>
|
||||
<select class="form-select @(cssValid("Material"))" @bind="CurrMaterial">
|
||||
@foreach (var item in ListPayload.Material)
|
||||
{
|
||||
<option value="@item">@item</option>
|
||||
}
|
||||
</select>
|
||||
<span class="input-group-text">Material</span>
|
||||
<input type="text" readonly class="form-control" value="@(CurrMaterial)">
|
||||
</div>
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text">Profile</label>
|
||||
<select class="form-select @(cssValid("Profile"))" @bind="@CurrProfile">
|
||||
@foreach (string profile in ListPayload.Profile)
|
||||
{
|
||||
<option value="@profile">@profile</option>
|
||||
}
|
||||
</select>
|
||||
<span class="input-group-text">Profile</span>
|
||||
<input type="text" readonly class="form-control" value="@(CurrProfile)">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-sm-12 d-flex flex-column gap-2">
|
||||
<div class="col-md-12 col-lg-6 d-flex flex-column gap-2 mr-2 flex-wrap">
|
||||
<div class="row">
|
||||
<h5>Fill type</h5>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text">Glass</label>
|
||||
<select class="form-select @(cssValid("Glass"))" @bind="@CurrGlass">
|
||||
@foreach (string glass in ListPayload.Glass)
|
||||
{
|
||||
<option value="@glass">@glass</option>
|
||||
}
|
||||
</select>
|
||||
<span class="input-group-text">Glass</span>
|
||||
<input type="text" readonly class="form-control" value="@(CurrGlass)">
|
||||
</div>
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text">Pannello</label>
|
||||
@@ -59,19 +44,14 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 col-sm-12 d-flex flex-column gap-2">
|
||||
<div class="col-md-12 col-lg-6 d-flex flex-column gap-2 flex-wrap">
|
||||
<div class="row">
|
||||
<h5 class="card-title">Color</h5>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class ="row">
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text">Window</label>
|
||||
<select class="form-select @(cssValid("ColorMaterial"))" @bind="@CurrColor">
|
||||
@foreach (string colorMaterial in ListPayload.ColorMaterial)
|
||||
{
|
||||
<option value="@colorMaterial">@colorMaterial</option>
|
||||
}
|
||||
</select>
|
||||
<span class="input-group-text">Window</span>
|
||||
<input type="text" readonly class="form-control" value="@(CurrColor)">
|
||||
</div>
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text">Trunking</label>
|
||||
|
||||
@@ -14,18 +14,6 @@ namespace WebWindowTest.Compo
|
||||
[Parameter]
|
||||
public Window CurrWindow { get; set; } = null!;
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<string> EC_SelColor { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<string> EC_SelGlass { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<string> EC_SelWindMat { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<string> EC_SelProfile { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<bool> EC_ReqClose { get; set; }
|
||||
|
||||
@@ -45,44 +33,36 @@ namespace WebWindowTest.Compo
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
/// <summary>
|
||||
/// Colore corrente
|
||||
/// </summary>
|
||||
protected string CurrColor
|
||||
{
|
||||
get => currColor;
|
||||
set
|
||||
{
|
||||
currColor = value;
|
||||
_ = EC_SelColor.InvokeAsync(value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Vetro corrente
|
||||
/// </summary>
|
||||
protected string CurrGlass
|
||||
{
|
||||
get => currGlass;
|
||||
set
|
||||
{
|
||||
currGlass = value;
|
||||
_ = EC_SelGlass.InvokeAsync(value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Materiale corrente
|
||||
/// </summary>
|
||||
protected string CurrMaterial
|
||||
{
|
||||
get => currMaterial;
|
||||
set
|
||||
{
|
||||
currMaterial = value;
|
||||
_ = EC_SelWindMat.InvokeAsync(value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Profilo corrente
|
||||
/// </summary>
|
||||
protected string CurrProfile
|
||||
{
|
||||
get => currProfile;
|
||||
set
|
||||
{
|
||||
currProfile = value;
|
||||
_ = EC_SelProfile.InvokeAsync(value);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
@@ -1,11 +1,4 @@
|
||||
using Egw.Window.Data;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WebWindowTest.DTO
|
||||
{
|
||||
@@ -13,12 +6,7 @@ namespace WebWindowTest.DTO
|
||||
/// Payload complessivo delle anagrafiche necessarie x Window
|
||||
/// </summary>
|
||||
public class BaseListPayload
|
||||
{
|
||||
/// <summary>
|
||||
/// Elenco template in formato DTO
|
||||
/// </summary>
|
||||
public List<TemplateSelectDTO>? TemplateDTO { get; set; } = null;
|
||||
|
||||
{
|
||||
/// <summary>
|
||||
/// Elenco Famiglie HW in formato DTO
|
||||
/// </summary>
|
||||
@@ -49,6 +37,11 @@ namespace WebWindowTest.DTO
|
||||
/// </summary>
|
||||
public List<string> Profile { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Elenco profili ammessi
|
||||
/// </summary>
|
||||
public Dictionary<string,List<Threshold>> Threshold { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Verifica di validità dell'intero Payload
|
||||
/// </summary>
|
||||
@@ -61,7 +54,8 @@ namespace WebWindowTest.DTO
|
||||
bool matOK = Material != null && Material.Count > 0;
|
||||
bool colorOK = ColorMaterial != null && ColorMaterial.Count > 0;
|
||||
bool profileOK = Profile != null && Profile.Count > 0;
|
||||
return famHwOK && glassOK && hwOK && colorOK && matOK && profileOK;
|
||||
bool thresholdOK = Threshold != null && Threshold.Count > 0;
|
||||
return famHwOK && glassOK && hwOK && colorOK && matOK && profileOK && thresholdOK;
|
||||
}
|
||||
/// <summary>
|
||||
/// Verifica che Payload sia almeno parzialmente popolato
|
||||
@@ -75,7 +69,8 @@ namespace WebWindowTest.DTO
|
||||
bool matOK = Material != null && Material.Count > 0;
|
||||
bool colorOK = ColorMaterial != null && ColorMaterial.Count > 0;
|
||||
bool profileOK = Profile != null && Profile.Count > 0;
|
||||
return famHwOK || glassOK || hwOK || colorOK || matOK || profileOK;
|
||||
bool thresholdOK = Threshold != null && Threshold.Count > 0;
|
||||
return famHwOK || glassOK || hwOK || colorOK || matOK || profileOK || thresholdOK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,11 +39,6 @@ namespace WebWindowTest.DTO
|
||||
/// </summary>
|
||||
public string Profile { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Template selezionato
|
||||
/// </summary>
|
||||
public Template Template { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Verifica di validità dell'intero Payload
|
||||
/// </summary>
|
||||
@@ -55,8 +50,7 @@ namespace WebWindowTest.DTO
|
||||
bool glassOk = !string.IsNullOrEmpty(Glass);
|
||||
bool matOK = !string.IsNullOrEmpty(Material);
|
||||
bool profileOK = !string.IsNullOrEmpty(Profile);
|
||||
bool templateOK = Template != null;
|
||||
return famHwOK && colorOK && matOK && glassOk && templateOK && profileOK;
|
||||
return famHwOK && colorOK && matOK && glassOk && profileOK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WebWindowTest.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; } = "";
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,9 @@ namespace WebWindowTest
|
||||
{
|
||||
public class ItemTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Tipo di area
|
||||
/// </summary>
|
||||
private AreaTypes m_type;
|
||||
public AreaTypes Type
|
||||
{
|
||||
@@ -22,6 +25,9 @@ namespace WebWindowTest
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Descrizione
|
||||
/// </summary>
|
||||
private string m_desc;
|
||||
public string Desc
|
||||
{
|
||||
@@ -35,6 +41,9 @@ namespace WebWindowTest
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Numero di riga nell'albero gerarchico
|
||||
/// </summary>
|
||||
private int m_row;
|
||||
public int Row
|
||||
{
|
||||
@@ -48,6 +57,9 @@ namespace WebWindowTest
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Numero di colonna nell'albero gerarchico
|
||||
/// </summary>
|
||||
private int m_col;
|
||||
public int Col
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Microsoft.VisualBasic;
|
||||
using Egw.Window.Data;
|
||||
using Microsoft.VisualBasic;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
@@ -201,6 +202,20 @@ namespace WebWindowTest.Json
|
||||
}
|
||||
}
|
||||
|
||||
private string m_Threshold;
|
||||
[JsonProperty]
|
||||
public string Threshold
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Threshold;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Threshold = value;
|
||||
}
|
||||
}
|
||||
|
||||
private bool m_bBottomRail;
|
||||
[JsonProperty]
|
||||
public bool BottomRail
|
||||
@@ -229,13 +244,28 @@ namespace WebWindowTest.Json
|
||||
}
|
||||
}
|
||||
|
||||
//private JsonFrameArcElement m_FrameArcElem;
|
||||
//[JsonProperty]
|
||||
//public JsonFrameArcElement ArcElement
|
||||
//{
|
||||
// get
|
||||
// {
|
||||
// return m_FrameArcElem;
|
||||
// }
|
||||
// set
|
||||
// {
|
||||
// m_FrameArcElem = value;
|
||||
// }
|
||||
//}
|
||||
|
||||
public JsonFrame() : base(AreaTypes.FRAME)
|
||||
{
|
||||
}
|
||||
|
||||
public JsonFrame(Shapes Shape, bool BottomRail, int BottomRailQty, int GroupId) : base(AreaTypes.FRAME)
|
||||
public JsonFrame(Shapes Shape, string sThreshold, bool BottomRail, int BottomRailQty, int GroupId) : base(AreaTypes.FRAME)
|
||||
{
|
||||
m_Shape = Shape;
|
||||
m_Threshold= sThreshold;
|
||||
m_bBottomRail = BottomRail;
|
||||
m_nBottomRailQty = BottomRailQty;
|
||||
base.GroupId = GroupId;
|
||||
@@ -247,11 +277,15 @@ namespace WebWindowTest.Json
|
||||
newFrame.SetGroupId(GroupId);
|
||||
newFrame.SetAreaType(AreaTypes.FRAME);
|
||||
newFrame.SetSelShape(m_Shape);
|
||||
newFrame.RefreshThresholdList();
|
||||
newFrame.SetSelThresholdFromName(m_Threshold);
|
||||
newFrame.SetBottomRail(m_bBottomRail);
|
||||
newFrame.SetBottomRailQty(m_nBottomRailQty);
|
||||
//if(ArcElement != null)
|
||||
// newFrame.SetFrameArcElem(ArcElement.Deserialize(newFrame, ParentWindow));
|
||||
//Frame.AppliedDone();
|
||||
for (var DimensionIndex = 0; DimensionIndex <= m_DimensionList.Count - 1; DimensionIndex++)
|
||||
newFrame.DimensionList[DimensionIndex].dValue = m_DimensionList[DimensionIndex].Value;
|
||||
newFrame.DimensionList[DimensionIndex].SetDimension(m_DimensionList[DimensionIndex].Value);
|
||||
for (var JointIndex = 0; JointIndex <= m_JointList.Count - 1; JointIndex++)
|
||||
newFrame.JointList[JointIndex].SetSelJointType(m_JointList[JointIndex].JointType);
|
||||
foreach (var Area in AreaList)
|
||||
@@ -311,20 +345,6 @@ namespace WebWindowTest.Json
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
@@ -353,6 +373,20 @@ namespace WebWindowTest.Json
|
||||
}
|
||||
}
|
||||
|
||||
//private JsonSashArcElement m_SashArcElem;
|
||||
//[JsonProperty]
|
||||
//public JsonSashArcElement ArcElement
|
||||
//{
|
||||
// get
|
||||
// {
|
||||
// return m_SashArcElem;
|
||||
// }
|
||||
// set
|
||||
// {
|
||||
// m_SashArcElem = value;
|
||||
// }
|
||||
//}
|
||||
|
||||
private string m_Hardware;
|
||||
[JsonProperty]
|
||||
public string Hardware
|
||||
@@ -409,16 +443,17 @@ namespace WebWindowTest.Json
|
||||
newSash.SashList[SashIndex].SetOpeningType(m_SashList[SashIndex].OpeningType);
|
||||
newSash.SashList[SashIndex].SetHasHandle(m_SashList[SashIndex].HasHandle);
|
||||
newSash.SashList[SashIndex].SetDimension(m_SashList[SashIndex].Dimension);
|
||||
newSash.SashList[SashIndex].SetMeasureType(m_SashList[SashIndex].MeasureType);
|
||||
foreach (var Joint in m_SashList[SashIndex].JointList)
|
||||
newSash.SashList[SashIndex].JointList.Add(Joint.Deserialize((Area)ParentArea));
|
||||
}
|
||||
foreach (var Joint in m_JointList)
|
||||
newSash.JointList.Add(Joint.Deserialize((Area)ParentArea));
|
||||
newSash.SetSelFamilyHardwareFromIndex(Hardware);
|
||||
newSash.ReqRefreshShape();
|
||||
//newSash.ReqRefreshShape();
|
||||
newSash.SetSelHardwareFromId(Hardware);
|
||||
foreach (var HwOption in m_HwOptionList)
|
||||
newSash.SelHwOptionList.Add(HwOption.Name, HwOption.Value);
|
||||
//foreach (var HwOption in m_HwOptionList)
|
||||
// newSash.HwOptionList.Add(HwOption.Deserialize());
|
||||
//if (ArcElement != null)
|
||||
// newSash.SetSashArcElem(ArcElement.Deserialize(newSash, ParentWindow));
|
||||
foreach (var Area in AreaList)
|
||||
{
|
||||
var AreaDeserealized = Area.Deserialize(newSash, ParentWindow);
|
||||
@@ -511,24 +546,24 @@ namespace WebWindowTest.Json
|
||||
Split.SetSplitQtyVert(0);
|
||||
else
|
||||
{
|
||||
//Split.SplitVertList.Clear();
|
||||
Split.SetSplitQtyVert(m_SplitVertList.Count - 1);
|
||||
for (var SplitIndex = 0; SplitIndex <= m_SplitVertList.Count - 1; SplitIndex++)
|
||||
{
|
||||
Split.SplitVertList[SplitIndex].SetIsRelative(m_SplitVertList[SplitIndex].IsRelative);
|
||||
Split.SplitVertList[SplitIndex].SetDimension(m_SplitVertList[SplitIndex].Dimension);
|
||||
Split.SplitVertList[SplitIndex].SetMeasureType(m_SplitVertList[SplitIndex].MeasureType);
|
||||
}
|
||||
}
|
||||
if (m_SplitHorizList.Count == 0)
|
||||
Split.SetSplitQtyHoriz(0);
|
||||
else
|
||||
{
|
||||
//Split.SplitHorizList.Clear();
|
||||
Split.SetSplitQtyHoriz(m_SplitHorizList.Count - 1);
|
||||
for (var SplitIndex = 0; SplitIndex <= m_SplitHorizList.Count - 1; SplitIndex++)
|
||||
{
|
||||
Split.SplitHorizList[SplitIndex].SetIsRelative(m_SplitHorizList[SplitIndex].IsRelative);
|
||||
Split.SplitHorizList[SplitIndex].SetDimension(m_SplitHorizList[SplitIndex].Dimension);
|
||||
Split.SplitHorizList[SplitIndex].SetMeasureType(m_SplitHorizList[SplitIndex].MeasureType);
|
||||
}
|
||||
}
|
||||
foreach (var Area in AreaList)
|
||||
@@ -618,6 +653,107 @@ namespace WebWindowTest.Json
|
||||
}
|
||||
}
|
||||
|
||||
//public class JsonFrameArcElement
|
||||
//{
|
||||
// private double m_Section;
|
||||
// [JsonProperty]
|
||||
// public double Section
|
||||
// {
|
||||
// get
|
||||
// {
|
||||
// return m_Section;
|
||||
// }
|
||||
// set
|
||||
// {
|
||||
// m_Section = value;
|
||||
// }
|
||||
// }
|
||||
|
||||
// private bool m_bCutEdge;
|
||||
// [JsonProperty]
|
||||
// public bool CutEdge
|
||||
// {
|
||||
// get
|
||||
// {
|
||||
// return m_bCutEdge;
|
||||
// }
|
||||
// set
|
||||
// {
|
||||
// m_bCutEdge = value;
|
||||
// }
|
||||
// }
|
||||
|
||||
// private bool m_bIsAlign;
|
||||
// [JsonProperty]
|
||||
// public bool IsAlign
|
||||
// {
|
||||
// get
|
||||
// {
|
||||
// return m_bIsAlign;
|
||||
// }
|
||||
// set
|
||||
// {
|
||||
// m_bIsAlign = value;
|
||||
// }
|
||||
// }
|
||||
|
||||
// public JsonFrameArcElement(double Section, bool CutEdge, bool IsAlign)
|
||||
// {
|
||||
// m_Section = Section;
|
||||
// m_bCutEdge = CutEdge;
|
||||
// m_bIsAlign = IsAlign;
|
||||
// }
|
||||
|
||||
// internal FrameArcElement Deserialize(Area ParentArea, Window ParentWindow)
|
||||
// {
|
||||
// FrameArcElement arcElement = new FrameArcElement(ParentArea, ParentWindow, m_Section, m_bCutEdge, m_bIsAlign);
|
||||
// return arcElement;
|
||||
// }
|
||||
//}
|
||||
|
||||
//public class JsonSashArcElement
|
||||
//{
|
||||
// private double m_Section;
|
||||
// [JsonProperty]
|
||||
// public double Section
|
||||
// {
|
||||
// get
|
||||
// {
|
||||
// return m_Section;
|
||||
// }
|
||||
// set
|
||||
// {
|
||||
// m_Section = value;
|
||||
// }
|
||||
// }
|
||||
|
||||
// private bool m_bCutEdge;
|
||||
// [JsonProperty]
|
||||
// public bool CutEdge
|
||||
// {
|
||||
// get
|
||||
// {
|
||||
// return m_bCutEdge;
|
||||
// }
|
||||
// set
|
||||
// {
|
||||
// m_bCutEdge = value;
|
||||
// }
|
||||
// }
|
||||
|
||||
// public JsonSashArcElement(double Section, bool CutEdge)
|
||||
// {
|
||||
// m_Section = Section;
|
||||
// m_bCutEdge = CutEdge;
|
||||
// }
|
||||
|
||||
// internal SashArcElement Deserialize(Area ParentArea, Window ParentWindow)
|
||||
// {
|
||||
// SashArcElement arcElement = new SashArcElement(ParentArea, ParentWindow, m_Section, m_bCutEdge);
|
||||
// return arcElement;
|
||||
// }
|
||||
//}
|
||||
|
||||
public class JsonJoint
|
||||
{
|
||||
private int m_nIndex;
|
||||
@@ -769,17 +905,14 @@ namespace WebWindowTest.Json
|
||||
}
|
||||
}
|
||||
|
||||
private bool m_bHasHandle;
|
||||
private MeasureTypes m_MeasureType;
|
||||
[JsonProperty]
|
||||
public bool HasHandle
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public MeasureTypes MeasureType
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_bHasHandle;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_bHasHandle = value;
|
||||
return m_MeasureType;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -797,9 +930,38 @@ namespace WebWindowTest.Json
|
||||
}
|
||||
}
|
||||
|
||||
public JsonSashDimension(Openings OpeningType, bool HasHandle, double Dimension, int SashId)
|
||||
private bool m_bHasHandle;
|
||||
[JsonProperty]
|
||||
public bool HasHandle
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_bHasHandle;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_bHasHandle = value;
|
||||
}
|
||||
}
|
||||
|
||||
private List<JsonJoint> m_JointList = new List<JsonJoint>();
|
||||
[JsonProperty]
|
||||
public List<JsonJoint> JointList
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_JointList;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_JointList = value;
|
||||
}
|
||||
}
|
||||
|
||||
public JsonSashDimension(Openings OpeningType, MeasureTypes MeasureType, bool HasHandle, double Dimension, int SashId)
|
||||
{
|
||||
m_OpeningType = OpeningType;
|
||||
m_MeasureType = MeasureType;
|
||||
m_bHasHandle = HasHandle;
|
||||
m_dDimension = Dimension;
|
||||
m_nSashId = SashId;
|
||||
@@ -832,10 +994,22 @@ namespace WebWindowTest.Json
|
||||
}
|
||||
}
|
||||
|
||||
public JsonSplitDimension(bool IsRelative, double Dimension)
|
||||
private MeasureTypes m_MeasureType;
|
||||
[JsonProperty]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public MeasureTypes MeasureType
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_MeasureType;
|
||||
}
|
||||
}
|
||||
|
||||
public JsonSplitDimension(bool IsRelative, double Dimension, MeasureTypes MeasureType)
|
||||
{
|
||||
m_bIsRelative = IsRelative;
|
||||
m_dDimension = Dimension;
|
||||
m_MeasureType = MeasureType;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -118,6 +118,14 @@ namespace WebWindowTest.Json
|
||||
COMBO = 3
|
||||
}
|
||||
|
||||
public enum MeasureTypes: int
|
||||
{
|
||||
NULL = 0,
|
||||
ABSOLUTE = 1,
|
||||
PROPORTIONAL = 2,
|
||||
PERCENTAGE = 3
|
||||
}
|
||||
|
||||
// Specifies the display state of an element.
|
||||
public enum Visibility
|
||||
{
|
||||
|
||||
@@ -10,13 +10,13 @@ namespace WebWindowTest
|
||||
{
|
||||
public enum CompileStep
|
||||
{
|
||||
Template = 0,
|
||||
Tree = 1,
|
||||
Frame,
|
||||
Tree = 0,
|
||||
Frame = 1,
|
||||
Split,
|
||||
Sash,
|
||||
Fill,
|
||||
General
|
||||
General,
|
||||
ArcElement
|
||||
}
|
||||
|
||||
public enum PositionJoints
|
||||
@@ -26,5 +26,22 @@ namespace WebWindowTest
|
||||
TR, // Top Right
|
||||
TL // Top Left
|
||||
}
|
||||
|
||||
public enum DataAction
|
||||
{
|
||||
/// <summary>
|
||||
/// Nessuna richiesta
|
||||
/// </summary>
|
||||
None = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Reset dizionario shape
|
||||
/// </summary>
|
||||
ResetDictShape,
|
||||
/// <summary>
|
||||
/// Reset dizionario HwOptions
|
||||
/// </summary>
|
||||
ResetHwOpt
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user