개정판 d4c3e39f
dev issue #1176 : ValidationCheck 추가
Change-Id: I592a9901417561e2d92aa6ace7719226134ff167
DTI_PID/SPPIDConverter/AutoModeling.cs | ||
---|---|---|
234 | 234 |
{ |
235 | 235 |
SortBranchLines(); |
236 | 236 |
Line item = BranchLines[0]; |
237 |
if (EnableBranchModeling(item)) |
|
238 |
{ |
|
239 |
NewLineModeling(item, true); |
|
240 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.UpProgress, null); |
|
241 |
} |
|
242 |
else |
|
243 |
throw new Exception("Fail Branch Modeling"); |
|
237 |
NewLineModeling(item, true); |
|
238 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.UpProgress, null); |
|
244 | 239 |
} |
245 | 240 |
catch (Exception ex) |
246 | 241 |
{ |
... | ... | |
250 | 245 |
Log.Write(ex.StackTrace); |
251 | 246 |
break; |
252 | 247 |
} |
253 |
|
|
254 |
bool EnableBranchModeling(Line line) |
|
255 |
{ |
|
256 |
bool result = true; |
|
257 |
if (line.CONNECTORS.FindAll(x => x.ConnectedObject != null && |
|
258 |
x.ConnectedObject.GetType() == typeof(Line) && |
|
259 |
string.IsNullOrEmpty(((Line)x.ConnectedObject).SPPID.ModelItemId)).Count > 0) |
|
260 |
result = false; |
|
261 |
|
|
262 |
return result; |
|
263 |
} |
|
264 | 248 |
} |
265 | 249 |
|
266 | 250 |
SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetAllProgress, stepLast_Line.Count); |
... | ... | |
739 | 723 |
newDrawing = application.Drawings.Add(document.Unit, document.Template, drawingNumber, drawingName); |
740 | 724 |
document.SPPID_DrawingNumber = drawingNumber; |
741 | 725 |
document.SPPID_DrawingName = drawingName; |
726 |
Thread.Sleep(1000); |
|
742 | 727 |
application.ActiveWindow.Fit(); |
743 | 728 |
Thread.Sleep(1000); |
744 | 729 |
application.ActiveWindow.Zoom = 2000; |
DTI_PID/SPPIDConverter/BaseModel/Document.cs | ||
---|---|---|
772 | 772 |
|
773 | 773 |
Connector connector1 = line1.CONNECTORS.Find(x => x.ConnectedObject == line2); |
774 | 774 |
Connector connector2 = line2.CONNECTORS.Find(x => x.ConnectedObject == line1); |
775 |
|
|
775 | 776 |
if (connector1 != null && connector2 != null) |
776 | 777 |
{ |
777 | 778 |
int connectorIndex = line1.CONNECTORS.IndexOf(connector1); |
778 | 779 |
if (connectorIndex != 0 && !SPPIDUtil.IsBranchLine(line1)) |
779 | 780 |
result = true; |
781 |
else if (connectorIndex != 0 && SPPIDUtil.IsBranchLine(line1) && SPPIDUtil.IsBranchLine(line2)) |
|
782 |
result = true; |
|
780 | 783 |
else if (connectorIndex == 0 && !SPPIDUtil.IsBranchLine(line1) && SPPIDUtil.IsBranchLine(line2)) |
781 | 784 |
result = true; |
785 |
} |
|
786 |
else if (SPPIDUtil.IsBranchLine(line1, line2)) |
|
787 |
{ |
|
788 |
if (connector1 == null) |
|
789 |
result = true; |
|
790 |
} |
|
782 | 791 |
|
783 |
if (result) |
|
784 |
{ |
|
785 |
validationStringBuilder.AppendLine("Check Segment Rule!"); |
|
786 |
validationStringBuilder.AppendLine("UID : " + item.UID); |
|
787 |
validationStringBuilder.AppendLine(); |
|
788 |
validationResult = true; |
|
789 |
} |
|
792 |
if (result) |
|
793 |
{ |
|
794 |
validationStringBuilder.AppendLine("Check Segment Rule!"); |
|
795 |
validationStringBuilder.AppendLine("UID : " + item.UID); |
|
796 |
validationStringBuilder.AppendLine(); |
|
797 |
validationResult = true; |
|
790 | 798 |
} |
791 | 799 |
} |
792 | 800 |
} |
DTI_PID/SPPIDConverter/ConverterDocking.cs | ||
---|---|---|
27 | 27 |
{ |
28 | 28 |
public partial class ConverterDocking : UserControl |
29 | 29 |
{ |
30 |
Ingr.RAD2D.Application radApp; |
|
31 |
dynamic application; |
|
30 |
|
|
32 | 31 |
public ConverterDocking() |
33 | 32 |
{ |
34 | 33 |
InitializeComponent(); |
35 |
application = Interaction.GetObject("", "PIDAutomation.Application"); |
|
36 |
WrapperApplication wApp = new WrapperApplication(application.Application); |
|
37 |
radApp = wApp.RADApplication; |
|
34 |
|
|
38 | 35 |
|
39 | 36 |
try |
40 | 37 |
{ |
... | ... | |
70 | 67 |
SPPID_Document document = converterForm.Documents[i]; |
71 | 68 |
if (document.SetSPPIDMapping() && document.Enable) |
72 | 69 |
{ |
70 |
dynamic application = Interaction.GetObject("", "PIDAutomation.Application"); |
|
71 |
WrapperApplication wApp = new WrapperApplication(application.Application); |
|
72 |
Ingr.RAD2D.Application radApp = wApp.RADApplication; |
|
73 |
|
|
73 | 74 |
AutoModeling modeling = new AutoModeling(document, application, radApp); |
74 | 75 |
modeling.DocumentLabelText = string.Format("Drawing Name : {0} ({1}/{2})", document.DrawingName, i + 1, converterForm.Documents.Count); |
75 | 76 |
modeling.Run(); |
77 |
|
|
78 |
ReleaseCOMObjects(application); |
|
76 | 79 |
} |
77 | 80 |
} |
78 | 81 |
} |
... | ... | |
91 | 94 |
|
92 | 95 |
private void btnLinkOPC_Click(object sender, EventArgs e) |
93 | 96 |
{ |
97 |
dynamic application = Interaction.GetObject("", "PIDAutomation.Application"); |
|
98 |
WrapperApplication wApp = new WrapperApplication(application.Application); |
|
99 |
Ingr.RAD2D.Application radApp = wApp.RADApplication; |
|
100 |
|
|
94 | 101 |
LMADataSource dataSource = new LMADataSource(); |
95 | 102 |
LMDrawings drawings = new LMDrawings(); |
96 | 103 |
|
... | ... | |
162 | 169 |
|
163 | 170 |
private void btnGetDrawingSize_Click(object sender, EventArgs e) |
164 | 171 |
{ |
172 |
dynamic application = Interaction.GetObject("", "PIDAutomation.Application"); |
|
173 |
WrapperApplication wApp = new WrapperApplication(application.Application); |
|
174 |
Ingr.RAD2D.Application radApp = wApp.RADApplication; |
|
175 |
|
|
165 | 176 |
if (radApp.ActiveSelectSet.Count > 0) |
166 | 177 |
{ |
167 | 178 |
DependencyObject line2D = radApp.ActiveSelectSet[0] as DependencyObject; |
... | ... | |
204 | 215 |
} |
205 | 216 |
private void AutoJoinPipeRun() |
206 | 217 |
{ |
218 |
dynamic application = Interaction.GetObject("", "PIDAutomation.Application"); |
|
219 |
WrapperApplication wApp = new WrapperApplication(application.Application); |
|
220 |
Ingr.RAD2D.Application radApp = wApp.RADApplication; |
|
221 |
|
|
207 | 222 |
string modelItemId = null; |
208 | 223 |
List<double[]> vertices = new List<double[]>(); |
209 | 224 |
if (radApp.ActiveSelectSet.Count == 0) |
... | ... | |
388 | 403 |
|
389 | 404 |
private void TESTLine() |
390 | 405 |
{ |
406 |
dynamic application = Interaction.GetObject("", "PIDAutomation.Application"); |
|
407 |
WrapperApplication wApp = new WrapperApplication(application.Application); |
|
408 |
Ingr.RAD2D.Application radApp = wApp.RADApplication; |
|
409 |
|
|
391 | 410 |
Placement _placement = new Placement(); |
392 | 411 |
LMADataSource dataSource = _placement.PIDDataSource;//placement.PIDDataSource; |
393 | 412 |
|
내보내기 Unified diff