프로젝트

일반

사용자정보

개정판 306a0af9

ID306a0af9624e2eed27594b065514749bc04a6900
상위 906920e9
하위 ba9c7fd5

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

dev issue #1124 : Rev, Title 등 Drawing Attribute

Change-Id: Ie8f03675faee4134f6360a89239767eae826e76d

차이점 보기:

DTI_PID/SPPIDConverter/AutoModeling.cs
1036 1036
                LMDrawing drawing = ((dynamic)drawings).Nth(1);
1037 1037
                if (drawing != null)
1038 1038
                {
1039
                    using (DataTable drawingAttributeDT = Project_DB.SelectDrawingProjectAttribute())
1040
                    {
1041
                        foreach (DataRow row in drawingAttributeDT.Rows)
1042
                        {
1043
                            string mappingName = DBNull.Value.Equals(row["SPPID_ATTRIBUTE"]) ? string.Empty : row["SPPID_ATTRIBUTE"].ToString();
1044
                            if (!string.IsNullOrEmpty(mappingName))
1045
                            {
1046
                                string uid = row["UID"].ToString();
1047
                                string name = row["NAME"].ToString();
1048
                                Text text = document.TEXTINFOS.Find(x => x.AREA == uid);
1049
                                if (text != null)
1050
                                {
1051
                                    string value = text.VALUE;
1052
                                    LMAAttribute attribute = drawing.Attributes[mappingName];
1053
                                    if (attribute != null)
1054
                                        attribute.set_Value(value);
1055
                                    ReleaseCOMObjects(attribute);
1056
                                    document.TEXTINFOS.Remove(text);
1057
                                }
1058
                            }
1059
                        }
1039 1060

  
1040

  
1061
                        drawingAttributeDT.Dispose();
1062
                    }
1041 1063

  
1042 1064
                    ReleaseCOMObjects(drawing);
1043 1065
                }
DTI_PID/SPPIDConverter/ConverterForm.cs
40 40
        private DataTable _ID2ChildSymbolDT = new DataTable();
41 41
        private DataTable _ID2LineDT = new DataTable();
42 42
        private DataTable _ID2AttributeDT = new DataTable();
43
        private DataTable _ID2DrawingAttributeDT = new DataTable();
43 44
        private DataTable _ID2LinePropertyDT = new DataTable();
44 45
        private DataTable _ID2SymbolTypeDT = new DataTable();
45 46
        private DataTable _ID2SymbolTable = new DataTable();
......
219 220
                InitID2Line();
220 221
                InitID2LineNumber();
221 222
                InitID2Attribute();
223
                InitID2DrawingAttribute();
222 224

  
223 225
                InitETCSetting();
224 226
            }
......
356 358
            }
357 359
        }
358 360

  
361
        private void InitID2DrawingAttribute()
362
        {
363
            using (DataTable drawingAttributeDT = Project_DB.SelectDrawingProjectAttribute())
364
            {
365
                _ID2DrawingAttributeDT = drawingAttributeDT;
366
            }
367
        }
368

  
359 369
        private void InitSPPIDDB()
360 370
        {
361 371
            buttonEditDefaultUnit.TextChanged -= new EventHandler(buttonEditDefaultUnit_TextChanged);
......
646 656
                return;
647 657
            }
648 658

  
649
            MappingForm form = new MappingForm(_ID2SymbolDT,_SPPIDSymbolPathDT, _ID2LineDT, _ID2LinePropertyDT, _ID2AttributeDT, _SPPIDAttributeDT);
659
            MappingForm form = new MappingForm(_ID2SymbolDT,_SPPIDSymbolPathDT, _ID2LineDT, _ID2LinePropertyDT, _ID2AttributeDT, _SPPIDAttributeDT, _ID2DrawingAttributeDT);
650 660
            form.ShowDialog();
651 661
            InitMapping();
652 662
        }
DTI_PID/SPPIDConverter/DB/Project_DB.cs
22 22
        const string SPPID_LABEL_INFO_TABLE = "T_SPPID_LABEL_INFO";
23 23
        const string SPPID_DRAWING_INFO = "T_SPPID_DRAWING_INFO";
24 24
        const string SPPID_OPC_INFO = "T_SPPID_OPC_INFO";
