프로젝트

일반

사용자정보

개정판 4f02de16

ID4f02de1611be60aa8a40debdfeb17d94037636b2
상위 12bc797d
하위 bc31413d

이지연이(가) 2년 이상 전에 추가함

issue #000: tie in point

Change-Id: I0abf8c076f7b1995a4c3fb3173c3ae810e9d1dd9

차이점 보기:

DTI_PID/ID2PSN/DB.cs
404 404
                    dicColCheck.Clear();
405 405
                    dicColCheck.Add("INDEX", "INTEGER");
406 406
                    dicColCheck.Add("NAME", "TEXT");
407
                    dicColCheck.Add("MULTIWAY", "TEXT");
408 407
                    if (matched == null)
409 408
                    {
410
                        var query = $"CREATE TABLE {PSN_MULTIWAY_SETTING} ([INDEX] INTEGER, [NAME] TEXT, [MULTIWAY] TEXT)";
409
                        var query = $"CREATE TABLE {PSN_MULTIWAY_SETTING} ([INDEX] INTEGER, [NAME] TEXT)";
411 410
                        using (var cmd = connection.GetSqlStringCommand(query))
412 411
                        {
413 412
                            cmd.ExecuteNonQuery();
......
1177 1176
            {
1178 1177
                try
1179 1178
                {
1180
                    var query = $@"SELECT [MULTIWAY], [INDEX], [NAME] FROM {PSN_MULTIWAY_SETTING};";
1179
                    var query = $@"SELECT [INDEX], [NAME] FROM {PSN_MULTIWAY_SETTING};";
1181 1180
                    using (var ds = connection.ExecuteDataSet(connection.GetSqlStringCommand(query)))
1182 1181
                    {
1183 1182
                        dt = ds.Tables[0].Copy();
......
1429 1428

  
1430 1429
                        foreach (MultiwayItem item in multiwayItems)
1431 1430
                        {
1432
                            query = $"INSERT INTO {PSN_MULTIWAY_SETTING} ([INDEX], NAME, MULTIWAY) VALUES (@INDEX, @NAME, @MULTIWAY)";
1431
                            query = $"INSERT INTO {PSN_MULTIWAY_SETTING} ([INDEX], NAME) VALUES (@INDEX, @NAME)";
1433 1432
                            var cmd = connection.GetSqlStringCommand(query);
1434 1433
                            AddWithValue(cmd, "@INDEX", item.Index);
1435 1434
                            AddWithValue(cmd, "@NAME", item.Name);
1436
                            AddWithValue(cmd, "@MULTIWAY", item.Multiway);
1437 1435
                            connection.ExecuteNonQuery(cmd, txn);
1438 1436
                        }
1439 1437

  
......
3023 3021
                    dicColCheck.Clear();
3024 3022
                    dicColCheck.Add("INDEX", "INTEGER");
3025 3023
                    dicColCheck.Add("NAME", "TEXT");
3026
                    dicColCheck.Add("MULTIWAY", "TEXT");
3027 3024
                    if (matched == null)
3028 3025
                    {
3029
                        var query = $"CREATE TABLE {PSN_MULTIWAY_SETTING} ([INDEX] INTEGER, [NAME] TEXT, [MULTIWAY] TEXT)";
3026
                        var query = $"CREATE TABLE {PSN_MULTIWAY_SETTING} ([INDEX] INTEGER, [NAME] TEXT)";
3030 3027
                        using (var cmd = connection.GetSqlStringCommand(query))
3031 3028
                        {
3032 3029
                            cmd.ExecuteNonQuery();
......
3692 3689

  
3693 3690
                            foreach (MultiwayItem itemMultiway in multiwayItems)
3694 3691
                            {
3695
                                query = $"INSERT INTO {PSN_MULTIWAY_SETTING} ([INDEX], NAME, MULTIWAY) VALUES (@INDEX, @NAME, @MULTIWAY)";
3692
                                query = $"INSERT INTO {PSN_MULTIWAY_SETTING} ([INDEX], NAME) VALUES (@INDEX, @NAME)";
3696 3693
                                var cmd = connection.GetSqlStringCommand(query);
3697 3694
                                AddWithValue(cmd, "@INDEX", itemMultiway.Index);
3698 3695
                                AddWithValue(cmd, "@NAME", itemMultiway.Name);
3699
                                AddWithValue(cmd, "@MULTIWAY", itemMultiway.Multiway);
3700 3696
                                connection.ExecuteNonQuery(cmd, txn);
3701 3697
                            }
3702 3698

  
DTI_PID/ID2PSN/Form/DBSettingForm.cs
170 170
                {
171 171
                    int index = Convert.ToInt32(row["INDEX"]);
172 172
                    string name = row["NAME"].ToString();
173
                    string Multiway = row["MULTIWAY"].ToString();
174 173

  
175 174
                    //KeywordInfo keywordInfo = new KeywordInfo();   
176 175
                    MultiwayInfos.MultiwayItems.Add(new MultiwayItem()
177 176
                    {
178 177
                        Index = index,
179
                        Name = name,
180
                        Multiway = Multiway
178
                        Name = name
181 179
                    });
182 180
                }
183 181

  
DTI_PID/ID2PSN/Form/MainForm.Designer.cs
58 58
            this.btnValveGroupItemsSetting = new DevExpress.XtraEditors.SimpleButton();
59 59
            this.btnEquipment = new DevExpress.XtraEditors.SimpleButton();
60 60
            this.btnHistory = new DevExpress.XtraEditors.SimpleButton();
61
            this.TieInSetting = new DevExpress.XtraEditors.SimpleButton();
61 62
            this.Root = new DevExpress.XtraLayout.LayoutControlGroup();
62 63
            this.layoutControlGroupMain = new DevExpress.XtraLayout.LayoutControlGroup();
63 64
            this.layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem();
......
70 71
            this.layoutControlItem16 = new DevExpress.XtraLayout.LayoutControlItem();
71 72
            this.layoutControlItem7 = new DevExpress.XtraLayout.LayoutControlItem();
72 73
            this.layoutControlItem8 = new DevExpress.XtraLayout.LayoutControlItem();
74
            this.layoutControlItem10 = new DevExpress.XtraLayout.LayoutControlItem();
73 75
            this.layoutControlGroup2 = new DevExpress.XtraLayout.LayoutControlGroup();
74 76
            this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
75 77
            this.emptySpaceItem2 = new DevExpress.XtraLayout.EmptySpaceItem();
......
85 87
            this.toolStripMenuItemPathItems = new System.Windows.Forms.ToolStripMenuItem();
86 88
            this.splashScreenManager1 = new DevExpress.XtraSplashScreen.SplashScreenManager(this, typeof(global::ID2PSN.WaitForm), true, true);
87 89
            this.sqLiteCommandBuilder1 = new System.Data.SQLite.SQLiteCommandBuilder();
88
            this.TieInSetting = new DevExpress.XtraEditors.SimpleButton();
89
            this.layoutControlItem10 = new DevExpress.XtraLayout.LayoutControlItem();
90 90
            ((System.ComponentModel.ISupportInitialize)(this.ribbonControl)).BeginInit();
91 91
            ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
92 92
            this.layoutControl1.SuspendLayout();
......
113 113
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem16)).BeginInit();
114 114
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).BeginInit();
115 115
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem8)).BeginInit();
116
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem10)).BeginInit();
116 117
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup2)).BeginInit();
117 118
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
118 119
            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem2)).BeginInit();
