Merge branch 'develop'

This commit is contained in:
Annamaria Sassi
2026-03-27 16:38:20 +01:00
14 changed files with 415 additions and 401 deletions
+2 -2
View File
@@ -9,8 +9,8 @@
<PrivateAssets>all</PrivateAssets>
</PackageVersion>
<PackageVersion Include="Egw.Window.Data" Version="2.8.1.2611" />
<PackageVersion Include="EgwCoreLib.Lux.Core" Version="1.0.2603.918" />
<PackageVersion Include="EgwCoreLib.Lux.Data" Version="1.0.2603.918" />
<PackageVersion Include="EgwCoreLib.Lux.Core" Version="1.0.2603.2112" />
<PackageVersion Include="EgwCoreLib.Lux.Data" Version="1.0.2603.2112" />
<PackageVersion Include="EgwCoreLib.Razor" Version="1.5.2511.312" />
<PackageVersion Include="EgwCoreLib.Utils" Version="1.5.2511.312" />
<PackageVersion Include="Microsoft.AspNetCore.Components.Web" Version="8.0.21" />
+15 -2
View File
@@ -533,8 +533,21 @@ namespace Test.UI.Components.Pages
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;
Dictionary<string, string> DictParam = new Dictionary<string, string>();
if (!string.IsNullOrEmpty(newFamilyHardware))
DictParam.Add("FamilyHardware", newFamilyHardware!);
if (!string.IsNullOrEmpty(newColorMaterial))
DictParam.Add("Color", newColorMaterial!);
if (!string.IsNullOrEmpty(newMaterial))
DictParam.Add("Material", newMaterial!);
if (!string.IsNullOrEmpty(newGlass))
DictParam.Add("Glass", newGlass!);
if (!string.IsNullOrEmpty(newProfile))
DictParam.Add("Profile", newProfile!);
var dp = SerialMan.MassUpdate(currSer, DictParam);
CurrData.CurrJwd = dp.serializeStruct;
//var newJwd = SerialMan.MassUpdate(currSer, shape, newFamilyHardware, newHardware, newColorMaterial, newMaterial, newGlass, newProfile);
//CurrData.CurrJwd = newJwd;
}
#endregion Private Methods
+8 -8
View File
@@ -4,7 +4,7 @@
<PageTitle>EditJWD</PageTitle>
@* <div class="row">
<div class="row">
<div class="col-6">
<div class="input-group mb-2 justify-content-center">
<span class="input-group-text">FamilyHw</span>
@@ -21,10 +21,10 @@
<div class="input-group mb-2 justify-content-center">
<span class="input-group-text">Color</span>
<select class="form-select" @bind="colorMassUpdate">
@foreach (var item in AvailColorMaterialList)
{
<option value="@item">@item</option>
}
@foreach (var item in AvailColorMaterialList)
{
<option value="@item">@item</option>
}
</select>
</div>
</div>
@@ -54,7 +54,7 @@
<div class="input-group mb-2 justify-content-center">
<span class="input-group-text">Profile</span>
<select class="form-select" @bind="profileMassUpdate">
@foreach (var item in AvailProfileList)
@foreach (var item in DescriptionProfileList)
{
<option value="@item">@item</option>
}
@@ -62,10 +62,10 @@
</div>
</div>
<div class="col-4">
<button class="btn btn-outline-secondary btn-sm" @onclick="() => updateInfoJwd(CurrData.CurrJwd, familyHWMassUpdate, null, colorMassUpdate, materialMassUpdate, glassMassUpdate, profileMassUpdate)">Save</button>
<button class="btn btn-outline-secondary btn-sm" @onclick="() => UpdateInfoJwdAsync(CurrData.CurrJwd, familyHWMassUpdate, colorMassUpdate, materialMassUpdate, glassMassUpdate, profileMassUpdate)">Save</button>
</div>
</div>
*@
@if (doEdit)
{
<WebWindowComplex.TableComp ListPayload="SetupList"
+160 -307
View File
@@ -1,7 +1,16 @@
using Egw.Window.Data;
using EgwCoreLib.Lux.Core;
using EgwCoreLib.Lux.Core.RestPayload;
using EgwCoreLib.Lux.Data.DbModel.Catalog;
using EgwCoreLib.Lux.Data.DbModel.Config;
using EgwCoreLib.Lux.Data.DbModel.Sales;
using EgwCoreLib.Lux.Data.DbModel.Utils;
using EgwCoreLib.Lux.Data.Domains;
using EgwCoreLib.Lux.Data.Services;
using EgwCoreLib.Lux.Data.Services.Config;
using EgwCoreLib.Lux.Data.Services.Items;
using EgwCoreLib.Lux.Data.Services.Sales;
using EgwCoreLib.Lux.Data.Services.Utils;
using Microsoft.AspNetCore.Components;
using Newtonsoft.Json;
using WebWindowComplex;
@@ -26,23 +35,6 @@ namespace Test.UI.Components.Pages
#region Protected Fields
/// <summary>
/// Predisposizione valori live SVG/JWD
/// </summary>
protected LivePayload CurrData = new LivePayload();
protected List<AreaProfiles> currElement = new List<AreaProfiles>();
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 selezionati
/// </summary>
@@ -64,60 +56,11 @@ namespace Test.UI.Components.Pages
#region Protected Properties
protected List<string> AvailColorMaterialList { get; set; } = new List<string>()
{
new string("White"),
new string("Black"),
new string("Blu"),
new string("Wood")
};
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")
};
[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(" ", "&nbsp;");
}
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
@@ -134,6 +77,7 @@ namespace Test.UI.Components.Pages
protected override async Task OnInitializedAsync()
{
ConfInit();
await ReloadBaseList();
User = false;
Random random = new Random();
CalcUid = Convert.ToString(random.Next(1000, 10000));
@@ -142,21 +86,14 @@ namespace Test.UI.Components.Pages
//initialJwd = File.ReadAllText("Data\\AntaDoppia.jwd");
currJwd = initialJwd;
// rileggo altri dati
await ReloadData();
// costruisco lista profili
ProfilePayload pp1 = new ProfilePayload()
//await ReloadData();
// converto i profili nel nuovo formato x payload...
var profList = AvailProfileList.Select(x => new ProfilePayload()
{
ProfileName = "Profilo78",
ThresholdList = ThresholdProfilo78,
ParameterDict = ParamProfilo78
};
ProfilePayload pp2 = new ProfilePayload()
{
ProfileName = "ProfiloSaomad",
ThresholdList = ThresholdProfiloSaomad,
ParameterDict = ParamProfiloSaomad
};
AvailProfileList = new List<ProfilePayload> { pp1, pp2 };
ProfileName = x.Code,
ThresholdList = x.ThresholdList,
ParameterDict = x.ProfileDataDict
}).ToList();
// preparo conf oggetti x controllo
SetupList = new BaseListPayload()
{
@@ -165,7 +102,7 @@ namespace Test.UI.Components.Pages
Glass = AvailGlassList,
Hardware = AvailHardwareList,
Material = AvailMaterialList,
ProfileList = AvailProfileList
ProfileList = profList
};
CurrData = new LivePayload()
{
@@ -174,6 +111,7 @@ namespace Test.UI.Components.Pages
DictShape = currGroupShape,
DictOptionsXml = currHwOption
};
DescriptionProfileList = profList.Select(x=>x.ProfileName).ToList();
DLService.PipeSvg.EA_NewMessage += PipeSvg_EA_NewMessage;
DLService.PipeShape.EA_NewMessage += PipeShape_EA_NewMessage;
DLService.PipeHwOpt.EA_NewMessage += PipeHwOption_EA_NewMessage;
@@ -182,14 +120,82 @@ namespace Test.UI.Components.Pages
#endregion Protected Methods
#region Private Properties
[Inject]
private ConfigDataService CDService { get; set; } = default!;
[Inject]
private IConfGlassService CGService { get; set; } = null!;
[Inject]
private IConfProfileService CPService { get; set; } = null!;
[Inject]
private IConfWoodService CWService { get; set; } = null!;
[Inject]
private IGenValService GVService { get; set; } = default!;
[Inject]
private IConfiguration Config { get; set; } = null!;
[Inject]
private DataLayerServices DLService { get; set; } = null!;
[Inject]
private ImageCacheService ICService { get; set; } = null!;
private string SelColorMaterial { get; set; } = "";
private string SelFamilyHardware { get; set; } = "";
private string SelGlass { get; set; } = "";
private string SelMaterial { get; set; } = "";
#endregion Private Properties
#region Private Fields
private List<GlassModel> AllConfGlass = new();
private List<GenValueModel> AllColors = new();
private List<HardwareModel> AllConfHardware = new();
private List<WoodModel> AllConfWood = new();
private List<string> AvailColorMaterialList = new List<string>();
private List<string> AvailFamilyHardwareList = new List<string>();
private List<string> AvailGlassList = new List<string>();
private List<Hardware> AvailHardwareList = new();
private List<string> AvailMaterialList = new List<string>();
private List<ProfileModel> AvailProfileList = new();
private List<string> DescriptionProfileList = new();
private EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS cEnvir = EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW;
/// <summary>
/// Predisposizione valori live SVG/JWD
/// </summary>
private LivePayload CurrData = new LivePayload();
private List<AreaProfiles> currElement = new List<AreaProfiles>();
private Dictionary<int, string> currGroupShape = new Dictionary<int, string>();
private Dictionary<int, string> currHwOption = new Dictionary<int, string>();
private string currJwd = "...";
private Dictionary<string, string> m_CurrArgs = new Dictionary<string, string>();
private string prevJwd = "";
private string apiUrl = "";
/// <summary>
/// Lista profili da DB
/// </summary>
private List<ProfilePayload> AvailProfileList = new List<ProfilePayload>();
///// <summary>
///// Lista profili da DB
///// </summary>
//private List<ProfilePayload> AvailProfileList = new List<ProfilePayload>();
private string calcTag = "";
@@ -220,210 +226,19 @@ namespace Test.UI.Components.Pages
/// </summary>
private bool isInteractive = false;
//private string colorMassUpdate;
//private string familyHWMassUpdate;
//private string glassMassUpdate;
//private Hardware hardwareMassUpdate;
//private string materialMassUpdate;
//private string profileMassUpdate;
private string colorMassUpdate;
private string familyHWMassUpdate;
private string glassMassUpdate;
private Hardware hardwareMassUpdate;
private string materialMassUpdate;
private string profileMassUpdate;
private string outClose = "";
private string outSave = "";
private Dictionary<string, double> ParamProfilo78 = new Dictionary<string, double>()
{
{"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},
{"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},
{"Frame_Rail_Bottom_DimMin", 70},
{"Frame_Rail_Bottom_DimStd", 78},
{"Frame_Rail_DimMax", 78},
{"Frame_Rail_DimMin", 68},
{"Frame_Rail_DimStd", 72},
{"Frame_Sash_Bottom_DimMax", 80},
{"Frame_Sash_Bottom_DimMin", 70},
{"Frame_Sash_Bottom_DimStd", 78},
{"Frame_Sash_Horizontal_DimMax", 110},
{"Frame_Sash_Horizontal_DimMin", 75},
{"Frame_Sash_Horizontal_DimStd", 95},
{"Frame_Sash_Threshold_DimMax", 26},
{"Frame_Sash_Threshold_DimMin", 24},
{"Frame_Sash_Threshold_DimStd", 25},
{"Frame_Sash_Top_DimMax", 80},
{"Frame_Sash_Top_DimMin", 70},
{"Frame_Sash_Top_DimStd", 78},
{"Frame_Sash_Vertical_DimMax", 110},
{"Frame_Sash_Vertical_DimMin", 85},
{"Frame_Sash_Vertical_DimStd", 95},
{"Frame_Slide_Bottom_DimMax", 60},
{"Frame_Slide_Bottom_DimMin", 50},
{"Frame_Slide_Bottom_DimStd", 55},
{"Frame_Slide_Fixed_DimMax", 60},
{"Frame_Slide_Fixed_DimMin", 50},
{"Frame_Slide_Fixed_DimStd", 55},
{"Frame_Slide_MovableBack_Bottom_DimMax", 60},
{"Frame_Slide_MovableBack_Bottom_DimMin", 50},
{"Frame_Slide_MovableBack_Bottom_DimStd", 55},
{"Frame_Slide_MovableBack_Threshold_DimMax", 10},
{"Frame_Slide_MovableBack_Threshold_DimMin", 3},
{"Frame_Slide_MovableBack_Threshold_DimStd", 4},
{"Frame_Slide_Movable_DimMax", 60},
{"Frame_Slide_Movable_DimMin", 50},
{"Frame_Slide_Movable_DimStd", 55},
{"Frame_Slide_Threshold_DimMax", 10},
{"Frame_Slide_Threshold_DimMin", 3},
{"Frame_Slide_Threshold_DimStd", 4},
{"Frame_Slide_Top_DimMax", 60},
{"Frame_Slide_Top_DimMin", 50},
{"Frame_Slide_Top_DimStd", 55},
{"Sash_Fill_Rail_DimMax", 80},
{"Sash_Fill_Rail_DimMin", 70},
{"Sash_Fill_Rail_DimStd", 78},
{"Sash_Frame_Bottom_DimMax", 80},
{"Sash_Frame_Bottom_DimMin", 70},
{"Sash_Frame_Bottom_DimStd", 78},
{"Sash_Frame_Top_DimMax", 80},
{"Sash_Frame_Top_DimMin", 70},
{"Sash_Frame_Top_DimStd", 78},
{"Sash_French_In_DimMax", 80},
{"Sash_French_In_DimMin", 70},
{"Sash_French_In_DimStd", 78},
{"Sash_French_Out_DimMax", 80},
{"Sash_French_Out_DimMin", 70},
{"Sash_French_Out_DimStd", 78},
{"Sash_Rail_Bottom_DimMax", 80},
{"Sash_Rail_Bottom_DimMin", 70},
{"Sash_Rail_Bottom_DimStd", 78},
{"Sash_Rail_DimMax", 80},
{"Sash_Rail_DimMin", 70},
{"Sash_Rail_DimStd", 78},
{"Sash_Sash_Active_DimMax", 80},
{"Sash_Sash_Active_DimMin", 70},
{"Sash_Sash_Active_DimStd", 78},
{"Sash_Sash_Inactive_DimMax", 80},
{"Sash_Sash_Inactive_DimMin", 70},
{"Sash_Sash_Inactive_DimStd", 78},
{"Sash_Sash_Split_DimMax", 70},
{"Sash_Sash_Split_DimMin", 50},
{"Sash_Sash_Split_DimStd", 60},
{"Sash_Slide_Active_DimMax", 90},
{"Sash_Slide_Active_DimMin", 70},
{"Sash_Slide_Active_DimStd", 80},
{"Sash_Slide_Active_In_DimMax", 90},
{"Sash_Slide_Active_In_DimMin", 70},
{"Sash_Slide_Active_In_DimStd", 80},
{"Sash_Slide_Fixed_Bottom_DimMax", 150},
{"Sash_Slide_Fixed_Bottom_DimMin", 120},
{"Sash_Slide_Fixed_Bottom_DimStd", 135},
{"Sash_Slide_Fixed_Side_DimMax", 90},
{"Sash_Slide_Fixed_Side_DimMin", 70},
{"Sash_Slide_Fixed_Side_DimStd", 80},
{"Sash_Slide_Fixed_Top_DimMax", 90},
{"Sash_Slide_Fixed_Top_DimMin", 70},
{"Sash_Slide_Fixed_Top_DimStd", 80},
{"Sash_Slide_Inactive_DimMax", 90},
{"Sash_Slide_Inactive_DimMin", 70},
{"Sash_Slide_Inactive_DimStd", 80},
{"Sash_Slide_MovableBack_Bottom_DimMax", 150},
{"Sash_Slide_MovableBack_Bottom_DimMin", 120},
{"Sash_Slide_MovableBack_Bottom_DimStd", 135},
{"Sash_Slide_MovableBack_Side_DimMax", 90},
{"Sash_Slide_MovableBack_Side_DimMin", 70},
{"Sash_Slide_MovableBack_Side_DimStd", 80},
{"Sash_Slide_MovableBack_Top_DimMax", 90},
{"Sash_Slide_MovableBack_Top_DimMin", 70},
{"Sash_Slide_MovableBack_Top_DimStd", 80},
{"Sash_Slide_Movable_Bottom_DimMax", 150},
{"Sash_Slide_Movable_Bottom_DimMin", 120},
{"Sash_Slide_Movable_Bottom_DimStd", 135},
{"Sash_Slide_Movable_Side_DimMax", 90},
{"Sash_Slide_Movable_Side_DimMin", 70},
{"Sash_Slide_Movable_Side_DimStd", 80},
{"Sash_Slide_Movable_Top_DimMax", 90},
{"Sash_Slide_Movable_Top_DimMin", 70},
{"Sash_Slide_Movable_Top_DimStd", 80},
{"Frame_BottomRail_Overlap", 33.2},
{"French_In_Overlap", 26},
{"French_Out_Overlap", 26},
{"Mixed_Bottom_Overlap", 26},
{"Mixed_Split_Bottom_Overlap", 41},
{"Mixed_Split_Top_Overlap", 41},
{"Mixed_Top_Overlap", 41},
{"NO_Mixed_Bottom_Overlap", 26},
{"NO_Mixed_Split_Bottom_Overlap", 41},
{"NO_Mixed_Split_Top_Overlap", 41},
{"NO_Slide_MovableBack_Threshold_Overlap", 0},
{"NO_Slide_Threshold_Overlap", 0},
{"Sash_Active_Overlap", 26},
{"Sash_Inactive_Overlap", 26},
{"Sash_BottomRail_Overlap", 24.5},
{"Sash_Bottom_Overlap", 26},
{"Sash_Horizontal_Bottom_Overlap", 26},
{"Sash_Horizontal_Top_Overlap", 41},
{"Sash_Threshold_Overlap", 18},
{"Sash_Top_Overlap", 41},
{"Sash_Vertical_Overlap", 41},
{"Slide_Active_Overlap", 80},
{"Slide_Bottom_Overlap", 0},
{"Slide_Fixed_Overlap", -5},
{"Slide_MovableBack_Bottom_Overlap", 0},
{"Slide_MovableBack_Threshold_Overlap", 0},
{"Slide_Movable_Overlap", -5},
{"Slide_Threshold_Overlap", 0},
{"Slide_Top_Overlap", -12}
};
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}
};
private bool startEmpty = true;
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 string windowUid = "CurrWindow";
#endregion Private Fields
@@ -440,8 +255,7 @@ namespace Test.UI.Components.Pages
}
else
{
return File.ReadAllText("Data\\AntaDoppiaInglesine.jwd");
//return File.ReadAllText("Data\\AntaDoppia.jwd");
return File.ReadAllText("Data\\AntaDoppia.jwd");
}
}
}
@@ -450,6 +264,51 @@ namespace Test.UI.Components.Pages
#region Private Methods
/// <summary>
/// Init classi configurazione
/// </summary>
/// <returns></returns>
private async Task ReloadBaseList()
{
// lettura config setup varie da DB/Cache Redis
AllConfGlass = await CGService.GetAllAsync();
AvailProfileList = await CPService.GetAllAsync();
// FixMe Todo: eliminare da REDIS e usare elenco DB solamente...
var rawProfiles = CDService.ProfileList(cEnvir, "Default");
// se fosse vuoto chiamo update...
if (rawProfiles == null || rawProfiles.Count == 0)
{
rawProfiles = CDService.ProfileList(cEnvir, "Default");
}
var rawHw = CDService.HwModelList(cEnvir, "HW.AGB");
// hw filtro solo validi...
AllConfHardware = rawHw
.Where(x => !x.FamilyName.Equals(x.Description, StringComparison.OrdinalIgnoreCase))
.ToList();
AllConfWood = await CWService.GetAllAsync();
AllColors = await GVService.GetFiltAsync("WoodCol");
// conversione tipi
AvailGlassList = AllConfGlass
.Select(x => x.Description)
.ToList();
AvailFamilyHardwareList = AllConfHardware
.DistinctBy(x => x.FamilyName)
.OrderBy(x => x.FamilyName)
.Select(x => x.FamilyName)
.ToList();
AvailHardwareList = AllConfHardware
.Select(x => new Egw.Window.Data.Hardware(x.Id, x.FamilyName, x.Description, x.OpeningType, x.Shape, x.SashQty, x.SashPosition))
.ToList();
AvailMaterialList = AllConfWood
.Select(x => x.Description)
.ToList();
AvailColorMaterialList = AllColors
.OrderBy(x => x.Index)
.Select(x => x.ValString)
.ToList();
}
/// <summary>
/// Effettua chiusura oggetto con eventuale save
/// </summary>
@@ -614,25 +473,6 @@ namespace Test.UI.Components.Pages
await Task.Delay(1);
}
/// <summary>
/// Rilettura dati
/// </summary>
/// <returns></returns>
private Task ReloadData()
{
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);
}
}
return Task.Delay(100);
}
private void SetEdit(Microsoft.AspNetCore.Components.Web.MouseEventArgs args)
{
doEdit = true;
@@ -648,10 +488,23 @@ namespace Test.UI.Components.Pages
return InvokeAsync(StateHasChanged);
}
private void updateInfoJwd(string currSer, string? newFamilyHardware, Hardware? newHardware, string? newColorMaterial, string? newMaterial, string? newGlass, string? newProfile)
private async Task UpdateInfoJwdAsync(string currSer, string? newFamilyHardware, string? newColorMaterial, string? newMaterial, string? newGlass, string? newProfile)
{
var newJwd = SerialMan.MassUpdate(currSer, newFamilyHardware, newHardware, newColorMaterial, newMaterial, newGlass, newProfile);
CurrData.CurrJwd = newJwd;
Dictionary<string, string> DictParam = new Dictionary<string, string>();
if (!string.IsNullOrEmpty(newFamilyHardware))
DictParam.Add( "FamilyHardware", newFamilyHardware! );
if (!string.IsNullOrEmpty(newColorMaterial))
DictParam.Add("Color", newColorMaterial!);
if (!string.IsNullOrEmpty(newMaterial))
DictParam.Add("Material", newMaterial!);
if (!string.IsNullOrEmpty(newGlass))
DictParam.Add("Glass", newGlass!);
if (!string.IsNullOrEmpty(newProfile))
DictParam.Add("Profile", newProfile!);
var dp = SerialMan.MassUpdate(currSer, DictParam);
CurrData.CurrJwd = dp.serializeStruct;
//var newJwd = SerialMan.MassUpdate(currSer, newFamilyHardware, newHardware, newColorMaterial, newMaterial, newGlass, newProfile);
//CurrData.CurrJwd = newJwd;
}
#endregion Private Methods
+15 -2
View File
@@ -601,8 +601,21 @@ namespace Test.UI.Components.Pages
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;
Dictionary<string, string> DictParam = new Dictionary<string, string>();
if (!string.IsNullOrEmpty(newFamilyHardware))
DictParam.Add("FamilyHardware", newFamilyHardware!);
if (!string.IsNullOrEmpty(newColorMaterial))
DictParam.Add("Color", newColorMaterial!);
if (!string.IsNullOrEmpty(newMaterial))
DictParam.Add("Material", newMaterial!);
if (!string.IsNullOrEmpty(newGlass))
DictParam.Add("Glass", newGlass!);
if (!string.IsNullOrEmpty(newProfile))
DictParam.Add("Profile", newProfile!);
var dp = SerialMan.MassUpdate(currSer, DictParam);
CurrData.CurrJwd = dp.serializeStruct;
//var newJwd = SerialMan.MassUpdate(currSer, shape, newFamilyHardware, newHardware, newColorMaterial, newMaterial, newGlass, newProfile);
//CurrData.CurrJwd = newJwd;
}
private void RemoveParams(Microsoft.AspNetCore.Components.Web.MouseEventArgs args)
+17 -1
View File
@@ -1,4 +1,6 @@
using EgwCoreLib.Lux.Data;
using EgwCoreLib.Lux.Data.Services;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using NLog;
using NLog.Web;
@@ -26,6 +28,20 @@ builder.Services.AddRazorComponents()
// costruzione connectionMultiplexer redis...
string connStr = configuration.GetConnectionString("Redis") ?? "localhost";
ConnectionMultiplexer redisConn = ConnectionMultiplexer.Connect(connStr);
// registrazione in blocco servizi con metodo extension custom
var connectionString = builder.Configuration.GetConnectionString("Lux.All") ?? throw new InvalidOperationException("Connection string 'DefaultConnection' not found.");
builder.Services.AddDbContextFactory<DataLayerContext>(options =>
{
var conn = builder.Configuration.GetConnectionString("Lux.All");
options.UseMySql(conn, ServerVersion.AutoDetect(conn), mySqlOptions =>
{
mySqlOptions.EnableStringComparisonTranslations();
})
.EnableSensitiveDataLogging(false)
.EnableDetailedErrors(false)
.LogTo(_ => { }); // disabilita EF logging;
});
builder.Services.AddLuxData(connectionString);
// registro connMultiplexer REDIS
builder.Services.AddSingleton<IConnectionMultiplexer>(redisConn);
// registro wrapper servizi REDIS
@@ -34,7 +50,7 @@ builder.Services.AddSingleton<RedisSubscriptionManager>();
// Aggiunta servizi specifici
builder.Services.AddSingleton<DataLayerServices>();
builder.Services.AddSingleton<ImageCacheService>();
builder.Services.AddSingleton<ConfigDataService>();
var app = builder.Build();
+8 -5
View File
@@ -123,11 +123,14 @@ namespace WebWindowComplex.Compo
currSplit = CurrSplit
};
_ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetDimElem });
// 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 });
if(!(CurrSplit.ParentArea.ParentArea is Sash))
{
// Se la shape selezionata è grid o custom, richiede reset shape
if (value == (int)SplitShapes.GRID || value == (int)SplitShapes.CUSTOM)
_ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDictShape });
if (SearchSash(CurrSplit))
_ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetHwOpt });
}
_ = EC_ReqElement.InvokeAsync(CurrSplit);
_ = EC_UpdateSplit.InvokeAsync(args);
}
+1
View File
@@ -169,6 +169,7 @@ namespace WebWindowComplex.Compo
{
FrameWindow.AddFirstSash();
await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetDimElem });
await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetDictShape });
var args = new DataUpdateFrame()
{
currFrame = FrameWindow,
+15
View File
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WebWindowComplex
{
public class GeneralData
{
public string serializeStruct { get; set; } = "";
public Dictionary<string,string> DictParameter { get; set; } = new();
}
}
+11 -8
View File
@@ -935,16 +935,19 @@ namespace WebWindowComplex.Models
internal string SetSelFamilyHardwareFromIndex(string codHardware)
{
string? item = "";
if (string.IsNullOrEmpty(m_SelFamilyHardware))
if(codHardware != "000000")
{
item = m_HardwareCompleteList
.Where(x => x.Id == codHardware)
.Select(x => x.FamilyName)
.FirstOrDefault();
SetSelFamilyHardware(item ?? "");
string? item = "";
if (string.IsNullOrEmpty(m_SelFamilyHardware))
{
item = m_HardwareCompleteList
.Where(x => x.Id == codHardware)
.Select(x => x.FamilyName)
.FirstOrDefault();
SetSelFamilyHardware(item ?? "");
}
}
return SelFamilyHardware;
return m_SelFamilyHardware;
}
internal void SetSelHardwareFromId(string sId)
+83 -44
View File
@@ -14,68 +14,107 @@ namespace WebWindowComplex
public class SerialMan
{
/// <summary>
/// Riceve un JWD in ingresso e effettua una sostituzione dei parametri rieschiesti (SE non nulli)
/// Riceve un JWD in ingresso e effettua una sostituzione dei parametri richiesti (SE non nulli)
/// </summary>
/// <param name="currSer"></param>
/// <param name="newFamilyHardware"></param>
/// <param name="newHardware"></param>
/// <param name="newColorMaterial"></param>
/// <returns>Valore serializzato con le modifiche richieste</returns>
public static string MassUpdate(string currSer, string? newFamilyHardware, Hardware? newHardware, string? newColorMaterial, string? newMaterial, string? newGlass, string? newProfile)
public static GeneralData MassUpdate(string currSer, Dictionary<string, string> DictParameter)
{
string outVal = currSer;
if (string.IsNullOrEmpty(currSer) || currSer == "{}")
{
GeneralData dp = new GeneralData()
{
serializeStruct = currSer,
DictParameter = DictParameter
};
return dp;
}
// serializzazione JWD --> window
JsonWindow WindowFromJson = JsonConvert.DeserializeObject<JsonWindow>(currSer, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", "");
Window currWindow = WindowFromJson.Deserialize();
// verifica 1:1 delle richieste
if (!string.IsNullOrEmpty(newFamilyHardware))
if (!string.IsNullOrEmpty(DictParameter.GetValueOrDefault("Color")))
{
SearchSash(currWindow.AreaList.First(), newFamilyHardware, null);
currWindow.sColorMaterial = DictParameter.GetValueOrDefault("Color")!;
DictParameter.Remove("Color");
}
if (newHardware != null)
if (!string.IsNullOrEmpty(DictParameter.GetValueOrDefault("Material")))
{
SearchSash(currWindow.AreaList.First(), null, newHardware);
currWindow.sMaterial = DictParameter.GetValueOrDefault("Material")!;
DictParameter.Remove("Material");
}
if (!string.IsNullOrEmpty(newColorMaterial))
if (!string.IsNullOrEmpty(DictParameter.GetValueOrDefault("Glass")))
{
currWindow.sColorMaterial = newColorMaterial;
}
if (!string.IsNullOrEmpty(newMaterial))
{
currWindow.sMaterial = newMaterial;
}
if (!string.IsNullOrEmpty(newGlass))
{
currWindow.sGlass = newGlass;
}
if (!string.IsNullOrEmpty(newProfile))
{
currWindow.sProfilePath = newProfile;
currWindow.sGlass = DictParameter.GetValueOrDefault("Glass")!;
DictParameter.Remove("Glass");
}
var CurrJwd = JsonConvert.SerializeObject(currWindow.Serialize(), Formatting.Indented);
return CurrJwd;
GeneralData datap = new GeneralData()
{
serializeStruct = CurrJwd,
DictParameter = DictParameter
};
return datap;
}
internal static void SearchSash(Area currentArea, string? newFamilyHw, Hardware? newHardware)
{
if (currentArea.AreaType.Equals(AreaTypes.SASH))
{
Sash s = (Sash)currentArea;
if (!string.IsNullOrEmpty(newFamilyHw))
{
s.SelFamilyHardware = newFamilyHw;
}
if (newHardware != null)
{
s.SelHardware = newHardware;
}
}
foreach (Area child in currentArea.AreaList)
{
SearchSash(child, newFamilyHw, newHardware);
}
}
//public static string MassUpdate(string currSer, string? newFamilyHardware, Hardware? newHardware, string? newColorMaterial, string? newMaterial, string? newGlass, string? newProfile)
//{
// if(string.IsNullOrEmpty(currSer) || currSer == "{}")
// {
// return currSer;
// }
// // serializzazione JWD --> window
// JsonWindow WindowFromJson = JsonConvert.DeserializeObject<JsonWindow>(currSer, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", "");
// Window currWindow = WindowFromJson.Deserialize();
// // verifica 1:1 delle richieste
// if (!string.IsNullOrEmpty(newFamilyHardware))
// {
// SearchSash(currWindow.AreaList.First(), newFamilyHardware, null);
// }
// if (newHardware != null)
// {
// SearchSash(currWindow.AreaList.First(), null, newHardware);
// }
// if (!string.IsNullOrEmpty(newColorMaterial))
// {
// currWindow.sColorMaterial = newColorMaterial;
// }
// if (!string.IsNullOrEmpty(newMaterial))
// {
// currWindow.sMaterial = newMaterial;
// }
// if (!string.IsNullOrEmpty(newGlass))
// {
// currWindow.sGlass = newGlass;
// }
// if (!string.IsNullOrEmpty(newProfile))
// {
// currWindow.sProfilePath = newProfile;
// }
// var CurrJwd = JsonConvert.SerializeObject(currWindow.Serialize(), Formatting.Indented);
// return CurrJwd;
//}
//internal static void SearchSash(Area currentArea, string? newFamilyHw, Hardware? newHardware)
//{
// if (currentArea.AreaType.Equals(AreaTypes.SASH))
// {
// Sash s = (Sash)currentArea;
// if (!string.IsNullOrEmpty(newFamilyHw))
// {
// s.SelFamilyHardware = newFamilyHw;
// }
// if (newHardware != null)
// {
// s.SelHardware = newHardware;
// }
// }
// foreach (Area child in currentArea.AreaList)
// {
// SearchSash(child, newFamilyHw, newHardware);
// }
//}
}
}
+23 -20
View File
@@ -337,7 +337,7 @@ namespace WebWindowComplex
private int m_maxRow = 0;
private List<Sash> m_SashList = new List<Sash>();
private List<Sash> m_SashGroupList = new List<Sash>();
private List<Split> m_SplitList = new List<Split>();
@@ -401,13 +401,15 @@ namespace WebWindowComplex
/// </summary>
private int prevReq { get; set; } = 0;
private List<Hardware> prevHardware { get; set; } = new();
private int reqHwOpt { get; set; } = 0;
private Dictionary<int, bool> RowCollapsed { get; set; } = new Dictionary<int, bool>();
private List<Sash> SashGroupList
{
get => m_SashList;
get => m_SashGroupList;
}
private string SelColorMaterial { get; set; } = "";
@@ -807,7 +809,7 @@ namespace WebWindowComplex
}
case AreaTypes.SASH:
{
m_SashList.Add((Sash)node);
m_SashGroupList.Add((Sash)node);
break;
}
case AreaTypes.FILL:
@@ -1242,6 +1244,22 @@ namespace WebWindowComplex
// Aggiornamento liste sash, split, splitted, fill e itemTable
UpdateLists();
}
for (int i = 0; i < SashGroupList.Count; i++)
{
if ((string.IsNullOrEmpty(SashGroupList.ElementAt(i).SelFamilyHardware)) &&
SashGroupList.ElementAt(i).nSashQty == prevHardware.ElementAt(i).SashQty)
{
SashGroupList.ElementAt(i).SetSelFamilyHardwareFromIndex(prevHardware.ElementAt(i).Id);
}
else if (!string.IsNullOrEmpty(SashGroupList.ElementAt(i).SelFamilyHardware) || SashGroupList.ElementAt(i).SelHardware != null)
{
var item = SashGroupList.ElementAt(i).SelHardware;
if (i > prevHardware.Count - 1)
prevHardware.Add(item);
else
prevHardware[i] = SashGroupList.ElementAt(i).SelHardware;
}
}
if (SashGroupList.Count > 0)
currAntaIndex = 0;
// Aggiorno window con dati shape e hw option
@@ -1468,21 +1486,6 @@ namespace WebWindowComplex
for (int elem = 2; elem <= elemList.Count - 2; elem++)
elemList.ElementAt(elem).SetOverlapElement(Window.m_ParameterList.GetValueOrDefault(overlapNameTop + "_Overlap"));
elemList.Last().SetOverlapElement(Window.m_ParameterList.GetValueOrDefault(overlapNameSx + "_Overlap"));
//bool recalcDim = false;
//for(int i = 0; i < elemList.Count; i++)
//{
// if (!elemList.ElementAt(i).Equals(elemOld.ElementAt(i)))
// recalcDim = true;
//}
//if (recalcDim)
//{
// Frame frame = sash.ParentWindow.AreaList.First();
// if (frame != null)
// {
// frame.SearchAreaList(frame, frame.AvailWidthArea(), "Width");
// frame.SearchAreaList(frame, frame.AvailHeightArea(), "Height");
// }
//}
}
/// <summary>
@@ -1602,7 +1605,7 @@ namespace WebWindowComplex
reqList.Add(FrameWindow.GroupId);
// Aggiorno le liste sash, split
m_FillList = new List<Fill>();
m_SashList = new List<Sash>();
m_SashGroupList = new List<Sash>();
m_SplitList = new List<Split>();
m_SplittedList = new List<Splitted>();
CreateWindowsList((m_CurrWindow!).AreaList.First(), false);
@@ -1726,7 +1729,7 @@ namespace WebWindowComplex
m_maxCol = 0;
m_maxRow = 0;
m_FillList = new List<Fill>();
m_SashList = new List<Sash>();
m_SashGroupList = new List<Sash>();
m_SplitList = new List<Split>();
m_SplittedList = new List<Splitted>();
m_ItemTableList = new List<ItemTable>();
+27 -1
View File
@@ -6,7 +6,7 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>3.1.3.2016</Version>
<Version>3.1.3.2716</Version>
<Authors>Annamaria Sassi</Authors>
<Company>Egalware</Company>
<Description>Componente gestione Configurazioni avanzate Window per LUX</Description>
@@ -54,6 +54,32 @@
@@ -6,7 +6,7 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>3.1.3.2016</Version>
<Version>3.1.3.2716</Version>
<Authors>Annamaria Sassi</Authors>
<Company>Egalware</Company>
<Description>Componente gestione JWD per LUX</Description>
@@ -56,6 +56,35 @@