25
        const string ID2_DRAWINGATTRIBUTE_TABLE = "T_ID2_DRAWINGATTRIBUTE";
25 26

  
26 27
        const string LineProperties_TABLE = "LineProperties";
27 28
        const string LineTypes_TABLE = "LineTypes";
......
29 30
        const string SymbolAttribute_TABLE = "SymbolAttribute";
30 31
        const string Symbol_TABLE = "Symbol";
31 32
        const string OPCRelations_TABLE = "OPCRelations";
33
        const string DrawingAttribute_Table = "TitleBlockProperties";
32 34

  
33 35
        private static SqlConnection GetSqlConnection()
34 36
        {
......
113 115
                                        cmd.CommandText = string.Format("CREATE TABLE {0} (ID2_OPC_UID TEXT PRIMARY KEY, SPPID_OPC_MODELITEM_ID TEXT, ID2_DRAWING_UID TEXT, ATTRIBUTES TEXT, PAIRED BOOL)", SPPID_OPC_INFO);
114 116
                                        cmd.ExecuteNonQuery();
115 117
                                    }
118
                                    if (dt.Select(string.Format("NAME = '{0}'", ID2_DRAWINGATTRIBUTE_TABLE)).Length == 0)
119
                                    {
120
                                        cmd.CommandText = string.Format("CREATE TABLE {0} (UID TEXT PRIMARY KEY, NAME TEXT)", ID2_DRAWINGATTRIBUTE_TABLE);
121
                                        cmd.ExecuteNonQuery();
122

  
123
                                        List<string> datas = new List<string>() { "Unit", "Rev No", "Drawing No" };
124
                                        foreach (var data in datas)
125
                                        {
126
                                            cmd.CommandText = string.Format("INSERT INTO {0} VALUES('{1}', '{1}')", ID2_DRAWINGATTRIBUTE_TABLE, data);
127
                                            cmd.ExecuteNonQuery();
128
                                        }
129
                                    }
116 130
                                }
117 131

  
118 132
                                #region Check Column 업데이트시 예비용
......
221 235
                                        cmd.CommandText = string.Format("CREATE TABLE {0} (ID2_OPC_UID varchar(255) PRIMARY KEY, SPPID_OPC_MODELITEM_ID varchar(MAX), ID2_DRAWING_UID varchar(MAX), ATTRIBUTES varchar(MAX), PAIRED BIT)", SPPID_OPC_INFO);
222 236
                                        cmd.ExecuteNonQuery();
223 237
                                    }
238
                                    if (dt.Select(string.Format("NAME = '{0}'", ID2_DRAWINGATTRIBUTE_TABLE)).Length == 0)
239
                                    {
240
                                        cmd.CommandText = string.Format("CREATE TABLE {0} (UID varchar(255) PRIMARY KEY, NAME varchar(255))", ID2_DRAWINGATTRIBUTE_TABLE);
241
                                        cmd.ExecuteNonQuery();
242

  
243
                                        List<string> datas = new List<string>() { "Unit", "Rev No", "Drawing No" };
244
                                        foreach (var data in datas)
245
                                        {
246
                                            cmd.CommandText = string.Format("INSERT INTO {0} VALUES('{1}', '{1}')", ID2_DRAWINGATTRIBUTE_TABLE, data);
247
                                            cmd.ExecuteNonQuery();
248
                                        }
249
                                    }
224 250
                                }
225 251

  
226 252
                                #region Check Column 업데이트시 예비용
......
963 989
            return dt;
964 990
        }
965 991

  
992
        public static DataTable SelectDrawingProjectAttribute()
