프로젝트

일반

사용자정보

개정판 c8b025e0

IDc8b025e051d5c66a4e8182df249983fa143553d3
상위 e302a79f
하위 c94252bf

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

dev issue #1230 : edit properties form

Change-Id: I75ede7e3e639b7dfc7e71e2d123a5f2e47cfe0e5

차이점 보기:

DTI_PID/APIDConverter/APIDConverterExplorer.cs
39 39
            {
40 40
                try
41 41
                {
42
                    AccessPropertyForm.Run();
43

  
44 42
                    foreach (var item in form.Documents)
45 43
                    {
46 44
                        AutoModeling autoModeling = new AutoModeling(item);
......
55 53
                }
56 54
                finally
57 55
                {
58
                    AccessPropertyForm.Stop();
56
                    
59 57
                }
60 58
                
61 59
            }
DTI_PID/APIDConverter/AVEVA.PID.CustomizationUtility_ACAD2018_x64.csproj
68 68
      <HintPath>C:\Program Files\Autodesk\AutoCAD 2018\Autodesk.AutoCAD.Interop.Common.dll</HintPath>
69 69
      <EmbedInteropTypes>True</EmbedInteropTypes>
70 70
    </Reference>
71
    <Reference Include="AVEVA.PID.Base, Version=12.2.1.2, Culture=neutral, processorArchitecture=AMD64">
72
      <SpecificVersion>False</SpecificVersion>
73
      <HintPath>C:\Program Files\AVEVA\P&amp;ID 12.2.SP1\Install\Exe\AVEVA.PID.Base.dll</HintPath>
74
    </Reference>
71 75
    <Reference Include="AVEVA.PID.Common, Version=12.2.1.2, Culture=neutral, processorArchitecture=MSIL">
72 76
      <SpecificVersion>False</SpecificVersion>
73 77
      <HintPath>C:\Program Files\AVEVA\P&amp;ID 12.2.SP1\Install\Exe\AVEVA.PID.Common.dll</HintPath>
......
93 97
      <HintPath>C:\Program Files\AVEVA\P&amp;ID 12.2.SP1\Install\Exe\AVEVA.PID.GUI.dll</HintPath>
94 98
      <Private>False</Private>
95 99
    </Reference>
100
    <Reference Include="AVEVA.PID.Interfaces, Version=12.2.1.2, Culture=neutral, processorArchitecture=AMD64">
101
      <SpecificVersion>False</SpecificVersion>
102
      <HintPath>C:\Program Files\AVEVA\P&amp;ID 12.2.SP1\Install\Exe\AVEVA.PID.Interfaces.dll</HintPath>
103
    </Reference>
96 104
    <Reference Include="AVEVA.PID.Utilities, Version=12.2.1.2, Culture=neutral, processorArchitecture=AMD64">
97 105
      <SpecificVersion>False</SpecificVersion>
98 106
      <HintPath>C:\Program Files\AVEVA\P&amp;ID 12.2.SP1\Install\Exe\AVEVA.PID.Utilities.dll</HintPath>
......
114 122
    <Reference Include="DevExpress.XtraGrid.v18.2, Version=18.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
115 123
    <Reference Include="DevExpress.XtraLayout.v18.2, Version=18.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
116 124
    <Reference Include="DevExpress.XtraTreeList.v18.2, Version=18.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
125
    <Reference Include="Infragistics.Shared, Version=17.1.20171.2032, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb, processorArchitecture=MSIL">
126
      <SpecificVersion>False</SpecificVersion>
127
      <HintPath>C:\Program Files\AVEVA\P&amp;ID 12.2.SP1\Install\Exe\Infragistics.Shared.dll</HintPath>
128
    </Reference>
129
    <Reference Include="Infragistics.Win.UltraWinGrid, Version=17.1.20171.2032, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb, processorArchitecture=MSIL">
130
      <SpecificVersion>False</SpecificVersion>
131
      <HintPath>C:\Program Files\AVEVA\P&amp;ID 12.2.SP1\Install\Exe\Infragistics.Win.UltraWinGrid.dll</HintPath>
132
    </Reference>
117 133
    <Reference Include="Microsoft.CSharp" />
118 134
    <Reference Include="Microsoft.VisualBasic" />
119 135
    <Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
......
152 168
    <Compile Include="AvevaInfo.cs" />
153 169
    <Compile Include="Model\PlantItem\Note.cs" />
154 170
    <Compile Include="Model\PlantItem\Text.cs" />
155
    <Compile Include="Utils\AccessPropertyForm.cs" />
171
    <Compile Include="Utils\AvevaThread.cs" />
156 172
    <Compile Include="APIDConverterExplorer.cs">
157 173
      <SubType>UserControl</SubType>
158 174
    </Compile>
......
271 287
  <ItemGroup>
272 288
    <None Include="Resources\pencolor_16x16.png" />
273 289
  </ItemGroup>
290
  <ItemGroup>
291
    <WCFMetadata Include="Connected Services\" />
292
  </ItemGroup>
274 293
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
275 294
  <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')" />
276 295
  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
DTI_PID/APIDConverter/AutoModeling.cs
8 8
using System.IO;
9 9
using System.Runtime.CompilerServices;
10 10
using Microsoft.VisualBasic.CompilerServices;
11
using System.Runtime.InteropServices;
12
using System.Threading;
11 13

  
12 14
using Autodesk.AutoCAD.ApplicationServices;
13 15
using Autodesk.AutoCAD.ApplicationServices.Core;
......
35 37
{
36 38
    public class AutoModeling
37 39
    {
40
        [DllImport("user32")]
41
        public static extern int FindWindow(string lpClassName, string lpWindowName);
42

  
38 43
        public static AutoModeling Running { get; set; }
39 44
        Model.Document document;
40 45
        AvevaInfo avevaInfo;
......
231 236
                    if (lineNumber != null)
232 237
                    {
233 238
                        GUIUtils.SetAutoLabelCheck(true);
239
                        AvevaThread.Run(ThreadType.OkBtnClick, null);
234 240
                        break;
235 241
                    }
236 242
                }
......
244 250
                handle = DrawSignal(line.Aveva.Name, points);
245 251

  
246 252
            if (lineNumber != null)
253
            {
247 254
                GUIUtils.SetAutoLabelCheck(false);
255
                AvevaThread.Stop(ThreadType.OkBtnClick);
256
            }
248 257

  
249 258
            foreach (var item in groupLine)
250 259
                item.Aveva.Handle = handle;
......
340 349
        }
341 350
        private void SetLineNumberAttribute(Model.LineNumber lineNumber)
342 351
        {
352
            Model.Line line = APIDUtils.FindObjectByUID(document, lineNumber.CONNLINE) as Model.Line;
353
            if (line != null)
354
            {
355
                foreach (Model.Attribute attribute in lineNumber.ATTRIBUTES)
356
                {
357
                    AttributeInfo info = avevaInfo.AttributeInfo.Find(x => x.UID == attribute.UID);
358
                    if (info != null)
359
                    {
360
                        if (info.APID_ATTRIBUTE_TYPE == AvevaAttributeType.PipeAttribute)
361
                        {
343 362

  
363
                        }
364
                    }
365
                }
366
            }
344 367
        }
345 368
        private void SetSymbolAttribute(Model.Symbol symbol)
346 369
        {
347
            foreach (var attribute in symbol.ATTRIBUTES)
370
            if (symbol.Aveva.Handle != 0)
348 371
            {
349
                AttributeInfo info = avevaInfo.AttributeInfo.Find(x => x.UID == attribute.UID);
350
                if (info != null)
372
                List<Tuple<string, string>> udaDatas = new List<Tuple<string, string>>();
373
                foreach (var attribute in symbol.ATTRIBUTES)
351 374
                {
352

  
375
                    AttributeInfo info = avevaInfo.AttributeInfo.Find(x => x.UID == attribute.UID);
376
                    if (info != null)
377
                    {
378
                        if (info.APID_ATTRIBUTE_TYPE == AvevaAttributeType.UDA)
379
                            udaDatas.Add(new Tuple<string, string>(info.APID_ATTRIBUTE, attribute.VALUE));
380
                    }
353 381
                }
382
                if (udaDatas.Count > 0)
383
                    SetSymbolUDAAttribute(GetObjectIdByHandle(symbol.Aveva.Handle), udaDatas);
354 384
            }
355 385
        }
356 386
        #endregion
......
636 666
            Autodesk.AutoCAD.ApplicationServices.Document acDoc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
637 667
            Database acCurDb = acDoc.Database;
638 668
            Handle handle = new Handle(lHandle);
669
            ObjectId result = ObjectId.Null;
670
            try
671
            {
672
                result = acCurDb.GetObjectId(false, handle, 0);
673
            }
674
            catch (System.Exception ex)
675
            {
639 676

  
640
            return acCurDb.GetObjectId(false, handle, 0);
677
            }
678
            return result;
679
        }
680
        private Entity GetEntityByHandle(long handle)
681
        {
682
            Entity entity = null;
683
            ObjectId objectId = GetObjectIdByHandle(handle);
684
            if (objectId != ObjectId.Null)
685
            {
686
                Autodesk.AutoCAD.ApplicationServices.Document acDoc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
687
                Database acCurDb = acDoc.Database;
688
                using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction())
689
                {
690
                    entity = (Entity)acTrans.GetObject(objectId, OpenMode.ForRead);
691
                    acTrans.Commit();
692
                }
693
            }
