프로젝트

일반

사용자정보

개정판 4b4dbca9

ID4b4dbca9d12f023aab8a8921ea996cabe5e2e371
상위 ac78b508
하위 7c990804, a30d7077

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

dev issue #000 : child Symbol Modeling

Change-Id: I26536f33fec33160b1efaf92f4fc5b45ccd48f9b

차이점 보기:

DTI_PID/SPPIDConverter/Model/SPPID_Document.cs
20 20
        private double testY = 0.55;
21 21

  
22 22
        public List<SymbolMapping> SymbolMappings;
23
        public List<ChildSymbolMapping> ChildSymbolMappings;
23 24
        public List<LineMapping> LineMappings;
24 25
        public List<LineNumberMapping> LineNumberMappings;
25 26
        public List<AttributeMapping> AttributeMappings;
......
32 33
        public string Unit { get; set; }
33 34
        public string Template { get; set; }
34 35

  
36
        
35 37
        public void SetSPPIDInfo()
36 38
        {
37 39
            foreach (var item in SYMBOLS)
......
44 46
                SPPIDUtil.ConvertSPPIDPoint(ref x, ref y, SIZE_WIDTH, SIZE_HEIGHT, testX, testY);
45 47
                item.SPPID.ORIGINAL_X = x;
46 48
                item.SPPID.ORIGINAL_Y = y;
49

  
50
                foreach (var childSymbol in item.ChildSymbols)
51
                {
52
                    if (childSymbol.SPPID == null)
53
                        childSymbol.SPPID = new SPPIDSymbolInfo();
54
                    SetChildSymbolSPPIDInfo(childSymbol);
55
                }
47 56
            }
48 57

  
49 58
            foreach (var item in LINES)
......
124 133
                item.SPPID.ORIGINAL_Y = y;
125 134
            }
126 135
        }
127
        
136

  
137
        private void SetChildSymbolSPPIDInfo(ChildSymbol item)
138
        {
139
            foreach (var childSymbol in item.ChildSymbols)
140
            {
141
                if (childSymbol.SPPID == null)
142
                    childSymbol.SPPID = new SPPIDSymbolInfo();
143
                SetChildSymbolSPPIDInfo(childSymbol);
144
            }
145
        }
146
      
128 147
        public bool SetSPPIDMapping()
129 148
        {
130 149
            foreach (var item in SYMBOLS)
......
133 152
                item.SPPID.MAPPINGNAME = mapping != null ? mapping.SPPIDSYMBOLNAME : null;
134 153
                if (string.IsNullOrEmpty(item.SPPID.MAPPINGNAME))
135 154
                    return false;
155

  
156
                foreach (var childSymbol in item.ChildSymbols)
157
                {
158
                    ChildSymbolMapping childMapping = ChildSymbolMappings.Find(x => x.UID == childSymbol.NAME);
159
                    childSymbol.SPPID.MAPPINGNAME = childMapping != null ? childMapping.SPPIDSYMBOLNAME : null;
160
                    if (string.IsNullOrEmpty(childSymbol.SPPID.MAPPINGNAME) || !SetChildSymbolMapping(childSymbol))
161
                        return false;
162
                }
136 163
            }
137 164

  
138 165
            foreach (var item in LINES)
......
181 208
                if (string.IsNullOrEmpty(item.SPPID.MAPPINGNAME))
182 209
                    return false;
183 210
            }
211

  
184 212
            return true;
185 213
        }
186 214

  
215
        private bool SetChildSymbolMapping(ChildSymbol item)
216
        {
217
            foreach (var childSymbol in item.ChildSymbols)
218
            {
219
                ChildSymbolMapping childMapping = ChildSymbolMappings.Find(x => x.UID == childSymbol.NAME);
220
                childSymbol.SPPID.MAPPINGNAME = childMapping != null ? childMapping.SPPIDSYMBOLNAME : null;
221
                if (string.IsNullOrEmpty(childSymbol.SPPID.MAPPINGNAME))
222
                    return false;
223
                else
224
                    return SetChildSymbolMapping(childSymbol);
225
            }
226

  
227
            return true;
228
        }
187 229
        #region Grouping Source
188 230
        private bool SetGrouping()
189 231
        {

내보내기 Unified diff

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