本文整理汇总了C++中GmatBase::GetParameterText方法的典型用法代码示例。如果您正苦于以下问题:C++ GmatBase::GetParameterText方法的具体用法?C++ GmatBase::GetParameterText怎么用?C++ GmatBase::GetParameterText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GmatBase
的用法示例。
在下文中一共展示了GmatBase::GetParameterText方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MeasurementException
//------------------------------------------------------------------------------
const std::vector<RealArray>& USNTwoWayRange::CalculateMeasurementDerivatives(
GmatBase *obj, Integer id)
{
#ifdef DEBUG_DERIVATIVES
MessageInterface::ShowMessage("USNTwoWayRange::CalculateMeasurement"
"Derivatives(%s, %d) called\n", obj->GetName().c_str(), id);
#endif
if (!initialized)
InitializeMeasurement();
GmatBase *objPtr = NULL;
Integer size = obj->GetEstimationParameterSize(id);
Integer objNumber = -1;
#ifdef DEBUG_DERIVATIVES
MessageInterface::ShowMessage(" ParameterSize = %d\n", size);
#endif
if (size <= 0)
throw MeasurementException("The derivative parameter on derivative "
"object " + obj->GetName() + "is not recognized");
// Check to see if obj is a participant
for (UnsignedInt i = 0; i < participants.size(); ++i)
{
if (participants[i] == obj)
{
objPtr = participants[i];
objNumber = i + 1;
#ifdef DEBUG_DERIVATIVES
MessageInterface::ShowMessage(" Participant %s found\n",
objPtr->GetName().c_str());
#endif
break;
}
}
// Or if it is the measurement model for this object
if (obj->IsOfType(Gmat::MEASUREMENT_MODEL))
if (obj->GetRefObject(Gmat::CORE_MEASUREMENT, "") == this)
{
objPtr = obj;
objNumber = 0;
#ifdef DEBUG_DERIVATIVES
MessageInterface::ShowMessage(" The measurement is the object\n",
objPtr->GetName().c_str());
#endif
}
if (objNumber == -1)
throw MeasurementException(
"USNTwoWayRange error - object is neither participant nor "
"measurement model.");
RealArray oneRow;
oneRow.assign(size, 0.0);
currentDerivatives.clear();
currentDerivatives.push_back(oneRow);
Integer parameterID = GetParmIdFromEstID(id, obj);
#ifdef DEBUG_DERIVATIVES
MessageInterface::ShowMessage(" Looking up id %d\n", parameterID);
#endif
if (objPtr != NULL)
{
if (objNumber == 1) // participant number 1, either a GroundStation or a Spacecraft
{
#ifdef DEBUG_DERIVATIVES
MessageInterface::ShowMessage(" Deriv is w.r.t. %s of Participant"
" 1\n", objPtr->GetParameterText(parameterID).c_str());
#endif
if (objPtr->GetParameterText(parameterID) == "Position")
{
throw MeasurementException("Derivative w.r.t. " +
participants[0]->GetName() +" position is not yet implemented");
// CalculateRangeVectorInertial();
// Rvector3 tmp, result;
// Rvector3 rangeUnit = rangeVecInertial.GetUnitVector();
// #ifdef DEBUG_DERIVATIVES
// MessageInterface::ShowMessage(" RVInertial = %.12lf %.12lf %.12lf\n",
// rangeVecInertial[0], rangeVecInertial[1], rangeVecInertial[2]);
// MessageInterface::ShowMessage(" Unit RVInertial = %.12lf %.12lf %.12lf ",
// rangeUnit[0], rangeUnit[1], rangeUnit[2]);
// #endif
// if (stationParticipant)
// {
// for (UnsignedInt i = 0; i < 3; ++i)
// tmp[i] = - rangeUnit[i];
//
// // for a Ground Station, need to rotate to the F1 frame
// result = tmp * R_j2k_1;
// for (UnsignedInt jj = 0; jj < 3; jj++)
// currentDerivatives[0][jj] = result[jj];
// }
//.........这里部分代码省略.........