public bool PostEvaluate(IAgAsHpopPluginResultPostEval ResultEval) { try { if (m_Enabled) { m_PostEvalCntr++; DebugMsg(m_PostEvalCntr, m_PostEvalMsgInterval, m_Name + ".PostEvaluate() called the " + m_PostEvalCntr + "th time"); } } 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); }
public bool PostEvaluate(IAgAsHpopPluginResultPostEval ResultEval) { try { if (this.m_MsgCntr % this.m_MsgInterval == 0) { Debug.WriteLine("--> Entered", this.m_Name + ".PostEvaluate( " + this.m_MsgCntr + " )"); } if (m_Enabled && m_DebugMode && ResultEval != null) { // get SRP acceleration from HPOP Tuple3 srpAccel = new Tuple3(0.0, 0.0, 0.0); ResultEval.GetAcceleration(AgEAccelType.eSRPAccel, AgEUtFrame.eUtFrameInertial, ref srpAccel.x, ref srpAccel.y, ref srpAccel.z); DebugMsg("HPOP computed Sunlight SRP = (" + srpAccel.x + ", " + srpAccel.y + ", " + srpAccel.z + ")"); srpAccel.scaleBy(-1.0); srpAccel.addTo(this.m_SunlightSRP); DebugMsg("Difference in Sunlight SRP = (" + srpAccel.x + ", " + srpAccel.y + ", " + srpAccel.z + ")"); double cr = ResultEval.Cr; double dragArea = ResultEval.DragArea; double solarFlux = ResultEval.SolarFlux; double illum = ResultEval.SolarIntensity; DebugMsg("Area = " + dragArea + ", Flux = " + solarFlux + ", Cr = " + cr + ", Mass = " + m_SpacecraftMass + ", Illum = " + illum); } else if (this.m_DebugMode) { this.m_UPS.Message(AgEUtLogMsgType.eUtLogMsgDebug, this.m_Name + ".PostEvaluate(): Disabled"); } } catch (Exception ex) { this.m_Enabled = false; Message(AgEUtLogMsgType.eUtLogMsgAlarm, this.m_Name + ".PostEvaluate(): Exception Message( " + ex.Message + " )"); Message(AgEUtLogMsgType.eUtLogMsgAlarm, this.m_Name + ".PostEvaluate(): Exception StackTr( " + ex.StackTrace + " )"); Debug.WriteLine("Exception Message( " + ex.Message + " )", this.m_Name + ".PostEvaluate()"); Debug.WriteLine("Exception StackTr( " + ex.StackTrace + " )", this.m_Name + ".PostEvaluate()"); } finally { if (this.m_MsgCntr % this.m_MsgInterval == 0) { Debug.WriteLine("<-- Exited", this.m_Name + ".PostEvaluate( " + this.m_MsgCntr + " )"); } } m_EvalMsgCount++; if (m_EvalMsgCount % m_EvalMsgMax == 0) { m_EvalMsgsOn = false; } return(this.m_Enabled); }
public bool PostEvaluate(IAgAsHpopPluginResultPostEval ResultEval) { try { if (this.m_PostEvalCntr % this.m_PostEvalMsgInterval == 0) { Debug.WriteLine("--> Entered", this.m_Name + ".PostEvaluate( " + this.m_PostEvalCntr + " )"); } this.m_PostEvalCntr++; if (this.m_UPS != null) { if (this.m_Enabled) { if (this.m_MsgStatus) { if (this.m_PostEvalCntr % this.m_PostEvalMsgInterval == 0) { AgEUtFrame reportFrame = AgEUtFrame.eUtFrameNTC; string frameName = "NTC"; AgEAccelType accelType = AgEAccelType.eSRPAccel; double srpX = 0.0, srpY = 0.0, srpZ = 0.0, AltInKm; AltInKm = ResultEval.Altitude * 0.001; this.m_UPS.Message(AgEUtLogMsgType.eUtLogMsgDebug, this.m_Name + ".PostEvaluate( " + this.m_PostEvalCntr + " ): SRPArea (" + ResultEval.SRPArea + " m^2), Altitude (" + AltInKm + " km)"); ResultEval.GetAcceleration(accelType, reportFrame, ref srpX, ref srpY, ref srpZ); this.m_UPS.Message(AgEUtLogMsgType.eUtLogMsgDebug, this.m_Name + ".PostEvaluate( " + this.m_PostEvalCntr + " ): SRPAccel (" + frameName + ") is (" + srpX + ", " + srpY + ", " + srpZ + ") meters/secs^2"); // report out the added acceleration in NTC components double thrustX = 0.0, thrustY = 0.0, thrustZ = 0.0; accelType = AgEAccelType.eAddedAccel; ResultEval.GetAcceleration(accelType, reportFrame, ref thrustX, ref thrustY, ref thrustZ); this.m_UPS.Message(AgEUtLogMsgType.eUtLogMsgDebug, this.m_Name + ".PostEvaluate( " + this.m_PostEvalCntr + " ): ThrustAccel (" + frameName + ") is (" + thrustX + ", " + thrustY + ", " + thrustZ + ") meters/secs^2"); } } } else { if (this.m_MsgStatus) { this.m_UPS.Message(AgEUtLogMsgType.eUtLogMsgDebug, this.m_Name + ".PostEvaluate(): 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 + ".PostEvaluate(): Exception Message( " + ex.Message + " )"); this.m_UPS.Message(AgEUtLogMsgType.eUtLogMsgAlarm, this.m_Name + ".PostEvaluate(): Exception StackTr( " + ex.StackTrace + " )"); } Debug.WriteLine("Exception Message( " + ex.Message + " )", this.m_Name + ".PostEvaluate()"); Debug.WriteLine("Exception StackTr( " + ex.StackTrace + " )", this.m_Name + ".PostEvaluate()"); } finally { if (this.m_PostEvalCntr % this.m_PostEvalMsgInterval == 0) { Debug.WriteLine("<-- Exited", this.m_Name + ".PostEvaluate( " + this.m_PostEvalCntr + " )"); } } return(this.m_Enabled); }