Merge branch 'develop'
This commit is contained in:
@@ -517,11 +517,13 @@ namespace Test.UI.Components.Pages
|
||||
// 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;
|
||||
CurrData.DictOptionsXml = currHwOption;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
currHwOption = new Dictionary<int, string>();
|
||||
}
|
||||
CurrData.DictOptionsXml = currHwOption;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
await Task.Delay(1);
|
||||
|
||||
@@ -152,12 +152,12 @@
|
||||
"SashType": "NULL",
|
||||
"BottomRail": false,
|
||||
"BottomRailQty": 0,
|
||||
//"BottomRailElemDimList": [
|
||||
// {
|
||||
// "Index": 1,
|
||||
// "Value": 78.0
|
||||
// }
|
||||
//],
|
||||
"BottomRailElemDimList": [
|
||||
{
|
||||
"Index": 1,
|
||||
"Value": 78.0
|
||||
}
|
||||
],
|
||||
"Hardware": "000633",
|
||||
"HwOptionList": [
|
||||
{
|
||||
|
||||
@@ -64,6 +64,12 @@ namespace WebWindowComplex.Compo
|
||||
[Parameter]
|
||||
public EventCallback<DataChangeMode> EC_EditView { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Evento per richiedere reset dizionari
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<DataUpdateRes> EC_ReqResetDict { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Anta corrente
|
||||
/// </summary>
|
||||
@@ -144,6 +150,7 @@ namespace WebWindowComplex.Compo
|
||||
{
|
||||
if (CurrSashDim.SelOpeningTypeIndex != value)
|
||||
{
|
||||
_ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetHwOpt });
|
||||
CurrSashDim.SelOpeningTypeIndex = value;
|
||||
_ = EC_UpdateSashDim.InvokeAsync(CurrSashDim);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace WebWindowComplex.Compo
|
||||
public EventCallback<bool> EC_ReqClose { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Evento per richiedere reset dizionario Shape
|
||||
/// Evento per richiedere reset dizionari
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
public EventCallback<DataUpdateRes> EC_ReqResetDict { get; set; }
|
||||
@@ -77,9 +77,10 @@ namespace WebWindowComplex.Compo
|
||||
if (CurrFrameWindow.SelShapeIndex != value)
|
||||
{
|
||||
CurrFrameWindow.SelShapeIndex = value;
|
||||
// richiesta reset dict shape
|
||||
// richiesta reset dict shape, profili element e hw option
|
||||
_ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetDictShape});
|
||||
_ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetDimElem });
|
||||
_ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetHwOpt });
|
||||
foreach (var s in SashList)
|
||||
{
|
||||
s.SelHardwareFromId = "000000";
|
||||
|
||||
@@ -186,6 +186,7 @@
|
||||
EditMode="editMode"
|
||||
EC_UpdateSash="UpdateSash"
|
||||
EC_UpdateSashDim="UpdateSashDimension"
|
||||
EC_ReqResetDict="ResetDict"
|
||||
EC_EditView="EditView">
|
||||
</AreaSash>
|
||||
</div>
|
||||
|
||||
@@ -91,6 +91,7 @@ namespace WebWindowComplex.Compo
|
||||
{
|
||||
CurrSashGroup.nSashQty = value;
|
||||
_ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetDimElem });
|
||||
_ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetHwOpt });
|
||||
var args = new DataUpdateSash()
|
||||
{
|
||||
currSash = CurrSashGroup,
|
||||
@@ -98,7 +99,8 @@ namespace WebWindowComplex.Compo
|
||||
};
|
||||
_ = EC_UpdateSashGroup.InvokeAsync(args);
|
||||
_ = EC_ReqElement.InvokeAsync(CurrSashGroup);
|
||||
_ = EC_ReqOptionHw.InvokeAsync(CurrSashGroup);
|
||||
if(CurrSashGroup.SelHardware.Id != "000000")
|
||||
_ = EC_ReqOptionHw.InvokeAsync(CurrSashGroup);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -328,6 +330,12 @@ namespace WebWindowComplex.Compo
|
||||
await EC_UpdateSashGroup.InvokeAsync(args);
|
||||
}
|
||||
}
|
||||
|
||||
protected async Task ResetDict(DataUpdateRes args)
|
||||
{
|
||||
await EC_ReqResetDict.InvokeAsync(args);
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Methods
|
||||
|
||||
@@ -845,11 +845,11 @@ namespace WebWindowComplex.Models
|
||||
foreach (var HwOption in HwOptionList)
|
||||
JsonSash.HwOptionList.Add(HwOption.Serialize());
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var HwOption in SelHwOptionList)
|
||||
JsonSash.HwOptionList.Add(new JsonHwOption(HwOption.Key, HwOption.Value));
|
||||
}
|
||||
//else if(currHwId != "000000")
|
||||
//{
|
||||
// foreach (var HwOption in SelHwOptionList)
|
||||
// JsonSash.HwOptionList.Add(new JsonHwOption(HwOption.Key, HwOption.Value));
|
||||
//}
|
||||
//if (SashArcElem != null)
|
||||
// JsonSash.ArcElement = SashArcElem.Serialize();
|
||||
//else
|
||||
|
||||
@@ -602,11 +602,7 @@ namespace WebWindowComplex
|
||||
{
|
||||
listErrLink.Add("Window", $"Deserializing Error:{Environment.NewLine}{ex}");
|
||||
// uso un oggetto "basico" per non fermarmi
|
||||
//string jwd = "{\r\n \"ProfilePath\": \"Profilo78\",\r\n \"Material\": \"Pino\",\r\n \"ColorMaterial\": \"Black\",\r\n \"Glass\": \"Vetro BE 2S 4T/16/4T\",\r\n \"AreaList\": [\r\n {\r\n \"Shape\": \"RECTANGLE\",\r\n \"DimensionList\": [\r\n {\r\n \"Index\": 1,\r\n \"Name\": \"Width\",\r\n \"Value\": 800.0\r\n },\r\n {\r\n \"Index\": 2,\r\n \"Name\": \"Height\",\r\n \"Value\": 1200.0\r\n }\r\n ],\r\n \"JointList\": [\r\n {\r\n \"Index\": 1,\r\n \"JointType\": \"FULL_H\"\r\n },\r\n {\r\n \"Index\": 2,\r\n \"JointType\": \"FULL_H\"\r\n },\r\n {\r\n \"Index\": 3,\r\n \"JointType\": \"FULL_H\"\r\n },\r\n {\r\n \"Index\": 4,\r\n \"JointType\": \"FULL_H\"\r\n }\r\n ],\r\n \"BottomRail\": false,\r\n \"BottomRailQty\": 0,\r\n \"GroupId\": 1,\r\n \"AreaList\": [\r\n {\r\n \"FillType\": \"GLASS\",\r\n \"GroupId\": 7,\r\n \"AreaList\": [],\r\n \"AreaType\": \"FILL\"\r\n }\r\n ],\r\n \"AreaType\": \"FRAME\"\r\n }\r\n ]\r\n}";
|
||||
//WindowFromJson = JsonConvert.DeserializeObject<JsonWindow>(jwd, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", "");
|
||||
//setCurrWindow(WindowFromJson);
|
||||
//await DoPreviewSvg(true);
|
||||
BuildFrameDefault();
|
||||
await BuildFrameDefault();
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -654,7 +650,7 @@ namespace WebWindowComplex
|
||||
}
|
||||
else
|
||||
{
|
||||
BuildFrameDefault();
|
||||
await BuildFrameDefault();
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -703,22 +699,31 @@ namespace WebWindowComplex
|
||||
fill.GroupId = 2;
|
||||
frame.AreaList.Add(fill);
|
||||
JsonWindow jsonWindow = window.Serialize();
|
||||
//JsonWindow jsonWindow = new JsonWindow("Profilo78", "Pino", "Black", "Vetro BE 2S 4T/16/4T");
|
||||
//jsonWindow.Deserialize();
|
||||
//JsonFrame jsonFrame = new JsonFrame(Shapes.RECTANGLE, "Bottom", false, 0, 1);
|
||||
//jsonWindow.AreaList.Add(jsonFrame);
|
||||
////jsonFrame.ArcElement = ae.Serialize();
|
||||
//foreach (var Dimension in DimensionList)
|
||||
// jsonFrame.DimensionList.Add(Dimension.Serialize());
|
||||
//foreach (var Joint in JointList)
|
||||
// jsonFrame.JointList.Add(Joint.Serialize());
|
||||
//JsonFill jsonFill = new JsonFill(FillTypes.GLASS, 2);
|
||||
string jwd = JsonConvert.SerializeObject(jsonWindow);
|
||||
JsonWindow WindowFromJson = JsonConvert.DeserializeObject<JsonWindow>(jwd, new PolymorphicJsonConverter()) ?? new JsonWindow("", "", "", "");
|
||||
setCurrWindow(WindowFromJson);
|
||||
await DoPreviewSvg(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per controllare che non ci siano duplicati di GroupId
|
||||
/// </summary>
|
||||
/// <param name="window"></param>
|
||||
/// <returns></returns>
|
||||
protected bool CheckGroupId(Window window)
|
||||
{
|
||||
List<int> groupIdList = new List<int>();
|
||||
SearchInWindow(window.AreaList.First(), groupIdList);
|
||||
var duplicati = groupIdList.GroupBy(x => x)
|
||||
.Where(g => g.Count() > 1)
|
||||
.Select(g => g.Key)
|
||||
.ToList();
|
||||
if (duplicati.Count > 0)
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per costruire oggetti della Window
|
||||
/// </summary>
|
||||
@@ -730,7 +735,8 @@ namespace WebWindowComplex
|
||||
m_CurrWindow = null;
|
||||
}
|
||||
m_CurrWindow = WindowFromJson.Deserialize();
|
||||
if(m_CurrWindow.AreaList != null && m_CurrWindow.AreaList.Count > 0)
|
||||
groupIdOK = CheckGroupId(m_CurrWindow);
|
||||
if(m_CurrWindow.AreaList != null && m_CurrWindow.AreaList.Count > 0 && groupIdOK)
|
||||
{
|
||||
FrameWindow = m_CurrWindow.AreaList[0];
|
||||
if (m_PreviousWindow != null)
|
||||
@@ -860,6 +866,7 @@ namespace WebWindowComplex
|
||||
private CompileStep currStep;
|
||||
private bool editLock = false;
|
||||
private bool firstDisplay = true;
|
||||
private bool groupIdOK = false;
|
||||
|
||||
/// <summary>
|
||||
/// Booleana fase loading
|
||||
@@ -974,7 +981,6 @@ namespace WebWindowComplex
|
||||
// verifico 1:1 le liste e i valori siano coerenti...
|
||||
if (ListPayload.ColorMaterial != null && ListPayload.ColorMaterial.Count > 0)
|
||||
{
|
||||
// verifico colore attuale sia consistente...
|
||||
if (m_CurrWindow != null)
|
||||
{
|
||||
if (ListPayload.ColorMaterial == null || !ListPayload.ColorMaterial.Contains(m_CurrWindow.sColorMaterial))
|
||||
@@ -993,6 +999,10 @@ namespace WebWindowComplex
|
||||
{
|
||||
listWarnings.Add("Profile", $"Missing Profile: {m_CurrWindow.sProfilePath}");
|
||||
}
|
||||
if (!groupIdOK)
|
||||
{
|
||||
listWarnings.Add("GroupId", "JWD not correct!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1580,6 +1590,23 @@ namespace WebWindowComplex
|
||||
return "btn btn-secondary btn-sm";
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per ottenere lista groupId
|
||||
/// </summary>
|
||||
/// <param name="node"> Area da aggiungere alla lista groupId </param>
|
||||
/// <param name="groupIdList"> Lista group id </param>
|
||||
protected void SearchInWindow(Area node, List<int> groupIdList)
|
||||
{
|
||||
if (node != null)
|
||||
{
|
||||
groupIdList.Add(node.GroupId);
|
||||
foreach (var item in node.AreaList)
|
||||
{
|
||||
SearchInWindow(item, groupIdList);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>3.1.2.410</Version>
|
||||
<Version>3.1.2.415</Version>
|
||||
<Authors>Annamaria Sassi</Authors>
|
||||
<Company>Egalware</Company>
|
||||
<Description>Componente gestione Configurazioni avanzate Window per LUX</Description>
|
||||
@@ -67,6 +67,8 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>3.1.2.410</Version>
|
||||
<Version>3.1.2.415</Version>
|
||||
<Authors>Annamaria Sassi</Authors>
|
||||
<Company>Egalware</Company>
|
||||
<Description>Componente gestione JWD per LUX</Description>
|
||||
@@ -56,6 +56,31 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user