Serializzazione hw option nel JWD

This commit is contained in:
Annamaria Sassi
2025-10-28 15:04:04 +01:00
parent 960d20e256
commit eaea52f45d
10 changed files with 175 additions and 55 deletions
+50 -40
View File
@@ -10,30 +10,30 @@
{
"nIndex": 1,
"sName": "Width",
"dValue": 1200.0
"dValue": 800.0
},
{
"nIndex": 2,
"sName": "Height",
"dValue": 1500.0
"dValue": 1200.0
}
],
"JointList": [
{
"nIndex": 1,
"JointType": "FULL_V"
"JointType": "FULL_H"
},
{
"nIndex": 2,
"JointType": "FULL_V"
"JointType": "FULL_H"
},
{
"nIndex": 3,
"JointType": "FULL_V"
"JointType": "FULL_H"
},
{
"nIndex": 4,
"JointType": "FULL_V"
"JointType": "FULL_H"
}
],
"BottomRail": false,
@@ -45,62 +45,72 @@
"SashList": [
{
"nSashId": 1,
"OpeningType": "TURNONLY_LEFT",
"bHasHandle": false,
"dDimension": 50.0
},
{
"nSashId": 2,
"OpeningType": "TILTTURN_RIGHT",
"OpeningType": "TILTTURN_LEFT",
"bHasHandle": true,
"dDimension": 50.0
"dDimension": 100.0
}
],
"SashType": "NULL",
"JointList": [
{
"nIndex": 1,
"JointType": "FULL_V"
"JointType": "FULL_H"
},
{
"nIndex": 2,
"JointType": "FULL_V"
"JointType": "FULL_H"
},
{
"nIndex": 3,
"JointType": "FULL_V"
"JointType": "FULL_H"
},
{
"nIndex": 4,
"JointType": "FULL_V"
"JointType": "FULL_H"
}
],
"BottomRail": false,
"BottomRailQty": 0,
"Hardware": "000632",
"HwOptionList": [
{
"Name": "Entrata",
"Value": "15 mm",
"Type": "Combo"
},
{
"Name": "LavManigliaPassante",
"Value": "No",
"Type": "Combo"
},
{
"Name": "PosizioneForoCilindro",
"Value": "Cilindro sopra la maniglia",
"Type": "Combo"
},
{
"Name": "ModelloCilindro",
"Value": "Nessun cilindro",
"Type": "Combo"
},
{
"Name": "LavCilindroPassante",
"Value": "No",
"Type": "Combo"
},
{
"Name": "HMan",
"Value": "",
"Type": "Text"
}
],
"Hardware": "000631",
"GroupId": 2,
"AreaList": [
{
"FillType": "GLASS",
"GroupId": 3,
"AreaList": [
{
"GroupId": 4,
"FillType": "GLASS",
"AreaList": [],
"AreaType": "FILL"
}
],
"AreaType": "SPLITTED"
},
{
"GroupId": 5,
"AreaList": [
{
"FillType": "GLASS",
"GroupId": 6,
"AreaList": [],
"AreaType": "FILL"
}
],
"AreaType": "SPLITTED"
"AreaList": [],
"AreaType": "FILL"
}
],
"AreaType": "SASH"
+60
View File
@@ -367,6 +367,20 @@ namespace WebWindowComplex.Json
}
}
private List<JsonHwOption> m_HwOptionList = new List<JsonHwOption>();
[JsonProperty]
public List<JsonHwOption> HwOptionList
{
get
{
return m_HwOptionList;
}
set
{
m_HwOptionList = value;
}
}
public JsonSash() : base(AreaTypes.SASH)
{
}
@@ -401,6 +415,8 @@ namespace WebWindowComplex.Json
newSash.SetSelFamilyHardwareFromIndex(Hardware);
newSash.ReqRefreshShape();
newSash.SetSelHardwareFromId(Hardware);
//foreach (var HwOption in m_HwOptionList)
// newSash.HwOptionList.Add(HwOption.Deserialize());
foreach (var Area in AreaList)
{
var AreaDeserealized = Area.Deserialize(newSash, ParentWindow);
@@ -640,6 +656,50 @@ namespace WebWindowComplex.Json
}
}
public class JsonHwOption
{
private string m_Name;
[JsonProperty]
public string Name
{
get
{
return m_Name;
}
set
{
m_Name = value;
}
}
private string m_Value;
[JsonProperty]
public string Value
{
get
{
return m_Value;
}
set
{
m_Value = value;
}
}
public JsonHwOption(string sName, string sValue)
{
m_Name = sName;
m_Value = sValue;
}
//internal AGBOption Deserialize()
//{
// AGBOption newOption = new AGBOption(m_Name, m_Value);
// return newOption;
//}
}
public class JsonFrameDimension
{
private int m_nIndex;
+16 -1
View File
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WebWindowComplex.Json;
using static WebWindowComplex.Json.WindowConst;
namespace WebWindowComplex.Models
@@ -11,11 +12,16 @@ namespace WebWindowComplex.Models
{
#region Public Constructors
/// <summary>
/// Costruttore partendo da xml
/// </summary>
/// <param name="HdwOptionParam"></param>
public AGBOption(ParametriOpzioniParametri HdwOptionParam)
{
m_sName = HdwOptionParam.NomeParametro;
m_sDescription = HdwOptionParam.DescrizioneParametro;
m_OptVisibility = Visibility.VISIBLE; // If(HdwOptionParam.Visible.ToLower = "true", Visibility.Visible, Visibility.Collapsed)
m_OptVisibility = Visibility.VISIBLE;
// If(HdwOptionParam.Visible.ToLower = "true", Visibility.Visible, Visibility.Collapsed)
}
#endregion Public Constructors
@@ -56,6 +62,15 @@ namespace WebWindowComplex.Models
#endregion Public Properties
#region Internal Methods
internal virtual JsonHwOption Serialize()
{
return null;
}
#endregion Internal Methods
#region Protected Fields
protected HwOptionTypes m_Type;
+11
View File
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WebWindowComplex.Json;
using static WebWindowComplex.Json.WindowConst;
namespace WebWindowComplex.Models
@@ -45,6 +46,16 @@ namespace WebWindowComplex.Models
#endregion Public Properties
#region Internal Methods
internal override JsonHwOption Serialize()
{
JsonHwOption JsonHwOption = new JsonHwOption(sName, m_sValue.sDescription);
return JsonHwOption;
}
#endregion Internal Methods
#region Private Fields
private AGBOptionParameter m_sValue;
+11
View File
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WebWindowComplex.Json;
using static WebWindowComplex.Json.WindowConst;
namespace WebWindowComplex.Models
@@ -80,6 +81,16 @@ namespace WebWindowComplex.Models
#endregion Public Properties
#region Internal Methods
internal override JsonHwOption Serialize()
{
JsonHwOption JsonHwOption = new JsonHwOption(sName, m_sValue);
return JsonHwOption;
}
#endregion Internal Methods
#region Private Fields
private string m_sValue;
+2
View File
@@ -655,6 +655,8 @@ namespace WebWindowComplex.Models
JsonSash.SashList.Add(SashDimension.Serialize());
foreach (var Joint in JointList)
JsonSash.JointList.Add(Joint.Serialize());
foreach (var HwOption in HwOptionList)
JsonSash.HwOptionList.Add(HwOption.Serialize());
foreach (var Area in AreaList)
JsonSash.AreaList.Add(Area.Serialize());
return JsonSash;
+1 -8
View File
@@ -236,11 +236,4 @@
}
}
}
</div>
@if (bError)
{
<div class="alert alert-danger" role="alert">
Aggiunta finestra non possibile.
</div>
}
</div>
+12 -4
View File
@@ -571,8 +571,6 @@ namespace WebWindowComplex
{
// reset editLock...
editLock = false;
// reset variabile errori
bError = false;
listErrPre = new Dictionary<string, string>();
listErrLink = new Dictionary<string, string>();
listWarnings = new Dictionary<string, string>();
@@ -732,6 +730,10 @@ namespace WebWindowComplex
}
}
/// <summary>
/// Metodo per costruire oggetti della Window
/// </summary>
/// <param name="WindowFromJson"></param>
protected void setCurrWindow(JsonWindow WindowFromJson)
{
if (m_CurrWindow != null)
@@ -812,8 +814,6 @@ namespace WebWindowComplex
#region Private Fields
private bool bError = false;
private int currAnta = 0;
private int currFill = -1;
@@ -900,6 +900,10 @@ namespace WebWindowComplex
//await DoPreviewSvg();
}
/// <summary>
/// Metodo per aggiungere una sash di default al Frame
/// </summary>
/// <param name="f"></param>
private void AddSashToFrame(Frame f)
{
f.AddFirstSash();
@@ -910,6 +914,10 @@ namespace WebWindowComplex
_ = DoReqShape(reqList);
}
/// <summary>
/// Metodo per aggiungere uno split di default al Frame
/// </summary>
/// <param name="f"></param>
private void AddSplitToFrame(Frame f)
{
f.AddSplit();
+2 -1
View File
@@ -6,7 +6,7 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>2.7.10.2716</Version>
<Version>2.7.10.2815</Version>
<Authors>Annamaria Sassi</Authors>
<Company>Egalware</Company>
<Description>Componente gestione Configurazioni avanzate Window per LUX</Description>
@@ -163,5 +163,6 @@
@@ -6,7 +6,7 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>2.7.10.2716</Version>
<Version>2.7.10.2815</Version>
<Authors>Annamaria Sassi</Authors>
<Company>Egalware</Company>
<Description>Componente gestione JWD per LUX</Description>
@@ -218,6 +218,15 @@