993
        {
994
            DataTable dt = new DataTable();
995
            Project_Info projectInfo = Project_Info.GetInstance();
996
            if (projectInfo.DBType == ID2DB_Type.SQLite)
997
            {
998
                using (SQLiteConnection connection = new SQLiteConnection(string.Format(CultureInfo.CurrentCulture, "Data Source = {0}", projectInfo.DBFilePath)))
999
                {
1000
                    try
1001
                    {
1002
                        connection.Open();
1003
                        using (SQLiteCommand cmd = connection.CreateCommand())
1004
                        {
1005
                            cmd.CommandText = string.Format(@"
1006
                            SELECT da.UID, da.NAME, sam.SPPID_ATTRIBUTE 
1007
                            FROM {0} as da 
1008
                                 LEFT OUTER JOIN {1} as sam 
1009
                                      ON da.UID = sam.UID;
1010
                            ", DrawingAttribute_Table, SPPID_ATTRIBUTE_MAPPING_TABLE);
1011
                            using (SQLiteDataReader dr = cmd.ExecuteReader())
1012
                                dt.Load(dr);
1013
                        }
1014
                        connection.Close();
1015
                    }
1016
                    catch (Exception ex)
1017
                    {
1018
                        Log.Write(ex.Message + "\r\n" + ex.StackTrace);
1019
                    }
1020
                    finally
1021
                    {
1022
                        connection.Dispose();
1023
                    }
1024
                }
1025
            }
1026
            else if (projectInfo.DBType == ID2DB_Type.MSSQL)
1027
            {
1028
                using (SqlConnection connection = GetSqlConnection())
1029
                {
1030
                    try
1031
                    {
1032
                        if (connection != null && connection.State == ConnectionState.Open)
1033
                        {
1034
                            using (SqlCommand cmd = connection.CreateCommand())
1035
                            {
1036
                                cmd.CommandText = string.Format(@"
1037
                            SELECT da.UID, da.NAME, sam.SPPID_ATTRIBUTE 
1038
                            FROM {0} as da
1039
                                 LEFT OUTER JOIN {1} as sam 
1040
                                      ON da.UID = sam.UID;
1041
                            ", DrawingAttribute_Table, SPPID_ATTRIBUTE_MAPPING_TABLE);
1042
                                using (SqlDataReader dr = cmd.ExecuteReader())
1043
                                    dt.Load(dr);
1044
                            }
1045
                            connection.Close();
1046
                        }
1047
                    }
1048
                    catch (Exception ex)
1049
                    {
1050
                        Log.Write(ex.Message + "\r\n" + ex.StackTrace);
1051
                    }
1052
                    finally
1053
                    {
1054
                        if (connection != null)
1055
                            connection.Dispose();
1056
                    }
1057
                }
1058
            }
1059

  
1060
            dt.Merge(SelectDrawingProjectAttribute2());
1061

  
1062
            return dt;
1063
        }
1064
        private static DataTable SelectDrawingProjectAttribute2()
1065
        {
1066
            DataTable dt = new DataTable();
1067
            Project_Info projectInfo = Project_Info.GetInstance();
1068
            if (projectInfo.DBType == ID2DB_Type.SQLite)
1069
            {
1070
                using (SQLiteConnection connection = new SQLiteConnection(string.Format(CultureInfo.CurrentCulture, "Data Source = {0}", projectInfo.DBFilePath)))
1071
                {
1072
                    try
1073
                    {
1074
                        connection.Open();
1075
                        using (SQLiteCommand cmd = connection.CreateCommand())
1076
                        {
1077
                            cmd.CommandText = string.Format(@"
1078
                            SELECT da.UID, da.NAME, sam.SPPID_ATTRIBUTE 
1079
                            FROM {0} as da 
1080
                                 LEFT OUTER JOIN {1} as sam 
1081
                                      ON da.UID = sam.UID;
1082
                            ", ID2_DRAWINGATTRIBUTE_TABLE, SPPID_ATTRIBUTE_MAPPING_TABLE);
1083
                            using (SQLiteDataReader dr = cmd.ExecuteReader())
1084
                                dt.Load(dr);
1085
                        }
1086
                        connection.Close();
1087
                    }
1088
                    catch (Exception ex)
1089
                    {
1090
                        Log.Write(ex.Message + "\r\n" + ex.StackTrace);
1091
                    }
1092
                    finally
1093
                    {
1094
                        connection.Dispose();
1095
                    }
1096
                }
1097
            }
1098
            else if (projectInfo.DBType == ID2DB_Type.MSSQL)
1099
            {
1100
                using (SqlConnection connection = GetSqlConnection())
1101
                {
1102
                    try
1103
                    {
1104
                        if (connection != null && connection.State == ConnectionState.Open)
1105
                        {
1106
                            using (SqlCommand cmd = connection.CreateCommand())
1107
                            {
1108
                                cmd.CommandText = string.Format(@"
1109
                            SELECT da.UID, da.NAME, sam.SPPID_ATTRIBUTE 
1110
                            FROM {0} as da
1111
                                 LEFT OUTER JOIN {1} as sam 
1112
                                      ON da.UID = sam.UID;
1113
                            ", ID2_DRAWINGATTRIBUTE_TABLE, SPPID_ATTRIBUTE_MAPPING_TABLE);
1114
                                using (SqlDataReader dr = cmd.ExecuteReader())
1115
                                    dt.Load(dr);
1116
                            }
1117
                            connection.Close();
1118
                        }
1119
                    }
1120
                    catch (Exception ex)
1121
                    {
1122
                        Log.Write(ex.Message + "\r\n" + ex.StackTrace);
1123
                    }
1124
                    finally
1125
                    {
1126
                        if (connection != null)
1127
                            connection.Dispose();
1128
                    }
1129
                }
1130
            }
1131

  
1132
            return dt;
1133
        }
1134

  
966 1135
        public static DataTable SelectID2SymbolTable()
967 1136
        {
968 1137
            DataTable dt = new DataTable();
DTI_PID/SPPIDConverter/Form/MappingForm.Designer.cs
31 31
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MappingForm));
32 32
            this.ribbonControl = new DevExpress.XtraBars.Ribbon.RibbonControl();
33 33
            this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
34
            this.gridControlDrawingAttribute = new DevExpress.XtraGrid.GridControl();
35
            this.gridViewDrawingAttribute = new DevExpress.XtraGrid.Views.Grid.GridView();
34 36
            this.textBoxVendorSymbolPath = new DevExpress.XtraEditors.ButtonEdit();
35 37
            this.btnImportData = new DevExpress.XtraEditors.SimpleButton();
36 38
            this.btnExportData = new DevExpress.XtraEditors.SimpleButton();
......
97 99
            this.GroupAttribute = new DevExpress.XtraLayout.LayoutControlGroup();
98 100
            this.layoutControlGroup7 = new DevExpress.XtraLayout.LayoutControlGroup();
99 101
            this.layoutControlItem11 = new DevExpress.XtraLayout.LayoutControlItem();
102
            this.splitterItem6 = new DevExpress.XtraLayout.SplitterItem();
103
            this.layoutControlGroup15 = new DevExpress.XtraLayout.LayoutControlGroup();
104
            this.layoutControlItem30 = new DevExpress.XtraLayout.LayoutControlItem();
100 105
            this.GroupETCSetting = new DevExpress.XtraLayout.LayoutControlGroup();
101 106
            this.emptySpaceItem3 = new DevExpress.XtraLayout.EmptySpaceItem();
102 107
            this.layoutControlGroup9 = new DevExpress.XtraLayout.LayoutControlGroup();
......
124 129
            this.layoutControlItem12 = new DevExpress.XtraLayout.LayoutControlItem();
125 130
            this.layoutControlItem4 = new DevExpress.XtraLayout.LayoutControlItem();
126 131
            this.emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem();
132
            this.splitterItem2 = new DevExpress.XtraLayout.SplitterItem();
127 133
            ((System.ComponentModel.ISupportInitialize)(this.ribbonControl)).BeginInit();
128 134
            ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
129 135
            this.layoutControl1.SuspendLayout();
136
            ((System.ComponentModel.ISupportInitialize)(this.gridControlDrawingAttribute)).BeginInit();
137
            ((System.ComponentModel.ISupportInitialize)(this.gridViewDrawingAttribute)).BeginInit();
130 138
            ((System.ComponentModel.ISupportInitialize)(this.textBoxVendorSymbolPath.Properties)).BeginInit();
131 139
            ((System.ComponentModel.ISupportInitialize)(this.spinEditDrainValveCellCount.Properties)).BeginInit();
132 140
            ((System.ComponentModel.ISupportInitialize)(this.spinEditMinSymbolGridCellCount.Properties)).BeginInit();
......
187 195
            ((System.ComponentModel.ISupportInitialize)(this.GroupAttribute)).BeginInit();
188 196
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup7)).BeginInit();
189 197
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem11)).BeginInit();
198
            ((System.ComponentModel.ISupportInitialize)(this.splitterItem6)).BeginInit();
