本文整理汇总了C++中GmatCommand::NeedsServerStartup方法的典型用法代码示例。如果您正苦于以下问题:C++ GmatCommand::NeedsServerStartup方法的具体用法?C++ GmatCommand::NeedsServerStartup怎么用?C++ GmatCommand::NeedsServerStartup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GmatCommand
的用法示例。
在下文中一共展示了GmatCommand::NeedsServerStartup方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Initialize
//.........这里部分代码省略.........
while (current)
{
#ifdef DEBUG_FUNCTION_INIT
if (!current) MessageInterface::ShowMessage(wxT("Current is NULL!!!\n"));
else MessageInterface::ShowMessage(wxT(" =====> Current command is %s <%s>\n"),
(current->GetTypeName()).c_str(),
current->GetGeneratingString(Gmat::NO_COMMENTS).c_str());
#endif
current->SetObjectMap(objectStore);
current->SetGlobalObjectMap(globalObjectStore);
current->SetSolarSystem(solarSys);
current->SetInternalCoordSystem(internalCoordSys);
current->SetTransientForces(forces);
#ifdef DEBUG_FUNCTION_INIT
MessageInterface::ShowMessage
(wxT(" Now about to set object map of type %s to Validator\n"),
(current->GetTypeName()).c_str());
#endif
// (Re)set object map on Validator (necessary because objects may have been added to the
// Local Object Store or Global Object Store during initialization of previous commands)
validatorStore.clear();
for (omi = objectStore->begin(); omi != objectStore->end(); ++omi)
validatorStore.insert(std::make_pair(omi->first, omi->second));
for (omi = globalObjectStore->begin(); omi != globalObjectStore->end(); ++omi)
validatorStore.insert(std::make_pair(omi->first, omi->second));
validator->SetObjectMap(&validatorStore);
#ifdef DEBUG_FUNCTION_INIT
MessageInterface::ShowMessage
(wxT(" Now about to call Validator->ValidateCommand() of type %s\n"),
current->GetTypeName().c_str());
#endif
// Let's try to ValidateCommand here, this will validate the command
// and create wrappers also
if (!validator->ValidateCommand(current, false, 2))
{
// get error message (loj: 2008.06.04)
StringArray errList = validator->GetErrorList();
wxString msg; // Check for empty errList (loj: 2009.03.17)
if (errList.empty())
msg = wxT("Error occurred");
else
msg = errList[0];
throw FunctionException(msg + wxT(" in the function \"") + functionPath + wxT("\""));
}
#ifdef DEBUG_FUNCTION_INIT
MessageInterface::ShowMessage
(wxT(" Now about to initialize command of type %s\n"), current->GetTypeName().c_str());
#endif
// catch exception and add function name to message (loj: 2008.09.23)
try
{
if (!(current->Initialize()))
{
#ifdef DEBUG_FUNCTION_INIT
MessageInterface::ShowMessage
(wxT("Exiting GmatFunction::Initialize for function '%s' with false\n"),
functionName.c_str());
#endif
return false;
}
}
catch (BaseException &e)
{
throw FunctionException(wxT("Cannot continue due to ") + e.GetFullMessage() +
wxT(" in the function \"") + functionPath + wxT("\""));
}
// Check to see if the command needs a server startup (loj: 2008.07.25)
if (current->NeedsServerStartup())
if (validator->StartMatlabServer(current) == false)
throw FunctionException(wxT("Unable to start the server needed by the ") +
(current->GetTypeName()) + wxT(" command"));
current = current->GetNext();
}
// Get automatic global object list and check if they are used in the function
// command sequence so that when any global object is declared in the main script
// but not used in the function, they can be ignored during function local object
// initialization. (LOJ: 2009.12.18)
BuildUnusedGlobalObjectList();
fcsFinalized = false;
#ifdef DEBUG_FUNCTION_INIT
MessageInterface::ShowMessage
(wxT("GmatFunction::Initialize() exiting for function '%s' with true\n"),
functionName.c_str());
#endif
#ifdef DEBUG_TRACE
ShowTrace(callCount, t1, wxT("GmatFunction::Initialize() exiting"), true);
#endif
return true;
}