프로젝트

일반

사용자정보

개정판 6a7573b0

ID6a7573b0a7b8afc29c604e8407f5f9e17cfcc54b
상위 4d2571ab
하위 03110d25

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

dev issue #366 : Mirror 기능 및 Drawing 크기 구하는 방식 변경

Change-Id: I7c87b78b185832403f62b18783c50861c70bb208

차이점 보기:

DTI_PID/SPPIDConverter/App.config
24 24
      <setting name="LatestProjectPath" serializeAs="String">
25 25
        <value />
26 26
      </setting>
27
      <setting name="DrawingX" serializeAs="String">
28
        <value>0</value>
29
      </setting>
30
      <setting name="DrawingY" serializeAs="String">
31
        <value>0</value>
32
      </setting>
27 33
    </Converter.SPPID.Properties.Settings>
28 34
  </userSettings>
29 35
  <system.data>
DTI_PID/SPPIDConverter/AutoModeling.cs
288 288
        /// <returns></returns>
289 289
        private bool DocumentCoordinateCorrection()
290 290
        {
291
            double maxX = 0;
292
            double maxY = 0;
293
            foreach (object drawingObj in radApp.ActiveDocument.ActiveSheet.DrawingObjects)
291
            if (Settings.Default.DrawingX != 0 && Settings.Default.DrawingY != 0)
294 292
            {
295
                Ingr.RAD2D.SmartFrame2d smartFrame2d = drawingObj as Ingr.RAD2D.SmartFrame2d;
296
                if (smartFrame2d != null)
297
                {
298
                    double x1 = 0;
299
                    double x2 = 0;
300
                    double y1 = 0;
301
                    double y2 = 0;
302
                    smartFrame2d.Range(out x1, out y1, out x2, out y2);
303
                    maxX = Math.Max(x2, maxX);
304
                    maxY = Math.Max(y2, maxY);
305
                }
306
            }
307
            if (maxX != 0 && maxY != 0)
308
            {
309
                document.SetSPPIDLocation(maxX, maxY);
293
                document.SetSPPIDLocation(Settings.Default.DrawingX, Settings.Default.DrawingY);
310 294
                document.CoordinateCorrection();
311 295
                return true;
312 296
            }
......
466 450
            try
467 451
            {
468 452
#endif
469
            // OWNERSYMBOL Attribute, 값을 가지고 있을 경우
470
            BaseModel.Attribute itemAttribute = symbol.ATTRIBUTES.Find(attr => attr.ATTRIBUTE == "OWNERSYMBOL");
471
            if (itemAttribute != null && string.IsNullOrEmpty(itemAttribute.VALUE) && itemAttribute.VALUE != "None")
472
                return;
473
            // 이미 모델링 됐을 경우
474
            else if (!string.IsNullOrEmpty(symbol.SPPID.RepresentationId))
475
                return;
476

  
477
            LMSymbol _LMSymbol = null;
478

  
479
            string mappingPath = symbol.SPPID.MAPPINGNAME;
480
            double x = symbol.SPPID.ORIGINAL_X;
481
            double y = symbol.SPPID.ORIGINAL_Y;
482
            int mirror = 0;
483
            double angle = symbol.ANGLE;
484

  
485
            SPPIDUtil.ConvertGridPoint(ref x, ref y);
486

  
487
            // OPC 일경우 180도 일때 Mirror
488
            if (mappingPath.Contains("Piping OPC's") && angle == Math.PI)
489
                mirror = 1;
453
                // OWNERSYMBOL Attribute, 값을 가지고 있을 경우
454
                BaseModel.Attribute itemAttribute = symbol.ATTRIBUTES.Find(attr => attr.ATTRIBUTE == "OWNERSYMBOL");
455
                if (itemAttribute != null && string.IsNullOrEmpty(itemAttribute.VALUE) && itemAttribute.VALUE != "None")
456
                    return;
457
                // 이미 모델링 됐을 경우
458
                else if (!string.IsNullOrEmpty(symbol.SPPID.RepresentationId))
459
                    return;
460

  
461
                LMSymbol _LMSymbol = null;
462

  
463
                string mappingPath = symbol.SPPID.MAPPINGNAME;
464
                double x = symbol.SPPID.ORIGINAL_X;
465
                double y = symbol.SPPID.ORIGINAL_Y;
466
                int mirror = 0;
467
                double angle = symbol.ANGLE;
468

  
469
                SPPIDUtil.ConvertGridPoint(ref x, ref y);
470

  
471
                // OPC 일경우 180도 일때 Mirror
472
                if (mappingPath.Contains("Piping OPC's") && angle == Math.PI)
473
                    mirror = 1;
474

  
475
                // Mirror 계산
476
                if (symbol.FLIP == 1)
477
                {
478
                    mirror = 1;
479
                    angle += Math.PI;
480
                }
490 481

  
491
            if (targetSymbol != null && !string.IsNullOrEmpty(targetSymbol.SPPID.RepresentationId))
492
            {
493
                LMSymbol _TargetItem = dataSource.GetSymbol(targetSymbol.SPPID.RepresentationId);
494
                Connector connector = SPPIDUtil.FindSymbolConnectorByUID(document, symbol.UID, targetSymbol);
495
                if (connector != null)
496
                    GetTargetSymbolConnectorPoint(connector, targetSymbol, ref x, ref y);
482
                if (targetSymbol != null && !string.IsNullOrEmpty(targetSymbol.SPPID.RepresentationId))
483
                {
484
                    LMSymbol _TargetItem = dataSource.GetSymbol(targetSymbol.SPPID.RepresentationId);
485
                    Connector connector = SPPIDUtil.FindSymbolConnectorByUID(document, symbol.UID, targetSymbol);
486
                    if (connector != null)
487
                        GetTargetSymbolConnectorPoint(connector, targetSymbol, ref x, ref y);
497 488

  
498
                _LMSymbol = _placement.PIDPlaceSymbol(mappingPath, x, y, Mirror: mirror, Rotation: angle, TargetItem: _TargetItem);
499
                ReleaseCOMObjects(_TargetItem);
500
            }
501
            else
502
                _LMSymbol = _placement.PIDPlaceSymbol(mappingPath, x, y, Mirror: mirror, Rotation: angle);
489
                    _LMSymbol = _placement.PIDPlaceSymbol(mappingPath, x, y, Mirror: mirror, Rotation: angle, TargetItem: _TargetItem);
490
                    ReleaseCOMObjects(_TargetItem);
491
                }
492
                else
493
                    _LMSymbol = _placement.PIDPlaceSymbol(mappingPath, x, y, Mirror: mirror, Rotation: angle);
503 494

  
504 495

  
505
            if (_LMSymbol != null)
506
            {
507
                _LMSymbol.Commit();
508
                symbol.SPPID.RepresentationId = _LMSymbol.AsLMRepresentation().Id;
509
                symbol.SPPID.GraphicOID = _LMSymbol.get_GraphicOID();
496
                if (_LMSymbol != null)
497
                {
498
                    _LMSymbol.Commit();
499
                    symbol.SPPID.RepresentationId = _LMSymbol.AsLMRepresentation().Id;
500
                    symbol.SPPID.GraphicOID = _LMSymbol.get_GraphicOID();
510 501

  
511
                foreach (var item in symbol.ChildSymbols)
512
                    CreateChildSymbol(item, _LMSymbol);
513
            }
502
                    foreach (var item in symbol.ChildSymbols)
503
                        CreateChildSymbol(item, _LMSymbol);
504
                }
514 505

  
515
            ReleaseCOMObjects(_LMSymbol);
516
            SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetProgress, ++CurrentCount);
506
                ReleaseCOMObjects(_LMSymbol);
507
                SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetProgress, ++CurrentCount);
