Example #1
0
// Find
//------------------------------------------------------------------------------
/*static*/ const Function * Function::Find( const AString & name )
{
	Function * func = s_FirstFunction;
	while ( func )
	{
		if ( func->GetName() == name )
		{
			return func;
		}
		func = func->m_NextFunction;
	}
	return nullptr;
}
Example #2
0
void InteractiveMatlabDialog::SetupCommand()
{
//   MessageInterface::ShowMessage("SetupCommand() Entered \n");
   wxString functionName = functionComboBox->GetStringSelection();

   // arg: for now to avoid a crash
   if (functionName != wxT(""))
   {
      Function *function = (Function *)theGuiInterpreter->GetConfiguredObject(
               functionName);

      if (function != NULL)
      {
         theCmd->SetRefObject(function, Gmat::FUNCTION, function->GetName());
      }
   }
   else
      throw (wxT("No Function Name Given"));

   // clear out previous parameters
   theCmd->TakeAction(wxT("Clear"));

   // set input parameters
   for (unsigned int i=0; i<inputStrings.Count(); i++)
   {
      wxString selInName = wxString(inputStrings[i]);
      theCmd->SetStringParameter(wxT("AddInput"), selInName, i);
   }

   // set output parameters
   for (unsigned int i=0; i<outputStrings.Count(); i++)
   {
       wxString selOutName = wxString(outputStrings[i]);
       theCmd->SetStringParameter(wxT("AddOutput"), selOutName, i);
   }

}