199
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup15)).BeginInit();
200
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem30)).BeginInit();
190 201
            ((System.ComponentModel.ISupportInitialize)(this.GroupETCSetting)).BeginInit();
191 202
            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem3)).BeginInit();
192 203
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup9)).BeginInit();
......
214 225
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem12)).BeginInit();
215 226
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).BeginInit();
216 227
            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).BeginInit();
228
            ((System.ComponentModel.ISupportInitialize)(this.splitterItem2)).BeginInit();
217 229
            this.SuspendLayout();
218 230
            // 
219 231
            // ribbonControl
......
233 245
            // 
234 246
            // layoutControl1
235 247
            // 
248
            this.layoutControl1.Controls.Add(this.gridControlDrawingAttribute);
236 249
            this.layoutControl1.Controls.Add(this.textBoxVendorSymbolPath);
237 250
            this.layoutControl1.Controls.Add(this.btnImportData);
238 251
            this.layoutControl1.Controls.Add(this.btnExportData);
......
270 283
            this.layoutControl1.TabIndex = 2;
271 284
            this.layoutControl1.Text = "layoutControl1";
272 285
            // 
286
            // gridControlDrawingAttribute
287
            // 
288
            this.gridControlDrawingAttribute.Location = new System.Drawing.Point(36, 543);
