개정판 1620ca9c
Feature: 사용자가 지정한 텍스트는 Compare에서 제외
Change-Id: I2a8b83a95b6d20ddee409c79384d3ba21faccf30
ID2.Manager/ID2.Manager.Compare/Controls/Verification.cs | ||
---|---|---|
5 | 5 |
using System; |
6 | 6 |
using System.Collections.Generic; |
7 | 7 |
using System.ComponentModel; |
8 |
using System.ComponentModel.Design; |
|
8 | 9 |
using System.Data; |
9 | 10 |
using System.Drawing; |
10 | 11 |
using System.IO; |
... | ... | |
18 | 19 |
using Telerik.Windows.Documents.Fixed.FormatProviders.Pdf; |
19 | 20 |
using Telerik.Windows.Documents.Fixed.Model; |
20 | 21 |
using Telerik.Windows.Documents.Fixed.Model.Editing; |
22 |
using Xtractor.Viewer; |
|
21 | 23 |
|
22 | 24 |
namespace ID2.Manager.Controls |
23 | 25 |
{ |
... | ... | |
679 | 681 |
/// AutoCAD P&ID 파일을 화면에 표시한다. |
680 | 682 |
void ShowAutoCADFile(string FilePath, Design design, bool clear = true) |
681 | 683 |
{ |
684 |
if (design is MyModel myModel) |
|
685 |
{ |
|
686 |
#region Fixed Text 리스트를 파일에서 읽는다. |
|
687 |
myModel.FixedTexts.Clear(); |
|
688 |
string FixedFilePath = $"{FilePath}.txt"; |
|
689 |
if (File.Exists(FixedFilePath)) |
|
690 |
{ |
|
691 |
using (var sr = new StreamReader(FixedFilePath)) |
|
692 |
{ |
|
693 |
string line; |
|
694 |
while ((line = sr.ReadLine()) != null) |
|
695 |
{ |
|
696 |
var tokens = line.Split(','); |
|
697 |
if (tokens.Length == 3) |
|
698 |
{ |
|
699 |
int x = int.MaxValue, y = int.MaxValue; |
|
700 |
int.TryParse(tokens[0], out x); |
|
701 |
int.TryParse(tokens[1], out y); |
|
702 |
myModel.FixedTexts.Add(new FixedText(x, y, tokens[2])); |
|
703 |
} |
|
704 |
} |
|
705 |
} |
|
706 |
} |
|
707 |
myModel.FilePath = FilePath; |
|
708 |
#endregion |
|
709 |
} |
|
710 |
|
|
682 | 711 |
if (clear) design.Clear(); |
683 | 712 |
var AddEntities = new List<Entity>(); |
684 | 713 |
|
... | ... | |
1015 | 1044 |
{ |
1016 | 1045 |
#region 비교 작업 수행 |
1017 | 1046 |
var AutoCADEntities = this.designCompare.Entities.Where(x => x.LayerName == Verification.AutoCADLayer).ToList(); |
1047 |
#region 확인이 끝났다고 설정한 Text, MultilineText 제거 |
|
1048 |
AutoCADEntities.RemoveAll(x => (x is Text text && (designCompare as MyModel).FixedTexts.Exists(y => y.Equals(text))) |
|
1049 |
|| (x is MultilineText mtext && (designCompare as MyModel).FixedTexts.Exists(y => y.Equals(mtext)))); |
|
1050 |
#endregion |
|
1051 |
|
|
1018 | 1052 |
var AVEVAtities = this.designCompare.Entities.Where(x => x.LayerName == Verification.AVEVALayer).ToList(); |
1053 |
#region 확인이 끝났다고 설정한 Text, MultilineText 제거 |
|
1054 |
AVEVAtities.RemoveAll(x => (x is Text text && (designCompare as MyModel).FixedTexts.Exists(y => y.Equals(text))) |
|
1055 |
|| (x is MultilineText mtext && (designCompare as MyModel).FixedTexts.Exists(y => y.Equals(mtext)))); |
|
1056 |
#endregion |
|
1057 |
|
|
1019 | 1058 |
var workunit = new Classes.CompareModelWorkUnit(this.designCompare, AutoCADEntities, AVEVAtities); |
1020 | 1059 |
workunit.Tolerance = Verification.Tolerance; |
1021 | 1060 |
workunit.LengthToleranceRatio = Verification.LengthToleranceRatio; |
내보내기 Unified diff