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


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

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


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

示例1: OnSolverSelection

//------------------------------------------------------------------------------
// void VaryPanel::OnSolverSelection(wxCommandEvent &event)
//------------------------------------------------------------------------------
void VaryPanel::OnSolverSelection(wxCommandEvent &event)
{
   #ifdef DEBUG_VARYPANEL_SOLVER
   MessageInterface::ShowMessage("VaryPanel::OnSolverSelection() entered\n");
   #endif
   
   solverName = mSolverComboBox->GetStringSelection().c_str();
   
   GmatBase *slvr = theGuiInterpreter->GetConfiguredObject(solverName);
   
   #ifdef DEBUG_VARYPANEL_SOLVER
   MessageInterface::ShowMessage
      ("   solverName='%s', solver=<%p>'%s'\n", solverName.c_str(), slvr,
       slvr ? slvr->GetName().c_str() : "NULL");
   #endif
   
   if (slvr == NULL)
   {
      MessageInterface::PopupMessage(Gmat::ERROR_, "The solver " + solverName + " is NULL");
   }
   else
   {
      solverChanged = true;
      SetControlEnabling(slvr);
      EnableUpdate(true);
   }
}
开发者ID:,项目名称:,代码行数:30,代码来源:

示例2: MapObjectsToSTM

//------------------------------------------------------------------------------
bool EstimationStateManager::MapObjectsToSTM()
{
   bool retval = true;

   // Fill in the STM based on the objects that comprise the state vector
   GmatBase* obj;
   Integer elementId; //, elementLength;
   for (UnsignedInt h = 0; h < stateMap.size(); ++h)
   {
      obj = stateMap[h]->object;
      if (stateMap[h]->subelement == 1)
      {
         elementId = stateMap[h]->parameterID;
//         elementLength = stateMap[h]->length;

         bool hasDstm = obj->HasDynamicParameterSTM(elementId);

         #ifdef DEBUG_STM_MAPPING
            MessageInterface::ShowMessage("Prepping for STM; element %s for "
                  "object %s has ID %d and length %d, and %s a dynamic STM "
                  "contribution\n", stateMap[h]->elementName.c_str(),
                  obj->GetName().c_str(), elementId, elementLength,
                  (hasDstm ? "has" : "does not have"));
         #endif

         if (hasDstm)
         {
            const Rmatrix* dstm = obj->GetParameterSTM(elementId);
            Integer stmSize = dstm->GetNumRows();
            // Fill in the master stm with the current data
            for (Integer i = 0; i < stmSize; ++i)
               for (Integer j = 0; j < stmSize; ++j)
                  stm(h+i, h+j) = (*dstm)(i,j);
         }

      }
   }

   #ifdef DEBUG_STM_MAPPING
      MessageInterface::ShowMessage("Loaded object STM's; esm STM now contains\n");
      for (Integer i = 0; i < stateSize; ++i)
      {
         for (Integer j = 0; j < stateSize; ++j)
            MessageInterface::ShowMessage("   %.12lf", stm(i,j));
         MessageInterface::ShowMessage("\n");
      }
      MessageInterface::ShowMessage("\n");
   #endif

   return retval;
}
开发者ID:,项目名称:,代码行数:52,代码来源:

示例3: SetGlobalObjectMap

//------------------------------------------------------------------------------
void CallFunction::SetGlobalObjectMap(std::map<wxString, GmatBase *> *map)
{
   #ifdef DEBUG_GLOBAL_OBJECT_MAP
   MessageInterface::ShowMessage
      (wxT("CallFunction::SetGlobalObjectMap() entered, mFunctionName='%s', ")
       wxT("map=<%p>\n"), mFunctionName.c_str(), map);
   #endif
   
   GmatCommand::SetGlobalObjectMap(map);
   
   // Now, find the function object
   GmatBase *mapObj = FindObject(mFunctionName);
   
   #ifdef DEBUG_GLOBAL_OBJECT_MAP
   MessageInterface::ShowMessage
      (wxT("   mapObj=<%p><%s>'%s'\n"), mapObj,
       mapObj ? mapObj->GetTypeName().c_str() : wxT("NULL"),
       mapObj ? mapObj->GetName().c_str() : wxT("NULL"));
   #endif
   
   if (mapObj == NULL)
   {
      //throw CommandException(wxT("CallFunction command cannot find Function ") +
      //         mFunctionName + wxT("\n"));
      ; // leave NULL for now
   }
   else
   {
      mFunction = (Function *)mapObj;
      
      #ifdef DEBUG_GLOBAL_OBJECT_MAP
      MessageInterface::ShowMessage
         (wxT("   mFunction=<%p><%s>\n"), mFunction, mFunction->GetName().c_str());
      #endif
      
      // Set only GmatFunction to FunctionManager (loj: 2008.09.03)
      if (mapObj->GetTypeName() == wxT("GmatFunction"))
         fm.SetFunction(mFunction);
   }
   fm.SetGlobalObjectMap(map);
   
   #ifdef DEBUG_GLOBAL_OBJECT_MAP
   MessageInterface::ShowMessage(wxT("CallFunction::SetGlobalObjectMap() exiting\n"));
   #endif
}
开发者ID:,项目名称:,代码行数:46,代码来源:

