- Aggiunti bottoni aggiuni ed elimina nella tabella
- Joint sash per archi gestiti in automatico di tipo Angled
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using WebWindowComplex.Json;
|
||||
using System.Linq;
|
||||
using WebWindowComplex.Json;
|
||||
using static WebWindowComplex.Json.WindowConst;
|
||||
|
||||
namespace WebWindowComplex.Models
|
||||
@@ -100,9 +101,9 @@ namespace WebWindowComplex.Models
|
||||
public void AddFirstSash()
|
||||
{
|
||||
// Salvo il parent
|
||||
Frame? f = null;
|
||||
if(this is Frame || ParentArea.AreaList.Last().Equals(this))
|
||||
{
|
||||
Frame? f = null;
|
||||
if (this is Frame)
|
||||
f = (Frame)this;
|
||||
else
|
||||
@@ -116,6 +117,21 @@ namespace WebWindowComplex.Models
|
||||
SashArea.SetSelFamilyHardware("");
|
||||
// Inserisco hardware di default
|
||||
SashArea.SetSelHardwareFromId("000000");
|
||||
if(f != null && (f.SelShapeIndex == (int)Shapes.ARC
|
||||
|| f.SelShapeIndex == (int)Shapes.DOUBLEARC
|
||||
|| f.SelShapeIndex == (int)Shapes.ARC_FULL
|
||||
|| f.SelShapeIndex == (int)Shapes.THREECENTERARC))
|
||||
{
|
||||
if(SashArea.SashList.FirstOrDefault() != null)
|
||||
{
|
||||
int joint = SashArea.SashList.FirstOrDefault()!.JointList.Count - 1;
|
||||
SashArea.SashList.FirstOrDefault()!.JointList.ElementAt(joint).SelJointTypeIndex = (int) Joints.ANGLED;
|
||||
}
|
||||
if (SashArea.SashList.LastOrDefault() != null)
|
||||
{
|
||||
SashArea.SashList.LastOrDefault()!.JointList.ElementAt(2).SelJointTypeIndex = (int)Joints.ANGLED;
|
||||
}
|
||||
}
|
||||
//if (ParentWindow.AreaList.First().SelShapeIndex == (int)Shapes.ARC ||
|
||||
// ParentWindow.AreaList.First().SelShapeIndex == (int)Shapes.DOUBLEARC ||
|
||||
// ParentWindow.AreaList.First().SelShapeIndex == (int)Shapes.ARC_FULL ||
|
||||
|
||||
@@ -220,7 +220,7 @@ namespace WebWindowComplex.Models
|
||||
else
|
||||
{
|
||||
for(int i = 0; i < itemList.Count; i++)
|
||||
ans.ElementAt(i).SetDimension(absoluteValue.ElementAt(i) / mcdList.FirstOrDefault());
|
||||
ans.ElementAt(i).SetDimension(Math.Round(absoluteValue.ElementAt(i) / mcdList.FirstOrDefault()));
|
||||
}
|
||||
|
||||
//int inedMin = absoluteValue.IndexOf(absoluteValue.Min());
|
||||
@@ -238,14 +238,14 @@ namespace WebWindowComplex.Models
|
||||
if (absoluteValue.ElementAt(indexArea) <= absoluteValue.ElementAt(i))
|
||||
{
|
||||
var mcd = CalculateMCD(absoluteValue.ElementAt(indexArea), absoluteValue.ElementAt(i));
|
||||
ans.ElementAt(i).SetDimension(absoluteValue.ElementAt(i) / mcd);
|
||||
ans.ElementAt(indexArea).SetDimension(absoluteValue.ElementAt(indexArea) / mcd);
|
||||
ans.ElementAt(i).SetDimension(Math.Round(absoluteValue.ElementAt(i) / mcd));
|
||||
ans.ElementAt(indexArea).SetDimension(Math.Round(absoluteValue.ElementAt(indexArea) / mcd));
|
||||
}
|
||||
else
|
||||
{
|
||||
var mcd = CalculateMCD(absoluteValue.ElementAt(indexArea), absoluteValue.ElementAt(i));
|
||||
ans.ElementAt(i).SetDimension(absoluteValue.ElementAt(i) / mcd);
|
||||
ans.ElementAt(indexArea).SetDimension(absoluteValue.ElementAt(indexArea) / mcd);
|
||||
ans.ElementAt(i).SetDimension(Math.Round(absoluteValue.ElementAt(i) / mcd));
|
||||
ans.ElementAt(indexArea).SetDimension(Math.Round(absoluteValue.ElementAt(indexArea) / mcd));
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -351,11 +351,11 @@ namespace WebWindowComplex.Models
|
||||
if (sumPesi == 0) sumPesi = 1;
|
||||
if (newType.Equals(MeasureTypes.ABSOLUTE))
|
||||
{
|
||||
return res / sumPesi * dDimension;
|
||||
return Math.Round(res / sumPesi * dDimension, 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
return (res / sumPesi * dDimension) / tot * 100;
|
||||
return Math.Round((res / sumPesi * dDimension) / tot * 100);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Egw.Window.Data;
|
||||
using System.ComponentModel.Design;
|
||||
using WebWindowComplex.Json;
|
||||
using static WebWindowComplex.Json.WindowConst;
|
||||
|
||||
@@ -323,6 +324,20 @@ namespace WebWindowComplex.Models
|
||||
JointList.Add(new Joint(this, 2, oldJointType[1].SelJointType));
|
||||
JointList.Add(new Joint(this, 3, Joints.ANGLED));
|
||||
JointList.Add(new Joint(this, 4, Joints.ANGLED));
|
||||
Sash? SashArea = null;
|
||||
if(AreaList.First() is Sash)
|
||||
SashArea = (Sash)AreaList.First();
|
||||
else if (AreaList.First().AreaList.Last().AreaList.First() is Sash)
|
||||
SashArea = (Sash)AreaList.First().AreaList.Last().AreaList.First();
|
||||
if (SashArea != null && SashArea.SashList.FirstOrDefault() != null)
|
||||
{
|
||||
int joint = SashArea.SashList.FirstOrDefault()!.JointList.Count - 1;
|
||||
SashArea.SashList.FirstOrDefault()!.JointList.ElementAt(joint).SelJointTypeIndex = (int)Joints.ANGLED;
|
||||
}
|
||||
if (SashArea != null && SashArea.SashList.LastOrDefault() != null)
|
||||
{
|
||||
SashArea.SashList.LastOrDefault()!.JointList.ElementAt(2).SelJointTypeIndex = (int)Joints.ANGLED;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
+20
-151
@@ -99,157 +99,6 @@ namespace WebWindowComplex.Models
|
||||
}
|
||||
}
|
||||
|
||||
//public int nSashQty
|
||||
//{
|
||||
// get
|
||||
// {
|
||||
// return m_SashList.Count > 0 ? m_SashList.Count : 1;
|
||||
// }
|
||||
// set
|
||||
// {
|
||||
// if (value > 0 && value <= 3)
|
||||
// {
|
||||
// double widthTot = CalculateWidthArea(ParentWindow.AreaList.First(), ParentWindow.AreaList.FirstOrDefault().DimensionList.Where(x => x.sName == "Width").First().dDimension);
|
||||
// if (value > m_SashList.Count)
|
||||
// {
|
||||
// // recupero larghezza ultimo
|
||||
// double dLastDimension = widthTot;
|
||||
// double dNewDimension = widthTot;
|
||||
// if (m_SashList.Count > 0)
|
||||
// {
|
||||
// dLastDimension = m_SashList[m_SashList.Count - 1].dDimension;
|
||||
// dNewDimension = dLastDimension / (value + 1 - nSashQty);
|
||||
// if (m_SashList[m_SashList.Count - 1].MeasureType.Equals(MeasureTypes.PROPORTIONAL))
|
||||
// dNewDimension = 1;
|
||||
// m_SashList[m_SashList.Count - 1].SetDimension(dNewDimension);
|
||||
// }
|
||||
// else
|
||||
// dNewDimension = dLastDimension / (value + 1 - nSashQty);
|
||||
// // aggiungo area Sash di default
|
||||
// for (var SplitIndex = m_SashList.Count; SplitIndex <= value - 1; SplitIndex++)
|
||||
// {
|
||||
// var addSashDim = new SashDimension(dNewDimension, m_SashList[m_SashList.Count - 1].MeasureType, this, SplitIndex + 1);
|
||||
// for(int i = 1; i <= 4; i++)
|
||||
// {
|
||||
// addSashDim.JointList.Add(new Joint(this, i, Joints.FULL_V));
|
||||
// }
|
||||
// SashList.Add(addSashDim);
|
||||
// }
|
||||
// }
|
||||
// else if (value < m_SashList.Count)
|
||||
// {
|
||||
// if (value > 0)
|
||||
// {
|
||||
// double dLastDimension = 0;
|
||||
// SashDimension itemDelete = null;
|
||||
// double deleteDim;
|
||||
// for (var SplitIndex = m_SashList.Count - 1; SplitIndex >= value; SplitIndex += -1)
|
||||
// {
|
||||
// //dLastDimension += m_SashList[SplitIndex].dDimension;
|
||||
// itemDelete = m_SashList[SplitIndex];
|
||||
// SashList.RemoveAt(SplitIndex);
|
||||
// }
|
||||
// if (!itemDelete.SelMeasureType.Equals(m_SashList[SashList.Count - 1].SelMeasureType))
|
||||
// {
|
||||
// AreaDimension ad = new AreaDimension(itemDelete.dDimension, itemDelete.SelMeasureType);
|
||||
// List<AreaDimension> adList = new List<AreaDimension>();
|
||||
// foreach (var it in SashList)
|
||||
// {
|
||||
// adList.Add(new AreaDimension(it.dDimension, it.SelMeasureType));
|
||||
// }
|
||||
// deleteDim = ad.ConvertDimension(adList, itemDelete.SelMeasureType, m_SashList[SashList.Count - 1].SelMeasureType, widthTot, m_SashList.IndexOf(itemDelete));
|
||||
// }
|
||||
// //deleteDim = Convert.ConvertDimension(itemDelete, itemDelete.SelMeasureType, m_SashList[SashList.Count - 1].SelMeasureType, itemDelete.dDimension, widthTot);
|
||||
// else
|
||||
// deleteDim = itemDelete.dDimension;
|
||||
// //dLastDimension += m_SashList[SashList.Count - 1].dDimension;
|
||||
// dLastDimension = deleteDim + m_SashList[SashList.Count - 1].dDimension;
|
||||
// SashList[SashList.Count - 1].SetDimension(dLastDimension);
|
||||
// if (value == 1)
|
||||
// SashList.First().SetHasHandle(true);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// SashList.RemoveAt(0);
|
||||
// }
|
||||
// }
|
||||
// if (m_SashList.Count == 0)
|
||||
// {
|
||||
// Area child = AreaList.First();
|
||||
// // Se nella singola anta ho uno split
|
||||
// if (!(child is Fill))
|
||||
// {
|
||||
// child = child.AreaList.First().AreaList.First();
|
||||
// }
|
||||
// child.SetParentArea(this.ParentArea);
|
||||
// this.ParentArea.AreaList.Remove(this);
|
||||
// this.ParentArea.AreaList.Add(child);
|
||||
// }
|
||||
// // Se ho singola anta
|
||||
// else if (m_SashList.Count == 1)
|
||||
// {
|
||||
// // Metto come padre dell'area nello splitted l'anta stessa
|
||||
// List<Area> ContentArea = new List<Area>();
|
||||
// ContentArea.Add(AreaList.First().AreaList.First());
|
||||
// ContentArea.First().SetParentArea(this);
|
||||
// AreaList.Clear();
|
||||
// AreaList.Add(ContentArea.First());
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // Se aggiungo ante
|
||||
// if (SashList.Count > AreaList.Count)
|
||||
// {
|
||||
// List<Area> ContentArea = new List<Area>();
|
||||
// // Salvo in ContentArea il sottoalbero delle singole aree che mantengo
|
||||
// if (AreaList.Count >= 1 & SashList.Count > AreaList.Count)
|
||||
// {
|
||||
// foreach (Area area in AreaList)
|
||||
// {
|
||||
// if (area is Splitted)
|
||||
// ContentArea.Add(area.AreaList.First());
|
||||
// else
|
||||
// ContentArea.Add(area);
|
||||
// }
|
||||
// AreaList.Clear();
|
||||
// }
|
||||
// for (int SplitIndex = AreaList.Count; SplitIndex <= SashList.Count - 1; SplitIndex++)
|
||||
// {
|
||||
// AreaList.Add(Splitted.CreateSplitted(this));
|
||||
// }
|
||||
// // Riaggiungo i sottoalberi che avevo salvato
|
||||
// for (int i = 0; i < AreaList.Count - 1; i++)
|
||||
// {
|
||||
// if (AreaList.Count == 2)
|
||||
// {
|
||||
// ContentArea[i].SetParentArea(AreaList[i]);
|
||||
// }
|
||||
// AreaList[i].AreaList.Add(ContentArea[i]);
|
||||
// }
|
||||
// // Aggiungo all'ultimo Splitted l'area di vetro
|
||||
// Fill newFill = Fill.CreateFill(AreaList[1], FillTypes.GLASS);
|
||||
// newFill.SetAreaType(AreaTypes.FILL);
|
||||
// AreaList[AreaList.Count - 1].AreaList.Add(newFill);
|
||||
// }
|
||||
// // Se tolgo anta
|
||||
// else
|
||||
// {
|
||||
// for (int SplitIndex = SashList.Count; SplitIndex <= AreaList.Count() - 1; SplitIndex++)
|
||||
// {
|
||||
// AreaList.Remove(AreaList[AreaList.Count - 1]);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// for (int i = 0; i < AreaList.Count; i++)
|
||||
// AreaList.ElementAt(i).SearchAreaList(AreaList.ElementAt(i), SashList.ElementAt(i).dDimension, "Width");
|
||||
// }
|
||||
// RefreshHardwareList();
|
||||
// ClearHardwareOptionList();
|
||||
// SetFirstHardware();
|
||||
// }
|
||||
//}
|
||||
|
||||
public int nSashQty
|
||||
{
|
||||
get
|
||||
@@ -307,6 +156,16 @@ namespace WebWindowComplex.Models
|
||||
}
|
||||
SashList.Add(addSashDim);
|
||||
}
|
||||
if (frame != null && (frame.SelShapeIndex == (int)Shapes.ARC
|
||||
|| frame.SelShapeIndex == (int)Shapes.DOUBLEARC
|
||||
|| frame.SelShapeIndex == (int)Shapes.ARC_FULL
|
||||
|| frame.SelShapeIndex == (int)Shapes.THREECENTERARC))
|
||||
{
|
||||
if (SashList.ElementAt(value - 2) != null)
|
||||
SashList.ElementAt(value - 2)!.JointList.ElementAt(2).SelJointTypeIndex = (int)Joints.FULL_V;
|
||||
if (SashList.LastOrDefault() != null)
|
||||
SashList.LastOrDefault()!.JointList.ElementAt(2).SelJointTypeIndex = (int)Joints.ANGLED;
|
||||
}
|
||||
}
|
||||
else if (value < m_SashList.Count)
|
||||
{
|
||||
@@ -356,6 +215,16 @@ namespace WebWindowComplex.Models
|
||||
{
|
||||
SashList.RemoveAt(0);
|
||||
}
|
||||
if (frame != null && (frame.SelShapeIndex == (int)Shapes.ARC
|
||||
|| frame.SelShapeIndex == (int)Shapes.DOUBLEARC
|
||||
|| frame.SelShapeIndex == (int)Shapes.ARC_FULL
|
||||
|| frame.SelShapeIndex == (int)Shapes.THREECENTERARC))
|
||||
{
|
||||
if (SashList.LastOrDefault() != null)
|
||||
{
|
||||
SashList.LastOrDefault()!.JointList.ElementAt(2).SelJointTypeIndex = (int)Joints.ANGLED;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (m_SashList.Count == 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user