694

  
695
            return entity;
641 696
        }
642 697
        private void SetBlockReferenceRotation(ObjectId objectId, double rotation)
643 698
        {
......
690 745
                }
691 746
            }
692 747
        }
748

  
749
        #endregion
750

  
751
        #region For Aveva
752
        private void SetAttributeByAvevaForm(long handle, List<Tuple<string, string>> datas)
753
        {
754
            Entity entity = GetEntityByHandle(handle);
755

  
756
            ComponentPropertiesHelper componentPropertiesHelper = new ComponentPropertiesHelper();
757
            AvevaThread.Run(ThreadType.AddProperty, datas);
758
            if (!componentPropertiesHelper.DisplayComponentProperties(entity))
759
                AvevaThread.Stop(ThreadType.AddProperty);
760
        }
693 761
        #endregion
694 762

  
695 763
        #region Modeling Utils
......
904 972
        #region Test Source
905 973
        public void test()
906 974
        {
907
            //InitGUI();
908
            //DrawSignal("SONIC", new List<string>() { "2,100", "100,100" });
909

  
910
            DrawPipe("Main Pipe", new List<string>() { "2,100", "100,100" }, null);
911
            return;
912
            Symbol symbol = new Symbol();
913
            symbol.Aveva = new AvevaSymbolInfo();
914
            symbol.Aveva.Name = "INVB";
915
            symbol.Aveva.X = 50;
916
            symbol.Aveva.Y = 100;
917

  
918
            DataRow[] allRows = avevaInfo.AvevaSymbolTable.Select(string.Format("Symbol_Name = '{0}'", symbol.Aveva.Name));
919
            if (allRows.Length == 1)
920
            {
921
                DataRow symbolRow = allRows[0];
922
                bool bAngle = CheckAngle(symbolRow);
923
                bool bBalloon = CheckBalloon(symbol);
924
                bBalloon = false;
925
                long handle = InsertSymbol(symbol, symbolRow, bAngle, bBalloon);
926
            }
927

  
928
            Hashtable symbolDefinitions = GraphicsUtility.GetSymbolDefinitions(symbol.Aveva.Name);
929
            string text = symbolDefinitions[SymbolDefinition.symAflowType].ToString().ToUpper();
930
            if (int.Parse(symbolDefinitions[SymbolDefinition.symNoOfInsertPoints].ToString()).Equals(2))
931
            {
932
                bool bIsPromptRotate = true;
933
            }
934
            int num = int.Parse(symbolDefinitions[SymbolDefinition.symFixedOrUserDefined].ToString());
935 975

  
936
            AssociateSymbolType eAssosiateSym = AssociateSymbolType.None;
937
            bool bIsSymbolHasAssociation = GraphicalUtility.FindSymbolHasAssociation(text, ref eAssosiateSym);
938
            bool bPlaceSimpleBlocks = SymbolCategory.astrSimplePlacedBlocks.Contains(text);
939

  
940
            //DrawPipe("Main Pipe", new List<string>() { "2,200", "100,200" });
941

  
942
            //DrawPipe("Sub Pipe", new List<string>() { "50,100", "50,200" });
943 976
        }
944
        public static void TESTStatic(ObjectId objectId)
977
        public static void TESTStatic(long handle)
945 978
        {
946
            // Get the current document and database, and start a transaction
947
            //Autodesk.AutoCAD.ApplicationServices.Document acDoc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
948
            //Database acCurDb = acDoc.Database;
949
            //Editor acDocEd = acDoc.Editor;
950

  
951
            //using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction())
952
            //{
953
            //    Entity objDb = (Entity)acTrans.GetObject(objectId, OpenMode.ForWrite);
954
            //    Entity startNodeEntityForPipe = Pipe.GetStartNodeEntityForPipe(objDb);
955

  
956
            //    //ArrayList arrayList = new ArrayList();
957
            //    //ArrayList arrayList2 = new ArrayList();
958
            //    //PIDUtils.VBUtils.GetUserDefineAttributes(startNodeEntityForPipe.ObjectId, ref arrayList, ref arrayList2);
959
            //    //PIDUtils.VBUtils.GetUserDefineAttributes(objDb.ObjectId, ref arrayList, ref arrayList2);
960
            //    //NamedXDataBlock namedXDataBlock = XDataUtilities.GetNamedBlock(objDb, "ReferenceObject");
961

  
962
            //    XData xData = XDataUtilities.GetXData<Entity>(objDb);
963
            //    XData xData2 = XDataUtilities.GetXData<Entity>(startNodeEntityForPipe);
964
            //    acTrans.Commit();
965
            //}
966

  
967
            //PLABFO
979
            
968 980
        }
969 981
        #endregion
970 982
    }
DTI_PID/APIDConverter/AvevaInfo.cs
59 59
                AttributeInfo info = new AttributeInfo();
60 60
                info.UID = DBNull.Value.Equals(row["UID"]) ? string.Empty : row["UID"].ToString();
61 61
                info.APID_ATTRIBUTE = DBNull.Value.Equals(row["APID_ATTRIBUTE"]) ? string.Empty : row["APID_ATTRIBUTE"].ToString();
62
                info.APID_ATTRIBUTE_TYPE = DBNull.Value.Equals(row["APID_ATTRIBUTE_TYPE"]) ? string.Empty : row["APID_ATTRIBUTE_TYPE"].ToString();
63
                if (!string.IsNullOrEmpty(info.APID_ATTRIBUTE) && !string.IsNullOrEmpty(info.APID_ATTRIBUTE_TYPE))
62
                string sType = DBNull.Value.Equals(row["APID_ATTRIBUTE_TYPE"]) ? string.Empty : row["APID_ATTRIBUTE_TYPE"].ToString();
63
                if (!string.IsNullOrEmpty(info.APID_ATTRIBUTE) && !string.IsNullOrEmpty(sType))
64 64
                {
65
                    string sRemove = "|" + info.APID_ATTRIBUTE_TYPE;
65
                    string sRemove = "|" + sType;
66 66
                    info.APID_ATTRIBUTE = info.APID_ATTRIBUTE.Remove(info.APID_ATTRIBUTE.LastIndexOf(sRemove), sRemove.Length);
67
                    AvevaAttributeType type;
68
                    if (Enum.TryParse(sType, out type))
69
                        info.APID_ATTRIBUTE_TYPE = type;
67 70
                }
68 71
                avevaInfo.AttributeInfo.Add(info);
69 72
            }
......
83 86
    {
84 87
        public string UID { get; set; }
85 88
        public string APID_ATTRIBUTE { get; set; }
86
        public string APID_ATTRIBUTE_TYPE { get; set; }
89
        public AvevaAttributeType APID_ATTRIBUTE_TYPE { get; set; }
87 90
    }
88 91

  
92
    public enum AvevaAttributeType
93
    {
94
        None,
95
        UDA,
96
        PipeAttribute,
97
    }
89 98
}
DTI_PID/APIDConverter/Form/MappingForm.Designer.cs
29 29
        private void InitializeComponent()
30 30
        {
31 31
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MappingForm));
32
            DevExpress.XtraBars.Ribbon.GalleryItemGroup galleryItemGroup4 = new DevExpress.XtraBars.Ribbon.GalleryItemGroup();
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 35
            this.gridControlLineNumberAttribute = new DevExpress.XtraGrid.GridControl();
......
56 56
            this.Root = new DevExpress.XtraLayout.LayoutControlGroup();
57 57
            this.emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem();
58 58
            this.tabbedControlGroup = new DevExpress.XtraLayout.TabbedControlGroup();
59
            this.GroupLine = new DevExpress.XtraLayout.LayoutControlGroup();
60
            this.layoutControlGroup1 = new DevExpress.XtraLayout.LayoutControlGroup();
61
            this.layoutControlItem9 = new DevExpress.XtraLayout.LayoutControlItem();
62
            this.layoutControlGroup12 = new DevExpress.XtraLayout.LayoutControlGroup();
63
            this.layoutControlItem15 = new DevExpress.XtraLayout.LayoutControlItem();
64
            this.splitterItem7 = new DevExpress.XtraLayout.SplitterItem();
65 59
            this.GroupSymbol = new DevExpress.XtraLayout.LayoutControlGroup();
66 60
            this.splitterItem2 = new DevExpress.XtraLayout.SplitterItem();
67 61
            this.splitterItem3 = new DevExpress.XtraLayout.SplitterItem();
......
81 75
            this.layoutControlItem12 = new DevExpress.XtraLayout.LayoutControlItem();
82 76
            this.layoutControlGroup10 = new DevExpress.XtraLayout.LayoutControlGroup();
83 77
            this.layoutControlItem13 = new DevExpress.XtraLayout.LayoutControlItem();
78
            this.GroupLine = new DevExpress.XtraLayout.LayoutControlGroup();
79
            this.layoutControlGroup1 = new DevExpress.XtraLayout.LayoutControlGroup();
80
            this.layoutControlItem9 = new DevExpress.XtraLayout.LayoutControlItem();
81
            this.layoutControlGroup12 = new DevExpress.XtraLayout.LayoutControlGroup();
82
            this.layoutControlItem15 = new DevExpress.XtraLayout.LayoutControlItem();
83
            this.splitterItem7 = new DevExpress.XtraLayout.SplitterItem();
