프로젝트

일반

사용자정보

개정판 a999464f

IDa999464fa37a2eadaf097c6a3177182ebb1490a5
상위 32954c7f
하위 14540282

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

dev issue #1225 : end line mapping

Change-Id: I458ff370c089709148de81c3d918680a09eedfbd

차이점 보기:

DTI_PID/APIDConverter/Form/APIDConverter.cs
167 167
                return;
168 168
            }
169 169

  
170
            DataTable lineMappingTable = Project_DB.GetLineMappingTable();
170 171
            DataTable tDrawing = Project_DB.SelectDrawings();
171 172
            Documents.Clear();
172 173
            foreach (int rowHandle in gridViewConverter.GetSelectedRows())
......
187 188
                document.AvevaSheetNumber = _SheetNumber;
188 189
                document.AvevaTemplateID = _ID;
189 190
                document.AvevaTemplateName = _TemplateName;
190
                Documents.Add(document);
191
                // validation check
192
                if (document.SetAvevaInfo(lineMappingTable))
193
                    Documents.Add(document);
191 194
            }
192 195

  
193
            DialogResult = DialogResult.OK;
196
            lineMappingTable.Dispose();
197

  
198
            if (Documents.Count > 0)
199
            {
200
                DialogResult = DialogResult.OK;
201
            }
202
            else
203
            {
204

  
205
            }
194 206
        }
195 207

  
196 208
        private void btnRefresh_Click(object sender, EventArgs e)
DTI_PID/APIDConverter/Model/PlantItem/Document.cs
526 526
        {
527 527
            return LINES.Find(x => x.UID == uid);
528 528
        }
529

  
530
        public bool SetAvevaInfo(DataTable lineMappingTable)
531
        {
532
            bool result = true;
533
            foreach (var item in LINES)
534
            {
535
                DataRow[] rows = lineMappingTable.Select(string.Format("UID = '{0}'", item.TYPEUID));
536
                if (rows.Length == 1 && !DBNull.Value.Equals(rows[0]["APID_SYMBOL"]) && !string.IsNullOrEmpty((string)rows[0]["APID_SYMBOL"]))
537
                {
538
                    item.Aveva = new AvevaLineInfo();
539
                    item.Aveva.Name = (string)rows[0]["APID_SYMBOL"];
540
                    item.Aveva.Start_X = item.Start_X;
541
                    item.Aveva.Start_Y = item.Start_Y;
542
                    item.Aveva.End_X = item.End_X;
543
                    item.Aveva.End_Y = item.End_Y;
544
                }
545
                else
546
                {
547
                    result = false;
548
                }
549
            }
550

  
551
            return result;
552
        }
529 553
    }
530 554
}
DTI_PID/APIDConverter/Model/PlantItem/Line.cs
75 75
        public int FLOWMARK_PERCENT { get => _FLOWMARK_PERCENT; set => _FLOWMARK_PERCENT = value; }
76 76
        public List<Association> ASSOCIATIONS { get => _ASSOCIATIONS; set => _ASSOCIATIONS = value; }
77 77
        public List<Attribute> ATTRIBUTES { get => _ATTRIBUTES; set => _ATTRIBUTES = value; }
78
        public AvevaLineInfo Aveva { get; set; }
78 79
    }
79 80
}

내보내기 Unified diff

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