Gestito parametro di ingresso lista Profili

This commit is contained in:
Annamaria Sassi
2026-01-22 14:46:39 +01:00
parent db317ccd77
commit e1ba401353
9 changed files with 158 additions and 29 deletions
+6 -4
View File
@@ -67,9 +67,10 @@ namespace WebWindowComplex.DTO
bool glassOK = Glass != null && Glass.Count > 0;
bool matOK = Material != null && Material.Count > 0;
bool colorOK = ColorMaterial != null && ColorMaterial.Count > 0;
bool profileOK = Profile != null && Profile.Count > 0;
bool profileOK = ProfileList != null && ProfileList.Count > 0;
bool profileOKOld = Profile != null && Profile.Count > 0;
bool thresholdOK = Threshold != null && Threshold.Count > 0;
return famHwOK && glassOK && hwOK && colorOK && matOK && profileOK && thresholdOK;
return famHwOK && glassOK && hwOK && colorOK && matOK && profileOK;
}
/// <summary>
/// Verifica che Payload sia almeno parzialmente popolato
@@ -82,9 +83,10 @@ namespace WebWindowComplex.DTO
bool glassOK = Glass != null && Glass.Count > 0;
bool matOK = Material != null && Material.Count > 0;
bool colorOK = ColorMaterial != null && ColorMaterial.Count > 0;
bool profileOK = Profile != null && Profile.Count > 0;
bool profileOK = ProfileList != null && ProfileList.Count > 0;
bool profileOKOld = Profile != null && Profile.Count > 0;
bool thresholdOK = Threshold != null && Threshold.Count > 0;
return famHwOK || glassOK || hwOK || colorOK || matOK || profileOK || thresholdOK;
return famHwOK || glassOK || hwOK || colorOK || matOK || profileOK;
}
}
}
+14
View File
@@ -52,5 +52,19 @@ namespace WebWindowComplex.DTO
bool profileOK = !string.IsNullOrEmpty(Profile);
return famHwOK && colorOK && matOK && glassOk && profileOK;
}
/// <summary>
/// Verifica che Payload sia almeno parzialmente popolato
/// </summary>
/// <returns></returns>
public bool IsPopulated()
{
bool famHwOK = FamilyHardware != null;
bool glassOK = Glass != null;
bool matOK = Material != null;
bool colorOK = ColorMaterial != null;
bool profileOK = Profile != null;
return famHwOK || glassOK || colorOK || matOK || profileOK;
}
}
}
+6 -4
View File
@@ -12,10 +12,12 @@ namespace WebWindowComplex.Models
public class Frame : Area
{
#region Public Fields
// Lista hardware completa passata dal chiamante del componente
public static Dictionary<string, List<Threshold>> m_AllThresholdList = new Dictionary<string, List<Threshold>>();
public static Dictionary<string, List<Threshold>> m_AllThresholdListOld = new Dictionary<string, List<Threshold>>();
// Lista soglie completa passata dal chiamante del componente
public static List<Threshold> m_AllThresholdList = new List<Threshold>();
#endregion Public Fields
#region Public Constructors
@@ -361,7 +363,7 @@ namespace WebWindowComplex.Models
public void RefreshThresholdList()
{
m_ThresholdList.Clear();
m_ThresholdList = m_AllThresholdList.GetValueOrDefault(ParentWindow.sProfilePath);
m_ThresholdList = m_AllThresholdList;
}
public double HeightFrame()
@@ -413,7 +415,7 @@ namespace WebWindowComplex.Models
newFrame.RefreshThresholdList();
if (m_AllThresholdList != null && m_AllThresholdList.Any())
{
newFrame.SetSelThresholdFromName(m_AllThresholdList.GetValueOrDefault(Window.sProfilePath)?.FirstOrDefault()?.Name ?? "");
newFrame.SetSelThresholdFromName(m_AllThresholdList.FirstOrDefault().Name ?? "");
}
//newFrame.FrameArcElem = null;
return newFrame;
+4 -5
View File
@@ -17,13 +17,12 @@ namespace WebWindowComplex.Models
{
public class Window
{
#region Public Events
#region Public Fields
//public event EventHandler<OnPreviewEventArgs> OnPreview = delegate { };
//public event EventHandler<OnReqShapeEventArgs> OnReqShape = delegate { };
//public event EventHandler<OnReqHwOptEventArgs> OnReqHwOption = delegate { };
// Lista dei parametri del profilo passata dal chiamante del componente
public static Dictionary<string, double> m_ParameterList = new Dictionary<string, double>();
#endregion Public Events
#endregion Public Fields
#region Public Properties
+20 -9
View File
@@ -52,7 +52,7 @@ namespace WebWindowComplex
/// Preselezione valori
/// </summary>
[Parameter]
public SelectPayload? CurrSelection { get; set; } = null;
public SelectPayload? SelectionData { get; set; } = null;
/// <summary>
/// Richiesta azione al parent
@@ -557,6 +557,7 @@ namespace WebWindowComplex
try
{
WindowFromJson = JsonConvert.DeserializeObject<JsonWindow>(LiveData.CurrJwd, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", "");
UpdateInputList(WindowFromJson);
setCurrWindow(WindowFromJson);
//SOLO SE non sono in edit...
if (!editLock)
@@ -748,18 +749,28 @@ namespace WebWindowComplex
/// <summary>
/// Metodo per settare i parmateri di ingresso selezionati
/// </summary>
protected void UpdateSelParameter()
protected void UpdateInputList(JsonWindow WindowFromJson)
{
Frame.m_AllThresholdList = ListPayload.Threshold;
//Frame.m_AllThresholdList = ListPayload.Threshold;
string profile = WindowFromJson.ProfilePath;
Window.m_ParameterList = ListPayload.ProfileList.FirstOrDefault(x => x.ProfileName.Equals(profile)).ParameterDict;
Frame.m_AllThresholdList = ListPayload.ProfileList.FirstOrDefault(x => x.ProfileName.Equals(profile)).ThresholdList;
Sash.m_HardwareCompleteList = ListPayload.Hardware;
Sash.s_FamilyHardwareList = ListPayload.FamilyHardware;
if (CurrSelection != null && CurrSelection.IsValid())
}
/// <summary>
/// Metodo per settare i parmateri di ingresso selezionati
/// </summary>
protected void UpdateSelParameter()
{
if (SelectionData != null && SelectionData.IsValid())
{
SelFamilyHardware = CurrSelection.FamilyHardware ?? "";
SelColorMaterial = CurrSelection.ColorMaterial ?? "";
SelMaterial = CurrSelection.Material ?? "";
SelGlass = CurrSelection.Glass ?? "";
SelProfile = CurrSelection.Profile ?? "";
SelFamilyHardware = SelectionData.FamilyHardware ?? "";
SelColorMaterial = SelectionData.ColorMaterial ?? "";
SelMaterial = SelectionData.Material ?? "";
SelGlass = SelectionData.Glass ?? "";
SelProfile = SelectionData.Profile ?? "";
}
}
+13 -1
View File
@@ -6,7 +6,7 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>2.8.1.2209</Version>
<Version>2.8.1.2214</Version>
<Authors>Annamaria Sassi</Authors>
<Company>Egalware</Company>
<Description>Componente gestione Configurazioni avanzate Window per LUX</Description>
@@ -42,6 +42,18 @@