コード例 #1
0
        public static IAgStkObject AttachFacilityRadar(IAgStkObject parent, string radarName, RadarParams 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);
            IAgSnPtFixed pointing = sensor.Pointing as IAgSnPtFixed;

            pointing.Orientation.AssignAzEl(Double.Parse(rParams.Az), Double.Parse(rParams.El), AGI.STKUtil.AgEAzElAboutBoresight.eAzElAboutBoresightRotate);

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

            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));
            rangeConstraint = CreatorFunctions.GetRangeCnst(constraints);
            CreatorFunctions.SetCnstMinMax(rangeConstraint, Double.Parse(rParams.MinRange), Double.Parse(rParams.MaxRange));
            solarExConstraint       = CreatorFunctions.GetSunExCnst(constraints);
            solarExConstraint.Angle = rParams.SolarExAngle;

            SetRadarGraphics(sensor);

            return(sensorObj);
        }
コード例 #2
0
        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);
        }