289
            this.gridControlDrawingAttribute.MainView = this.gridViewDrawingAttribute;
290
            this.gridControlDrawingAttribute.MenuManager = this.ribbonControl;
291
            this.gridControlDrawingAttribute.Name = "gridControlDrawingAttribute";
292
            this.gridControlDrawingAttribute.Size = new System.Drawing.Size(744, 173);
293
            this.gridControlDrawingAttribute.TabIndex = 42;
294
            this.gridControlDrawingAttribute.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
295
            this.gridViewDrawingAttribute});
296
            // 
297
            // gridViewDrawingAttribute
298
            // 
299
            this.gridViewDrawingAttribute.GridControl = this.gridControlDrawingAttribute;
300
            this.gridViewDrawingAttribute.Name = "gridViewDrawingAttribute";
301
            this.gridViewDrawingAttribute.OptionsView.ShowGroupPanel = false;
302
            // 
273 303
            // textBoxVendorSymbolPath
274 304
            // 
275 305
            this.textBoxVendorSymbolPath.Location = new System.Drawing.Point(184, 370);
......
511 541
            this.gridControlAttribute.MainView = this.gridViewAttribute;
512 542
            this.gridControlAttribute.MenuManager = this.ribbonControl;
513 543
            this.gridControlAttribute.Name = "gridControlAttribute";
514
            this.gridControlAttribute.Size = new System.Drawing.Size(744, 638);
544
            this.gridControlAttribute.Size = new System.Drawing.Size(744, 413);
515 545
            this.gridControlAttribute.TabIndex = 19;
516 546
            this.gridControlAttribute.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
517 547
            this.gridViewAttribute});
......
601 631
            this.pictureEditID2Symbol.Name = "pictureEditID2Symbol";
602 632
            this.pictureEditID2Symbol.Properties.ShowCameraMenuItem = DevExpress.XtraEditors.Controls.CameraMenuItemVisibility.Auto;
603 633
            this.pictureEditID2Symbol.Properties.SizeMode = DevExpress.XtraEditors.Controls.PictureSizeMode.Squeeze;
604
            this.pictureEditID2Symbol.Size = new System.Drawing.Size(379, 306);
634
            this.pictureEditID2Symbol.Size = new System.Drawing.Size(354, 306);
605 635
            this.pictureEditID2Symbol.StyleController = this.layoutControl1;
606 636
            this.pictureEditID2Symbol.TabIndex = 4;
607 637
            // 
608 638
            // pictureEditMapped
609 639
            // 
610
            this.pictureEditMapped.Location = new System.Drawing.Point(448, 410);
640
            this.pictureEditMapped.Location = new System.Drawing.Point(423, 410);
611 641
            this.pictureEditMapped.MenuManager = this.ribbonControl;
612 642
            this.pictureEditMapped.Name = "pictureEditMapped";
