프로젝트

일반

사용자정보

개정판 ecd39237

IDecd392374ee29bdac78e823caa070fa848d7f706
상위 dd624cbd
하위 a352d94f

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

dev issue #1227 : dev OPC mapping form

Change-Id: I7e1e12f86525a2cbbdd212329f6c63b95015fed0

차이점 보기:

DTI_PID/APIDConverter/AVEVA.PID.CustomizationUtility_ACAD2018_x64.csproj
255 255
  <ItemGroup>
256 256
    <None Include="Resources\cancel_16x16.png" />
257 257
  </ItemGroup>
258
  <ItemGroup>
259
    <None Include="Resources\pencolor_16x16.png" />
260
  </ItemGroup>
258 261
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
259 262
  <Import Project="..\packages\System.Data.SQLite.Core.1.0.111.0\build\net46\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.111.0\build\net46\System.Data.SQLite.Core.targets')" />
260 263
  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
DTI_PID/APIDConverter/Form/MappingForm.Designer.cs
32 32
            DevExpress.XtraBars.Ribbon.GalleryItemGroup galleryItemGroup1 = new DevExpress.XtraBars.Ribbon.GalleryItemGroup();
33 33
            this.ribbonControl = new DevExpress.XtraBars.Ribbon.RibbonControl();
34 34
            this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
35
            this.gridControlOPC = new DevExpress.XtraGrid.GridControl();
36
            this.gridViewOPC = new DevExpress.XtraGrid.Views.Grid.GridView();
35 37
            this.gridControlLine = new DevExpress.XtraGrid.GridControl();
36 38
            this.gridViewLine = new DevExpress.XtraGrid.Views.Grid.GridView();
37 39
            this.btnRefreshSymbol = new DevExpress.XtraEditors.SimpleButton();
......
69 71
            this.layoutControlItem7 = new DevExpress.XtraLayout.LayoutControlItem();
70 72
            this.splitterItem4 = new DevExpress.XtraLayout.SplitterItem();
71 73
            this.layoutControlItem8 = new DevExpress.XtraLayout.LayoutControlItem();
72
            this.GroupSpecificSymbol = new DevExpress.XtraLayout.LayoutControlGroup();
73
            this.gridControlOPC = new DevExpress.XtraGrid.GridControl();
74
            this.gridViewOPC = new DevExpress.XtraGrid.Views.Grid.GridView();
75
            this.layoutControlItem10 = new DevExpress.XtraLayout.LayoutControlItem();
74
            this.GroupOPC = new DevExpress.XtraLayout.LayoutControlGroup();
76 75
            this.layoutControlGroup2 = new DevExpress.XtraLayout.LayoutControlGroup();
76
            this.layoutControlItem10 = new DevExpress.XtraLayout.LayoutControlItem();
77 77
            this.emptySpaceItem3 = new DevExpress.XtraLayout.EmptySpaceItem();
78 78
            ((System.ComponentModel.ISupportInitialize)(this.ribbonControl)).BeginInit();
79 79
            ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
80 80
            this.layoutControl1.SuspendLayout();
81
            ((System.ComponentModel.ISupportInitialize)(this.gridControlOPC)).BeginInit();
82
            ((System.ComponentModel.ISupportInitialize)(this.gridViewOPC)).BeginInit();
81 83
            ((System.ComponentModel.ISupportInitialize)(this.gridControlLine)).BeginInit();
82 84
            ((System.ComponentModel.ISupportInitialize)(this.gridViewLine)).BeginInit();
83 85
            ((System.ComponentModel.ISupportInitialize)(this.galleryControlAvevaSymbols)).BeginInit();
......
112 114
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).BeginInit();
113 115
            ((System.ComponentModel.ISupportInitialize)(this.splitterItem4)).BeginInit();
114 116
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem8)).BeginInit();
115
            ((System.ComponentModel.ISupportInitialize)(this.GroupSpecificSymbol)).BeginInit();
116
            ((System.ComponentModel.ISupportInitialize)(this.gridControlOPC)).BeginInit();
117
            ((System.ComponentModel.ISupportInitialize)(this.gridViewOPC)).BeginInit();
118
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem10)).BeginInit();
117
            ((System.ComponentModel.ISupportInitialize)(this.GroupOPC)).BeginInit();
119 118
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup2)).BeginInit();
119
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem10)).BeginInit();
120 120
            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem3)).BeginInit();
121 121
            this.SuspendLayout();
122 122
            // 
......
155 155
            this.layoutControl1.TabIndex = 1;
156 156
            this.layoutControl1.Text = "layoutControl1";
157 157
            // 
