개정판 310aeb31
dev issue #000 : Instrument Lable 임시 모델링 개발 / Signal Run Branch 안되던 현상 수정
Change-Id: I245c21b40b7e9aa69731f69fb9fc7cc656691121
DTI_PID/SPPIDConverter/AutoModeling.cs | ||
---|---|---|
112 | 112 |
// Input Symbol Attribute |
113 | 113 |
foreach (var item in document.SYMBOLS) |
114 | 114 |
InputSymbolAttribute(item); |
115 |
|
|
116 |
#region 임시 Label |
|
117 |
foreach (var item in document.SYMBOLS) |
|
118 |
{ |
|
119 |
if (item.TYPE.Contains("Labels")) |
|
120 |
{ |
|
121 |
SPPIDSymbolInfo info = item.SPPID; |
|
122 |
Array points = new double[] { 0, item.SPPID.ORIGINAL_X, item.SPPID.ORIGINAL_Y }; |
|
123 |
string symbolUID = item.ATTRIBUTES.Find(x => x.ATTRIBUTE == "SYMBOLOWNER").VALUE; |
|
124 |
Symbol symbol = SPPIDUtil.FindObjectByUID(document, symbolUID) as Symbol; |
|
125 |
|
|
126 |
LMSymbol _TargetItem = dataSource.GetSymbol(symbol.SPPID.RepresentationId); |
|
127 |
LMLabelPersist _LMLabelPresist = _placement.PIDPlaceLabel(item.SPPID.MAPPINGNAME, ref points, Rotation: 0, LabeledItem: _TargetItem.AsLMRepresentation(), IsLeaderVisible: true); |
|
128 |
LMModelItem _LMModelItem = _TargetItem.ModelItemObject; |
|
129 |
LMAAttributes _Attributes = _LMModelItem.Attributes; |
|
130 |
|
|
131 |
foreach (var attribute in item.ATTRIBUTES) |
|
132 |
{ |
|
133 |
AttributeMapping mapping = document.AttributeMappings.Find(x => x.UID == attribute.UID); |
|
134 |
if (mapping != null) |
|
135 |
{ |
|
136 |
LMAAttribute _LMAAttribute = _Attributes[mapping.SPPIDATTRIBUTENAME]; |
|
137 |
if (_LMAAttribute != null) |
|
138 |
_LMAAttribute.set_Value(attribute.VALUE); |
|
139 |
} |
|
140 |
} |
|
141 |
_LMModelItem.Commit(); |
|
142 |
_LMLabelPresist.Commit(); |
|
143 |
ReleaseCOMObjects(_TargetItem); |
|
144 |
ReleaseCOMObjects(_LMLabelPresist); |
|
145 |
ReleaseCOMObjects(_LMModelItem); |
|
146 |
ReleaseCOMObjects(_Attributes); |
|
147 |
} |
|
148 |
} |
|
149 |
#endregion |
|
115 | 150 |
} |
116 | 151 |
catch (Exception ex) |
117 | 152 |
{ |
... | ... | |
809 | 844 |
|
810 | 845 |
private void JoinPipeRun(string fromModelItemId, string toModelItemId) |
811 | 846 |
{ |
812 |
LMPipeRun run1 = dataSource.GetPipeRun(toModelItemId); |
|
813 |
LMPipeRun run2 = dataSource.GetPipeRun(fromModelItemId); |
|
847 |
LMModelItem modelItem1 = dataSource.GetModelItem(toModelItemId); |
|
848 |
_LMAItem item1 = modelItem1.AsLMAItem(); |
|
849 |
LMModelItem modelItem2 = dataSource.GetModelItem(fromModelItemId); |
|
850 |
_LMAItem item2 = modelItem2.AsLMAItem(); |
|
851 |
|
|
814 | 852 |
// item2가 item1으로 조인 |
815 | 853 |
try |
816 | 854 |
{ |
817 |
_LMAItem item1 = run1.AsLMAItem(); |
|
818 |
_LMAItem item2 = run2.AsLMAItem(); |
|
819 |
|
|
820 | 855 |
_placement.PIDJoinRuns(ref item1, ref item2); |
821 | 856 |
item1.Commit(); |
822 | 857 |
item2.Commit(); |
... | ... | |
827 | 862 |
} |
828 | 863 |
finally |
829 | 864 |
{ |
830 |
ReleaseCOMObjects(run1); |
|
831 |
ReleaseCOMObjects(run2); |
|
865 |
ReleaseCOMObjects(modelItem1); |
|
866 |
ReleaseCOMObjects(item1); |
|
867 |
ReleaseCOMObjects(modelItem2); |
|
868 |
ReleaseCOMObjects(item2); |
|
832 | 869 |
} |
833 | 870 |
} |
834 | 871 |
|
835 | 872 |
private void AutoJoinPipeRun(string modelItemId) |
836 | 873 |
{ |
837 |
LMPipeRun run = dataSource.GetPipeRun(modelItemId); |
|
874 |
LMModelItem modelItem = dataSource.GetModelItem(modelItemId); |
|
875 |
_LMAItem item = modelItem.AsLMAItem(); |
|
838 | 876 |
try |
839 | 877 |
{ |
840 |
_LMAItem item = run.AsLMAItem(); |
|
841 | 878 |
string modelitemID = item.Id; |
842 | 879 |
_placement.PIDAutoJoin(item, AutoJoinEndConstants.autoJoin_Both, ref item); |
843 | 880 |
string afterModelItemID = item.Id; |
... | ... | |
855 | 892 |
} |
856 | 893 |
finally |
857 | 894 |
{ |
858 |
ReleaseCOMObjects(run); |
|
895 |
ReleaseCOMObjects(modelItem); |
|
896 |
ReleaseCOMObjects(item); |
|
859 | 897 |
} |
860 | 898 |
} |
861 | 899 |
|
... | ... | |
879 | 917 |
private Dictionary<LMConnector, List<double[]>> GetPipeRunVertices(string modelId) |
880 | 918 |
{ |
881 | 919 |
Dictionary<LMConnector, List<double[]>> connectorVertices = new Dictionary<LMConnector, List<double[]>>(); |
882 |
LMPipeRun _LMPipeRun = dataSource.GetPipeRun(modelId); |
|
883 |
if (_LMPipeRun != null) |
|
920 |
LMModelItem modelItem = dataSource.GetModelItem(modelId); |
|
921 |
|
|
922 |
if (modelItem != null) |
|
884 | 923 |
{ |
885 |
foreach (LMRepresentation rep in _LMPipeRun.Representations)
|
|
924 |
foreach (LMRepresentation rep in modelItem.Representations)
|
|
886 | 925 |
{ |
887 | 926 |
if (rep.Attributes["RepresentationType"].get_Value() == "Connector" && rep.Attributes["ItemStatus"].get_Value() == "Active") |
888 | 927 |
{ |
... | ... | |
904 | 943 |
} |
905 | 944 |
} |
906 | 945 |
|
907 |
ReleaseCOMObjects(_LMPipeRun);
|
|
946 |
ReleaseCOMObjects(modelItem);
|
|
908 | 947 |
} |
909 | 948 |
|
910 | 949 |
return connectorVertices; |
... | ... | |
1047 | 1086 |
if (!string.IsNullOrEmpty(symbol.SPPID.RepresentationId)) |
1048 | 1087 |
{ |
1049 | 1088 |
LMSymbol _LMSymbol = dataSource.GetSymbol(symbol.SPPID.RepresentationId); |
1050 |
dynamic _LMModelItem = ((dynamic)_LMSymbol).ModelItemObject;
|
|
1089 |
LMModelItem _LMModelItem = _LMSymbol.ModelItemObject;
|
|
1051 | 1090 |
LMAAttributes _Attributes = _LMModelItem.Attributes; |
1052 | 1091 |
|
1053 | 1092 |
foreach (var item in symbol.PROPERTIES) |
내보내기 Unified diff