示例4: SetProperty

//------------------------------------------------------------------------------
bool PropagationStateManager::SetProperty(std::string propName, Integer index)
{
   #ifdef DEBUG_STATE_CONSTRUCTION
      MessageInterface::ShowMessage("Entered SetProperty(%s, %d)\n",
            propName.c_str(), index);
   #endif

   if ((index < 0) || (index >= (Integer)objects.size()))
      throw PropagatorException("Index out of bounds specifying a prop object "
            "in a propagation state manager\n");

   GmatBase *obj = objects[index];

   if (obj)
   {
      // Validate that the property can be propagated
      if (obj->SetPropItem(propName) == Gmat::UNKNOWN_STATE)
         throw PropagatorException(propName
               + " is not a known propagation parameter on "
               + obj->GetName());
      if (find(elements[obj]->begin(), elements[obj]->end(), propName) ==
            elements[obj]->end())
         elements[obj]->push_back(propName);

      #ifdef DEBUG_STATE_CONSTRUCTION
         MessageInterface::ShowMessage("Current property List:\n");
            for (StringArray::iterator i = elements[obj]->begin();
                  i != elements[obj]->end(); ++i)
               MessageInterface::ShowMessage("   %s\n", i->c_str());
      #endif

      return true;
   }

   return false;
}
开发者ID:,项目名称:,代码行数:37,代码来源:

示例5: MeasurementException

