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


C++ GmatBase::SetIntegerParameter方法代码示例

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


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

示例1: SaveData

//------------------------------------------------------------------------------
// virtual void SaveData()
//------------------------------------------------------------------------------
void GroundTrackPlotPanel::SaveData()
{
   #if DEBUG_PANEL_SAVE
   MessageInterface::ShowMessage
      ("GroundTrackPlotPanel::SaveData() entered, mHasCentralBodyChanged=%d, "
       " mHasObjectListChanged=%d\n   mHasIntegerDataChanged=%d, "
       "mHasTextureMapChanged=%d\n", mHasCentralBodyChanged, mHasObjectListChanged,
       mHasIntegerDataChanged, mHasTextureMapChanged);
   #endif
   
   canClose = true;
   std::string str1, str2;
   Integer collectFreq = 0, updateFreq = 0, pointsToRedraw = 0;
   
   //-----------------------------------------------------------------
   // check values from text field
   //-----------------------------------------------------------------
   
   if (mHasIntegerDataChanged)
   {
      CheckInteger(collectFreq, mDataCollectFreqTextCtrl->GetValue().c_str(),
                   "DataCollectFrequency", "Integer Number > 0", false, true, true);
      
      CheckInteger(updateFreq, mUpdatePlotFreqTextCtrl->GetValue().c_str(),
                   "UpdatePlotFrequency", "Integer Number > 0", false, true, true);
      
      CheckInteger(pointsToRedraw, mNumPointsToRedrawTextCtrl->GetValue().c_str(),
                   "NumPointsToRedraw", "Integer Number >= 0", false, true, true, true);
   }
      
   if (!canClose)
      return;
   
   //-----------------------------------------------------------------
   // save values to base, base code should do the range checking
   //-----------------------------------------------------------------
   GmatBase *clonedObj = mGroundTrackPlot->Clone();
   try
   {
      if (mHasCentralBodyChanged)
      {
         std::string newCentralBody = mCentralBodyComboBox->GetValue().WX_TO_STD_STRING;
         std::string newTexture = mTextureMapTextCtrl->GetValue().WX_TO_STD_STRING;
         clonedObj->SetStringParameter("CentralBody", newCentralBody);
         mHasCentralBodyChanged = false;
         // Set mHasTextureMapChanged to true so that it can be validated below (LOJ: 2014.11.03)
         mHasTextureMapChanged = true;
      }
      
      if (mHasObjectListChanged)
      {
         #if DEBUG_PANEL_SAVE
         MessageInterface::ShowMessage("   Saving object list\n");
         #endif
         clonedObj->TakeAction("Clear");
         int count = mObjectCheckListBox->GetCount();
         for (int i = 0; i < count; i++)
         {
            if (mObjectCheckListBox->IsChecked(i))
            {
               std::string objName =  mObjectCheckListBox->GetString(i).WX_TO_STD_STRING;
               #ifdef DEBUG_PANEL_SAVE
               MessageInterface::ShowMessage("   objName = '%s'\n", objName.c_str());
               #endif
               clonedObj->SetStringParameter("Add", objName);
            }
         }
         mHasObjectListChanged = false;
      }
      
      if (mHasIntegerDataChanged)
      {
         #if DEBUG_PANEL_SAVE
         MessageInterface::ShowMessage("   Saving Integer data\n");
         #endif
         clonedObj->SetIntegerParameter("DataCollectFrequency", collectFreq);
         clonedObj->SetIntegerParameter("UpdatePlotFrequency", updateFreq);
         clonedObj->SetIntegerParameter("NumPointsToRedraw", pointsToRedraw);
         mHasIntegerDataChanged = false;
      }
      
      if (mHasDataOptionChanged)
      {
         #if DEBUG_PANEL_SAVE
         MessageInterface::ShowMessage("   Saving drawing options\n");
         #endif
         clonedObj->SetBooleanParameter("ShowPlot", mShowPlotCheckBox->GetValue());
         clonedObj->SetStringParameter("SolverIterations",
                                       mSolverIterComboBox->GetValue().c_str());
         mHasDataOptionChanged = false;
      }
      
      // Save texture map
      if (mHasTextureMapChanged)
      {
         #if DEBUG_PANEL_SAVE
         MessageInterface::ShowMessage("   Saving new texture map\n");
//.........这里部分代码省略.........
开发者ID:rockstorm101,项目名称:GMAT,代码行数:101,代码来源:GroundTrackPlotPanel.cpp


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