......
125 126
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem13)).BeginInit();
126 127
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem17)).BeginInit();
127 128
            this.contextMenuPSN.SuspendLayout();
128
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem10)).BeginInit();
129 129
            this.SuspendLayout();
130 130
            // 
131 131
            // ribbonControl
......
421 421
            this.btnHistory.Text = "View Revision History";
422 422
            this.btnHistory.Click += new System.EventHandler(this.btnHistory_Click);
423 423
            // 
424
            // TieInSetting
425
            // 
426
            this.TieInSetting.Location = new System.Drawing.Point(24, 251);
427
            this.TieInSetting.Name = "TieInSetting";
428
            this.TieInSetting.Size = new System.Drawing.Size(233, 22);
429
            this.TieInSetting.StyleController = this.layoutControl1;
430
            this.TieInSetting.TabIndex = 27;
431
            this.TieInSetting.Text = "Tie-In Setting";
432
            this.TieInSetting.Click += new System.EventHandler(this.TieInSetting_Click);
433
            // 
424 434
            // Root
425 435
            // 
426 436
            this.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
......
545 555
            this.layoutControlItem8.TextSize = new System.Drawing.Size(0, 0);
546 556
            this.layoutControlItem8.TextVisible = false;
547 557
            // 
558
            // layoutControlItem10
