diff --git a/Thermo.Active.Config/Config/moduleBlockConfigValidator.xsd b/Thermo.Active.Config/Config/moduleBlockConfigValidator.xsd index 90e99fb6..5dbe717c 100644 --- a/Thermo.Active.Config/Config/moduleBlockConfigValidator.xsd +++ b/Thermo.Active.Config/Config/moduleBlockConfigValidator.xsd @@ -14,6 +14,8 @@ + + diff --git a/Thermo.Active.Config/ServerConfigController.cs b/Thermo.Active.Config/ServerConfigController.cs index e1bcf9db..18dc9845 100644 --- a/Thermo.Active.Config/ServerConfigController.cs +++ b/Thermo.Active.Config/ServerConfigController.cs @@ -625,7 +625,7 @@ namespace Thermo.Active.Config NumDec = Convert.ToInt32(x.Element("numDec").Value), MinVal = Convert.ToInt32(x.Element("minVal").Value), MaxVal = Convert.ToInt32(x.Element("maxVal").Value), - + }) .ToList(); } @@ -644,14 +644,14 @@ namespace Thermo.Active.Config { Id = Convert.ToInt16(x.Element("id").Value), Label = x.Element("label").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), ShowDelay = Convert.ToBoolean(x.Element("showDelay").Value), - Priority = Convert.ToInt16(x.Element("priority").Value) + Priority = Convert.ToInt16(x.Element("priority").Value), + // attributi presi da default se NON presenti... + ScaleFactor = x.Element("scaleFactor") != null ? Convert.ToInt16(x.Element("scaleFactor").Value) : 1000, + NumDec = x.Element("numDec") != null ? Convert.ToInt16(x.Element("numDec").Value) : 1 }) .ToList(); } diff --git a/Thermo.Active.Model/ConfigModels/ModBlockConfigModel.cs b/Thermo.Active.Model/ConfigModels/ModBlockConfigModel.cs index 7f47779f..44ca2c80 100644 --- a/Thermo.Active.Model/ConfigModels/ModBlockConfigModel.cs +++ b/Thermo.Active.Model/ConfigModels/ModBlockConfigModel.cs @@ -12,5 +12,7 @@ namespace Thermo.Active.Model.ConfigModels public int IdParam { get; set; } public bool ShowDelay { get; set; } public int Priority { get; set; } + public int ScaleFactor { get; set; } = 1000; + public int NumDec { get; set; } = 1; } } diff --git a/Thermo.Active.Model/ConfigModels/RecipeConfigModel.cs b/Thermo.Active.Model/ConfigModels/RecipeConfigModel.cs index 31f25568..43eed0fd 100644 --- a/Thermo.Active.Model/ConfigModels/RecipeConfigModel.cs +++ b/Thermo.Active.Model/ConfigModels/RecipeConfigModel.cs @@ -12,8 +12,8 @@ namespace Thermo.Active.Model.ConfigModels public string Name { get; set; } public string Description { get; set; } public string Format { get; set; } - public int ScaleFactor { get; set; } - public int NumDec { get; set; } + public int ScaleFactor { get; set; } = 1; + public int NumDec { get; set; } = 0; public Dictionary EnumVal { get; set; } public string Anim { get; set; } } diff --git a/Thermo.Active.Model/DTOModels/ThModules/DTOModulesBlock.cs b/Thermo.Active.Model/DTOModels/ThModules/DTOModulesBlock.cs index e63cd958..7a237c60 100644 --- a/Thermo.Active.Model/DTOModels/ThModules/DTOModulesBlock.cs +++ b/Thermo.Active.Model/DTOModels/ThModules/DTOModulesBlock.cs @@ -13,10 +13,12 @@ namespace Thermo.Active.Model.DTOModels.ThModules public int IdParam { get; set; } = 0; public bool ShowDelay { get; set; } = false; public int Priority { get; set; } = 0; - public int ActualDelay { get; set; } = 0; - public int ActualDuration { get; set; } = 0; - public int EstimatedDelay { get; set; } = 0; - public int EstimatedDuration { get; set; } = 0; + public int ScaleFactor { get; set; } = 1000; + public int NumDec { get; set; } = 1; + public double ActualDelay { get; set; } = 0; + public double ActualDuration { get; set; } = 0; + public double EstimatedDelay { get; set; } = 0; + public double EstimatedDuration { get; set; } = 0; public List PrecedingId { get; set; } = new List(); public bool Visible { get; set; } = false; public bool Running { get; set; } = false; @@ -42,6 +44,10 @@ namespace Thermo.Active.Model.DTOModels.ThModules return false; if (Priority != item.Priority) return false; + if (ScaleFactor != item.ScaleFactor) + return false; + if (NumDec != item.NumDec) + return false; if (ActualDelay != item.ActualDelay) return false; if (ActualDuration != item.ActualDuration)