개정판 21be5063
dev issue #728: Convert vb to c#
DTI_PID/SPPIDAutoModeling/ItemObject.cs | ||
---|---|---|
16 | 16 |
TEXT = 4, |
17 | 17 |
} |
18 | 18 |
|
19 |
public class SymbolChild |
|
20 |
{ |
|
21 |
private string _Arrow; |
|
22 |
private string _Name; |
|
23 |
private int _Index; |
|
24 |
private string _SPPIDMAPPINGNAME; |
|
25 |
private object _SPPID_ITEM_OBJECT; |
|
26 |
|
|
27 |
public string Arrow { get => _Arrow; set => _Arrow = value; } |
|
28 |
public string Name { get => _Name; set => _Name = value; } |
|
29 |
public int Index { get => _Index; set => _Index = value; } |
|
30 |
public string SPPIDMAPPINGNAME { get => _SPPIDMAPPINGNAME; set => _SPPIDMAPPINGNAME = value; } |
|
31 |
public object SPPID_ITEM_OBJECT { get => _SPPID_ITEM_OBJECT; set => _SPPID_ITEM_OBJECT = value; } |
|
32 |
} |
|
33 |
|
|
34 |
|
|
19 | 35 |
public class Group |
20 | 36 |
{ |
21 | 37 |
private List<Symbol> _SYMBOLS = new List<Symbol>(); |
... | ... | |
25 | 41 |
public List<Line> LINES { get => _LINES; set => _LINES = value; } |
26 | 42 |
} |
27 | 43 |
|
44 |
|
|
45 |
|
|
28 | 46 |
public class Drawing |
29 | 47 |
{ |
30 | 48 |
#region Property |
... | ... | |
126 | 144 |
#region Property |
127 | 145 |
private string _ORIGINALPOINT; |
128 | 146 |
private List<Connector> _CONNECTORS = new List<Connector>(); |
147 |
private string _CONNECTIONPOINT; |
|
129 | 148 |
private string _LOCATION; |
130 | 149 |
private string _SIZE; |
131 | 150 |
private double _ANGLE; |
132 | 151 |
private string _PARENT; |
133 |
private List<string> _CHILD = new List<string>();
|
|
134 |
private List<object> _CHILD_SPPID_ITEM_OBJECT = new List<object>();
|
|
152 |
private string _CHILD;
|
|
153 |
private List<SymbolChild> _CHILD_LIST = new List<SymbolChild>();
|
|
135 | 154 |
private string _HASINSTRUMENTLABEL; |
136 | 155 |
private string _CURRENTPOINTMODEINDEX; |
137 | 156 |
private bool _DRAWCHECKED; |
... | ... | |
144 | 163 |
public string SIZE { get => _SIZE; set => _SIZE = value; } |
145 | 164 |
public double ANGLE { get => _ANGLE; set => _ANGLE = value; } |
146 | 165 |
public string PARENT { get => _PARENT; set => _PARENT = value; } |
147 |
public List<string> CHILD { get => _CHILD; set => _CHILD = value; } |
|
148 |
public List<object> CHILD_SPPID_ITEM_OBJECT { get => _CHILD_SPPID_ITEM_OBJECT; set => _CHILD_SPPID_ITEM_OBJECT = value; } |
|
166 |
public string CHILD { get => _CHILD; set => _CHILD = value; } |
|
149 | 167 |
public string HASINSTRUMENTLABEL { get => _HASINSTRUMENTLABEL; set => _HASINSTRUMENTLABEL = value; } |
150 | 168 |
public string CURRENTPOINTMODEINDEX { get => _CURRENTPOINTMODEINDEX; set => _CURRENTPOINTMODEINDEX = value; } |
151 | 169 |
public bool DRAWCHECKED { get => _DRAWCHECKED; set => _DRAWCHECKED = value; } |
... | ... | |
153 | 171 |
public double LOCATION_Y { get => _LOCATION_Y; set => _LOCATION_Y = value; } |
154 | 172 |
public int MIRROR { get => _MIRROR; set => _MIRROR = value; } |
155 | 173 |
public List<Connector> CONNECTORS { get => _CONNECTORS; set => _CONNECTORS = value; } |
174 |
public string CONNECTIONPOINT { get => _CONNECTIONPOINT; set => _CONNECTIONPOINT = value; } |
|
175 |
public List<SymbolChild> CHILD_LIST { get => _CHILD_LIST; set => _CHILD_LIST = value; } |
|
156 | 176 |
#endregion |
157 | 177 |
public override void AfterSetting() |
158 | 178 |
{ |
179 |
// SPPIDMAPPINGNAME Setting |
|
180 |
SPPIDMAPPINGNAME = SPPIDUtill.GetSPPIDMappingName(NAME); |
|
181 |
// End |
|
182 |
|
|
159 | 183 |
// Angle Setting |
160 | 184 |
if (ANGLE == 1.57) |
161 | 185 |
ANGLE = 90 * Math.PI / 180; |
... | ... | |
172 | 196 |
SPPIDUtill.ConvertSPPIDPoint(ref _LOCATION_X, ref _LOCATION_Y, AutoModeling.DrawingItem.WIDTH, AutoModeling.DrawingItem.HEIGHT); |
173 | 197 |
// End |
174 | 198 |
|
175 |
// SPPID Type Setting
|
|
199 |
// SPPID Type Setting |
|
176 | 200 |
SPPID_TYPE = SPPID_ITEM_TYPE.SYMBOL; |
177 | 201 |
// End |
202 |
|
|
203 |
// Child Setting |
|
204 |
if (!string.IsNullOrEmpty(CHILD) && CHILD != "None") |
|
205 |
{ |
|
206 |
string[] childArray = CHILD.Split(new char[] { ',' }); |
|
207 |
for (int i = 0; i < childArray.Length; i++) |
|
208 |
{ |
|
209 |
SymbolChild child = new SymbolChild() |
|
210 |
{ |
|
211 |
Arrow = childArray[0], |
|
212 |
Name = childArray[1], |
|
213 |
Index = i |
|
214 |
}; |
|
215 |
child.SPPIDMAPPINGNAME = SPPIDUtill.GetSPPIDMappingName(child.Name); |
|
216 |
CHILD_LIST.Add(child); |
|
217 |
} |
|
218 |
} |
|
219 |
// End |
|
220 |
|
|
221 |
// Input Drawing |
|
222 |
AutoModeling.DrawingItem.SYMBOLS.Add(this); |
|
223 |
// End |
|
178 | 224 |
} |
179 | 225 |
|
180 | 226 |
public override void Modeling() |
... | ... | |
213 | 259 |
// End |
214 | 260 |
|
215 | 261 |
// Check Child And Modeling |
216 |
foreach (string sChild in CHILD)
|
|
262 |
foreach (SymbolChild symoblChild in CHILD_LIST)
|
|
217 | 263 |
{ |
218 | 264 |
try |
219 | 265 |
{ |
220 |
string[] arrChild = sChild.Split(new char[',']); |
|
221 |
string sArrow = arrChild[0]; |
|
222 |
string sMappingName = arrChild[1]; |
|
266 |
string sArrow = symoblChild.Arrow; |
|
267 |
string sMappingName = symoblChild.SPPIDMAPPINGNAME; |
|
223 | 268 |
|
224 | 269 |
double dChildAngle = 0; |
225 | 270 |
if (sArrow == "UP") |
... | ... | |
233 | 278 |
|
234 | 279 |
LMSymbol _childLmSymbol = _placement.PIDPlaceSymbol(sMappingName, LOCATION_X, LOCATION_Y, Mirror: 0, Rotation: dChildAngle, TargetItem: SPPID_ITEM_OBJECT); |
235 | 280 |
_childLmSymbol.Commit(); |
236 |
CHILD_SPPID_ITEM_OBJECT.Add(_childLmSymbol);
|
|
281 |
symoblChild.SPPID_ITEM_OBJECT = _childLmSymbol;
|
|
237 | 282 |
} |
238 | 283 |
catch (Exception) |
239 | 284 |
{ |
240 |
|
|
285 |
|
|
241 | 286 |
} |
242 | 287 |
} |
243 | 288 |
// End |
... | ... | |
287 | 332 |
#endregion |
288 | 333 |
public override void AfterSetting() |
289 | 334 |
{ |
335 |
// SPPIDMAPPINGNAME Setting |
|
336 |
SPPIDMAPPINGNAME = SPPIDUtill.GetSPPIDMappingName(NAME); |
|
337 |
// End |
|
338 |
|
|
290 | 339 |
// Point Setting |
291 | 340 |
SPPIDUtill.ConvertPointBystring(_STARTPOINT, ref _START_X, ref _START_Y); |
292 | 341 |
SPPIDUtill.ConvertSPPIDPoint(ref _START_X, ref _START_Y, AutoModeling.DrawingItem.WIDTH, AutoModeling.DrawingItem.HEIGHT); |
... | ... | |
301 | 350 |
// SPPID Type Setting |
302 | 351 |
SPPID_TYPE = SPPID_ITEM_TYPE.LINE; |
303 | 352 |
// End |
353 |
|
|
354 |
// Input Drawing |
|
355 |
AutoModeling.DrawingItem.LINES.Add(this); |
|
356 |
// End |
|
304 | 357 |
} |
305 | 358 |
|
306 | 359 |
public override void Modeling() |
... | ... | |
343 | 396 |
|
344 | 397 |
public override void AfterSetting() |
345 | 398 |
{ |
399 |
// SPPIDMAPPINGNAME Setting |
|
400 |
SPPIDMAPPINGNAME = SPPIDUtill.GetSPPIDMappingName(NAME); |
|
401 |
// End |
|
402 |
|
|
346 | 403 |
// Angle Setting |
347 | 404 |
if (ANGLE == 1.57) |
348 | 405 |
ANGLE = 90 * Math.PI / 180; |
... | ... | |
362 | 419 |
// SPPID Type Setting |
363 | 420 |
SPPID_TYPE = SPPID_ITEM_TYPE.LABEL; |
364 | 421 |
// End |
422 |
|
|
423 |
// Input Drawing |
|
424 |
AutoModeling.DrawingItem.LINENUMBERS.Add(this); |
|
425 |
// End |
|
365 | 426 |
} |
366 | 427 |
|
367 | 428 |
public override void Modeling() |
... | ... | |
419 | 480 |
#endregion |
420 | 481 |
public override void AfterSetting() |
421 | 482 |
{ |
483 |
// SPPIDMAPPINGNAME Setting |
|
484 |
SPPIDMAPPINGNAME = SPPIDUtill.GetSPPIDMappingName(NAME); |
|
485 |
// End |
|
486 |
|
|
422 | 487 |
// Angle Setting |
423 | 488 |
if (ANGLE == 1.57) |
424 | 489 |
ANGLE = 90 * Math.PI / 180; |
... | ... | |
438 | 503 |
// SPPID Type Setting |
439 | 504 |
SPPID_TYPE = SPPID_ITEM_TYPE.TEXT; |
440 | 505 |
// End |
506 |
|
|
507 |
// Input Drawing |
|
508 |
AutoModeling.DrawingItem.TEXTS.Add(this); |
|
509 |
// End |
|
441 | 510 |
} |
442 | 511 |
|
443 | 512 |
public override void Modeling() |
... | ... | |
445 | 514 |
try |
446 | 515 |
{ |
447 | 516 |
Placement _placement = new Placement(); |
448 |
if (NAME == "TEXT") |
|
517 |
if (NAME == "TEXT" || NAME == "NOTE")
|
|
449 | 518 |
{ |
450 | 519 |
LMSymbol _LmSymbol = _placement.PIDPlaceSymbol(SPPIDMAPPINGNAME, LOCATION_X, LOCATION_Y, Rotation: ANGLE); |
451 | 520 |
LMItemNote _LmItemNote = _placement.PIDDataSource.GetItemNote(_LmSymbol.ModelItemID); |
... | ... | |
509 | 578 |
private string _CONNECTEDITEM; |
510 | 579 |
private string _CONNECTPOINT; |
511 | 580 |
private string _SCENECONNECTPOINT; |
581 |
private string _INDEX; |
|
512 | 582 |
|
513 | 583 |
public string CONNECTEDITEM { get => _CONNECTEDITEM; set => _CONNECTEDITEM = value; } |
514 | 584 |
public string CONNECTPOINT { get => _CONNECTPOINT; set => _CONNECTPOINT = value; } |
515 | 585 |
public string SCENECONNECTPOINT { get => _SCENECONNECTPOINT; set => _SCENECONNECTPOINT = value; } |
586 |
public string INDEX { get => _INDEX; set => _INDEX = value; } |
|
516 | 587 |
#endregion |
517 | 588 |
} |
518 | 589 |
} |
내보내기 Unified diff