Aggiornata costruzione finestra con vetro fisso partendo da jwd vuoto

This commit is contained in:
Annamaria Sassi
2026-02-04 10:26:08 +01:00
parent dff06ff704
commit 5afb1c8842
4 changed files with 70 additions and 13 deletions
+32 -9
View File
@@ -667,8 +667,21 @@ namespace WebWindowComplex
private async Task BuildFrameDefault()
{
// Costruisco window e setto i parametri
Window window = new Window();
window.sProfilePath = "Profilo78";
window.sMaterial = "Pino";
window.sGlass = "Vetro BE 2S 4T/16/4T";
window.sColorMaterial = "Wood";
// Costruisco frame e setto i parametri
Frame frame = new Frame(null, window);
frame.SetGroupId(1);
frame.SetAreaType(AreaTypes.FRAME);
frame.SetSelShape(Shapes.RECTANGLE);
frame.SetSelThresholdFromName("Bottom");
frame.SetBottomRail(false);
frame.SetBottomRailQty(0);
window.AreaList.Add(frame);
List<FrameDimension> DimensionList = new List<FrameDimension>
{
new FrameDimension(frame, 1, "Width", 800, false),
@@ -681,15 +694,25 @@ namespace WebWindowComplex
new Joint(frame, 3, Joints.FULL_H),
new Joint(frame, 4, Joints.FULL_H)
};
JsonWindow jsonWindow = new JsonWindow("Profilo78", "Pino", "Black", "Vetro BE 2S 4T/16/4T");
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());
jsonFrame.AreaList.Add(Fill.CreateFill(frame, FillTypes.GLASS).Serialize(true));
frame.JointList = JointList;
frame.DimensionList = DimensionList;
// Costruisco fill e setto i parametri
Fill fill = new Fill(frame, window);
fill.AreaType = AreaTypes.FILL;
fill.SelFillType = FillTypes.GLASS;
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);