프로젝트

일반

사용자정보

개정판 4d4dce52

ID4d4dce5214a2072da2dd5b97925083e999aff50a
상위 6f404d45
하위 9d6edced

함의성이(가) 약 3년 전에 추가함

revert

Change-Id: I82422eba1357822cff080d21514121e2a36208ed

차이점 보기:

DTI_PID/SPPIDConverter/OPC/AutoModeling_OPC.cs
4 4
using System.Text;
5 5
using System.Threading.Tasks;
6 6
using System.Data;
7
using Ingr.SPPID.Llama;
8
using Ingr.SPPID.Plaice;
7
using Llama;
8
using Plaice;
9 9
using Ingr.RAD2D.Interop.RAD2D;
10 10
using Ingr.RAD2D.Internal;
11 11
using Ingr.RAD2D.Helper;
......
64 64
            bool isPaired = false;
65 65
            LMOPC _FROM_OPC = dataSource.GetOPC(fromOPCModelId);
66 66
            LMOPC _TO_OPC = dataSource.GetOPC(toOPCModelId);
67
            if (_FROM_OPC != null && _FROM_OPC.ItemStatus.ToString() == "Active" && _TO_OPC != null && _TO_OPC.ItemStatus.ToString() == "Active")
67
            if (_FROM_OPC != null && _FROM_OPC.get_ItemStatus() == "Active" && _TO_OPC != null && _TO_OPC.get_ItemStatus() == "Active")
