- Modificata gestione elementi split (su dimensione secondaria si specifica solo una larghezza per split)
- Aggiunta gestione profili bottom rail per sash e frame - Iniziato a gestire dimensione solo luce per sash
This commit is contained in:
@@ -101,9 +101,14 @@ namespace WebWindowComplex.Models
|
||||
public void AddFirstSash()
|
||||
{
|
||||
// Salvo il parent
|
||||
Area ParentArea = AreaList[0].ParentArea;
|
||||
if(this is Frame)
|
||||
{
|
||||
Frame f = (Frame)this;
|
||||
f.BottomRailQty = 0;
|
||||
f.BottomRailElemDimList.Clear();
|
||||
}
|
||||
// Creo area sash di default
|
||||
Sash SashArea = Sash.CreateSash(ParentArea);
|
||||
Sash SashArea = Sash.CreateSash(this);
|
||||
// Inserisco famiglia hardware vuota
|
||||
SashArea.SetSelFamilyHardware("");
|
||||
// Inserisco hardware di default
|
||||
|
||||
@@ -97,17 +97,36 @@ namespace WebWindowComplex.Models
|
||||
}
|
||||
set
|
||||
{
|
||||
if (m_nBottomRailQty >= 0)
|
||||
if (value >= 0)
|
||||
{
|
||||
if(value > m_nBottomRailQty)
|
||||
{
|
||||
// Aggiungo un element
|
||||
// Aggiungo un element in coda
|
||||
BottomRailElemDimList.Add(new ElementDimension(this, BottomRailElemDimList.Count + 1, 78));
|
||||
BottomRailElemDimList.Last().SetNameElement("Frame_Fill_Rail");
|
||||
BottomRailElemDimList.Last().SetMinDimension(Window.m_ParameterList.GetValueOrDefault(BottomRailElemDimList.Last().sName + "_DimMin"));
|
||||
BottomRailElemDimList.Last().SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(BottomRailElemDimList.Last().sName + "_DimMax"));
|
||||
BottomRailElemDimList.Last().SetDimension(Window.m_ParameterList.GetValueOrDefault(BottomRailElemDimList.Last().sName + "_DimStd"));
|
||||
if (value > 1 && BottomRailElemDimList.Count - 2 >= 0)
|
||||
{
|
||||
BottomRailElemDimList.ElementAt(BottomRailElemDimList.Count - 2).SetNameElement("Frame_Rail");
|
||||
BottomRailElemDimList.ElementAt(BottomRailElemDimList.Count - 2).SetMinDimension(Window.m_ParameterList.GetValueOrDefault(BottomRailElemDimList.ElementAt(BottomRailElemDimList.Count - 2).sName + "_DimMin"));
|
||||
BottomRailElemDimList.ElementAt(BottomRailElemDimList.Count - 2).SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(BottomRailElemDimList.ElementAt(BottomRailElemDimList.Count - 2).sName + "_DimMax"));
|
||||
BottomRailElemDimList.ElementAt(BottomRailElemDimList.Count - 2).SetDimension(BottomRailElemDimList.ElementAt(BottomRailElemDimList.Count - 2).dDimension);
|
||||
}
|
||||
}
|
||||
else if (value < m_nBottomRailQty)
|
||||
{
|
||||
// Elimino un element
|
||||
BottomRailElemDimList.RemoveAt(BottomRailElemDimList.Count - 1);
|
||||
// Elimino gli element
|
||||
for(int i = BottomRailElemDimList.Count-1; i == value; i--)
|
||||
BottomRailElemDimList.RemoveAt(i);
|
||||
if (value >= 1)
|
||||
{
|
||||
BottomRailElemDimList.Last().SetNameElement("Frame_Fill_Rail");
|
||||
BottomRailElemDimList.Last().SetMinDimension(Window.m_ParameterList.GetValueOrDefault(BottomRailElemDimList.Last().sName + "_DimMin"));
|
||||
BottomRailElemDimList.Last().SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(BottomRailElemDimList.Last().sName + "_DimMax"));
|
||||
BottomRailElemDimList.Last().SetDimension(BottomRailElemDimList.Last().dDimension);
|
||||
}
|
||||
}
|
||||
m_nBottomRailQty = value;
|
||||
if (value > 0)
|
||||
|
||||
@@ -451,11 +451,30 @@ namespace WebWindowComplex.Models
|
||||
{
|
||||
// Aggiungo un element
|
||||
BottomRailElemDimList.Add(new ElementDimension(this, BottomRailElemDimList.Count + 1, 78));
|
||||
BottomRailElemDimList.Last().SetNameElement("Sash_Fill_Rail");
|
||||
BottomRailElemDimList.Last().SetMinDimension(Window.m_ParameterList.GetValueOrDefault(BottomRailElemDimList.Last().sName + "_DimMin"));
|
||||
BottomRailElemDimList.Last().SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(BottomRailElemDimList.Last().sName + "_DimMax"));
|
||||
BottomRailElemDimList.Last().SetDimension(Window.m_ParameterList.GetValueOrDefault(BottomRailElemDimList.Last().sName + "_DimStd"));
|
||||
if (value > 1 && BottomRailElemDimList.Count - 2 >= 0)
|
||||
{
|
||||
BottomRailElemDimList.ElementAt(BottomRailElemDimList.Count - 2).SetNameElement("Sash_Rail");
|
||||
BottomRailElemDimList.ElementAt(BottomRailElemDimList.Count - 2).SetMinDimension(Window.m_ParameterList.GetValueOrDefault(BottomRailElemDimList.ElementAt(BottomRailElemDimList.Count - 2).sName + "_DimMin"));
|
||||
BottomRailElemDimList.ElementAt(BottomRailElemDimList.Count - 2).SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(BottomRailElemDimList.ElementAt(BottomRailElemDimList.Count - 2).sName + "_DimMax"));
|
||||
BottomRailElemDimList.ElementAt(BottomRailElemDimList.Count - 2).SetDimension(BottomRailElemDimList.ElementAt(BottomRailElemDimList.Count - 2).dDimension);
|
||||
}
|
||||
}
|
||||
else if (value < m_nSashBottomRailQty)
|
||||
{
|
||||
// Elimino un element
|
||||
BottomRailElemDimList.RemoveAt(BottomRailElemDimList.Count - 1);
|
||||
// Elimino gli element
|
||||
for (int i = BottomRailElemDimList.Count - 1; i == value; i--)
|
||||
BottomRailElemDimList.RemoveAt(i);
|
||||
if (value >= 1)
|
||||
{
|
||||
BottomRailElemDimList.Last().SetNameElement("Sash_Fill_Rail");
|
||||
BottomRailElemDimList.Last().SetMinDimension(Window.m_ParameterList.GetValueOrDefault(BottomRailElemDimList.Last().sName + "_DimMin"));
|
||||
BottomRailElemDimList.Last().SetMaxDimension(Window.m_ParameterList.GetValueOrDefault(BottomRailElemDimList.Last().sName + "_DimMax"));
|
||||
BottomRailElemDimList.Last().SetDimension(BottomRailElemDimList.Last().dDimension);
|
||||
}
|
||||
}
|
||||
m_nSashBottomRailQty = value;
|
||||
if (m_nSashBottomRailQty > 0)
|
||||
@@ -835,7 +854,7 @@ namespace WebWindowComplex.Models
|
||||
if (nCounterGroup < GroupId)
|
||||
Area.nCounterGroup = GroupId;
|
||||
string currHwId = hideHw ? CustomHwId : m_SelHardware!.Id;
|
||||
JsonSash JsonSash = new JsonSash(m_bIsSashVertical, m_SashType, m_bSashBottomRail, m_nSashBottomRailQty, currHwId, GroupId);
|
||||
JsonSash JsonSash = new JsonSash(m_bIsSashVertical, m_SashType, m_bSashBottomRail, m_nSashBottomRailQty, currHwId, GroupId, bIsDimensionLight);
|
||||
foreach (var SashDimension in SashList)
|
||||
JsonSash.SashList.Add(SashDimension.Serialize());
|
||||
foreach (var BottomRailDim in BottomRailElemDimList)
|
||||
|
||||
@@ -432,17 +432,6 @@ namespace WebWindowComplex.Models
|
||||
m_ElemDimVertList = value;
|
||||
}
|
||||
}
|
||||
public List<SplitDimension> SplitPositionList
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_SplitPositionList;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_SplitPositionList = value;
|
||||
}
|
||||
}
|
||||
|
||||
public List<IdNameStruct> SplitShapeList
|
||||
{
|
||||
@@ -531,34 +520,6 @@ namespace WebWindowComplex.Models
|
||||
}
|
||||
}
|
||||
|
||||
public bool OnlySashChild()
|
||||
{
|
||||
foreach (var areaSplitted in AreaList)
|
||||
{
|
||||
if (!(areaSplitted.AreaList.FirstOrDefault()?.AreaType is AreaTypes.SASH))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public bool MinOneSashChild()
|
||||
{
|
||||
foreach (var areaSplitted in AreaList)
|
||||
{
|
||||
if (areaSplitted.AreaList.FirstOrDefault()?.AreaType is AreaTypes.SASH)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public bool SashChildSxOrDx()
|
||||
{
|
||||
foreach (var areaSplitted in AreaList)
|
||||
{
|
||||
if (areaSplitted.AreaList.FirstOrDefault()?.AreaType is AreaTypes.SASH)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Internal Properties
|
||||
@@ -597,10 +558,20 @@ namespace WebWindowComplex.Models
|
||||
JsonSplit.SplitVertList.Add(SplitVert.Serialize());
|
||||
foreach (var SplitHoriz in m_SplitHorizList)
|
||||
JsonSplit.SplitHorizList.Add(SplitHoriz.Serialize());
|
||||
foreach (var Elem in m_ElemDimHorizList)
|
||||
JsonSplit.ElementDimHorizList.Add(Elem.Serialize());
|
||||
foreach (var Elem in m_ElemDimVertList)
|
||||
JsonSplit.ElementDimVertList.Add(Elem.Serialize());
|
||||
if(m_ElemDimHorizList != null && m_ElemDimHorizList.Count > 0)
|
||||
{
|
||||
int subAreaMinHoriz = m_ElemDimHorizList.Min(x => x.nSubArea);
|
||||
List<SplitElementDimension> horizList = m_ElemDimHorizList.Where(x => x.nSubArea == subAreaMinHoriz).ToList();
|
||||
foreach (var Elem in horizList)
|
||||
JsonSplit.ElementDimHorizList.Add(Elem.Serialize());
|
||||
}
|
||||
if (m_ElemDimVertList != null && m_ElemDimVertList.Count > 0)
|
||||
{
|
||||
int subAreaMinVert = m_ElemDimVertList.Min(x => x.nSubArea);
|
||||
List<SplitElementDimension> vertList = m_ElemDimVertList.Where(x => x.nSubArea == subAreaMinVert).ToList();
|
||||
foreach (var Elem in vertList.ToList())
|
||||
JsonSplit.ElementDimVertList.Add(Elem.Serialize());
|
||||
}
|
||||
foreach (var Area in AreaList)
|
||||
JsonSplit.AreaList.Add(Area.Serialize(hideHw));
|
||||
return JsonSplit;
|
||||
@@ -636,12 +607,19 @@ namespace WebWindowComplex.Models
|
||||
}
|
||||
else
|
||||
{
|
||||
// Un Elemento per ogni dimensione principale e secondaria
|
||||
//int subArea = 1;
|
||||
//if (!bSplitStartVert)
|
||||
// subArea = 0;
|
||||
//for (int i = 0; i < QtyHoriz; i++)
|
||||
// ElemDimHorizList.Add(new SplitElementDimension(this, i + 1, 78, subArea));
|
||||
// Un Elemento per ogni dimensione principale e per ogni sotto dimensione
|
||||
if (bSplitStartVert)
|
||||
{
|
||||
for(int subArea = 0; subArea <= QtyVert; subArea++)
|
||||
for (int subArea = 0; subArea <= QtyVert; subArea++)
|
||||
{
|
||||
for (int i = 0; i < QtyHoriz; i++)
|
||||
ElemDimHorizList.Add(new SplitElementDimension(this, i + 1, 78, subArea+1));
|
||||
ElemDimHorizList.Add(new SplitElementDimension(this, i + 1, 78, subArea + 1));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -682,6 +660,13 @@ namespace WebWindowComplex.Models
|
||||
}
|
||||
else
|
||||
{
|
||||
// Un Elemento per ogni dimensione principale e secondaria
|
||||
//int subArea = 0;
|
||||
//if (!bSplitStartVert)
|
||||
// subArea = 1;
|
||||
//for (int i = 0; i < QtyVert; i++)
|
||||
// ElemDimVertList.Add(new SplitElementDimension(this, i + 1, 78, subArea));
|
||||
// Un Elemento per ogni dimensione principale e per ogni sotto dimensione
|
||||
if (bSplitStartVert)
|
||||
{
|
||||
for (int i = 0; i < QtyVert; i++)
|
||||
@@ -689,12 +674,12 @@ namespace WebWindowComplex.Models
|
||||
}
|
||||
else
|
||||
{
|
||||
for(int subArea = 0; subArea <= QtyHoriz; subArea++)
|
||||
for (int subArea = 0; subArea <= QtyHoriz; subArea++)
|
||||
{
|
||||
for (int i = 0; i < QtyVert; i++)
|
||||
ElemDimVertList.Add(new SplitElementDimension(this, i+1, 78, subArea + 1));
|
||||
ElemDimVertList.Add(new SplitElementDimension(this, i + 1, 78, subArea + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user