517 508
#if DEBUG
518 509

  
519 510
            }
DTI_PID/SPPIDConverter/ConverterDocking.Designer.cs
29 29
        private void InitializeComponent()
30 30
        {
31 31
            this.components = new System.ComponentModel.Container();
32
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ConverterDocking));
33 32
            DevExpress.XtraSplashScreen.SplashScreenManager splashScreenManager = new DevExpress.XtraSplashScreen.SplashScreenManager(this, null, true, true, typeof(System.Windows.Forms.UserControl));
33
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ConverterDocking));
34 34
            this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
35 35
            this.simpleButton1 = new DevExpress.XtraEditors.SimpleButton();
36 36
            this.btnSPPIDConverter = new DevExpress.XtraEditors.SimpleButton();
37 37
            this.Root = new DevExpress.XtraLayout.LayoutControlGroup();
38
            this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
39 38
            this.emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem();
40 39
            this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
41 40
            this.defaultLookAndFeel = new DevExpress.LookAndFeel.DefaultLookAndFeel(this.components);
41
            this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
42
            this.textEditDrawingX = new DevExpress.XtraEditors.TextEdit();
43
            this.layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem();
44
            this.layoutControlGroup1 = new DevExpress.XtraLayout.LayoutControlGroup();
45
            this.textEditDrawingY = new DevExpress.XtraEditors.TextEdit();