68 68
            {
69 69
                string symbolPath = GetSPPIDFileName(_FROM_OPC);
70 70
                LMOPC pairOPC = _FROM_OPC.pairedWithOPCObject;
71 71

  
72 72
                foreach (LMRepresentation rep in pairOPC.Representations)
73
                    if (rep.DrawingID.ToString() != "0")
73
                    if (rep.DrawingID != "0")
74 74
                        isPaired = true;
75 75
                try
76 76
                {
......
81 81
                            LMSymbol removeSymbol = dataSource.GetSymbol(rep.Id);
82 82
                            if (removeSymbol != null)
83 83
                            {
84
                                ZoomObjectByGraphicOID(removeSymbol.GraphicOID.ToString());
84
                                ZoomObjectByGraphicOID(removeSymbol.get_GraphicOID().ToString());
85 85

  
86
                                int mirror = removeSymbol.IsMirroredIndex;
87
                                double angle = Convert.ToDouble(removeSymbol.RotationAngle);
88
                                double x = Convert.ToDouble(removeSymbol.XCoordinate);
89
                                double y = Convert.ToDouble(removeSymbol.YCoordinate);
86
                                int mirror = removeSymbol.get_IsMirroredIndex();
87
                                double angle = Convert.ToDouble(removeSymbol.get_RotationAngle());
88
                                double x = removeSymbol.get_XCoordinate();
89
                                double y = removeSymbol.get_YCoordinate();
90 90
                                LMSymbol newOPC = null;
91 91
                                LMConnector connConnector = null;
92 92
                                int connConnectorIndex = 0;
93 93
                                foreach (LMConnector LMConnector in removeSymbol.Avoid1Connectors)
94 94
                                {
95
                                    if (LMConnector.ItemStatus.ToString() == "Active")
95
                                    if (LMConnector.get_ItemStatus() == "Active")
96 96
                                    {
97 97
                                        connConnector = LMConnector;
98 98
                                        if (!DBNull.Value.Equals(connConnector.ConnectItem1SymbolID) && connConnector.ConnectItem1SymbolID == removeSymbol.Id)
......
107 107
                                {
108 108
                                    foreach (LMConnector LMConnector in removeSymbol.Avoid2Connectors)
109 109
                                    {
110
                                        if (LMConnector.ItemStatus.ToString() == "Active")
110
                                        if (LMConnector.get_ItemStatus() == "Active")
111 111
                                        {
112 112
                                            connConnector = LMConnector;
113 113
                                            if (!DBNull.Value.Equals(connConnector.ConnectItem1SymbolID) && connConnector.ConnectItem1SymbolID == removeSymbol.Id)
......
130 130
                                        string _symbolPath = null;
131 131
                                        foreach (LMRepresentation representation in modelItem.Representations)
132 132
                                        {
133
                                            if (!DBNull.Value.Equals(representation.FileName) && !string.IsNullOrEmpty(representation.FileName.ToString()))
133
                                            if (!DBNull.Value.Equals(representation.get_FileName()) && !string.IsNullOrEmpty(representation.get_FileName()))
134 134
                                            {
135
                                                _symbolPath = representation.FileName.ToString();
135
                                                _symbolPath = representation.get_FileName();
136 136
                                                break;
137 137
                                            }
138 138
                                        }
139 139

  
140 140
                                        if (!string.IsNullOrEmpty(_symbolPath))
141 141
                                        {
142
                                            LMAItem _LMAItem = _placement.PIDCreateItem(_symbolPath);
142
                                            _LMAItem _LMAItem = _placement.PIDCreateItem(_symbolPath);
143 143
                                            List<double[]> vertices = GetConnectorVertices(connConnector);
144 144
                                            PlaceRunInputs placeRunInputs = new PlaceRunInputs();
145 145
                                            double[] point = null;
......
173 173
                                    {
174 174
                                        LMAAttribute _attribute = modelitem.Attributes[attribute[0]];
175 175
                                        if (_attribute != null)
176
                                            _attribute.Value = attribute[1];
176
                                            _attribute.set_Value(attribute[1]);
177 177
                                    }
178 178
                                    newOPC.Commit();
179 179
                                    modelitem.Commit();
......
222 222
            List<double[]> vertices = new List<double[]>();
223 223
            if (connector != null)
224 224
            {
225
                dynamic OID = connector.GraphicOID.ToString();
226
                Ingr.RAD2D.Components.Connector.Connector drawingObject = radApp.ActiveDocument.ActiveSheet.DrawingObjects[OID] as Ingr.RAD2D.Components.Connector.Connector;
225
                dynamic OID = connector.get_GraphicOID().ToString();
226
                DependencyObject drawingObject = radApp.ActiveDocument.ActiveSheet.DrawingObjects[OID];
227 227
                Ingr.RAD2D.LineStringGeometry2d lineStringGeometry = drawingObject.GetGeometry() as Ingr.RAD2D.LineStringGeometry2d;
228 228
                int verticesCount = lineStringGeometry.VertexCount;
229 229
                double[] value = null;
......
251 251
                double minY = 0;
252 252
                double maxX = 0;
253 253
                double maxY = 0;
254
                ((GraphicObject)radApp.ActiveDocument.ActiveSheet.DrawingObjects[graphicOID]).Range(out minX, out minY, out maxX, out maxY);
255
                // TODO : ZOOM FIT
256
                //radApp.ActiveWindow.ZoomArea2(minX - 0.007, minY - 0.007, maxX + 0.007, maxY + 0.007, null);
254
                radApp.ActiveDocument.ActiveSheet.DrawingObjects[graphicOID].Range(out minX, out minY, out maxX, out maxY);
255
                radApp.ActiveWindow.ZoomArea2(minX - 0.007, minY - 0.007, maxX + 0.007, maxY + 0.007, null);
257 256

  
258 257
                Thread.Sleep(milliseconds);
259 258
            }
......
264 263
            string symbolPath = null;
265 264
            foreach (LMRepresentation rep in opc.Representations)
266 265
            {
267
                if (!DBNull.Value.Equals(rep.FileName) && !string.IsNullOrEmpty(rep.FileName.ToString()))
266
                if (!DBNull.Value.Equals(rep.get_FileName()) && !string.IsNullOrEmpty(rep.get_FileName()))
268 267
                {
269
                    symbolPath = rep.FileName.ToString();
268
                    symbolPath = rep.get_FileName();
270 269
                    break;
271 270
                }
272 271
            }

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)