개정판 42d7b127
Feature: 원본 CAD의 텍스트들을 그리드에 표시하고 사용자가 키보드 방향 키를 눌러 텍스트를 확인하는 기능 추가
Change-Id: I123bef8660a13bae87ae292d5c85b595c4e20237
ID2.Manager/ID2.Manager.Compare/Controls/Verification.cs | ||
---|---|---|
25 | 25 |
{ |
26 | 26 |
public partial class Verification : UserControl |
27 | 27 |
{ |
28 |
public delegate void CompareComplete(List<TextInfo> list); |
|
29 |
public CompareComplete OnCompareComplete; |
|
30 |
|
|
28 | 31 |
readonly string IniFilePath = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), |
29 | 32 |
Application.ProductName, $"{Application.ProductName}.ini"); |
30 | 33 |
|
... | ... | |
468 | 471 |
{ |
469 | 472 |
ApplyLayers(); |
470 | 473 |
this.designCompare.Invalidate(); |
474 |
|
|
475 |
if (OnCompareComplete != null) |
|
476 |
{ |
|
477 |
var TextInfoColl = new List<TextInfo>(); |
|
478 |
var TextColl = designAutoCAD.Entities.OfType<devDept.Eyeshot.Entities.Text>().ToList(); |
|
479 |
foreach (var text in TextColl) |
|
480 |
{ |
|
481 |
TextInfoColl.Add(new TextInfo(Math.Round(text.InsertionPoint.X, 5), Math.Round(text.InsertionPoint.Y, 5), text.TextString)); |
|
482 |
} |
|
483 |
OnCompareComplete(TextInfoColl); |
|
484 |
} |
|
471 | 485 |
} |
472 | 486 |
} |
473 | 487 |
|
... | ... | |
681 | 695 |
/// AutoCAD P&ID 파일을 화면에 표시한다. |
682 | 696 |
void ShowAutoCADFile(string FilePath, Design design, bool clear = true) |
683 | 697 |
{ |
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 |
|
|
711 | 698 |
if (clear) design.Clear(); |
712 | 699 |
var AddEntities = new List<Entity>(); |
713 | 700 |
|
... | ... | |
1044 | 1031 |
{ |
1045 | 1032 |
#region 비교 작업 수행 |
1046 | 1033 |
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 |
|
|
1052 | 1034 |
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 | 1035 |
|
1058 | 1036 |
var workunit = new Classes.CompareModelWorkUnit(this.designCompare, AutoCADEntities, AVEVAtities); |
1059 | 1037 |
workunit.Tolerance = Verification.Tolerance; |
... | ... | |
1078 | 1056 |
} |
1079 | 1057 |
} |
1080 | 1058 |
|
1059 |
/// <summary> |
|
1060 |
/// AVEVA에서 일치하는 Text를 찾지 못하는 경우 False를 리턴한다. |
|
1061 |
/// </summary> |
|
1062 |
/// <param name="textInfo"></param> |
|
1063 |
/// <returns></returns> |
|
1064 |
public bool Zoom(TextInfo textInfo) |
|
1065 |
{ |
|
1066 |
var TextColl = this.designAutoCAD.Entities.OfType<devDept.Eyeshot.Entities.Text>().ToList(); |
|
1067 |
var found = TextColl.Find(x => textInfo.DoesEquals(x)); |
|
1068 |
if (found != null) |
|
1069 |
{ |
|
1070 |
this.designAutoCAD.Entities.ClearSelection(); |
|
1071 |
found.Selected = true; |
|
1072 |
this.designAutoCAD.ZoomFit(new List<Entity>() { found }, true, 70); |
|
1073 |
this.designAutoCAD.Invalidate(); |
|
1074 |
|
|
1075 |
this.designCompare.Entities.ClearSelection(); |
|
1076 |
TextColl = this.designCompare.Entities.OfType<devDept.Eyeshot.Entities.Text>().ToList(); |
|
1077 |
found = TextColl.Find(x => textInfo.DoesEquals(x)); |
|
1078 |
if(found != null) found.Selected = true; |
|
1079 |
|
|
1080 |
this.designAVEVA.Entities.ClearSelection(); |
|
1081 |
TextColl = this.designAVEVA.Entities.OfType<devDept.Eyeshot.Entities.Text>().ToList(); |
|
1082 |
found = TextColl.Find(x => textInfo.DoesEquals(x, Tolerance)); |
|
1083 |
if (found != null) |
|
1084 |
{ |
|
1085 |
found.Selected = true; |
|
1086 |
return true; |
|
1087 |
} |
|
1088 |
} |
|
1089 |
|
|
1090 |
return false; |
|
1091 |
} |
|
1092 |
|
|
1081 | 1093 |
#region Camera Sync |
1082 | 1094 |
private void CameraChanged(object sender, devDept.Eyeshot.Workspace.CameraMoveEventArgs e) |
1083 | 1095 |
{ |
ID2.Manager/ID2.Manager.Compare/Main.Designer.cs | ||
---|---|---|
29 | 29 |
/// </summary> |
30 | 30 |
private void InitializeComponent() |
31 | 31 |
{ |
32 |
Telerik.WinControls.UI.GridViewCheckBoxColumn gridViewCheckBoxColumn2 = new Telerik.WinControls.UI.GridViewCheckBoxColumn(); |
|
33 |
Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn3 = new Telerik.WinControls.UI.GridViewTextBoxColumn(); |
|
34 |
Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn4 = new Telerik.WinControls.UI.GridViewTextBoxColumn(); |
|
35 |
Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn5 = new Telerik.WinControls.UI.GridViewTextBoxColumn(); |
|
36 |
Telerik.WinControls.UI.TableViewDefinition tableViewDefinition2 = new Telerik.WinControls.UI.TableViewDefinition(); |
|
32 | 37 |
Telerik.WinControls.UI.GridViewCheckBoxColumn gridViewCheckBoxColumn1 = new Telerik.WinControls.UI.GridViewCheckBoxColumn(); |
33 | 38 |
Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn1 = new Telerik.WinControls.UI.GridViewTextBoxColumn(); |
34 | 39 |
Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn2 = new Telerik.WinControls.UI.GridViewTextBoxColumn(); |
... | ... | |
57 | 62 |
this.radProgressBarElement = new Telerik.WinControls.UI.RadProgressBarElement(); |
58 | 63 |
this.DockMain = new Telerik.WinControls.UI.Docking.RadDock(); |
59 | 64 |
this.toolWindowData = new Telerik.WinControls.UI.Docking.ToolWindow(); |
60 |
this.radSplitContainer1 = new Telerik.WinControls.UI.RadSplitContainer(); |
|
65 |
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); |
|
66 |
this.radGridViewData = new Telerik.WinControls.UI.RadGridView(); |
|
67 |
this.radButtonSave = new Telerik.WinControls.UI.RadButton(); |
|
61 | 68 |
this.toolTabStrip1 = new Telerik.WinControls.UI.Docking.ToolTabStrip(); |
62 | 69 |
this.DockWindowMain = new Telerik.WinControls.UI.Docking.ToolWindow(); |
63 | 70 |
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); |
... | ... | |
70 | 77 |
this.DockMainTabStrip = new Telerik.WinControls.UI.Docking.DocumentTabStrip(); |
71 | 78 |
this.DockValidation = new Telerik.WinControls.UI.Docking.DocumentWindow(); |
72 | 79 |
this.LayoutValidation = new System.Windows.Forms.TableLayoutPanel(); |
73 |
this.toolTabStrip2 = new Telerik.WinControls.UI.Docking.ToolTabStrip(); |
|
74 | 80 |
this.telerikMetroTheme1 = new Telerik.WinControls.Themes.TelerikMetroTheme(); |
75 | 81 |
this.office2013DarkTheme1 = new Telerik.WinControls.Themes.Office2013DarkTheme(); |
76 | 82 |
this.visualStudio2012DarkTheme1 = new Telerik.WinControls.Themes.VisualStudio2012DarkTheme(); |
77 | 83 |
this.visualStudio2012LightTheme1 = new Telerik.WinControls.Themes.VisualStudio2012LightTheme(); |
78 | 84 |
this.windows8Theme1 = new Telerik.WinControls.Themes.Windows8Theme(); |
85 |
this.toolTabStrip3 = new Telerik.WinControls.UI.Docking.ToolTabStrip(); |
|
79 | 86 |
((System.ComponentModel.ISupportInitialize)(this.ID2ManagerRadRibbonBar)).BeginInit(); |
80 | 87 |
((System.ComponentModel.ISupportInitialize)(this.radPageViewViewer)).BeginInit(); |
81 | 88 |
this.radPageViewViewer.SuspendLayout(); |
82 | 89 |
((System.ComponentModel.ISupportInitialize)(this.radStatusStripMain)).BeginInit(); |
83 | 90 |
((System.ComponentModel.ISupportInitialize)(this.DockMain)).BeginInit(); |
84 | 91 |
this.DockMain.SuspendLayout(); |
85 |
((System.ComponentModel.ISupportInitialize)(this.radSplitContainer1)).BeginInit(); |
|
86 |
this.radSplitContainer1.SuspendLayout(); |
|
92 |
this.toolWindowData.SuspendLayout(); |
|
93 |
this.tableLayoutPanel2.SuspendLayout(); |
|
94 |
((System.ComponentModel.ISupportInitialize)(this.radGridViewData)).BeginInit(); |
|
95 |
((System.ComponentModel.ISupportInitialize)(this.radGridViewData.MasterTemplate)).BeginInit(); |
|
96 |
((System.ComponentModel.ISupportInitialize)(this.radButtonSave)).BeginInit(); |
|
87 | 97 |
((System.ComponentModel.ISupportInitialize)(this.toolTabStrip1)).BeginInit(); |
88 | 98 |
this.toolTabStrip1.SuspendLayout(); |
89 | 99 |
this.DockWindowMain.SuspendLayout(); |
... | ... | |
99 | 109 |
((System.ComponentModel.ISupportInitialize)(this.DockMainTabStrip)).BeginInit(); |
100 | 110 |
this.DockMainTabStrip.SuspendLayout(); |
101 | 111 |
this.DockValidation.SuspendLayout(); |
102 |
((System.ComponentModel.ISupportInitialize)(this.toolTabStrip2)).BeginInit(); |
|
103 |
this.toolTabStrip2.SuspendLayout(); |
|
112 |
((System.ComponentModel.ISupportInitialize)(this.toolTabStrip3)).BeginInit(); |
|
104 | 113 |
((System.ComponentModel.ISupportInitialize)(this)).BeginInit(); |
105 | 114 |
this.SuspendLayout(); |
106 | 115 |
// |
... | ... | |
287 | 296 |
// |
288 | 297 |
// DockMain |
289 | 298 |
// |
290 |
this.DockMain.ActiveWindow = this.toolWindowData;
|
|
299 |
this.DockMain.ActiveWindow = this.DockWindowMain;
|
|
291 | 300 |
this.DockMain.AutoHideAnimation = Telerik.WinControls.UI.Docking.AutoHideAnimateMode.None; |
292 | 301 |
this.DockMain.CausesValidation = false; |
293 |
this.DockMain.Controls.Add(this.radSplitContainer1);
|
|
294 |
this.DockMain.Controls.Add(this.toolTabStrip2);
|
|
302 |
this.DockMain.Controls.Add(this.toolTabStrip1);
|
|
303 |
this.DockMain.Controls.Add(this.DockContainerMain);
|
|
295 | 304 |
this.DockMain.Dock = System.Windows.Forms.DockStyle.Fill; |
296 | 305 |
this.DockMain.IsCleanUpTarget = true; |
297 | 306 |
this.DockMain.Location = new System.Drawing.Point(0, 162); |
298 | 307 |
this.DockMain.MainDocumentContainer = this.DockContainerMain; |
299 | 308 |
this.DockMain.Name = "DockMain"; |
300 |
this.DockMain.Orientation = System.Windows.Forms.Orientation.Horizontal; |
|
301 | 309 |
// |
302 | 310 |
// |
303 | 311 |
// |
... | ... | |
309 | 317 |
// toolWindowData |
310 | 318 |
// |
311 | 319 |
this.toolWindowData.Caption = null; |
320 |
this.toolWindowData.Controls.Add(this.tableLayoutPanel2); |
|
312 | 321 |
this.toolWindowData.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))); |
313 | 322 |
this.toolWindowData.Location = new System.Drawing.Point(1, 24); |
314 | 323 |
this.toolWindowData.Name = "toolWindowData"; |
315 | 324 |
this.toolWindowData.PreviousDockState = Telerik.WinControls.UI.Docking.DockState.Docked; |
316 |
this.toolWindowData.Size = new System.Drawing.Size(1322, 174);
|
|
325 |
this.toolWindowData.Size = new System.Drawing.Size(276, 436);
|
|
317 | 326 |
this.toolWindowData.Text = "Data"; |
318 | 327 |
// |
319 |
// radSplitContainer1 |
|
320 |
// |
|
321 |
this.radSplitContainer1.Controls.Add(this.toolTabStrip1); |
|
322 |
this.radSplitContainer1.Controls.Add(this.DockContainerMain); |
|
323 |
this.radSplitContainer1.IsCleanUpTarget = true; |
|
324 |
this.radSplitContainer1.Location = new System.Drawing.Point(5, 5); |
|
325 |
this.radSplitContainer1.Name = "radSplitContainer1"; |
|
326 |
this.radSplitContainer1.Padding = new System.Windows.Forms.Padding(5); |
|
327 |
// |
|
328 |
// |
|
329 |
// |
|
330 |
this.radSplitContainer1.RootElement.MinSize = new System.Drawing.Size(25, 25); |
|
331 |
this.radSplitContainer1.Size = new System.Drawing.Size(1324, 282); |
|
332 |
this.radSplitContainer1.TabIndex = 0; |
|
333 |
this.radSplitContainer1.TabStop = false; |
|
328 |
// tableLayoutPanel2 |
|
329 |
// |
|
330 |
this.tableLayoutPanel2.ColumnCount = 1; |
|
331 |
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); |
|
332 |
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); |
|
333 |
this.tableLayoutPanel2.Controls.Add(this.radGridViewData, 0, 1); |
|
334 |
this.tableLayoutPanel2.Controls.Add(this.radButtonSave, 0, 0); |
|
335 |
this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; |
|
336 |
this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 0); |
|
337 |
this.tableLayoutPanel2.Name = "tableLayoutPanel2"; |
|
338 |
this.tableLayoutPanel2.RowCount = 2; |
|
339 |
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F)); |
|
340 |
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); |
|
341 |
this.tableLayoutPanel2.Size = new System.Drawing.Size(276, 436); |
|
342 |
this.tableLayoutPanel2.TabIndex = 1; |
|
343 |
// |
|
344 |
// radGridViewData |
|
345 |
// |
|
346 |
this.radGridViewData.Dock = System.Windows.Forms.DockStyle.Fill; |
|
347 |
this.radGridViewData.Location = new System.Drawing.Point(3, 33); |
|
348 |
// |
|
349 |
// |
|
350 |
// |
|
351 |
this.radGridViewData.MasterTemplate.AllowAddNewRow = false; |
|
352 |
this.radGridViewData.MasterTemplate.AllowDeleteRow = false; |
|
353 |
this.radGridViewData.MasterTemplate.AllowDragToGroup = false; |
|
354 |
gridViewCheckBoxColumn2.FieldName = "Unmatched"; |
|
355 |
gridViewCheckBoxColumn2.HeaderText = "Unmatched"; |
|
356 |
gridViewCheckBoxColumn2.MaxWidth = 30; |
|
357 |
gridViewCheckBoxColumn2.Name = "Unmatched"; |
|
358 |
gridViewCheckBoxColumn2.Width = 30; |
|
359 |
gridViewTextBoxColumn3.FieldName = "X"; |
|
360 |
gridViewTextBoxColumn3.HeaderText = "X"; |
|
361 |
gridViewTextBoxColumn3.Name = "X"; |
|
362 |
gridViewTextBoxColumn3.ReadOnly = true; |
|
363 |
gridViewTextBoxColumn3.WrapText = true; |
|
364 |
gridViewTextBoxColumn4.FieldName = "Y"; |
|
365 |
gridViewTextBoxColumn4.HeaderText = "Y"; |
|
366 |
gridViewTextBoxColumn4.Name = "Y"; |
|
367 |
gridViewTextBoxColumn4.ReadOnly = true; |
|
368 |
gridViewTextBoxColumn4.WrapText = true; |
|
369 |
gridViewTextBoxColumn5.FieldName = "TextString"; |
|
370 |
gridViewTextBoxColumn5.HeaderText = "TextString"; |
|
371 |
gridViewTextBoxColumn5.Name = "TextString"; |
|
372 |
gridViewTextBoxColumn5.ReadOnly = true; |
|
373 |
this.radGridViewData.MasterTemplate.Columns.AddRange(new Telerik.WinControls.UI.GridViewDataColumn[] { |
|
374 |
gridViewCheckBoxColumn2, |
|
375 |
gridViewTextBoxColumn3, |
|
376 |
gridViewTextBoxColumn4, |
|
377 |
gridViewTextBoxColumn5}); |
|
378 |
this.radGridViewData.MasterTemplate.EnableFiltering = true; |
|
379 |
this.radGridViewData.MasterTemplate.ViewDefinition = tableViewDefinition2; |
|
380 |
this.radGridViewData.Name = "radGridViewData"; |
|
381 |
this.radGridViewData.ShowGroupPanel = false; |
|
382 |
this.radGridViewData.Size = new System.Drawing.Size(270, 400); |
|
383 |
this.radGridViewData.TabIndex = 0; |
|
384 |
// |
|
385 |
// radButtonSave |
|
386 |
// |
|
387 |
this.radButtonSave.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) |
|
388 |
| System.Windows.Forms.AnchorStyles.Left))); |
|
389 |
this.radButtonSave.Location = new System.Drawing.Point(3, 3); |
|
390 |
this.radButtonSave.Name = "radButtonSave"; |
|
391 |
this.radButtonSave.Size = new System.Drawing.Size(80, 24); |
|
392 |
this.radButtonSave.TabIndex = 1; |
|
393 |
this.radButtonSave.Text = "Save"; |
|
334 | 394 |
// |
335 | 395 |
// toolTabStrip1 |
336 | 396 |
// |
337 | 397 |
this.toolTabStrip1.Controls.Add(this.DockWindowMain); |
338 |
this.toolTabStrip1.Location = new System.Drawing.Point(0, 0); |
|
398 |
this.toolTabStrip1.Controls.Add(this.toolWindowData); |
|
399 |
this.toolTabStrip1.Location = new System.Drawing.Point(5, 5); |
|
339 | 400 |
this.toolTabStrip1.Name = "toolTabStrip1"; |
340 | 401 |
// |
341 | 402 |
// |
342 | 403 |
// |
343 | 404 |
this.toolTabStrip1.RootElement.MinSize = new System.Drawing.Size(25, 25); |
344 | 405 |
this.toolTabStrip1.SelectedIndex = 0; |
345 |
this.toolTabStrip1.Size = new System.Drawing.Size(278, 282);
|
|
406 |
this.toolTabStrip1.Size = new System.Drawing.Size(278, 486);
|
|
346 | 407 |
this.toolTabStrip1.SizeInfo.AbsoluteSize = new System.Drawing.Size(278, 200); |
347 | 408 |
this.toolTabStrip1.SizeInfo.SplitterCorrection = new System.Drawing.Size(78, 0); |
348 | 409 |
this.toolTabStrip1.TabIndex = 5; |
... | ... | |
358 | 419 |
this.DockWindowMain.Location = new System.Drawing.Point(1, 24); |
359 | 420 |
this.DockWindowMain.Name = "DockWindowMain"; |
360 | 421 |
this.DockWindowMain.PreviousDockState = Telerik.WinControls.UI.Docking.DockState.Floating; |
361 |
this.DockWindowMain.Size = new System.Drawing.Size(276, 256);
|
|
422 |
this.DockWindowMain.Size = new System.Drawing.Size(276, 436);
|
|
362 | 423 |
this.DockWindowMain.Text = "Main"; |
363 | 424 |
// |
364 | 425 |
// tableLayoutPanel1 |
... | ... | |
379 | 440 |
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); |
380 | 441 |
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F)); |
381 | 442 |
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); |
382 |
this.tableLayoutPanel1.Size = new System.Drawing.Size(276, 256);
|
|
443 |
this.tableLayoutPanel1.Size = new System.Drawing.Size(276, 436);
|
|
383 | 444 |
this.tableLayoutPanel1.TabIndex = 1; |
384 | 445 |
// |
385 | 446 |
// radGridViewDocument |
... | ... | |
416 | 477 |
this.radGridViewDocument.MasterTemplate.EnableFiltering = true; |
417 | 478 |
this.radGridViewDocument.MasterTemplate.ViewDefinition = tableViewDefinition1; |
418 | 479 |
this.radGridViewDocument.Name = "radGridViewDocument"; |
419 |
this.radGridViewDocument.Size = new System.Drawing.Size(270, 150);
|
|
480 |
this.radGridViewDocument.Size = new System.Drawing.Size(270, 330);
|
|
420 | 481 |
this.radGridViewDocument.TabIndex = 0; |
421 | 482 |
// |
422 | 483 |
// radLabel1 |
... | ... | |
480 | 541 |
// |
481 | 542 |
this.DockMainTabStrip.RootElement.MinSize = new System.Drawing.Size(25, 25); |
482 | 543 |
this.DockMainTabStrip.SelectedIndex = 0; |
483 |
this.DockMainTabStrip.Size = new System.Drawing.Size(1042, 282);
|
|
544 |
this.DockMainTabStrip.Size = new System.Drawing.Size(1042, 486);
|
|
484 | 545 |
this.DockMainTabStrip.TabIndex = 0; |
485 | 546 |
this.DockMainTabStrip.TabStop = false; |
486 | 547 |
// |
... | ... | |
494 | 555 |
this.DockValidation.Location = new System.Drawing.Point(6, 29); |
495 | 556 |
this.DockValidation.Name = "DockValidation"; |
496 | 557 |
this.DockValidation.PreviousDockState = Telerik.WinControls.UI.Docking.DockState.Floating; |
497 |
this.DockValidation.Size = new System.Drawing.Size(1030, 247);
|
|
558 |
this.DockValidation.Size = new System.Drawing.Size(1030, 451);
|
|
498 | 559 |
this.DockValidation.Text = "Validation"; |
499 | 560 |
// |
500 | 561 |
// LayoutValidation |
... | ... | |
507 | 568 |
this.LayoutValidation.Name = "LayoutValidation"; |
508 | 569 |
this.LayoutValidation.RowCount = 1; |
509 | 570 |
this.LayoutValidation.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); |
510 |
this.LayoutValidation.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 247F));
|
|
511 |
this.LayoutValidation.Size = new System.Drawing.Size(1030, 247);
|
|
571 |
this.LayoutValidation.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 192F));
|
|
572 |
this.LayoutValidation.Size = new System.Drawing.Size(1030, 451);
|
|
512 | 573 |
this.LayoutValidation.TabIndex = 0; |
513 | 574 |
// |
514 |
// toolTabStrip2
|
|
575 |
// toolTabStrip3
|
|
515 | 576 |
// |
516 |
this.toolTabStrip2.Controls.Add(this.toolWindowData); |
|
517 |
this.toolTabStrip2.Location = new System.Drawing.Point(5, 291); |
|
518 |
this.toolTabStrip2.Name = "toolTabStrip2"; |
|
577 |
this.toolTabStrip3.Location = new System.Drawing.Point(0, 0); |
|
578 |
this.toolTabStrip3.Name = "toolTabStrip3"; |
|
519 | 579 |
// |
520 | 580 |
// |
521 | 581 |
// |
522 |
this.toolTabStrip2.RootElement.MinSize = new System.Drawing.Size(25, 25);
|
|
523 |
this.toolTabStrip2.SelectedIndex = 0;
|
|
524 |
this.toolTabStrip2.Size = new System.Drawing.Size(1324, 200);
|
|
525 |
this.toolTabStrip2.TabIndex = 1;
|
|
526 |
this.toolTabStrip2.TabStop = false;
|
|
582 |
this.toolTabStrip3.RootElement.MinSize = new System.Drawing.Size(25, 25);
|
|
583 |
this.toolTabStrip3.SelectedIndex = 0;
|
|
584 |
this.toolTabStrip3.Size = new System.Drawing.Size(200, 200);
|
|
585 |
this.toolTabStrip3.TabIndex = 0;
|
|
586 |
this.toolTabStrip3.TabStop = false;
|
|
527 | 587 |
// |
528 | 588 |
// Main |
529 | 589 |
// |
... | ... | |
545 | 605 |
((System.ComponentModel.ISupportInitialize)(this.radStatusStripMain)).EndInit(); |
546 | 606 |
((System.ComponentModel.ISupportInitialize)(this.DockMain)).EndInit(); |
547 | 607 |
this.DockMain.ResumeLayout(false); |
548 |
((System.ComponentModel.ISupportInitialize)(this.radSplitContainer1)).EndInit(); |
|
549 |
this.radSplitContainer1.ResumeLayout(false); |
|
608 |
this.toolWindowData.ResumeLayout(false); |
|
609 |
this.tableLayoutPanel2.ResumeLayout(false); |
|
610 |
((System.ComponentModel.ISupportInitialize)(this.radGridViewData.MasterTemplate)).EndInit(); |
|
611 |
((System.ComponentModel.ISupportInitialize)(this.radGridViewData)).EndInit(); |
|
612 |
((System.ComponentModel.ISupportInitialize)(this.radButtonSave)).EndInit(); |
|
550 | 613 |
((System.ComponentModel.ISupportInitialize)(this.toolTabStrip1)).EndInit(); |
551 | 614 |
this.toolTabStrip1.ResumeLayout(false); |
552 | 615 |
this.DockWindowMain.ResumeLayout(false); |
... | ... | |
563 | 626 |
((System.ComponentModel.ISupportInitialize)(this.DockMainTabStrip)).EndInit(); |
564 | 627 |
this.DockMainTabStrip.ResumeLayout(false); |
565 | 628 |
this.DockValidation.ResumeLayout(false); |
566 |
((System.ComponentModel.ISupportInitialize)(this.toolTabStrip2)).EndInit(); |
|
567 |
this.toolTabStrip2.ResumeLayout(false); |
|
629 |
((System.ComponentModel.ISupportInitialize)(this.toolTabStrip3)).EndInit(); |
|
568 | 630 |
((System.ComponentModel.ISupportInitialize)(this)).EndInit(); |
569 | 631 |
this.ResumeLayout(false); |
570 | 632 |
this.PerformLayout(); |
... | ... | |
612 | 674 |
private Telerik.WinControls.Themes.Windows8Theme windows8Theme1; |
613 | 675 |
private Telerik.WinControls.UI.RadRibbonBarGroup radRibbonBarGroup1; |
614 | 676 |
private Telerik.WinControls.UI.RadButtonElement radButtonElementConfiguration; |
615 |
private Telerik.WinControls.UI.RadSplitContainer radSplitContainer1; |
|
616 |
private Telerik.WinControls.UI.Docking.ToolTabStrip toolTabStrip2; |
|
617 | 677 |
private Telerik.WinControls.UI.Docking.ToolWindow toolWindowData; |
678 |
private Telerik.WinControls.UI.RadGridView radGridViewData; |
|
679 |
private Telerik.WinControls.UI.Docking.ToolTabStrip toolTabStrip3; |
|
680 |
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; |
|
681 |
private Telerik.WinControls.UI.RadButton radButtonSave; |
|
618 | 682 |
} |
619 | 683 |
} |
ID2.Manager/ID2.Manager.Compare/Main.cs | ||
---|---|---|
17 | 17 |
|
18 | 18 |
using Telerik.WinControls; |
19 | 19 |
using Telerik.WinControls.UI; |
20 |
using Telerik.Windows.Diagrams.Core; |
|
21 |
using Xtractor.Viewer; |
|
22 |
using devDept.Eyeshot; |
|
20 | 23 |
|
21 | 24 |
namespace ID2.Manager |
22 | 25 |
{ |
... | ... | |
32 | 35 |
} |
33 | 36 |
} |
34 | 37 |
|
35 |
//#if DEBUG |
|
36 |
// Telerik.WinControls.RadControlSpy.RadControlSpyForm radControlSpyForm = new Telerik.WinControls.RadControlSpy.RadControlSpyForm(); |
|
37 |
//#endif |
|
38 | 38 |
private readonly Color _SummaryColor = Color.FromArgb(255, 108, 55); |
39 |
private BindingList<TextInfo> textInfos { get; } = new BindingList<TextInfo>(); |
|
39 | 40 |
|
40 | 41 |
public Main() |
41 | 42 |
{ |
42 | 43 |
InitializeComponent(); |
43 | 44 |
var verification = new Controls.Verification(this.radProgressBarElement) { Dock = DockStyle.Fill }; |
45 |
verification.OnCompareComplete += this.CompareCompleteHandler; |
|
44 | 46 |
this.LayoutValidation.Controls.Add(verification); |
45 | 47 |
this.DockMainTabStrip.Select(); |
46 | 48 |
|
... | ... | |
64 | 66 |
} |
65 | 67 |
|
66 | 68 |
/// <summary> |
69 |
/// 비교가 끝나고 나서 Text를 그리드에 표시한다. |
|
70 |
/// </summary> |
|
71 |
/// <param name="list"></param> |
|
72 |
public void CompareCompleteHandler(List<TextInfo> list) |
|
73 |
{ |
|
74 |
textInfos.Clear(); |
|
75 |
textInfos.AddRange(list); |
|
76 |
#region 파일에서 일치하지 않는 텍스트들을 읽는다. |
|
77 |
var doc = this.radGridViewDocument.SelectedRows[0].DataBoundItem as Document; |
|
78 |
if (doc != null) |
|
79 |
{ |
|
80 |
string ID2DrawingFolder = Program.AutoCADFolder; |
|
81 |
string FilePath = System.IO.Path.Combine(ID2DrawingFolder, $"{doc.DocumentNo}.dwg.txt"); |
|
82 |
if (File.Exists(FilePath)) |
|
83 |
{ |
|
84 |
using (var sr = new StreamReader(FilePath)) |
|
85 |
{ |
|
86 |
string line; |
|
87 |
while ((line = sr.ReadLine()) != null) |
|
88 |
{ |
|
89 |
var tokens = line.Split(','); |
|
90 |
if (tokens.Length == 3) |
|
91 |
{ |
|
92 |
double x, y; |
|
93 |
double.TryParse(tokens[0], out x); |
|
94 |
double.TryParse(tokens[1], out y); |
|
95 |
var textinfo = new TextInfo(x, y, tokens[2]); |
|
96 |
var found = this.textInfos.Find(param => param.Equals(textinfo)); |
|
97 |
if (found != null) found.Unmatched = true; |
|
98 |
} |
|
99 |
} |
|
100 |
} |
|
101 |
} |
|
102 |
} |
|
103 |
#endregion |
|
104 |
|
|
105 |
this.radGridViewData.DataSource = list; |
|
106 |
} |
|
107 |
|
|
108 |
/// <summary> |
|
67 | 109 |
/// 사용자가 선택한 테마를 적용한다. |
68 | 110 |
/// </summary> |
69 | 111 |
/// <param name="sender"></param> |
... | ... | |
122 | 164 |
|
123 | 165 |
this.radGridViewDocument.CellClick += RadGridViewDocument_CellClick; |
124 | 166 |
this.radGridViewDocument.SelectionChanged += RadGridViewDocument_SelectionChanged; |
167 |
this.radGridViewData.SelectionChanged += RadGridViewData_SelectionChanged; |
|
168 |
this.radGridViewData.DataBindingComplete += RadGridViewData_DataBindingComplete; |
|
169 |
this.radGridViewData.ViewRowFormatting += RadGridViewData_ViewRowFormatting; |
|
170 |
this.radButtonSave.Click += RadButtonSave_Click; |
|
125 | 171 |
} |
126 | 172 |
catch (Exception ex) |
127 | 173 |
{ |
... | ... | |
132 | 178 |
base.OnLoad(e); |
133 | 179 |
} |
134 | 180 |
|
181 |
private void RadGridViewData_ViewRowFormatting(object sender, RowFormattingEventArgs e) |
|
182 |
{ |
|
183 |
if (e.RowElement != null && e.RowElement.RowInfo.DataBoundItem is TextInfo textinfo) |
|
184 |
{ |
|
185 |
e.RowElement.ResetValue(LightVisualElement.ForeColorProperty, ValueResetFlags.Local); |
|
186 |
if (textinfo.Unmatched) |
|
187 |
e.RowElement.ForeColor = Color.Blue; |
|
188 |
else if (!textinfo.Found) |
|
189 |
e.RowElement.ForeColor = Color.Magenta; |
|
190 |
} |
|
191 |
} |
|
192 |
|
|
193 |
/// <summary> |
|
194 |
/// 일치하지 않는 텍스트들을 파일로 저장한다. |
|
195 |
/// </summary> |
|
196 |
/// <param name="sender"></param> |
|
197 |
/// <param name="e"></param> |
|
198 |
/// <exception cref="NotImplementedException"></exception> |
|
199 |
private void RadButtonSave_Click(object sender, EventArgs e) |
|
200 |
{ |
|
201 |
var doc = this.radGridViewDocument.SelectedRows[0].DataBoundItem as Document; |
|
202 |
if (doc != null) |
|
203 |
{ |
|
204 |
string ID2DrawingFolder = Program.AutoCADFolder; |
|
205 |
string FilePath = System.IO.Path.Combine(ID2DrawingFolder, $"{doc.DocumentNo}.dwg.txt"); |
|
206 |
var unmathced = textInfos.Where(x => x.Unmatched).ToList(); |
|
207 |
using (var sw = new StreamWriter(FilePath)) |
|
208 |
{ |
|
209 |
unmathced.ForEach(x => sw.WriteLine(x.ToString())); |
|
210 |
} |
|
211 |
|
|
212 |
RadMessageBox.Show("불일치 텍스트들을 저장했습니다."); |
|
213 |
} |
|
214 |
} |
|
215 |
|
|
216 |
/// <summary> |
|
217 |
/// 칼럼 길이를 데이터에 맞춘다. |
|
218 |
/// </summary> |
|
219 |
/// <param name="sender"></param> |
|
220 |
/// <param name="e"></param> |
|
221 |
private void RadGridViewData_DataBindingComplete(object sender, GridViewBindingCompleteEventArgs e) |
|
222 |
{ |
|
223 |
this.radGridViewData.BestFitColumns(BestFitColumnMode.AllCells); |
|
224 |
} |
|
225 |
|
|
226 |
/// <summary> |
|
227 |
/// 선택한 Text를 그래픽 화면에서 Zoom한다. |
|
228 |
/// </summary> |
|
229 |
/// <param name="sender"></param> |
|
230 |
/// <param name="e"></param> |
|
231 |
private void RadGridViewData_SelectionChanged(object sender, EventArgs e) |
|
232 |
{ |
|
233 |
if ((sender as RadGridView).CurrentRow != null) |
|
234 |
{ |
|
235 |
var TextInfo = (sender as RadGridView).CurrentRow.DataBoundItem as TextInfo; |
|
236 |
if (TextInfo != null) |
|
237 |
{ |
|
238 |
var verification = this.LayoutValidation.Controls[0] as Controls.Verification; |
|
239 |
TextInfo.Found = verification.Zoom(TextInfo); |
|
240 |
} |
|
241 |
} |
|
242 |
} |
|
243 |
|
|
135 | 244 |
private void RadGridViewDocument_CellClick(object sender, GridViewCellEventArgs e) |
136 | 245 |
{ |
137 | 246 |
if (this.radGridViewDocument.SelectedRows.Any() && this.radGridViewDocument.SelectedRows[0].Equals(e.Row)) |
ID2.Manager/ID2.Manager.Compare/Model/MyModel.cs | ||
---|---|---|
57 | 57 |
|
58 | 58 |
public string FilePath { get; set; } |
59 | 59 |
|
60 |
public List<FixedText> FixedTexts { get; } = new List<FixedText>(); |
|
61 |
|
|
62 | 60 |
/// <summary> |
63 | 61 |
/// WorkUnit Queue |
64 | 62 |
/// </summary> |
... | ... | |
124 | 122 |
AdjustNearAndFarPlanes(); |
125 | 123 |
Invalidate(); |
126 | 124 |
} |
127 |
else if (e.KeyCode == Keys.X && !string.IsNullOrEmpty(FilePath) && File.Exists(FilePath)) |
|
128 |
{ |
|
129 |
#region 선택한 텍스트들을 파일로 저장한다. |
|
130 |
var selection = this.GetSelectedEntities().Where(x => x is devDept.Eyeshot.Entities.Text || x is devDept.Eyeshot.Entities.MultilineText) |
|
131 |
.ToList() |
|
132 |
.ConvertAll(x => |
|
133 |
{ |
|
134 |
if (x is devDept.Eyeshot.Entities.Text text) |
|
135 |
{ |
|
136 |
return new FixedText(Convert.ToInt32(text.InsertionPoint.X), Convert.ToInt32(text.InsertionPoint.Y), text.TextString); |
|
137 |
} |
|
138 |
else if (x is devDept.Eyeshot.Entities.MultilineText multitext) |
|
139 |
{ |
|
140 |
return new FixedText(Convert.ToInt32(multitext.InsertionPoint.X), Convert.ToInt32(multitext.InsertionPoint.Y), multitext.TextString); |
|
141 |
} |
|
142 |
|
|
143 |
return null; |
|
144 |
}); |
|
145 |
selection.RemoveAll(x => x is null); |
|
146 |
|
|
147 |
var excluded = selection.Where(x => !FixedTexts.Exists(y => y.Equals(x))).ToList(); |
|
148 |
string FixedFilePath = $"{FilePath}.txt"; |
|
149 |
using (var sw = new StreamWriter(FixedFilePath, append:true)) |
|
150 |
{ |
|
151 |
excluded.ForEach(x => sw.WriteLine(x.ToString())); |
|
152 |
} |
|
153 |
#endregion |
|
154 |
} |
|
155 | 125 |
else |
156 | 126 |
{ |
157 | 127 |
base.OnKeyDown(e); |
ID2.Manager/ID2.Manager.Compare/Program.cs | ||
---|---|---|
8 | 8 |
using GemBox.Spreadsheet; |
9 | 9 |
using System.ComponentModel; |
10 | 10 |
using System.Drawing; |
11 |
using System.Runtime.CompilerServices; |
|
12 |
using Xtractor.Viewer; |
|
11 | 13 |
|
12 | 14 |
namespace ID2.Manager |
13 | 15 |
{ |
... | ... | |
54 | 56 |
} |
55 | 57 |
} |
56 | 58 |
|
59 |
public sealed class TextInfo : IEquatable<TextInfo>, INotifyPropertyChanged |
|
60 |
{ |
|
61 |
public event PropertyChangedEventHandler PropertyChanged; |
|
62 |
private void NotifyPropertyChanged([CallerMemberName] String propertyName = "") |
|
63 |
{ |
|
64 |
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); |
|
65 |
} |
|
66 |
|
|
67 |
public TextInfo(double x, double y, string text) |
|
68 |
{ |
|
69 |
X = x; |
|
70 |
Y = y; |
|
71 |
TextString = text; |
|
72 |
} |
|
73 |
|
|
74 |
private bool _Unmatched = false; |
|
75 |
public bool Unmatched |
|
76 |
{ |
|
77 |
get { return _Unmatched; } |
|
78 |
set |
|
79 |
{ |
|
80 |
if( _Unmatched != value) |
|
81 |
{ |
|
82 |
_Unmatched = value; |
|
83 |
NotifyPropertyChanged("Unmatched"); |
|
84 |
} |
|
85 |
} |
|
86 |
} |
|
87 |
[Description("시스템에서 일치하는 문자열을 찾는 경우 설정")] |
|
88 |
public bool Found { get; set; } = true; |
|
89 |
[ReadOnly(true)] |
|
90 |
public double X { get; set; } |
|
91 |
[ReadOnly(true)] |
|
92 |
public double Y { get; set; } |
|
93 |
[ReadOnly(true)] |
|
94 |
public string TextString { get; set; } |
|
95 |
|
|
96 |
public bool Equals(TextInfo other) |
|
97 |
{ |
|
98 |
return Math.Abs(this.X - other.X) < double.Epsilon |
|
99 |
&& Math.Abs(this.Y - other.Y) < double.Epsilon |
|
100 |
&& this.TextString.Replace(System.Environment.NewLine, string.Empty).Equals(other.TextString.Replace(System.Environment.NewLine, string.Empty)); |
|
101 |
} |
|
102 |
|
|
103 |
public bool DoesEquals(devDept.Eyeshot.Entities.Text text, double toler=double.Epsilon) |
|
104 |
{ |
|
105 |
return Math.Abs(this.X - Math.Round(text.InsertionPoint.X, 5)) < toler && |
|
106 |
Math.Abs(this.Y - Math.Round(text.InsertionPoint.Y, 5)) < toler && |
|
107 |
this.TextString.Replace(System.Environment.NewLine, string.Empty).Equals(text.TextString.Replace(System.Environment.NewLine, string.Empty)); |
|
108 |
} |
|
109 |
|
|
110 |
public override string ToString() |
|
111 |
{ |
|
112 |
return $"{X},{Y},{TextString}"; |
|
113 |
} |
|
114 |
} |
|
115 |
|
|
57 | 116 |
static class Program |
58 | 117 |
{ |
59 | 118 |
/// </summary> |
내보내기 Unified diff