46
            this.layoutControlItem4 = new DevExpress.XtraLayout.LayoutControlItem();
47
            this.layoutControlGroup2 = new DevExpress.XtraLayout.LayoutControlGroup();
48
            this.btnGetDrawingSize = new DevExpress.XtraEditors.SimpleButton();
49
            this.layoutControlItem5 = new DevExpress.XtraLayout.LayoutControlItem();
42 50
            ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
43 51
            this.layoutControl1.SuspendLayout();
44 52
            ((System.ComponentModel.ISupportInitialize)(this.Root)).BeginInit();
45
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
46 53
            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).BeginInit();
47 54
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
55
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
56
            ((System.ComponentModel.ISupportInitialize)(this.textEditDrawingX.Properties)).BeginInit();
57
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).BeginInit();
58
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).BeginInit();
59
            ((System.ComponentModel.ISupportInitialize)(this.textEditDrawingY.Properties)).BeginInit();
60
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).BeginInit();
61
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup2)).BeginInit();
62
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).BeginInit();
48 63
            this.SuspendLayout();
49 64
            // 
65
            // splashScreenManager
66
            // 
67
            splashScreenManager.ClosingDelay = 500;
68
            // 
50 69
            // layoutControl1
51 70
            // 
71
            this.layoutControl1.Controls.Add(this.btnGetDrawingSize);
72
            this.layoutControl1.Controls.Add(this.textEditDrawingY);
73
            this.layoutControl1.Controls.Add(this.textEditDrawingX);
52 74
            this.layoutControl1.Controls.Add(this.simpleButton1);
53 75
            this.layoutControl1.Controls.Add(this.btnSPPIDConverter);
54 76
            this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
55 77
            this.layoutControl1.Location = new System.Drawing.Point(0, 0);
56 78
            this.layoutControl1.Name = "layoutControl1";
57 79
            this.layoutControl1.Root = this.Root;
58
            this.layoutControl1.Size = new System.Drawing.Size(150, 300);
80
            this.layoutControl1.Size = new System.Drawing.Size(200, 500);
59 81
            this.layoutControl1.TabIndex = 0;
60 82
            this.layoutControl1.Text = "layoutControl1";
61 83
            // 
62 84
            // simpleButton1
63 85
            // 
64
            this.simpleButton1.Location = new System.Drawing.Point(12, 52);
86
            this.simpleButton1.Location = new System.Drawing.Point(12, 216);
65 87
            this.simpleButton1.Name = "simpleButton1";
66
            this.simpleButton1.Size = new System.Drawing.Size(126, 22);
88
            this.simpleButton1.Size = new System.Drawing.Size(176, 22);
67 89
            this.simpleButton1.StyleController = this.layoutControl1;
68 90
            this.simpleButton1.TabIndex = 5;
69 91
            this.simpleButton1.Text = "simpleButton1";
......
73 95
            // btnSPPIDConverter
74 96
            // 
75 97
            this.btnSPPIDConverter.ImageOptions.SvgImage = ((DevExpress.Utils.Svg.SvgImage)(resources.GetObject("btnSPPIDConverter.ImageOptions.SvgImage")));
76
            this.btnSPPIDConverter.Location = new System.Drawing.Point(12, 12);
98
            this.btnSPPIDConverter.Location = new System.Drawing.Point(24, 45);
77 99
            this.btnSPPIDConverter.Name = "btnSPPIDConverter";
78
            this.btnSPPIDConverter.Size = new System.Drawing.Size(126, 36);
100
            this.btnSPPIDConverter.Size = new System.Drawing.Size(152, 36);