613 643
            this.pictureEditMapped.Properties.ShowCameraMenuItem = DevExpress.XtraEditors.Controls.CameraMenuItemVisibility.Auto;
614 644
            this.pictureEditMapped.Properties.SizeMode = DevExpress.XtraEditors.Controls.PictureSizeMode.Squeeze;
615
            this.pictureEditMapped.Size = new System.Drawing.Size(332, 306);
645
            this.pictureEditMapped.Size = new System.Drawing.Size(357, 306);
616 646
            this.pictureEditMapped.StyleController = this.layoutControl1;
617 647
            this.pictureEditMapped.TabIndex = 5;
618 648
            // 
......
808 838
            this.layoutControlItem1});
809 839
            this.layoutControlGroup3.Location = new System.Drawing.Point(0, 332);
810 840
            this.layoutControlGroup3.Name = "layoutControlGroup3";
811
            this.layoutControlGroup3.Size = new System.Drawing.Size(407, 353);
841
            this.layoutControlGroup3.Size = new System.Drawing.Size(382, 353);
812 842
            this.layoutControlGroup3.Text = "ID2 Image";
813 843
            // 
814 844
            // layoutControlItem1
......
816 846
            this.layoutControlItem1.Control = this.pictureEditID2Symbol;
817 847
            this.layoutControlItem1.Location = new System.Drawing.Point(0, 0);
818 848
            this.layoutControlItem1.Name = "layoutControlItem1";
819
            this.layoutControlItem1.Size = new System.Drawing.Size(383, 310);
849
            this.layoutControlItem1.Size = new System.Drawing.Size(358, 310);
820 850
            this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0);
821 851
            this.layoutControlItem1.TextVisible = false;
822 852
            // 
......
824 854
            // 
825 855
            this.layoutControlGroup4.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
826 856
            this.layoutControlItem2});
827
            this.layoutControlGroup4.Location = new System.Drawing.Point(412, 332);
857
            this.layoutControlGroup4.Location = new System.Drawing.Point(387, 332);
828 858
            this.layoutControlGroup4.Name = "layoutControlGroup4";
829
            this.layoutControlGroup4.Size = new System.Drawing.Size(360, 353);
859
            this.layoutControlGroup4.Size = new System.Drawing.Size(385, 353);
830 860
            this.layoutControlGroup4.Text = "Mapped Image";
831 861
            // 
832 862
            // layoutControlItem2
......
834 864
            this.layoutControlItem2.Control = this.pictureEditMapped;
835 865
            this.layoutControlItem2.Location = new System.Drawing.Point(0, 0);
836 866
            this.layoutControlItem2.Name = "layoutControlItem2";
837
            this.layoutControlItem2.Size = new System.Drawing.Size(336, 310);
867
            this.layoutControlItem2.Size = new System.Drawing.Size(361, 310);
838 868
            this.layoutControlItem2.TextSize = new System.Drawing.Size(0, 0);
839 869
            this.layoutControlItem2.TextVisible = false;
840 870
            // 
841 871
            // splitterItem4
842 872
            // 
843 873
            this.splitterItem4.AllowHotTrack = true;
844
            this.splitterItem4.Location = new System.Drawing.Point(407, 332);
874
            this.splitterItem4.Location = new System.Drawing.Point(382, 332);
845 875
            this.splitterItem4.Name = "splitterItem4";
846 876
            this.splitterItem4.Size = new System.Drawing.Size(5, 353);
847 877
            // 
......
944 974
            // GroupAttribute
945 975
            // 
946 976
            this.GroupAttribute.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
947
            this.layoutControlGroup7});
977
            this.layoutControlGroup7,
978
            this.splitterItem6,
979
            this.layoutControlGroup15});
948 980
            this.GroupAttribute.Location = new System.Drawing.Point(0, 0);
949 981
            this.GroupAttribute.Name = "GroupAttribute";
950 982
            this.GroupAttribute.Size = new System.Drawing.Size(772, 685);
......
956 988
            this.layoutControlItem11});
957 989
            this.layoutControlGroup7.Location = new System.Drawing.Point(0, 0);
958 990
            this.layoutControlGroup7.Name = "layoutControlGroup7";
959
            this.layoutControlGroup7.Size = new System.Drawing.Size(772, 685);