84 84
            this.GroupAttribute = new DevExpress.XtraLayout.LayoutControlGroup();
85 85
            this.layoutControlGroup11 = new DevExpress.XtraLayout.LayoutControlGroup();
86 86
            this.layoutControlItem14 = new DevExpress.XtraLayout.LayoutControlItem();
......
120 120
            ((System.ComponentModel.ISupportInitialize)(this.Root)).BeginInit();
121 121
            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).BeginInit();
122 122
            ((System.ComponentModel.ISupportInitialize)(this.tabbedControlGroup)).BeginInit();
123
            ((System.ComponentModel.ISupportInitialize)(this.GroupLine)).BeginInit();
124
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).BeginInit();
125
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem9)).BeginInit();
126
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup12)).BeginInit();
127
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem15)).BeginInit();
128
            ((System.ComponentModel.ISupportInitialize)(this.splitterItem7)).BeginInit();
129 123
            ((System.ComponentModel.ISupportInitialize)(this.GroupSymbol)).BeginInit();
130 124
            ((System.ComponentModel.ISupportInitialize)(this.splitterItem2)).BeginInit();
131 125
            ((System.ComponentModel.ISupportInitialize)(this.splitterItem3)).BeginInit();
......
145 139
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem12)).BeginInit();
146 140
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup10)).BeginInit();
147 141
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem13)).BeginInit();
142
            ((System.ComponentModel.ISupportInitialize)(this.GroupLine)).BeginInit();
143
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).BeginInit();
144
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem9)).BeginInit();
145
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup12)).BeginInit();
146
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem15)).BeginInit();
147
            ((System.ComponentModel.ISupportInitialize)(this.splitterItem7)).BeginInit();
148 148
            ((System.ComponentModel.ISupportInitialize)(this.GroupAttribute)).BeginInit();
149 149
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup11)).BeginInit();
150 150
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem14)).BeginInit();
......
174 174
            this.ribbonControl.ShowDisplayOptionsMenuButton = DevExpress.Utils.DefaultBoolean.False;
175 175
            this.ribbonControl.ShowPageHeadersMode = DevExpress.XtraBars.Ribbon.ShowPageHeadersMode.ShowOnMultiplePages;
176 176
            this.ribbonControl.ShowToolbarCustomizeItem = false;
177
            this.ribbonControl.Size = new System.Drawing.Size(1131, 32);
177
            this.ribbonControl.Size = new System.Drawing.Size(1139, 32);
178 178
            this.ribbonControl.Toolbar.ShowCustomizeItem = false;
179 179
            // 
180 180
            // layoutControl1
......
198 198
            this.layoutControl1.Location = new System.Drawing.Point(0, 32);
199 199
            this.layoutControl1.Name = "layoutControl1";
200 200
            this.layoutControl1.Root = this.Root;
201
            this.layoutControl1.Size = new System.Drawing.Size(1131, 734);
201
            this.layoutControl1.Size = new System.Drawing.Size(1139, 738);
202 202
            this.layoutControl1.TabIndex = 1;
203 203
            this.layoutControl1.Text = "layoutControl1";
204 204
            // 
205 205
            // gridControlLineNumberAttribute
206 206
            // 
207
            this.gridControlLineNumberAttribute.Location = new System.Drawing.Point(36, 401);
207
            this.gridControlLineNumberAttribute.Location = new System.Drawing.Point(36, 403);
208 208
            this.gridControlLineNumberAttribute.MainView = this.gridViewLineNumberAttribute;
209 209
            this.gridControlLineNumberAttribute.MenuManager = this.ribbonControl;
210 210
            this.gridControlLineNumberAttribute.Name = "gridControlLineNumberAttribute";
211
            this.gridControlLineNumberAttribute.Size = new System.Drawing.Size(730, 257);
211
            this.gridControlLineNumberAttribute.Size = new System.Drawing.Size(736, 259);
212 212
            this.gridControlLineNumberAttribute.TabIndex = 19;
213 213
            this.gridControlLineNumberAttribute.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
214 214
            this.gridViewLineNumberAttribute});
......
225 225
            this.gridControlAttribute.MainView = this.gridViewAttribute;
226 226
            this.gridControlAttribute.MenuManager = this.ribbonControl;
227 227
            this.gridControlAttribute.Name = "gridControlAttribute";
228
            this.gridControlAttribute.Size = new System.Drawing.Size(730, 579);
228
            this.gridControlAttribute.Size = new System.Drawing.Size(736, 583);
229 229
            this.gridControlAttribute.TabIndex = 18;
230 230
            this.gridControlAttribute.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
231 231
            this.gridViewAttribute});
......
238 238
            // 
239 239
            // pictureEditMappedOPCOut
240 240
            // 
241
            this.pictureEditMappedOPCOut.Location = new System.Drawing.Point(541, 401);
241
            this.pictureEditMappedOPCOut.Location = new System.Drawing.Point(545, 403);
242 242
            this.pictureEditMappedOPCOut.MenuManager = this.ribbonControl;
243 243
            this.pictureEditMappedOPCOut.Name = "pictureEditMappedOPCOut";
244 244
            this.pictureEditMappedOPCOut.Properties.ShowCameraMenuItem = DevExpress.XtraEditors.Controls.CameraMenuItemVisibility.Auto;
245
            this.pictureEditMappedOPCOut.Size = new System.Drawing.Size(225, 257);
245
            this.pictureEditMappedOPCOut.Size = new System.Drawing.Size(227, 259);
246 246
            this.pictureEditMappedOPCOut.StyleController = this.layoutControl1;
247 247
            this.pictureEditMappedOPCOut.TabIndex = 17;
248 248
            // 
249 249
            // pictureEditMappedOPCIn
250 250
            // 
251
            this.pictureEditMappedOPCIn.Location = new System.Drawing.Point(289, 401);
251
            this.pictureEditMappedOPCIn.Location = new System.Drawing.Point(291, 403);
252 252
            this.pictureEditMappedOPCIn.MenuManager = this.ribbonControl;
253 253
            this.pictureEditMappedOPCIn.Name = "pictureEditMappedOPCIn";
254 254
            this.pictureEditMappedOPCIn.Properties.ShowCameraMenuItem = DevExpress.XtraEditors.Controls.CameraMenuItemVisibility.Auto;
255
            this.pictureEditMappedOPCIn.Size = new System.Drawing.Size(224, 257);
255
            this.pictureEditMappedOPCIn.Size = new System.Drawing.Size(226, 259);
256 256
            this.pictureEditMappedOPCIn.StyleController = this.layoutControl1;
257 257
            this.pictureEditMappedOPCIn.TabIndex = 16;
258 258
            // 
259 259
            // pictureEditID2OPC
260 260
            // 
261
            this.pictureEditID2OPC.Location = new System.Drawing.Point(36, 401);
261
            this.pictureEditID2OPC.Location = new System.Drawing.Point(36, 403);
262 262
            this.pictureEditID2OPC.MenuManager = this.ribbonControl;
263 263
            this.pictureEditID2OPC.Name = "pictureEditID2OPC";
264 264
            this.pictureEditID2OPC.Properties.ShowCameraMenuItem = DevExpress.XtraEditors.Controls.CameraMenuItemVisibility.Auto;
265
            this.pictureEditID2OPC.Size = new System.Drawing.Size(225, 257);
265
            this.pictureEditID2OPC.Size = new System.Drawing.Size(227, 259);
266 266
            this.pictureEditID2OPC.StyleController = this.layoutControl1;
267 267
            this.pictureEditID2OPC.TabIndex = 15;
268 268
            // 
......
272 272
            this.gridControlOPC.MainView = this.gridViewOPC;
273 273
            this.gridControlOPC.MenuManager = this.ribbonControl;
274 274
            this.gridControlOPC.Name = "gridControlOPC";
275
            this.gridControlOPC.Size = new System.Drawing.Size(730, 263);
275
            this.gridControlOPC.Size = new System.Drawing.Size(736, 265);
276 276
            this.gridControlOPC.TabIndex = 14;
277 277
            this.gridControlOPC.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
278 278
            this.gridViewOPC});
......
289 289
            this.gridControlLine.MainView = this.gridViewLine;
290 290
            this.gridControlLine.MenuManager = this.ribbonControl;
291 291
            this.gridControlLine.Name = "gridControlLine";
292
            this.gridControlLine.Size = new System.Drawing.Size(730, 263);
292
            this.gridControlLine.Size = new System.Drawing.Size(736, 265);
293 293
            this.gridControlLine.TabIndex = 13;
294 294
            this.gridControlLine.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
295 295
            this.gridViewLine});
......
303 303
            // btnRefreshSymbol
304 304
            // 
305 305
            this.btnRefreshSymbol.ImageOptions.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("btnRefreshSymbol.ImageOptions.SvgImage")));
306
            this.btnRefreshSymbol.Location = new System.Drawing.Point(804, 646);
306
            this.btnRefreshSymbol.Location = new System.Drawing.Point(810, 650);
307 307
            this.btnRefreshSymbol.Name = "btnRefreshSymbol";
308
            this.btnRefreshSymbol.Size = new System.Drawing.Size(315, 36);
308
            this.btnRefreshSymbol.Size = new System.Drawing.Size(317, 36);
309 309
            this.btnRefreshSymbol.StyleController = this.layoutControl1;
310 310
            this.btnRefreshSymbol.TabIndex = 12;