//------------------------------------------------------------------------------
const std::vector<RealArray>& USNTwoWayRange::CalculateMeasurementDerivatives(
      GmatBase *obj, Integer id)
{
   #ifdef DEBUG_DERIVATIVES
      MessageInterface::ShowMessage("USNTwoWayRange::CalculateMeasurement"
            "Derivatives(%s, %d) called\n", obj->GetName().c_str(), id);
   #endif

   if (!initialized)
      InitializeMeasurement();

   GmatBase *objPtr = NULL;

   Integer size = obj->GetEstimationParameterSize(id);
   Integer objNumber = -1;

   #ifdef DEBUG_DERIVATIVES
      MessageInterface::ShowMessage("   ParameterSize = %d\n", size);
   #endif

   if (size <= 0)
      throw MeasurementException("The derivative parameter on derivative "
            "object " + obj->GetName() + "is not recognized");

   // Check to see if obj is a participant
   for (UnsignedInt i = 0; i < participants.size(); ++i)
   {
      if (participants[i] == obj)
      {
         objPtr = participants[i];
         objNumber = i + 1;
         #ifdef DEBUG_DERIVATIVES
            MessageInterface::ShowMessage("   Participant %s found\n",
                  objPtr->GetName().c_str());
         #endif
         break;
      }
   }

   // Or if it is the measurement model for this object
   if (obj->IsOfType(Gmat::MEASUREMENT_MODEL))
   if (obj->GetRefObject(Gmat::CORE_MEASUREMENT, "") == this)
   {
      objPtr = obj;
      objNumber = 0;
      #ifdef DEBUG_DERIVATIVES
         MessageInterface::ShowMessage("   The measurement is the object\n",
               objPtr->GetName().c_str());
      #endif
   }

   if (objNumber == -1)
      throw MeasurementException(
            "USNTwoWayRange error - object is neither participant nor "
            "measurement model.");

   RealArray oneRow;
   oneRow.assign(size, 0.0);
   currentDerivatives.clear();
   currentDerivatives.push_back(oneRow);

   Integer parameterID = GetParmIdFromEstID(id, obj);

   #ifdef DEBUG_DERIVATIVES
      MessageInterface::ShowMessage("   Looking up id %d\n", parameterID);
   #endif

   if (objPtr != NULL)
   {
      if (objNumber == 1) // participant number 1, either a GroundStation or a Spacecraft
      {
         #ifdef DEBUG_DERIVATIVES
            MessageInterface::ShowMessage("   Deriv is w.r.t. %s of Participant"
                     " 1\n", objPtr->GetParameterText(parameterID).c_str());
         #endif
         if (objPtr->GetParameterText(parameterID) == "Position")
         {
            throw MeasurementException("Derivative w.r.t. " +
                  participants[0]->GetName() +" position is not yet implemented");

//            CalculateRangeVectorInertial();
//            Rvector3 tmp, result;
//            Rvector3 rangeUnit = rangeVecInertial.GetUnitVector();
//            #ifdef DEBUG_DERIVATIVES
//               MessageInterface::ShowMessage("   RVInertial      = %.12lf %.12lf %.12lf\n",
//                        rangeVecInertial[0], rangeVecInertial[1], rangeVecInertial[2]);
//               MessageInterface::ShowMessage("   Unit RVInertial = %.12lf %.12lf %.12lf ",
//                        rangeUnit[0], rangeUnit[1], rangeUnit[2]);
//            #endif
//            if (stationParticipant)
//            {
//               for (UnsignedInt i = 0; i < 3; ++i)
//                  tmp[i] = - rangeUnit[i];
//
//               // for a Ground Station, need to rotate to the F1 frame
//               result = tmp * R_j2k_1;
//               for (UnsignedInt jj = 0; jj < 3; jj++)
//                  currentDerivatives[0][jj] = result[jj];
//            }
//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:

示例6: Initialize

//------------------------------------------------------------------------------
bool Target::Initialize()
{
    GmatBase *mapObj = NULL;
    cloneCount = 0;

    if ((mapObj = FindObject(solverName)) == NULL)
    {
        wxString errorString = wxT("Target command cannot find targeter \"");
        errorString += solverName;
        errorString += wxT("\"");
        throw CommandException(errorString, Gmat::ERROR_);
    }

    // Clone the targeter for local use
#ifdef DEBUG_TARGET_INIT
    MessageInterface::ShowMessage
    (wxT("Target::Initialize() cloning mapObj <%p>'%s'\n"), mapObj,
     mapObj->GetName().c_str());
    MessageInterface::ShowMessage
    (wxT("mapObj maxIter=%d\n"),
     mapObj->GetIntegerParameter(mapObj->GetParameterID(wxT("MaximumIterations"))));
#endif

    // Delete the old cloned solver
    if (theSolver)
    {
#ifdef DEBUG_MEMORY
        MemoryTracker::Instance()->Remove
        (theSolver, wxT("local solver", "Target::Initialize()"),
         wxT("deleting local cloned solver"));
#endif
        delete theSolver;
    }

    theSolver = (Solver *)(mapObj->Clone());
    if (theSolver != NULL)
        ++cloneCount;

#ifdef DEBUG_MEMORY
    MemoryTracker::Instance()->Add
    (theSolver, theSolver->GetName(), wxT("Target::Initialize()"),
     wxT("theSolver = (Solver *)(mapObj->Clone())"));
#endif

    theSolver->TakeAction(wxT("ResetInstanceCount"));
    mapObj->TakeAction(wxT("ResetInstanceCount"));

    theSolver->TakeAction(wxT("IncrementInstanceCount"));
    mapObj->TakeAction(wxT("IncrementInstanceCount"));

    if (theSolver->GetStringParameter(wxT("ReportStyle")) == wxT("Debug"))
        targeterInDebugMode = true;
    theSolver->SetStringParameter(wxT("SolverMode"),
                                  GetStringParameter(SOLVER_SOLVE_MODE));
    theSolver->SetStringParameter(wxT("ExitMode"),
                                  GetStringParameter(SOLVER_EXIT_MODE));

    // Set the local copy of the targeter on each node
    std::vector<GmatCommand*>::iterator node;
    GmatCommand *current;
    specialState = Solver::INITIALIZING;

    for (node = branch.begin(); node != branch.end(); ++node)
    {
        current = *node;

#ifdef DEBUG_TARGET_COMMANDS
        Integer nodeNum = 0;
#endif
        while ((current != NULL) && (current != this))
        {
#ifdef DEBUG_TARGET_COMMANDS
            MessageInterface::ShowMessage(
                wxT("   Target Command %d:  %s\n"), ++nodeNum,
                current->GetTypeName().c_str());
#endif
            if ((current->GetTypeName() == wxT("Vary")) ||
                    (current->GetTypeName() == wxT("Achieve")))
                current->SetRefObject(theSolver, Gmat::SOLVER, solverName);
            current = current->GetNext();
        }
    }

    bool retval = SolverBranchCommand::Initialize();

    if (retval == true) {
        // Targeter specific initialization goes here:
        if (FindObject(solverName) == NULL)
        {
            wxString errorString = wxT("Target command cannot find targeter \"");
            errorString += solverName;
            errorString += wxT("\"");
            throw CommandException(errorString);
        }

        retval = theSolver->Initialize();
    }

    targeterInFunctionInitialized = false;
//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:

示例7: SaveChildPositionAndSize

//------------------------------------------------------------------------------
// void SaveChildPositionAndSize()
//------------------------------------------------------------------------------
void GmatMdiChildFrame::SaveChildPositionAndSize()
{
   if (mCanSaveLocation == false)
      return;

   if (IsIconized())
      return;
   
   // Get the position and size of the window first
   #ifdef __WXMAC__
      Integer screenWidth  = wxSystemSettings::GetMetric(wxSYS_SCREEN_X);
      Integer screenHeight = wxSystemSettings::GetMetric(wxSYS_SCREEN_Y);
   #else
      Integer screenWidth;
      Integer screenHeight;
      GmatAppData::Instance()->GetMainFrame()->GetActualClientSize(&screenWidth, &screenHeight, true);
      // Since GmatMainFrame::GetActualClientSize() subtracts one, add one here (LOJ: 2012.07.23)
      screenWidth++;
      screenHeight++;
   #endif

   bool isMinimized = IsIconized(), isMaximized = IsMaximized();
   if (isMinimized)	
	  Iconize(false);
   else if (isMaximized)
	  Maximize(false);

   int tmpX = -1, tmpY = -1;
   int tmpW = -1, tmpH = -1;
   GetPosition(&tmpX, &tmpY);
   GetSize(&tmpW, &tmpH);
   Rvector upperLeft(2, ((Real) tmpX /(Real)  screenWidth), ((Real) tmpY /(Real)  screenHeight));
   Rvector childSize(2,  ((Real) tmpW /(Real)  screenWidth), ((Real) tmpH /(Real)  screenHeight));

   if (isMinimized)	
	  Iconize();
   else if (isMaximized)
	  Maximize();


   #ifdef DEBUG_PERSISTENCE
   // ======================= begin temporary ==============================
   MessageInterface::ShowMessage("*** Size of SCREEN %s is: width = %d, height = %d\n",
                                 mChildName.WX_TO_C_STRING, screenWidth, screenHeight);
   MessageInterface::ShowMessage("Position of View plot %s is: x = %d, y = %d\n",
                                 mChildName.WX_TO_C_STRING, tmpX, tmpY);
   MessageInterface::ShowMessage("Size of View plot %s is: width = %d, height = %d\n",
                                 mChildName.WX_TO_C_STRING, tmpW, tmpH);
   // ======================= end temporary ==============================
   #endif

   if ((mItemType == GmatTree::OUTPUT_REPORT)  ||
       (mItemType == GmatTree::OUTPUT_CCSDS_OEM_FILE ) ||
       (mItemType == GmatTree::OUTPUT_ORBIT_VIEW) ||
       (mItemType == GmatTree::OUTPUT_XY_PLOT) ||
       (mItemType == GmatTree::OUTPUT_GROUND_TRACK_PLOT)
       // We'll want to add the event reports eventually, but they are not subscriber based
       //|| (mItemType == GmatTree::EVENT_REPORT)
       )
   {
      GmatBase *obj = theGuiInterpreter->GetConfiguredObject(mChildName.c_str());
      
      #ifdef DEBUG_FUNCTION
      // Check if child name is the configured object name
      MessageInterface::ShowMessage
         ("GmatMdiChildFrame::SaveChildPositionAndSize() the child '%s' %s a "
          "configured object, obj = <%p>[%s]'%s'\n", mChildName.WX_TO_C_STRING,
          obj ? "is" : "is not", obj, obj ? obj->GetTypeName().c_str() : "NULL",
          obj ? obj->GetName().c_str() : "NULL");
      #endif
      
      if (!obj)
      {
         // Just return if child is not a configured subscriber,ie,
         // plotting from GMAT function (LOJ: 2015.06.26)
         #ifdef DEBUG_FUNCTION
         MessageInterface::ShowMessage
            ("**** WARNING **** GmatMdiChildFrame::SaveChildPositionAndSize() "
             "will not save position and size for unconfigured subscriber '%s'\n",
             mChildName.WX_TO_C_STRING);
         #endif
         return;
      }
      else if (!obj->IsOfType("Subscriber"))
      {
         #ifdef DEBUG_PERSISTENCE
         MessageInterface::ShowMessage
            ("**** WARNING **** GmatMdiChildFrame::SaveChildPositionAndSize() "
             "cannot not save position and size for non-subscriber '%s'\n",
             mChildName.WX_TO_C_STRING);
         #endif
         SubscriberException se;
         se.SetDetails("Cannot set position and size for non-subscriber '%s'");
         throw se;
      }
      
      Subscriber *sub = (Subscriber*) obj;
//.........这里部分代码省略.........
开发者ID:rockstorm101,项目名称:GMAT,代码行数:101,代码来源:GmatMdiChildFrame.cpp

示例8: main

//------------------------------------------------------------------------------
// int main(int argc, char *argv[])
//------------------------------------------------------------------------------
int main(int argc, char *argv[])
{
   cout << "=-=-=-=-=-=-= TEST coordinate system ....." << endl;
   cout << " ------ number of objects instantiated = " << GmatBase::GetInstanceCount() << endl;
   
   cout.setf(ios::fixed);
   cout.precision(16);

   std::string eopFileName    = "/GMAT/dev/datafiles/EOPFiles/eopc04.62-now";
   std::string nutFileName    = "/GMAT/dev/datafiles/ITRF/NUTATION.DAT";
   std::string planFileName   = "/GMAT/dev/datafiles/ITRF/NUT85.DAT";
   std::string SLPFileName    = "/GMAT/dev/datafiles/mac/DBS_mn2000.dat";
   std::string DEFileName     = "/GMAT/dev/datafiles/DEascii/macp1941.405";
   std::string LeapFileName   = "/GMAT/dev/datafiles/tai-utcFiles/tai-utc.dat";
   
   cout << "\n==> First, test the AxisSystemFactory <==" << endl;
   AxisSystemFactory *asf = new AxisSystemFactory();
   cout << "AxisSystemFactory created .........." << endl;
   cout << " ------ number of objects instantiated = " << GmatBase::GetInstanceCount() << endl;
   std::string
      AXES_TYPE[13] =
   {
      "MJ2000Eq",
      "MJ2000Ec",
      "TOEEq",
      "TOEEc",
      "MOEEq",
      "MOEEc",
      "TODEq",
      "TODEc",
      "MODEq",
      "MODEc",
      "ObjectReferenced",
      "Equator",
      "BodyFixed",
   };
   
   AxisSystem *as;
   MJ2000EqAxes* mj;
   MJ2000EqAxes* mj2;
   //MJ2000EcAxes* mj2;
   std::string tmpStr = "";
   //for (int i = 0; i < 13 ; i++)
   for (int i = 0; i < 2 ; i++) // only do the first one, for now
   {
      tmpStr = AXES_TYPE[i] + "1";
      as = asf->CreateAxisSystem(AXES_TYPE[i], tmpStr);
      if (as) 
      {
         cout << "AxisSystem of type " << AXES_TYPE[i] << 
                  " was created with name " << tmpStr << endl;
         if (i > 1)       delete as; 
         else if (i == 0) mj   = (MJ2000EqAxes*) as;
         //else             mj2  = (MJ2000EcAxes*) as;
      }
      else    cout << "NO " << AXES_TYPE[i] << " AxisSystem created." << endl;
   }
   
   cout << " ------ number of objects instantiated = " << GmatBase::GetInstanceCount() << endl;
   if (mj)
   {
      cout << "MJ2000EqAxes object exists with name " << mj->GetName() << 
      " and type " << mj->GetTypeName() << endl;
   }
   mj2 = (MJ2000EqAxes*)(asf->CreateAxisSystem("MJ2000Eq","MJ2000Eq2"));
   if (mj2)
   {
      cout << "MJ20002 object exists with name " << mj2->GetName() << 
      " and type " << mj2->GetTypeName() << endl;
   }

   try
   {
      LeapSecsFileReader* ls     = new LeapSecsFileReader(LeapFileName);
      ls->Initialize();
      EopFile *eop               = new EopFile(eopFileName);
      eop->Initialize();
      ItrfCoefficientsFile* itrf = new ItrfCoefficientsFile(nutFileName, planFileName);
      itrf->Initialize();
      //bf->SetEopFile(eop);
      //bf->SetCoefficientsFile(itrf);
      TimeConverterUtil::SetLeapSecsFileReader(ls);
      TimeConverterUtil::SetEopFile(eop);
   }
   catch (BaseException &bbee)
   {
      cout << "ERROR !!!!! " << bbee.GetMessage() << endl;
   }
   
   SolarSystem*   ss;
   Star*          sol;
   Planet*        earth;
   Planet*        mars;
   Planet*        jupiter;
   Moon*          luna;
   std::string    j2000BN = "";
   SpacePoint*    j2000B  = NULL;
//.........这里部分代码省略.........
开发者ID:rockstorm101,项目名称:GMAT,代码行数:101,代码来源:TestCoord.cpp

示例9: VerifyAddHardware

//-------------------------------------------------------------------------
// This function is used to verify GroundStation's added hardware.
//
// return true if there is no error, false otherwise.
//-------------------------------------------------------------------------
// made changes by Tuan Nguyen
bool GroundStation::VerifyAddHardware()
{
   Gmat::ObjectType type;
   std::string subTypeName;
   GmatBase* obj;

   // 1. Verify all hardware in hardwareList are not NULL:
   for(ObjectArray::iterator i= hardwareList.begin(); i != hardwareList.end(); ++i)
   {
	   obj = (*i);
	   if (obj == NULL)
	   {
		   MessageInterface::ShowMessage("***Error***:One element of hardwareList = NULL\n");
		   return false;
	   }
   }

   // 2. Verify primary antenna to be in hardwareList:
   // 2.1. Create antenna list from hardwareList for searching:
   // extract all antenna from hardwareList and store to antennaList
   ObjectArray antennaList;
   for(ObjectArray::iterator i= hardwareList.begin(); i != hardwareList.end(); ++i)
   {
	  obj = (*i);
      subTypeName = obj->GetTypeName();
	  if (subTypeName == "Antenna")
		 antennaList.push_back(obj);
   }

   // 2.2. Verify primary antenna of Receiver, Transmitter, and Transponder:
   GmatBase* antenna;
   GmatBase* primaryAntenna;
   std::string primaryAntennaName;
   bool verify = true;
   for(ObjectArray::iterator i= hardwareList.begin(); i != hardwareList.end(); ++i)
   {
	  obj = (*i);
	  type = obj->GetType();
	  if (type == Gmat::HARDWARE)
	  {
         subTypeName = obj->GetTypeName();
         if ((subTypeName == "Transmitter")||
        	 (subTypeName == "Receiver")||
        	 (subTypeName == "Transponder"))
         {
    		 // Get primary antenna:
    		 primaryAntennaName = obj->GetRefObjectName(Gmat::HARDWARE);
    		 primaryAntenna = obj->GetRefObject(Gmat::HARDWARE,primaryAntennaName);

    		 bool check;
    		 if (primaryAntenna == NULL)
    		 {
    			 MessageInterface::ShowMessage
					 ("***Error***:primary antenna of %s in %s's AddHardware list is NULL \n",
					  obj->GetName().c_str(), this->GetName().c_str());
    			 check = false;
    		 }
    		 else
    		 {
    			 // Check primary antenna of transmitter, receiver, or transponder is in antenna list:
    			 check = false;
    			 for(ObjectArray::iterator j= antennaList.begin(); j != antennaList.end(); ++j)
    			 {
    				 antenna = (*j);
    				 if (antenna == primaryAntenna)
    				 {
    					 check = true;
    					 break;
    				 }
    				 else if (antenna->GetName() == primaryAntenna->GetName())
    				 {
    					 MessageInterface::ShowMessage
							 ("Primary antenna %s of %s is a clone of an antenna in %s's AddHardware\n",
							  primaryAntenna->GetName().c_str(), obj->GetName().c_str(), this->GetName().c_str());
    				 }
    			 }
            	 if (check == false)
            	 {
            		 // Display error message:
            		 MessageInterface::ShowMessage
							 ("***Error***:primary antenna of %s is not in %s's AddHardware\n",
							  obj->GetName().c_str(), this->GetName().c_str());
            	 }

        	 }

        	 verify = verify && check;
         }
	  }
   }

   return verify;
}
开发者ID:rockstorm101,项目名称:GMAT,代码行数:99,代码来源:GroundStation.cpp

示例10: LoadData

//------------------------------------------------------------------------------
// void LoadData()
//------------------------------------------------------------------------------
void CallFunctionPanel::LoadData()
{
   #ifdef DEBUG_CALLFUNCTION_PANEL_LOAD
   MessageInterface::ShowMessage(wxT("CallFunctionPanel::LoadData() entered\n"));
   #endif
   
   // Set the pointer for the "Show Script" button
   mObject = theCommand;
   
   int id = theCommand->GetParameterID(wxT("FunctionName"));
   wxString functionName = theCommand->GetStringParameter(id);
   
   // If function name is not in the ComboBox list, add blank
   if (!theFunctionComboBox->SetStringSelection(functionName.c_str()))
   {
      theFunctionComboBox->Append(wxT(""));
      theFunctionComboBox->SetStringSelection(wxT(""));
   }
   
   #ifdef DEBUG_CALLFUNCTION_PANEL_LOAD
   MessageInterface::ShowMessage
      (wxT("   Function name is: <%s>\n"), functionName.c_str());
   #endif
   
   // get input parameters
   StringArray inputList = theCommand->GetStringArrayParameter(wxT("AddInput"));
   mNumInput = inputList.size();
   mInputWxStrings.Clear();
   
   #ifdef DEBUG_CALLFUNCTION_PANEL_LOAD
   MessageInterface::ShowMessage
      (wxT("   Found %d input parameters:\n"), mNumInput);
   for (StringArray::iterator i = inputList.begin(); i != inputList.end(); ++i)
      MessageInterface::ShowMessage(wxT("      '%s'\n"), i->c_str());
   #endif
   
   if (mNumInput > 0)
   {
      wxString *inputNames = new wxString[mNumInput];
      GmatBase *param;
      wxString cellValue = wxT("");
      wxString delimiter = wxT(", ");
      
      for (int i=0; i<mNumInput; i++)
      {
         inputNames[i] = inputList[i].c_str();
         
         #ifdef DEBUG_CALLFUNCTION_PANEL_LOAD
         MessageInterface::ShowMessage(wxT("   Looking up ") + inputList[i] + wxT("\n"));
         #endif
         
         param = theGuiInterpreter->GetConfiguredObject(inputList[i]);
         
         if (i == mNumInput-1)
            delimiter = wxT("");
         
         if (param != NULL)
         {
            cellValue = cellValue + param->GetName().c_str() + delimiter;
            mInputWxStrings.Add(param->GetName().c_str());
         }
      }
      
      #ifdef __USE_GRID_FOR_INPUT_OUTPUT__
      theInputGrid->SetCellValue(0, 0, cellValue);
      #else
      theInputTextCtrl->SetValue(cellValue);
      #endif
      
      delete [] inputNames;
   }
   
   // get output parameters
   StringArray outputList = theCommand->GetStringArrayParameter(wxT("AddOutput"));
   mNumOutput = outputList.size();
   mOutputWxStrings.Clear();
   
   #ifdef DEBUG_CALLFUNCTION_PANEL_LOAD
   MessageInterface::ShowMessage
      (wxT("   Found %d output parameters:\n"), mNumOutput);
   for (StringArray::iterator i = outputList.begin(); i != outputList.end(); ++i)
      MessageInterface::ShowMessage(wxT("      '%s'\n"), i->c_str());
   #endif
   
   if (mNumOutput > 0)
   {
      wxString *outputNames = new wxString[mNumOutput];
      GmatBase *param;
      wxString cellValue = wxT("");
      wxString delimiter = wxT(", ");
      
      for (int i=0; i<mNumOutput; i++)
      {
         outputNames[i] = outputList[i].c_str();
         
         #ifdef DEBUG_CALLFUNCTION_PANEL_LOAD
         MessageInterface::ShowMessage(wxT("   Looking up ") + outputList[i] + wxT("\n"));
//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:


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