Aggiunta Threshold in Frame

This commit is contained in:
Annamaria Sassi
2025-12-22 14:44:30 +01:00
parent 5ad4baa471
commit 10b63ff6b6
18 changed files with 156 additions and 40 deletions
+8 -2
View File
@@ -42,10 +42,16 @@
</div>
<div class="input-group mb-2">
<label class="input-group-text">Tipology</label>
<select class="form-select">
<select class="form-select" @bind="SelThreshold">
@foreach (var item in Frame.m_ThresholdList)
{
<option value="@(item.Type)">@(item.Name)</option>
}
</select>
@* <select class="form-select">
<option value="0">Soglia</option>
<option value="1">Sgocciolatoio</option>
</select>
</select> *@
</div>
</div>
</div>
+22 -2
View File
@@ -1,3 +1,4 @@
using Egw.Window.Data;
using Microsoft.AspNetCore.Components;
using WebWindowComplex.Models;
@@ -76,8 +77,27 @@ namespace WebWindowComplex.Compo
svgNoHw = true
};
_ = EC_UpdatePreview.InvokeAsync(args);
//_ = EC_ReqOptionHw.InvokeAsync(CurrFrameWindow);
//_ = EC_UpdateShape.InvokeAsync(CurrFrameWindow);
}
}
}
/// <summary>
/// Metodo per selezionare threshold
/// </summary>
protected int SelThreshold
{
get => CurrFrameWindow.SelThresholdFromType;
set
{
if (CurrFrameWindow.SelThresholdFromType != value)
{
CurrFrameWindow.SelThresholdFromType = value;
var args = new DataUpdateFrame()
{
currFrame = CurrFrameWindow,
svgNoHw = false
};
_ = EC_UpdatePreview.InvokeAsync(args);
}
}
}
+9 -2
View File
@@ -44,6 +44,11 @@ namespace WebWindowComplex.DTO
/// </summary>
public List<string> Profile { get; set; } = null!;
/// <summary>
/// Elenco profili ammessi
/// </summary>
public List<Threshold> Threshold { get; set; } = null!;
/// <summary>
/// Verifica di validità dell'intero Payload
/// </summary>
@@ -56,7 +61,8 @@ namespace WebWindowComplex.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
@@ -70,7 +76,8 @@ namespace WebWindowComplex.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;
}
}
}
+19 -2
View File
@@ -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 WebWindowComplex.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
@@ -247,9 +262,10 @@ namespace WebWindowComplex.Json
{
}
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;
@@ -261,6 +277,7 @@ namespace WebWindowComplex.Json
newFrame.SetGroupId(GroupId);
newFrame.SetAreaType(AreaTypes.FRAME);
newFrame.SetSelShape(m_Shape);
newFrame.SetSelThresholdFromName(m_Threshold);
newFrame.SetBottomRail(m_bBottomRail);
newFrame.SetBottomRailQty(m_nBottomRailQty);
//if(ArcElement != null)
+42 -2
View File
@@ -1,4 +1,5 @@
using System;
using Egw.Window.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -10,6 +11,13 @@ namespace WebWindowComplex.Models
{
public class Frame : Area
{
#region Public Fields
// Lista hardware completa passata dal chiamante del componente
public static List<Threshold> m_ThresholdList = new List<Threshold>();
#endregion Public Fields
#region Public Constructors
public Frame(Area ParentArea, Window ParentWindow) : base(ParentArea, ParentWindow)
@@ -44,6 +52,30 @@ namespace WebWindowComplex.Models
}
}
public Threshold SelThreshold
{
get
{
return m_SelThreshold;
}
set
{
m_SelThreshold = value;
}
}
public int SelThresholdFromType
{
get
{
return m_SelThreshold.Type;
}
set
{
m_SelThreshold = m_ThresholdList.Where(x=>x.Type.Equals(value)).First();
}
}
public int BottomRailQty
{
get
@@ -329,6 +361,7 @@ namespace WebWindowComplex.Models
newFrame.SetSelShape(Shapes.RECTANGLE);
newFrame.SetBottomRail(false);
newFrame.SetBottomRailQty(0);
newFrame.SetSelThresholdFromName(m_ThresholdList.FirstOrDefault().Name);
//newFrame.FrameArcElem = null;
return newFrame;
}
@@ -338,7 +371,7 @@ namespace WebWindowComplex.Models
Area.nCounterGroup = 0;
if (nCounterGroup < GroupId)
Area.nCounterGroup = GroupId;
JsonFrame JsonFrame = new JsonFrame(m_Shape, m_bBottomRail, m_nBottomRailQty, GroupId);
JsonFrame JsonFrame = new JsonFrame(m_Shape, m_SelThreshold.Name, m_bBottomRail, m_nBottomRailQty, GroupId);
//if (FrameArcElem != null)
// JsonFrame.ArcElement = FrameArcElem.Serialize();
//else
@@ -477,6 +510,11 @@ namespace WebWindowComplex.Models
m_Shape = Value;
}
internal void SetSelThresholdFromName(string value)
{
m_SelThreshold = m_ThresholdList.Where(x=>x.Name.Equals(value)).First();
}
#endregion Internal Methods
#region Private Fields
@@ -485,6 +523,8 @@ namespace WebWindowComplex.Models
private bool m_bBottomRail;
private Threshold m_SelThreshold;
private List<FrameDimension> m_DimensionList = new List<FrameDimension>();
private List<Joint> m_JointList = new List<Joint>();
+3 -2
View File
@@ -583,7 +583,7 @@ namespace WebWindowComplex
};
//FrameArcElement ae = new FrameArcElement(frame, window, 10, true, true);
JsonWindow jsonWindow = new JsonWindow("Profilo78", "Pino", "Black", "Vetro BE 2S 4T/16/4T");
JsonFrame jsonFrame = new JsonFrame(Shapes.RECTANGLE, false, 0, 1);
JsonFrame jsonFrame = new JsonFrame(Shapes.RECTANGLE, null, false, 0, 1);
jsonWindow.AreaList.Add(jsonFrame);
//jsonFrame.ArcElement = ae.Serialize();
foreach (var Dimension in DimensionList)
@@ -744,6 +744,7 @@ namespace WebWindowComplex
/// </summary>
protected void UpdateSelParameter()
{
Frame.m_ThresholdList = ListPayload.Threshold;
Sash.m_HardwareCompleteList = ListPayload.Hardware;
Sash.s_FamilyHardwareList = ListPayload.FamilyHardware;
if (CurrSelection != null && CurrSelection.IsValid())
@@ -988,7 +989,7 @@ namespace WebWindowComplex
/// <param name="args"></param>
private async Task ReqResetDict(DataUpdateRes args)
{
_ = EC_ActionReq.InvokeAsync(args.req);
await EC_ActionReq.InvokeAsync(args.req);
}
/// <summary>
+6 -2
View File
@@ -6,7 +6,7 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>2.7.12.1812</Version>
<Version>2.7.12.2212</Version>
<Authors>Annamaria Sassi</Authors>
<Company>Egalware</Company>
<Description>Componente gestione Configurazioni avanzate Window per LUX</Description>
@@ -18,7 +18,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Egw.Window.Data" Version="2.7.10.2116" />
<PackageReference Include="Egw.Window.Data" Version="2.7.12-beta.2210" />
<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" />
@@ -405,6 +405,10 @@