79 101
            this.btnSPPIDConverter.StyleController = this.layoutControl1;
80 102
            this.btnSPPIDConverter.TabIndex = 4;
81
            this.btnSPPIDConverter.Text = "Converter";
103
            this.btnSPPIDConverter.Text = "Open Converter";
82 104
            this.btnSPPIDConverter.Click += new System.EventHandler(this.btnConverter_Click);
83 105
            // 
84 106
            // Root
......
86 108
            this.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
87 109
            this.Root.GroupBordersVisible = false;
88 110
            this.Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
89
            this.layoutControlItem1,
90 111
            this.emptySpaceItem1,
91
            this.layoutControlItem2});
112
            this.layoutControlItem2,
113
            this.layoutControlGroup1,
114
            this.layoutControlGroup2});
92 115
            this.Root.Name = "Root";
93
            this.Root.Size = new System.Drawing.Size(150, 300);
116
            this.Root.Size = new System.Drawing.Size(200, 500);
94 117
            this.Root.TextVisible = false;
95 118
            // 
96
            // layoutControlItem1
97
            // 
98
            this.layoutControlItem1.Control = this.btnSPPIDConverter;
99
            this.layoutControlItem1.Location = new System.Drawing.Point(0, 0);
100
            this.layoutControlItem1.Name = "layoutControlItem1";
101
            this.layoutControlItem1.Size = new System.Drawing.Size(130, 40);
102
            this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0);
103
            this.layoutControlItem1.TextVisible = false;
104
            // 
105 119
            // emptySpaceItem1
106 120
            // 
107 121
            this.emptySpaceItem1.AllowHotTrack = false;
108
            this.emptySpaceItem1.Location = new System.Drawing.Point(0, 66);
122
            this.emptySpaceItem1.Location = new System.Drawing.Point(0, 230);
109 123
            this.emptySpaceItem1.Name = "emptySpaceItem1";
110
            this.emptySpaceItem1.Size = new System.Drawing.Size(130, 214);
124
            this.emptySpaceItem1.Size = new System.Drawing.Size(180, 250);
111 125
            this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
112 126
            // 
113 127
            // layoutControlItem2
114 128
            // 
115 129
            this.layoutControlItem2.Control = this.simpleButton1;
116
            this.layoutControlItem2.Location = new System.Drawing.Point(0, 40);
130
            this.layoutControlItem2.Location = new System.Drawing.Point(0, 204);
117 131
            this.layoutControlItem2.Name = "layoutControlItem2";
118
            this.layoutControlItem2.Size = new System.Drawing.Size(130, 26);
132
            this.layoutControlItem2.Size = new System.Drawing.Size(180, 26);
119 133
            this.layoutControlItem2.TextSize = new System.Drawing.Size(0, 0);
120 134
            this.layoutControlItem2.TextVisible = false;
121 135
            // 
......
123 137
            // 
124 138
            this.defaultLookAndFeel.LookAndFeel.SkinName = "Office 2019 Colorful";
125 139
            // 
126
            // splashScreenManager
140
            // layoutControlItem1
127 141
            // 
128
            splashScreenManager.ClosingDelay = 500;
142
            this.layoutControlItem1.Control = this.btnSPPIDConverter;
143
            this.layoutControlItem1.Location = new System.Drawing.Point(0, 0);
144
            this.layoutControlItem1.Name = "layoutControlItem1";
145
            this.layoutControlItem1.Size = new System.Drawing.Size(156, 40);
146
            this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0);
147
            this.layoutControlItem1.TextVisible = false;
148
            // 
149
            // textEditDrawingX
150
            // 
151
            this.textEditDrawingX.Location = new System.Drawing.Point(35, 156);
152
            this.textEditDrawingX.Name = "textEditDrawingX";
153
            this.textEditDrawingX.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
154
            this.textEditDrawingX.Properties.EditFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
155
            this.textEditDrawingX.Properties.ReadOnly = true;
156
            this.textEditDrawingX.Size = new System.Drawing.Size(141, 20);
157
            this.textEditDrawingX.StyleController = this.layoutControl1;
158
            this.textEditDrawingX.TabIndex = 6;
159
            // 
160
            // layoutControlItem3
161
            // 
162
            this.layoutControlItem3.Control = this.textEditDrawingX;
