개정판 faba1fc7
dev issue #1230 : edit aveva AttributeInfo
Change-Id: If3a14f65dc236eb73a3af73b0d26104ca0f91aa6
DTI_PID/APIDConverter/AvevaInfo.cs | ||
---|---|---|
59 | 59 |
AttributeInfo info = new AttributeInfo(); |
60 | 60 |
info.UID = DBNull.Value.Equals(row["UID"]) ? string.Empty : row["UID"].ToString(); |
61 | 61 |
info.APID_ATTRIBUTE = DBNull.Value.Equals(row["APID_ATTRIBUTE"]) ? string.Empty : row["APID_ATTRIBUTE"].ToString(); |
62 |
string sType = DBNull.Value.Equals(row["APID_ATTRIBUTE_TYPE"]) ? string.Empty : row["APID_ATTRIBUTE_TYPE"].ToString(); |
|
63 |
if (!string.IsNullOrEmpty(info.APID_ATTRIBUTE) && !string.IsNullOrEmpty(sType)) |
|
64 |
{ |
|
65 |
string sRemove = "|" + sType; |
|
66 |
info.APID_ATTRIBUTE = info.APID_ATTRIBUTE.Remove(info.APID_ATTRIBUTE.LastIndexOf(sRemove), sRemove.Length); |
|
67 |
AvevaAttributeType type; |
|
68 |
if (Enum.TryParse(sType, out type)) |
|
69 |
info.APID_ATTRIBUTE_TYPE = type; |
|
70 |
} |
|
62 |
//string sType = DBNull.Value.Equals(row["APID_ATTRIBUTE_TYPE"]) ? string.Empty : row["APID_ATTRIBUTE_TYPE"].ToString();
|
|
63 |
//if (!string.IsNullOrEmpty(info.APID_ATTRIBUTE) && !string.IsNullOrEmpty(sType))
|
|
64 |
//{
|
|
65 |
// string sRemove = "|" + sType;
|
|
66 |
// info.APID_ATTRIBUTE = info.APID_ATTRIBUTE.Remove(info.APID_ATTRIBUTE.LastIndexOf(sRemove), sRemove.Length);
|
|
67 |
// AvevaAttributeType type;
|
|
68 |
// if (Enum.TryParse(sType, out type))
|
|
69 |
// info.APID_ATTRIBUTE_TYPE = type;
|
|
70 |
//}
|
|
71 | 71 |
avevaInfo.AttributeInfo.Add(info); |
72 | 72 |
} |
73 | 73 |
dt.Dispose(); |
... | ... | |
86 | 86 |
{ |
87 | 87 |
public string UID { get; set; } |
88 | 88 |
public string APID_ATTRIBUTE { get; set; } |
89 |
public AvevaAttributeType APID_ATTRIBUTE_TYPE { get; set; } |
|
90 |
} |
|
91 |
|
|
92 |
public enum AvevaAttributeType |
|
93 |
{ |
|
94 |
None, |
|
95 |
UDA, |
|
96 |
PipeAttribute, |
|
97 | 89 |
} |
98 | 90 |
} |
내보내기 Unified diff