update decoding objects

This commit is contained in:
Samuele Locatelli
2020-06-04 19:03:28 +02:00
parent eba5920137
commit 90ef09785c
6 changed files with 59 additions and 19 deletions
+22 -6
View File
@@ -610,8 +610,10 @@ namespace Thermo.Active.Config
.Elements()
.Select(x => new ModBlockConfigModel()
{
Id = Convert.ToInt16(x.Element("id").Value),
Label = x.Element("label").Value,
Id = Convert.ToInt16(x.Element("id").Value),
LocalizedLabels = x.Element("localizedLabels").Elements().ToDictionary(
y => y.Attribute("langKey").Value, y => y.Value
),
Type = GetTActMB_Type(x.Element("type").Value),
Section = GetTActMB_Section(x.Element("section").Value),
IdParam = Convert.ToInt16(x.Element("idParam").Value),
@@ -627,14 +629,28 @@ namespace Thermo.Active.Config
{
XDocument xmlConfigFile = GetXmlHandlerWithValidator(RISK_CONFIG_SCHEMA_PATH, RISK_CONFIG_PATH);
//// Read head config from XML file
//RiskConfig = xmlConfigFile
// Read head config from XML file
RiskResistConfig = xmlConfigFile
.Root
.Elements()
.Select(x => new RiskResistModel()
{
Id=0,
IdChannel = Convert.ToInt16(x.Element("canale").Value),
Row = Convert.ToInt16(x.Element("riga").Value),
Column=0,
Dimension=0
})
.ToList();
//RiskChannelConfig = xmlConfigFile
// .Root
// .Elements()
// .Select(x => new RiskConfigModel()
// .Select(x => new RiskChannelModel()
// {
// Id = Convert.ToInt16(x.Element("id").Value),
// Category = GetTActCategory(x.Element("category").Value),
// //Category = GetTActCategory(x.Element("category").Value),
// SubCategory_1 = x.Element("subCategory_1").Value,
// SubCategory_2 = x.Element("subCategory_2").Value,
// Name = x.Element("name").Value,