163
            this.layoutControlItem3.Location = new System.Drawing.Point(0, 26);
164
            this.layoutControlItem3.Name = "layoutControlItem3";
165
            this.layoutControlItem3.Size = new System.Drawing.Size(156, 24);
166
            this.layoutControlItem3.Text = "X";
167
            this.layoutControlItem3.TextSize = new System.Drawing.Size(8, 14);
168
            // 
169
            // layoutControlGroup1
170
            // 
171
            this.layoutControlGroup1.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
172
            this.layoutControlItem3,
173
            this.layoutControlItem4,
174
            this.layoutControlItem5});
175
            this.layoutControlGroup1.Location = new System.Drawing.Point(0, 85);
176
            this.layoutControlGroup1.Name = "layoutControlGroup1";
177
            this.layoutControlGroup1.Size = new System.Drawing.Size(180, 119);
178
            this.layoutControlGroup1.Text = "Drawing Size";
179
            // 
180
            // textEditDrawingY
181
            // 
182
            this.textEditDrawingY.Location = new System.Drawing.Point(35, 180);
183
            this.textEditDrawingY.Name = "textEditDrawingY";
184
            this.textEditDrawingY.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
185
            this.textEditDrawingY.Properties.EditFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
186
            this.textEditDrawingY.Properties.ReadOnly = true;
187
            this.textEditDrawingY.Size = new System.Drawing.Size(141, 20);
188
            this.textEditDrawingY.StyleController = this.layoutControl1;
189
            this.textEditDrawingY.TabIndex = 7;
190
            // 
191
            // layoutControlItem4
192
            // 
193
            this.layoutControlItem4.Control = this.textEditDrawingY;
194
            this.layoutControlItem4.Location = new System.Drawing.Point(0, 50);
195
            this.layoutControlItem4.Name = "layoutControlItem4";
196
            this.layoutControlItem4.Size = new System.Drawing.Size(156, 24);
197
            this.layoutControlItem4.Text = "Y";
198
            this.layoutControlItem4.TextSize = new System.Drawing.Size(8, 14);
199
            // 
200
            // layoutControlGroup2
201
            // 
202
            this.layoutControlGroup2.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
203
            this.layoutControlItem1});
204
            this.layoutControlGroup2.Location = new System.Drawing.Point(0, 0);
205
            this.layoutControlGroup2.Name = "layoutControlGroup2";
206
            this.layoutControlGroup2.Size = new System.Drawing.Size(180, 85);
207
            this.layoutControlGroup2.Text = "Converter";
208
            // 
209
            // btnGetDrawingSize
210
            // 
211
            this.btnGetDrawingSize.Location = new System.Drawing.Point(24, 130);
212
            this.btnGetDrawingSize.Name = "btnGetDrawingSize";
213
            this.btnGetDrawingSize.Size = new System.Drawing.Size(152, 22);
214
            this.btnGetDrawingSize.StyleController = this.layoutControl1;
215
            this.btnGetDrawingSize.TabIndex = 8;
216
            this.btnGetDrawingSize.Text = "Get Drawing Size";
217
            this.btnGetDrawingSize.Click += new System.EventHandler(this.btnGetDrawingSize_Click);
218
            // 
219
            // layoutControlItem5
220
            // 
221
            this.layoutControlItem5.Control = this.btnGetDrawingSize;
222
            this.layoutControlItem5.Location = new System.Drawing.Point(0, 0);
223
            this.layoutControlItem5.Name = "layoutControlItem5";
224
            this.layoutControlItem5.Size = new System.Drawing.Size(156, 26);
225
            this.layoutControlItem5.TextSize = new System.Drawing.Size(0, 0);
226
            this.layoutControlItem5.TextVisible = false;
129 227
            // 
130 228
            // ConverterDocking
131 229
            // 
......
133 231
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
134 232
            this.Controls.Add(this.layoutControl1);
135 233
            this.Name = "ConverterDocking";
136
            this.Size = new System.Drawing.Size(150, 300);
234
            this.Size = new System.Drawing.Size(200, 500);
137 235
            ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit();
138 236
            this.layoutControl1.ResumeLayout(false);
139 237
            ((System.ComponentModel.ISupportInitialize)(this.Root)).EndInit();
