Merge branch 'develop'
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.14.36915.13 d17.14
|
||||
VisualStudioVersion = 17.14.36915.13
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test.UI", "Test.UI\Test.UI.csproj", "{8F1D6298-C1E6-44E6-82BD-4128AE17C0C7}"
|
||||
EndProject
|
||||
|
||||
@@ -34,6 +34,11 @@
|
||||
<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="TestError">
|
||||
<span class="fa-solid fa-pencil px-2 fs-4" aria-hidden="true"></span> <span class="@hideText">TestError</span>
|
||||
</NavLink>
|
||||
</div>
|
||||
@* <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>
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
@page "/TestError"
|
||||
@rendermode InteractiveServer
|
||||
|
||||
<PageTitle>EditJWD</PageTitle>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-3"><button class="btn btn-primary" @onclick="() => RemoveJwd()">No JWD</button></div>
|
||||
<div class="col-3"><button class="btn btn-primary" @onclick="RemoveParams">No Parameters</button></div>
|
||||
</div>
|
||||
|
||||
<WebWindowComplex.TableComp ListPayload="SetupList"
|
||||
LiveData="CurrData"
|
||||
SelectionData="SelectList"
|
||||
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,622 @@
|
||||
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 TestError
|
||||
{
|
||||
|
||||
#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;
|
||||
DLService.PipeProfElement.EA_NewMessage -= PipeProfElement_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 List<AreaProfiles> currElement = new List<AreaProfiles>();
|
||||
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();
|
||||
|
||||
/// <summary>
|
||||
/// Configurazione selezionati
|
||||
/// </summary>
|
||||
protected SelectPayload SelectList = new SelectPayload();
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#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")
|
||||
};
|
||||
|
||||
/// <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_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}
|
||||
};
|
||||
|
||||
[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 = false;
|
||||
Random random = new Random();
|
||||
CalcUid = Convert.ToString(random.Next(1000, 10000));
|
||||
windowUid = CalcUid;
|
||||
//InitialJwd = File.ReadAllText("Data\\AntaDoppiaInglesine.jwd");
|
||||
InitialJwd = File.ReadAllText("Data\\AntaDoppia.jwd");
|
||||
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()
|
||||
{
|
||||
ColorMaterial = AvailColorMaterialList,
|
||||
FamilyHardware = AvailFamilyHardwareList,
|
||||
Glass = AvailGlassList,
|
||||
Hardware = AvailHardwareList,
|
||||
Material = AvailMaterialList,
|
||||
ProfileList = AvailProfileList
|
||||
};
|
||||
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;
|
||||
DLService.PipeProfElement.EA_NewMessage += PipeProfElement_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 channelProfList = "";
|
||||
private string channelProfElem = "";
|
||||
private string channelSvg = "";
|
||||
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Effettua chiusura oggetto con eventuale save
|
||||
/// </summary>
|
||||
/// <param name="reqSave"></param>
|
||||
private void CloseObj(DataSave reqSave)
|
||||
{
|
||||
currJwd = reqSave.currJwd;
|
||||
outClose = !reqSave.ForceSave ? "Richiesto chiusura!" : "";
|
||||
outSave = reqSave.ForceSave ? "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") ?? "";
|
||||
channelProfElem = Config.GetValue<string>("ServerConf:ChannelProfElem") ?? "";
|
||||
channelProfList = Config.GetValue<string>("ServerConf:ChannelProfList") ?? "";
|
||||
}
|
||||
|
||||
/// <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;
|
||||
|
||||
case DataAction.ResetDimElem:
|
||||
CurrData.ProfElementList = new List<AreaProfiles>();
|
||||
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;
|
||||
}
|
||||
else
|
||||
{
|
||||
currHwOption = new Dictionary<int, string>();
|
||||
}
|
||||
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 PipeProfElement_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($"{channelProfElem}:{windowUid}"))
|
||||
{
|
||||
// deserializzo il dizionario delle risposte...
|
||||
var rawDict = JsonConvert.DeserializeObject<List<AreaProfiles>>(currArgs.newMessage);
|
||||
currElement = rawDict ?? new List<AreaProfiles>();
|
||||
CurrData.ProfElementList = currElement;
|
||||
}
|
||||
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 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 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;
|
||||
}
|
||||
|
||||
private void RemoveParams(Microsoft.AspNetCore.Components.Web.MouseEventArgs args)
|
||||
{
|
||||
SetupList = new BaseListPayload();
|
||||
}
|
||||
private Task RemoveJwd()
|
||||
{
|
||||
//InitialJwd = "";
|
||||
//currJwd = InitialJwd;
|
||||
CurrData.CurrJwd = "";
|
||||
// rileggo altri dati
|
||||
return ReloadData();
|
||||
}
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,14 @@
|
||||
{
|
||||
<EgwCoreLib.Razor.LoadingData></EgwCoreLib.Razor.LoadingData>
|
||||
}
|
||||
else if (!okParams)
|
||||
{
|
||||
<div class="alert alert-warning fs-4">Parametri Mancanti!</div>
|
||||
}
|
||||
else if (!okJwd)
|
||||
{
|
||||
<div class="alert alert-warning fs-4">JWD Mancante!</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
if (listErrPre != null && listErrPre.Count > 0)
|
||||
|
||||
@@ -257,7 +257,7 @@ namespace WebWindowComplex
|
||||
if (FillList[i].Equals(node))
|
||||
{
|
||||
nFill = FillList.Count == 1 ? "" : $"{i + 1}";
|
||||
if(node.AreaList.Count == 0)
|
||||
if (node.AreaList.Count == 0)
|
||||
ItemTableList.Add(new ItemTable(AreaTypes.FILL, "FL" + nFill, maxRow, col, i, 0));
|
||||
else
|
||||
ItemTableList.Add(new ItemTable(AreaTypes.FILL, "FL" + nFill, maxRow, col, i, node.AreaList.Count));
|
||||
@@ -604,7 +604,9 @@ namespace WebWindowComplex
|
||||
isLoading = true;
|
||||
// SOLO SE sono presenti...
|
||||
listErrLink = new Dictionary<string, string>();
|
||||
if (ListPayload.IsPopulated() && LiveData.IsValid())
|
||||
okParams = ListPayload.IsPopulated();
|
||||
okJwd = LiveData.IsValid();
|
||||
if (okParams && okJwd)
|
||||
{
|
||||
bool updRequested = false;
|
||||
listErrPre = new Dictionary<string, string>();
|
||||
@@ -650,7 +652,7 @@ namespace WebWindowComplex
|
||||
listErrLink.Add("Window", $"Deserializing Error:{Environment.NewLine}{ex}");
|
||||
Log.Error($"Errore nel deserializzare jwd: {ex.Message}");
|
||||
// uso un oggetto "basico" per non fermarmi
|
||||
WindowFromJson =BuildFrameDefault();
|
||||
WindowFromJson = BuildFrameDefault();
|
||||
await DoPreviewSvg(true);
|
||||
}
|
||||
}
|
||||
@@ -675,7 +677,7 @@ namespace WebWindowComplex
|
||||
firstDisplay = false;
|
||||
// preview SVG senza HW
|
||||
await DoPreviewSvg(true, true);
|
||||
if(LiveData.ProfElementList.Count == 0)
|
||||
if (LiveData.ProfElementList.Count == 0)
|
||||
await UpdateElement(FrameWindow);
|
||||
}
|
||||
List<int> reqList = SashList.Select(x => x.GroupId).ToList();
|
||||
@@ -708,8 +710,8 @@ namespace WebWindowComplex
|
||||
{
|
||||
checkErrorPre();
|
||||
}
|
||||
isLoading = false;
|
||||
}
|
||||
isLoading = false;
|
||||
}
|
||||
|
||||
private JsonWindow BuildFrameDefault()
|
||||
@@ -751,7 +753,7 @@ namespace WebWindowComplex
|
||||
frame.AreaList.Add(fill);
|
||||
JsonWindow jsonWindow = window.Serialize();
|
||||
string jwd = JsonConvert.SerializeObject(jsonWindow);
|
||||
return JsonConvert.DeserializeObject<JsonWindow>(jwd, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", "");
|
||||
return JsonConvert.DeserializeObject<JsonWindow>(jwd, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", "");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -868,7 +870,7 @@ namespace WebWindowComplex
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Metodo che resetta le liste (sash, split, splitted, fill e itemTable) e le crea nuovamente
|
||||
/// </summary>
|
||||
@@ -893,7 +895,7 @@ namespace WebWindowComplex
|
||||
Child.Add(item.Row, item.NumChild);
|
||||
}
|
||||
}
|
||||
else if(RowCollapsed.ContainsKey(item.Row))
|
||||
else if (RowCollapsed.ContainsKey(item.Row))
|
||||
{
|
||||
RowCollapsed.Remove(item.Row);
|
||||
}
|
||||
@@ -944,6 +946,8 @@ namespace WebWindowComplex
|
||||
/// Booleana fase loading
|
||||
/// </summary>
|
||||
private bool isLoading = false;
|
||||
private bool okParams = false;
|
||||
private bool okJwd = false;
|
||||
private bool isRendered = false;
|
||||
|
||||
/// <summary>
|
||||
@@ -1163,9 +1167,9 @@ namespace WebWindowComplex
|
||||
/// Metodo per aggiornare il valore collassato degli elementi della gerarchia
|
||||
/// </summary>
|
||||
/// <param name="Args"></param>
|
||||
private void CollapsedRowTree(Dictionary<int,bool> Args)
|
||||
private void CollapsedRowTree(Dictionary<int, bool> Args)
|
||||
{
|
||||
foreach(var item in Args)
|
||||
foreach (var item in Args)
|
||||
{
|
||||
RowCollapsed[item.Key] = Args[item.Key] ? true : false;
|
||||
if (m_ItemTableList.FirstOrDefault(x => x.Row == item.Key) != null)
|
||||
@@ -1312,7 +1316,7 @@ namespace WebWindowComplex
|
||||
}
|
||||
string overlapName = string.Join("_", SpElemList.ElementAt(i).sName.Split('_').Skip(1));
|
||||
SpElemList.ElementAt(i).SetOverlapElement(Window.m_ParameterList.GetValueOrDefault(overlapName + "_Overlap"));
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1343,28 +1347,28 @@ namespace WebWindowComplex
|
||||
string overlapNameDx = "";
|
||||
elemList = anta.ElementDimensionList;
|
||||
List<ElementDimension> elemOld = elemList;
|
||||
foreach(var elem in sash.BottomRailElemDimList)
|
||||
foreach (var elem in sash.BottomRailElemDimList)
|
||||
{
|
||||
elem.SetOverlapElement(Window.m_ParameterList.GetValueOrDefault("Sash_BottomRail_Overlap"));
|
||||
}
|
||||
if (sash.ParentArea is Frame || (sash.ParentArea.ParentArea is Split split && split.nSplitQtyHoriz == 0))
|
||||
{
|
||||
Frame frame = sash.ParentWindow.AreaList.First();
|
||||
if(frame.SelThreshold.Name.Contains("Threshold"))
|
||||
if (frame.SelThreshold.Name.Contains("Threshold"))
|
||||
overlapNameBottom = "Sash_Threshold";
|
||||
else
|
||||
overlapNameBottom = "Sash_Bottom";
|
||||
overlapNameTop = "Sash_Top";
|
||||
if(sash.ParentArea is Frame)
|
||||
if (sash.ParentArea is Frame)
|
||||
{
|
||||
if(sash.SashList.Count == 1)
|
||||
if (sash.SashList.Count == 1)
|
||||
{
|
||||
overlapNameDx = "Sash_Top";
|
||||
overlapNameSx = "Sash_Top";
|
||||
}
|
||||
else
|
||||
{
|
||||
if(indexAnta == 0)
|
||||
if (indexAnta == 0)
|
||||
{
|
||||
overlapNameDx = string.Join("_", elemList.ElementAt(1).sName.Split('_').Skip(1));
|
||||
overlapNameSx = "Sash_Top";
|
||||
@@ -1398,7 +1402,7 @@ namespace WebWindowComplex
|
||||
}
|
||||
else
|
||||
{
|
||||
if(indexAnta == 0)
|
||||
if (indexAnta == 0)
|
||||
{
|
||||
overlapNameDx = string.Join("_", elemList.ElementAt(1).sName.Split('_').Skip(1));
|
||||
overlapNameSx = "Sash_Top";
|
||||
@@ -1493,7 +1497,7 @@ namespace WebWindowComplex
|
||||
else if (sash.ParentArea.ParentArea is Split s && s.nSplitQtyHoriz > 0)
|
||||
{
|
||||
int indexAreaSplit = s.AreaList.IndexOf(sash.ParentArea);
|
||||
int indexSplit = indexAreaSplit == 0 ? 0 : indexAreaSplit - 1;
|
||||
int indexSplit = indexAreaSplit == 0 ? 0 : indexAreaSplit - 1;
|
||||
if (indexAreaSplit == 0)
|
||||
{
|
||||
overlapNameBottom = "Sash_Bottom";
|
||||
@@ -1661,7 +1665,7 @@ namespace WebWindowComplex
|
||||
// cerco il record
|
||||
var currRec = (Fill?)SearchAreaFromGroupId(FrameWindow, newFill.GroupId);
|
||||
// lo aggiorno
|
||||
if(currRec != null)
|
||||
if (currRec != null)
|
||||
{
|
||||
currRec = newFill;
|
||||
await DoPreviewSvg();
|
||||
@@ -1794,7 +1798,7 @@ namespace WebWindowComplex
|
||||
{
|
||||
if (node.AreaList == null)
|
||||
return;
|
||||
if(node is Sash || node is Split)
|
||||
if (node is Sash || node is Split)
|
||||
groupId.Add(node.GroupId);
|
||||
foreach (var child in node.AreaList)
|
||||
ReqListGroupId(child, groupId);
|
||||
|
||||
@@ -300,6 +300,8 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -261,6 +261,23 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user