프로젝트

일반

사용자정보

개정판 30d2cfcc

ID30d2cfcc1b954acc72b9a0cc85dbfb9fafb15146
상위 1421f1d6
하위 17d9dc0d

gaqhf 이(가) 5년 이상 전에 추가함

dev issue #000 : edit read xml and ChildSymbol 설정 추가

Change-Id: Iba7d86dc217eb2903c71ca9af44e65fb7de68927

차이점 보기:

DTI_PID/BaseModel/Model/ChildSymbol.cs
8 8
{
9 9
    public class ChildSymbol
10 10
    {
11
        private int _ParentAt;
12
        private string _Direction;
13
        private string _NAME;
14
        private List<ChildSymbol> _ChildSymbols = new List<ChildSymbol>();
15
        private List<Connector> _Connectors = new List<Connector>();
11 16

  
17
        public string NAME { get => _NAME; set => _NAME = value; }
18
        public List<ChildSymbol> ChildSymbols { get => _ChildSymbols; set => _ChildSymbols = value; }
19
        public int ParentAt { get => _ParentAt; set => _ParentAt = value; }
20
        public string Direction { get => _Direction; set => _Direction = value; }
21
        public List<Connector> Connectors { get => _Connectors; set => _Connectors = value; }
12 22
    }
13 23
}
DTI_PID/BaseModel/Model/Document.cs
61 61
                Symbol symbol = new Symbol()
62 62
                {
63 63
                    UID = item.Element("UID").Value,
64
                    DBUID = item.Element("DBUID").Value,
64 65
                    NAME = item.Element("NAME").Value,
65 66
                    TYPE = item.Element("TYPE").Value,
66 67
                    OWNER = item.Element("OWNER").Value,
......
80 81
                SetSymbolConnectors(item.Element("CONNECTORS"), symbol.CONNECTORS, symbol.CONNECTIONPOINT);
81 82
                SetProperties(item.Element("PROPERTIES"), symbol.PROPERTIES);
82 83
                SetAttributes(item.Element("SYMBOLATTRIBUTES"), symbol.ATTRIBUTES);
83

  
84
                //// Child
85
                //if (!string.IsNullOrEmpty(symbol.CONNECTIONPOINT) && symbol.CONNECTIONPOINT != "None")
86
                //{
87
                //    string[] array = symbol.CONNECTIONPOINT.Split(new char[] { '/' });
88
                //    for (int i = 0; i < array.Length; i++)
89
                //    {
90
                //        string[] arrConn = array[i].Split(new char[] { ',' });
91
                //        symbol.CONNECTORS[i].INDEX = Convert.ToInt32(arrConn[3]);
92
                //    }
93
                //}
84
                SetChildSymbol(symbol);
94 85

  
95 86
                SYMBOLS.Add(symbol);
96 87
            }
......
107 98
                    STARTPOINT = item.Element("STARTPOINT").Value,
108 99
                    ENDPOINT = item.Element("ENDPOINT").Value,
109 100
                    TYPE = item.Element("TYPE").Value,
101
                    TYPEUID = item.Element("TYPE").Attribute("TYPEUID").Value,
110 102
                    AREA = item.Element("AREA").Value,
111 103
                    THICKNESS = item.Element("THICKNESS").Value,
112 104
                };
......
224 216
        {
225 217
            foreach (XElement item in node.Elements("PROPERTY"))
226 218
            {
227
                try
228
                {
229
                    properties.Add(new Property()
230
                    {
231
                        UID = item.Attribute("UID").Value,
232
                        LENGTH = item.Attribute("Length").Value,
233
                        EXPRESSION = item.Attribute("Expression").Value,
234
                        DISPLAYATTRIBUTE = item.Attribute("DisplayAttribute").Value,
235
                        ATTRIBUTETYPE = item.Attribute("AttributeType").Value,
236
                        ATTRIBUTE = item.Attribute("Attribute").Value,
237
                        VALUE = item.Value
238
                    });
239
                }
240
                catch (Exception ex)
219
                properties.Add(new Property()
241 220
                {
242

  
243
                }
221
                    UID = item.Attribute("UID").Value,
222
                    LENGTH = item.Attribute("Length").Value,
223
                    EXPRESSION = item.Attribute("Expression").Value,
224
                    DISPLAYATTRIBUTE = item.Attribute("DisplayAttribute").Value,
225
                    ATTRIBUTETYPE = item.Attribute("AttributeType").Value,
226
                    ATTRIBUTE = item.Attribute("Attribute").Value,
227
                    VALUE = item.Value
228
                });
244 229
            }
245 230
        }
246 231

  
247 232
        private void SetAttributes(XElement node, List<Attribute> attributes)