311 311
            this.btnRefreshSymbol.Text = "Refresh AVEVA Symbol Image";
......
317 317
            // 
318 318
            // 
319 319
            // 
320
            galleryItemGroup4.Caption = "Items";
320
            galleryItemGroup1.Caption = "Items";
321 321
            this.galleryControlAvevaSymbols.Gallery.Groups.AddRange(new DevExpress.XtraBars.Ribbon.GalleryItemGroup[] {
322
            galleryItemGroup4});
322
            galleryItemGroup1});
323 323
            this.galleryControlAvevaSymbols.Gallery.ItemDoubleClick += new DevExpress.XtraBars.Ribbon.GalleryItemClickEventHandler(this.galleryControlAvevaSymbols_Gallery_ItemDoubleClick);
324
            this.galleryControlAvevaSymbols.Location = new System.Drawing.Point(816, 279);
324
            this.galleryControlAvevaSymbols.Location = new System.Drawing.Point(822, 281);
325 325
            this.galleryControlAvevaSymbols.Name = "galleryControlAvevaSymbols";
326
            this.galleryControlAvevaSymbols.Size = new System.Drawing.Size(291, 351);
326
            this.galleryControlAvevaSymbols.Size = new System.Drawing.Size(293, 353);
327 327
            this.galleryControlAvevaSymbols.StyleController = this.layoutControl1;
328 328
            this.galleryControlAvevaSymbols.TabIndex = 11;
329 329
            this.galleryControlAvevaSymbols.Text = "galleryControl1";
......
332 332
            // 
333 333
            this.galleryControlClient1.GalleryControl = this.galleryControlAvevaSymbols;
334 334
            this.galleryControlClient1.Location = new System.Drawing.Point(2, 2);
335
            this.galleryControlClient1.Size = new System.Drawing.Size(270, 347);
335
            this.galleryControlClient1.Size = new System.Drawing.Size(272, 349);
336 336
            // 
337 337
            // pictureEditMapped
338 338
            // 
339
            this.pictureEditMapped.Location = new System.Drawing.Point(423, 401);
339
            this.pictureEditMapped.Location = new System.Drawing.Point(426, 403);
340 340
            this.pictureEditMapped.MenuManager = this.ribbonControl;
341 341
            this.pictureEditMapped.Name = "pictureEditMapped";
342 342
            this.pictureEditMapped.Properties.ShowCameraMenuItem = DevExpress.XtraEditors.Controls.CameraMenuItemVisibility.Auto;
343
            this.pictureEditMapped.Size = new System.Drawing.Size(343, 257);
343
            this.pictureEditMapped.Size = new System.Drawing.Size(346, 259);
344 344
            this.pictureEditMapped.StyleController = this.layoutControl1;
345 345
            this.pictureEditMapped.TabIndex = 10;
346 346
            // 
347 347
            // pictureEditID2Symbol
348 348
            // 
349
            this.pictureEditID2Symbol.Location = new System.Drawing.Point(36, 401);
349
            this.pictureEditID2Symbol.Location = new System.Drawing.Point(36, 403);
350 350
            this.pictureEditID2Symbol.MenuManager = this.ribbonControl;
351 351
            this.pictureEditID2Symbol.Name = "pictureEditID2Symbol";
352 352
            this.pictureEditID2Symbol.Properties.ShowCameraMenuItem = DevExpress.XtraEditors.Controls.CameraMenuItemVisibility.Auto;
353
            this.pictureEditID2Symbol.Size = new System.Drawing.Size(349, 257);
353
            this.pictureEditID2Symbol.Size = new System.Drawing.Size(352, 259);
354 354
            this.pictureEditID2Symbol.StyleController = this.layoutControl1;
355 355
            this.pictureEditID2Symbol.TabIndex = 9;
356 356
            // 
357 357
            // treeListAvevaSymbol
358 358
            // 
359 359
            this.treeListAvevaSymbol.Cursor = System.Windows.Forms.Cursors.Default;
360
            this.treeListAvevaSymbol.Location = new System.Drawing.Point(816, 45);
360
            this.treeListAvevaSymbol.Location = new System.Drawing.Point(822, 45);
361 361
            this.treeListAvevaSymbol.Name = "treeListAvevaSymbol";
362
            this.treeListAvevaSymbol.Size = new System.Drawing.Size(291, 175);
362
            this.treeListAvevaSymbol.Size = new System.Drawing.Size(293, 177);
363 363
            this.treeListAvevaSymbol.TabIndex = 8;
364 364
            // 
365 365
            // gridControlSymbol
......
368 368
            this.gridControlSymbol.MainView = this.gridViewSymbol;
369 369
            this.gridControlSymbol.MenuManager = this.ribbonControl;
370 370
            this.gridControlSymbol.Name = "gridControlSymbol";
371
            this.gridControlSymbol.Size = new System.Drawing.Size(730, 263);
371
            this.gridControlSymbol.Size = new System.Drawing.Size(736, 265);
372 372
            this.gridControlSymbol.TabIndex = 7;
373 373
            this.gridControlSymbol.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
374 374
            this.gridViewSymbol});
......
384 384
            // btnClose
385 385
            // 
386 386
            this.btnClose.ImageOptions.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("btnClose.ImageOptions.SvgImage")));
387
            this.btnClose.Location = new System.Drawing.Point(1033, 686);
387
            this.btnClose.Location = new System.Drawing.Point(1041, 690);
388 388
            this.btnClose.Name = "btnClose";
389 389
            this.btnClose.Size = new System.Drawing.Size(86, 36);
390 390
            this.btnClose.StyleController = this.layoutControl1;
......
395 395
            // btnSave
396 396
            // 
397 397
            this.btnSave.ImageOptions.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("btnSave.ImageOptions.SvgImage")));
398
            this.btnSave.Location = new System.Drawing.Point(935, 686);
398
            this.btnSave.Location = new System.Drawing.Point(943, 690);
399 399
            this.btnSave.Name = "btnSave";
400 400
            this.btnSave.Size = new System.Drawing.Size(84, 36);
401 401
            this.btnSave.StyleController = this.layoutControl1;
......
419 419
            this.splitterItem4,
420 420
            this.layoutControlItem8});
421 421
            this.Root.Name = "Root";
422
            this.Root.Size = new System.Drawing.Size(1131, 734);
422
            this.Root.Size = new System.Drawing.Size(1139, 738);
423 423
            this.Root.TextVisible = false;
424 424
            // 
425 425
            // emptySpaceItem1
426 426
            // 
427 427
            this.emptySpaceItem1.AllowHotTrack = false;
428
            this.emptySpaceItem1.Location = new System.Drawing.Point(0, 674);
428
            this.emptySpaceItem1.Location = new System.Drawing.Point(0, 678);
429 429
            this.emptySpaceItem1.MinSize = new System.Drawing.Size(104, 24);
430 430
            this.emptySpaceItem1.Name = "emptySpaceItem1";
431
            this.emptySpaceItem1.Size = new System.Drawing.Size(923, 40);
431
            this.emptySpaceItem1.Size = new System.Drawing.Size(931, 40);
432 432
            this.emptySpaceItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
433 433
            this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
434 434
            // 
......
437 437
            this.tabbedControlGroup.Location = new System.Drawing.Point(0, 0);
438 438
            this.tabbedControlGroup.Name = "tabbedControlGroup";
439 439
            this.tabbedControlGroup.SelectedTabPage = this.GroupSymbol;
440
            this.tabbedControlGroup.Size = new System.Drawing.Size(782, 674);
440
            this.tabbedControlGroup.Size = new System.Drawing.Size(788, 678);
441 441
            this.tabbedControlGroup.TabPages.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
442 442
            this.GroupSymbol,
443 443
            this.GroupOPC,
444 444
            this.GroupLine,
445 445
            this.GroupAttribute});
446 446
            // 
447
            // GroupLine
448
            // 
449
            this.GroupLine.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
450
            this.layoutControlGroup1,
451
            this.layoutControlGroup12,
452
            this.splitterItem7});
453
            this.GroupLine.Location = new System.Drawing.Point(0, 0);
454
            this.GroupLine.Name = "GroupLine";
455
            this.GroupLine.Size = new System.Drawing.Size(758, 628);
456
            this.GroupLine.Text = "Line";
457
            // 
458
            // layoutControlGroup1
459
            // 
460
            this.layoutControlGroup1.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
461
            this.layoutControlItem9});
462
            this.layoutControlGroup1.Location = new System.Drawing.Point(0, 0);
463
            this.layoutControlGroup1.Name = "layoutControlGroup1";
464
            this.layoutControlGroup1.Size = new System.Drawing.Size(758, 312);
465
            this.layoutControlGroup1.Text = "ID2 Line List";
466
            // 
467
            // layoutControlItem9
468
            // 
469
            this.layoutControlItem9.Control = this.gridControlLine;
470
            this.layoutControlItem9.Location = new System.Drawing.Point(0, 0);
471
            this.layoutControlItem9.Name = "layoutControlItem9";
472
            this.layoutControlItem9.Size = new System.Drawing.Size(734, 267);
473
            this.layoutControlItem9.TextSize = new System.Drawing.Size(0, 0);
474
            this.layoutControlItem9.TextVisible = false;
475
            // 
476
            // layoutControlGroup12
477
            // 
478
            this.layoutControlGroup12.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
479
            this.layoutControlItem15});
