Aggiunto larghezza elementi frame
This commit is contained in:
@@ -0,0 +1,103 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using WebWindowComplex.Json;
|
||||
using static WebWindowComplex.Json.WindowConst;
|
||||
|
||||
namespace WebWindowComplex.Models
|
||||
{
|
||||
public class ElementDimension
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
public ElementDimension(Frame ParentArea, int nIndex, double dDimension)
|
||||
{
|
||||
m_ParentArea = ParentArea;
|
||||
m_nIndex = nIndex;
|
||||
m_dDimension = dDimension;
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public double dDimension
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_dDimension;
|
||||
}
|
||||
set
|
||||
{
|
||||
if(dDimension != value)
|
||||
{
|
||||
if (value > MaxDim)
|
||||
m_dDimension = MaxDim;
|
||||
else if (value < MinDim)
|
||||
m_dDimension = MinDim;
|
||||
else
|
||||
m_dDimension = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int nIndex
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_nIndex;
|
||||
}
|
||||
}
|
||||
|
||||
public Area ParentArea
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_ParentArea;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public void SetDimension(double dValue)
|
||||
{
|
||||
m_dDimension = dValue;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Internal Methods
|
||||
|
||||
internal JsonElementDimension Serialize()
|
||||
{
|
||||
JsonElementDimension JsonElementDimension = new JsonElementDimension(m_nIndex, m_dDimension);
|
||||
return JsonElementDimension;
|
||||
}
|
||||
|
||||
#endregion Internal Methods
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected Frame m_ParentArea;
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private double m_dDimension;
|
||||
|
||||
private int m_nIndex;
|
||||
|
||||
// valore massimo della dimensione del frame
|
||||
private int MaxDim = 200;
|
||||
// valore minimo della dimensione del frame
|
||||
private int MinDim = 50;
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
@@ -117,6 +117,12 @@ namespace WebWindowComplex.Models
|
||||
set => m_DimensionList = value;
|
||||
}
|
||||
|
||||
public List<ElementDimension> ElementDimensionList
|
||||
{
|
||||
get => m_ElementDimensionList;
|
||||
set => m_ElementDimensionList = value;
|
||||
}
|
||||
|
||||
public List<Joint> JointList
|
||||
{
|
||||
get
|
||||
@@ -425,6 +431,8 @@ namespace WebWindowComplex.Models
|
||||
// JsonFrame.ArcElement = null;
|
||||
foreach (var Dimension in DimensionList)
|
||||
JsonFrame.DimensionList.Add(Dimension.Serialize());
|
||||
foreach (var ElementDimension in ElementDimensionList)
|
||||
JsonFrame.ElementDimensionList.Add(ElementDimension.Serialize());
|
||||
foreach (var Joint in JointList)
|
||||
JsonFrame.JointList.Add(Joint.Serialize());
|
||||
foreach (var Area in AreaList)
|
||||
@@ -554,6 +562,49 @@ namespace WebWindowComplex.Models
|
||||
break;
|
||||
}
|
||||
}
|
||||
ElementDimensionList.Clear();
|
||||
// aggiungo Element Dimension
|
||||
switch (Value)
|
||||
{
|
||||
case Shapes.RECTANGLE:
|
||||
case Shapes.ARC_FULL:
|
||||
case Shapes.RIGHTCHAMFER:
|
||||
case Shapes.LEFTCHAMFER:
|
||||
case Shapes.ARC:
|
||||
{
|
||||
for(int i = 0; i < 4; i++)
|
||||
ElementDimensionList.Add(new ElementDimension(this, i + 1, 78));
|
||||
break;
|
||||
}
|
||||
|
||||
case Shapes.DOUBLECHAMFER:
|
||||
case Shapes.DOUBLEARC:
|
||||
{
|
||||
for (int i = 0; i < 5; i++)
|
||||
ElementDimensionList.Add(new ElementDimension(this, i + 1, 78));
|
||||
break;
|
||||
}
|
||||
|
||||
case Shapes.THREECENTERARC:
|
||||
{
|
||||
for (int i = 0; i < 6; i++)
|
||||
ElementDimensionList.Add(new ElementDimension(this, i + 1, 78));
|
||||
break;
|
||||
}
|
||||
|
||||
case Shapes.TRIANGLE:
|
||||
{
|
||||
for (int i = 0; i < 3; i++)
|
||||
ElementDimensionList.Add(new ElementDimension(this, i + 1, 78));
|
||||
break;
|
||||
}
|
||||
|
||||
case Shapes.CUSTOM:
|
||||
{
|
||||
ElementDimensionList.Clear();
|
||||
break;
|
||||
}
|
||||
}
|
||||
m_Shape = Value;
|
||||
}
|
||||
|
||||
@@ -583,6 +634,8 @@ namespace WebWindowComplex.Models
|
||||
private List<Threshold> m_ThresholdList = new List<Threshold>();
|
||||
|
||||
private List<FrameDimension> m_DimensionList = new List<FrameDimension>();
|
||||
|
||||
private List<ElementDimension> m_ElementDimensionList = new List<ElementDimension>();
|
||||
|
||||
private List<Joint> m_JointList = new List<Joint>();
|
||||
|
||||
|
||||
@@ -249,6 +249,12 @@ namespace WebWindowComplex.Models
|
||||
}
|
||||
}
|
||||
|
||||
public List<ElementDimension> ElementDimensionList
|
||||
{
|
||||
get => m_ElementDimensionList;
|
||||
set => m_ElementDimensionList = value;
|
||||
}
|
||||
|
||||
public bool SashBottomRail
|
||||
{
|
||||
get
|
||||
@@ -648,7 +654,9 @@ namespace WebWindowComplex.Models
|
||||
JsonSash JsonSash = new JsonSash(m_bIsSashVertical, m_SashType, m_bSashBottomRail, m_nSashBottomRailQty, currHwId, GroupId);
|
||||
foreach (var SashDimension in SashList)
|
||||
JsonSash.SashList.Add(SashDimension.Serialize());
|
||||
if(HwOptionList.Count > 0)
|
||||
foreach (var ElementDimension in ElementDimensionList)
|
||||
JsonSash.ElementDimensionList.Add(ElementDimension.Serialize());
|
||||
if (HwOptionList.Count > 0)
|
||||
{
|
||||
foreach (var HwOption in HwOptionList)
|
||||
JsonSash.HwOptionList.Add(HwOption.Serialize());
|
||||
@@ -868,6 +876,8 @@ namespace WebWindowComplex.Models
|
||||
|
||||
private int m_nSashBottomRailQty;
|
||||
|
||||
private List<ElementDimension> m_ElementDimensionList = new List<ElementDimension>();
|
||||
|
||||
private List<IdNameStruct> m_OrientationSashTypeList = new List<IdNameStruct>
|
||||
{
|
||||
new IdNameStruct((int)OrientationSash.VERTICAL, "Vertical"),
|
||||
|
||||
Reference in New Issue
Block a user