559
            // 
560
            this.layoutControlItem10.Control = this.TieInSetting;
561
            this.layoutControlItem10.Location = new System.Drawing.Point(0, 208);
562
            this.layoutControlItem10.Name = "layoutControlItem10";
563
            this.layoutControlItem10.Size = new System.Drawing.Size(237, 26);
564
            this.layoutControlItem10.TextSize = new System.Drawing.Size(0, 0);
565
            this.layoutControlItem10.TextVisible = false;
566
            // 
548 567
            // layoutControlGroup2
549 568
            // 
550 569
            this.layoutControlGroup2.GroupStyle = DevExpress.Utils.GroupStyle.Card;
......
673 692
            this.sqLiteCommandBuilder1.DataAdapter = null;
674 693
            this.sqLiteCommandBuilder1.QuoteSuffix = "]";
675 694
            // 
676
            // TieInSetting
677
            // 
678
            this.TieInSetting.Location = new System.Drawing.Point(24, 251);
679
            this.TieInSetting.Name = "TieInSetting";
680
            this.TieInSetting.Size = new System.Drawing.Size(233, 22);
681
            this.TieInSetting.StyleController = this.layoutControl1;
682
            this.TieInSetting.TabIndex = 27;
683
            this.TieInSetting.Text = "Tie-In Setting";
684
            this.TieInSetting.Click += new System.EventHandler(this.TieInSetting_Click);
685
            // 
686
            // layoutControlItem10
687
            // 
688
            this.layoutControlItem10.Control = this.TieInSetting;
689
            this.layoutControlItem10.Location = new System.Drawing.Point(0, 208);
690
            this.layoutControlItem10.Name = "layoutControlItem10";
691
            this.layoutControlItem10.Size = new System.Drawing.Size(237, 26);
692
            this.layoutControlItem10.TextSize = new System.Drawing.Size(0, 0);
693
            this.layoutControlItem10.TextVisible = false;
694
            // 
695 695
            // MainForm
696 696
            // 
697 697
            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
......
730 730
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem16)).EndInit();
731 731
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).EndInit();
732 732
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem8)).EndInit();
733
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem10)).EndInit();
733 734
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup2)).EndInit();
734 735
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
735 736
            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem2)).EndInit();
......
742 743
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem13)).EndInit();
743 744
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem17)).EndInit();
744 745
            this.contextMenuPSN.ResumeLayout(false);
745
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem10)).EndInit();
746 746
            this.ResumeLayout(false);
747 747
            this.PerformLayout();
748 748

  
DTI_PID/ID2PSN/Form/MainForm.cs
1065 1065

  
1066 1066
        private void MultiwaySetting_Click(object sender, EventArgs e)
1067 1067
        {
1068
            TieInSetting form = new TieInSetting();
1068
            MultiwaySetting form = new MultiwaySetting();
1069 1069
            form.ShowDialog();
1070 1070
        }
1071 1071

  
DTI_PID/ID2PSN/Form/MainForm.resx
118 118
    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119 119
  </resheader>
120 120
  <metadata name="defaultLookAndFeel.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
121
    <value>197, 17</value>
121
    <value>17, 56</value>
122 122
  </metadata>
123 123
  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
124 124
  <data name="btnSaveAs.ImageOptions.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
......
344 344
</value>
345 345
  </data>