480
            this.layoutControlGroup12.Location = new System.Drawing.Point(0, 322);
481
            this.layoutControlGroup12.Name = "layoutControlGroup12";
482
            this.layoutControlGroup12.Size = new System.Drawing.Size(758, 306);
483
            this.layoutControlGroup12.Text = "Line Number Attribute";
484
            // 
485
            // layoutControlItem15
486
            // 
487
            this.layoutControlItem15.Control = this.gridControlLineNumberAttribute;
488
            this.layoutControlItem15.Location = new System.Drawing.Point(0, 0);
489
            this.layoutControlItem15.Name = "layoutControlItem15";
490
            this.layoutControlItem15.Size = new System.Drawing.Size(734, 261);
491
            this.layoutControlItem15.TextSize = new System.Drawing.Size(0, 0);
492
            this.layoutControlItem15.TextVisible = false;
493
            // 
494
            // splitterItem7
495
            // 
496
            this.splitterItem7.AllowHotTrack = true;
497
            this.splitterItem7.Location = new System.Drawing.Point(0, 312);
498
            this.splitterItem7.Name = "splitterItem7";
499
            this.splitterItem7.Size = new System.Drawing.Size(758, 10);
500
            // 
501 447
            // GroupSymbol
502 448
            // 
503 449
            this.GroupSymbol.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
......
508 454
            this.layoutControlGroup7});
509 455
            this.GroupSymbol.Location = new System.Drawing.Point(0, 0);
510 456
            this.GroupSymbol.Name = "GroupSymbol";
511
            this.GroupSymbol.Size = new System.Drawing.Size(758, 628);
457
            this.GroupSymbol.Size = new System.Drawing.Size(764, 632);
512 458
            this.GroupSymbol.Text = "Symbol";
513 459
            // 
514 460
            // splitterItem2
515 461
            // 
516 462
            this.splitterItem2.AllowHotTrack = true;
517
            this.splitterItem2.Location = new System.Drawing.Point(0, 312);
463
            this.splitterItem2.Location = new System.Drawing.Point(0, 314);
518 464
            this.splitterItem2.Name = "splitterItem2";
519
            this.splitterItem2.Size = new System.Drawing.Size(758, 10);
465
            this.splitterItem2.Size = new System.Drawing.Size(764, 10);
520 466
            // 
521 467
            // splitterItem3
522 468
            // 
523 469
            this.splitterItem3.AllowHotTrack = true;
524
            this.splitterItem3.Location = new System.Drawing.Point(377, 322);
470
            this.splitterItem3.Location = new System.Drawing.Point(380, 324);
525 471
            this.splitterItem3.Name = "splitterItem3";
526
            this.splitterItem3.Size = new System.Drawing.Size(10, 306);
472
            this.splitterItem3.Size = new System.Drawing.Size(10, 308);
527 473
            // 
528 474
            // layoutControlGroup4
529 475
            // 
530 476
            this.layoutControlGroup4.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
531 477
            this.layoutControlItem5});
532
            this.layoutControlGroup4.Location = new System.Drawing.Point(0, 322);
478
            this.layoutControlGroup4.Location = new System.Drawing.Point(0, 324);
533 479
            this.layoutControlGroup4.Name = "layoutControlGroup4";
534
            this.layoutControlGroup4.Size = new System.Drawing.Size(377, 306);
480
            this.layoutControlGroup4.Size = new System.Drawing.Size(380, 308);
535 481
            this.layoutControlGroup4.Text = "ID2 Image";
536 482
            // 
537 483
            // layoutControlItem5
......
539 485
            this.layoutControlItem5.Control = this.pictureEditID2Symbol;
540 486
            this.layoutControlItem5.Location = new System.Drawing.Point(0, 0);
541 487
            this.layoutControlItem5.Name = "layoutControlItem5";
542
            this.layoutControlItem5.Size = new System.Drawing.Size(353, 261);
488
            this.layoutControlItem5.Size = new System.Drawing.Size(356, 263);
543 489
            this.layoutControlItem5.TextSize = new System.Drawing.Size(0, 0);
544 490
            this.layoutControlItem5.TextVisible = false;
545 491
            // 
......
547 493
            // 
548 494
            this.layoutControlGroup5.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
549 495
            this.layoutControlItem6});
550
            this.layoutControlGroup5.Location = new System.Drawing.Point(387, 322);
496
            this.layoutControlGroup5.Location = new System.Drawing.Point(390, 324);
551 497
            this.layoutControlGroup5.Name = "layoutControlGroup5";
552
            this.layoutControlGroup5.Size = new System.Drawing.Size(371, 306);
498
            this.layoutControlGroup5.Size = new System.Drawing.Size(374, 308);
553 499
            this.layoutControlGroup5.Text = "Mapped Image";
554 500
            // 
555 501
            // layoutControlItem6
......
557 503
            this.layoutControlItem6.Control = this.pictureEditMapped;
558 504
            this.layoutControlItem6.Location = new System.Drawing.Point(0, 0);
559 505
            this.layoutControlItem6.Name = "layoutControlItem6";
560
            this.layoutControlItem6.Size = new System.Drawing.Size(347, 261);
506
            this.layoutControlItem6.Size = new System.Drawing.Size(350, 263);
561 507
            this.layoutControlItem6.TextSize = new System.Drawing.Size(0, 0);
562 508
            this.layoutControlItem6.TextVisible = false;
563 509
            // 
......
567 513
            this.layoutControlItem4});
568 514
            this.layoutControlGroup7.Location = new System.Drawing.Point(0, 0);
569 515
            this.layoutControlGroup7.Name = "layoutControlGroup7";
570
            this.layoutControlGroup7.Size = new System.Drawing.Size(758, 312);
516
            this.layoutControlGroup7.Size = new System.Drawing.Size(764, 314);
571 517
            this.layoutControlGroup7.Text = "ID2 Symbol List";
572 518
            // 
573 519
            // layoutControlItem4
......
575 521
            this.layoutControlItem4.Control = this.gridControlSymbol;
576 522
            this.layoutControlItem4.Location = new System.Drawing.Point(0, 0);
577 523
            this.layoutControlItem4.Name = "layoutControlItem4";
578
            this.layoutControlItem4.Size = new System.Drawing.Size(734, 267);
524
            this.layoutControlItem4.Size = new System.Drawing.Size(740, 269);
579 525
            this.layoutControlItem4.TextSize = new System.Drawing.Size(0, 0);
580 526
            this.layoutControlItem4.TextVisible = false;
581 527
            // 
......
589 535
            this.layoutControlGroup10});
590 536
            this.GroupOPC.Location = new System.Drawing.Point(0, 0);
591 537
            this.GroupOPC.Name = "GroupOPC";
592
            this.GroupOPC.Size = new System.Drawing.Size(758, 628);
538
            this.GroupOPC.Size = new System.Drawing.Size(764, 632);
593 539
            this.GroupOPC.Text = "OPC Symbol";
594 540
            // 
595 541
            // layoutControlGroup2
......
598 544
            this.layoutControlItem10});
599 545
            this.layoutControlGroup2.Location = new System.Drawing.Point(0, 0);
600 546
            this.layoutControlGroup2.Name = "layoutControlGroup2";
601
            this.layoutControlGroup2.Size = new System.Drawing.Size(758, 312);
547
            this.layoutControlGroup2.Size = new System.Drawing.Size(764, 314);
602 548
            this.layoutControlGroup2.Text = "OPC Symbol";
603 549
            // 
604 550
            // layoutControlItem10
......
606 552
            this.layoutControlItem10.Control = this.gridControlOPC;
607 553
            this.layoutControlItem10.Location = new System.Drawing.Point(0, 0);
608 554
            this.layoutControlItem10.Name = "layoutControlItem10";
609
            this.layoutControlItem10.Size = new System.Drawing.Size(734, 267);
555
            this.layoutControlItem10.Size = new System.Drawing.Size(740, 269);
610 556
            this.layoutControlItem10.TextSize = new System.Drawing.Size(0, 0);
611 557
            this.layoutControlItem10.TextVisible = false;
612 558
            // 
613 559
            // splitterItem5
614 560
            // 
615 561
            this.splitterItem5.AllowHotTrack = true;
616
            this.splitterItem5.Location = new System.Drawing.Point(0, 312);
562
            this.splitterItem5.Location = new System.Drawing.Point(0, 314);
617 563
            this.splitterItem5.Name = "splitterItem5";
618
            this.splitterItem5.Size = new System.Drawing.Size(758, 10);
564
            this.splitterItem5.Size = new System.Drawing.Size(764, 10);
619 565
            // 
620 566
            // layoutControlGroup8
621 567
            // 
622 568
            this.layoutControlGroup8.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
623 569
            this.layoutControlItem11});
624
            this.layoutControlGroup8.Location = new System.Drawing.Point(0, 322);
570
            this.layoutControlGroup8.Location = new System.Drawing.Point(0, 324);
625 571
            this.layoutControlGroup8.Name = "layoutControlGroup8";
626
            this.layoutControlGroup8.Size = new System.Drawing.Size(253, 306);
572
            this.layoutControlGroup8.Size = new System.Drawing.Size(255, 308);
627 573
            this.layoutControlGroup8.Text = "ID2 Image";
628 574
            // 
629 575
            // layoutControlItem11
......
631 577
            this.layoutControlItem11.Control = this.pictureEditID2OPC;