140
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
141 238
            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).EndInit();
142 239
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
240
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
241
            ((System.ComponentModel.ISupportInitialize)(this.textEditDrawingX.Properties)).EndInit();
242
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).EndInit();
243
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).EndInit();
244
            ((System.ComponentModel.ISupportInitialize)(this.textEditDrawingY.Properties)).EndInit();
245
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).EndInit();
246
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup2)).EndInit();
247
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).EndInit();
143 248
            this.ResumeLayout(false);
144 249

  
145 250
        }
......
149 254
        private DevExpress.XtraLayout.LayoutControl layoutControl1;
150 255
        private DevExpress.XtraLayout.LayoutControlGroup Root;
151 256
        private DevExpress.XtraEditors.SimpleButton btnSPPIDConverter;
152
        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1;
153 257
        private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem1;
154 258
        private DevExpress.LookAndFeel.DefaultLookAndFeel defaultLookAndFeel;
155 259
        private DevExpress.XtraEditors.SimpleButton simpleButton1;
156 260
        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2;
261
        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1;
262
        private DevExpress.XtraEditors.TextEdit textEditDrawingY;
263
        private DevExpress.XtraEditors.TextEdit textEditDrawingX;
264
        private DevExpress.XtraLayout.LayoutControlGroup layoutControlGroup1;
265
        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem3;
266
        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem4;
267
        private DevExpress.XtraLayout.LayoutControlGroup layoutControlGroup2;
268
        private DevExpress.XtraEditors.SimpleButton btnGetDrawingSize;
269
        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem5;
157 270
    }
158 271
}
DTI_PID/SPPIDConverter/ConverterDocking.cs
33 33
            WrapperApplication wApp = new WrapperApplication(application.Application);
34 34
            radApp = wApp.RADApplication;
35 35

  
36
            try
37
            {
38
                textEditDrawingX.EditValue = Settings.Default.DrawingX;
39
                textEditDrawingY.EditValue = Settings.Default.DrawingY;
40
            }
41
            catch (Exception ex)
42
            {
43
                StringBuilder sb = new StringBuilder();
44
                sb.AppendLine(ex.Message);
45
                sb.AppendLine(ex.StackTrace);
46
                MessageBox.Show(sb.ToString());
47
            }
48
            
49

  
36 50
#if DEBUG
37 51
            simpleButton1.Visible = true;
38 52

  
......
83 97
            }
84 98
        }
85 99

  
86
        private void simpleButton1_Click(object sender, EventArgs e)
100
        private void btnGetDrawingSize_Click(object sender, EventArgs e)
87 101
        {
88
            Placement placement = new Placement();
89
            LMADataSource dataSource = new LMADataSource();//placement.PIDDataSource;
90
            
91
            
92
            Ingr.RAD2D.Symbol2d symbol2d = radApp.ActiveSelectSet[0] as Ingr.RAD2D.Symbol2d;
93
            if (symbol2d != null)
102
            if (radApp.ActiveSelectSet.Count > 0)
94 103
            {
95

  
96
                
97

  
98
                double minX;
99
                double minY;
100
                double maxX;
101
                double maxY;
102
                symbol2d.Range(out minX, out minY, out maxX, out maxY);
103

  
104
                foreach (var attributes in symbol2d.AttributeSets)
104
                DependencyObject line2D = radApp.ActiveSelectSet[0] as DependencyObject;
105
                if (line2D != null)
105 106
                {
106
                    foreach (var attribute in attributes)
107
                    {
108
                        string name = attribute.Name;
109
                        string value = attribute.GetValue().ToString();
110
                        if (name == "ModelID")
111
                        {
112
                            string modelID = value;
113
                            LMModelItem modelItem = dataSource.GetModelItem(modelID);
114
                            foreach (LMRepresentation rep in modelItem.Representations)
115
                            {
116
                                if (rep.Attributes["RepresentationType"].get_Value() == "Symbol")
117
                                {
118
                                    LMSymbol symbol = dataSource.GetSymbol(rep.Id);
119

  
120
                                    List<double[]> points = new List<double[]>();
121
                                    StringBuilder sb = new StringBuilder();
122
                                    for (int i = 1; i < int.MaxValue; i++)
123
                                    {
124
                                        double connX = 0;
125
                                        double connY = 0;
126
                                        if (placement.PIDConnectPointLocation(symbol, i, ref connX, ref connY))
127
                                        {
128
                                            points.Add(new double[] { connX, connY });
129
                                            sb.AppendLine(i + " / " + connX + " / " + connY);
130
                                        }
131
                                        else
132
                                            break;
133
                                    }
134

  
135
                                    double prevX = symbol.get_XCoordinate();
136
                                    double prevY = symbol.get_YCoordinate();
137

  
138
                                    MessageBox.Show(sb.ToString());
139
                                }
140
                            }
141
                        }
142
                    }
107
                    double minX = 0;
108
                    double minY = 0;
109
                    double maxX = 0;
110
                    double maxY = 0;
111
                    line2D.Range(out minX, out minY, out maxX, out maxY);
112

  
113
                    Settings.Default.DrawingX = maxX - minX;
114
                    Settings.Default.DrawingY = maxY - minY;
115
                    Settings.Default.Save();
116

  
117
                    textEditDrawingX.EditValue = Settings.Default.DrawingX;
118
                    textEditDrawingY.EditValue = Settings.Default.DrawingY;
143 119
                }
144

  
145
               
120
                else
121
                    MessageBox.Show(Msg.SelectLine, Msg.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning);
146 122
            }
123
            else
124
                MessageBox.Show(Msg.SelectLine, Msg.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning);
125
        }
