- Eliminate classi non usate
- Eliminato Componente di Test
This commit is contained in:
@@ -3,9 +3,10 @@
|
||||
|
||||
<PageTitle>TestComponent</PageTitle>
|
||||
|
||||
<WebTest IN_TemplateDTOList="@AvailTemplateList"
|
||||
@* <WebTest IN_TemplateDTOList="@AvailTemplateList"
|
||||
IN_SelTemplate="@SelTemplate"
|
||||
EC_OnUpdate="SaveJWD"
|
||||
EC_OnSelectedTemplate="SetTemplate"
|
||||
LiveSVG="@currSvg">
|
||||
</WebTest>
|
||||
*@
|
||||
@@ -515,52 +515,6 @@ namespace WebWindowComplex.Json
|
||||
}
|
||||
}
|
||||
|
||||
public class JsonCurve
|
||||
{
|
||||
private GDB_TY m_CurveType;
|
||||
[JsonProperty]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public GDB_TY CurveType
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_CurveType;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_CurveType = value;
|
||||
}
|
||||
}
|
||||
|
||||
private Point3d m_ptStart;
|
||||
[JsonProperty]
|
||||
public Point3d ptStart
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_ptStart;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_ptStart = value;
|
||||
}
|
||||
}
|
||||
|
||||
private Point3d m_ptEnd;
|
||||
[JsonProperty]
|
||||
public Point3d ptEnd
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_ptEnd;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_ptEnd = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class JsonFrameDimension
|
||||
{
|
||||
private int m_nIndex;
|
||||
|
||||
@@ -110,25 +110,6 @@ namespace WebWindowComplex.Json
|
||||
HORIZONTAL = 2
|
||||
}
|
||||
|
||||
public enum GDB_TY
|
||||
{
|
||||
NONE = 0,
|
||||
GROUP = 2,
|
||||
GEO_VECTOR = 128,
|
||||
GEO_POINT = 129,
|
||||
GEO_FRAME = 130,
|
||||
CRV_LINE = 256,
|
||||
CRV_ARC = 257,
|
||||
CRV_BEZ = 258,
|
||||
CRV_COMPO = 259,
|
||||
SRF_MESH = 512,
|
||||
SRF_FRGN = 513,
|
||||
SRF_BEZ = 514,
|
||||
VOL_ZMAP = 1024,
|
||||
EXT_TEXT = 2048,
|
||||
EXT_DIMENSION = 2049
|
||||
}
|
||||
|
||||
// Specifies the display state of an element.
|
||||
public enum Visibility
|
||||
{
|
||||
@@ -139,52 +120,5 @@ namespace WebWindowComplex.Json
|
||||
// Do not display the element, and do not reserve space for it in layout.
|
||||
COLLAPSED
|
||||
}
|
||||
|
||||
//LUA
|
||||
public enum LuaShapes {
|
||||
RECT = 1,
|
||||
CHAMFER_SIDE = 2,
|
||||
CHAMFER = 3,
|
||||
ROUND_ARC = 4,
|
||||
SEGMENTAL_ARC = 5,
|
||||
POINTED_ARC = 6,
|
||||
TRIANGLE = 7
|
||||
}
|
||||
|
||||
public struct Point3d
|
||||
{
|
||||
public double x;
|
||||
|
||||
public double y;
|
||||
|
||||
public double z;
|
||||
|
||||
public Point3d(double dX, double dY, double dZ)
|
||||
{
|
||||
this = default(Point3d);
|
||||
x = dX;
|
||||
y = dY;
|
||||
z = dZ;
|
||||
}
|
||||
|
||||
public Point3d(ref Point3d PtP)
|
||||
{
|
||||
this = default(Point3d);
|
||||
x = PtP.x;
|
||||
y = PtP.y;
|
||||
z = PtP.z;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return x.ToString("F3", CultureInfo.InvariantCulture) + "," + y.ToString("F3", CultureInfo.InvariantCulture) + "," + z.ToString("F3", CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public static Point3d ORIG()
|
||||
{
|
||||
return new Point3d(0.0, 0.0, 0.0);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+31
-153
@@ -266,7 +266,6 @@ namespace WebWindowComplex
|
||||
return m_Shape;
|
||||
}
|
||||
}
|
||||
|
||||
public int SelShapeIndex
|
||||
{
|
||||
get
|
||||
@@ -384,7 +383,6 @@ namespace WebWindowComplex
|
||||
m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized());
|
||||
}
|
||||
}
|
||||
|
||||
internal void SetSelShape(Shapes Value)
|
||||
{
|
||||
DimensionList.Clear();
|
||||
@@ -559,19 +557,6 @@ namespace WebWindowComplex
|
||||
m_nBottomRailQty = nBottomRailQty;
|
||||
}
|
||||
|
||||
private ObservableCollection<Curve> m_Outline;
|
||||
public ObservableCollection<Curve> Outline
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Outline;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Outline = value;
|
||||
}
|
||||
}
|
||||
|
||||
public Frame(Area ParentArea, Window ParentWindow) : base(ParentArea, ParentWindow)
|
||||
{
|
||||
}
|
||||
@@ -586,57 +571,6 @@ namespace WebWindowComplex
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override Frame Copy(Area ParentArea)
|
||||
{
|
||||
return null;
|
||||
@@ -663,7 +597,7 @@ namespace WebWindowComplex
|
||||
public static List<string> s_FamilyHardwareList = new List<string>();
|
||||
// Macro famiglia hardware scelta dal chiamante
|
||||
public static string s_SelFamilyHW = "";
|
||||
|
||||
|
||||
public int nSashQty
|
||||
{
|
||||
get
|
||||
@@ -1584,19 +1518,6 @@ namespace WebWindowComplex
|
||||
}
|
||||
}
|
||||
|
||||
private Curve m_Split;
|
||||
public Curve sSplit
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Split;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Split = value;
|
||||
}
|
||||
}
|
||||
|
||||
public Split(Area ParentArea, Window ParentWindow) : base(ParentArea, ParentWindow)
|
||||
{
|
||||
}
|
||||
@@ -1832,48 +1753,6 @@ namespace WebWindowComplex
|
||||
}
|
||||
}
|
||||
|
||||
public class Curve
|
||||
{
|
||||
private GDB_TY m_CurveType;
|
||||
public GDB_TY CurveType
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_CurveType;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_CurveType = value;
|
||||
}
|
||||
}
|
||||
|
||||
private Point3d m_ptStart;
|
||||
public Point3d ptStart
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_ptStart;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_ptStart = value;
|
||||
}
|
||||
}
|
||||
|
||||
private Point3d m_ptEnd;
|
||||
public Point3d ptEnd
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_ptEnd;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_ptEnd = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class Hardware
|
||||
{
|
||||
private string m_sId;
|
||||
@@ -2532,7 +2411,6 @@ namespace WebWindowComplex
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public struct IdNameStruct
|
||||
{
|
||||
private int m_Id;
|
||||
@@ -2673,37 +2551,37 @@ namespace WebWindowComplex
|
||||
return 0;
|
||||
}
|
||||
|
||||
//public static int IdFromName(string Name, ObservableCollection<object> List)
|
||||
//{
|
||||
// checked
|
||||
// {
|
||||
// int num = List.Count - 1;
|
||||
// for (int i = 0; i <= num; i++)
|
||||
// {
|
||||
// if (Operators.CompareString(((IdNameStruct)List[i]).Name, Name, TextCompare: false) == 0)
|
||||
// {
|
||||
// return ((IdNameStruct)List[i]).Id;
|
||||
// }
|
||||
// }
|
||||
// return 0;
|
||||
// }
|
||||
//}
|
||||
public static int IdFromName(string Name, ObservableCollection<object> List)
|
||||
{
|
||||
checked
|
||||
{
|
||||
int num = List.Count - 1;
|
||||
for (int i = 0; i <= num; i++)
|
||||
{
|
||||
if (string.Compare(((IdNameStruct)List[i]).Name, Name, false) == 0)
|
||||
{
|
||||
return ((IdNameStruct)List[i]).Id;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
//public static int IdFromName(string Name, List<object> List)
|
||||
//{
|
||||
// checked
|
||||
// {
|
||||
// int num = List.Count - 1;
|
||||
// for (int i = 0; i <= num; i++)
|
||||
// {
|
||||
// if (Operators.CompareString(((IdNameStruct)List[i]).Name, Name, TextCompare: false) == 0)
|
||||
// {
|
||||
// return ((IdNameStruct)List[i]).Id;
|
||||
// }
|
||||
// }
|
||||
// return 0;
|
||||
// }
|
||||
//}
|
||||
public static int IdFromName(string Name, List<object> List)
|
||||
{
|
||||
checked
|
||||
{
|
||||
int num = List.Count - 1;
|
||||
for (int i = 0; i <= num; i++)
|
||||
{
|
||||
if (string.Compare(((IdNameStruct)List[i]).Name, Name, false) == 0)
|
||||
{
|
||||
return ((IdNameStruct)List[i]).Id;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,813 +0,0 @@
|
||||
<div class="row">
|
||||
<div class="@mainCss()">
|
||||
<div class="card text-center table-svg">
|
||||
<div class="card-header" style="background-color: #d5f1f2;">
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<ul class="nav nav-tabs card-header-tabs">
|
||||
<li class="nav-item">
|
||||
@if (currStep == CompileStep.Template)
|
||||
{
|
||||
<a data-target="#Template" class="nav-link active fw-bold" aria-current="true" @onclick="() => AdvStep(CompileStep.Template)">Template</a>
|
||||
}
|
||||
else
|
||||
{
|
||||
<a data-target="#Template" class="nav-link text-secondary" @onclick="() => AdvStep(CompileStep.Template)">Template</a>
|
||||
}
|
||||
</li>
|
||||
@if (FrameWindow != null)
|
||||
{
|
||||
<li class="nav-item">
|
||||
<a data-target="#Frame" class="@tabNavCss(CompileStep.Frame)" aria-current="true" @onclick="() => NextStepAndPreview(CompileStep.Frame)">Frame</a>
|
||||
</li>
|
||||
@if(SplitList.Count > 0)
|
||||
{
|
||||
<li class="nav-item">
|
||||
<a data-target="#Split" class="@tabNavCss(CompileStep.Split)" aria-current="true" @onclick="() => NextStepAndPreview(CompileStep.Split)">Split</a>
|
||||
</li>
|
||||
}
|
||||
@if (SashList.Count > 0)
|
||||
{
|
||||
@for (int i = 0; i<SashList.Count;i++)
|
||||
{
|
||||
int Index = i;
|
||||
<li class="nav-item">
|
||||
<a data-target="#Sash" class="@tabNavCss(CompileStep.Sash, Index)" aria-current="true" @onclick="() => NextStepAndPreview(CompileStep.Sash, Index)">Sash @(SashList.Count==1 ? "": Index+1)</a>
|
||||
</li>
|
||||
}
|
||||
}
|
||||
<li class="nav-item">
|
||||
<a data-target="#Fill" class="@tabNavCss(CompileStep.Fill)" aria-current="true" @onclick="() => NextStepAndPreview(CompileStep.Fill)">Fill</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a data-target="#General" class="@tabNavCss(CompileStep.General)" aria-current="true" @onclick="() => NextStepAndPreview(CompileStep.General)">General</a>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-4 d-grid gap-2 d-md-flex justify-content-md-end">
|
||||
<button class="btn btn-lg btn-primary" style="font-size: 1rem;" @onclick="DoSave">Save</button>
|
||||
@* <button class="btn btn-lg btn-primary btn-sm" @onclick="DoPreviewSvg">Preview Svg</button> *@
|
||||
@if (currStep != CompileStep.Template)
|
||||
{
|
||||
<button class="btn btn-lg btn-primary" style="font-size: 1rem;" @onclick="DoReset">Reset</button>
|
||||
}
|
||||
<button class="btn btn-lg btn-primary" style="font-size: 1rem;" @onclick="DoClose">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body bg-transparent">
|
||||
<div class="text-center display-4">
|
||||
@if (currStep == CompileStep.Template)
|
||||
{
|
||||
<table class="table table-hover align-middle">
|
||||
<thead class="fs-5">
|
||||
<tr>
|
||||
<th scope="col">#</th>
|
||||
<th scope="col" class="col-4">Image</th>
|
||||
<th scope="col" class="text-start">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="table-group-divider fs-5">
|
||||
@foreach (var item in IN_TemplateDTOList)
|
||||
{
|
||||
string colorClass = "";
|
||||
@if (SelTemplateDTO != null && item.Index == SelTemplateDTO.Index)
|
||||
colorClass = "table-success";
|
||||
else
|
||||
colorClass = "";
|
||||
<tr style="height: 120px;" class="@colorClass" @onclick="() => DoSelect(item)">
|
||||
<td>@item.Index</td>
|
||||
<td><img class="img-fluid" width="100" src="@item.ImageUrl" /></td>
|
||||
<td class="text-start">@item.Description</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
@if (currStep == CompileStep.Frame)
|
||||
{
|
||||
@if (m_CurrWindow != null)
|
||||
{
|
||||
m_PreviousWindow = m_CurrWindow;
|
||||
}
|
||||
<div class="container">
|
||||
<div class="text-start p-1 display-4">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text" for="FrameShape">Shape</label>
|
||||
<select class="form-select" id="FrameShape" @bind="@FrameWindow.SelShapeIndex">
|
||||
<option value="0">Rectangle</option>
|
||||
<option value="1">Right Chamfer</option>
|
||||
<option value="2">Left Chamfer</option>
|
||||
<option value="3">Double Chamfer</option>
|
||||
<option value="4">Arc</option>
|
||||
<option value="5">Arc Full</option>
|
||||
<option value="6">Double Arc</option>
|
||||
<option value="7">Triangle</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5 class="card-title">Dimension</h5>
|
||||
@foreach (FrameDimension dimension in FrameWindow.DimensionList)
|
||||
{
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text" id="NameDimFrame@(FrameWindow.DimensionList.IndexOf(dimension) + 1)">@dimension.sName</span>
|
||||
<input type="number" class="form-control" aria-label="@dimension.dValue" @bind="@dimension.dValue">
|
||||
<span class="input-group-text">mm</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5 class="card-title m-0">Frame joints</h5>
|
||||
<div class="row text-center">
|
||||
<div class="col">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => AllJointsFrame(1, 0)">Angled</button>
|
||||
</div>
|
||||
<div class="col">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => AllJointsFrame(2, 0)">Horizontal</button>
|
||||
</div>
|
||||
<div class="col">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => AllJointsFrame(3, 0)">Vertical</button>
|
||||
</div>
|
||||
</div>
|
||||
@foreach (Joint joint in FrameWindow.JointList)
|
||||
{
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text" for="IndexJoint@(FrameWindow.JointList.IndexOf(joint) + 1)">@((positionJoints)(FrameWindow.JointList.IndexOf(joint)))</label>
|
||||
<select class="form-select" id="IndexJoint@(FrameWindow.JointList.IndexOf(joint) + 1)" @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>
|
||||
@if (!(FrameWindow.AreaList[0] is Split))
|
||||
{
|
||||
<div class="col-sm-6">
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5 class="card-title">Frame</h5>
|
||||
<div class="input-group mb-2">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => FrameWindow.AddSplit()">Aggiungi split</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
@if (m_SashList.Count == 0)
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5 class="card-title">Bottom rail</h5>
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text" id="BottomRailQty">Quantity</span>
|
||||
<input type="number" class="form-control" aria-label="BottomRailQty" @bind="@FrameWindow.BottomRailQty">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else if (currStep == CompileStep.Split)
|
||||
{
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="text-start p-1 display-4">
|
||||
<div class="row">
|
||||
@for(int i = 0; i < SplitList.Count; i++)
|
||||
{
|
||||
Split currSplit = SplitList[i];
|
||||
<div class="col-sm-6">
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
@if (currSplit.ParentArea is Splitted || currSplit.ParentArea is Sash)
|
||||
{
|
||||
@for(int j = 0; j < SashList.Count; j++)
|
||||
{
|
||||
@if (SashList[j].Equals(currSplit.ParentArea))
|
||||
{
|
||||
<h5>@("Sash " + (j+1))</h5>
|
||||
}
|
||||
else if (SashList[j].Equals(currSplit.ParentArea.ParentArea))
|
||||
{
|
||||
@for(int k = 0; k < SashList[j].AreaList.Count; k++)
|
||||
{
|
||||
@if (SashList[j].AreaList[k].AreaList[0].Equals(currSplit))
|
||||
{
|
||||
<h5>@("Sash " + (j + 1) + " - anta " + (k + 1))</h5>
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
<h5>@("Frame")</h5>
|
||||
}
|
||||
<div class="col">
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5>Split</h5>
|
||||
<div class="input-group mb-2 justify-content-center">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => SwapTwoAree(currSplit)">Swap Aree</button>
|
||||
</div>
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text" id="SplitQty@(m_SplitList.IndexOf(currSplit) + 1)">Number</span>
|
||||
<input type="number" class="form-control" placeholder="0" aria-label="basic-addon1Split" @bind="@currSplit.nSplitQty">
|
||||
</div>
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text" for="ShapeSplit@(m_SplitList.IndexOf(currSplit) + 1)">Shape</label>
|
||||
<select class="form-select" id="ShapeSplit@(m_SplitList.IndexOf(currSplit) + 1)" @bind="@currSplit.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 currSplit.SplitPositionList)
|
||||
{
|
||||
string desc = "";
|
||||
@if (currSplit.SelSplitShape == Json.WindowConst.SplitShapes.VERTICAL)
|
||||
{
|
||||
@if (currSplit.SplitPositionList.IndexOf(dim) == 0)
|
||||
{
|
||||
desc = "Larg. area sx split";
|
||||
}
|
||||
else
|
||||
{
|
||||
desc = "Larg. area dx split";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@if (currSplit.SplitPositionList.IndexOf(dim) == 0)
|
||||
{
|
||||
desc = "Altez. area sotto split";
|
||||
}
|
||||
else
|
||||
{
|
||||
desc = "Altez. area sopra split";
|
||||
}
|
||||
}
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text" id="SplitDimension@(currSplit.SplitPositionList.IndexOf(dim) + 1)">@desc</span>
|
||||
<input type="number" class="form-control" aria-label="basic-addon2Split" @bind="@dim.dDimension">
|
||||
<span class="input-group-text">%</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
@for(int i= 0; i < SplittedList.Count; i++)
|
||||
{
|
||||
Splitted currSplitted = SplittedList[i];
|
||||
<div class="col-sm-6">
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5>Area split</h5>
|
||||
<div class="input-group mb-2">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => currSplitted.AddSash()">Aggiungi sash</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@* @for (int i = 0; i < SplitParentList.Count; i++)
|
||||
{
|
||||
@for (int j = 0; j < 2 && (i * 2 + j <= SplitParentList.Count - 1); j++)
|
||||
{
|
||||
SplitParent currSplitParent = m_SplitParentList[i * 2 + j];
|
||||
@if (currSplitParent.Split != null)
|
||||
{
|
||||
Split currSplit = (Split)currSplitParent.Split;
|
||||
<div class="col-sm-6">
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
@if (currSplitParent.Description.Contains("Sash"))
|
||||
{
|
||||
<h5>@(currSplitParent.Description + " area " + numSash)</h5>
|
||||
numSash++;
|
||||
}
|
||||
else if (currSplitParent.Description.Contains("Split"))
|
||||
{
|
||||
<h5>@(currSplitParent.Description + " area " + numSplit)</h5>
|
||||
numSplit++;
|
||||
}
|
||||
else
|
||||
{
|
||||
<h5>@( currSplitParent.Description + " area")</h5>
|
||||
}
|
||||
<div class="col">
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5>Split</h5>
|
||||
<div class="input-group mb-2 justify-content-center">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => SwapTwoAree(currSplitParent.Split)">Swap Aree</button>
|
||||
</div>
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text" id="SplitQty@(m_SplitParentList.IndexOf(currSplitParent) + 1)">Number</span>
|
||||
<input type="number" class="form-control" placeholder="0" aria-label="basic-addon1Split" @bind="@currSplit.nSplitQty">
|
||||
</div>
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text" for="ShapeSplit@(m_SplitParentList.IndexOf(currSplitParent) + 1)">Shape</label>
|
||||
<select class="form-select" id="ShapeSplit@(m_SplitParentList.IndexOf(currSplitParent) + 1)" @bind="@currSplit.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 currSplit.SplitPositionList)
|
||||
{
|
||||
string desc = "";
|
||||
@if (currSplit.SelSplitShape == Json.WindowConst.SplitShapes.VERTICAL)
|
||||
{
|
||||
@if (currSplit.SplitPositionList.IndexOf(dim) == 0)
|
||||
{
|
||||
desc = "Larg. area sx split";
|
||||
}
|
||||
else
|
||||
{
|
||||
desc = "Larg. area dx split";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@if (currSplit.SplitPositionList.IndexOf(dim) == 0)
|
||||
{
|
||||
desc = "Altez. area sotto split";
|
||||
}
|
||||
else
|
||||
{
|
||||
desc = "Altez. area sopra split";
|
||||
}
|
||||
}
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text" id="SplitDimension@(currSplit.SplitPositionList.IndexOf(dim) + 1)">@desc</span>
|
||||
<input type="number" class="form-control" aria-label="basic-addon2Split" @bind="@dim.dDimension">
|
||||
<span class="input-group-text">%</span>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
@if (currSplitParent.Description.Contains("Sash"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else if (currSplitParent.Description.Contains("Frame"))
|
||||
{
|
||||
<div class="col-sm-6">
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5>@currSplitParent.Description</h5>
|
||||
<div class="input-group mb-2">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => currSplitParent.Splitted.AddSplit()">Aggiungi split</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
@if (currSplitParent.Description.Contains("Split area with sash"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@if (currSplitParent.IntoSash == false)
|
||||
{
|
||||
<div class="col-sm-6">
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5>@("Area " + currSplitParent.Description + " " + numSplit)</h5>
|
||||
<div class="input-group mb-2">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => currSplitParent.Splitted.AddSash()">Aggiungi sash</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
numSplit++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} *@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else if (currStep == CompileStep.Sash)
|
||||
{
|
||||
Sash item = SashList[currSash];
|
||||
<div class="container">
|
||||
<div class="text-start display-4">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text" id="NumberSash@(SashList.IndexOf(item) + 1)">Number</span>
|
||||
<input type="number" class="form-control" aria-label="NumberSash@(SashList.IndexOf(item) + 1)" @bind="@item.nSashQty">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5 class="card-title">Orientation</h5>
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text" for="OrientationSash@(SashList.IndexOf(item) + 1)">Tipology</label>
|
||||
<select class="form-select" id="OrientationSash@(SashList.IndexOf(item) + 1)" @bind="@item.SelOrientationSashTypeIndex">
|
||||
<option value="0">Vertical</option>
|
||||
<option value="1">Horizontal</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5 class="card-title">Bottom rail</h5>
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text" id="BottomRailQty@(SashList.IndexOf(item) + 1)">Quantity</span>
|
||||
<input type="number" class="form-control" aria-label="BottomRailQty" @bind="@item.SashBottomRailQty">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
@for (int i = 0; i <= item.SashList.Count / 2; i++)
|
||||
{
|
||||
for (int j = 0; j < 2 && (i * 2 + j <= item.SashList.Count - 1); j++)
|
||||
{
|
||||
SashDimension sash = item.SashList[i * 2 + j];
|
||||
<div class="col-sm-6">
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
@if (item.SashList.Count == 1)
|
||||
{
|
||||
<h5 class="card-title">Opening</h5>
|
||||
}
|
||||
else
|
||||
{
|
||||
<h5 class="card-title">Sash opening @(i * 2 + j + 1)</h5>
|
||||
}
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text" for="OpeningSash@(i * 2 + j + 1)">Tipology</label>
|
||||
<select class="form-select" id="OpeningSash@(i * 2 + j + 1)" @bind="@sash.SelOpeningTypeIndex">
|
||||
<option value="0">A sinistra</option>
|
||||
<option value="1">A destra</option>
|
||||
<option value="2">Ad anta-ribalta sinistra</option>
|
||||
<option value="3">Ad anta-ribalta destra</option>
|
||||
<option value="4">Solo verso alto</option>
|
||||
<option value="5">Solo verso basso</option>
|
||||
<option value="6">Pivot</option>
|
||||
<option value="7">Fissa</option>
|
||||
<option value="8">Complanare sinistra</option>
|
||||
<option value="9">Complanare destra</option>
|
||||
<option value="10">Scorrevole sinistra</option>
|
||||
<option value="11">Scorrevole destra</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-group mb-2">
|
||||
<span class="input-group-text">Dimension</span>
|
||||
<input type="number" class="form-control" aria-label="DimensionSash" @bind="@sash.dDimension">
|
||||
<span class="input-group-text">%</span>
|
||||
</div>
|
||||
<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="Handle" id="HandleSashLabel@(i + 1)" checked="@sash.bHasHandle" @onclick="() => changeHandle(sash)">
|
||||
</div>
|
||||
<div class="px-2">
|
||||
<label class="form-check-label fs-6 text-dark" for="HandleSashLabel@(i * 2 + j + 1)">Handle</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5 class="card-title">Sash joints</h5>
|
||||
<div class="row p-0 m-0 text-center">
|
||||
<div class="col">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => AllJointsFrame(1, 1)">Angled</button>
|
||||
</div>
|
||||
<div class="col">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => AllJointsFrame(2, 1)">Horizontal</button>
|
||||
</div>
|
||||
<div class="col">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => AllJointsFrame(3, 1)">Vertical</button>
|
||||
</div>
|
||||
</div>
|
||||
@foreach (Joint joint in item.JointList)
|
||||
{
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text" for="IndexJoint@(item.JointList.IndexOf(joint) + 1)">@((positionJoints)(item.JointList.IndexOf(joint)))</label>
|
||||
<select class="form-select" id="IndexJoint@(item.JointList.IndexOf(joint) + 1)" @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>
|
||||
<div class="col-sm-6">
|
||||
@for (int i = 0; i < item.AreaList.Count; i++)
|
||||
{
|
||||
Area anta;
|
||||
@if (item.AreaList[i] is Splitted)
|
||||
{
|
||||
anta = item.AreaList[i];
|
||||
}
|
||||
else
|
||||
{
|
||||
anta = item;
|
||||
}
|
||||
@if (!(anta.AreaList[0] is Split))
|
||||
{
|
||||
<div class="col">
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5 class="card-title">Anta @(i + 1)</h5>
|
||||
<div class="input-group mb-2">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => anta.AddSplit()">Aggiungi split</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else if (currStep == CompileStep.Fill)
|
||||
{
|
||||
<div class="container">
|
||||
<div class="text-start p-1 display-4 ">
|
||||
<div class="row text-center">
|
||||
<div class="col-12">
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<h5>Fill Area</h5>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row align-items-center">
|
||||
<div class="col">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => AllFill(1)">All glass</button>
|
||||
</div>
|
||||
<div class="col">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => AllFill(2)">All wood</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
@for (int i = 0; i < FillList.Count; i += 2)
|
||||
{
|
||||
Fill currFill = FillList[i];
|
||||
<div class="col-sm-6">
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
@if (FillList.Count == 1)
|
||||
{
|
||||
<h5 class="card-title">Fill </h5>
|
||||
}
|
||||
else
|
||||
{
|
||||
<h5 class="card-title">Fill @(FillList.IndexOf(currFill) + 1)</h5>
|
||||
}
|
||||
<div class="input-group mb-2">
|
||||
<select class="form-select" @bind="@currFill.SelFillTypeIndex">
|
||||
<option value="0">Glass</option>
|
||||
<option value="1">Wood</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if (i + 1 < FillList.Count)
|
||||
{
|
||||
Fill nextFill = FillList[i + 1];
|
||||
<div class="col-sm-6">
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
@if (FillList.Count == 1)
|
||||
{
|
||||
<h5 class="card-title">Fill </h5>
|
||||
}
|
||||
else
|
||||
{
|
||||
<h5 class="card-title">Fill @(FillList.IndexOf(nextFill) + 1)</h5>
|
||||
}
|
||||
<div class="input-group mb-2">
|
||||
<select class="form-select" @bind="@nextFill.SelFillTypeIndex">
|
||||
<option value="0">Glass</option>
|
||||
<option value="1">Wood</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
else if (currStep == CompileStep.General)
|
||||
{
|
||||
<div class="container">
|
||||
<div class="text-start p-1 display-4 ">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5 class="card-title">Generic</h5>
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text" for="MaterialWindow">Material</label>
|
||||
<select class="form-select" id="MaterialWindow">
|
||||
<option value="0">Wood</option>
|
||||
<option value="1">PVC</option>
|
||||
<option value="2">Aluminum</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text" for="ProfileWindow">Profile</label>
|
||||
<select class="form-select" id="ProfileWindow">
|
||||
<option value="0">Profilo 78</option>
|
||||
<option value="1">Profilo..</option>
|
||||
<option value="2">Profilo...</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5 class="card-title">Fill type</h5>
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text" for="GlassWindow">Glass</label>
|
||||
<select class="form-select" id="GlassWindow">
|
||||
<option value="0">Doppio vetro</option>
|
||||
<option value="1">Triplo vetro</option>
|
||||
<option value="2">Antieffrazione</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text" for="PanelWindow">Pannello</label>
|
||||
<select class="form-select" id="PanelWindow">
|
||||
<option value="0">Liscio</option>
|
||||
<option value="1">Con venatura</option>
|
||||
<option value="2">Custom</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5 class="card-title">Color</h5>
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text" for="TreatmentWindow">Treatment</label>
|
||||
<select class="form-select" id="TreatmentWindow">
|
||||
<option value="0">Standard</option>
|
||||
<option value="1">...</option>
|
||||
<option value="2">Custom</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="row">
|
||||
<p class="d-inline-flex gap-1">
|
||||
<div class="col">
|
||||
<button type="button" class="@buttonCss(ColorWindow.Bianco)" @onclick="() => ChangeColorWindow(ColorWindow.Bianco)" data-bs-toggle=" button" aria-pressed="true">Bianco</button>
|
||||
@* <button class="btn btn-outline-secondary btn-sm">Bianco</button> *@
|
||||
</div>
|
||||
<div class="col">
|
||||
<button type="button" class="@buttonCss(ColorWindow.Grigio)" @onclick="() => ChangeColorWindow(ColorWindow.Grigio)" data-bs-toggle="button" aria-pressed="true">Grigio</button>
|
||||
</div>
|
||||
<div class="col">
|
||||
<button type="button" class="@buttonCss(ColorWindow.Tortora)" @onclick="() => ChangeColorWindow(ColorWindow.Tortora)" data-bs-toggle="button" aria-pressed="true">Tortora</button>
|
||||
</div>
|
||||
</p>
|
||||
</div>
|
||||
<div class="row">
|
||||
<p class="d-inline-flex gap-1">
|
||||
<div class="col">
|
||||
<button type="button" class="@buttonCss(ColorWindow.Blu)" @onclick="() => ChangeColorWindow(ColorWindow.Blu)" data-bs-toggle="button" aria-pressed="true">Blu</button>
|
||||
</div>
|
||||
<div class="col">
|
||||
<button type="button" class="@buttonCss(ColorWindow.Verde)" @onclick="() => ChangeColorWindow(ColorWindow.Verde)" data-bs-toggle="button" aria-pressed="true">Verde</button>
|
||||
</div>
|
||||
<div class="col">
|
||||
<button type="button" class="@buttonCss(ColorWindow.Nero)" @onclick="() => ChangeColorWindow(ColorWindow.Nero)" data-bs-toggle="button" aria-pressed="true">Nero</button>
|
||||
</div>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if (m_SashList.Count > 0)
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="border mb-2">
|
||||
<div class="card-body py-2">
|
||||
<h5 class="card-title">Hardware</h5>
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text" for="ColorHardware">Generic color</label>
|
||||
<select class="form-select" id="ColorHardware">
|
||||
<option value="0">Oro</option>
|
||||
<option value="1">Bronzo</option>
|
||||
<option value="2">Ottone</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text" for="CapsColor">Caps color</label>
|
||||
<select class="form-select" id="CapsColor">
|
||||
<option value="0">Oro</option>
|
||||
<option value="1">Bronzo</option>
|
||||
<option value="2">Ottone</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-group mb-2">
|
||||
<label class="input-group-text" for="HandleColor">Handle color</label>
|
||||
<select class="form-select" id="HandleColor">
|
||||
<option value="0">Oro</option>
|
||||
<option value="1">Bronzo</option>
|
||||
<option value="2">Ottone</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@if (currStep != CompileStep.Template)
|
||||
{
|
||||
<div class="col-6">
|
||||
@outSvg
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -1,619 +0,0 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.AspNetCore.Components.Web;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Reflection.Metadata;
|
||||
using System.Runtime.InteropServices;
|
||||
using WebWindowConfigurator.DTO;
|
||||
using WebWindowConfigurator.Json;
|
||||
using static WebWindowConfigurator.Json.WindowConst;
|
||||
|
||||
namespace WebWindowConfigurator
|
||||
{
|
||||
public partial class WebTest : IDisposable
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
[Parameter]
|
||||
public string CssSvg { get; set; } = "responsive-svg";
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<bool> EC_OnClose { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<TemplateSelectDTO> EC_OnSelectedTemplate { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<Dictionary<string, string>> EC_OnUpdate { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public Template IN_SelTemplate
|
||||
{
|
||||
get => m_SelTemplate;
|
||||
set
|
||||
{
|
||||
// Se non ho ancora selezionato template oppure se cambio template di selezione
|
||||
if (value != null && (m_SelTemplate == null || (m_SelTemplate != null && value.nIndex != m_SelTemplate.nIndex)) && !string.IsNullOrEmpty(value.JWD))
|
||||
{
|
||||
m_SelTemplate = value;
|
||||
JsonWindow WindowFromJson = JsonConvert.DeserializeObject<JsonWindow>(m_SelTemplate.JWD, new PolymorphicJsonConverter()) ?? new JsonWindow("");
|
||||
if (m_CurrWindow != null)
|
||||
{
|
||||
m_CurrWindow.OnPreview -= M_CurrWindow_OnPreview;
|
||||
m_CurrWindow = null;
|
||||
}
|
||||
m_CurrWindow = WindowFromJson.Deserialize();
|
||||
m_CurrWindow.OnPreview += M_CurrWindow_OnPreview;
|
||||
// recupero dimensioni Frame e Joint Frame della finestra precedente
|
||||
if (m_PreviousWindow != null)
|
||||
{
|
||||
for (int i = 0; i < 2; i++)
|
||||
m_CurrWindow.AreaList[0].DimensionList[i] = m_PreviousWindow.AreaList[0].DimensionList[i];
|
||||
for (int i = 0; i < 4; i++)
|
||||
m_CurrWindow.AreaList[0].JointList[i] = m_PreviousWindow.AreaList[0].JointList[i];
|
||||
}
|
||||
}
|
||||
if (m_CurrWindow != null)
|
||||
{
|
||||
m_FillList = new List<Fill>();
|
||||
m_SashList = new List<Sash>();
|
||||
m_SplitList = new List<Split>();
|
||||
m_SplitParentList = new List<SplitParent>();
|
||||
m_SplittedList = new List<Splitted>();
|
||||
CreateWindowsList(m_CurrWindow.AreaList[0], false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Parameter]
|
||||
public List<TemplateSelectDTO> IN_TemplateDTOList { get; set; } = null!;
|
||||
|
||||
[Parameter]
|
||||
public string LiveSVG
|
||||
{
|
||||
get => m_SelSVG;
|
||||
set => m_SelSVG = value;
|
||||
}
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (m_CurrWindow != null)
|
||||
{
|
||||
m_CurrWindow.OnPreview -= M_CurrWindow_OnPreview;
|
||||
m_CurrWindow = null;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Enums
|
||||
|
||||
protected enum CompileStep
|
||||
{
|
||||
Template = 0,
|
||||
Frame = 1,
|
||||
Split,
|
||||
Sash,
|
||||
Fill,
|
||||
General
|
||||
}
|
||||
|
||||
protected enum ColorWindow
|
||||
{
|
||||
Bianco = 0,
|
||||
Grigio = 1,
|
||||
Tortora,
|
||||
Blu,
|
||||
Verde,
|
||||
Nero
|
||||
}
|
||||
|
||||
#endregion Protected Enums
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
protected Frame FrameWindow
|
||||
{
|
||||
get => m_Frame;
|
||||
set => m_Frame = value;
|
||||
}
|
||||
|
||||
protected string m_SelSVG { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Componente SVG da mostrare
|
||||
/// </summary>
|
||||
protected MarkupString outSvg
|
||||
{
|
||||
get
|
||||
{
|
||||
// aggiunta gestione classe svg per posizionamento con costraints
|
||||
var newSvg = LiveSVG.Replace("<svg", $"<svg class=\"{CssSvg}\"");
|
||||
return (MarkupString)newSvg;
|
||||
}
|
||||
}
|
||||
|
||||
protected List<Sash> SashList
|
||||
{
|
||||
get => m_SashList;
|
||||
}
|
||||
protected List<Split> SplitList
|
||||
{
|
||||
get => m_SplitList;
|
||||
}
|
||||
protected List<Fill> FillList
|
||||
{
|
||||
get => m_FillList;
|
||||
}
|
||||
protected List<Splitted> SplittedList
|
||||
{
|
||||
get => m_SplittedList;
|
||||
}
|
||||
protected List<SplitParent> SplitParentList
|
||||
{
|
||||
get => m_SplitParentList;
|
||||
}
|
||||
|
||||
protected TemplateSelectDTO? SelTemplateDTO { get; set; } = null;
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per la scelta della maniglia univoca
|
||||
/// </summary>
|
||||
/// <param name="sashDim"></param>
|
||||
/// <returns></returns>
|
||||
protected async Task changeHandle(SashDimension sashDim)
|
||||
{
|
||||
//if(m_SashList[0].AreaList.Count < 3)
|
||||
//{
|
||||
foreach (SashDimension item in SashList[0].SashList)
|
||||
{
|
||||
if (item.Equals(sashDim))
|
||||
{
|
||||
item.bHasHandle = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
item.bHasHandle = false;
|
||||
}
|
||||
}
|
||||
//}
|
||||
await Task.Delay(1);
|
||||
}
|
||||
|
||||
// Ancora da fare...
|
||||
protected async Task DoClose()
|
||||
{
|
||||
await EC_OnClose.InvokeAsync(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Anteprima SVG
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected async Task DoPreviewSvg()
|
||||
{
|
||||
if (m_CurrWindow != null)
|
||||
{
|
||||
var CurrJwd = JsonConvert.SerializeObject(m_CurrWindow.Serialize(), Formatting.Indented);
|
||||
Dictionary<string, string> Args = new Dictionary<string, string>();
|
||||
Args.Add("Jwd", CurrJwd);
|
||||
Args.Add("Mode", 1.ToString());
|
||||
await EC_OnUpdate.InvokeAsync(Args);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo di reset dei dati a quelli del template
|
||||
/// </summary>
|
||||
protected async Task DoReset()
|
||||
{
|
||||
JsonWindow WindowFromJson = JsonConvert.DeserializeObject<JsonWindow>(m_SelTemplate.JWD, new PolymorphicJsonConverter()) ?? new JsonWindow("");
|
||||
if (m_CurrWindow != null)
|
||||
{
|
||||
m_CurrWindow.OnPreview -= M_CurrWindow_OnPreview;
|
||||
m_CurrWindow = null;
|
||||
}
|
||||
m_CurrWindow = WindowFromJson.Deserialize();
|
||||
m_CurrWindow.OnPreview += M_CurrWindow_OnPreview;
|
||||
m_FillList = new List<Fill>();
|
||||
m_SashList = new List<Sash>();
|
||||
m_SplitList = new List<Split>();
|
||||
m_SplittedList = new List<Splitted>();
|
||||
m_SplitParentList = new List<SplitParent>();
|
||||
// popolo le liste Fill, Sash e Split
|
||||
CreateWindowsList(m_CurrWindow.AreaList[0], false);
|
||||
currSash = -1;
|
||||
await DoPreviewSvg();
|
||||
}
|
||||
|
||||
// Ancora da fare..
|
||||
protected async Task DoSave()
|
||||
{
|
||||
//manca salvataggio JWD
|
||||
await EC_OnClose.InvokeAsync(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Selezione del template
|
||||
/// </summary>
|
||||
/// <param name="newSel"> template selezionato</param>
|
||||
protected async void DoSelect(TemplateSelectDTO newSel)
|
||||
{
|
||||
SelTemplateDTO = newSel;
|
||||
//DoSelectAndPreview(CompileStep.Frame);
|
||||
await EC_OnSelectedTemplate.InvokeAsync(newSel);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per cambiare step e aggiornare preview svg
|
||||
/// </summary>
|
||||
/// <param name="newStep"> step successivo</param>
|
||||
protected async void NextStepAndPreview(CompileStep newStep, int Index = -1)
|
||||
{
|
||||
currStep = newStep;
|
||||
if (newStep == CompileStep.Sash)
|
||||
currSash = Index;
|
||||
else
|
||||
currSash = -1;
|
||||
await DoPreviewSvg();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per identificare oggetti nella Window e popolare le liste Fill, Sash e Split, SplitParent
|
||||
/// </summary>
|
||||
/// <param name="node"></param>
|
||||
//protected void CreateWindowsList(Area node)
|
||||
//{
|
||||
// if (node != null)
|
||||
// {
|
||||
// switch (node.AreaType)
|
||||
// {
|
||||
// case AreaTypes.FRAME:
|
||||
// {
|
||||
// FrameWindow = (Frame)node;
|
||||
// if (node.AreaList[0] is Split)
|
||||
// SplitParentList.Add(new SplitParent(AreaTypes.FRAME, "Frame", false, node.AreaList[0], null));
|
||||
// else
|
||||
// SplitParentList.Add(new SplitParent(AreaTypes.FRAME, "Frame", false, null, node));
|
||||
// break;
|
||||
// }
|
||||
// case AreaTypes.SASH:
|
||||
// {
|
||||
// m_SashList.Add((Sash)node);
|
||||
// if (node.AreaList[0] is Fill)
|
||||
// SplitParentList.Add(new SplitParent(AreaTypes.SPLITTED, "Sash", true, null, node));
|
||||
// else if(node.AreaList[0] is Split)
|
||||
// SplitParentList.Add(new SplitParent(AreaTypes.SPLITTED, "Sash into split", true, node.AreaList[0], node));
|
||||
// break;
|
||||
// }
|
||||
// case AreaTypes.FILL:
|
||||
// {
|
||||
// m_FillList.Add((Fill)node);
|
||||
// break;
|
||||
// }
|
||||
// case AreaTypes.SPLIT:
|
||||
// {
|
||||
// m_SplitList.Add((Split)node);
|
||||
// break;
|
||||
// }
|
||||
// case AreaTypes.SPLITTED:
|
||||
// {
|
||||
// if (node.AreaList[0] is Split)
|
||||
// {
|
||||
// if (node.ParentArea is Sash)
|
||||
// SplitParentList.Add(new SplitParent(AreaTypes.SPLITTED, "Sash", true, node.AreaList[0], node));
|
||||
// else
|
||||
// SplitParentList.Add(new SplitParent(AreaTypes.SPLITTED, "Split", false, node.AreaList[0], node));
|
||||
// }
|
||||
// else if (node.AreaList[0] is Sash)
|
||||
// {
|
||||
// SplitParentList.Add(new SplitParent(AreaTypes.SPLITTED, "Split area with sash", false, null, node));
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (node.ParentArea is Sash)
|
||||
// SplitParentList.Add(new SplitParent(AreaTypes.SPLITTED, "Sash", true, null, node));
|
||||
// else if (node.ParentArea.ParentArea is Sash)
|
||||
// SplitParentList.Add(new SplitParent(AreaTypes.SPLITTED, "Split into sash", true, null, node));
|
||||
// else
|
||||
// SplitParentList.Add(new SplitParent(AreaTypes.SPLITTED, "Split", false, null, node));
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// foreach (var item in node.AreaList)
|
||||
// {
|
||||
// CreateWindowsList(item);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
//protected void CreateWindowsList(Area node, bool IntoSash)
|
||||
//{
|
||||
// if (node != null)
|
||||
// {
|
||||
// bool nodeIntoSash = false;
|
||||
// if (node.ParentArea is Sash || IntoSash == true)
|
||||
// nodeIntoSash = true;
|
||||
// switch (node.AreaType)
|
||||
// {
|
||||
// case AreaTypes.FRAME:
|
||||
// {
|
||||
// FrameWindow = (Frame)node;
|
||||
// if (node.AreaList[0] is Split)
|
||||
// SplitParentList.Add(new SplitParent(AreaTypes.FRAME, "Frame", nodeIntoSash, node.AreaList[0], null));
|
||||
// else
|
||||
// SplitParentList.Add(new SplitParent(AreaTypes.FRAME, "Frame", nodeIntoSash, null, node));
|
||||
// break;
|
||||
// }
|
||||
// case AreaTypes.SASH:
|
||||
// {
|
||||
// m_SashList.Add((Sash)node);
|
||||
// if (node.AreaList[0] is Fill)
|
||||
// SplitParentList.Add(new SplitParent(AreaTypes.SPLITTED, "Sash", nodeIntoSash, null, node));
|
||||
// else if (node.AreaList[0] is Split)
|
||||
// SplitParentList.Add(new SplitParent(AreaTypes.SPLITTED, "Sash into split", nodeIntoSash, node.AreaList[0], node));
|
||||
// break;
|
||||
// }
|
||||
// case AreaTypes.FILL:
|
||||
// {
|
||||
// m_FillList.Add((Fill)node);
|
||||
// break;
|
||||
// }
|
||||
// case AreaTypes.SPLIT:
|
||||
// {
|
||||
// m_SplitList.Add((Split)node);
|
||||
// break;
|
||||
// }
|
||||
// case AreaTypes.SPLITTED:
|
||||
// {
|
||||
// if (node.AreaList[0] is Split)
|
||||
// {
|
||||
// if (node.ParentArea is Sash)
|
||||
// SplitParentList.Add(new SplitParent(AreaTypes.SPLITTED, "Sash", nodeIntoSash, node.AreaList[0], node));
|
||||
// else
|
||||
// SplitParentList.Add(new SplitParent(AreaTypes.SPLITTED, "Split", nodeIntoSash, node.AreaList[0], node));
|
||||
// }
|
||||
// else if (node.AreaList[0] is Sash)
|
||||
// {
|
||||
// SplitParentList.Add(new SplitParent(AreaTypes.SPLITTED, "Split area with sash", nodeIntoSash, null, node));
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (node.ParentArea is Sash)
|
||||
// SplitParentList.Add(new SplitParent(AreaTypes.SPLITTED, "Sash", nodeIntoSash, null, node));
|
||||
// else if (nodeIntoSash)
|
||||
// SplitParentList.Add(new SplitParent(AreaTypes.SPLITTED, "Area split into sash", nodeIntoSash, null, node));
|
||||
// else
|
||||
// SplitParentList.Add(new SplitParent(AreaTypes.SPLITTED, "Split", nodeIntoSash, null, node));
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// foreach (var item in node.AreaList)
|
||||
// {
|
||||
// CreateWindowsList(item, nodeIntoSash);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
protected void CreateWindowsList(Area node, bool IntoSash)
|
||||
{
|
||||
if (node != null)
|
||||
{
|
||||
if (node.ParentArea is Sash || IntoSash == true)
|
||||
IntoSash = true;
|
||||
switch (node.AreaType)
|
||||
{
|
||||
case AreaTypes.FRAME:
|
||||
{
|
||||
FrameWindow = (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;
|
||||
}
|
||||
case AreaTypes.SPLITTED:
|
||||
{
|
||||
if(node.ParentArea is Split && !IntoSash && node.AreaList[0] is Fill)
|
||||
{
|
||||
m_SplittedList.Add((Splitted)node);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
foreach (var item in node.AreaList)
|
||||
{
|
||||
CreateWindowsList(item, IntoSash);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per settare tutti i Joints di Frame o Sash come ANGLED o FULL_H o FULL_V
|
||||
/// </summary>
|
||||
/// <param name="int_type"> tipo di giunzione (ANGLED o FULL_H o FULL_V)</param>
|
||||
/// <param name="int_place"> oggetto a cui essere applicato (Frame o Sash)</param>
|
||||
/// <returns></returns>
|
||||
private async Task AllJointsFrame(int int_type, int int_place)
|
||||
{
|
||||
Joints type = Joints.ANGLED;
|
||||
if (int_type == 2)
|
||||
{
|
||||
type = Joints.FULL_H;
|
||||
}
|
||||
else if (int_type == 3)
|
||||
{
|
||||
type = Joints.FULL_V;
|
||||
}
|
||||
if (int_place == 0)
|
||||
{
|
||||
foreach (Joint joint in FrameWindow.JointList)
|
||||
{
|
||||
joint.SetSelJointType(type);
|
||||
}
|
||||
}
|
||||
else if (int_place == 1)
|
||||
{
|
||||
foreach (Joint joint in m_SashList[0].JointList)
|
||||
{
|
||||
joint.SetSelJointType(type);
|
||||
}
|
||||
}
|
||||
await DoPreviewSvg();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per settare tutti i Joints di Frame o Sash come ANGLED o FULL_H o FULL_V
|
||||
/// </summary>
|
||||
/// <param name="int_type"> tipo di giunzione (ANGLED o FULL_H o FULL_V)</param>
|
||||
/// <param name="int_place"> oggetto a cui essere applicato (Frame o Sash)</param>
|
||||
/// <returns></returns>
|
||||
private async Task AllFill(int int_type)
|
||||
{
|
||||
FillTypes type = FillTypes.GLASS;
|
||||
if (int_type == 2)
|
||||
{
|
||||
type = FillTypes.WOOD;
|
||||
}
|
||||
foreach (Fill currFill in m_FillList)
|
||||
{
|
||||
currFill.SetFillType(type);
|
||||
}
|
||||
await DoPreviewSvg();
|
||||
}
|
||||
|
||||
private async Task SwapTwoAree(Area currArea)
|
||||
{
|
||||
currArea.SwapAree();
|
||||
await DoPreviewSvg();
|
||||
}
|
||||
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private CompileStep currStep = CompileStep.Template;
|
||||
|
||||
private int currSash = -1;
|
||||
|
||||
private ColorWindow currColorWin = ColorWindow.Bianco;
|
||||
|
||||
private Frame m_Frame;
|
||||
|
||||
private List<Sash> m_SashList = new List<Sash>();
|
||||
|
||||
private List<Split> m_SplitList = new List<Split>();
|
||||
|
||||
private List<Fill> m_FillList = new List<Fill>();
|
||||
|
||||
private List<Splitted> m_SplittedList = new List<Splitted>();
|
||||
|
||||
private List<SplitParent> m_SplitParentList = new List<SplitParent>();
|
||||
|
||||
private enum positionJoints
|
||||
{
|
||||
BL = 0, // Bottom Left
|
||||
BR = 1, // Bottom Right
|
||||
TR, // Top Right
|
||||
TL // Top Left
|
||||
}
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private Window? m_CurrWindow { get; set; } = null;
|
||||
|
||||
private Window? m_PreviousWindow { get; set; } = null;
|
||||
|
||||
private Template m_SelTemplate { get; set; } = null!;
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per andare allo step successivo
|
||||
/// </summary>
|
||||
/// <param name="newStep"> step successivo</param>
|
||||
private void AdvStep(CompileStep newStep)
|
||||
{
|
||||
currStep = newStep;
|
||||
currSash = -1;
|
||||
}
|
||||
|
||||
|
||||
private void ChangeColorWindow(ColorWindow newColorWin)
|
||||
{
|
||||
currColorWin = newColorWin;
|
||||
}
|
||||
|
||||
private void M_CurrWindow_OnPreview(object? sender, OnPreviewEventArgs e)
|
||||
{
|
||||
Dictionary<string, string> Args = new Dictionary<string, string>();
|
||||
Args.Add("Jwd", e.sJwd);
|
||||
Args.Add("Mode", 1.ToString());
|
||||
EC_OnUpdate.InvokeAsync(Args);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calcola il css del tab selezionato
|
||||
/// </summary>
|
||||
/// <param name="testStep"></param>
|
||||
/// <returns></returns>
|
||||
private string tabNavCss(CompileStep testStep, int Index = -1)
|
||||
{
|
||||
if(testStep == CompileStep.Sash)
|
||||
{
|
||||
if ((currSash == 0 && Index == 0)|| (currSash == 1 && Index == 1))
|
||||
{
|
||||
return "nav-link active fw-bold";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "nav-link text-secondary";
|
||||
}
|
||||
}
|
||||
return (testStep == currStep) ? "nav-link active fw-bold" : "nav-link text-secondary";
|
||||
}
|
||||
|
||||
private string buttonCss(ColorWindow testColor)
|
||||
{
|
||||
return testColor.Equals(currColorWin) ? "btn btn-outline-secondary active" : "btn btn-outline-secondary";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calcola larghezza colonna da mostrare
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string mainCss()
|
||||
{
|
||||
return (currStep == CompileStep.Template) ? "col-12" : "col-6";
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
.my-component {
|
||||
border: 2px dashed red;
|
||||
padding: 1em;
|
||||
margin: 1em 0;
|
||||
background-image: url('background.png');
|
||||
}
|
||||
|
||||
|
||||
/* gestione SVG responsive */
|
||||
.responsive-svg {
|
||||
/* SVG scala a fit del container */
|
||||
width: 100%;
|
||||
/* Altezza massima in rem (caratteri) */
|
||||
height: 40rem;
|
||||
/* Removes extra space below SVG */
|
||||
display: block;
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>2.7.9.1209</Version>
|
||||
<Version>2.7.9.1210</Version>
|
||||
<Authors>Annamaria Sassi</Authors>
|
||||
<Company>Egalware</Company>
|
||||
<Description>Componente gestione JWD per LUX</Description>
|
||||
@@ -350,6 +350,16 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user