248 233
        {
249
            foreach (XElement item in node.Elements("PROPERTY"))
234
            foreach (XElement item in node.Elements("ATTRIBUTE"))
250 235
            {
251 236
                attributes.Add(new Attribute()
252 237
                {
......
256 241
                    DISPLAYATTRIBUTE = item.Attribute("DisplayAttribute").Value,
257 242
                    ATTRIBUTETYPE = item.Attribute("AttributeType").Value,
258 243
                    ATTRIBUTE = item.Attribute("Attribute").Value,
244
                    ATTRAT = item.Attribute("AttrAt").Value,
259 245
                    VALUE = item.Value
260 246
                });
261 247
            }
......
284 270
                lineNumberRuns.Add(run);
285 271
            }
286 272
        }
273

  
274
        private void SetChildSymbol(Symbol symbol)
275
        {
276
            List<ChildSymbol> childList = new List<ChildSymbol>();
277
            if (!string.IsNullOrEmpty(symbol.CHILD) && symbol.CHILD != "None")
278
            {
279
                string[] childArray = symbol.CHILD.Split(new char[] { '/' });
280
                foreach (string sChild in childArray)
281
                {
282
                    string[] sChildInfo = sChild.Split(new char[] { ',' });
283
                    childList.Add(new ChildSymbol()
284
                    {
285
                        ParentAt = Convert.ToInt32(sChildInfo[0]),
286
                        Direction = sChildInfo[1],
287
                        NAME = sChildInfo[2]
288
                    });
289
                }
290

  
291
                foreach (ChildSymbol child in childList)
292
                {
293
                    if (child.ParentAt == 0)
294
                        symbol.ChildSymbols.Add(child);
295
                    else
296
                        childList[child.ParentAt - 1].ChildSymbols.Add(child);
297
                }
298
            }
299
            if (!string.IsNullOrEmpty(symbol.CONNECTIONPOINT) && symbol.CONNECTIONPOINT != "None")
300
            {
301
                string[] connectionArray = symbol.CONNECTIONPOINT.Split(new char[] { '/' });
302
                string[] array = symbol.CONNECTIONPOINT.Split(new char[] { '/' });
303
                for (int i = 0; i < array.Length; i++)
304
                {
305
                    string[] arrConn = array[i].Split(new char[] { ',' });
306
                    int connIndex = Convert.ToInt32(arrConn[3]);
307
                    if (connIndex != 0)
308
                        childList[connIndex - 1].Connectors.Add(symbol.CONNECTORS[i]);
309
                }
310
            }
311
        }
287 312
        #endregion
288 313

  
289 314
        public Symbol GetSymbolByUID(string uid)
DTI_PID/BaseModel/Model/Line.cs
10 10
    {
11 11
        private string _OWNER;
12 12
        private string _UID;
13
        private string _TYPEUID;
13 14
        private string _STARTPOINT;
14 15
        private string _ENDPOINT;
15 16
        private string _TYPE;
......
25 26
        public string AREA { get => _AREA; set => _AREA = value; }
26 27
        public string THICKNESS { get => _THICKNESS; set => _THICKNESS = value; }
27 28
        public List<Connector> CONNECTORS { get => _CONNECTORS; set => _CONNECTORS = value; }
29
        public string TYPEUID { get => _TYPEUID; set => _TYPEUID = value; }
28 30
    }
29 31
}
DTI_PID/BaseModel/Model/Other/Attribute.cs
15 15
        private string _ATTRIBUTETYPE;
16 16
        private string _ATTRIBUTE;
17 17
        private string _VALUE;
18
        private string _ATTRAT;
18 19

  
19 20
        public string UID { get => _UID; set => _UID = value; }
20 21
        public string LENGTH { get => _LENGTH; set => _LENGTH = value; }
......
23 24
        public string ATTRIBUTETYPE { get => _ATTRIBUTETYPE; set => _ATTRIBUTETYPE = value; }
24 25
        public string ATTRIBUTE { get => _ATTRIBUTE; set => _ATTRIBUTE = value; }
25 26
        public string VALUE { get => _VALUE; set => _VALUE = value; }
27
        public string ATTRAT { get => _ATTRAT; set => _ATTRAT = value; }
26 28
    }
27 29
}
DTI_PID/BaseModel/Model/Symbol.cs
9 9
    public class Symbol
10 10
    {
11 11
        private string _UID;
12
        private string _DBUID;
12 13
        private string _NAME;
13 14
        private List<Association> _ASSOCIATIONS = new List<Association>();
14 15
        private string _TYPE;
......
49 50
        public List<Attribute> ATTRIBUTES { get => _ATTRIBUTES; set => _ATTRIBUTES = value; }
50 51
        public int CURRENTPOINTMODEINDEX { get => _CURRENTPOINTMODEINDEX; set => _CURRENTPOINTMODEINDEX = value; }
51 52
        public List<ChildSymbol> ChildSymbols { get => _ChildSymbols; set => _ChildSymbols = value; }
53
        public string DBUID { get => _DBUID; set => _DBUID = value; }
52 54
    }
53 55
}

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)