632 578
            this.layoutControlItem11.Location = new System.Drawing.Point(0, 0);
633 579
            this.layoutControlItem11.Name = "layoutControlItem11";
634
            this.layoutControlItem11.Size = new System.Drawing.Size(229, 261);
580
            this.layoutControlItem11.Size = new System.Drawing.Size(231, 263);
635 581
            this.layoutControlItem11.TextSize = new System.Drawing.Size(0, 0);
636 582
            this.layoutControlItem11.TextVisible = false;
637 583
            // 
......
639 585
            // 
640 586
            this.layoutControlGroup9.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
641 587
            this.layoutControlItem12});
642
            this.layoutControlGroup9.Location = new System.Drawing.Point(253, 322);
588
            this.layoutControlGroup9.Location = new System.Drawing.Point(255, 324);
643 589
            this.layoutControlGroup9.Name = "layoutControlGroup9";
644
            this.layoutControlGroup9.Size = new System.Drawing.Size(252, 306);
590
            this.layoutControlGroup9.Size = new System.Drawing.Size(254, 308);
645 591
            this.layoutControlGroup9.Text = "Mapped In-OPC Image";
646 592
            // 
647 593
            // layoutControlItem12
......
649 595
            this.layoutControlItem12.Control = this.pictureEditMappedOPCIn;
650 596
            this.layoutControlItem12.Location = new System.Drawing.Point(0, 0);
651 597
            this.layoutControlItem12.Name = "layoutControlItem12";
652
            this.layoutControlItem12.Size = new System.Drawing.Size(228, 261);
598
            this.layoutControlItem12.Size = new System.Drawing.Size(230, 263);
653 599
            this.layoutControlItem12.TextSize = new System.Drawing.Size(0, 0);
654 600
            this.layoutControlItem12.TextVisible = false;
655 601
            // 
......
657 603
            // 
658 604
            this.layoutControlGroup10.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
659 605
            this.layoutControlItem13});
660
            this.layoutControlGroup10.Location = new System.Drawing.Point(505, 322);
606
            this.layoutControlGroup10.Location = new System.Drawing.Point(509, 324);
661 607
            this.layoutControlGroup10.Name = "layoutControlGroup10";
662
            this.layoutControlGroup10.Size = new System.Drawing.Size(253, 306);
608
            this.layoutControlGroup10.Size = new System.Drawing.Size(255, 308);
663 609
            this.layoutControlGroup10.Text = "Mapped Out-OPC Image";
664 610
            // 
665 611
            // layoutControlItem13
......
667 613
            this.layoutControlItem13.Control = this.pictureEditMappedOPCOut;
668 614
            this.layoutControlItem13.Location = new System.Drawing.Point(0, 0);
669 615
            this.layoutControlItem13.Name = "layoutControlItem13";
670
            this.layoutControlItem13.Size = new System.Drawing.Size(229, 261);
616
            this.layoutControlItem13.Size = new System.Drawing.Size(231, 263);
671 617
            this.layoutControlItem13.TextSize = new System.Drawing.Size(0, 0);
672 618
            this.layoutControlItem13.TextVisible = false;
673 619
            // 
620
            // GroupLine
621
            // 
622
            this.GroupLine.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
623
            this.layoutControlGroup1,
624
            this.layoutControlGroup12,
625
            this.splitterItem7});
626
            this.GroupLine.Location = new System.Drawing.Point(0, 0);
627
            this.GroupLine.Name = "GroupLine";
628
            this.GroupLine.Size = new System.Drawing.Size(764, 632);
629
            this.GroupLine.Text = "Line";
630
            // 
631
            // layoutControlGroup1
632
            // 
633
            this.layoutControlGroup1.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
634
            this.layoutControlItem9});
635
            this.layoutControlGroup1.Location = new System.Drawing.Point(0, 0);
636
            this.layoutControlGroup1.Name = "layoutControlGroup1";
637
            this.layoutControlGroup1.Size = new System.Drawing.Size(764, 314);
638
            this.layoutControlGroup1.Text = "ID2 Line List";
639
            // 
640
            // layoutControlItem9
641
            // 
642
            this.layoutControlItem9.Control = this.gridControlLine;
643
            this.layoutControlItem9.Location = new System.Drawing.Point(0, 0);
644
            this.layoutControlItem9.Name = "layoutControlItem9";
645
            this.layoutControlItem9.Size = new System.Drawing.Size(740, 269);
646
            this.layoutControlItem9.TextSize = new System.Drawing.Size(0, 0);
647
            this.layoutControlItem9.TextVisible = false;
648
            // 
649
            // layoutControlGroup12
650
            // 
651
            this.layoutControlGroup12.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
652
            this.layoutControlItem15});
653
            this.layoutControlGroup12.Location = new System.Drawing.Point(0, 324);
654
            this.layoutControlGroup12.Name = "layoutControlGroup12";
655
            this.layoutControlGroup12.Size = new System.Drawing.Size(764, 308);
656
            this.layoutControlGroup12.Text = "Line Number Attribute";
657
            // 
658
            // layoutControlItem15
659
            // 
660
            this.layoutControlItem15.Control = this.gridControlLineNumberAttribute;
661
            this.layoutControlItem15.Location = new System.Drawing.Point(0, 0);
662
            this.layoutControlItem15.Name = "layoutControlItem15";
663
            this.layoutControlItem15.Size = new System.Drawing.Size(740, 263);
664
            this.layoutControlItem15.TextSize = new System.Drawing.Size(0, 0);
665
            this.layoutControlItem15.TextVisible = false;
666
            // 
667
            // splitterItem7
668
            // 
669
            this.splitterItem7.AllowHotTrack = true;
670
            this.splitterItem7.Location = new System.Drawing.Point(0, 314);
671
            this.splitterItem7.Name = "splitterItem7";
672
            this.splitterItem7.Size = new System.Drawing.Size(764, 10);
673
            // 
674 674
            // GroupAttribute
675 675
            // 
676 676
            this.GroupAttribute.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
677 677
            this.layoutControlGroup11});
678 678
            this.GroupAttribute.Location = new System.Drawing.Point(0, 0);
679 679
            this.GroupAttribute.Name = "GroupAttribute";
680
            this.GroupAttribute.Size = new System.Drawing.Size(758, 628);
680
            this.GroupAttribute.Size = new System.Drawing.Size(764, 632);
681 681
            this.GroupAttribute.Text = "Attribute";
682 682
            // 
683 683
            // layoutControlGroup11
......
686 686
            this.layoutControlItem14});
687 687
            this.layoutControlGroup11.Location = new System.Drawing.Point(0, 0);
688 688
            this.layoutControlGroup11.Name = "layoutControlGroup11";
689
            this.layoutControlGroup11.Size = new System.Drawing.Size(758, 628);
689
            this.layoutControlGroup11.Size = new System.Drawing.Size(764, 632);
690 690
            this.layoutControlGroup11.Text = "ID2 Attribute List";
691 691
            // 
692 692
            // layoutControlItem14
......
694 694
            this.layoutControlItem14.Control = this.gridControlAttribute;
695 695
            this.layoutControlItem14.Location = new System.Drawing.Point(0, 0);
696 696
            this.layoutControlItem14.Name = "layoutControlItem14";
697
            this.layoutControlItem14.Size = new System.Drawing.Size(734, 583);
697
            this.layoutControlItem14.Size = new System.Drawing.Size(740, 587);
698 698
            this.layoutControlItem14.TextSize = new System.Drawing.Size(0, 0);
699 699
            this.layoutControlItem14.TextVisible = false;
700 700
            // 
701 701
            // layoutControlItem2
702 702
            // 
703 703
            this.layoutControlItem2.Control = this.btnSave;
704
            this.layoutControlItem2.Location = new System.Drawing.Point(923, 674);
704
            this.layoutControlItem2.Location = new System.Drawing.Point(931, 678);
705 705
            this.layoutControlItem2.MaxSize = new System.Drawing.Size(88, 40);
706 706
            this.layoutControlItem2.MinSize = new System.Drawing.Size(88, 40);
707 707
            this.layoutControlItem2.Name = "layoutControlItem2";
......
713 713
            // layoutControlItem3
714 714
            // 
715 715
            this.layoutControlItem3.Control = this.btnClose;
716
            this.layoutControlItem3.Location = new System.Drawing.Point(1021, 674);
716
            this.layoutControlItem3.Location = new System.Drawing.Point(1029, 678);
717 717
            this.layoutControlItem3.MaxSize = new System.Drawing.Size(90, 40);
718 718
            this.layoutControlItem3.MinSize = new System.Drawing.Size(90, 40);
719 719
            this.layoutControlItem3.Name = "layoutControlItem3";
......
725 725
            // splitterItem1
726 726
            // 
727 727
            this.splitterItem1.AllowHotTrack = true;
728
            this.splitterItem1.Location = new System.Drawing.Point(782, 0);
728
            this.splitterItem1.Location = new System.Drawing.Point(788, 0);
729 729
            this.splitterItem1.Name = "splitterItem1";
730
            this.splitterItem1.Size = new System.Drawing.Size(10, 674);
730
            this.splitterItem1.Size = new System.Drawing.Size(10, 678);
731 731
            // 
732 732
            // layoutControlGroup3
733 733
            // 
734 734
            this.layoutControlGroup3.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
735 735
            this.layoutControlItem1});
736
            this.layoutControlGroup3.Location = new System.Drawing.Point(792, 0);