126

  
127
        private void simpleButton1_Click(object sender, EventArgs e)
128
        {
129
            Placement placement = new Placement();
130
            LMADataSource dataSource = new LMADataSource();//placement.PIDDataSource;
131

  
132
            placement.PIDPlaceSymbol(@"\Instrumentation\Relief Devices\Press Relief Valve.sym", 0, 0, Mirror: 0);
133
            placement.PIDPlaceSymbol(@"\Instrumentation\Relief Devices\Press Relief Valve.sym", 0.03, 0, Mirror: 1);
134
            //placement.PIDPlaceSymbol("", 0.06, 0, Mirror: 2);
135
            //Ingr.RAD2D.Symbol2d symbol2d = radApp.ActiveSelectSet[0] as Ingr.RAD2D.Symbol2d;
136
            //if (symbol2d != null)
137
            //{
138
            //    double minX;
139
            //    double minY;
140
            //    double maxX;
141
            //    double maxY;
142
            //    symbol2d.Range(out minX, out minY, out maxX, out maxY);
143

  
144
            //    foreach (var attributes in symbol2d.AttributeSets)
145
            //    {
146
            //        foreach (var attribute in attributes)
147
            //        {
148
            //            string name = attribute.Name;
149
            //            string value = attribute.GetValue().ToString();
150
            //            if (name == "ModelID")
151
            //            {
152
            //                string modelID = value;
153
            //                LMModelItem modelItem = dataSource.GetModelItem(modelID);
154
            //                foreach (LMRepresentation rep in modelItem.Representations)
155
            //                {
156
            //                    if (rep.Attributes["RepresentationType"].get_Value() == "Symbol")
157
            //                    {
158
            //                        LMSymbol symbol = dataSource.GetSymbol(rep.Id);
159

  
160
            //                        List<double[]> points = new List<double[]>();
161
            //                        StringBuilder sb = new StringBuilder();
162
            //                        for (int i = 1; i < int.MaxValue; i++)
163
            //                        {
164
            //                            double connX = 0;
165
            //                            double connY = 0;
166
            //                            if (placement.PIDConnectPointLocation(symbol, i, ref connX, ref connY))
167
            //                            {
168
            //                                points.Add(new double[] { connX, connY });
169
            //                                sb.AppendLine(i + " / " + connX + " / " + connY);
170
            //                            }
171
            //                            else
172
            //                                break;
173
            //                        }
174

  
175
            //                        double prevX = symbol.get_XCoordinate();
176
            //                        double prevY = symbol.get_YCoordinate();
177

  
178
            //                        MessageBox.Show(sb.ToString());
179
            //                    }
180
            //                }
181
            //            }
182
            //        }
183
            //    }
184

  
185

  
186
            //}
147 187
        }
188

  
189
        
148 190
    }