346 346
  <metadata name="contextMenuPSN.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
347
    <value>359, 17</value>
347
    <value>17, 95</value>
348 348
  </metadata>
349 349
  <metadata name="sqLiteCommandBuilder1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
350
    <value>507, 17</value>
350
    <value>17, 134</value>
351 351
  </metadata>
352 352
  <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
353 353
    <value>25</value>
DTI_PID/ID2PSN/Form/MultiwaySetting.cs
68 68

  
69 69
            DataTable dtType = new DataTable();
70 70
            dtType.Columns.Add("Index");
71
            dtType.Columns.Add("Multiways");
72 71
            dtType.Columns.Add("Name");
73 72
            dtType.Columns.Add(" ");
74 73
            gridControlMultiway.DataSource = dtType;
......
79 78
            gridColumn.OptionsColumn.AllowEdit = false;
80 79
            gridColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
81 80
            gridColumn.VisibleIndex = 0;
82
            gridColumn = gridViewMultiway.Columns[1];
83
            gridColumn.Name = "Multiways";
84
            gridColumn.Caption = "Transform Key Words";
85
            gridColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
86
            gridColumn.VisibleIndex = 1;
87
            //gridColumn.AppearanceHeader.BackColor = Color.Red;
88 81
            
89
            gridColumn = gridViewMultiway.Columns[2];
82
            gridColumn = gridViewMultiway.Columns[1];
90 83
            gridColumn.Name = "Name";
91 84
            gridColumn.Caption = "ID2 Symbol Name";
92 85
            gridColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
93
            gridColumn.VisibleIndex = 2;
86
            gridColumn.VisibleIndex = 1;
94 87

  
95 88
            RepositoryItemTreeListLookUpEdit treeListLookUpEdit = new RepositoryItemTreeListLookUpEdit();
96 89
            gridControlMultiway.RepositoryItems.Add(treeListLookUpEdit);
97 90
            SetSymbol(treeListLookUpEdit);
98 91
            gridColumn.ColumnEdit = treeListLookUpEdit;
99 92

  
100
            gridColumn = gridViewMultiway.Columns[3];
93
            gridColumn = gridViewMultiway.Columns[2];
101 94
            gridColumn.Name = "Remove";
102 95
            gridColumn.Caption = "";
103 96
            gridColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
104
            gridColumn.VisibleIndex = 3;
97
            gridColumn.VisibleIndex = 2;
105 98
            gridColumn.MaxWidth = 16;
106 99
            
107 100
            gridColumn.ColumnEdit = btnRemove;
......
144 137
        {
145 138
            DataTable dt = DB.SelectMultiwaysSetting();
146 139
            DataTable typeDT = gridControlMultiway.DataSource as DataTable;
147
            bool check = false;
148 140
            foreach (DataRow row in dt.Rows)
149 141
            {
150 142
                int index = Convert.ToInt32(row["INDEX"]);
151 143
                string name = row["NAME"].ToString();    
152
                string Multiway = row["Multiway"].ToString();
153
                if (!name.Equals("useID2Attribute"))
154
                    typeDT.Rows.Add(index, Multiway, name, null);
155
                else
156
                {
157
                    if(Convert.ToBoolean(Multiway))
158
                        check = true;
159
                }    
144
                typeDT.Rows.Add(index,  name, null);                
160 145
            }
161 146
        }
162 147

  
......
240 225
            }
241 226

  
242 227
            DataTable dt = gridControlMultiway.DataSource as DataTable;
243
            dt.Rows.Add(dt.Rows.Count + 1, null, null, null);
228
            dt.Rows.Add(dt.Rows.Count + 1, null, null);
244 229
            gridViewMultiway.Columns["Index"].BestFit();
245 230
        }
246 231

  
......
251 236
            for (int i = 0; i < MultiwayInfo.MultiwayItems.Count; i++)
252 237
            {
253 238
                MultiwayItem item = MultiwayInfo.MultiwayItems[i];
254
                dt.Rows.Add(item.Index, item.Multiway, item.Name);
239
                dt.Rows.Add(item.Index, item.Name);
255 240
            }
