当前位置: 首页>>代码示例>>C++>>正文


C++ Solver::SetStringParameter方法代码示例

本文整理汇总了C++中Solver::SetStringParameter方法的典型用法代码示例。如果您正苦于以下问题:C++ Solver::SetStringParameter方法的具体用法?C++ Solver::SetStringParameter怎么用?C++ Solver::SetStringParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Solver的用法示例。


在下文中一共展示了Solver::SetStringParameter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SaveData


//.........这里部分代码省略.........
      CheckVariable(strMultSf.c_str(), objTypes,
                    "MultiplicativeScaleFactor", expRange, true);
   }
   
   if (!canClose)
      return;
   
   //-----------------------------------------------------------------
   // save values to base, base code should do the range checking
   //-----------------------------------------------------------------
   
   #ifdef DEBUG_VARYPANEL_SAVE
   MessageInterface::ShowMessage("   solverName=%s, variableName=%s\n",
       solverName.c_str(), variableName.c_str());
   #endif
   
   Solver *solver = (Solver*)theGuiInterpreter->GetConfiguredObject(solverName);
   
   if (solver == NULL)
      throw GmatBaseException("Cannot find the solver: " + solverName);
   
   bool validateCommand = false;
   
   try
   {
      bool changed = false;

      if (solverChanged)
      {
         #ifdef DEBUG_VARYPANEL_SAVE
         MessageInterface::ShowMessage
            ("   Solver changed, solver=<%p>'%s'\n", solver, solver->GetName().c_str());
         #endif
         mVaryCommand->SetStringParameter("SolverName", solverName);
         mVaryCommand->SetRefObject(solver, Gmat::SOLVER, solverName);
         solverChanged = false;
         changed = true;
      }
      
      if (variableChanged)
      {
         #ifdef DEBUG_VARYPANEL_SAVE
         MessageInterface::ShowMessage
            ("   Variable changed, variableName='%s'\n", variableName.c_str());
         #endif
         validateCommand = true;
         mVaryCommand->SetStringParameter("Variable", variableName);
         solver->SetStringParameter("Variables", variableName);
         variableChanged = false;
         changed = true;
      }
      
      if (mInitialTextCtrl->IsModified())
      {
         validateCommand = true;
         mVaryCommand->SetStringParameter("InitialValue", strInitVal.c_str());
         mInitialTextCtrl->DiscardEdits();
         changed = true;
      }
      
      if (mPertTextCtrl->IsModified())
      {
         validateCommand = true;
         mVaryCommand->SetStringParameter("Perturbation", strPert.c_str());
         mPertTextCtrl->DiscardEdits();
         changed = true;
开发者ID:,项目名称:,代码行数:67,代码来源:


注:本文中的Solver::SetStringParameter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。