149 191
}
DTI_PID/SPPIDConverter/ConverterDocking.resx
136 136
</value>
137 137
  </data>
138 138
  <metadata name="defaultLookAndFeel.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
139
    <value>17, 17</value>
139
    <value>190, 17</value>
140 140
  </metadata>
141 141
</root>
DTI_PID/SPPIDConverter/Properties/Msg.Designer.cs
178 178
        }
179 179
        
180 180
        /// <summary>
181
        ///   Please select one line.과(와) 유사한 지역화된 문자열을 찾습니다.
182
        /// </summary>
183
        internal static string SelectLine {
184
            get {
185
                return ResourceManager.GetString("SelectLine", resourceCulture);
186
            }
187
        }
188
        
189
        /// <summary>
181 190
        ///   Success과(와) 유사한 지역화된 문자열을 찾습니다.
182 191
        /// </summary>
183 192
        internal static string Success {
DTI_PID/SPPIDConverter/Properties/Msg.ko.resx
171 171
  <data name="EndConvert" xml:space="preserve">
172 172
    <value>도면 변환을 완료하였습니다.</value>
173 173
  </data>
174
  <data name="SelectLine" xml:space="preserve">
175
    <value>하나의 Line을 선택해주세요.</value>
176
  </data>
174 177
</root>
DTI_PID/SPPIDConverter/Properties/Msg.resx
171 171
  <data name="EndConvert" xml:space="preserve">
172 172
    <value>Completed drawing conversion</value>
173 173
  </data>
174
  <data name="SelectLine" xml:space="preserve">
175
    <value>Please select one line.</value>
176
  </data>
174 177
</root>
DTI_PID/SPPIDConverter/Properties/Settings.Designer.cs
34 34
                this["LatestProjectPath"] = value;
35 35
            }
36 36
        }
37
        
38
        [global::System.Configuration.UserScopedSettingAttribute()]
39
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
40
        [global::System.Configuration.DefaultSettingValueAttribute("0")]
41
        public double DrawingX {
42
            get {
43
                return ((double)(this["DrawingX"]));
44
            }
45
            set {
46
                this["DrawingX"] = value;
47
            }
48
        }
49
        
50
        [global::System.Configuration.UserScopedSettingAttribute()]
51
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
52
        [global::System.Configuration.DefaultSettingValueAttribute("0")]
53
        public double DrawingY {
54
            get {
55
                return ((double)(this["DrawingY"]));
56
            }
57
            set {
58
                this["DrawingY"] = value;
59
            }
60
        }
37 61
    }
38 62
}
DTI_PID/SPPIDConverter/Properties/Settings.settings
5 5
    <Setting Name="LatestProjectPath" Type="System.String" Scope="User">
6 6
      <Value Profile="(Default)" />
7 7
    </Setting>
8
    <Setting Name="DrawingX" Type="System.Double" Scope="User">
9
      <Value Profile="(Default)">0</Value>
10
    </Setting>
11
    <Setting Name="DrawingY" Type="System.Double" Scope="User">
12
      <Value Profile="(Default)">0</Value>
13
    </Setting>
8 14
  </Settings>
9 15
</SettingsFile>
DTI_PID/SPPIDConverter/Wrapper/SPPIDConverterWrapper.cs
221 221
                            {
222 222
                                DialogBar dlgBar = application.DialogBars.Add(DialogBarName, DockingFlagsConstants.igDockableOnLeft, DockingLocationConstants.igDockOnLeft,
223 223
                                     DialogBarStyleConstants.igDialogBarStyleShowCaption | DialogBarStyleConstants.igDialogBarStyleStretchToFitHorizontal | DialogBarStyleConstants.igDialogBarStyleStretchToFitVertical | DialogBarStyleConstants.igDialogBarStyleNoBorder, 0, 0);
224
                                DialogbarControl dialogBarControl_UserControl = dlgBar.Controls.AddManaged(autoModelingDllPath, "Converter.SPPID.Wrapper.ConverterDocking", 150, 300);
224
                                DialogbarControl dialogBarControl_UserControl = dlgBar.Controls.AddManaged(autoModelingDllPath, "Converter.SPPID.Wrapper.ConverterDocking", 200, 500);
225 225
                            }
226 226
                        }
227 227
                        catch (Exception ex)

내보내기 Unified diff

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