158
            // gridControlOPC
159
            // 
160
            this.gridControlOPC.Location = new System.Drawing.Point(36, 79);
161
            this.gridControlOPC.MainView = this.gridViewOPC;
162
            this.gridControlOPC.MenuManager = this.ribbonControl;
163
            this.gridControlOPC.Name = "gridControlOPC";
164
            this.gridControlOPC.Size = new System.Drawing.Size(709, 261);
165
            this.gridControlOPC.TabIndex = 14;
166
            this.gridControlOPC.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
167
            this.gridViewOPC});
168
            // 
169
            // gridViewOPC
170
            // 
171
            this.gridViewOPC.GridControl = this.gridControlOPC;
172
            this.gridViewOPC.Name = "gridViewOPC";
173
            this.gridViewOPC.OptionsView.ShowGroupPanel = false;
174
            // 
158 175
            // gridControlLine
159 176
            // 
160 177
            this.gridControlLine.Location = new System.Drawing.Point(36, 79);
......
308 325
            // 
309 326
            this.tabbedControlGroup.Location = new System.Drawing.Point(0, 0);
310 327
            this.tabbedControlGroup.Name = "tabbedControlGroup";
311
            this.tabbedControlGroup.SelectedTabPage = this.GroupSpecificSymbol;
328
            this.tabbedControlGroup.SelectedTabPage = this.GroupOPC;
312 329
            this.tabbedControlGroup.Size = new System.Drawing.Size(761, 670);
313 330
            this.tabbedControlGroup.TabPages.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
314 331
            this.GroupSymbol,
315
            this.GroupLine,
316
            this.GroupSpecificSymbol});
332
            this.GroupOPC,
333
            this.GroupLine});
317 334
            // 
318 335
            // GroupSymbol
319 336
            // 
......
517 534
            this.layoutControlItem8.TextSize = new System.Drawing.Size(0, 0);
518 535
            this.layoutControlItem8.TextVisible = false;
519 536
            // 
520
            // GroupSpecificSymbol
537
            // GroupOPC
521 538
            // 
522
            this.GroupSpecificSymbol.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
539
            this.GroupOPC.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
523 540
            this.layoutControlGroup2,
524 541
            this.emptySpaceItem3});
525
            this.GroupSpecificSymbol.Location = new System.Drawing.Point(0, 0);
526
            this.GroupSpecificSymbol.Name = "GroupSpecificSymbol";
527
            this.GroupSpecificSymbol.Size = new System.Drawing.Size(737, 624);
528
            this.GroupSpecificSymbol.Text = "Specific Symbol";
529
            // 
530
            // gridControlOPC
531
            // 
532
            this.gridControlOPC.Location = new System.Drawing.Point(36, 79);
533
            this.gridControlOPC.MainView = this.gridViewOPC;
534
            this.gridControlOPC.MenuManager = this.ribbonControl;
535
            this.gridControlOPC.Name = "gridControlOPC";
536
            this.gridControlOPC.Size = new System.Drawing.Size(709, 261);
537
            this.gridControlOPC.TabIndex = 14;
538
            this.gridControlOPC.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
539
            this.gridViewOPC});
542
            this.GroupOPC.Location = new System.Drawing.Point(0, 0);
543
            this.GroupOPC.Name = "GroupOPC";
544
            this.GroupOPC.Size = new System.Drawing.Size(737, 624);
545
            this.GroupOPC.Text = "OPC Symbol";
540 546
            // 
541
            // gridViewOPC
547
            // layoutControlGroup2
542 548
            // 
543
            this.gridViewOPC.GridControl = this.gridControlOPC;
544
            this.gridViewOPC.Name = "gridViewOPC";
545
            this.gridViewOPC.OptionsView.ShowGroupPanel = false;
549
            this.layoutControlGroup2.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
550
            this.layoutControlItem10});
551
            this.layoutControlGroup2.Location = new System.Drawing.Point(0, 0);
552
            this.layoutControlGroup2.Name = "layoutControlGroup2";
553
            this.layoutControlGroup2.Size = new System.Drawing.Size(737, 310);
554
            this.layoutControlGroup2.Text = "OPC Symbol";
546 555
            // 
547 556
            // layoutControlItem10
548 557
            // 
......
553 562
            this.layoutControlItem10.TextSize = new System.Drawing.Size(0, 0);
554 563
            this.layoutControlItem10.TextVisible = false;
555 564
            // 
556
            // layoutControlGroup2
557
            // 
558
            this.layoutControlGroup2.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
559
            this.layoutControlItem10});
560
            this.layoutControlGroup2.Location = new System.Drawing.Point(0, 0);
