public bool Evaluate(
            AgAccessConstraintPluginResultEval Result,
            AgAccessConstraintPluginObjectData baseObj,
            AgAccessConstraintPluginObjectData targetObj)
        {
            if (Result != null)
            {
                Result.Value = 0.0;

                if (baseObj != null)
                {
                    double range = baseObj.Range(
                        AGI.Access.Constraint.Plugin.AgEAccessApparentPositionType.eProperApparentPosition);

                    double detectability = -1.0, relX = 0.0, relY = 0.0, relZ = 0.0;

                    baseObj.RelativePosition(
                        AGI.Access.Constraint.Plugin.AgEAccessApparentPositionType.eProperApparentPosition,
                        AGI.Plugin.AgEUtFrame.eUtFrameFixed, ref relX, ref relY, ref relZ);

                    bool usePosToComputeImageDetection = true;

                    AgAccessConstraintPluginObjectDescriptor baseDesc = baseObj.Descriptor;
                    string basePath = baseDesc.ObjectPath;

                    if (basePath != "" && m_AxesHash.ContainsKey(basePath))
                    {
                        AgCrdnConfiguredAxes topoAxes = (AgCrdnConfiguredAxes)m_AxesHash[basePath];

                        if (topoAxes != null)
                        {
                            topoAxes.TransformComponents(baseObj, ref relX, ref relY, ref relZ);

                            double sinElev = relZ / range;

                            detectability = computeDetectability(range, sinElev, m_size);

                            usePosToComputeImageDetection = false;
                        }
                    }

                    if (usePosToComputeImageDetection)
                    {
                        // will only work with Facility/Targets on Earth
                        double x = 0.0, y = 0.0, z = 0.0;
                        baseObj.Position(AGI.Plugin.AgEUtFrame.eUtFrameFixed, ref x, ref y, ref z);
                        detectability = computeImageDetectionFromPos(range, x, y, z, relX, relY, relZ);
                    }

                    Result.Value = detectability;
                }
            }

            return(true);
        }
示例#2
0
        public void Free()
        {
            Debug.WriteLine(m_DisplayName + ".Free()", "Entered:");

            m_Site               = null;
            m_StkRootObject      = null;
            m_CalcToolProvider   = null;
            m_VectorToolProvider = null;
            m_ICRFAxes           = null;

            Debug.WriteLine(m_DisplayName + ".Free()", "Exited:");
        }
示例#3
0
        public bool Reset(AgCrdnAxesPluginResultReset Result)
        {
            string objPath = "[" + Result.ObjectPath + "]";

            Debug.WriteLine(m_DisplayName + ".Reset()", "Entered:");

            m_CalcToolProvider   = Result.CalcToolProvider;
            m_VectorToolProvider = Result.VectorToolProvider;

            m_ICRFAxes = m_VectorToolProvider.ConfigureAxes("ICRF", "<MyObject>", "ICRF", "<MyObject>");

            Debug.WriteLine(m_DisplayName + ".Reset()", "Exited:");

            return(true);
        }
        public bool PreCompute(AgAccessConstraintPluginResultPreCompute Result)
        {
            // Get the topocentric Axes from the Vector Tool,
            // for the Facility/Target, to be used in the computation later

            AgAccessConstraintPluginObjectDescriptor baseDesc = Result.Base;
            string basePath = baseDesc.ObjectPath;

            if (basePath != "")
            {
                if (!m_AxesHash.ContainsKey(basePath))
                {
                    AgCrdnPluginProvider vgtProvider = baseDesc.VectorToolProvider;

                    if (vgtProvider != null)
                    {
                        string cbName = "Earth";                        //
                        cbName = baseDesc.CentralBodyName;
                        cbName = "CentralBody/" + cbName;

                        AgCrdnConfiguredAxes topoAxes = vgtProvider.ConfigureAxes(
                            "Fixed", cbName, "TopoCentric", "");

                        if (topoAxes != null && topoAxes.IsConfigured)
                        {
                            m_AxesHash.Add(basePath, topoAxes);
                        }
                    }
                }
            }

            if (m_Site != null && m_DebugMode)
            {
                Message(AgEUtLogMsgType.eUtLogMsgInfo, m_DisplayName + ": PreCompute()");
            }

            return(true);
        }