inserita bozza deserializzazione (NON VA!!!)
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace OPC_UA_REDIS
|
||||
{
|
||||
@@ -24,19 +25,25 @@ namespace OPC_UA_REDIS
|
||||
/// </summary>
|
||||
public class ouBaseObj
|
||||
{
|
||||
[XmlAttribute("SymbolicName")]
|
||||
public string SymbolicName { get; set; }
|
||||
[XmlAttribute("BrowseName")]
|
||||
public string BrowseName { get; set; }
|
||||
[XmlAttribute("DataType")]
|
||||
public string DataType { get; set; }
|
||||
[XmlAttribute("ValueRank")]
|
||||
public string ValueRank { get; set; }
|
||||
}
|
||||
|
||||
public class ouProperty: ouBaseObj
|
||||
{
|
||||
[XmlAttribute("Value")]
|
||||
public string Value { get; set; }
|
||||
}
|
||||
|
||||
public class ouVariable: ouBaseObj
|
||||
{
|
||||
[XmlAttribute("Units")]
|
||||
public string Units { get; set; }
|
||||
}
|
||||
|
||||
@@ -44,10 +51,20 @@ namespace OPC_UA_REDIS
|
||||
|
||||
#region area oggetti deserializzazione
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto più esterno ModelDesign
|
||||
/// </summary>
|
||||
[XmlRoot("ModelDesign")]
|
||||
public class ModelDesign
|
||||
{
|
||||
public Machine Machine;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto più esterno Machine
|
||||
/// </summary>
|
||||
public class machine
|
||||
public class Machine
|
||||
{
|
||||
/// <summary>
|
||||
/// Property Model
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace SCMA
|
||||
using MTC;
|
||||
using OPC_UA_REDIS;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
#region macro oggetti da istanziare a blocchi da configurazione XML
|
||||
|
||||
@@ -1530,6 +1531,9 @@ namespace SCMA
|
||||
// leggo file...
|
||||
string rawDataModel = file.ReadToEnd();
|
||||
// deserializzo x inizializzare il mio adapter...
|
||||
XmlSerializer serializer = new XmlSerializer(typeof(DataModelClass.ModelDesign), new XmlRootAttribute("ModelDesign"));
|
||||
StringReader stringReader = new StringReader(rawDataModel);
|
||||
DataModelClass.Machine currMachine =((DataModelClass.ModelDesign)serializer.Deserialize(stringReader)).Machine;
|
||||
// !!!FARE!!!
|
||||
// pre-processo datamodel...
|
||||
currGateway.DataModel = xmlSanitize(rawDataModel);
|
||||
|
||||
Reference in New Issue
Block a user