561
            this.layoutControlGroup2.Name = "layoutControlGroup2";
562
            this.layoutControlGroup2.Size = new System.Drawing.Size(737, 310);
563
            this.layoutControlGroup2.Text = "OPC Symbol";
564
            // 
565 565
            // emptySpaceItem3
566 566
            // 
567 567
            this.emptySpaceItem3.AllowHotTrack = false;
......
586 586
            ((System.ComponentModel.ISupportInitialize)(this.ribbonControl)).EndInit();
587 587
            ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit();
588 588
            this.layoutControl1.ResumeLayout(false);
589
            ((System.ComponentModel.ISupportInitialize)(this.gridControlOPC)).EndInit();
590
            ((System.ComponentModel.ISupportInitialize)(this.gridViewOPC)).EndInit();
589 591
            ((System.ComponentModel.ISupportInitialize)(this.gridControlLine)).EndInit();
590 592
            ((System.ComponentModel.ISupportInitialize)(this.gridViewLine)).EndInit();
591 593
            ((System.ComponentModel.ISupportInitialize)(this.galleryControlAvevaSymbols)).EndInit();
......
620 622
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).EndInit();
621 623
            ((System.ComponentModel.ISupportInitialize)(this.splitterItem4)).EndInit();
622 624
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem8)).EndInit();
623
            ((System.ComponentModel.ISupportInitialize)(this.GroupSpecificSymbol)).EndInit();
624
            ((System.ComponentModel.ISupportInitialize)(this.gridControlOPC)).EndInit();
625
            ((System.ComponentModel.ISupportInitialize)(this.gridViewOPC)).EndInit();
626
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem10)).EndInit();
625
            ((System.ComponentModel.ISupportInitialize)(this.GroupOPC)).EndInit();
627 626
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup2)).EndInit();
627
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem10)).EndInit();
628 628
            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem3)).EndInit();
629 629
            this.ResumeLayout(false);
630 630
            this.PerformLayout();
......
672 672
        private DevExpress.XtraGrid.Views.Grid.GridView gridViewLine;
673 673
        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem9;
674 674
        private DevExpress.XtraLayout.LayoutControlGroup layoutControlGroup1;
675
        private DevExpress.XtraLayout.LayoutControlGroup GroupSpecificSymbol;
676 675
        private DevExpress.XtraGrid.GridControl gridControlOPC;
677 676
        private DevExpress.XtraGrid.Views.Grid.GridView gridViewOPC;
677
        private DevExpress.XtraLayout.LayoutControlGroup GroupOPC;
678 678
        private DevExpress.XtraLayout.LayoutControlGroup layoutControlGroup2;
679 679
        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem10;
680 680
        private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem3;
DTI_PID/APIDConverter/Form/MappingForm.cs
85 85
            gridViewOPC.Columns["IN_SYMBOL"].Caption = "IN OPC Symbol Name";
86 86
            gridViewOPC.Columns["OUT_SYMBOL"].Caption = "OUT OPC Symbol Name";
87 87
            gridViewOPC.Columns["Type"].GroupIndex = 0;
88
            gridViewOPC.Columns["IN_SYMBOL"].OptionsColumn.AllowEdit = false;
89
            gridViewOPC.Columns["OUT_SYMBOL"].OptionsColumn.AllowEdit = false;
90 88
            gridViewOPC.Columns["Name"].OptionsColumn.AllowEdit = false;
89

  
90
            RepositoryItemButtonEdit repTextEditOPC = new RepositoryItemButtonEdit();
91
            repTextEditOPC.Buttons[0].Kind = ButtonPredefines.Glyph;
92
            repTextEditOPC.Buttons[0].Image = Resource.cancel_16x16;
93
            repTextEditOPC.ButtonClick += opcButtonEdit_ButtonClick;
94
            repTextEditOPC.TextEditStyle = TextEditStyles.DisableTextEditor;
95
            gridControlOPC.RepositoryItems.Add(repTextEditOPC);
96
            gridViewOPC.Columns["IN_SYMBOL"].ColumnEdit = repTextEditOPC;
97
            gridViewOPC.Columns["OUT_SYMBOL"].ColumnEdit = repTextEditOPC;
98

  
99

  
100

  
101

  
102

  
103
            gridViewOPC.ExpandAllGroups();
104

  
105
            void opcButtonEdit_ButtonClick(object sender, ButtonPressedEventArgs e)
