Exemplo n.º 1
0
        public MYPLUGIN() : base()
        {
            try
            {
                m_Name    = "MYPLUGIN";
                m_Enabled = false;

                m_UPS   = null;
                m_Scope = null;

                //===========================
                // messaging related attributes
                //===========================

                m_DebugMode = false;

                m_EvalMsgInterval     = 5000;
                m_PostEvalMsgInterval = 5000;
                m_PreNextMsgInterval  = 1000;

                m_PreNextCntr  = 0;
                m_EvalCntr     = 0;
                m_PostEvalCntr = 0;
            }
            finally
            {
            }
        }
Exemplo n.º 2
0
        public bool Init(IAgUtPluginSite site)
        {
            this.m_UtPluginSite = site;

            if (this.m_UtPluginSite != null)
            {
                this.m_gatorPrv = ((IAgGatorPluginSite)(this.m_UtPluginSite)).GatorProvider;

                if (this.m_gatorPrv != null)
                {
                    this.m_eccAno = this.m_gatorPrv.ConfigureCalcObject("Eccentric_Anomaly");
                    this.m_mass   = this.m_gatorPrv.ConfigureCalcObject("Total_Mass");

                    this.m_AlphaS0 = this.m_gatorPrv.ConfigureCalcObject("AlphaS0");
                    this.m_AlphaS1 = this.m_gatorPrv.ConfigureCalcObject("AlphaS1");
                    this.m_AlphaS2 = this.m_gatorPrv.ConfigureCalcObject("AlphaS2");
                    this.m_BetaS1  = this.m_gatorPrv.ConfigureCalcObject("BetaS1");
                    this.m_BetaS2  = this.m_gatorPrv.ConfigureCalcObject("BetaS2");


                    if (this.m_eccAno != null && this.m_mass != null && this.m_AlphaS0 != null && this.m_AlphaS1 != null &&
                        this.m_AlphaS2 != null && this.m_BetaS1 != null && this.m_BetaS2 != null)
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
        public void Free()
        {
            try
            {
                Debug.WriteLine("--> Entered", m_Name + ".Free()");

                if (m_UPS != null)
                {
                    if (m_DebugMode)
                    {
                        Message(AgEUtLogMsgType.eUtLogMsgDebug, m_Name + ".Free():");
                        Message(AgEUtLogMsgType.eUtLogMsgDebug, m_Name + ".Free(): MsgCntr( " + m_MsgCntr + " )");
                    }

                    Marshal.ReleaseComObject(m_UPS);
                    m_UPS = null;
                }
            }
            catch (Exception ex)
            {
                Message(AgEUtLogMsgType.eUtLogMsgAlarm, m_Name + ".Free(): Exception Message( " + ex.Message + " )");
                Message(AgEUtLogMsgType.eUtLogMsgAlarm, m_Name + ".Free(): Exception StackTr( " + ex.StackTrace + " )");

                Debug.WriteLine("Exception Message( " + ex.Message + " )", m_Name + ".Free()");
                Debug.WriteLine("Exception StackTr( " + ex.StackTrace + " )", m_Name + ".Free()");
            }
            finally
            {
                Debug.WriteLine("<-- Exited", m_Name + ".Free()");
            }
        }
Exemplo n.º 4
0
        public Example1() : base()
        {
            try
            {
                Debug.WriteLine("--> Entered", this.m_Name + ".Example1()");

                this.m_UPS   = null;
                this.m_Scope = null;

                this.SetAttributeConfigDefaults();

                this.m_SpeedOfLight   = 299792458.0;
                this.m_SpacecraftMass = 1764.17;
                this.m_BusTerm        = 0.0;
                this.m_SA_Term        = 0.0;
                this.m_BP1Term        = 0.0;
                this.m_BP2Term        = 0.0;

                this.m_MsgCntr    = -1;
                this.m_EvalMsgsOn = false;

                this.m_SunlightSRP = new Tuple3(0.0, 0.0, 0.0);
            }
            finally
            {
                Debug.WriteLine("<-- Exited", this.m_Name + ".Example1()");
            }
        }
Exemplo n.º 5
0
        public ImageDetection()
        {
            // defaults

            m_Site  = null;
            m_Scope = null;

            m_lamda    = 0.65;                          // 700 nanometers = 0.7 microns
            m_diameter = .085;
            m_Q        = .4316 / 0.9406680947115166;

            m_a      = 3.32;
            m_b      = 1.559;
            m_logRER = Math.Log10(0.9);

            m_size = 3;

            m_DebugMode = false;                // NOTE: if true, will output a msg when
            // entering events other than Evaluate().
            //
            // DON'T set to true when using constraint as a
            // Figure of Merit,because PreCompute() and PostCompute()
            // are called once per animation step, which will cause
            // lots of messages to be written to the Message Viewer.
            m_MsgCntr     = 0;
            m_MsgInterval = 100;
        }
Exemplo n.º 6
0
 public SunPhaseAngleExample()
 {
     m_agAttrBuilder    = null;
     m_Site             = null;
     useEquatorialAngle = true;
     Debug.WriteLine(m_DisplayName + ".SunPhaseAngleExample()", "Entered:");
     Debug.WriteLine(m_DisplayName + ".SunPhaseAngleExample()", "Exited:");
 }
Exemplo n.º 7
0
        public void Free()
        {
            if (m_Site != null && m_DebugMode)
            {
                Message(AgEUtLogMsgType.eUtLogMsgInfo, m_DisplayName + ": Free()");
            }

            m_Site = null;
        }
        public void Free()
        {
            if (_DebugMode)
            {
                Message(AgEUtLogMsgType.eUtLogMsgDebug, "DensityExponentialExample:Free()");
            }

            _AgUtPluginSite = null;
        }
Exemplo n.º 9
0
 public void Initialize(IAgUtPluginSite site)
 {
     m_stkPluginSite = site as IAgStkPluginSite;
     if (m_stkPluginSite != null)
     {
         m_vectorToolProvider = m_stkPluginSite.VectorToolProvider;
         m_calcToolProvider   = m_stkPluginSite.CalcToolProvider;
     }
 }
Exemplo n.º 10
0
        public void Free()
        {
            Debug.WriteLine(m_DisplayName + ".Free()", "Entered:");

            Message(AgEUtLogMsgType.eUtLogMsgInfo, m_DisplayName + ": Free()");

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

            m_Site = null;
        }
Exemplo n.º 11
0
        public bool Init(IAgUtPluginSite site)
        {
            Debug.WriteLine(m_DisplayName + ".Init()", "Entered:");

            m_Site = site;
            Message(AgEUtLogMsgType.eUtLogMsgInfo, m_DisplayName + ": Init()");

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

            return(true);
        }
Exemplo n.º 12
0
        public bool Init(IAgUtPluginSite site)
        {
            m_Site = site;

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

            return(true);
        }
        public bool Init(IAgUtPluginSite Site)
        {
            m_UtPluginSite = (AgStkPluginSite)Site;

            if (m_UtPluginSite != null)
            {
                // Get a pointer to the STK Object Model root object
                m_StkRootObject = (AgStkObjectRoot)m_UtPluginSite.StkRootObject;
                m_StkScenario   = m_StkRootObject.CurrentScenario;
            }
            return(true);
        }
Exemplo n.º 14
0
        public void Free()
        {
            try
            {
                Debug.WriteLine("--> Entered", this.m_Name + ".Free()");

                if (this.m_UPS != null)
                {
                    if (this.m_MsgStatus)
                    {
                        this.m_UPS.Message(AgEUtLogMsgType.eUtLogMsgDebug, this.m_Name + ".Free():");
                        this.m_UPS.Message(AgEUtLogMsgType.eUtLogMsgDebug, this.m_Name + ".Free(): PreNextCntr( " + this.m_PreNextCntr + " )");
                        this.m_UPS.Message(AgEUtLogMsgType.eUtLogMsgDebug, this.m_Name + ".Free(): EvalCntr( " + this.m_EvalCntr + " )");
                        this.m_UPS.Message(AgEUtLogMsgType.eUtLogMsgDebug, this.m_Name + ".Free(): PostEvalCntr( " + this.m_PostEvalCntr + " )");
                    }

                    Marshal.ReleaseComObject(this.m_UPS);
                }
                this.m_UPS = null;

                if (this.m_SPS != null)
                {
                    Marshal.ReleaseComObject(this.m_SPS);
                }
                this.m_SPS = null;

                if (this.m_CPP != null)
                {
                    Marshal.ReleaseComObject(this.m_CPP);
                }
                this.m_CPP = null;

                if (this.m_CCV != null)
                {
                    Marshal.ReleaseComObject(this.m_CCV);
                }
                this.m_CCV = null;
            }
            catch (Exception ex)
            {
                if (this.m_UPS != null)
                {
                    this.m_UPS.Message(AgEUtLogMsgType.eUtLogMsgAlarm, this.m_Name + ".Free(): Exception Message( " + ex.Message + " )");
                    this.m_UPS.Message(AgEUtLogMsgType.eUtLogMsgAlarm, this.m_Name + ".Free(): Exception StackTr( " + ex.StackTrace + " )");
                }
                Debug.WriteLine("Exception Message( " + ex.Message + " )", this.m_Name + ".Free()");
                Debug.WriteLine("Exception StackTr( " + ex.StackTrace + " )", this.m_Name + ".Free()");
            }
            finally
            {
                Debug.WriteLine("<-- Exited", this.m_Name + ".Free()");
            }
        }
Exemplo n.º 15
0
        public void Free()
        {
            m_AxesHash.Clear();

            m_AxesHash = null;

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

            m_Site = null;
        }
Exemplo n.º 16
0
        public bool Init(IAgUtPluginSite Site)
        {
            Debug.WriteLine(m_DisplayName + ".Init()", "Entered:");

            m_Site = (AgStkPluginSite)Site;

            if (m_Site != null)
            {
                // Get a pointer to the STK Object Model root object
                m_StkRootObject = (AgStkObjectRoot)m_Site.StkRootObject;
            }

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

            return(true);
        }
Exemplo n.º 17
0
        public FileReader()
        {
            // defaults

            m_Site  = null;
            m_Scope = null;


            m_DebugMode = false;                // NOTE: if true, will output a msg when
            // entering events other than Evaluate().
            //
            // DON'T set to true when using constraint as a
            // Figure of Merit,because PreCompute() and PostCompute()
            // are called once per animation step, which will cause
            // lots of messages to be written to the Message Viewer.
            m_MsgCntr     = 0;
            m_MsgInterval = 100;
        }
        public bool Init(IAgUtPluginSite Ups)
        {
            try
            {
                Debug.WriteLine("--> Entered", m_Name + ".Init()");

                m_UPS = Ups;

                if (m_UPS != null)
                {
                    if (m_DebugMode)
                    {
                        if (m_Enabled)
                        {
                            Message(AgEUtLogMsgType.eUtLogMsgDebug, m_Name + " Enabled in " + m_Name + ".Init()");
                        }
                        else
                        {
                            Message(AgEUtLogMsgType.eUtLogMsgDebug, m_Name + " Disabled in " + m_Name + ".Init()");
                        }
                    }
                }
                else
                {
                    throw new Exception("UtPluginSite was null");
                }
            }
            catch (Exception ex)
            {
                m_Enabled = false;

                Message(AgEUtLogMsgType.eUtLogMsgAlarm, m_Name + ".Init(): Exception Message( " + ex.Message + " )");
                Message(AgEUtLogMsgType.eUtLogMsgAlarm, m_Name + ".Init(): Exception StackTr( " + ex.StackTrace + " )");

                Debug.WriteLine("Exception Message( " + ex.Message + " )", m_Name + ".Init()");
                Debug.WriteLine("Exception StackTr( " + ex.StackTrace + " )", m_Name + ".Init()");
            }
            finally
            {
                Debug.WriteLine("<-- Exited", m_Name + ".Init()");
            }

            return(m_Enabled);
        }
        public bool Init(IAgUtPluginSite Site)
        {
            if (_DebugMode)
            {
                Message(AgEUtLogMsgType.eUtLogMsgDebug, "DensityExponentialExample:Init()");
            }

            if (Site != null)
            {
                _AgUtPluginSite = Site;
                if (_DebugMode)
                {
                    if (_Enabled)
                    {
                        Message(AgEUtLogMsgType.eUtLogMsgInfo, "DensityExponentialExample:Init(): Enabled");
                    }
                    else
                    {
                        Message(AgEUtLogMsgType.eUtLogMsgInfo, "DensityExponentialExample:Init(): Disabled because Enabled flag is False");
                    }
                }
                else if (!_Enabled)
                {
                    Message(AgEUtLogMsgType.eUtLogMsgAlarm, "DensityExponentialExample:Init(): Disabled because Enabled flag is False");
                }
            }
            else
            {
                Message(AgEUtLogMsgType.eUtLogMsgAlarm, "DensityExponentialExample:Init(): Forcing Disabled because Plugin Site was null!");

                _Enabled = false;
            }

            _outputLowAltMsg    = true;
            _outputMaxHeightMsg = true;
            _MsgCntr            = -1;

            return(_Enabled);
        }
Exemplo n.º 20
0
        public void Free()
        {
            try
            {
                if (m_UPS != null)
                {
                    Marshal.ReleaseComObject(m_UPS);
                }
                m_UPS = null;
            }
            catch (Exception ex)
            {
                Message(AgEUtLogMsgType.eUtLogMsgAlarm,
                        m_Name + ".Init(): Exception Message( " + ex.Message + " )");

                Message(AgEUtLogMsgType.eUtLogMsgAlarm,
                        m_Name + ".Init(): Exception StackTr( " + ex.StackTrace + " )");
            }
            finally
            {
            }
        }
Exemplo n.º 21
0
        public bool Init(IAgUtPluginSite Ups)
        {
            try
            {
                m_UPS = Ups;

                m_Enabled = (m_UPS != null);
            }
            catch (Exception ex)
            {
                m_Enabled = false;

                Message(AgEUtLogMsgType.eUtLogMsgAlarm,
                        m_Name + ".Init(): Exception Message( " + ex.Message + " )");

                Message(AgEUtLogMsgType.eUtLogMsgAlarm,
                        m_Name + ".Init(): Exception StackTr( " + ex.StackTrace + " )");
            }
            finally
            {
            }

            return(m_Enabled);
        }
Exemplo n.º 22
0
        public Example1() : base()
        {
            try
            {
                Debug.WriteLine("--> Entered", this.m_Name + ".Example1()");

                this.SetAttributeConfigDefaults();

                this.m_UPS = null;
                this.m_SPS = null;
                this.m_CPP = null;
                this.m_CCV = null;

                this.m_SRPArea      = 0.0;
                this.m_PreNextCntr  = 0;                                     // CLR initializes to zero, but do it anyways.
                this.m_EvalCntr     = 0;                                     // CLR initializes to zero, but do it anyways.
                this.m_PostEvalCntr = 0;                                     // CLR initializes to zero, but do it anyways.
                this.m_SrpIsOn      = false;
            }
            finally
            {
                Debug.WriteLine("<-- Exited", this.m_Name + ".Example1()");
            }
        }
Exemplo n.º 23
0
        public bool Init(IAgUtPluginSite Ups)
        {
            try
            {
                Debug.WriteLine("--> Entered", this.m_Name + ".Init()");

                this.m_UPS = Ups;

                if (this.m_UPS != null)
                {
                    if (this.m_Enabled)
                    {
                        m_SPS = this.m_UPS as IAgStkPluginSite;

                        if (this.m_SPS != null)
                        {
                            this.m_CPP = this.m_SPS.VectorToolProvider;

                            if (this.m_CPP != null)
                            {
                                this.m_CCV = this.m_CPP.ConfigureVector(this.m_VectorName, "", "J2000", "CentralBody/Earth");
                            }

                            if (this.m_MsgStatus)
                            {
                                this.m_UPS.Message(AgEUtLogMsgType.eUtLogMsgDebug, this.m_Name + ".Init():");
                                this.m_UPS.Message(AgEUtLogMsgType.eUtLogMsgDebug, this.m_Name + ".Init(): AccelRefFrame( " + this.AccelRefFrame + " )");
                                this.m_UPS.Message(AgEUtLogMsgType.eUtLogMsgDebug, this.m_Name + ".Init(): AccelX( " + this.m_AccelX + " )");
                                this.m_UPS.Message(AgEUtLogMsgType.eUtLogMsgDebug, this.m_Name + ".Init(): AccelY( " + this.m_AccelY + " )");
                                this.m_UPS.Message(AgEUtLogMsgType.eUtLogMsgDebug, this.m_Name + ".Init(): AccelZ( " + this.m_AccelZ + " )");
                            }

                            if (this.m_CCV == null)
                            {
                                this.m_UPS.Message(AgEUtLogMsgType.eUtLogMsgDebug, this.m_Name + ".Init(): Could not obtain " + m_VectorName);
                                this.m_UPS.Message(AgEUtLogMsgType.eUtLogMsgDebug, this.m_Name + ".Init(): Turning off the computation of SRP Area");
                            }
                        }
                        else
                        {
                            this.m_UPS.Message(AgEUtLogMsgType.eUtLogMsgDebug, this.m_Name + ".Init(): Could not obtain IAgStkPluginSite from" + this.m_UPS.SiteName);
                            this.m_UPS.Message(AgEUtLogMsgType.eUtLogMsgDebug, this.m_Name + ".Init(): Turning off the computation of SRP Area");
                        }
                    }
                    else
                    {
                        if (this.m_MsgStatus)
                        {
                            this.m_UPS.Message(AgEUtLogMsgType.eUtLogMsgDebug, this.m_Name + ".Init(): Disabled");
                        }
                    }
                }
                else
                {
                    throw new Exception("UtPluginSite was null");
                }
            }
            catch (Exception ex)
            {
                this.m_Enabled = false;

                if (this.m_UPS != null)
                {
                    this.m_UPS.Message(AgEUtLogMsgType.eUtLogMsgAlarm, this.m_Name + ".Init(): Exception Message( " + ex.Message + " )");
                    this.m_UPS.Message(AgEUtLogMsgType.eUtLogMsgAlarm, this.m_Name + ".Init(): Exception StackTr( " + ex.StackTrace + " )");
                }
                Debug.WriteLine("Exception Message( " + ex.Message + " )", this.m_Name + ".Init()");
                Debug.WriteLine("Exception StackTr( " + ex.StackTrace + " )", this.m_Name + ".Init()");
            }
            finally
            {
                Debug.WriteLine("<-- Exited", this.m_Name + ".Init()");
            }

            return(this.m_Enabled);
        }
Exemplo n.º 24
0
        public bool Init(IAgUtPluginSite Site)
        {
            DebugMessage(AgEUtLogMsgType.eUtLogMsgDebug, "DragLiftExample:Init()");

            if (Site != null)
            {
                _AgUtPluginSite = Site;

                if (_Enabled)
                {
                    DebugMessage(AgEUtLogMsgType.eUtLogMsgInfo, "DragLiftExample:Init(): Enabled");
                }
                else
                {
                    DebugMessage(AgEUtLogMsgType.eUtLogMsgInfo, "DragLiftExample:Init(): Disabled because Enabled flag is False");
                }

                if (_Enabled)
                {
                    IAgCrdnPluginCalcProvider calcPrv = null;
                    IAgCrdnPluginProvider     vtPrv   = null;

                    IAgGatorPluginSite gatorSite = Site as IAgGatorPluginSite;

                    if (gatorSite != null)
                    {
                        calcPrv = gatorSite.CalcToolProvider;
                        vtPrv   = gatorSite.VectorToolProvider;
                    }
                    else
                    {
                        IAgStkPluginSite stkSite = Site as IAgStkPluginSite;

                        if (stkSite != null)
                        {
                            calcPrv = stkSite.CalcToolProvider;
                            vtPrv   = stkSite.VectorToolProvider;
                        }
                    }

                    if (calcPrv != null)
                    {
                        string CalcName   = "Orbit.Classical.TrueAnomaly";
                        string SourceName = ""; // "Satellite/RefSat"; // Can use <MySelf> (or "" which means <Myself>)

                        _trueAnomScalar = calcPrv.GetCalcScalar(CalcName, SourceName);

                        if (_trueAnomScalar == null)
                        {
                            Message(AgEUtLogMsgType.eUtLogMsgAlarm, "Cannot obtain TrueAnomaly CalcScalar");
                        }
                        else if (!_trueAnomScalar.IsConfigured)
                        {
                            Message(AgEUtLogMsgType.eUtLogMsgAlarm, "TrueAnomaly CalcScalar not configured for use");

                            _trueAnomScalar = null;
                        }
                        else
                        {
                            DebugMessage(AgEUtLogMsgType.eUtLogMsgInfo, "TrueAnomaly CalcScalar ready for use");
                        }
                    }
                    else
                    {
                        Message(AgEUtLogMsgType.eUtLogMsgAlarm, "Cannot obtain CalcToolProvider");
                    }

                    if (vtPrv != null)
                    {
                        string VectorName        = "Position";
                        string SourceName        = ""; // "Satellite/RefSat";     // Can use <MySelf> (or "" which means <Myself>)
                        string RefAxesName       = "Fixed";
                        string RefAxesSourceName = "CentralBody/Earth";

                        _posVec = vtPrv.ConfigureVector(VectorName, SourceName, RefAxesName, RefAxesSourceName);

                        if (_posVec == null)
                        {
                            Message(AgEUtLogMsgType.eUtLogMsgAlarm, "Cannot obtain Position vector");
                        }
                        else if (!_posVec.IsConfigured)
                        {
                            Message(AgEUtLogMsgType.eUtLogMsgAlarm, "Position vector not configured for use");

                            _posVec = null;
                        }
                        else
                        {
                            DebugMessage(AgEUtLogMsgType.eUtLogMsgInfo, "Position vector ready for use");
                        }
                    }
                    else
                    {
                        Message(AgEUtLogMsgType.eUtLogMsgAlarm, "Cannot obtain VectorToolProvider");
                    }
                }
            }
            else
            {
                Message(AgEUtLogMsgType.eUtLogMsgAlarm, "DragLiftExample:Init(): Forcing Disabled because Plugin Site was null!");

                _Enabled = false;
            }

            return(_Enabled);
        }
Exemplo n.º 25
0
        public bool Init(IAgUtPluginSite Site)
        {
            m_site = Site;

            return(true);
        }
Exemplo n.º 26
0
 public void Free()
 {
     m_site = null;
 }