991
            this.layoutControlGroup7.Size = new System.Drawing.Size(772, 460);
960 992
            this.layoutControlGroup7.Text = "ID2 Attribute List";
961 993
            // 
962 994
            // layoutControlItem11
......
964 996
            this.layoutControlItem11.Control = this.gridControlAttribute;
965 997
            this.layoutControlItem11.Location = new System.Drawing.Point(0, 0);
966 998
            this.layoutControlItem11.Name = "layoutControlItem11";
967
            this.layoutControlItem11.Size = new System.Drawing.Size(748, 642);
999
            this.layoutControlItem11.Size = new System.Drawing.Size(748, 417);
968 1000
            this.layoutControlItem11.TextSize = new System.Drawing.Size(0, 0);
969 1001
            this.layoutControlItem11.TextVisible = false;
970 1002
            // 
1003
            // splitterItem6
1004
            // 
1005
            this.splitterItem6.AllowHotTrack = true;
1006
            this.splitterItem6.Location = new System.Drawing.Point(0, 460);
1007
            this.splitterItem6.Name = "splitterItem6";
1008
            this.splitterItem6.Size = new System.Drawing.Size(772, 5);
1009
            // 
1010
            // layoutControlGroup15
1011
            // 
1012
            this.layoutControlGroup15.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
1013
            this.layoutControlItem30});
1014
            this.layoutControlGroup15.Location = new System.Drawing.Point(0, 465);
1015
            this.layoutControlGroup15.Name = "layoutControlGroup15";
1016
            this.layoutControlGroup15.Size = new System.Drawing.Size(772, 220);
1017
            this.layoutControlGroup15.Text = "ID2 Drawing Attribute List";
1018
            // 
1019
            // layoutControlItem30
1020
            // 
1021
            this.layoutControlItem30.Control = this.gridControlDrawingAttribute;
1022
            this.layoutControlItem30.Location = new System.Drawing.Point(0, 0);
1023
            this.layoutControlItem30.Name = "layoutControlItem30";
1024
            this.layoutControlItem30.Size = new System.Drawing.Size(748, 177);
1025
            this.layoutControlItem30.TextSize = new System.Drawing.Size(0, 0);
1026
            this.layoutControlItem30.TextVisible = false;
1027
            // 
971 1028
            // GroupETCSetting
972 1029
            // 
973 1030
            this.GroupETCSetting.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
......
1234 1291
            this.emptySpaceItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
1235 1292
            this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
1236 1293
            // 
1294
            // splitterItem2
1295
            // 
1296
            this.splitterItem2.AllowHotTrack = true;
1297
            this.splitterItem2.Location = new System.Drawing.Point(0, 637);
1298
            this.splitterItem2.Name = "splitterItem2";
1299
            this.splitterItem2.Size = new System.Drawing.Size(748, 5);
1300
            // 
1237 1301
            // MappingForm
1238 1302
            // 
1239 1303
            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
......
1250 1314
            ((System.ComponentModel.ISupportInitialize)(this.ribbonControl)).EndInit();
1251 1315
            ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit();
1252 1316
            this.layoutControl1.ResumeLayout(false);
1317
            ((System.ComponentModel.ISupportInitialize)(this.gridControlDrawingAttribute)).EndInit();
1318
            ((System.ComponentModel.ISupportInitialize)(this.gridViewDrawingAttribute)).EndInit();
1253 1319
            ((System.ComponentModel.ISupportInitialize)(this.textBoxVendorSymbolPath.Properties)).EndInit();
1254 1320
            ((System.ComponentModel.ISupportInitialize)(this.spinEditDrainValveCellCount.Properties)).EndInit();
1255 1321
            ((System.ComponentModel.ISupportInitialize)(this.spinEditMinSymbolGridCellCount.Properties)).EndInit();
......
1310 1376
            ((System.ComponentModel.ISupportInitialize)(this.GroupAttribute)).EndInit();
1311 1377
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup7)).EndInit();
1312 1378
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem11)).EndInit();
1379
            ((System.ComponentModel.ISupportInitialize)(this.splitterItem6)).EndInit();
1380
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup15)).EndInit();
1381
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem30)).EndInit();
1313 1382
            ((System.ComponentModel.ISupportInitialize)(this.GroupETCSetting)).EndInit();
