개정판 20972c61
dev issue #497 : equip, symbol Snap Grid
Change-Id: Ic17d8d2f63f394235694f6b7de2f14fc4bf504ea
DTI_PID/SPPIDConverter/AutoModeling.cs | ||
---|---|---|
99 | 99 |
int AllCount = ClacProgressCount(); |
100 | 100 |
|
101 | 101 |
SplashScreenManager.ShowForm(typeof(SPPIDSplashScreen), true, true); |
102 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetAllStep, AllCount); |
|
103 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetDocumentName, DocumentLabelText); |
|
102 | 104 |
Thread.Sleep(1000); |
103 | 105 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetParent, (IntPtr)radApp.HWnd); |
104 | 106 |
Thread.Sleep(1000); |
105 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetAllStep, AllCount); |
|
106 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetDocumentName, DocumentLabelText); |
|
107 | 107 |
|
108 | 108 |
// Equipment Modeling |
109 | 109 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Equipments Modeling"); |
... | ... | |
416 | 416 |
double y = symbol.SPPID.ORIGINAL_Y; |
417 | 417 |
int mirror = 0; |
418 | 418 |
double angle = symbol.ANGLE; |
419 |
|
|
419 |
|
|
420 |
SPPIDUtil.ConvertGridPoint(ref x, ref y); |
|
421 |
|
|
420 | 422 |
// OPC 일경우 180도 일때 Mirror |
421 | 423 |
if (mappingPath.Contains("Piping OPC's") && angle == Math.PI) |
422 | 424 |
mirror = 1; |
... | ... | |
466 | 468 |
{ |
467 | 469 |
_LMSymbol.Commit(); |
468 | 470 |
symbol.SPPID.RepresentationId = _LMSymbol.AsLMRepresentation().Id; |
471 |
symbol.SPPID.GraphicOID = _LMSymbol.get_GraphicOID(); |
|
469 | 472 |
|
470 | 473 |
foreach (var item in symbol.ChildSymbols) |
471 | 474 |
CreateChildSymbol(item, _LMSymbol); |
... | ... | |
573 | 576 |
int mirror = 0; |
574 | 577 |
double angle = equipment.ANGLE; |
575 | 578 |
|
579 |
SPPIDUtil.ConvertGridPoint(ref x, ref y); |
|
580 |
|
|
576 | 581 |
Connector connector = equipment.CONNECTORS.Find(conn => !string.IsNullOrEmpty(conn.CONNECTEDITEM) && conn.CONNECTEDITEM != "None"); |
577 | 582 |
if (connector != null) |
578 | 583 |
{ |
... | ... | |
613 | 618 |
{ |
614 | 619 |
_LMSymbol.Commit(); |
615 | 620 |
equipment.SPPID.RepresentationId = _LMSymbol.AsLMRepresentation().Id; |
621 |
equipment.SPPID.GraphicOID = _LMSymbol.get_GraphicOID(); |
|
616 | 622 |
ReleaseCOMObjects(_LMSymbol); |
617 | 623 |
} |
618 | 624 |
|
DTI_PID/SPPIDConverter/BaseModel/SPPID/SPPIDSymbolInfo.cs | ||
---|---|---|
12 | 12 |
public double ORIGINAL_X { get; set; } |
13 | 13 |
public double ORIGINAL_Y { get; set; } |
14 | 14 |
public string RepresentationId { get; set; } |
15 |
public string GraphicOID { get; set; } |
|
15 | 16 |
} |
16 | 17 |
} |
DTI_PID/SPPIDConverter/ConverterDocking.cs | ||
---|---|---|
74 | 74 |
|
75 | 75 |
private void simpleButton1_Click(object sender, EventArgs e) |
76 | 76 |
{ |
77 |
//SPPIDSplashScreen s = new SPPIDSplashScreen(); |
|
78 |
//s.ShowDialog(); |
|
79 |
|
|
80 |
|
|
81 |
SplashScreenManager.ShowForm(typeof(SPPIDSplashScreen), true, true); |
|
82 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetDocumentName, (IntPtr)radApp.HWnd); |
|
83 |
// The splash screen will be opened in a separate thread. To interact with it, use the SendCommand method. |
|
84 |
for (int i = 1; i <= 100; i++) |
|
85 |
{ |
|
86 |
|
|
87 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetProgress, i); |
|
88 |
//To process commands, override the SplashScreen.ProcessCommand method. |
|
89 |
Thread.Sleep(100); |
|
90 |
} |
|
91 |
|
|
92 |
// Close the Splash Screen. |
|
93 |
SplashScreenManager.CloseForm(false); |
|
94 |
|
|
95 |
////SetVisibleCore(false); |
|
96 |
|
|
97 |
//SplashScreenWrapper wrapper = new SplashScreenWrapper(); |
|
98 |
//wrapper.ShowDialog(); |
|
99 |
|
|
100 |
return; |
|
101 |
|
|
102 |
Placement _placement = new Placement(); |
|
103 |
LMADataSource dataSource = _placement.PIDDataSource; |
|
104 |
|
|
105 |
//double maxX = 0; |
|
106 |
//double maxY = 0; |
|
107 |
//foreach (object drawingObj in radApp.ActiveDocument.SelectSet) |
|
108 |
//{ |
|
109 |
// DependencyObject dd = drawingObj as DependencyObject; |
|
110 |
// foreach (var attributes in dd.AttributeSets) |
|
111 |
// { |
|
112 |
// foreach (var item in attributes) |
|
113 |
// { |
|
114 |
// string name = item.Name; |
|
115 |
// string value = item.GetValue().ToString(); |
|
116 |
// } |
|
117 |
// } |
|
118 |
// if (dd != null) |
|
119 |
// { |
|
120 |
// LineString2d lineString2D = dd.DrawingObjects[4] as LineString2d; |
|
121 |
// lineString2D.InsertVertex(lineString2D.VertexCount, 0.5, 0.5); |
|
122 |
// lineString2D.RemoveVertex(lineString2D.VertexCount); |
|
123 |
// } |
|
124 |
//} |
|
125 |
|
|
126 |
//DependencyObject drawingObject = radApp.ActiveSelectSet[0] as DependencyObject; |
|
127 |
//foreach (var attributes in drawingObject.AttributeSets) |
|
128 |
//{ |
|
129 |
// foreach (var attribute in attributes) |
|
130 |
// { |
|
131 |
// if (attribute.Name == "ModelID") |
|
132 |
// { |
|
133 |
// LMModelItem modelItem = dataSource.GetModelItem(attribute.GetValue()); |
|
134 |
// _LMAItem item = modelItem.AsLMAItem(); |
|
135 |
// try |
|
136 |
// { |
|
137 |
// string modelitemID = item.Id; |
|
138 |
// _placement.PIDAutoJoin(item, AutoJoinEndConstants.AutoJoin_None, ref item); |
|
139 |
// string afterModelItemID = item.Id; |
|
140 |
// item.Commit(); |
|
141 |
// } |
|
142 |
// catch (Exception ex) |
|
143 |
// { |
|
144 |
// System.Windows.Forms.MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); |
|
145 |
// } |
|
146 |
// } |
|
147 |
// } |
|
148 |
//} |
|
77 |
Placement placement = new Placement(); |
|
78 |
LMADataSource dataSource = placement.PIDDataSource; |
|
149 | 79 |
|
150 | 80 |
Ingr.RAD2D.Symbol2d symbol2d = radApp.ActiveSelectSet[0] as Ingr.RAD2D.Symbol2d; |
151 | 81 |
if (symbol2d != null) |
... | ... | |
184 | 114 |
|
185 | 115 |
|
186 | 116 |
} |
187 |
|
|
188 |
|
|
189 |
|
|
190 | 117 |
} |
191 | 118 |
} |
192 | 119 |
} |
DTI_PID/SPPIDConverter/SPPIDModel/SPPID_Document.cs | ||
---|---|---|
91 | 91 |
SPPIDUtil.ConvertPointBystring(item.ORIGINALPOINT, ref x, ref y); |
92 | 92 |
SPPIDUtil.ConvertSPPIDPoint(ref x, ref y, SIZE_WIDTH, SIZE_HEIGHT, SPPIDDocumentX, SPPIDDocumentY); |
93 | 93 |
|
94 |
SPPIDUtil.ConvertGridPoint(ref x, ref y); |
|
95 |
|
|
96 | 94 |
item.SPPID.ORIGINAL_X = x; |
97 | 95 |
item.SPPID.ORIGINAL_Y = y; |
98 | 96 |
} |
... | ... | |
120 | 118 |
SPPIDUtil.ConvertPointBystring(item.ORIGINALPOINT, ref x, ref y); |
121 | 119 |
SPPIDUtil.ConvertSPPIDPoint(ref x, ref y, SIZE_WIDTH, SIZE_HEIGHT, SPPIDDocumentX, SPPIDDocumentY); |
122 | 120 |
|
123 |
SPPIDUtil.ConvertGridPoint(ref x, ref y); |
|
124 |
|
|
125 | 121 |
item.SPPID.ORIGINAL_X = x; |
126 | 122 |
item.SPPID.ORIGINAL_Y = y; |
127 | 123 |
} |
내보내기 Unified diff