개정판 7e680366
dev issue #507 : fix JoinRun
Change-Id: I261087f9c65fa83b75a8b306486606a19a4eb0f4
DTI_PID/SPPIDConverter/AutoModeling.cs | ||
---|---|---|
3230 | 3230 |
attribute.set_Value("End 1 is upstream (Inlet)"); |
3231 | 3231 |
} |
3232 | 3232 |
else if (modelItem1.get_ItemStatus() == "Active" && modelItem2.get_ItemStatus() == "Active") |
3233 |
survivorId = null; |
|
3233 |
{ |
|
3234 |
int model1Cnt = GetConnectorCount(modelId1); |
|
3235 |
int model2Cnt = GetConnectorCount(modelId2); |
|
3236 |
if (model1Cnt == 0) |
|
3237 |
{ |
|
3238 |
beforeID = modelItem1.Id; |
|
3239 |
afterID = modelItem2.Id; |
|
3240 |
survivorId = afterID; |
|
3241 |
LMAAttribute attribute = modelItem2.Attributes["FlowDirection"]; |
|
3242 |
if (attribute != null) |
|
3243 |
attribute.set_Value("End 1 is upstream (Inlet)"); |
|
3244 |
} |
|
3245 |
else if (model2Cnt == 0) |
|
3246 |
{ |
|
3247 |
beforeID = modelItem2.Id; |
|
3248 |
afterID = modelItem1.Id; |
|
3249 |
survivorId = afterID; |
|
3250 |
LMAAttribute attribute = modelItem1.Attributes["FlowDirection"]; |
|
3251 |
if (attribute != null) |
|
3252 |
attribute.set_Value("End 1 is upstream (Inlet)"); |
|
3253 |
} |
|
3254 |
else |
|
3255 |
survivorId = null; |
|
3256 |
} |
|
3234 | 3257 |
else |
3235 | 3258 |
{ |
3236 | 3259 |
Log.Write("잘못된 경우"); |
... | ... | |
3770 | 3793 |
return result; |
3771 | 3794 |
} |
3772 | 3795 |
|
3796 |
|
|
3797 |
private int GetConnectorCount(string modelItemID) |
|
3798 |
{ |
|
3799 |
LMModelItem modelItem = dataSource.GetModelItem(modelItemID); |
|
3800 |
int result = 0; |
|
3801 |
if (modelItem != null) |
|
3802 |
{ |
|
3803 |
foreach (LMRepresentation rep in modelItem.Representations) |
|
3804 |
{ |
|
3805 |
if (rep.Attributes["RepresentationType"].get_Value() == "Connector" && rep.Attributes["ItemStatus"].get_Value() == "Active") |
|
3806 |
result++; |
|
3807 |
ReleaseCOMObjects(rep); |
|
3808 |
} |
|
3809 |
ReleaseCOMObjects(modelItem); |
|
3810 |
} |
|
3811 |
|
|
3812 |
return result; |
|
3813 |
} |
|
3814 |
|
|
3773 | 3815 |
public List<string> GetRepresentations(string modelItemID) |
3774 | 3816 |
{ |
3775 | 3817 |
List<string> result = new List<string>(); ; |
내보내기 Unified diff