Gestito parametro di ingresso lista Profili
This commit is contained in:
@@ -69,6 +69,7 @@
|
||||
|
||||
<WebWindowComplex.TableComp ListPayload="SetupList"
|
||||
LiveData="CurrData"
|
||||
SelectionData="SelectList"
|
||||
baseUser="User"
|
||||
EC_ActionReq="DoAction"
|
||||
EC_DoUpdate="ExecRequest"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Egw.Window.Data;
|
||||
using EgwCoreLib.Lux.Core;
|
||||
using EgwCoreLib.Lux.Core.RestPayload;
|
||||
using EgwCoreLib.Lux.Data.DbModel.Config;
|
||||
using EgwCoreLib.Lux.Data.Services;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Newtonsoft.Json;
|
||||
@@ -57,6 +58,11 @@ namespace Test.UI.Components.Pages
|
||||
/// </summary>
|
||||
protected BaseListPayload SetupList = new BaseListPayload();
|
||||
|
||||
/// <summary>
|
||||
/// Configurazione selezionati
|
||||
/// </summary>
|
||||
protected SelectPayload SelectList = new SelectPayload();
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Protected Properties
|
||||
@@ -65,7 +71,8 @@ namespace Test.UI.Components.Pages
|
||||
{
|
||||
new string("White"),
|
||||
new string("Black"),
|
||||
new string("Blu")
|
||||
new string("Blu"),
|
||||
new string("Wood")
|
||||
};
|
||||
|
||||
protected List<string> AvailFamilyHardwareList { get; set; } = new List<string>()
|
||||
@@ -92,18 +99,68 @@ namespace Test.UI.Components.Pages
|
||||
new string("Abete")
|
||||
};
|
||||
|
||||
protected List<string> AvailProfileList { get; set; } = new List<string>()
|
||||
protected List<string> AvailProfileListOld { get; set; } = new List<string>()
|
||||
{
|
||||
new string("Profilo78"),
|
||||
new string("ProfiloSaomad")
|
||||
};
|
||||
|
||||
protected Dictionary<string, List<Threshold>> AvailThreshold { get; set; } = new Dictionary<string, List<Threshold>>()
|
||||
protected Dictionary<string, List<Threshold>> AvailThresholdOld { 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")}}
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Lista profili da DB
|
||||
/// </summary>
|
||||
private List<ProfilePayload> AvailProfileList = new List<ProfilePayload>();
|
||||
|
||||
|
||||
private List<Threshold> ThresholdProfilo78 = new List<Threshold>()
|
||||
{
|
||||
{ new Threshold(3, "Bottom") },
|
||||
{ new Threshold(1, "Threshold") }
|
||||
};
|
||||
|
||||
private List<Threshold> ThresholdProfiloSaomad = new List<Threshold>()
|
||||
{
|
||||
{ new Threshold(3, "Bottom") },
|
||||
{ new Threshold(2, "BottomWaterdrip") },
|
||||
{ new Threshold(1, "Threshold") }
|
||||
};
|
||||
|
||||
private Dictionary<string, double> ParamProfilo78 = new Dictionary<string, double>()
|
||||
{
|
||||
{"Frame_BottomRail_Overlap", 33.2},
|
||||
{"Frame_Fill_Rail_DimMax", 85},
|
||||
{"Frame_Fill_Rail_DimMin", 70},
|
||||
{"Frame_Fill_Rail_DimStd", 72},
|
||||
{"Frame_Fixed_Bottom_DimMax", 80},
|
||||
{"Frame_Fixed_Bottom_DimMin", 70},
|
||||
{"Frame_Fixed_Bottom_DimStd", 78},
|
||||
{"Frame_Fixed_Top_DimMax", 80},
|
||||
{"Frame_Fixed_Top_DimMin", 70},
|
||||
{"Frame_Fixed_Top_DimStd", 78}
|
||||
};
|
||||
|
||||
private Dictionary<string, double> ParamProfiloSaomad = new Dictionary<string, double>()
|
||||
{
|
||||
{"Frame_Frame_Split_DimMax", 85},
|
||||
{"Frame_Frame_Split_DimMin", 55},
|
||||
{"Frame_Frame_Split_DimStd", 60},
|
||||
{"Frame_Mixed_Bottom_DimMax", 80},
|
||||
{"Frame_Mixed_Bottom_DimMin", 70},
|
||||
{"Frame_Mixed_Bottom_DimStd", 78},
|
||||
{"Frame_Mixed_Split_DimMax", 110},
|
||||
{"Frame_Mixed_Split_DimMin", 70},
|
||||
{"Frame_Mixed_Split_DimStd", 90},
|
||||
{"Frame_Mixed_Top_DimMax", 80},
|
||||
{"Frame_Mixed_Top_DimMin", 70},
|
||||
{"Frame_Mixed_Top_DimStd", 78},
|
||||
{"Frame_Rail_Bottom_DimMax", 80}
|
||||
};
|
||||
|
||||
[Inject]
|
||||
protected IConfiguration Config { get; set; } = null!;
|
||||
|
||||
@@ -150,6 +207,20 @@ namespace Test.UI.Components.Pages
|
||||
currJwd = InitialJwd;
|
||||
// rileggo altri dati
|
||||
await ReloadData();
|
||||
// costruisco lista profili
|
||||
ProfilePayload pp1 = new ProfilePayload()
|
||||
{
|
||||
ProfileName = "Profilo78",
|
||||
ThresholdList = ThresholdProfilo78,
|
||||
ParameterDict = ParamProfilo78
|
||||
};
|
||||
ProfilePayload pp2 = new ProfilePayload()
|
||||
{
|
||||
ProfileName = "ProfiloSaomad",
|
||||
ThresholdList = ThresholdProfiloSaomad,
|
||||
ParameterDict = ParamProfiloSaomad
|
||||
};
|
||||
AvailProfileList = new List<ProfilePayload> { pp1, pp2 };
|
||||
// preparo conf oggetti x controllo
|
||||
SetupList = new BaseListPayload()
|
||||
{
|
||||
@@ -158,8 +229,9 @@ namespace Test.UI.Components.Pages
|
||||
Glass = AvailGlassList,
|
||||
Hardware = AvailHardwareList,
|
||||
Material = AvailMaterialList,
|
||||
Profile = AvailProfileList,
|
||||
Threshold = AvailThreshold
|
||||
ProfileList = AvailProfileList,
|
||||
Profile = AvailProfileListOld,
|
||||
Threshold = AvailThresholdOld
|
||||
};
|
||||
CurrData = new LivePayload()
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 ?? "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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 JWD per LUX</Description>
|
||||
@@ -57,6 +57,22 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user