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


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

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


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

示例1: SaveData

//------------------------------------------------------------------------------
// void SaveData()
//------------------------------------------------------------------------------
void VaryPanel::SaveData()
{   
   #ifdef DEBUG_VARYPANEL_SAVE
   MessageInterface::ShowMessage("VaryPanel::SaveData() entered\n");
   #endif
   
   canClose = true;
   std::string strInitVal, strPert, strLower, strUpper, strMaxStep;
   std::string strAddSf, strMultSf;
   
   //-----------------------------------------------------------------
   // check input values: Number, Variable, Array element, Parameter
   //-----------------------------------------------------------------
   
   std::string expRange = "Real Number, Variable, Array element, Plottable Parameter";
   ObjectTypeArray objTypes;
   objTypes.push_back(Gmat::UNKNOWN_OBJECT);
   
   // Any plottable Parameters allowed, so use UNKNOWN_OBJECT
   if (mInitialTextCtrl->IsModified())
   {
      strInitVal = mInitialTextCtrl->GetValue().c_str();
      CheckVariable(strInitVal, objTypes,
                    "InitialValue", expRange, true);
   }
   
   if (mPertTextCtrl->IsModified())
   {
      strPert = mPertTextCtrl->GetValue().c_str();
      CheckVariable(strPert, objTypes,
                    "Perturbation", expRange, true);
   }
   
   if (mLowerValueTextCtrl->IsModified())
   {
      strLower = mLowerValueTextCtrl->GetValue().c_str();
      CheckVariable(strLower, objTypes,
                    "Lower", expRange, true);
   }
   
   if (mUpperValueTextCtrl->IsModified())
   {
      strUpper = mUpperValueTextCtrl->GetValue().c_str();
      CheckVariable(strUpper.c_str(), objTypes,
                    "Upper", expRange, true);
   }
   
   if (mMaxStepTextCtrl->IsModified())
   {
      strMaxStep = mMaxStepTextCtrl->GetValue().c_str();
      CheckVariable(strMaxStep.c_str(), objTypes,
                    "MaxStep", expRange, true);
   }
   
   if (mAdditiveTextCtrl->IsModified())
   {
      strAddSf = mAdditiveTextCtrl->GetValue().c_str();
      CheckVariable(strAddSf.c_str(), objTypes,
                    "AdditiveScaleFactor", expRange, true);
   }
   
   if (mMultiplicativeTextCtrl->IsModified())
   {
      strMultSf = mMultiplicativeTextCtrl->GetValue().c_str();
      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
//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:


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