Gestione hardware
This commit is contained in:
@@ -36,12 +36,16 @@ namespace WebWindowComplex
|
||||
if (value != null && (m_SelTemplate == null || (m_SelTemplate != null && value.nIndex != m_SelTemplate.nIndex)) && !string.IsNullOrEmpty(value.JWD))
|
||||
{
|
||||
m_SelTemplate = value;
|
||||
SelFamilyHardware = IN_SelFamilyHardware;
|
||||
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;
|
||||
}
|
||||
Sash.m_HardwareCompleteList = IN_HardwareList;
|
||||
Sash.s_FamilyHardwareList = IN_FamilyHardwareList;
|
||||
Sash.s_SelFamilyHW = IN_SelFamilyHardware;
|
||||
m_CurrWindow = WindowFromJson.Deserialize();
|
||||
m_CurrWindow.OnPreview += M_CurrWindow_OnPreview;
|
||||
// recupero dimensioni Frame e Joint Frame della finestra precedente
|
||||
@@ -65,10 +69,6 @@ namespace WebWindowComplex
|
||||
m_ItemTableList = new List<ItemTable>();
|
||||
CreateWindowsList(m_CurrWindow.AreaList[0], false);
|
||||
CreateElementTable(m_CurrWindow.AreaList[0], 1, 1, 1, 1);
|
||||
foreach (var item in SashList)
|
||||
{
|
||||
item.RefreshHardwareList(IN_HardwareList, IN_FamilyHardware);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -77,7 +77,10 @@ namespace WebWindowComplex
|
||||
public List<TemplateSelectDTO> IN_TemplateDTOList { get; set; } = null!;
|
||||
|
||||
[Parameter]
|
||||
public string IN_FamilyHardware { get; set; } = null;
|
||||
public List<string> IN_FamilyHardwareList { get; set; } = null!;
|
||||
|
||||
[Parameter]
|
||||
public string IN_SelFamilyHardware { get; set; } = null;
|
||||
|
||||
[Parameter]
|
||||
public List<Hardware> IN_HardwareList { get; set; } = null;
|
||||
@@ -187,6 +190,29 @@ namespace WebWindowComplex
|
||||
|
||||
protected TemplateSelectDTO? SelTemplateDTO { get; set; } = null;
|
||||
|
||||
protected string SelFamilyHardware
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_SelFamilyHardware;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_SelFamilyHardware = value;
|
||||
Sash.s_SelFamilyHW = value;
|
||||
for (int i = 0; i < SashList.Count; i++)
|
||||
{
|
||||
SashList[i].RefreshHardwareList();
|
||||
SashList[i].RefreshHardwareOptionList();
|
||||
SashList[i].SetFirstHardware();
|
||||
}
|
||||
if (m_CurrWindow != null)
|
||||
{
|
||||
m_CurrWindow.OnUpdatePreview(m_CurrWindow.sSerialized());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
@@ -242,6 +268,7 @@ namespace WebWindowComplex
|
||||
/// </summary>
|
||||
protected async Task DoReset()
|
||||
{
|
||||
SelFamilyHardware = IN_SelFamilyHardware;
|
||||
JsonWindow WindowFromJson = JsonConvert.DeserializeObject<JsonWindow>(m_SelTemplate.JWD, new PolymorphicJsonConverter()) ?? new JsonWindow("");
|
||||
if (m_CurrWindow != null)
|
||||
{
|
||||
@@ -532,28 +559,28 @@ namespace WebWindowComplex
|
||||
/// <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>
|
||||
/// <param name="n_type"> tipo di giunzione (ANGLED o FULL_H o FULL_V)</param>
|
||||
/// <param name="n_place"> oggetto a cui essere applicato (Frame o Sash)</param>
|
||||
/// <returns></returns>
|
||||
private async Task AllJointsFrame(int int_type, int int_place)
|
||||
private async Task AllJointsFrame(int n_type, int n_place)
|
||||
{
|
||||
Joints type = Joints.ANGLED;
|
||||
if (int_type == 2)
|
||||
if (n_type == 2)
|
||||
{
|
||||
type = Joints.FULL_H;
|
||||
}
|
||||
else if (int_type == 3)
|
||||
else if (n_type == 3)
|
||||
{
|
||||
type = Joints.FULL_V;
|
||||
}
|
||||
if (int_place == 0)
|
||||
if (n_place == 0)
|
||||
{
|
||||
foreach (Joint joint in FrameWindow.JointList)
|
||||
{
|
||||
joint.SetSelJointType(type);
|
||||
}
|
||||
}
|
||||
else if (int_place == 1)
|
||||
else if (n_place == 1)
|
||||
{
|
||||
foreach (Joint joint in m_SashList[0].JointList)
|
||||
{
|
||||
@@ -566,13 +593,12 @@ namespace WebWindowComplex
|
||||
/// <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>
|
||||
/// <param name="n_type"> tipo di riempimento (GLASS o WOOD)</param>
|
||||
/// <returns></returns>
|
||||
private async Task AllFill(int int_type)
|
||||
private async Task AllFill(int n_type)
|
||||
{
|
||||
FillTypes type = FillTypes.GLASS;
|
||||
if (int_type == 2)
|
||||
if (n_type == 2)
|
||||
{
|
||||
type = FillTypes.WOOD;
|
||||
}
|
||||
@@ -657,6 +683,8 @@ namespace WebWindowComplex
|
||||
|
||||
private Template m_SelTemplate { get; set; } = null!;
|
||||
|
||||
private string m_SelFamilyHardware { get; set; } = "";
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
Reference in New Issue
Block a user