1314 1383
            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem3)).EndInit();
1315 1384
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup9)).EndInit();
......
1337 1406
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem12)).EndInit();
1338 1407
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).EndInit();
1339 1408
            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).EndInit();
1409
            ((System.ComponentModel.ISupportInitialize)(this.splitterItem2)).EndInit();
1340 1410
            this.ResumeLayout(false);
1341 1411
            this.PerformLayout();
1342 1412

  
......
1439 1509
        private DevExpress.XtraEditors.ButtonEdit btnBorder;
1440 1510
        private DevExpress.XtraLayout.LayoutControlGroup layoutControlGroup14;
1441 1511
        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem29;
1512
        private DevExpress.XtraLayout.SplitterItem splitterItem2;
1513
        private DevExpress.XtraGrid.GridControl gridControlDrawingAttribute;
1514
        private DevExpress.XtraGrid.Views.Grid.GridView gridViewDrawingAttribute;
1515
        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem30;
1516
        private DevExpress.XtraLayout.SplitterItem splitterItem6;
1517
        private DevExpress.XtraLayout.LayoutControlGroup layoutControlGroup15;
1442 1518
    }
1443 1519
}
DTI_PID/SPPIDConverter/Form/MappingForm.cs
58 58
        DataTable linePropertyDT;
59 59
        DataTable attributeDT;
60 60
        DataTable SPPIDAttributeDT;
61
        DataTable drawingAttributeDT;
61 62

  
62 63
        ButtonEdit currentButtonEdit;
63
        public MappingForm(DataTable symbolDT, DataTable SPPIDSymbolPathDT, DataTable lineDT, DataTable linePropertyDT, DataTable attributeDT, DataTable SPPIDAttributeDT)
64
        public MappingForm(DataTable symbolDT, DataTable SPPIDSymbolPathDT, DataTable lineDT, DataTable linePropertyDT, DataTable attributeDT, DataTable SPPIDAttributeDT, DataTable drawingAttributeDT)
64 65
        {
65 66
            InitializeComponent();
66 67
            this.symbolDT = symbolDT;
......
69 70
            this.linePropertyDT = linePropertyDT;
70 71
            this.attributeDT = attributeDT;
71 72
            this.SPPIDAttributeDT = SPPIDAttributeDT;
73
            this.drawingAttributeDT = drawingAttributeDT;
72 74

  
73 75
            checkComboBoxTextLocation.EditValueChanging += TextEdit1_EditValueChanging;
74 76
            checkComboBoxTextLocation.Properties.SeparatorChar = ',';
......
183 185
            gridControlAttribute.RepositoryItems.Add(clearButton);
184 186
            gridViewAttribute.ExpandAllGroups();
185 187

  
188
            // Drawing Attribute GridView
189
            gridControlDrawingAttribute.DataSource = drawingAttributeDT;
190
            gridViewDrawingAttribute.Columns["UID"].Visible = false;
191
            gridViewDrawingAttribute.Columns["NAME"].OptionsColumn.AllowEdit = false;
192

  
193
            gridControlDrawingAttribute.RepositoryItems.Add(lookUpEdit);
194
            gridViewDrawingAttribute.Columns["SPPID_ATTRIBUTE"].ColumnEdit = lookUpEdit;
195

  
196

  
186 197
            // LineNumber GridView
187 198
            gridControlLineNumber.DataSource = linePropertyDT;
188 199
            gridViewLineNumber.Columns["UID"].Visible = false;
......
416 427
                labelDatas.Add(new Tuple<string, int, bool>(_uid, _LOCATION, _LEADERLINE));
417 428
            }
418 429

  
430
            foreach (DataRow row in drawingAttributeDT.Rows)
431
            {
432
                string _uid = row["UID"].ToString();
433
                string _SPPID_Attribute = row["SPPID_ATTRIBUTE"] == DBNull.Value ? null : row["SPPID_ATTRIBUTE"].ToString();
434
                attributeDatas.Add(new Tuple<string, string>(_uid, _SPPID_Attribute));
435
            }
436

  
419 437
            #region Setting
420 438
            Dictionary<string, string> dicSetting = new Dictionary<string, string>();
421 439

  

내보내기 Unified diff

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