736
            this.layoutControlGroup3.Location = new System.Drawing.Point(798, 0);
737 737
            this.layoutControlGroup3.Name = "layoutControlGroup3";
738
            this.layoutControlGroup3.Size = new System.Drawing.Size(319, 224);
738
            this.layoutControlGroup3.Size = new System.Drawing.Size(321, 226);
739 739
            this.layoutControlGroup3.Text = "Aveva Symbol Structure";
740 740
            // 
741 741
            // layoutControlItem1
......
743 743
            this.layoutControlItem1.Control = this.treeListAvevaSymbol;
744 744
            this.layoutControlItem1.Location = new System.Drawing.Point(0, 0);
745 745
            this.layoutControlItem1.Name = "layoutControlItem1";
746
            this.layoutControlItem1.Size = new System.Drawing.Size(295, 179);
746
            this.layoutControlItem1.Size = new System.Drawing.Size(297, 181);
747 747
            this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0);
748 748
            this.layoutControlItem1.TextVisible = false;
749 749
            // 
750 750
            // emptySpaceItem2
751 751
            // 
752 752
            this.emptySpaceItem2.AllowHotTrack = false;
753
            this.emptySpaceItem2.Location = new System.Drawing.Point(1011, 674);
753
            this.emptySpaceItem2.Location = new System.Drawing.Point(1019, 678);
754 754
            this.emptySpaceItem2.MaxSize = new System.Drawing.Size(10, 40);
755 755
            this.emptySpaceItem2.MinSize = new System.Drawing.Size(10, 40);
756 756
            this.emptySpaceItem2.Name = "emptySpaceItem2";
......
762 762
            // 
763 763
            this.layoutControlGroup6.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
764 764
            this.layoutControlItem7});
765
            this.layoutControlGroup6.Location = new System.Drawing.Point(792, 234);
765
            this.layoutControlGroup6.Location = new System.Drawing.Point(798, 236);
766 766
            this.layoutControlGroup6.Name = "layoutControlGroup6";
767
            this.layoutControlGroup6.Size = new System.Drawing.Size(319, 400);
767
            this.layoutControlGroup6.Size = new System.Drawing.Size(321, 402);
768 768
            this.layoutControlGroup6.Text = "Aveva Symbols";
769 769
            // 
770 770
            // layoutControlItem7
......
772 772
            this.layoutControlItem7.Control = this.galleryControlAvevaSymbols;
773 773
            this.layoutControlItem7.Location = new System.Drawing.Point(0, 0);
774 774
            this.layoutControlItem7.Name = "layoutControlItem7";
775
            this.layoutControlItem7.Size = new System.Drawing.Size(295, 355);
775
            this.layoutControlItem7.Size = new System.Drawing.Size(297, 357);
776 776
            this.layoutControlItem7.TextSize = new System.Drawing.Size(0, 0);
777 777
            this.layoutControlItem7.TextVisible = false;
778 778
            // 
779 779
            // splitterItem4
780 780
            // 
781 781
            this.splitterItem4.AllowHotTrack = true;
782
            this.splitterItem4.Location = new System.Drawing.Point(792, 224);
782
            this.splitterItem4.Location = new System.Drawing.Point(798, 226);
783 783
            this.splitterItem4.Name = "splitterItem4";
784
            this.splitterItem4.Size = new System.Drawing.Size(319, 10);
784
            this.splitterItem4.Size = new System.Drawing.Size(321, 10);
785 785
            // 
786 786
            // layoutControlItem8
787 787
            // 
788 788
            this.layoutControlItem8.Control = this.btnRefreshSymbol;
789
            this.layoutControlItem8.Location = new System.Drawing.Point(792, 634);
789
            this.layoutControlItem8.Location = new System.Drawing.Point(798, 638);
790 790
            this.layoutControlItem8.Name = "layoutControlItem8";
791
            this.layoutControlItem8.Size = new System.Drawing.Size(319, 40);
791
            this.layoutControlItem8.Size = new System.Drawing.Size(321, 40);
792 792
            this.layoutControlItem8.TextSize = new System.Drawing.Size(0, 0);
793 793
            this.layoutControlItem8.TextVisible = false;
794 794
            // 
......
810 810
            // 
811 811
            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
812 812
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
813
            this.ClientSize = new System.Drawing.Size(1131, 766);
813
            this.ClientSize = new System.Drawing.Size(1139, 770);
814 814
            this.Controls.Add(this.layoutControl1);
815 815
            this.Controls.Add(this.ribbonControl);
816 816
            this.Name = "MappingForm";
......
843 843
            ((System.ComponentModel.ISupportInitialize)(this.Root)).EndInit();
844 844
            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).EndInit();
845 845
            ((System.ComponentModel.ISupportInitialize)(this.tabbedControlGroup)).EndInit();
846
            ((System.ComponentModel.ISupportInitialize)(this.GroupLine)).EndInit();
847
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).EndInit();
848
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem9)).EndInit();
849
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup12)).EndInit();
850
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem15)).EndInit();
851
            ((System.ComponentModel.ISupportInitialize)(this.splitterItem7)).EndInit();
852 846
            ((System.ComponentModel.ISupportInitialize)(this.GroupSymbol)).EndInit();
853 847
            ((System.ComponentModel.ISupportInitialize)(this.splitterItem2)).EndInit();
854 848
            ((System.ComponentModel.ISupportInitialize)(this.splitterItem3)).EndInit();
......
868 862
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem12)).EndInit();
869 863
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup10)).EndInit();
870 864
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem13)).EndInit();
865
            ((System.ComponentModel.ISupportInitialize)(this.GroupLine)).EndInit();
866
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).EndInit();
867
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem9)).EndInit();
868
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup12)).EndInit();
869
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem15)).EndInit();
870
            ((System.ComponentModel.ISupportInitialize)(this.splitterItem7)).EndInit();
871 871
            ((System.ComponentModel.ISupportInitialize)(this.GroupAttribute)).EndInit();
872 872
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup11)).EndInit();
873 873
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem14)).EndInit();
DTI_PID/APIDConverter/Form/MappingForm.cs
405 405
                Project_DB.InsertOPCMapping(opcDatas) &&
406 406
                Project_DB.InsertAttributeMapping(attributeDatas))
407 407
            {
408
                MessageBox.Show("Save Success!", "APID Converter", MessageBoxButtons.OK, MessageBoxIcon.Information);
409 408
                AvevaInfo.Refresh();
409
                MessageBox.Show("Save Success!", "APID Converter", MessageBoxButtons.OK, MessageBoxIcon.Information);
410 410
            }
411 411
            else
412 412
                MessageBox.Show("Save Fail!", "APID Converter", MessageBoxButtons.OK, MessageBoxIcon.Error);
DTI_PID/APIDConverter/PIDCustomization.cs
419 419
        [CommandMethod("TestS", Autodesk.AutoCAD.Runtime.CommandFlags.UsePickSet)]
420 420
        public static void TestSelection()
421 421
        {
422
            AccessPropertyForm.Run();
423

  
424
            //GUIUtils.SetAutoLabelCheck(false);
425
            ////APIDUtils.CreateDrawingAndOpen("testA1", "1", "Aveva-Metric", "1");
426
            
427

  
428
            AccessPropertyForm.Stop();
422
            AvevaThread.Run(ThreadType.AddProperty | ThreadType.OkBtnClick, null);
423
            AvevaThread.Run(ThreadType.AddProperty, null);
424
            AvevaThread.Run(ThreadType.AddProperty | ThreadType.None, null);
425
            AvevaThread.Run(ThreadType.AddProperty | ThreadType.AddProperty, null);
429 426
        }
430 427

  
431 428
        [CommandMethod("PicTest", Autodesk.AutoCAD.Runtime.CommandFlags.UsePickSet)]
432 429
        public static void PicTest()
433 430
        {
434
            // Get the current document and database, and start a transaction
435
            Autodesk.AutoCAD.ApplicationServices.Document acDoc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
436
            Database acCurDb = acDoc.Database;
437
            Editor acDocEd = acDoc.Editor;
438

  
439
            // Request for objects to be selected in the drawing area
440
            PromptSelectionResult acSSPrompt = acDocEd.GetSelection();
441

  
442
            // If the prompt status is OK, objects were selected
443
            if (acSSPrompt.Status == PromptStatus.OK)
444
            {
445
                ObjectId[] selectedObjectIds = acSSPrompt.Value.GetObjectIds();
446
                // Get the last selected entity
447

  
448
                if (selectedObjectIds.Length > 0)
449
                {
450
                    ObjectId objIdBlock = selectedObjectIds[0];
451
                    AutoModeling.TESTStatic(objIdBlock);
452

  
453
                    using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction())
454
                    {
455
                        DBDictionary gd = (DBDictionary)acTrans.GetObject(acCurDb.GroupDictionaryId, OpenMode.ForRead);
456

  
457
                        DBObject objDB = acTrans.GetObject(objIdBlock, OpenMode.ForRead, true);
458
                        if (objDB != null)
459
                        {
460

  
461
                            foreach (var entry in gd)
462
                            {
463
                                Autodesk.AutoCAD.DatabaseServices.Group group = acTrans.GetObject(entry.Value, OpenMode.ForRead) as Autodesk.AutoCAD.DatabaseServices.Group;
464
                                ObjectId[] ids = group.GetAllEntityIds();
465
                                foreach (var item in group.GetAllEntityIds())
466
                                {
467
                                    
468
                                }
469
                            }
470
                            // check if the selected entity is of Type BlockReference
471
                            //if (objDB.GetType() == typeof(BlockReference))
472
                            //{
473
                            //    BlockReference block = objDB as BlockReference;
474

  
475
                            //    // open an entity in write mode so that we can modify its color
476
                            //    //Entity objDb = (Entity)acTrans.GetObject(objIdBlock, OpenMode.ForWrite);
477
                            //    //if (objDb != null)
478
                            //    //{
479
                            //    //    objDb.ColorIndex = 0;// white color
480
                            //    //}
481
                            //}
482
                        }
483
                        acTrans.Commit();
484
                    }
485
                }
486
            }
