Aggiornamento profili degli elementi
This commit is contained in:
@@ -128,10 +128,10 @@ Vengono richieste nei seguenti casi:
|
||||
|
||||
Descrive il tipo di riempimento: vetro o pannello.
|
||||
|
||||
# Richieste di informazioni a EgwMultiEnginManager
|
||||
## Richieste di informazioni a EgwMultiEnginManager
|
||||
|
||||
Nel componente sono presenti quattro tipi di richieste di informazioni al programma EgwMultiEngineManager:
|
||||
1. SVG: serve per avere SVG dato il JWD per poter rappresentare il disegno. La domanda è costituita dal JWD e la risposta contiene il SVG;
|
||||
2. Forma del telaio: serve per poter avere la lista degli hardware coerenti con le caratteristiche scelte. La domanda è costituita dal JWD e dalla lista di groupId interessati. La risposta contiene un dizionario di valori interi-stringa che rappresentano groupId-forma;
|
||||
3. Hardware option: serve per avere le opzioni relative all'hardware selezionato. La domanda è costituita dal JWD e la lista di groupId interessati. La risposta contiene un dizionario interi-stringa che rappresentano groupId-opzioni hardware. Le opzioni hardware sono restituite in formato xml;
|
||||
4. Profili degli elementi: serve per avere i profili degli elementi del groupId richiesto (nel caso di gruppi di ante gli elemeneti sono specificati per ogni anta). La domanda è costituita dal JWD e dalla lista di groupId interessati. La risposta contiene un dizionario di valori interi-stringhe.
|
||||
4. Profili degli elementi: serve per avere i profili degli elementi groupId richiesto (nel caso di gruppi di ante gli elemeneti sono specificati per ogni anta). La domanda è costituita dal JWD e dalla lista di groupId interessati. La risposta contiene un dizionario di valori interi-stringhe.
|
||||
|
||||
@@ -539,15 +539,6 @@ namespace WebWindowComplex.Json
|
||||
}
|
||||
}
|
||||
|
||||
private List<JsonElementDimension> m_ElemDimHorizList = new List<JsonElementDimension>();
|
||||
[JsonProperty]
|
||||
public List<JsonElementDimension> ElementDimHorizList
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_ElemDimHorizList;
|
||||
}
|
||||
}
|
||||
|
||||
private List<JsonElementDimension> m_ElemDimVertList = new List<JsonElementDimension>();
|
||||
[JsonProperty]
|
||||
@@ -559,6 +550,15 @@ namespace WebWindowComplex.Json
|
||||
}
|
||||
}
|
||||
|
||||
private List<JsonElementDimension> m_ElemDimHorizList = new List<JsonElementDimension>();
|
||||
[JsonProperty]
|
||||
public List<JsonElementDimension> ElementDimHorizList
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_ElemDimHorizList;
|
||||
}
|
||||
}
|
||||
public JsonSplit() : base(AreaTypes.SPLIT)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -43,7 +43,6 @@ namespace WebWindowComplex.Models
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int nIndex
|
||||
{
|
||||
get
|
||||
@@ -72,7 +71,6 @@ namespace WebWindowComplex.Models
|
||||
return m_ParentArea;
|
||||
}
|
||||
}
|
||||
|
||||
public double dOverlap
|
||||
{
|
||||
get
|
||||
@@ -105,6 +103,10 @@ namespace WebWindowComplex.Models
|
||||
m_sName = dValue;
|
||||
}
|
||||
|
||||
public void SetOverlapElement(double dValue)
|
||||
{
|
||||
m_dOverlap = dValue;
|
||||
}
|
||||
|
||||
public ElementDimension Copy()
|
||||
{
|
||||
@@ -116,11 +118,6 @@ namespace WebWindowComplex.Models
|
||||
|
||||
#region Internal Methods
|
||||
|
||||
internal void SetOverlap(double overlap)
|
||||
{
|
||||
m_dOverlap = overlap;
|
||||
}
|
||||
|
||||
internal JsonElementDimension Serialize()
|
||||
{
|
||||
JsonElementDimension JsonElementDimension = new JsonElementDimension(m_nIndex, m_dDimension);
|
||||
@@ -129,14 +126,10 @@ namespace WebWindowComplex.Models
|
||||
|
||||
#endregion Internal Methods
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected Area m_ParentArea;
|
||||
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private Area m_ParentArea;
|
||||
|
||||
private double m_dDimension;
|
||||
|
||||
private double m_dOverlap;
|
||||
|
||||
@@ -765,7 +765,7 @@ namespace WebWindowComplex
|
||||
// Inserisco i profili ricevuti nei rispettivi Element
|
||||
foreach (var item in LiveData.DictElement)
|
||||
{
|
||||
|
||||
UpdateProfileElement(null, item.Key);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1049,22 +1049,45 @@ namespace WebWindowComplex
|
||||
AdvStep(CompileStep.Tree);
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// Metodo per cercare un area precisa
|
||||
///// </summary>
|
||||
///// <param name="currentArea"> Area che si sta analizzando </param>
|
||||
///// <param name="idSearch"> Id Area che si sta cercando </param>
|
||||
///// <param name="itemSearch"> Area che si sta cercando </param>
|
||||
///// <returns></returns>
|
||||
//private Area SearchArea(Area currentArea, int idSearch, Area itemSearch)
|
||||
//{
|
||||
// if (currentArea.GroupId == idSearch && currentArea.AreaType.Equals(itemSearch.AreaType))
|
||||
// {
|
||||
// return currentArea;
|
||||
// }
|
||||
// foreach (Area child in currentArea.AreaList)
|
||||
// {
|
||||
// Area found = SearchArea(child, idSearch, itemSearch);
|
||||
// if (found != null)
|
||||
// {
|
||||
// return found;
|
||||
// }
|
||||
// }
|
||||
// return null;
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per cercare un area precisa
|
||||
/// Metodo per cercare un area precisa partendo da GroupId
|
||||
/// </summary>
|
||||
/// <param name="currentArea"> Area che si sta analizzando </param>
|
||||
/// <param name="idSearch"> Id Area che si sta cercando </param>
|
||||
/// <param name="itemSearch"> Area che si sta cercando </param>
|
||||
/// <returns></returns>
|
||||
private Area SearchArea(Area currentArea, int idSearch, Area itemSearch)
|
||||
private Area SearchAreaFromGroupId(Area currentArea, int idSearch)
|
||||
{
|
||||
if (currentArea.GroupId == idSearch && currentArea.AreaType.Equals(itemSearch.AreaType))
|
||||
if (currentArea.GroupId == idSearch)
|
||||
{
|
||||
return currentArea;
|
||||
}
|
||||
foreach (Area child in currentArea.AreaList)
|
||||
{
|
||||
Area found = SearchArea(child, idSearch, itemSearch);
|
||||
Area found = SearchAreaFromGroupId(child, idSearch);
|
||||
if (found != null)
|
||||
{
|
||||
return found;
|
||||
@@ -1074,50 +1097,61 @@ namespace WebWindowComplex
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per cercare un area precisa
|
||||
/// Metodo per aggiornare i nomi dei profili degli elementi
|
||||
/// </summary>
|
||||
/// <param name="currentArea"> Area che si sta analizzando </param>
|
||||
/// <param name="idSearch"> Id Area che si sta cercando </param>
|
||||
/// <param name="index"> Indice che si sta cercando </param>
|
||||
/// <param name="profileNameList"> Lista dei profili </param>
|
||||
/// <param name="GroupIdSearch"> Id Area che si sta cercando </param>
|
||||
/// <param name="SashIdSearch"> Id dell'anta (se -1 non usare) </param>
|
||||
/// <returns></returns>
|
||||
private Area UpdateIdElement(Area currentArea, int idSearch, int index)
|
||||
private void UpdateProfileElement(List<string> profileNameList, int GroupIdSearch, int SashIdSearch = -1)
|
||||
{
|
||||
switch (currentArea.AreaType)
|
||||
// Cerco area corrispondente al GroupId
|
||||
Area found = SearchAreaFromGroupId(FrameWindow, SashIdSearch);
|
||||
switch (found.AreaType)
|
||||
{
|
||||
case AreaTypes.FRAME:
|
||||
{
|
||||
Frame frame = (Frame)currentArea;
|
||||
foreach(var item in frame.ElementDimensionList)
|
||||
Frame frame = (Frame)found;
|
||||
for(int i = 0; i < frame.ElementDimensionList.Count; i++)
|
||||
{
|
||||
//if(item.nIndex == index)
|
||||
|
||||
frame.ElementDimensionList.ElementAt(i).SetNameElement(profileNameList.ElementAt(i));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case AreaTypes.SASH:
|
||||
{
|
||||
Sash sash = (Sash)found;
|
||||
SashDimension anta = sash.SashList.ElementAt(SashIdSearch);
|
||||
for (int i = 0; i < anta.ElementDimensionList.Count; i++)
|
||||
{
|
||||
anta.ElementDimensionList.ElementAt(i).SetNameElement(profileNameList.ElementAt(i));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case AreaTypes.SPLIT:
|
||||
{
|
||||
Split split = (Split)found;
|
||||
for (int i = 0; i < split.ElemDimHorizList.Count; i++)
|
||||
{
|
||||
split.ElemDimHorizList.ElementAt(i).SetNameElement(profileNameList.ElementAt(i));
|
||||
}
|
||||
for (int i = split.ElemDimHorizList.Count; i < split.ElemDimVertList.Count; i++)
|
||||
{
|
||||
split.ElemDimVertList.ElementAt(i).SetNameElement(profileNameList.ElementAt(i));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
foreach (Area child in currentArea.AreaList)
|
||||
foreach (Area child in found.AreaList)
|
||||
{
|
||||
Area found = UpdateIdElement(child, idSearch, index);
|
||||
if (found != null)
|
||||
{
|
||||
return found;
|
||||
}
|
||||
UpdateProfileElement(profileNameList, GroupIdSearch, SashIdSearch);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo per aggiornare valori della sezione General
|
||||
/// </summary>
|
||||
/// <param name="newVal"></param>
|
||||
/// <param name="args"></param>
|
||||
private void UpdatePreviewGeneral(DataUpdateGeneral args)
|
||||
{
|
||||
string Color = args.Color;
|
||||
@@ -1209,7 +1243,7 @@ namespace WebWindowComplex
|
||||
if (newFill != null)
|
||||
{
|
||||
// cerco il record
|
||||
var currRec = (Fill)SearchArea(FrameWindow, newFill.GroupId, newFill);
|
||||
var currRec = (Fill)SearchAreaFromGroupId(FrameWindow, newFill.GroupId);
|
||||
// lo aggiorno
|
||||
currRec = newFill;
|
||||
await DoPreviewSvg();
|
||||
@@ -1302,7 +1336,7 @@ namespace WebWindowComplex
|
||||
if (newSash != null)
|
||||
{
|
||||
// cerco il record
|
||||
var currRec = SearchArea(FrameWindow, newSash.GroupId, newSash);
|
||||
var currRec = SearchAreaFromGroupId(FrameWindow, newSash.GroupId);
|
||||
// lo aggiorno
|
||||
currRec = newSash;
|
||||
// resetto hw lst
|
||||
@@ -1325,7 +1359,7 @@ namespace WebWindowComplex
|
||||
if (newSash != null)
|
||||
{
|
||||
// cerco il record
|
||||
var currRec = SearchArea(FrameWindow, newSash.GroupId, newSash);
|
||||
var currRec = SearchAreaFromGroupId(FrameWindow, newSash.GroupId);
|
||||
// lo aggiorno
|
||||
currRec = newSash;
|
||||
// resetto hw lst
|
||||
@@ -1350,7 +1384,7 @@ namespace WebWindowComplex
|
||||
if (newSplit != null)
|
||||
{
|
||||
// cerco il record
|
||||
var currRec = SearchArea(FrameWindow, newSplit.GroupId, newSplit);
|
||||
var currRec = SearchAreaFromGroupId(FrameWindow, newSplit.GroupId);
|
||||
// lo aggiorno
|
||||
currRec = newSplit;
|
||||
if (!noSvg)
|
||||
@@ -1372,7 +1406,7 @@ namespace WebWindowComplex
|
||||
{
|
||||
if (currSplitted != null)
|
||||
{
|
||||
var item = SearchArea(FrameWindow, currSplitted.GroupId, currSplitted);
|
||||
var item = SearchAreaFromGroupId(FrameWindow, currSplitted.GroupId);
|
||||
item = currSplitted;
|
||||
// ricalcolo liste
|
||||
UpdateLists();
|
||||
@@ -1396,7 +1430,7 @@ namespace WebWindowComplex
|
||||
bool noSvg = args.noSvg;
|
||||
if (svgNoHw)
|
||||
{
|
||||
Sash item = (Sash)SearchArea(FrameWindow, newSash.GroupId, newSash);
|
||||
Sash item = (Sash)SearchAreaFromGroupId(FrameWindow, newSash.GroupId);
|
||||
if (newSash != null && item != null)
|
||||
{
|
||||
item = newSash;
|
||||
@@ -1405,7 +1439,7 @@ namespace WebWindowComplex
|
||||
}
|
||||
else
|
||||
{
|
||||
Sash item = (Sash)SearchArea(FrameWindow, newSash.GroupId, newSash);
|
||||
Sash item = (Sash)SearchAreaFromGroupId(FrameWindow, newSash.GroupId );
|
||||
if (newSash != null && item != null)
|
||||
{
|
||||
item = newSash;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>2.8.1.2613</Version>
|
||||
<Version>2.8.1.2616</Version>
|
||||
<Authors>Annamaria Sassi</Authors>
|
||||
<Company>Egalware</Company>
|
||||
<Description>Componente gestione Configurazioni avanzate Window per LUX</Description>
|
||||
@@ -95,6 +95,9 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>2.8.1.2613</Version>
|
||||
<Version>2.8.1.2616</Version>
|
||||
<Authors>Annamaria Sassi</Authors>
|
||||
<Company>Egalware</Company>
|
||||
<Description>Componente gestione JWD per LUX</Description>
|
||||
@@ -138,6 +138,11 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user