Fix decoding of softkey new data

This commit is contained in:
Samuele Locatelli
2020-07-21 17:46:03 +02:00
parent 0f23124a17
commit fa9a477a88
4 changed files with 20 additions and 1 deletions
@@ -518,6 +518,8 @@ namespace Thermo.Active.Config
IsActive = Convert.ToBoolean(x.Element("active").Value),
IsVisible = Convert.ToBoolean(x.Element("visible").Value),
IsStarred = x.Element("starred") != null ? Convert.ToBoolean(x.Element("starred").Value) : false,
RefCallParam = x.Element("refCallParam") != null ? x.Element("refCallParam").Value : "",
RefCallLabel = x.Element("refCallLabel") != null ? x.Element("refCallLabel").Value : "",
Category = Convert.ToInt32(x.Element("category").Value),
LocalizedNames = x.Element("localizedNames").Elements().ToDictionary( // Read localized names and convert into a dictionary
y => y.Attribute("langKey").Value, y => y.Value
@@ -760,7 +762,7 @@ namespace Thermo.Active.Config
SetpointThermo = 0,
MaxPower = riferimento.Potenza,
NumResist = 1,
CalcIchMin = riferimento.Modello.Contains("Quarzo") || riferimento.Modello.Contains("Alogena")
CalcIchMin = riferimento.Modello.Contains("Quarzo") || riferimento.Modello.Contains("Alogena")
});
}
else
@@ -11,6 +11,8 @@ namespace Thermo.Active.Model.ConfigModels
public bool IsActive { get; set; }
public bool IsVisible { get; set; }
public bool IsStarred { get; set; } = false;
public string RefCallParam { get; set; } = "";
public string RefCallLabel { get; set; } = "";
public bool OperatorConfirmationNeeded { get; set; }
public List<SubKeysModel> SubKeys { get; set; }
public int PlcId { get; set; }
@@ -20,6 +20,8 @@ namespace Thermo.Active.Model.DTOModels
public bool Visible { get; set; }
public bool Starred { get; set; } = false;
public bool Value { get; set; }
public string RefCallParam { get; set; } = "";
public string RefCallLabel { get; set; } = "";
public override bool Equals(object obj)
{
@@ -34,6 +36,10 @@ namespace Thermo.Active.Model.DTOModels
return false;
if (Value != item.Value)
return false;
if (RefCallParam != item.RefCallParam)
return false;
if (RefCallLabel != item.RefCallLabel)
return false;
return true;
}
@@ -43,4 +49,5 @@ namespace Thermo.Active.Model.DTOModels
return base.GetHashCode();
}
}
}
+8
View File
@@ -1011,6 +1011,8 @@ namespace Thermo.Active.NC
Id = subkey.Id,
Active = plcSoftKey.Active,
Starred = softKey.IsStarred,
RefCallParam = softKey.RefCallParam,
RefCallLabel = softKey.RefCallLabel,
Category = softKey.Category,
Value = plcSoftKey.Value
});
@@ -1032,6 +1034,8 @@ namespace Thermo.Active.NC
Id = softKey.Id,
Active = plcSoftKey.Active,
Starred = softKey.IsStarred,
RefCallParam = softKey.RefCallParam,
RefCallLabel = softKey.RefCallLabel,
Category = softKey.Category,
Visible = softKey.IsVisible,
Value = plcSoftKey.Value
@@ -1071,6 +1075,8 @@ namespace Thermo.Active.NC
Id = subkey.Id,
Active = plcSoftKey.Active,
Starred = softKey.IsStarred,
RefCallParam = softKey.RefCallParam,
RefCallLabel = softKey.RefCallLabel,
Category = softKey.Category,
Value = plcSoftKey.Value
});
@@ -1098,6 +1104,8 @@ namespace Thermo.Active.NC
Id = softKey.Id,
Active = plcSoftKey.Active,
Starred = softKey.IsStarred,
RefCallParam = softKey.RefCallParam,
RefCallLabel = softKey.RefCallLabel,
Category = softKey.Category,
Visible = softKey.IsVisible,
Value = plcSoftKey.Value