프로젝트

일반

사용자정보

개정판 dfb760ef

IDdfb760ef7e2ee4aa18c0572d72bf2bdea6700e97
상위 0243026f
하위 1c955e70

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

dev issue #1230 : add AvevaInfo and attribute method

Change-Id: If7b4b9f9e869c822e260b8807da118b57e7e917f

차이점 보기:

DTI_PID/APIDConverter/APIDConverterExplorer.cs
40 40
                try
41 41
                {
42 42
                    AccessPropertyForm.Run();
43
                    System.Data.DataTable avevaSymbolTable = Project_DB.SelectSymbolTable();
44 43

  
45 44
                    foreach (var item in form.Documents)
46 45
                    {
47
                        AutoModeling autoModeling = new AutoModeling(item, avevaSymbolTable);
46
                        AutoModeling autoModeling = new AutoModeling(item);
48 47
                        autoModeling.CreateDrawing();
49 48
                    }
50 49

  
DTI_PID/APIDConverter/AVEVA.PID.CustomizationUtility_ACAD2018_x64.csproj
149 149
    <Reference Include="WindowsBase" />
150 150
  </ItemGroup>
151 151
  <ItemGroup>
152
    <Compile Include="AvevaInfo.cs" />
152 153
    <Compile Include="Model\PlantItem\Note.cs" />
153 154
    <Compile Include="Model\PlantItem\Text.cs" />
154 155
    <Compile Include="Utils\AccessPropertyForm.cs" />
DTI_PID/APIDConverter/AutoModeling.cs
37 37
    {
38 38
        public static AutoModeling Running { get; set; }
39 39
        Model.Document document;
40

  
41
        System.Data.DataTable AvevaSymbolTable = null;
40
        AvevaInfo avevaInfo;
42 41

  
43 42
        private void SetConvertRule()
44 43
        {
......
54 53
            #endregion
55 54
        }
56 55

  
57
        public AutoModeling(Model.Document document, System.Data.DataTable AvevaSymbolTable)
56
        public AutoModeling(Model.Document document)
58 57
        {
59 58
            this.document = document;
60
            this.AvevaSymbolTable = AvevaSymbolTable;
59
            avevaInfo = AvevaInfo.GetInstance();
61 60
        }
62 61

  
63 62
        public void CreateDrawing()
......
102 101
            try
103 102
            {
104 103
                SplashScreenManager.ShowForm(typeof(APIDSplashScreen), true, true);
105
                SplashScreenManager.Default.SendCommand(APIDSplashScreen.SplashScreenCommand.SetAllStepCount, 5);
104
                SplashScreenManager.Default.SendCommand(APIDSplashScreen.SplashScreenCommand.SetAllStepCount, 8);
106 105
                SplashScreenManager.Default.SendCommand(APIDSplashScreen.SplashScreenCommand.SetDocumentName, document.AvevaDrawingNumber + document.AvevaSheetNumber);
107 106
                SplashScreenManager.Default.SendCommand(APIDSplashScreen.SplashScreenCommand.SetParent, Autodesk.AutoCAD.ApplicationServices.Application.MainWindow.Handle);
108 107

  
......
113 112
                RunSymbolModeling();
114 113
                RunTextModeling();
115 114
                RunNoteModeling();
115
                RunInputLineAttribute();
116
                RunInputLineNumberAttribute();
117
                RunInputSymbolAttribute();
116 118
            }
117 119
            catch (System.Exception ex)
118 120
            {
......
182 184
        }
183 185
        private void RunInputLineAttribute()
184 186
        {
185

  
187
            SplashScreenManager.Default.SendCommand(APIDSplashScreen.SplashScreenCommand.SetAllProgress, document.LINES.Count);
188
            SplashScreenManager.Default.SendCommand(APIDSplashScreen.SplashScreenCommand.SetStep, "Input Line Attribute");
189
            foreach (var item in document.LINES)
190
            {
191
                SetLineAttribute(item);
192
                SplashScreenManager.Default.SendCommand(APIDSplashScreen.SplashScreenCommand.UpProgress, null);
193
            }
186 194
        }
187 195
        private void RunInputSymbolAttribute()
188 196
        {
189

  
197
            SplashScreenManager.Default.SendCommand(APIDSplashScreen.SplashScreenCommand.SetAllProgress, document.SYMBOLS.Count);
198
            SplashScreenManager.Default.SendCommand(APIDSplashScreen.SplashScreenCommand.SetStep, "Input Symbol Attribute");
199
            foreach (var item in document.SYMBOLS)
200
            {
201
                SetSymbolAttribute(item);
202
                SplashScreenManager.Default.SendCommand(APIDSplashScreen.SplashScreenCommand.UpProgress, null);
203
            }
204
        }
205
        private void RunInputLineNumberAttribute()
206
        {
207
            SplashScreenManager.Default.SendCommand(APIDSplashScreen.SplashScreenCommand.SetAllProgress, document.LINENUMBERS.Count);
208
            SplashScreenManager.Default.SendCommand(APIDSplashScreen.SplashScreenCommand.SetStep, "Input LineNumber Attribute");
209
            foreach (var item in document.LINENUMBERS)
210
            {
211
                SetLineNumberAttribute(item);
212
                SplashScreenManager.Default.SendCommand(APIDSplashScreen.SplashScreenCommand.UpProgress, null);
213
            }
190 214
        }
191 215
        #endregion
192 216

  
......
227 251
        }
228 252
        private void SymbolModeling(Symbol symbol)
229 253
        {
230
            DataRow[] allRows = AvevaSymbolTable.Select(string.Format("Symbol_Name = '{0}'", symbol.Aveva.Name));
254
            DataRow[] allRows = avevaInfo.AvevaSymbolTable.Select(string.Format("Symbol_Name = '{0}'", symbol.Aveva.Name));
231 255
            if (allRows.Length == 1)
232 256
            {
233 257
                DataRow symbolRow = allRows[0];
......
314 338
        {
315 339

  
316 340
        }
341
        private void SetLineNumberAttribute(Model.LineNumber lineNumber)
342
        {
343

  
344
        }
317 345
        private void SetSymbolAttribute(Model.Symbol symbol)
318 346
        {
319 347

  
......
880 908
            symbol.Aveva.X = 50;
881 909
            symbol.Aveva.Y = 100;
882 910

  
883
            DataRow[] allRows = AvevaSymbolTable.Select(string.Format("Symbol_Name = '{0}'", symbol.Aveva.Name));
911
            DataRow[] allRows = avevaInfo.AvevaSymbolTable.Select(string.Format("Symbol_Name = '{0}'", symbol.Aveva.Name));
884 912
            if (allRows.Length == 1)
885 913
            {
886 914
                DataRow symbolRow = allRows[0];
DTI_PID/APIDConverter/AvevaInfo.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5
using System.Threading.Tasks;
6
using AVEVA.PID.CustomizationUtility.DB;
7
using AVEVA.PID.CustomizationUtility.Model;
8
using AVEVA.PID.CustomizationUtility.Properties;
9
using System.Data;
10

  
11
namespace AVEVA.PID.CustomizationUtility
12
{
13
    public class AvevaInfo
14
    {
15
        static AvevaInfo avevaInfo;
16

  
17
        public DataTable AvevaSymbolTable { get; set; }
18

  
19

  
20
        public static AvevaInfo GetInstance()
21
        {
22
            if (avevaInfo == null)
23
            {
24
                avevaInfo = new AvevaInfo();
25
                Refresh();
26
            }
27
            return avevaInfo;
28
        }
29

  
30
        public static void Refresh()
31
        {
32
            avevaInfo.AvevaSymbolTable = Project_DB.SelectSymbolTable();
33

  
34
        }
35
    }
36
}

내보내기 Unified diff

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