Gestione hardware
This commit is contained in:
+69
-33
@@ -126,7 +126,6 @@ namespace WebWindowComplex
|
||||
set
|
||||
{
|
||||
m_AreaType = value;
|
||||
//m_delDrawWindow();
|
||||
}
|
||||
}
|
||||
internal void SetAreaType(AreaTypes AreaType)
|
||||
@@ -658,6 +657,13 @@ namespace WebWindowComplex
|
||||
|
||||
public class Sash : Area
|
||||
{
|
||||
// Lista hardware completa passata dal chiamante del componente
|
||||
public static List<Hardware> m_HardwareCompleteList = new List<Hardware>();
|
||||
// Lista hardware completa passata dal chiamante del componente
|
||||
public static List<string> s_FamilyHardwareList = new List<string>();
|
||||
// Macro famiglia hardware scelta dal chiamante
|
||||
public static string s_SelFamilyHW = "";
|
||||
|
||||
public int nSashQty
|
||||
{
|
||||
get
|
||||
@@ -823,9 +829,9 @@ namespace WebWindowComplex
|
||||
//}
|
||||
}
|
||||
}
|
||||
//RefreshHardwareList();
|
||||
RefreshHardwareList();
|
||||
RefreshHardwareOptionList();
|
||||
//SetFirstHardware();
|
||||
SetFirstHardware();
|
||||
m_ParentWindow.OnUpdatePreview(m_ParentWindow.sSerialized());
|
||||
}
|
||||
}
|
||||
@@ -1157,6 +1163,26 @@ namespace WebWindowComplex
|
||||
m_SelHardware = m_HardwareList[0];
|
||||
}
|
||||
|
||||
public int SelHardwareTypeIndex
|
||||
{
|
||||
get
|
||||
{
|
||||
for (int i = 0; i < m_HardwareList.Count; i++)
|
||||
{
|
||||
if (m_HardwareList[i].Equals(m_SelHardware))
|
||||
return i;
|
||||
}
|
||||
return 0;
|
||||
//return IdNameStruct.IndFromId((int)m_SelHardware, m_HardwareList);
|
||||
}
|
||||
set
|
||||
{
|
||||
m_SelHardware = m_HardwareList[value];
|
||||
//m_SelOpeningType = (Openings)IdNameStruct.IdFromInd(value, m_OpeningTypeList);
|
||||
ParentWindow.OnUpdatePreview(ParentWindow.sSerialized());
|
||||
}
|
||||
}
|
||||
|
||||
internal void SetFirstHardware()
|
||||
{
|
||||
if (m_HardwareList.Count > 0)
|
||||
@@ -1180,26 +1206,24 @@ namespace WebWindowComplex
|
||||
|
||||
internal static Sash CreateSash(Area Area)
|
||||
{
|
||||
Sash NewSash = new Sash(Area, Area.ParentWindow);
|
||||
NewSash.SetAreaType(AreaTypes.SASH);
|
||||
NewSash.SetSashQty(1);
|
||||
NewSash.SetOrientationSashType(OrientationSash.VERTICAL);
|
||||
NewSash.SetIsSashVertical(true);
|
||||
// recupero numero di lati dell'area contenitore
|
||||
//int nOutlineLayerId = EgtGetFirstNameInGroup(Area.nAreaId, WIN_OUTLINE);
|
||||
//int nJointQty = EgtGetGroupObjs(nOutlineLayerId);
|
||||
Sash newSash = new Sash(Area, Area.ParentWindow);
|
||||
newSash.SetAreaType(AreaTypes.SASH);
|
||||
newSash.SetSashQty(1);
|
||||
newSash.SetOrientationSashType(OrientationSash.VERTICAL);
|
||||
newSash.SetIsSashVertical(true);
|
||||
for (var JointIndex = 0; JointIndex <= 3; JointIndex++)
|
||||
NewSash.JointList.Add(new Joint(NewSash, JointIndex + 1, Joints.FULL_H));
|
||||
NewSash.SetSashBottomRail(false);
|
||||
NewSash.SetSashBottomRailQty(0);
|
||||
//NewSash.RefreshHardwareList();
|
||||
NewSash.RefreshHardwareOptionList();
|
||||
//NewSash.SetFirstHardware();
|
||||
return NewSash;
|
||||
newSash.JointList.Add(new Joint(newSash, JointIndex + 1, Joints.FULL_H));
|
||||
newSash.SetSashBottomRail(false);
|
||||
newSash.SetSashBottomRailQty(0);
|
||||
newSash.RefreshHardwareList();
|
||||
newSash.RefreshHardwareOptionList();
|
||||
newSash.SetFirstHardware();
|
||||
return newSash;
|
||||
}
|
||||
private string FindSashShape()
|
||||
{
|
||||
// Return "R"
|
||||
//return "CHAMFER";
|
||||
return "RECTANGLE";
|
||||
}
|
||||
|
||||
@@ -1258,10 +1282,18 @@ namespace WebWindowComplex
|
||||
{
|
||||
if(m_SashList.Count > 1)
|
||||
{
|
||||
if (GetOpeningType(m_SashList[0].OpeningType) == OpeningTypes.TURNONLY)
|
||||
return "ANTA_BANDIERA";
|
||||
else
|
||||
return "ANTA_RIBALTA";
|
||||
for(int i = 0; i < m_SashList.Count; i++)
|
||||
{
|
||||
if (m_SashList[i].bHasHandle)
|
||||
{
|
||||
if (GetOpeningType(m_SashList[i].OpeningType) == OpeningTypes.TURNONLY)
|
||||
return "ANTA_BANDIERA";
|
||||
else
|
||||
return "ANTA_RIBALTA";
|
||||
}
|
||||
|
||||
}
|
||||
return "ANTA_BANDIERA";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1301,13 +1333,13 @@ namespace WebWindowComplex
|
||||
}
|
||||
}
|
||||
|
||||
public void RefreshHardwareList(List<Hardware> HardwareCompleteList, string nameFamily)
|
||||
public void RefreshHardwareList()
|
||||
{
|
||||
m_HardwareList.Clear();
|
||||
string sSashShape = FindSashShape();
|
||||
string sOpeningType = ConvertOpeningType();
|
||||
m_HardwareList = new ObservableCollection<Hardware>(from Hardware in HardwareCompleteList
|
||||
where Hardware.sId == "000000" || (Hardware.sFamily == nameFamily && Hardware.nSashQty == nSashQty && Hardware.sShape == sSashShape && Hardware.sOpeningType == sOpeningType)
|
||||
m_HardwareList = new ObservableCollection<Hardware>(from Hardware in m_HardwareCompleteList
|
||||
where Hardware.sId == "000000" || (Hardware.sFamily == s_SelFamilyHW && Hardware.nSashQty == nSashQty && Hardware.sShape == sSashShape && Hardware.sOpeningType == sOpeningType)
|
||||
select Hardware);
|
||||
}
|
||||
|
||||
@@ -1354,6 +1386,9 @@ namespace WebWindowComplex
|
||||
newSash.SetIsSashVertical(bIsSashVertical);
|
||||
newSash.SetOrientationSashType(OrientationSashType);
|
||||
newSash.SetSashBottomRailQty(SashBottomRailQty);
|
||||
newSash.RefreshHardwareList();
|
||||
newSash.RefreshHardwareOptionList();
|
||||
newSash.SetSelHardware(SelHardware);
|
||||
for (int i = 0; i <SashList.Count; i++)
|
||||
{
|
||||
//Cancello SashDimension di default e aggiungo la copia
|
||||
@@ -1376,7 +1411,7 @@ namespace WebWindowComplex
|
||||
|
||||
internal override JsonArea Serialize()
|
||||
{
|
||||
JsonSash JsonSash = new JsonSash(m_bIsSashVertical, m_SashType, m_bSashBottomRail, m_nSashBottomRailQty/*, m_SelHardware.sId*/);
|
||||
JsonSash JsonSash = new JsonSash(m_bIsSashVertical, m_SashType, m_bSashBottomRail, m_nSashBottomRailQty, m_SelHardware.sId);
|
||||
foreach (var SashDimension in SashList)
|
||||
JsonSash.SashList.Add(SashDimension.Serialize());
|
||||
foreach (var Joint in JointList)
|
||||
@@ -1840,7 +1875,7 @@ namespace WebWindowComplex
|
||||
}
|
||||
|
||||
public class Hardware
|
||||
{
|
||||
{
|
||||
private string m_sId;
|
||||
public string sId
|
||||
{
|
||||
@@ -1858,7 +1893,7 @@ namespace WebWindowComplex
|
||||
return m_sFamily;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private string m_sName;
|
||||
public string sName
|
||||
{
|
||||
@@ -2147,9 +2182,9 @@ namespace WebWindowComplex
|
||||
set
|
||||
{
|
||||
m_SelOpeningType = value;
|
||||
//m_Parent.RefreshHardwareList();
|
||||
//m_Parent.RefreshHardwareOptionList();
|
||||
//m_Parent.SetFirstHardware();
|
||||
m_Parent.RefreshHardwareList();
|
||||
m_Parent.RefreshHardwareOptionList();
|
||||
m_Parent.SetFirstHardware();
|
||||
}
|
||||
}
|
||||
public Openings OpeningType
|
||||
@@ -2172,6 +2207,9 @@ namespace WebWindowComplex
|
||||
set
|
||||
{
|
||||
m_SelOpeningType = (Openings)IdNameStruct.IdFromInd(value, m_OpeningTypeList);
|
||||
m_Parent.RefreshHardwareList();
|
||||
m_Parent.RefreshHardwareOptionList();
|
||||
m_Parent.SetFirstHardware();
|
||||
m_Parent.ParentWindow.OnUpdatePreview(m_Parent.ParentWindow.sSerialized());
|
||||
}
|
||||
}
|
||||
@@ -2647,7 +2685,6 @@ namespace WebWindowComplex
|
||||
// return ((IdNameStruct)List[i]).Id;
|
||||
// }
|
||||
// }
|
||||
|
||||
// return 0;
|
||||
// }
|
||||
//}
|
||||
@@ -2664,7 +2701,6 @@ namespace WebWindowComplex
|
||||
// return ((IdNameStruct)List[i]).Id;
|
||||
// }
|
||||
// }
|
||||
|
||||
// return 0;
|
||||
// }
|
||||
//}
|
||||
|
||||
Reference in New Issue
Block a user