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
+2 -1
View File
@@ -34,7 +34,8 @@ namespace Thermo.Active.Config
public static List<HeadsConfigModel> HeadsConfig;
public static List<RecipeConfigModel> RecipeConfig;
public static List<ModBlockConfigModel> ModBlockConfig;
public static List<RiskConfigModel> RiskConfig;
public static List<RiskResistModel> RiskResistConfig;
public static List<RiskChannelModel> RiskChannelConfig;
public static CmsConnectConfigModel CmsConnectConfig;
public static AreasConfigModel ProductionConfig;
+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,
@@ -75,7 +75,7 @@
<Content Include="Config\recipeConfig.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Config\risk2007Config.xml">
<Content Include="Config\risk2007.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Config\userSoftKeyConfig.xml">
@@ -171,7 +171,7 @@
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Config\risk2007ConfigValidator.xsd">
<EmbeddedResource Include="Config\risk2007Validator.xsd">
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
@@ -6,7 +6,7 @@ namespace Thermo.Active.Model.ConfigModels
public class ModBlockConfigModel
{
public int Id;
public string Label { get; set; }
public Dictionary<string,string> LocalizedLabels { get; set; }
public TACT_MBLOCK_TYPE Type { get; set; }
public TACT_MBLOCK_SECTION Section { get; set; }
public int IdParam{ get; set; }
@@ -3,14 +3,37 @@ using static Thermo.Active.Model.Constants;
namespace Thermo.Active.Model.ConfigModels
{
public class RiskConfigModel
public class RiskRiflettore
{
public int Tipo;
public List<RiskResistenza> resistenza;
}
public class RiskResistenza
{
public int Tipo;
public int Riga;
public int Canale;
}
public class RiskRiferimenti
{
public int Id;
public TACT_PARAM_TYPE Category { get; set; }
public string SubCategory_1 { get; set; }
public string SubCategory_2 { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public string Format { get; set; }
public int Potenza;
public int Dimensione;
}
public class RiskResistModel
{
public int Id;
public int IdChannel;
public int Column;
public int Row;
public int Dimension;
}
public class RiskChannelModel
{
public int IdChannel;
public int IdReflector;
public int SetpointRecipe;
public int SetpointThermo;
public int MaxPower;
}
}
+2 -2
View File
@@ -238,8 +238,8 @@ namespace Thermo.Active.Model
public const string MODBLOCK_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "moduleBlockConfigValidator.xsd";
public const string MODBLOCK_CONFIG_PATH = CONFIG_DIRECTORY + "moduleBlockConfig.xml";
public const string RISK_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "risk2007ConfigValidator.xsd";
public const string RISK_CONFIG_PATH = CONFIG_DIRECTORY + "risk2007Config.xml";
public const string RISK_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "risk2007Validator.xsd";
public const string RISK_CONFIG_PATH = CONFIG_DIRECTORY + "risk2007.xml";
public const string NC_SOFTKEYS_CONFIG_SCHEMA_PATH = RESOURCE_DIRECTORY + "ncSoftKeyConfigValidator.xsd";
public const string NC_SOFTKEYS_CONFIG_PATH = CONFIG_DIRECTORY + "ncSoftKeyConfig.xml";