public void set_ManeuverParams(object MnvrObj, string name, double value) { IAgVAMCSManeuver thisMnvr = MnvrObj as IAgVAMCSManeuver; if (thisMnvr.ManeuverType == AgEVAManeuverType.eVAManeuverTypeImpulsive) { IAgVAManeuverImpulsive ImpMnvr = thisMnvr.Maneuver as IAgVAManeuverImpulsive; #region Type: Thrust Vector if (ImpMnvr.AttitudeControlType == AgEVAAttitudeControl.eVAAttitudeControlThrustVector) { IAgVAAttitudeControlImpulsiveThrustVector thisImpMnvr = ImpMnvr.AttitudeControl as IAgVAAttitudeControlImpulsiveThrustVector; IAgPosition DV_vectorObj = (thisImpMnvr.DeltaVVector as IAgPosition); Cartesian_Object DV_Vector = new Cartesian_Object(); DV_vectorObj.QueryCartesian(out DV_Vector.X, out DV_Vector.Y, out DV_Vector.Z); if (name == "Del-V (X: Velocity)") { DV_Vector.X = value; } else if (name == "Del-V (Y: Normal)") { DV_Vector.Y = value; } else if (name == "Del-V (Z: Co-Normal)") { DV_Vector.Z = value; } } #endregion #region Type: Along Velocity Vector else if (ImpMnvr.AttitudeControlType == AgEVAAttitudeControl.eVAAttitudeControlVelocityVector) { IAgVAAttitudeControlImpulsiveVelocityVector thisImpMnvr = ImpMnvr.AttitudeControl as IAgVAAttitudeControlImpulsiveVelocityVector; if (name == "Del-V Magnitude") { thisImpMnvr.DeltaVMagnitude = value; } } #endregion #region Type: Anti-Velocity Vector else if (ImpMnvr.AttitudeControlType == AgEVAAttitudeControl.eVAAttitudeControlAntiVelocityVector) { IAgVAAttitudeControlImpulsiveVelocityVector thisImpMnvr = ImpMnvr.AttitudeControl as IAgVAAttitudeControlImpulsiveVelocityVector; if (name == "Del-V Magnitude") { thisImpMnvr.DeltaVMagnitude = value; } } #endregion #region Type: Attitude else if (ImpMnvr.AttitudeControlType == AgEVAAttitudeControl.eVAAttitudeControlAttitude) { IAgVAAttitudeControlImpulsiveAttitude thisImpMnvr = ImpMnvr.AttitudeControl as IAgVAAttitudeControlImpulsiveAttitude; if (name == "Del-V Magnitude") { thisImpMnvr.DeltaVMagnitude = value; } EulerAng_Object MnvrEulAngs = new EulerAng_Object(); IAgOrientationEulerAngles angles = (IAgOrientationEulerAngles)thisImpMnvr.Orientation.ConvertTo(AgEOrientationType.eEulerAngles); MnvrEulAngs.Sequence = angles.Sequence; MnvrEulAngs.Phi_1 = double.Parse(angles.A.ToString(), System.Globalization.CultureInfo.InvariantCulture); MnvrEulAngs.Theta_2 = double.Parse(angles.A.ToString(), System.Globalization.CultureInfo.InvariantCulture); MnvrEulAngs.Psi_3 = double.Parse(angles.A.ToString(), System.Globalization.CultureInfo.InvariantCulture); //DeltaVParams.Add("Euler Angle Sequence", double.Parse(MnvrEulAngs.Sequence.ToString(), System.Globalization.CultureInfo.InvariantCulture)); l_unit.Add(units.u_Null); if (name == "Euler Angle 1 (Phi)") { MnvrEulAngs.Phi_1 = value; } else if (name == "Euler Angle 2 (Theta)") { MnvrEulAngs.Theta_2 = value; } else if (name == "Euler Angle 3 (Psi)") { MnvrEulAngs.Psi_3 = value; } } ; #endregion } }
//Impulsive public void get_ManeuverParams(IAgVAMCSSegment MnvrSegment, int depth, List <string> localParent) { depth++; IAgVAMCSManeuver thisMnvr = MnvrSegment as IAgVAMCSManeuver; #region List Header l_SegObj.Add(null); l_unit.Add(""); l_depth.Add(depth); l_isQuantity.Add(false); l_implemClass.Add(implem_Classes.NULL); #endregion if (thisMnvr.ManeuverType == AgEVAManeuverType.eVAManeuverTypeImpulsive) { IAgVAManeuverImpulsive ImpMnvr = thisMnvr.Maneuver as IAgVAManeuverImpulsive; #region Type: Thrust Vector if (ImpMnvr.AttitudeControlType == AgEVAAttitudeControl.eVAAttitudeControlThrustVector) { IAgVAAttitudeControlImpulsiveThrustVector thisImpMnvr = ImpMnvr.AttitudeControl as IAgVAAttitudeControlImpulsiveThrustVector; l_Names.Add("Impulsive: Thrust vector"); //Header name l_Values.Add(double.PositiveInfinity); l_types.Add(thisImpMnvr.ThrustAxesName); l_localParents.Add(localParent); IAgPosition DV_vectorObj = (thisImpMnvr.DeltaVVector as IAgPosition); Cartesian_Object DV_Vector = new Cartesian_Object(); DV_vectorObj.QueryCartesian(out DV_Vector.X, out DV_Vector.Y, out DV_Vector.Z); DeltaVParams.Add("Del-V (X: Velocity)", DV_Vector.X); l_unit.Add(units.u_Velocity); DeltaVParams.Add("Del-V (Y: Normal)", DV_Vector.Y); l_unit.Add(units.u_Velocity); DeltaVParams.Add("Del-V (Z: Co-Normal)", DV_Vector.Z); l_unit.Add(units.u_Velocity); update_Lists(DeltaVParams, depth, thisMnvr, implem_Classes.Astg_Mnvr_DV, localParent); } #endregion #region Type: Along Velocity Vector else if (ImpMnvr.AttitudeControlType == AgEVAAttitudeControl.eVAAttitudeControlVelocityVector) { IAgVAAttitudeControlImpulsiveVelocityVector thisImpMnvr = ImpMnvr.AttitudeControl as IAgVAAttitudeControlImpulsiveVelocityVector; l_Names.Add("Impulsive: Along Velocity Vector"); //Header name l_Values.Add(double.PositiveInfinity); l_types.Add(" "); l_localParents.Add(localParent); DeltaVParams.Add("Del-V Magnitude", thisImpMnvr.DeltaVMagnitude); l_unit.Add(units.u_Velocity); update_Lists(DeltaVParams, depth, thisMnvr, implem_Classes.Astg_Mnvr_DV, localParent); } #endregion #region Type: Anti-Velocity Vector else if (ImpMnvr.AttitudeControlType == AgEVAAttitudeControl.eVAAttitudeControlAntiVelocityVector) { IAgVAAttitudeControlImpulsiveVelocityVector thisImpMnvr = ImpMnvr.AttitudeControl as IAgVAAttitudeControlImpulsiveVelocityVector; l_Names.Add("Impulsive: Anti-Velocity Vector"); //Header name l_Values.Add(double.PositiveInfinity); l_types.Add(" "); l_localParents.Add(localParent); DeltaVParams.Add("Del-V Magnitude", thisImpMnvr.DeltaVMagnitude); l_unit.Add(units.u_Velocity); update_Lists(DeltaVParams, depth, thisMnvr, implem_Classes.Astg_Mnvr_DV, localParent); } #endregion #region Type: Attitude else if (ImpMnvr.AttitudeControlType == AgEVAAttitudeControl.eVAAttitudeControlAttitude) { IAgVAAttitudeControlImpulsiveAttitude thisImpMnvr = ImpMnvr.AttitudeControl as IAgVAAttitudeControlImpulsiveAttitude; l_Names.Add("Impulsive: Attitude"); //Header name l_Values.Add(double.PositiveInfinity); l_types.Add(thisImpMnvr.RefAxesName); l_localParents.Add(localParent); DeltaVParams.Add("Del-V Magnitude", thisImpMnvr.DeltaVMagnitude); l_unit.Add(units.u_Velocity); EulerAng_Object MnvrEulAngs = new EulerAng_Object(); IAgOrientationEulerAngles angles = (IAgOrientationEulerAngles)thisImpMnvr.Orientation.ConvertTo(AgEOrientationType.eEulerAngles); MnvrEulAngs.Sequence = angles.Sequence; MnvrEulAngs.Phi_1 = double.Parse(angles.A.ToString(), System.Globalization.CultureInfo.InvariantCulture); MnvrEulAngs.Theta_2 = double.Parse(angles.A.ToString(), System.Globalization.CultureInfo.InvariantCulture); MnvrEulAngs.Psi_3 = double.Parse(angles.A.ToString(), System.Globalization.CultureInfo.InvariantCulture); //DeltaVParams.Add("Euler Angle Sequence", double.Parse(MnvrEulAngs.Sequence.ToString(), System.Globalization.CultureInfo.InvariantCulture)); l_unit.Add(units.u_Null); DeltaVParams.Add("Euler Angle 1 (Phi)", MnvrEulAngs.Phi_1); l_unit.Add(units.u_Angle); DeltaVParams.Add("Euler Angle 2 (Theta)", MnvrEulAngs.Theta_2); l_unit.Add(units.u_Angle); DeltaVParams.Add("Euler Angle 3 (Psi)", MnvrEulAngs.Psi_3); l_unit.Add(units.u_Angle); update_Lists(DeltaVParams, depth, thisMnvr, implem_Classes.Astg_Mnvr_DV, localParent); } ; #endregion } }