개정판 4328cb06
dev issue #1230 : fix AttributeInfo
Change-Id: I9cf59fd66bfd28460688738e2b9843158d492d0c
DTI_PID/APIDConverter/AutoModeling.cs | ||
---|---|---|
344 | 344 |
} |
345 | 345 |
private void SetSymbolAttribute(Model.Symbol symbol) |
346 | 346 |
{ |
347 |
foreach (var attribute in symbol.ATTRIBUTES) |
|
348 |
{ |
|
349 |
AttributeInfo info = avevaInfo.AttributeInfo.Find(x => x.UID == attribute.UID); |
|
350 |
if (info != null) |
|
351 |
{ |
|
347 | 352 |
|
353 |
} |
|
354 |
} |
|
348 | 355 |
} |
349 | 356 |
#endregion |
350 | 357 |
|
DTI_PID/APIDConverter/AvevaInfo.cs | ||
---|---|---|
17 | 17 |
public DataTable AvevaSymbolTable { get; set; } |
18 | 18 |
public List<SymbolInfo> SymbolInfo { get; set; } |
19 | 19 |
public List<AttributeInfo> AttributeInfo { get; set; } |
20 |
|
|
21 | 20 |
public static AvevaInfo GetInstance() |
22 | 21 |
{ |
23 | 22 |
if (avevaInfo == null) |
... | ... | |
27 | 26 |
} |
28 | 27 |
return avevaInfo; |
29 | 28 |
} |
30 |
|
|
31 | 29 |
public static void Refresh() |
32 | 30 |
{ |
33 | 31 |
if (avevaInfo == null) |
... | ... | |
37 | 35 |
SetSymbolInfo(); |
38 | 36 |
SetAttributeInfo(); |
39 | 37 |
} |
40 |
|
|
41 | 38 |
private static void SetSymbolInfo() |
42 | 39 |
{ |
43 | 40 |
avevaInfo.SymbolInfo = new List<SymbolInfo>(); |
... | ... | |
53 | 50 |
} |
54 | 51 |
dt.Dispose(); |
55 | 52 |
} |
56 |
|
|
57 | 53 |
private static void SetAttributeInfo() |
58 | 54 |
{ |
59 | 55 |
avevaInfo.AttributeInfo = new List<AttributeInfo>(); |
... | ... | |
64 | 60 |
info.UID = DBNull.Value.Equals(row["UID"]) ? string.Empty : row["UID"].ToString(); |
65 | 61 |
info.APID_ATTRIBUTE = DBNull.Value.Equals(row["APID_ATTRIBUTE"]) ? string.Empty : row["APID_ATTRIBUTE"].ToString(); |
66 | 62 |
info.APID_ATTRIBUTE_TYPE = DBNull.Value.Equals(row["APID_ATTRIBUTE_TYPE"]) ? string.Empty : row["APID_ATTRIBUTE_TYPE"].ToString(); |
63 |
if (!string.IsNullOrEmpty(info.APID_ATTRIBUTE) && !string.IsNullOrEmpty(info.APID_ATTRIBUTE_TYPE)) |
|
64 |
{ |
|
65 |
string sRemove = "|" + info.APID_ATTRIBUTE_TYPE; |
|
66 |
info.APID_ATTRIBUTE = info.APID_ATTRIBUTE.Remove(info.APID_ATTRIBUTE.LastIndexOf(sRemove), sRemove.Length); |
|
67 |
} |
|
67 | 68 |
avevaInfo.AttributeInfo.Add(info); |
68 | 69 |
} |
69 | 70 |
dt.Dispose(); |
70 | 71 |
} |
71 | 72 |
} |
72 | 73 |
|
73 |
|
|
74 |
|
|
75 | 74 |
public class SymbolInfo |
76 | 75 |
{ |
77 | 76 |
public string UID { get; set; } |
내보내기 Unified diff