106
            {
107
                string value = string.Empty;
108
                if (gridViewOPC.FocusedRowHandle >= 0)
109
                    value = gridViewOPC.GetRowCellDisplayText(gridViewOPC.FocusedRowHandle, gridViewOPC.FocusedColumn.FieldName);
110

  
111
                if (!string.IsNullOrEmpty(value) &&
112
                    MessageBox.Show("Are you sure you want to clear mapping information?", "APID Converter", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
113
                    gridViewOPC.SetRowCellValue(gridViewOPC.FocusedRowHandle, gridViewOPC.FocusedColumn.FieldName, null);
114
            }
91 115
        }
92 116
        private void SetAvevaSymbolStructure()
93 117
        {
......
392 416
        }
393 417
        private void galleryControlAvevaSymbols_Gallery_ItemDoubleClick(object sender, DevExpress.XtraBars.Ribbon.GalleryItemClickEventArgs e)
394 418
        {
419
            Project_Info info = Project_Info.GetInstance();
395 420
            if (tabbedControlGroup.SelectedTabPage.Name == "GroupSymbol" && gridViewSymbol.FocusedRowHandle >= 0)
396 421
            {
397 422
                string result = "";
398 423
                GetNodeLoopText(treeListAvevaSymbol.FocusedNode, ref result);
399 424
                gridViewSymbol.SetRowCellValue(gridViewSymbol.FocusedRowHandle, "APID_SYMBOL", result + @"\" + e.Item.Caption);
400 425

  
401
                Project_Info info = Project_Info.GetInstance();
402 426
                string fullPath = gridViewSymbol.GetRowCellDisplayText(gridViewSymbol.FocusedRowHandle, "APID_SYMBOL");
403 427
                string _ID2ImagePath = info.AVEVA_ImageDirPath + fullPath + ".png";
428

  
404 429
                if (pictureEditMapped.Image != null)
405 430
                {
406 431
                    pictureEditMapped.Image.Dispose();
407 432
                    pictureEditMapped.Image = null;
408 433
                }
409
                if (File.Exists(_ID2ImagePath))
434
                if (!string.IsNullOrEmpty(_ID2ImagePath) && File.Exists(_ID2ImagePath))
410 435
                    pictureEditMapped.Image = Image.FromFile(_ID2ImagePath);
411 436
            }
437
            else if (tabbedControlGroup.SelectedTabPage.Name == "GroupOPC" && gridViewOPC.FocusedRowHandle >= 0 &&
438
                (gridViewOPC.FocusedColumn.FieldName == "IN_SYMBOL" || gridViewOPC.FocusedColumn.FieldName == "OUT_SYMBOL"))
439
            {
440
                string result = "";
441
                GetNodeLoopText(treeListAvevaSymbol.FocusedNode, ref result);
442
                gridViewOPC.SetRowCellValue(gridViewOPC.FocusedRowHandle, gridViewOPC.FocusedColumn.FieldName, result + @"\" + e.Item.Caption);
443

  
444
                string fullPath = gridViewOPC.GetRowCellDisplayText(gridViewOPC.FocusedRowHandle, gridViewOPC.FocusedColumn.FieldName);
445
                string _ID2ImagePath = info.AVEVA_ImageDirPath + fullPath + ".png";
446
            }
447

  
448
            
412 449
        }
413 450
        public void repositoryItemButtonEdit_ButtonClick(object sender, ButtonPressedEventArgs e)
414 451
        {
DTI_PID/APIDConverter/Properties/Resource.Designer.cs
93 93
        /// <summary>
94 94
        ///   System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
95 95
        /// </summary>
96
        internal static System.Drawing.Bitmap pencolor_16x16 {
97
            get {
98
                object obj = ResourceManager.GetObject("pencolor_16x16", resourceCulture);
99
                return ((System.Drawing.Bitmap)(obj));
100
            }
101
        }
102
        
103
        /// <summary>
104
        ///   System.Drawing.Bitmap 형식의 지역화된 리소스를 찾습니다.
105
        /// </summary>
96 106
        internal static System.Drawing.Bitmap setting {
97 107
            get {
98 108
                object obj = ResourceManager.GetObject("setting", resourceCulture);
DTI_PID/APIDConverter/Properties/Resource.resx
127 127
  <data name="mapping" type="System.Resources.ResXFileRef, System.Windows.Forms">
128 128
    <value>..\Resources\mapping.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
129 129
  </data>
130
  <data name="pencolor_16x16" type="System.Resources.ResXFileRef, System.Windows.Forms">
131
    <value>..\Resources\pencolor_16x16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
132
  </data>
130 133
  <data name="setting" type="System.Resources.ResXFileRef, System.Windows.Forms">
131 134
    <value>..\Resources\setting.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
132 135
  </data>

내보내기 Unified diff

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