256 241
        }
257 242

  
......
266 251
                MultiwayInfo.MultiwayItems.Add(new MultiwayItem()
267 252
                {
268 253
                    Index = i + 1,
269
                    Name = row["Name"].ToString(),
270
                    Multiway = row["Multiways"].ToString()
254
                    Name = row["Name"].ToString()
271 255
                });
272 256
            }
273 257
        }
......
297 281
            }
298 282

  
299 283
            ReNumbering(currentMultiwayInfo);
300
            if(currentMultiwayInfo.MultiwayItems.Find(x => x.Multiway == string.Empty || x.Name == string.Empty) != null)
284
            if(currentMultiwayInfo.MultiwayItems.Find(x => x.Name == string.Empty) != null)
301 285
            {
302 286
                MessageBox.Show("Please save after entering data.", "ID2 " + ID2Info.ProgramName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
303 287
                return;
DTI_PID/ID2PSN/Object/Item.cs
53 53
        public Equipment Equipment { get; set; }
54 54
        public Document Document { get; set; }
55 55
        public string Keyword { get; set; }
56
  
56

  
57
        public Item pairItem { get; set; }
58
        public Item LineItemCopy()
59
        {
60
            Item newItem = new Item();
61

  
62
            newItem.UID = Guid.NewGuid().ToString();
63

  
64
            newItem.Name = this.Name;
65
            newItem.ID2DBType = this.ID2DBType;
66
            newItem.Owner = this.Owner;
67
            newItem.ItemType = ItemType.Line;
68

  
69
            List<Attribute> attributes = new List<Attribute>();
70
            foreach (var attr in this.Attributes)
71
            {
72
                attributes.Add(new Attribute()
73
                {
74
                    UID = attr.UID,
75
                    Name = attr.Name,
76
                    DisplayName = attr.DisplayName,
77
                    Value = attr.Value
78
                });
79
            }
80
            newItem.Attributes = attributes;
81

  
82
            List<Relation> relations = new List<Relation>();
83
            foreach (var _relation in this.Relations)
84
            {
85
                relations.Add(new Relation()
86
                {
87
                    UID = "None",
88
                    Point = (double[])_relation.Point.Clone()
89
                });
90
            }
91
            newItem.Relations = relations;
92

  
93
            return newItem;
94
        }
95

  
96
        public string GetAttributeByName(string name)
97
        {
98
            Attribute attribute = this.Attributes.Find(x => x.Name.ToUpper() == name.ToUpper());
99
            if (attribute != null && !string.IsNullOrEmpty(attribute.Value) && attribute.Value != "None")
100
            {
101
                return attribute.Value;
102
            }
103

  
104
            if (this.LineNumber != null)
105
            {
106
                attribute = this.LineNumber.Attributes.Find(x => x.Name.ToUpper() == name.ToUpper());
107
                if (attribute != null)
108
                {
109
                    return attribute.Value;
110
                }
111
            }
112

  
113
            return null;
114
        }
115

  
57 116
    }
58 117

  
59 118
    public class Relation 
DTI_PID/ID2PSN/Object/MultiwayInfo.cs
15 15
    public class MultiwayItem
16 16
    {
17 17
        public int Index { get; set; }
18
        public string Multiway { get; set; }
19 18
        public string Name { get; set; }
20 19
    }
21 20
}
DTI_PID/ID2PSN/PSN.cs
3400 3400
                                    PathItems.Rows.InsertAt(createLineRow(PathItems.Select(string.Format("PipeLine_OID = '{0}' AND PipeSystemNetwork_OID = '{1}'", item.PSNPipeLineID, dataRow["OID"])).First()), insertIndex);
3401 3401
                                    PathItems.Rows.InsertAt(createTerminatorRow(pathItemRows.First(), FROM_DATA), insertIndex);
3402 3402

  
3403
                                    bCheck = true;
3403
                                    bCheck = true; 
3404 3404
                                }
3405 3405
                            }
3406 3406
                            else

내보내기 Unified diff

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