public static IAgStkObject AttachFacilityOptical(IAgStkObject parent, string radarName, OpticalParams rParams)
        {
            IAgStkObject sensorObj = CreatorFunctions.GetCreateSensor(parent, radarName);
            IAgSensor    sensor    = sensorObj as IAgSensor;

            sensor.Graphics.IsObjectGraphicsVisible = false;
            IAgSnSimpleConicPattern pattern = sensor.Pattern as IAgSnSimpleConicPattern;

            pattern.ConeAngle = Double.Parse(rParams.HalfAngle);

            IAgAccessConstraintCollection constraints = sensor.AccessConstraints;
            IAgAccessCnstrMinMax          elConstraint;
            IAgAccessCnstrMinMax          azConstraint;
            IAgAccessCnstrMinMax          rangeConstraint;
            IAgAccessCnstrMinMax          sunElConstraint;
            IAgAccessCnstrAngle           lunExConstraint;

            elConstraint = CreatorFunctions.GetElCnst(constraints);
            CreatorFunctions.SetCnstMinMax(elConstraint, Double.Parse(rParams.MinEl), Double.Parse(rParams.MaxEl));
            azConstraint = CreatorFunctions.GetAzCnst(constraints);
            CreatorFunctions.SetCnstMinMax(azConstraint, Double.Parse(rParams.MinAz), Double.Parse(rParams.MaxAz));

            sunElConstraint = CreatorFunctions.GetSunElCnst(constraints);
            CreatorFunctions.SetCnstMinMax(sunElConstraint, -90, Double.Parse(rParams.SunElAngle));

            rangeConstraint = CreatorFunctions.GetRangeCnst(constraints);
            CreatorFunctions.SetCnstMinMax(rangeConstraint, Double.Parse(rParams.MinRange), Double.Parse(rParams.MaxRange));

            lunExConstraint       = CreatorFunctions.GetLunExCnst(constraints);
            lunExConstraint.Angle = rParams.LunarExAngle;

            SetOpticalGraphics(sensor);

            return(sensorObj);
        }