개정판 288a94c5
Fix: 유사도 분류 기능 오류 수정
Change-Id: I950191479a63d1fed8d834140a77b5d3b190f12d
ID2.Manager/ID2.Manager.Compare/Controls/Verification.cs | ||
---|---|---|
28 | 28 |
|
29 | 29 |
#region 기본값 |
30 | 30 |
private static string AutoCADLayer { get; } = "AutoCAD"; |
31 |
private static string AutoCADDiffLayer { get; } = "AutoCAD_Diff"; |
|
32 |
private static string AutoCADExceptLayer { get; } = "AutoCAD_Except"; |
|
31 | 33 |
private static Color AutoCADColor = Color.FromArgb(44, 44, 44); |
32 | 34 |
private static string AVEVALayer { get; } = "AVEVA"; |
35 |
private static string AVEVADiffLayer { get; } = "AVEVA_Diff"; |
|
36 |
private static string AVEVAExceptLayer { get; } = "AVEVA_Except"; |
|
33 | 37 |
private static Color AVEVAColor = Color.FromArgb(44, 44, 44); |
34 | 38 |
private static string RevCloudLayer { get; } = "RevCloud"; |
35 | 39 |
private static Color RevCloudColor = Color.Magenta; |
... | ... | |
69 | 73 |
this.designCompare.ActiveViewport.CoordinateSystemIcon.Visible = false; |
70 | 74 |
this.designCompare.ActiveViewport.OriginSymbol.Visible = false; |
71 | 75 |
|
72 |
this.radCheckBoxAutoCAD.CheckStateChanged += RadCheckBoxAutoCAD_CheckStateChanged;
|
|
73 |
this.radCheckBoxAVEVA.CheckStateChanged += RadCheckBoxAVEVA_CheckStateChanged;
|
|
76 |
this.radCheckedDropDownListAutoCAD.ItemCheckedChanged += RadCheckedDropDownListAutoCAD_ItemCheckedChanged;
|
|
77 |
this.radCheckedDropDownListAVEVA.ItemCheckedChanged += RadCheckedDropDownListAVEVA_ItemCheckedChanged;
|
|
74 | 78 |
this.radCheckBoxRevCloud.CheckStateChanged += RadCheckBoxRevCloud_CheckStateChanged; |
75 | 79 |
|
76 | 80 |
_progressBar = progressBar; |
... | ... | |
98 | 102 |
#endregion |
99 | 103 |
} |
100 | 104 |
|
101 |
private void RadCheckBoxRevCloud_CheckStateChanged(object sender, EventArgs e)
|
|
105 |
private void RadCheckedDropDownListAVEVA_ItemCheckedChanged(object sender, RadCheckedListDataItemEventArgs e)
|
|
102 | 106 |
{ |
103 |
var layer = this.designCompare.Layers.FirstOrDefault(x => x.Name.ToUpper() == Verification.RevCloudLayer.ToUpper());
|
|
104 |
if (layer != null) layer.Visible = (sender as RadCheckBox).Checked;
|
|
107 |
var layer = this.designCompare.Layers.FirstOrDefault(x => x.Name.ToUpper() == e.Item.Text.ToUpper());
|
|
108 |
if (layer != null) layer.Visible = e.Item.Checked;
|
|
105 | 109 |
this.designCompare.Invalidate(); |
110 |
|
|
111 |
Classes.ID2Helper.IniWriteValue(IniFilePath, "Verification", e.Item.Text, e.Item.Checked.ToString()); |
|
106 | 112 |
} |
107 | 113 |
|
108 |
private void RadCheckBoxAVEVA_CheckStateChanged(object sender, EventArgs e)
|
|
114 |
private void RadCheckedDropDownListAutoCAD_ItemCheckedChanged(object sender, RadCheckedListDataItemEventArgs e)
|
|
109 | 115 |
{ |
110 |
var layer = this.designCompare.Layers.FirstOrDefault(x => x.Name.ToUpper() == Verification.AVEVALayer.ToUpper()); |
|
116 |
var layer = this.designCompare.Layers.FirstOrDefault(x => x.Name.ToUpper() == e.Item.Text.ToUpper()); |
|
117 |
if (layer != null) layer.Visible = e.Item.Checked; |
|
118 |
this.designCompare.Invalidate(); |
|
119 |
|
|
120 |
Classes.ID2Helper.IniWriteValue(IniFilePath, "Verification", e.Item.Text, e.Item.Checked.ToString()); |
|
121 |
} |
|
122 |
|
|
123 |
private void RadCheckBoxRevCloud_CheckStateChanged(object sender, EventArgs e) |
|
124 |
{ |
|
125 |
var layer = this.designCompare.Layers.FirstOrDefault(x => x.Name.ToUpper() == Verification.RevCloudLayer.ToUpper()); |
|
111 | 126 |
if (layer != null) layer.Visible = (sender as RadCheckBox).Checked; |
112 | 127 |
this.designCompare.Invalidate(); |
113 | 128 |
} |
114 | 129 |
|
115 |
private void RadCheckBoxAutoCAD_CheckStateChanged(object sender, EventArgs e)
|
|
130 |
private void RadCheckBoxAVEVA_CheckStateChanged(object sender, EventArgs e)
|
|
116 | 131 |
{ |
117 |
var layer = this.designCompare.Layers.FirstOrDefault(x => x.Name.ToUpper() == Verification.AutoCADLayer.ToUpper());
|
|
132 |
var layer = this.designCompare.Layers.FirstOrDefault(x => x.Name.ToUpper() == Verification.AVEVALayer.ToUpper());
|
|
118 | 133 |
if (layer != null) layer.Visible = (sender as RadCheckBox).Checked; |
119 | 134 |
this.designCompare.Invalidate(); |
120 | 135 |
} |
... | ... | |
273 | 288 |
Verification.Tolerance = Convert.ToDouble(this.radSpinEditorTolerance.Value); |
274 | 289 |
} |
275 | 290 |
|
291 |
string _AutoCADLayer = Classes.ID2Helper.IniReadValue(IniFilePath, "Verification", Verification.AutoCADLayer); |
|
292 |
if (!string.IsNullOrEmpty(_AutoCADLayer)) |
|
293 |
{ |
|
294 |
bool Checked = Convert.ToBoolean(_AutoCADLayer); |
|
295 |
var item = this.radCheckedDropDownListAutoCAD.Items.FirstOrDefault(x => x.Text == Verification.AutoCADLayer); |
|
296 |
if (item is RadCheckedListDataItem CheckedItem) CheckedItem.Checked = Checked; |
|
297 |
} |
|
298 |
|
|
299 |
string _AutoCADDiffLayer = Classes.ID2Helper.IniReadValue(IniFilePath, "Verification", Verification.AutoCADDiffLayer); |
|
300 |
if (!string.IsNullOrEmpty(_AutoCADDiffLayer)) |
|
301 |
{ |
|
302 |
bool Checked = Convert.ToBoolean(_AutoCADDiffLayer); |
|
303 |
var item = this.radCheckedDropDownListAutoCAD.Items.FirstOrDefault(x => x.Text == Verification.AutoCADDiffLayer); |
|
304 |
if (item is RadCheckedListDataItem CheckedItem) CheckedItem.Checked = Checked; |
|
305 |
} |
|
306 |
|
|
276 | 307 |
string _AutoCADColor = Classes.ID2Helper.IniReadValue(IniFilePath, "Verification", "AutoCADColor"); |
277 | 308 |
if (!string.IsNullOrEmpty(_AutoCADColor)) |
278 | 309 |
{ |
... | ... | |
284 | 315 |
} |
285 | 316 |
} |
286 | 317 |
|
318 |
string _AVEVALayer = Classes.ID2Helper.IniReadValue(IniFilePath, "Verification", Verification.AVEVALayer); |
|
319 |
if (!string.IsNullOrEmpty(_AutoCADLayer)) |
|
320 |
{ |
|
321 |
bool Checked = Convert.ToBoolean(_AVEVALayer); |
|
322 |
var item = this.radCheckedDropDownListAVEVA.Items.FirstOrDefault(x => x.Text == Verification.AVEVALayer); |
|
323 |
if (item is RadCheckedListDataItem CheckedItem) CheckedItem.Checked = Checked; |
|
324 |
} |
|
325 |
|
|
326 |
string _AVEVADiffLayer = Classes.ID2Helper.IniReadValue(IniFilePath, "Verification", Verification.AVEVADiffLayer); |
|
327 |
if (!string.IsNullOrEmpty(_AVEVADiffLayer)) |
|
328 |
{ |
|
329 |
bool Checked = Convert.ToBoolean(_AVEVADiffLayer); |
|
330 |
var item = this.radCheckedDropDownListAVEVA.Items.FirstOrDefault(x => x.Text == Verification.AVEVADiffLayer); |
|
331 |
if (item is RadCheckedListDataItem CheckedItem) CheckedItem.Checked = Checked; |
|
332 |
} |
|
333 |
|
|
287 | 334 |
string _AVEVAColor = Classes.ID2Helper.IniReadValue(IniFilePath, "Verification", "AVEVAColor"); |
288 | 335 |
if (!string.IsNullOrEmpty(_AVEVAColor)) |
289 | 336 |
{ |
... | ... | |
538 | 585 |
ra.DoWork(); |
539 | 586 |
var min = ra.Min; |
540 | 587 |
if (!ra.Layers.Contains(Verification.AutoCADLayer)) ra.Layers.Add(Verification.AutoCADLayer, Verification.AutoCADColor); |
588 |
if (!ra.Layers.Contains(Verification.AutoCADDiffLayer)) ra.Layers.Add(Verification.AutoCADDiffLayer, Verification.DiffColor); |
|
589 |
if (!ra.Layers.Contains(Verification.AutoCADExceptLayer)) ra.Layers.Add(Verification.AutoCADExceptLayer, Verification.AutoCADColor); |
|
541 | 590 |
foreach (var ent in ra.Entities) |
542 | 591 |
{ |
543 | 592 |
/// 도면을 원점으로 맞춘다. |
... | ... | |
680 | 729 |
{ |
681 | 730 |
ent.LayerName = Verification.AutoCADLayer; |
682 | 731 |
} |
732 |
else |
|
733 |
{ |
|
734 |
ent.LayerName = Verification.AutoCADExceptLayer; |
|
735 |
} |
|
683 | 736 |
} |
684 | 737 |
#endregion |
685 | 738 |
|
... | ... | |
716 | 769 |
ra.DoWork(); |
717 | 770 |
|
718 | 771 |
if (!ra.Layers.Contains(Verification.AVEVALayer)) ra.Layers.Add(Verification.AVEVALayer, Verification.AVEVAColor); |
772 |
if (!ra.Layers.Contains(Verification.AVEVADiffLayer)) ra.Layers.Add(Verification.AVEVADiffLayer, Verification.DiffColor); |
|
773 |
if (!ra.Layers.Contains(Verification.AVEVAExceptLayer)) ra.Layers.Add(Verification.AVEVAExceptLayer, Verification.AVEVAColor); |
|
719 | 774 |
var min = ra.Min; |
720 | 775 |
foreach (var ent in ra.Entities) |
721 | 776 |
{ |
... | ... | |
759 | 814 |
} |
760 | 815 |
else if (ent is LinearPath lp) |
761 | 816 |
{ |
817 |
string LayerName = Forms.ExceptLayer.ExceptLayers.Exists(x => x.Name.ToUpper() == lp.LayerName.ToUpper()) ? |
|
818 |
Verification.AVEVAExceptLayer : Verification.AVEVALayer; |
|
762 | 819 |
int count = Convert.ToInt32(lp.Vertices.Length); |
763 | 820 |
for (int i = 0; i < count - 1; ++i) |
764 | 821 |
{ |
765 | 822 |
AddEntities.Add(new devDept.Eyeshot.Entities.Line(lp.Vertices[i], lp.Vertices[i + 1]) |
766 | 823 |
{ |
767 |
LayerName = Verification.AVEVALayer,
|
|
824 |
LayerName = LayerName,
|
|
768 | 825 |
LineWeight = lp.LineWeight, |
769 | 826 |
Color = Verification.AVEVAColor, |
770 | 827 |
LineTypeMethod = colorMethodType.byEntity |
... | ... | |
790 | 847 |
{ |
791 | 848 |
ent.LayerName = Verification.AVEVALayer; |
792 | 849 |
} |
850 |
else |
|
851 |
{ |
|
852 |
ent.LayerName = Verification.AVEVAExceptLayer; |
|
853 |
} |
|
793 | 854 |
} |
794 | 855 |
ra.AddToScene(design); |
795 | 856 |
} |
... | ... | |
845 | 906 |
var AutoCADEntities = this.designCompare.Entities.Where(x => x.LayerName == Verification.AutoCADLayer).ToList(); |
846 | 907 |
var AVEVAtities = this.designCompare.Entities.Where(x => x.LayerName == Verification.AVEVALayer).ToList(); |
847 | 908 |
CompareAndMark(this.designCompare, AutoCADEntities, this.designCompare, AVEVAtities); |
848 |
this.designCompare.Entities.ForEach(x => |
|
849 |
{ |
|
850 |
if (x.LayerName != Verification.AVEVALayer && x.LayerName != Verification.AutoCADLayer && |
|
851 |
x.LayerName != Verification.RevCloudLayer) x.LayerName = Verification.AutoCADLayer; |
|
852 |
}); |
|
853 | 909 |
} |
854 | 910 |
|
911 |
var others = this.designCompare.Entities.Where(x => |
|
912 |
{ |
|
913 |
return (x.LayerName != Verification.AVEVALayer && x.LayerName != Verification.AVEVADiffLayer && |
|
914 |
x.LayerName != Verification.AutoCADLayer && x.LayerName != Verification.AutoCADDiffLayer && |
|
915 |
x.LayerName != Verification.RevCloudLayer); |
|
916 |
}).ToList(); |
|
917 |
|
|
918 |
others.ForEach(x => |
|
919 |
{ |
|
920 |
if (x.LayerName == Verification.AutoCADExceptLayer) |
|
921 |
x.LayerName = Verification.AutoCADLayer; |
|
922 |
else if (x.LayerName == Verification.AVEVAExceptLayer) |
|
923 |
x.LayerName = Verification.AVEVALayer; |
|
924 |
}); |
|
925 |
|
|
855 | 926 |
#region 레이어 설정 적용 |
856 | 927 |
var layer = this.designCompare.Layers.FirstOrDefault(x => x.Name.ToUpper() == Verification.RevCloudLayer.ToUpper()); |
857 | 928 |
if (layer != null) layer.Visible = this.radCheckBoxRevCloud.Checked; |
858 | 929 |
|
859 | 930 |
layer = this.designCompare.Layers.FirstOrDefault(x => x.Name.ToUpper() == Verification.AVEVALayer.ToUpper()); |
860 |
if (layer != null) layer.Visible = this.radCheckBoxAVEVA.Checked; |
|
931 |
if (layer != null) |
|
932 |
{ |
|
933 |
var item = this.radCheckedDropDownListAVEVA.Items.FirstOrDefault(x => x.Text.ToUpper() == Verification.AVEVALayer.ToUpper()); |
|
934 |
if (item is RadCheckedListDataItem CheckedItem) layer.Visible = CheckedItem.Checked; |
|
935 |
} |
|
936 |
|
|
937 |
layer = this.designCompare.Layers.FirstOrDefault(x => x.Name.ToUpper() == Verification.AVEVADiffLayer.ToUpper()); |
|
938 |
if (layer != null) |
|
939 |
{ |
|
940 |
var item = this.radCheckedDropDownListAVEVA.Items.FirstOrDefault(x => x.Text.ToUpper() == Verification.AVEVADiffLayer.ToUpper()); |
|
941 |
if (item is RadCheckedListDataItem CheckedItem) layer.Visible = CheckedItem.Checked; |
|
942 |
} |
|
861 | 943 |
|
862 | 944 |
layer = this.designCompare.Layers.FirstOrDefault(x => x.Name.ToUpper() == Verification.AutoCADLayer.ToUpper()); |
863 |
if (layer != null) layer.Visible = this.radCheckBoxAutoCAD.Checked; |
|
945 |
if (layer != null) |
|
946 |
{ |
|
947 |
var item = this.radCheckedDropDownListAutoCAD.Items.FirstOrDefault(x => x.Text.ToUpper() == Verification.AutoCADLayer.ToUpper()); |
|
948 |
if(item is RadCheckedListDataItem CheckedItem) layer.Visible = CheckedItem.Checked; |
|
949 |
} |
|
950 |
|
|
951 |
layer = this.designCompare.Layers.FirstOrDefault(x => x.Name.ToUpper() == Verification.AutoCADDiffLayer.ToUpper()); |
|
952 |
if (layer != null) |
|
953 |
{ |
|
954 |
var item = this.radCheckedDropDownListAutoCAD.Items.FirstOrDefault(x => x.Text.ToUpper() == Verification.AutoCADDiffLayer.ToUpper()); |
|
955 |
if(item is RadCheckedListDataItem CheckedItem) layer.Visible = CheckedItem.Checked; |
|
956 |
} |
|
864 | 957 |
|
865 | 958 |
this.designCompare.Invalidate(); |
866 | 959 |
#endregion |
... | ... | |
923 | 1016 |
|
924 | 1017 |
if (!EqualIndices.Any()) |
925 | 1018 |
{ |
1019 |
AutoCADEntities[i].LayerName = Verification.AutoCADDiffLayer; |
|
926 | 1020 |
ColorEntity(design1, AutoCADEntities[i], Verification.DiffColor, colorMethodType.byEntity, false); |
927 | 1021 |
|
928 | 1022 |
#region 틀린 엔터티의 BoundingBox를 구함 |
... | ... | |
942 | 1036 |
{ |
943 | 1037 |
if (!equalEntitiesInV2[j]) |
944 | 1038 |
{ |
1039 |
AVEVAEntities[j].LayerName = Verification.AVEVADiffLayer; |
|
945 | 1040 |
ColorEntity(design2, AVEVAEntities[j], Verification.DiffColor, colorMethodType.byEntity, false); |
946 | 1041 |
|
947 | 1042 |
#region 틀린 엔터티의 BoundingBox를 구함 |
내보내기 Unified diff