431
            
487 432
        }
488 433

  
489 434

  
DTI_PID/APIDConverter/Utils/APIDUtils.cs
156 156
            foreach (DataRow item in udaDT.Rows)
157 157
            {
158 158
                string name = (string)item["UDAName"];
159
                string value = item["UDAName"] + "|UDA";
159
                string value = item["UDAName"] + "|" + AvevaAttributeType.UDA;
160 160
                string displayMember = name + " | " + display;
161 161
                dt.Rows.Add(name, display, value, displayMember);
162 162
            }
......
177 177
            foreach (var item in PID.Utilities.PipeLabelHelper.GetPipeDisplayLabelFields())
178 178
            {
179 179
                string name = item.Value.FieldName;
180
                string value = item.Key + "|Attribute";
180
                string value = item.Key + "|" + AvevaAttributeType.PipeAttribute;
181 181
                string displayMember = name + " | " + display;
182 182
                dt.Rows.Add(name, display, value, displayMember);
183 183
            }
DTI_PID/APIDConverter/Utils/AccessPropertyForm.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Runtime.InteropServices;
5
using System.Text;
6
using System.Threading.Tasks;
7
using System.Threading;
8

  
9
namespace AVEVA.PID.CustomizationUtility
10
{
11
    class AccessPropertyForm
12
    {
13
        [DllImport("user32")]
14
        public static extern int FindWindow(string lpClassName, string lpWindowName);
15
        [DllImport("user32.dll")]
16
        public static extern int FindWindowEx(int hWnd1, int hWnd2, string lpsz1, string lpsz2);
17
        [DllImport("user32")]
18
        public static extern int SendMessage(IntPtr hWnd, int uMsg, IntPtr WParam, IntPtr LParam);
19

  
20
        const int BM_CLICK = 0x00F5;
21

  
22
        private static bool run;
23

  
24
        public static void Run()
25
        {
26
            run = true;
27
            Thread thread = new Thread(loop => {
28
                while (run)
29
                {
30
                    CloseForm();
31
                }
32
            });
33
            thread.IsBackground = true;
34
            thread.Start();
35
        }
36

  
37
        public static void Stop()
38
        {
39
            run = false;
40
        }
41

  
42
        public static void CloseForm()
43
        {
44
            try
45
            {
46
                int handle = FindWindow(null, AvevaACAD18String.PipePropertyUI);
47
                if (handle > 0)
48
                {
49
                    int button = FindWindowEx(handle, 0, null, "Ok");
50
                    if (button > 0)
51
                    {
52
                        Thread.Sleep(500);
53
                        SendMessage((IntPtr)button, BM_CLICK, (IntPtr)0, (IntPtr)0);
54
                        Thread.Sleep(2000);
55
                    }
56
                }
57
                Thread.Sleep(1000);
58
            }
59
            catch (Exception ex)
60
            {
61

  
62
            }
63
        }
64
    }
65
}
DTI_PID/APIDConverter/Utils/AvevaThread.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Runtime.InteropServices;
5
using System.Text;
6
using System.Threading.Tasks;
7
using System.Threading;
8
using System.Collections;
9
using System.Configuration;
10
using System.Data;
11
using System.Data.Common;
12
using System.Data.SqlClient;
13
using System.IO;
14
using System.Runtime.CompilerServices;
15
using Microsoft.VisualBasic.CompilerServices;
16

  
17
using Autodesk.AutoCAD.ApplicationServices;
18
using Autodesk.AutoCAD.ApplicationServices.Core;
19
using Autodesk.AutoCAD.DatabaseServices;
20
using Autodesk.AutoCAD.EditorInput;
21
using Autodesk.AutoCAD.Geometry;
22
using Autodesk.AutoCAD.Interop;
23
using Autodesk.AutoCAD.Interop.Common;
24
using Autodesk.AutoCAD.Runtime;
25
using Autodesk.AutoCAD.Windows;
26

  
27
using AVEVA.PID.Components;
28
using AVEVA.PID.GUI;
29
using AVEVA.PID.Common;
30
using AVEVA.PID.DWGSelector;
31
using AVEVA.PID.Utilities;
32

  
33
using AVEVA.PID.CustomizationUtility.DB;
34
using AVEVA.PID.CustomizationUtility.Model;
35
using AVEVA.PID.CustomizationUtility.Properties;
36

  
37
namespace AVEVA.PID.CustomizationUtility
38
{
39
    [Flags]
40
    public enum ThreadType
41
    {
42
        None = 0,
43
        OkBtnClick = 1,
44
        AddProperty = 2,
45
    }
46

  
47
    class AvevaThread
48
    {
49
        [DllImport("user32")]
50
        public static extern int FindWindow(string lpClassName, string lpWindowName);
51
        [DllImport("user32.dll")]
52
        public static extern int FindWindowEx(int hWnd1, int hWnd2, string lpsz1, string lpsz2);
53
        [DllImport("user32")]
54
        public static extern int SendMessage(IntPtr hWnd, int uMsg, IntPtr WParam, IntPtr LParam);
55

  
56
        const int BM_CLICK = 0x00F5;
57

  
58
        private static ThreadType Running;
59

  
60
        public static bool IsRunning(ThreadType type)
61
        {
62
            if (Running.HasFlag(type))
63
                return true;
64
            else
65
                return false;
66
        }
67

  
68
        public static void Run(ThreadType type, params object[] param)
69
        {
70
            if ((type & (type - 1)) == 0)
71
            {
72
                if (type.HasFlag(ThreadType.OkBtnClick) && !Running.HasFlag(ThreadType.OkBtnClick))
73
                {
74
                    Thread thread = new Thread(OkBtnClick);
75
                    thread.IsBackground = true;
76
                    thread.Start();
77
                    Running |= ThreadType.OkBtnClick;
78
                }
79
                else if (type.HasFlag(ThreadType.AddProperty) && !Running.HasFlag(ThreadType.AddProperty))
80
                {
81
                    Thread thread = new Thread(() => AddProperty(param[0] as List<Tuple<string, string>>));
82
                    thread.IsBackground = true;
83
                    thread.Start();
84
                    Running |= ThreadType.AddProperty;
85
                }
86
            }
87
        }
88

  
89
        public static void Stop(ThreadType type)
90
        {
91
            Running &= ~type;
92
        }
93

  
94
        public static void OkBtnClick()
95
        {
96
            try
97
            {
98
                while (Running.HasFlag(ThreadType.OkBtnClick))
99
                {
100
                    int handle = FindWindow(null, AvevaACAD18String.PipePropertyUI);
101
                    if (handle > 0)
102
                    {
103
                        int button = FindWindowEx(handle, 0, null, "Ok");
104
                        if (button > 0)
105
                        {
106
                            Thread.Sleep(2000);
107
                            SendMessage((IntPtr)button, BM_CLICK, (IntPtr)0, (IntPtr)0);
108
                            Thread.Sleep(500);
109
                            Running &= ~ThreadType.OkBtnClick;
110
                        }
111
                    }
112
                    Thread.Sleep(1000);
113
                }
114
            }
115
            catch (System.Exception ex)
116
            {
117

  
118
            }
119
        }
120

  
121
        public static void AddProperty(List<Tuple<string, string>> datas)
122
        {
123
            try
124
            {
125
                while (Running.HasFlag(ThreadType.AddProperty))
126
                {
127
                    int handle = FindWindow(null, AvevaACAD18String.PipePropertyUI);
128
                    if (handle > 0)
129
                    {
130
                        System.Windows.Forms.Control control = System.Windows.Forms.Control.FromHandle((IntPtr)handle);
131
                        if (control != null && control.GetType() == typeof(ComponentPropertiesUI))
132
                        {
133
                            ComponentPropertiesUI UI = control as ComponentPropertiesUI;
134
                            foreach (var tuple in datas)
135
                                UI.GetGridRow(tuple.Item1).Cells["Value"].Value = tuple.Item2;
136

  
137
                            int button = FindWindowEx(handle, 0, null, "Ok");
138
                            if (button > 0)
139
                            {
140
                                Thread.Sleep(500);
141
                                SendMessage((IntPtr)button, BM_CLICK, (IntPtr)0, (IntPtr)0);
142
                                Thread.Sleep(500);
143
                            }
144
                        }
145
                        Running &= ~ThreadType.AddProperty;
146
                        break;
147
                    }
148
                    Thread.Sleep(1000);
149
                }
150
            }
151
            catch (System.Exception ex)
152
            {
153

  
154
            }
155
        }
156

  
157
        public static void Test()
158
        {
159
            
160
        }
161
    }
162
}

내보내기 Unified diff

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