예제 #1
0
//------------------------------------------------------------------------------
// void ResetBranchCommandChanged(GmatCommand *brCmd, Integer level)
//------------------------------------------------------------------------------
void GmatCommandUtil::ResetBranchCommandChanged(GmatCommand *brCmd, Integer level)
{
   GmatCommand* current = brCmd;
   Integer childNo = 0;
   GmatCommand* nextInBranch = NULL;
   GmatCommand* child;
   std::string cmdstr;
   
   while((child = current->GetChildCommand(childNo)) != NULL)
   {
      nextInBranch = child;
      
      while ((nextInBranch != NULL) && (nextInBranch != current))
      {         
         #ifdef DEBUG_COMMAND_CHANGED
         for (int i=0; i<=level; i++)
            cmdstr = "---" + cmdstr;         
         cmdstr = "--- " + nextInBranch->GetTypeName() + "\n";        
         MessageInterface::ShowMessage("%s", cmdstr.c_str());
         #endif
         
         nextInBranch->ConfigurationChanged(false);
         
         if (nextInBranch->GetChildCommand() != NULL)
            ResetBranchCommandChanged(nextInBranch, level+1);
         
         nextInBranch = nextInBranch->GetNext();
      }
      
      ++childNo;
   }
   
   #ifdef DEBUG_COMMAND_CHANGED
   MessageInterface::ShowMessage
      ("===> GmatCommandUtil::ResetBranchCommandChanged() leaving\n");
   #endif
}
예제 #2
0
//------------------------------------------------------------------------------
// void ResetCommandSequenceChanged(GmatCommand *cmd)
//------------------------------------------------------------------------------
void GmatCommandUtil::ResetCommandSequenceChanged(GmatCommand *cmd)
{
   if (cmd == NULL)
      return;
   
   GmatCommand *current = cmd;
   std::string cmdstr = cmd->GetTypeName();
   
   #ifdef DEBUG_COMMAND_CHANGED
   MessageInterface::ShowMessage
      ("===> GmatCommandUtil::ResetCommandSequenceChanged() entered, "
       "cmd=<%p><%s>\n", cmd, cmdstr.c_str());
   #endif
   
   while (current != NULL)
   {
      cmdstr = "--- " + current->GetTypeName() + "\n";
      
      #ifdef DEBUG_COMMAND_CHANGED
      MessageInterface::ShowMessage(cmdstr);
      #endif
      
      current->ConfigurationChanged(false);
      
      // go through sub commands
      if ((current->GetChildCommand(0)) != NULL)
         ResetBranchCommandChanged(current, 0);
      
      current = current->GetNext();
   }
   
   #ifdef DEBUG_COMMAND_CHANGED
   MessageInterface::ShowMessage
      ("===> GmatCommandUtil::ResetCommandSequenceChanged() leaving\n");
   #endif
}