- aggiunta visualizzazione svg in tabella template
- gestione oggetti sottostanti il template selezionato per interfaccia
This commit is contained in:
@@ -10,7 +10,7 @@ namespace WebWindowConfigurator.DTO
|
||||
{
|
||||
public int Index { get; set; } = 0;
|
||||
public string Description { get; set; } = "";
|
||||
public string TemplFile { get; set; } = "";
|
||||
public string TemplSVG { get; set; } = "";
|
||||
public string JwdFileName { get; set; } = "";
|
||||
public string SVGFileName { get; set; } = "";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,12 +37,12 @@ namespace WebWindowConfigurator
|
||||
}
|
||||
}
|
||||
|
||||
public Template(int nIndex, string sDescription, string JWD, string SVG)
|
||||
public Template(int nIndex, string sDescription, string SVG, string JWD)
|
||||
{
|
||||
m_nIndex = nIndex;
|
||||
this.sDescription = sDescription;
|
||||
m_JWD = JWD;
|
||||
m_SVG = SVG;
|
||||
m_JWD = JWD;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,11 +58,11 @@
|
||||
<div class="alert alert-light text-center display-4">
|
||||
@if (currStep == CompileStep.Template)
|
||||
{
|
||||
<table class="table table-hover">
|
||||
<table class="table table-hover align-middle">
|
||||
<thead class="table-light fs-5">
|
||||
<tr>
|
||||
<th scope="col">#</th>
|
||||
<th scope="col">Image</th>
|
||||
<th scope="col" class="col-4">Image</th>
|
||||
<th scope="col" class="text-start">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -74,9 +74,9 @@
|
||||
colorClass = "table-success";
|
||||
else
|
||||
colorClass = "";
|
||||
<tr class="@colorClass" @onclick="() => DoSelect(item)">
|
||||
<tr style="height: 150px;" class="@colorClass" @onclick="() => DoSelect(item)">
|
||||
<td>@item.Index</td>
|
||||
<td>@item.TemplSVG</td>
|
||||
<td><img class="img-fluid" width="100" src="@item.SVGFileName" /></td>
|
||||
<td class="text-start">@item.Description</td>
|
||||
</tr>
|
||||
}
|
||||
@@ -91,8 +91,8 @@
|
||||
<div class="col-6">
|
||||
<div class="alert alert-light text-start p-1 display-4 w-50">
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text" for="inputGroupSelect01">Shape</label>
|
||||
<select class="form-select" @bind="@m_frame.SelShapeIndex">
|
||||
<label class="input-group-text" for="FrameShape">Shape</label>
|
||||
<select class="form-select" @bind="@m_Frame.SelShapeIndex">
|
||||
<option value="0">Rettangolo</option>
|
||||
<option value="1">Right Chamfer</option>
|
||||
<option value="2">Left Chamfer</option>
|
||||
@@ -106,11 +106,11 @@
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5 class="card-title">Dimensioni</h5>
|
||||
@foreach (FrameDimension dimension in m_frame.DimensionList)
|
||||
@foreach (FrameDimension dimension in m_Frame.DimensionList)
|
||||
{
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text" id="basic-addon1">@dimension.nIndex</span>
|
||||
<span class="input-group-text" id="basic-addon2">@dimension.sName</span>
|
||||
<span class="input-group-text" id="IndexDimFrame">@dimension.nIndex</span>
|
||||
<span class="input-group-text" id="NameDimFrame">@dimension.sName</span>
|
||||
<input type="number" class="form-control" aria-label="@dimension.dValue" @bind="@dimension.dValue">
|
||||
</div>
|
||||
}
|
||||
@@ -119,10 +119,10 @@
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5 class="card-title">Giunzioni telaio</h5>
|
||||
@foreach (Joint joint in m_frame.JointList)
|
||||
@foreach (Joint joint in m_Frame.JointList)
|
||||
{
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text" for="inputGroupSelect02">@joint.nIndex</label>
|
||||
<label class="input-group-text" for="IndexJoint">@joint.nIndex</label>
|
||||
<select class="form-select" @bind="@joint.SelJointTypeIndex">
|
||||
<option value="0">Angled</option>
|
||||
<option value="1">Full H</option>
|
||||
@@ -137,15 +137,15 @@
|
||||
<h5 class="card-title">Bottom rail</h5>
|
||||
<div class="d-flex justify-content-start fs-5 mb-2">
|
||||
<div class="px-1">
|
||||
<input class="form-check-input ml-auto" type="checkbox" name="BottomRail" id="BottomRail" @bind="@m_frame.BottomRail">
|
||||
<input class="form-check-input ml-auto" type="checkbox" name="BottomRail" id="BottomRail" @bind="@m_Frame.BottomRail">
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<label class="form-check-label fs-6 text-dark" for="checkDefault">BottomRail</label>
|
||||
<label class="form-check-label fs-6 text-dark" for="BottomRailLabel">BottomRail</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text" id="basic-addon1">Quantità</span>
|
||||
<input type="number" class="form-control" aria-label="BottomRailQty" @bind="@m_frame.BottomRailQty">
|
||||
<span class="input-group-text" id="BottomRailQty">Quantità</span>
|
||||
<input type="number" class="form-control" aria-label="BottomRailQty" @bind="@m_Frame.BottomRailQty">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -153,23 +153,123 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
@m_SelSVG
|
||||
@*img*@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else if (currStep == CompileStep.Split)
|
||||
{
|
||||
<div class="alert alert-info text-center display-4">
|
||||
aggiungi montanti
|
||||
@* <button class="btn btn-sm btn-primary" title="Reset selezione" @onclick="DoReset"><i class="fa-solid fa-arrow-rotate-right"></i></button> *@
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<div class="alert alert-light text-start p-1 display-4 w-75">
|
||||
@foreach(var item in SplitList)
|
||||
{
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text" id="basic-addon1Split">Numero</span>
|
||||
<input type="number" class="form-control" placeholder="0" aria-label="basic-addon1Split" @bind="@item.nSplitQty">
|
||||
</div>
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text" for="basic-addon2Split">Shape</label>
|
||||
<select class="form-select" @bind="@item.SelSplitShapeIndex">
|
||||
<option value="0">Vertical</option>
|
||||
<option value="1">Horizontal</option>
|
||||
<option value="2">Grid</option>
|
||||
<option value="3">Custom</option>
|
||||
</select>
|
||||
</div>
|
||||
@foreach (var dim in item.SplitPositionList)
|
||||
{
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text" id="basic-addon3Split">Altezza area inferiore</span>
|
||||
<input type="number" class="form-control" aria-label="basic-addon2Split" @bind="@dim.dDimension">
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@* <button class="btn btn-sm btn-primary" title="Reset selezione" @onclick="DoReset"><i class="fa-solid fa-arrow-rotate-right"></i></button> *@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
@*img*@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else if (currStep == CompileStep.Sash)
|
||||
{
|
||||
<div class="alert alert-info text-center display-4">
|
||||
aggiungi caratteristiche finestra
|
||||
@* <button class="btn btn-sm btn-primary" title="Reset selezione" @onclick="DoReset"><i class="fa-solid fa-arrow-rotate-right"></i></button> *@
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<div class="alert alert-light text-start p-1 display-4 w-50">
|
||||
@foreach (var item in SashList)
|
||||
{
|
||||
<div class="input-group mb-2">
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text" id="NumberSash">Numero</span>
|
||||
<input type="number" class="form-control" aria-label="NumberSash" @bind="@item.nSashQty">
|
||||
</div>
|
||||
</div>
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5 class="card-title">Orientamento</h5>
|
||||
<div class="form-check fs-5">
|
||||
<input class="form-check-input" type="radio" name="OrientamSash" id="VerticalSash" value="option1" checked>
|
||||
<label class="form-check-label" for="VerticalSash">Vertical</label>
|
||||
</div>
|
||||
<div class="form-check fs-5">
|
||||
<input class="form-check-input" type="radio" name="OrientamSash" id="HorizontalSash" value="option2">
|
||||
<label class="form-check-label" for="HorizontalSash">Horizontal</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5 class="card-title">Giunzioni ante</h5>
|
||||
@foreach (Joint joint in item.JointList)
|
||||
{
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text" for="IndexJoint">@joint.nIndex</label>
|
||||
<select class="form-select" @bind="@joint.SelJointTypeIndex">
|
||||
<option value="0">Angled</option>
|
||||
<option value="1">Full H</option>
|
||||
<option value="2">Full V</option>
|
||||
</select>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5 class="card-title">Bottom rail</h5>
|
||||
<div class="d-flex justify-content-start fs-5 mb-2">
|
||||
<div class="px-1">
|
||||
<input class="form-check-input ml-auto" type="checkbox" name="BottomRail" id="BottomRail" @bind="@item.BottomRail">
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<label class="form-check-label fs-6 text-dark" for="BottomRailLabel">BottomRail</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text" id="BottomRailQty">Quantità</span>
|
||||
<input type="number" class="form-control" aria-label="BottomRailQty" @bind="@item.BottomRailQty">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@* <button class="btn btn-sm btn-primary" title="Reset selezione" @onclick="DoReset"><i class="fa-solid fa-arrow-rotate-right"></i></button> *@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
@* img *@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else if (currStep == CompileStep.Fill)
|
||||
@@ -231,7 +331,7 @@
|
||||
@if (currStep == CompileStep.General)
|
||||
{
|
||||
<div class="alert alert-light text-center displa y-4">
|
||||
@foreach (FrameDimension dimension in m_frame.DimensionList)
|
||||
@foreach (FrameDimension dimension in m_Frame.DimensionList)
|
||||
{
|
||||
<div class="input-group mb-3 w-25">
|
||||
<span class="input-group-text" id="basic-addon1">@dimension.nIndex</span>
|
||||
|
||||
@@ -36,6 +36,7 @@ namespace WebWindowConfigurator
|
||||
m_SelTemplate = value;
|
||||
JsonWindow WindowFromJson = JsonConvert.DeserializeObject<JsonWindow>(m_SelTemplate.JWD, new PolymorphicJsonConverter());
|
||||
m_CurrWindow = WindowFromJson.Deserialize();
|
||||
SearchInAreaList(m_CurrWindow.AreaList[0]);
|
||||
m_SelSVG = m_SelTemplate.SVG;
|
||||
}
|
||||
}
|
||||
@@ -46,7 +47,6 @@ namespace WebWindowConfigurator
|
||||
|
||||
public TemplateSelectDTO? SelTemplateDTO { get; set; } = null;
|
||||
|
||||
public Area m_SelArea { get; set; } = null!;
|
||||
public string m_SelSVG { get; set; } = "";
|
||||
|
||||
#endregion Public Properties
|
||||
@@ -66,9 +66,11 @@ namespace WebWindowConfigurator
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
protected Frame m_frame
|
||||
private Frame m_Frame;
|
||||
protected Frame Frame
|
||||
{
|
||||
get => (Frame)m_CurrWindow.AreaList[0];
|
||||
get => m_Frame;
|
||||
set => m_Frame = value;
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
@@ -116,6 +118,56 @@ namespace WebWindowConfigurator
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private List<Sash> m_SashList = new List<Sash>();
|
||||
public List<Sash> SashList
|
||||
{
|
||||
get => m_SashList;
|
||||
}
|
||||
private List<Fill> m_FillList = new List<Fill>();
|
||||
public List<Fill> FillList
|
||||
{
|
||||
get => m_FillList;
|
||||
}
|
||||
private List<Split> m_SplitList = new List<Split>();
|
||||
public List<Split> SplitList
|
||||
{
|
||||
get => m_SplitList;
|
||||
}
|
||||
|
||||
public void SearchInAreaList(Area node)
|
||||
{
|
||||
if (node != null)
|
||||
{
|
||||
switch (node.AreaType)
|
||||
{
|
||||
case AreaTypes.FRAME:
|
||||
{
|
||||
m_Frame = (Frame)node;
|
||||
break;
|
||||
}
|
||||
case AreaTypes.SASH:
|
||||
{
|
||||
m_SashList.Add((Sash)node);
|
||||
break;
|
||||
}
|
||||
case AreaTypes.FILL:
|
||||
{
|
||||
m_FillList.Add((Fill)node);
|
||||
break;
|
||||
}
|
||||
case AreaTypes.SPLIT:
|
||||
{
|
||||
m_SplitList.Add((Split)node);
|
||||
break;
|
||||
}
|
||||
}
|
||||
foreach (var item in node.AreaList)
|
||||
{
|
||||
SearchInAreaList(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void AdvStep(CompileStep newStep)
|
||||
{
|
||||
currStep = newStep;
|
||||
|
||||
+244
-244
@@ -129,38 +129,145 @@ namespace WebWindowConfigurator
|
||||
new IdNameStruct((int)Shapes.DOUBLEARC, "Double Arc"),
|
||||
new IdNameStruct((int)Shapes.TRIANGLE, "Triangle")
|
||||
};
|
||||
public ObservableCollection<IdNameStruct> ShapeList
|
||||
{
|
||||
get
|
||||
public ObservableCollection<IdNameStruct> ShapeList
|
||||
{
|
||||
return m_ShapeList;
|
||||
get
|
||||
{
|
||||
return m_ShapeList;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Shapes m_Shape;
|
||||
public Shapes Shape
|
||||
{
|
||||
get
|
||||
private Shapes m_Shape;
|
||||
public Shapes Shape
|
||||
{
|
||||
return m_Shape;
|
||||
get
|
||||
{
|
||||
return m_Shape;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int SelShapeIndex
|
||||
{
|
||||
get
|
||||
public int SelShapeIndex
|
||||
{
|
||||
return IdNameStruct.IndFromId((int)m_Shape, m_ShapeList);
|
||||
get
|
||||
{
|
||||
return IdNameStruct.IndFromId((int)m_Shape, m_ShapeList);
|
||||
}
|
||||
set
|
||||
{
|
||||
Shapes SelShape = (Shapes)IdNameStruct.IdFromInd(value, m_ShapeList);
|
||||
if (m_Shape != SelShape)
|
||||
{
|
||||
// verifico parametri Dimension
|
||||
DimensionList.Clear();
|
||||
// aggiungo Dimensioni
|
||||
switch (SelShape)
|
||||
{
|
||||
case Shapes.RECTANGLE:
|
||||
case Shapes.ARC_FULL:
|
||||
{
|
||||
DimensionList.Add(new FrameDimension(1, "Width", 1500, true));
|
||||
DimensionList.Add(new FrameDimension(2, "Height", 1800, true));
|
||||
break;
|
||||
}
|
||||
|
||||
case Shapes.RIGHTCHAMFER:
|
||||
{
|
||||
DimensionList.Add(new FrameDimension(1, "Width", 1500, true));
|
||||
DimensionList.Add(new FrameDimension(2, "Left Height", 1800, true));
|
||||
DimensionList.Add(new FrameDimension(3, "Right Height", 1500, true));
|
||||
break;
|
||||
}
|
||||
|
||||
case Shapes.LEFTCHAMFER:
|
||||
{
|
||||
DimensionList.Add(new FrameDimension(1, "Width", 1500, true));
|
||||
DimensionList.Add(new FrameDimension(2, "Left Height", 1500, true));
|
||||
DimensionList.Add(new FrameDimension(3, "Right Height", 1800, true));
|
||||
break;
|
||||
}
|
||||
|
||||
case Shapes.DOUBLECHAMFER:
|
||||
case Shapes.ARC:
|
||||
{
|
||||
DimensionList.Add(new FrameDimension(1, "Width", 1500, true));
|
||||
DimensionList.Add(new FrameDimension(2, "Height", 1500, true));
|
||||
DimensionList.Add(new FrameDimension(3, "Full Height", 1800, true));
|
||||
break;
|
||||
}
|
||||
|
||||
case Shapes.DOUBLEARC:
|
||||
{
|
||||
DimensionList.Add(new FrameDimension(1, "Width", 1500, true));
|
||||
DimensionList.Add(new FrameDimension(2, "Height", 1500, true));
|
||||
DimensionList.Add(new FrameDimension(3, "Full Height", 2400, true));
|
||||
break;
|
||||
}
|
||||
|
||||
case Shapes.TRIANGLE:
|
||||
{
|
||||
DimensionList.Add(new FrameDimension(1, "Width", 2000, true));
|
||||
DimensionList.Add(new FrameDimension(2, "Height", 1500, true));
|
||||
DimensionList.Add(new FrameDimension(3, "Height projection", 0, true));
|
||||
break;
|
||||
}
|
||||
|
||||
case Shapes.CUSTOM:
|
||||
{
|
||||
DimensionList.Clear();
|
||||
break;
|
||||
}
|
||||
}
|
||||
// aggiungo Joint
|
||||
m_JointList.Clear();
|
||||
switch (SelShape)
|
||||
{
|
||||
case Shapes.RECTANGLE:
|
||||
case Shapes.RIGHTCHAMFER:
|
||||
case Shapes.LEFTCHAMFER:
|
||||
case Shapes.DOUBLECHAMFER:
|
||||
case Shapes.ARC:
|
||||
case Shapes.DOUBLEARC:
|
||||
{
|
||||
JointList.Add(new Joint(1, Joints.FULL_H));
|
||||
JointList.Add(new Joint(2, Joints.FULL_H));
|
||||
JointList.Add(new Joint(3, Joints.FULL_H));
|
||||
JointList.Add(new Joint(4, Joints.FULL_H));
|
||||
break;
|
||||
}
|
||||
|
||||
case Shapes.ARC_FULL:
|
||||
{
|
||||
JointList.Add(new Joint(1, Joints.FULL_H));
|
||||
JointList.Add(new Joint(2, Joints.FULL_H));
|
||||
JointList.Add(new Joint(3, Joints.ANGLED));
|
||||
JointList.Add(new Joint(4, Joints.ANGLED));
|
||||
break;
|
||||
}
|
||||
|
||||
case Shapes.TRIANGLE:
|
||||
{
|
||||
JointList.Add(new Joint(1, Joints.FULL_H));
|
||||
JointList.Add(new Joint(2, Joints.FULL_H));
|
||||
JointList.Add(new Joint(3, Joints.ANGLED));
|
||||
break;
|
||||
}
|
||||
|
||||
case Shapes.CUSTOM:
|
||||
{
|
||||
JointList.Clear();
|
||||
break;
|
||||
}
|
||||
}
|
||||
m_Shape = SelShape;
|
||||
}
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
Shapes SelShape = (Shapes)IdNameStruct.IdFromInd(value, m_ShapeList);
|
||||
if (m_Shape != SelShape)
|
||||
{
|
||||
// verifico parametri Dimension
|
||||
|
||||
internal void SetSelShape(Shapes Value)
|
||||
{
|
||||
DimensionList.Clear();
|
||||
// aggiungo Dimensioni
|
||||
switch (SelShape)
|
||||
// aggiungo Dimension
|
||||
switch (Value)
|
||||
{
|
||||
case Shapes.RECTANGLE:
|
||||
case Shapes.ARC_FULL:
|
||||
@@ -218,8 +325,8 @@ namespace WebWindowConfigurator
|
||||
}
|
||||
}
|
||||
// aggiungo Joint
|
||||
m_JointList.Clear();
|
||||
switch (SelShape)
|
||||
int nJointQty = 4;
|
||||
switch (Value)
|
||||
{
|
||||
case Shapes.RECTANGLE:
|
||||
case Shapes.RIGHTCHAMFER:
|
||||
@@ -258,263 +365,156 @@ namespace WebWindowConfigurator
|
||||
break;
|
||||
}
|
||||
}
|
||||
m_Shape = SelShape;
|
||||
m_Shape = Value;
|
||||
}
|
||||
|
||||
private ObservableCollection<FrameDimension> m_DimensionList = new ObservableCollection<FrameDimension>();
|
||||
public ObservableCollection<FrameDimension> DimensionList
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_DimensionList;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal void SetSelShape(Shapes Value)
|
||||
|
||||
private ObservableCollection<Joint> m_JointList = new ObservableCollection<Joint>();
|
||||
public ObservableCollection<Joint> JointList
|
||||
{
|
||||
DimensionList.Clear();
|
||||
// aggiungo Dimension
|
||||
switch (Value)
|
||||
get
|
||||
{
|
||||
return m_JointList;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_JointList = value;
|
||||
}
|
||||
}
|
||||
|
||||
private bool m_bBottomRail;
|
||||
public bool BottomRail
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_bBottomRail;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_bBottomRail = value;
|
||||
}
|
||||
}
|
||||
internal void SetBottomRail(bool bBottomRail)
|
||||
{
|
||||
m_bBottomRail = bBottomRail;
|
||||
}
|
||||
|
||||
private int m_nBottomRailQty = 0;
|
||||
public int BottomRailQty
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_nBottomRailQty;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_nBottomRailQty = value;
|
||||
}
|
||||
}
|
||||
internal void SetBottomRailQty(int nBottomRailQty)
|
||||
{
|
||||
m_nBottomRailQty = nBottomRailQty;
|
||||
}
|
||||
|
||||
private ObservableCollection<Curve> m_Outline;
|
||||
public ObservableCollection<Curve> Outline
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Outline;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Outline = value;
|
||||
}
|
||||
}
|
||||
|
||||
public Frame(Area ParentArea) : base(ParentArea)
|
||||
{
|
||||
}
|
||||
|
||||
internal static Area CreateFrame(Window Window)
|
||||
{
|
||||
Frame NewFrame = new Frame(null/* TODO Change to default(_) if this is not a reference type */);
|
||||
NewFrame.SetAreaType(AreaTypes.FRAME);
|
||||
NewFrame.SetSelShape(Shapes.RECTANGLE);
|
||||
NewFrame.SetBottomRail(false);
|
||||
NewFrame.SetBottomRailQty(0);
|
||||
return NewFrame;
|
||||
}
|
||||
|
||||
private LuaShapes ConvertShape(Shapes value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case Shapes.RECTANGLE:
|
||||
case Shapes.ARC_FULL:
|
||||
{
|
||||
DimensionList.Add(new FrameDimension(1, "Width", 1500, true));
|
||||
DimensionList.Add(new FrameDimension(2, "Height", 1800, true));
|
||||
break;
|
||||
return LuaShapes.RECT;
|
||||
}
|
||||
|
||||
case Shapes.RIGHTCHAMFER:
|
||||
{
|
||||
DimensionList.Add(new FrameDimension(1, "Width", 1500, true));
|
||||
DimensionList.Add(new FrameDimension(2, "Left Height", 1800, true));
|
||||
DimensionList.Add(new FrameDimension(3, "Right Height", 1500, true));
|
||||
break;
|
||||
return LuaShapes.CHAMFER_SIDE;
|
||||
}
|
||||
|
||||
case Shapes.LEFTCHAMFER:
|
||||
{
|
||||
DimensionList.Add(new FrameDimension(1, "Width", 1500, true));
|
||||
DimensionList.Add(new FrameDimension(2, "Left Height", 1500, true));
|
||||
DimensionList.Add(new FrameDimension(3, "Right Height", 1800, true));
|
||||
break;
|
||||
return LuaShapes.CHAMFER_SIDE;
|
||||
}
|
||||
|
||||
case Shapes.DOUBLECHAMFER:
|
||||
{
|
||||
return LuaShapes.CHAMFER;
|
||||
}
|
||||
|
||||
case Shapes.ARC:
|
||||
{
|
||||
DimensionList.Add(new FrameDimension(1, "Width", 1500, true));
|
||||
DimensionList.Add(new FrameDimension(2, "Height", 1500, true));
|
||||
DimensionList.Add(new FrameDimension(3, "Full Height", 1800, true));
|
||||
break;
|
||||
}
|
||||
|
||||
case Shapes.DOUBLEARC:
|
||||
{
|
||||
DimensionList.Add(new FrameDimension(1, "Width", 1500, true));
|
||||
DimensionList.Add(new FrameDimension(2, "Height", 1500, true));
|
||||
DimensionList.Add(new FrameDimension(3, "Full Height", 2400, true));
|
||||
break;
|
||||
}
|
||||
|
||||
case Shapes.TRIANGLE:
|
||||
{
|
||||
DimensionList.Add(new FrameDimension(1, "Width", 2000, true));
|
||||
DimensionList.Add(new FrameDimension(2, "Height", 1500, true));
|
||||
DimensionList.Add(new FrameDimension(3, "Height projection", 0, true));
|
||||
break;
|
||||
}
|
||||
|
||||
case Shapes.CUSTOM:
|
||||
{
|
||||
DimensionList.Clear();
|
||||
break;
|
||||
}
|
||||
}
|
||||
// aggiungo Joint
|
||||
int nJointQty = 4;
|
||||
switch (Value)
|
||||
{
|
||||
case Shapes.RECTANGLE:
|
||||
case Shapes.RIGHTCHAMFER:
|
||||
case Shapes.LEFTCHAMFER:
|
||||
case Shapes.DOUBLECHAMFER:
|
||||
case Shapes.ARC:
|
||||
case Shapes.DOUBLEARC:
|
||||
{
|
||||
JointList.Add(new Joint(1, Joints.FULL_H));
|
||||
JointList.Add(new Joint(2, Joints.FULL_H));
|
||||
JointList.Add(new Joint(3, Joints.FULL_H));
|
||||
JointList.Add(new Joint(4, Joints.FULL_H));
|
||||
break;
|
||||
return LuaShapes.SEGMENTAL_ARC;
|
||||
}
|
||||
|
||||
case Shapes.ARC_FULL:
|
||||
{
|
||||
JointList.Add(new Joint(1, Joints.FULL_H));
|
||||
JointList.Add(new Joint(2, Joints.FULL_H));
|
||||
JointList.Add(new Joint(3, Joints.ANGLED));
|
||||
JointList.Add(new Joint(4, Joints.ANGLED));
|
||||
break;
|
||||
return LuaShapes.ROUND_ARC;
|
||||
}
|
||||
|
||||
case Shapes.DOUBLEARC:
|
||||
{
|
||||
return LuaShapes.POINTED_ARC;
|
||||
}
|
||||
|
||||
case Shapes.TRIANGLE:
|
||||
{
|
||||
JointList.Add(new Joint(1, Joints.FULL_H));
|
||||
JointList.Add(new Joint(2, Joints.FULL_H));
|
||||
JointList.Add(new Joint(3, Joints.ANGLED));
|
||||
break;
|
||||
return LuaShapes.TRIANGLE;
|
||||
}
|
||||
|
||||
case Shapes.CUSTOM:
|
||||
default:
|
||||
{
|
||||
JointList.Clear();
|
||||
break;
|
||||
return LuaShapes.RECT;
|
||||
}
|
||||
}
|
||||
m_Shape = Value;
|
||||
}
|
||||
|
||||
private ObservableCollection<FrameDimension> m_DimensionList = new ObservableCollection<FrameDimension>();
|
||||
public ObservableCollection<FrameDimension> DimensionList
|
||||
{
|
||||
get
|
||||
internal override JsonArea Serialize()
|
||||
{
|
||||
return m_DimensionList;
|
||||
JsonFrame JsonFrame = new JsonFrame(m_Shape, m_bBottomRail, m_nBottomRailQty);
|
||||
foreach (var Dimension in DimensionList)
|
||||
JsonFrame.DimensionList.Add(Dimension.Serialize());
|
||||
foreach (var Joint in JointList)
|
||||
JsonFrame.JointList.Add(Joint.Serialize());
|
||||
foreach (var Area in AreaList)
|
||||
JsonFrame.AreaList.Add(Area.Serialize());
|
||||
return JsonFrame;
|
||||
}
|
||||
}
|
||||
|
||||
private ObservableCollection<Joint> m_JointList = new ObservableCollection<Joint>();
|
||||
public ObservableCollection<Joint> JointList
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_JointList;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_JointList = value;
|
||||
}
|
||||
}
|
||||
|
||||
private bool m_bBottomRail;
|
||||
public bool BottomRail
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_bBottomRail;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_bBottomRail = value;
|
||||
}
|
||||
}
|
||||
internal void SetBottomRail(bool bBottomRail)
|
||||
{
|
||||
m_bBottomRail = bBottomRail;
|
||||
}
|
||||
|
||||
private int m_nBottomRailQty = 0;
|
||||
public int BottomRailQty
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_nBottomRailQty;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_nBottomRailQty = value;
|
||||
}
|
||||
}
|
||||
internal void SetBottomRailQty(int nBottomRailQty)
|
||||
{
|
||||
m_nBottomRailQty = nBottomRailQty;
|
||||
}
|
||||
|
||||
private ObservableCollection<Curve> m_Outline;
|
||||
public ObservableCollection<Curve> Outline
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Outline;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Outline = value;
|
||||
}
|
||||
}
|
||||
|
||||
public Frame(Area ParentArea) : base(ParentArea)
|
||||
{
|
||||
}
|
||||
|
||||
internal static Area CreateFrame(Window Window)
|
||||
{
|
||||
Frame NewFrame = new Frame(null/* TODO Change to default(_) if this is not a reference type */);
|
||||
NewFrame.SetAreaType(AreaTypes.FRAME);
|
||||
NewFrame.SetSelShape(Shapes.RECTANGLE);
|
||||
NewFrame.SetBottomRail(false);
|
||||
NewFrame.SetBottomRailQty(0);
|
||||
return NewFrame;
|
||||
}
|
||||
|
||||
private LuaShapes ConvertShape(Shapes value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case Shapes.RECTANGLE:
|
||||
{
|
||||
return LuaShapes.RECT;
|
||||
}
|
||||
|
||||
case Shapes.RIGHTCHAMFER:
|
||||
{
|
||||
return LuaShapes.CHAMFER_SIDE;
|
||||
}
|
||||
|
||||
case Shapes.LEFTCHAMFER:
|
||||
{
|
||||
return LuaShapes.CHAMFER_SIDE;
|
||||
}
|
||||
|
||||
case Shapes.DOUBLECHAMFER:
|
||||
{
|
||||
return LuaShapes.CHAMFER;
|
||||
}
|
||||
|
||||
case Shapes.ARC:
|
||||
{
|
||||
return LuaShapes.SEGMENTAL_ARC;
|
||||
}
|
||||
|
||||
case Shapes.ARC_FULL:
|
||||
{
|
||||
return LuaShapes.ROUND_ARC;
|
||||
}
|
||||
|
||||
case Shapes.DOUBLEARC:
|
||||
{
|
||||
return LuaShapes.POINTED_ARC;
|
||||
}
|
||||
|
||||
case Shapes.TRIANGLE:
|
||||
{
|
||||
return LuaShapes.TRIANGLE;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
return LuaShapes.RECT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal override JsonArea Serialize()
|
||||
{
|
||||
JsonFrame JsonFrame = new JsonFrame(m_Shape, m_bBottomRail, m_nBottomRailQty);
|
||||
foreach (var Dimension in DimensionList)
|
||||
JsonFrame.DimensionList.Add(Dimension.Serialize());
|
||||
foreach (var Joint in JointList)
|
||||
JsonFrame.JointList.Add(Joint.Serialize());
|
||||
foreach (var Area in AreaList)
|
||||
JsonFrame.AreaList.Add(Area.Serialize());
|
||||
return JsonFrame;
|
||||
}
|
||||
}
|
||||
|
||||
public class Sash : Area
|
||||
{
|
||||
public int nSashQty
|
||||
|
||||
Reference in New Issue
Block a user