Esempio n. 1
0
        private void ProcessActiveStreetLightDDC(IGTDDCKeyObjects ddcStreetLightList)
        {
            try
            {
                foreach (IGTDDCKeyObject ddcobj in ddcStreetLightList)
                {
                    if ((ddcobj.Geometry.Type == GTGeometryTypeConstants.gtgtOrientedPointGeometry) || (ddcobj.Geometry.Type == GTGeometryTypeConstants.gtgtPointGeometry))
                    {
                        IGTKeyObject koStreetLight = oDC.OpenFeature(ddcobj.FNO, ddcobj.FID);

                        oRelationService.ActiveFeature = koStreetLight;

                        IGTKeyObjects koOwnedByList = oRelationService.GetRelatedFeatures(3);                         // Owned By

                        if (koOwnedByList == null)
                        {
                            continue;
                        }

                        if (koOwnedByList.Count == 0)
                        {
                            continue;
                        }

                        //Should only be one IGTKeyObject that owns a streetlight
                        //Need Common_N data on both the structure and the streetlight
                        IGTKeyObject koStructure = koOwnedByList[0];

                        GTActiveStreetLight objStreetLight = CommandUtilities.GetCommonNActiveFeature(koStreetLight, koStructure, oDiag);

                        if (objStreetLight == null)
                        {
                            continue;
                        }

                        objStreetLight.G3E_FID       = ddcobj.FID;
                        objStreetLight.G3E_FNO       = ddcobj.FNO;
                        objStreetLight.Structure_FID = koStructure.FID;
                        objStreetLight.StructureFNO  = koStructure.FNO;

                        this.oActiveList.Add(objStreetLight);
                    }
                }
            }
            catch (Exception ex)
            {
                CommandUtilities.LogException(oDiag, "ProcessActiveStreetLightDDC", ex);
                throw ex;
            }
        }