本文整理汇总了C++中GmatBase::IsOfType方法的典型用法代码示例。如果您正苦于以下问题:C++ GmatBase::IsOfType方法的具体用法?C++ GmatBase::IsOfType怎么用?C++ GmatBase::IsOfType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GmatBase
的用法示例。
在下文中一共展示了GmatBase::IsOfType方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BuildUnusedGlobalObjectList
//------------------------------------------------------------------------------
void GmatFunction::BuildUnusedGlobalObjectList()
{
#ifdef DEBUG_UNUSED_GOL
MessageInterface::ShowMessage
(wxT("BuildUnusedGlobalObjectList() entered. There are %d global objects\n"),
globalObjectStore->size());
#endif
if (unusedGlobalObjectList != NULL)
delete unusedGlobalObjectList;
unusedGlobalObjectList = new StringArray;
// Check global object store
wxString cmdUsed;
std::map<wxString, GmatBase *>::iterator omi;
for (omi = globalObjectStore->begin(); omi != globalObjectStore->end(); ++omi)
{
GmatBase *obj = omi->second;
if (!GmatCommandUtil::FindObject(fcs, (omi->second)->GetType(), omi->first,
cmdUsed))
{
// Add unused global CoordinateSystem with Spacecraft origin, primary,
// or secondary, since Spacecraft is not an automatic global object and
// we don't want to throw an exception for unexisting Spacecraft in the GOS.
if (obj->IsOfType(Gmat::COORDINATE_SYSTEM))
{
GmatBase *origin = obj->GetRefObject(Gmat::SPACE_POINT, wxT("_GFOrigin_"));
GmatBase *primary = obj->GetRefObject(Gmat::SPACE_POINT, wxT("_GFPrimary_"));
GmatBase *secondary = obj->GetRefObject(Gmat::SPACE_POINT, wxT("_GFSecondary_"));
if ((origin != NULL && origin->IsOfType(Gmat::SPACECRAFT)) ||
(primary != NULL && primary->IsOfType(Gmat::SPACECRAFT)) ||
(secondary != NULL && secondary->IsOfType(Gmat::SPACECRAFT)))
{
#ifdef DEBUG_UNUSED_GOL
MessageInterface::ShowMessage
(wxT("==> Adding '%s' to unusedGOL\n"), (omi->first).c_str());
#endif
unusedGlobalObjectList->push_back(omi->first);
}
}
}
}
#ifdef DEBUG_UNUSED_GOL
MessageInterface::ShowMessage
(wxT("BuildUnusedGlobalObjectList() leaving, There are %d unused global objects\n"),
unusedGlobalObjectList->size());
#endif
}
示例2: Initialize
//------------------------------------------------------------------------------
bool EndFiniteBurn::Initialize()
{
bool retval = GmatCommand::Initialize();
GmatBase *mapObj;
if (retval)
{
// Look up the maneuver object
if ((mapObj = FindObject(burnName)) == NULL)
throw CommandException("EndFiniteBurn: Unknown finite burn \"" +
burnName + "\"");
if (mapObj->IsOfType("FiniteBurn") == false)
throw CommandException("EndFiniteBurn: " + (burnName) + " is not a "
"FiniteBurn");
maneuver = (FiniteBurn*)mapObj;
// Find all of the spacecraft
StringArray::iterator scName;
Spacecraft *sc;
sats.clear();
for (scName = satNames.begin(); scName != satNames.end(); ++scName)
{
if ((mapObj = FindObject(*scName)) == NULL)
throw CommandException("EndFiniteBurn: Unknown SpaceObject \"" +
(*scName) + "\"");
if (mapObj->IsOfType(Gmat::SPACECRAFT) == false)
throw CommandException("EndFiniteBurn: " + (*scName) +
" is not a Spacecraft");
sc = (Spacecraft*)mapObj;
sats.push_back(sc);
}
}
thrustName = burnName + "_FiniteThrust";
#ifdef DEBUG_END_MANEUVER
MessageInterface::ShowMessage
("EndFiniteBurn initialized with thrust force named \"%s\"\n",
thrustName.c_str());
#endif
return isInitialized;
}
示例3: while
//------------------------------------------------------------------------------
PropSetup *GetFirstPropagator(GmatCommand *cmd)
{
static PropSetup *retval = NULL;
GmatCommand *current = cmd;
#ifdef DEBUG_ODE_SEARCH
extraMsg = "Commands checked:\n";
#endif
while (current != NULL)
{
#ifdef DEBUG_ODE_SEARCH
extraMsg += " '" + current->GetTypeName() + "'\n";
#endif
if (current->GetTypeName() == "Propagate")
{
try
{
// Set all of the internal connections
// current->TakeAction("PrepareToPropagate");
current->Execute();
}
catch (BaseException &ex)
{
lastMsg = ex.GetFullMessage();
}
#ifdef DEBUG_ODE_SEARCH
extraMsg += " Checking in this command\n";
#endif
GmatBase *obj = current->GetRefObject(Gmat::PROP_SETUP, "", 0);
#ifdef DEBUG_ODE_SEARCH
if (obj != NULL)
extraMsg += " Found an object of type PROPSETUP\n";
else
extraMsg += " Propagate command returns NULL PROPSETUP\n";
#endif
if (obj->IsOfType("PropSetup"))
{
retval = (PropSetup*)(obj);
break;
}
}
current = current->GetNext();
}
return retval;
}
示例4: Initialize
//------------------------------------------------------------------------------
bool Set::Initialize()
{
bool retval = GmatCommand::Initialize();
target = FindObject(targetName);
if (target == NULL)
throw CommandException("The Set command could not find the target "
"object \"" + targetName + "\" needed to initialize");
GmatBase *obj = FindObject(interfaceName);
if (obj == NULL)
throw CommandException("The Set command could not find the interface "
"object \"" + interfaceName + "\" needed to initialize");
if (obj->IsOfType("DataInterface"))
theInterface = (DataInterface*)obj;
else
throw CommandException("The object \"" + interfaceName +
"\" is not a FileInterface object.");
// If specific data elements are requested, warn if not in the reader
if (!loadAll)
{
StringArray allKeywords =
theInterface->GetStringArrayParameter("SupportedFields");
for (UnsignedInt i = 0; i < selections.size(); ++i)
if (find(allKeywords.begin(), allKeywords.end(), selections[i]) ==
allKeywords.end())
MessageInterface::ShowMessage("*** Warning ***: The data keyword "
"\"%s\" is not a recognized keyword in the data reader "
"\"tvhf\" on the line:\n%s\n", selections[i].c_str(),
generatingString.c_str());
}
return retval;
}
示例5: CalculateRotationMatrix
//------------------------------------------------------------------------------
void TopocentricAxes::CalculateRotationMatrix(const A1Mjd &atEpoch,
bool forceComputation)
{
// Check to make sure that the central body is a celestial body
itsBodyName = bfPoint->GetStringParameter("CentralBody");
#ifdef DEBUG_TOPOCENTRIC_AXES
MessageInterface::ShowMessage("Origin's central body is %s\n",
itsBodyName.c_str());
#endif
GmatBase *bodyPtr = bfPoint->GetRefObject(Gmat::CELESTIAL_BODY, itsBodyName);
if (!bodyPtr)
{
std::string errMsg = "Central Body for a BodyFixedPoint used in a ";
errMsg += " Topocentric Coordinate System is NULL";
throw CoordinateSystemException(errMsg);
}
if (!(bodyPtr->IsOfType("CelestialBody")))
{
std::string errMsg = "Central Body for a BodyFixedPoint used in a ";
errMsg += " Topocentric Coordinate System must be a Celestial Body";
throw CoordinateSystemException(errMsg);
}
centralBody = (CelestialBody*) bodyPtr;
flattening = centralBody->GetFlattening();
radius = centralBody->GetEquatorialRadius();
bfcs = bfPoint->GetBodyFixedCoordinateSystem();
horizonReference = bfPoint->GetStringParameter("HorizonReference");
if ((horizonReference != "Sphere") && (horizonReference != "Ellipsoid"))
{
std::string errMsg = "Unexpected horizon reference \"";
errMsg += horizonReference + "\" received from BodyFixedPoint \"";
errMsg += bfPoint->GetName() + "\"";
throw CoordinateSystemException(errMsg);
}
// compute rotMatrix and rotDotMatrix
// First, calculate the Rft matrix, if the position has changed
Rvector3 newLoc = bfPoint->GetBodyFixedLocation(atEpoch);
#ifdef DEBUG_TOPOCENTRIC_AXES
MessageInterface::ShowMessage("horizon reference is %s:\n",
horizonReference.c_str());
MessageInterface::ShowMessage("flattening of %s is %12.17f:\n",
itsBodyName.c_str(), flattening);
MessageInterface::ShowMessage("equatorial radius of %s is %12.17f:\n\n",
itsBodyName.c_str(), radius);
MessageInterface::ShowMessage("bfPoint's old location is:\n");
MessageInterface::ShowMessage("%12.17f\n", bfLocation[0]);
MessageInterface::ShowMessage("%12.17f\n", bfLocation[1]);
MessageInterface::ShowMessage("%12.17f\n", bfLocation[2]);
MessageInterface::ShowMessage("bfPoint's new location is:\n");
MessageInterface::ShowMessage("%12.17f\n", newLoc[0]);
MessageInterface::ShowMessage("%12.17f\n", newLoc[1]);
MessageInterface::ShowMessage("%12.17f\n", newLoc[2]);
#endif
if (newLoc != bfLocation)
CalculateRFT(atEpoch, newLoc);
// save the location
bfLocation = newLoc;
#ifdef DEBUG_TOPOCENTRIC_AXES
MessageInterface::ShowMessage("Now bfLocation is set to:\n");
MessageInterface::ShowMessage("%12.17f\n", bfLocation[0]);
MessageInterface::ShowMessage("%12.17f\n", bfLocation[1]);
MessageInterface::ShowMessage("%12.17f\n", bfLocation[2]);
#endif
// Determine rotation matrix from body-fixed to inertial
Rvector bogusIn(6,7000.0,1000.0,6000.0, 0.0, 0.0, 0.0);
Rvector bogusOut = bfcs->ToBaseSystem(atEpoch, bogusIn); // @todo - need ToMJ2000Eq here?
#ifdef DEBUG_TOPOCENTRIC_AXES
MessageInterface::ShowMessage("bogusIn:\n");
MessageInterface::ShowMessage("%12.17f\n", bogusIn[0]);
MessageInterface::ShowMessage("%12.17f\n", bogusIn[1]);
MessageInterface::ShowMessage("%12.17f\n", bogusIn[2]);
MessageInterface::ShowMessage("%12.17f\n", bogusIn[3]);
MessageInterface::ShowMessage("%12.17f\n", bogusIn[4]);
MessageInterface::ShowMessage("%12.17f\n", bogusIn[5]);
MessageInterface::ShowMessage("bogusOut:\n");
MessageInterface::ShowMessage("%12.17f\n", bogusOut[0]);
MessageInterface::ShowMessage("%12.17f\n", bogusOut[1]);
MessageInterface::ShowMessage("%12.17f\n", bogusOut[2]);
MessageInterface::ShowMessage("%12.17f\n", bogusOut[3]);
MessageInterface::ShowMessage("%12.17f\n", bogusOut[4]);
MessageInterface::ShowMessage("%12.17f\n", bogusOut[5]);
#endif
Rmatrix33 RIF = bfcs->GetLastRotationMatrix();
Rmatrix33 RIFDot = bfcs->GetLastRotationDotMatrix();
#ifdef DEBUG_TOPOCENTRIC_AXES
MessageInterface::ShowMessage("last Rotation Matrix (RIF):\n");
MessageInterface::ShowMessage("%12.17f %12.17f %12.17f \n",
RIF(0,0), RIF(0,1), RIF(0,2));
MessageInterface::ShowMessage("%12.17f %12.17f %12.17f \n",
RIF(1,0), RIF(1,1), RIF(1,2));
MessageInterface::ShowMessage("%12.17f %12.17f %12.17f \n",
RIF(2,0), RIF(2,1), RIF(2,2));
MessageInterface::ShowMessage("last Rotation Dot Matrix (RIFDot):\n");
MessageInterface::ShowMessage("%12.17f %12.17f %12.17f \n",
RIFDot(0,0), RIFDot(0,1), RIFDot(0,2));
MessageInterface::ShowMessage("%12.17f %12.17f %12.17f \n",
RIFDot(1,0), RIFDot(1,1), RIFDot(1,2));
//.........这里部分代码省略.........
示例6: Initialize
//------------------------------------------------------------------------------
bool RunSimulator::Initialize()
{
bool retval = false;
// First set the simulator object
if (solverName == "")
throw CommandException("Cannot initialize RunSimulator command -- the "
"simulator name is not specified.");
// Clear the old clone if it was set
if (theSimulator != NULL)
delete theSimulator;
GmatBase *simObj = FindObject(solverName);
if (simObj == NULL)
throw CommandException("Cannot initialize RunSimulator command -- the "
"simulator named " + solverName + " cannot be found.");
if (!simObj->IsOfType("Simulator"))
throw CommandException("Cannot initialize RunSimulator command -- the "
"object named " + solverName + " is not a simulator.");
theSimulator = (Simulator*)(simObj->Clone());
// Set the streams for the measurement manager
MeasurementManager *measman = theSimulator->GetMeasurementManager();
StringArray streamList = measman->GetStreamList();
for (UnsignedInt ms = 0; ms < streamList.size(); ++ms)
{
GmatBase *obj = FindObject(streamList[ms]);
if (obj != NULL)
{
if (obj->IsOfType(Gmat::DATASTREAM))
{
DataFile *df = (DataFile*)obj;
measman->SetStreamObject(df);
}
}
else
throw CommandException("Did not find the object named " +
streamList[ms]);
}
// Find the event manager and store its pointer
if (triggerManagers == NULL)
throw CommandException("The Event Manager pointer was not set on the "
"RunSimulator command");
for (UnsignedInt i = 0; i < triggerManagers->size(); ++i)
{
#ifdef DEBUG_INITIALIZATION
MessageInterface::ShowMessage("RunSimulator has an TriggerManager of "
"type %s, id %d\n",
(*triggerManagers)[i]->GetTriggerTypeString().c_str(),
(*triggerManagers)[i]->GetTriggerType());
#endif
if ((*triggerManagers)[i]->GetTriggerType() == Gmat::EVENT)
{
eventMan = (EventManager*)(*triggerManagers)[i];
#ifdef DEBUG_INITIALIZATION
MessageInterface::ShowMessage("RunSimulator has an EventManager of "
"type %s\n", eventMan->GetTriggerTypeString().c_str());
#endif
}
}
if (eventMan == NULL)
throw CommandException("The EventManager pointer was not set on the "
"RunSimulator command");
// Next comes the propagator
PropSetup *obj = theSimulator->GetPropagator();
#ifdef DEBUG_INITIALIZATION
MessageInterface::ShowMessage("Propagator at address %p ", obj);
if (obj != NULL)
MessageInterface::ShowMessage("is named %s\n",
obj->GetName().c_str());
else
MessageInterface::ShowMessage("is not yet set\n");
#endif
if (obj != NULL)
{
if (obj->IsOfType(Gmat::PROP_SETUP))
{
PropSetup *ps = (PropSetup*)obj->Clone();
// RunSimulator only manages one PropSetup. If that changes, so
// does this code
if (propagators.size() > 0)
{
for (std::vector<PropSetup*>::iterator pp = propagators.begin();
pp != propagators.end(); ++pp)
{
delete (*pp);
}
propagators.clear();
p.clear();
fm.clear();
//.........这里部分代码省略.........
示例7: SaveChildPositionAndSize
//------------------------------------------------------------------------------
// void SaveChildPositionAndSize()
//------------------------------------------------------------------------------
void GmatMdiChildFrame::SaveChildPositionAndSize()
{
if (mCanSaveLocation == false)
return;
if (IsIconized())
return;
// Get the position and size of the window first
#ifdef __WXMAC__
Integer screenWidth = wxSystemSettings::GetMetric(wxSYS_SCREEN_X);
Integer screenHeight = wxSystemSettings::GetMetric(wxSYS_SCREEN_Y);
#else
Integer screenWidth;
Integer screenHeight;
GmatAppData::Instance()->GetMainFrame()->GetActualClientSize(&screenWidth, &screenHeight, true);
// Since GmatMainFrame::GetActualClientSize() subtracts one, add one here (LOJ: 2012.07.23)
screenWidth++;
screenHeight++;
#endif
bool isMinimized = IsIconized(), isMaximized = IsMaximized();
if (isMinimized)
Iconize(false);
else if (isMaximized)
Maximize(false);
int tmpX = -1, tmpY = -1;
int tmpW = -1, tmpH = -1;
GetPosition(&tmpX, &tmpY);
GetSize(&tmpW, &tmpH);
Rvector upperLeft(2, ((Real) tmpX /(Real) screenWidth), ((Real) tmpY /(Real) screenHeight));
Rvector childSize(2, ((Real) tmpW /(Real) screenWidth), ((Real) tmpH /(Real) screenHeight));
if (isMinimized)
Iconize();
else if (isMaximized)
Maximize();
#ifdef DEBUG_PERSISTENCE
// ======================= begin temporary ==============================
MessageInterface::ShowMessage("*** Size of SCREEN %s is: width = %d, height = %d\n",
mChildName.WX_TO_C_STRING, screenWidth, screenHeight);
MessageInterface::ShowMessage("Position of View plot %s is: x = %d, y = %d\n",
mChildName.WX_TO_C_STRING, tmpX, tmpY);
MessageInterface::ShowMessage("Size of View plot %s is: width = %d, height = %d\n",
mChildName.WX_TO_C_STRING, tmpW, tmpH);
// ======================= end temporary ==============================
#endif
if ((mItemType == GmatTree::OUTPUT_REPORT) ||
(mItemType == GmatTree::OUTPUT_CCSDS_OEM_FILE ) ||
(mItemType == GmatTree::OUTPUT_ORBIT_VIEW) ||
(mItemType == GmatTree::OUTPUT_XY_PLOT) ||
(mItemType == GmatTree::OUTPUT_GROUND_TRACK_PLOT)
// We'll want to add the event reports eventually, but they are not subscriber based
//|| (mItemType == GmatTree::EVENT_REPORT)
)
{
GmatBase *obj = theGuiInterpreter->GetConfiguredObject(mChildName.c_str());
#ifdef DEBUG_FUNCTION
// Check if child name is the configured object name
MessageInterface::ShowMessage
("GmatMdiChildFrame::SaveChildPositionAndSize() the child '%s' %s a "
"configured object, obj = <%p>[%s]'%s'\n", mChildName.WX_TO_C_STRING,
obj ? "is" : "is not", obj, obj ? obj->GetTypeName().c_str() : "NULL",
obj ? obj->GetName().c_str() : "NULL");
#endif
if (!obj)
{
// Just return if child is not a configured subscriber,ie,
// plotting from GMAT function (LOJ: 2015.06.26)
#ifdef DEBUG_FUNCTION
MessageInterface::ShowMessage
("**** WARNING **** GmatMdiChildFrame::SaveChildPositionAndSize() "
"will not save position and size for unconfigured subscriber '%s'\n",
mChildName.WX_TO_C_STRING);
#endif
return;
}
else if (!obj->IsOfType("Subscriber"))
{
#ifdef DEBUG_PERSISTENCE
MessageInterface::ShowMessage
("**** WARNING **** GmatMdiChildFrame::SaveChildPositionAndSize() "
"cannot not save position and size for non-subscriber '%s'\n",
mChildName.WX_TO_C_STRING);
#endif
SubscriberException se;
se.SetDetails("Cannot set position and size for non-subscriber '%s'");
throw se;
}
Subscriber *sub = (Subscriber*) obj;
//.........这里部分代码省略.........
示例8: SaveChildPositionAndSize
//------------------------------------------------------------------------------
// void SaveChildPositionAndSize()
//------------------------------------------------------------------------------
void GmatMdiChildFrame::SaveChildPositionAndSize()
{
if (mCanSaveLocation == false)
return;
// Get the position and size of the window first
#ifdef __WXMAC__
Integer screenWidth = wxSystemSettings::GetMetric(wxSYS_SCREEN_X);
Integer screenHeight = wxSystemSettings::GetMetric(wxSYS_SCREEN_Y);
#else
Integer screenWidth;
Integer screenHeight;
//theParent->GetClientSize(&screenWidth, &screenHeight);
GmatAppData::Instance()->GetMainFrame()->GetActualClientSize(&screenWidth, &screenHeight, true);
#endif
// #ifdef DEBUG_PERSISTENCE
// wxRect wxR = GetScreenRect();
// wxPoint wxP = wxR.GetPosition();
// wxSize wxS = wxR.GetSize();
// Integer x = (Integer) wxP.x;
// Integer y = (Integer) wxP.y;
// Integer w = (Integer) wxS.GetWidth();
// Integer h = (Integer) wxS.GetHeight();
// MessageInterface::ShowMessage
// (wxT("wxP.x = %d, wxP.y = %d, wxS.w = %d, wxS.h = %d\n"), x, y, w, h);
// #endif
int tmpX = -1, tmpY = -1;
int tmpW = -1, tmpH = -1;
GetPosition(&tmpX, &tmpY);
GetSize(&tmpW, &tmpH);
Rvector upperLeft(2, ((Real) tmpX /(Real) screenWidth), ((Real) tmpY /(Real) screenHeight));
Rvector childSize(2, ((Real) tmpW /(Real) screenWidth), ((Real) tmpH /(Real) screenHeight));
#ifdef DEBUG_PERSISTENCE
// ======================= begin temporary ==============================
MessageInterface::ShowMessage(wxT("*** Size of SCREEN %s is: width = %d, height = %d\n"), mPlotName.c_str(), screenWidth, screenHeight);
MessageInterface::ShowMessage(wxT("Position of View plot %s is: x = %d, y = %d\n"), mPlotName.c_str(), tmpX, tmpY);
MessageInterface::ShowMessage(wxT("Size of View plot %s is: width = %d, height = %d\n"), mPlotName.c_str(), tmpW, tmpH);
// MessageInterface::ShowMessage(wxT("Position of View plot %s in pixels rel. to parent window is: x = %d, y = %d\n"),
// mPlotName.c_str(), (Integer) tmpX, (Integer) tmpY);
// MessageInterface::ShowMessage(wxT("Size of View plot %s in pixels rel. to parent window is: x = %d, y = %d\n"),
// mPlotName.c_str(), (Integer) tmpW, (Integer) tmpH);
// wxPoint tmpPt = ScreenToClient(wxP);
// MessageInterface::ShowMessage(wxT("--- Position of View plot %s in client coords is: x = %d, y = %d\n"),
// mPlotName.c_str(), (Integer) tmpPt.x, (Integer) tmpPt.y);
// ======================= end temporary ==============================
#endif
if ((mItemType == GmatTree::OUTPUT_REPORT) || (mItemType == GmatTree::OUTPUT_ORBIT_VIEW) ||
(mItemType == GmatTree::OUTPUT_XY_PLOT) || (mItemType == GmatTree::OUTPUT_GROUND_TRACK_PLOT)
// We'll want to add the event reports eventually, but they are not subscriber based
//|| (mItemType == GmatTree::EVENT_REPORT)
)
{
GmatBase *obj =
(Subscriber*)theGuiInterpreter->GetConfiguredObject(mPlotName.c_str());
if (!obj || !obj->IsOfType(wxT("Subscriber")))
{
wxString errmsg = wxT("Cannot find subscriber ");
errmsg += mPlotName + wxT("\n");
throw SubscriberException(errmsg);
}
Subscriber *sub = (Subscriber*) obj;
#ifdef DEBUG_PERSISTENCE
MessageInterface::ShowMessage("...... Now saving plot data to %s:\n", (sub->GetName()).c_str());
MessageInterface::ShowMessage(" Upper left = %12.10f %12.10f\n", upperLeft[0], upperLeft[1]);
MessageInterface::ShowMessage(" Size = %12.10f %12.10f\n", childSize[0], childSize[1]);
MessageInterface::ShowMessage(" RelativeZOrder = %d\n", relativeZOrder);
#endif
sub->SetRvectorParameter(sub->GetParameterID(wxT("UpperLeft")), upperLeft);
sub->SetRvectorParameter(sub->GetParameterID(wxT("Size")), childSize);
sub->SetIntegerParameter(sub->GetParameterID(wxT("RelativeZOrder")), relativeZOrder);
}
else if (mItemType == GmatTree::MISSION_TREE_UNDOCKED)
{
// get the config object
wxFileConfig *pConfig;
pConfig = (wxFileConfig *) GmatAppData::Instance()->GetPersonalizationConfig();
wxString location;
location << upperLeft[0] << wxT(" ") << upperLeft[1];
wxString size;
size << childSize[0] << wxT(" ") << childSize[1];
pConfig->Write(wxT("/MissionTree/UpperLeft"), location.c_str());
pConfig->Write(wxT("/MissionTree/Size"), size.c_str());
}
}
示例9: catch
//------------------------------------------------------------------------------
PropSetup *GetPropagator(GmatCommand **cmd)
{
PropSetup *retval = NULL;
static Integer setupIndex = 0;
if ((*cmd) != NULL)
{
bool findNextPropagate = false;
std::string currentType = (*cmd)->GetTypeName();
if ((currentType == "Propagate") && (setupIndex > 0))
{
try
{
if ((*cmd)->GetRefObject(Gmat::PROP_SETUP, "", setupIndex) == NULL)
{
findNextPropagate = true;
(*cmd) = (*cmd)->GetNext();
setupIndex = 0;
}
}
catch (BaseException &)
{
findNextPropagate = true;
(*cmd) = (*cmd)->GetNext();
}
}
else
findNextPropagate = true;
if (findNextPropagate)
{
// Find the next propagate command
setupIndex = 0;
if ((*cmd) != NULL)
{
while ((*cmd)->GetTypeName() != "Propagate")
{
(*cmd) = (*cmd)->GetNext();
if ((*cmd) == NULL)
break;
}
}
}
if ((*cmd) != NULL)
{
#ifdef DEBUG_INTERFACE_FROM_MATLAB
fprintf(fp, "Current <%p>: %s; SetupIndex %d\n", (*cmd),
(*cmd)->GetGeneratingString(Gmat::NO_COMMENTS).c_str(),
setupIndex);
#endif
GmatBase *obj = NULL;
try
{
if (setupIndex == 0)
{
try
{
// Set all of the internal connections
// current->TakeAction("PrepareToPropagate");
(*cmd)->Execute();
}
catch (BaseException &ex)
{
lastMsg = ex.GetFullMessage();
}
}
obj = (*cmd)->GetRefObject(Gmat::PROP_SETUP, "", setupIndex);
}
catch (BaseException *)
{
obj = NULL;
}
if (obj == NULL)
{
(*cmd) = (*cmd)->GetNext();
#ifdef DEBUG_INTERFACE_FROM_MATLAB
fprintf(fp, "obj was NULL; new command is <%p>: %s\n", (*cmd),
(*cmd)->GetGeneratingString(Gmat::NO_COMMENTS).c_str());
#endif
setupIndex = 0;
}
else
{
if (obj->IsOfType(Gmat::PROP_SETUP))
retval = (PropSetup*)obj;
++setupIndex;
}
}
}
return retval;
}