コード例 #1
0
/**
 * Retrieve the value for a Real parameter.
 *
 * @param <label> The label of the parameter.
 *
 * @return The parameter's value.
 */
Real Formation::GetRealParameter(const std::string &label) const
{
   // Performance!
    if (label == "A1Epoch")
       return state.GetEpoch();
   
    return GetRealParameter(GetParameterID(label));
}
コード例 #2
0
//------------------------------------------------------------------------------
// std::string GetStringParameter(const std::string &label) const
//------------------------------------------------------------------------------
std::string GroundTrackPlot::GetStringParameter(const std::string &label) const
{
   #if DBGLVL_PARAM_STRING
   MessageInterface::ShowMessage
      ("GroundTrackPlot::GetStringParameter() label = %s\n", label.c_str());
   #endif
   
   return GetStringParameter(GetParameterID(label));
}
コード例 #3
0
//------------------------------------------------------------------------------
bool Formation::SetBooleanParameter(const std::string &label,
                                    const bool value)
{
   #ifdef DEBUG_FORMATION_ACTIONS
      MessageInterface::ShowMessage(
         "Formation::SetBooleanParameter called with label = %s\n",
         label.c_str());
   #endif

   return SetBooleanParameter(GetParameterID(label), value);
}
コード例 #4
0
//------------------------------------------------------------------------------
// bool SetStringParameter(const wxString &label,
//                         const wxString &value)
//------------------------------------------------------------------------------
bool StringVar::SetStringParameter(const wxString &label,
                                   const wxString &value)
{
   #ifdef DEBUG_STRINGVAR
   MessageInterface::ShowMessage
      (wxT("StringVar::SetStringParameter() label=%s value='%s'\n"),
       label.c_str(), value.c_str());
   #endif
   
   return SetStringParameter(GetParameterID(label), value);
}
コード例 #5
0
//------------------------------------------------------------------------------
// bool SetStringParameter(const std::string &label, const std::string &value)
//------------------------------------------------------------------------------
bool GroundTrackPlot::SetStringParameter(const std::string &label,
                                         const std::string &value)
{
   #if DBGLVL_PARAM_STRING
   MessageInterface::ShowMessage
      ("GroundTrackPlot::SetStringParameter()<%s> label=%s, value=%s \n",
       instanceName.c_str(), label.c_str(), value.c_str());
   #endif
   
   return SetStringParameter(GetParameterID(label), value);
}
コード例 #6
0
//------------------------------------------------------------------------------
bool Variable::SetStringParameter(const wxString &label,
                                 const wxString &value)
{
   #ifdef DEBUG_VARIABLE_SET
   MessageInterface::ShowMessage
      (wxT("Variable::SetStringParameter() label=%s value=%s\n"),
       label.c_str(), value.c_str());
   #endif
   
   return SetStringParameter(GetParameterID(label), value);
}
コード例 #7
0
//------------------------------------------------------------------------------
std::string SolverSequenceCommand::GetStringParameter(const std::string& label,
      const Integer index) const
{
   return GetStringParameter(GetParameterID(label), index);
}
コード例 #8
0
//------------------------------------------------------------------------------
bool SolverSequenceCommand::IsParameterReadOnly(const std::string& label) const
{
   return IsParameterReadOnly(GetParameterID(label));
}
コード例 #9
0
ファイル: BatchEstimator.cpp プロジェクト: ddj116/gmat
//------------------------------------------------------------------------------
bool BatchEstimator::SetStringParameter(const std::string &label,
                                        const std::string &value,
                                        const Integer index)
{
   return SetStringParameter(GetParameterID(label), value, index);
}
コード例 #10
0
ファイル: BatchEstimator.cpp プロジェクト: ddj116/gmat
//------------------------------------------------------------------------------
std::string BatchEstimator::GetStringParameter(const std::string &label) const
{
   return GetStringParameter(GetParameterID(label));
}
コード例 #11
0
ファイル: ChemicalTank.cpp プロジェクト: rockstorm101/GMAT
//---------------------------------------------------------------------------
// std::string GetStringParameter(const std::string &label) const
//---------------------------------------------------------------------------
std::string ChemicalTank::GetStringParameter(const std::string &label) const
{
   return GetStringParameter(GetParameterID(label));
}
コード例 #12
0
//------------------------------------------------------------------------------
bool NonlinearConstraint::InterpretAction()
{
   bool tooMuch = false;
   // Clean out any old data
   wrapperObjectNames.clear();
   ClearWrappers();

   StringArray chunks = InterpretPreface();

   #ifdef DEBUG_NLC_PARSING
      MessageInterface::ShowMessage(wxT("Preface chunks as\n"));
      for (StringArray::iterator i = chunks.begin(); i != chunks.end(); ++i)
         MessageInterface::ShowMessage(wxT("   \"%s\"\n"), i->c_str());
      MessageInterface::ShowMessage(wxT("\n"));
   #endif
   
   // Find and set the solver object name
   // This is the only setting in Vary that is not in a wrapper
   StringArray currentChunks = parser.Decompose(chunks[1], wxT("()"), false);
   if (!GmatStringUtil::HasNoBrackets(currentChunks.at(0), false))
      throw CommandException(
            wxT("Solver name for NonlinearConstraint command may not contain brackets, braces, or parentheses.")); 
   SetStringParameter(OPTIMIZER_NAME, currentChunks[0]);
   if (currentChunks.size() < 2)
      throw CommandException(wxT("Missing field or value for NonlinearConstraint command."));
   if (currentChunks.size() > 2) tooMuch = true;
   wxString cc = GmatStringUtil::Strip(currentChunks[1]);
   Integer ccEnd = cc.size() - 1;
   if ((tooMuch) || (cc.at(0) != wxT('(')) || (cc.at(ccEnd) != wxT(')')))
      throw CommandException(
           wxT("Missing parentheses, or unexpected characters found, around logical expression argument to NonlinearConstraint command."));
   if (!GmatStringUtil::IsBracketBalanced(cc, wxT("()")))
      throw CommandException(wxT("Parentheses unbalanced in NonlinearConstraint command."));
   // @todo - if tolerance allowed later, will need to not check for braces here ...
   if ((cc.find(wxT('[')) != cc.npos) || (cc.find(wxT(']')) != cc.npos) ||
       (cc.find(wxT('{')) != cc.npos) || (cc.find(wxT('}')) != cc.npos) )
      throw CommandException(wxT("NonlinearConstraint command may not contain brackets or braces."));
   
   wxString noSpaces2     = GmatStringUtil::RemoveAll(cc,wxT(' '));
   //wxString noSpaces2     = GmatStringUtil::RemoveAll(currentChunks[1],' ');
   currentChunks = parser.SeparateBrackets(noSpaces2, wxT("()"), wxT(","), false);
   
   #ifdef DEBUG_NLC_PARSING
      MessageInterface::ShowMessage(
         wxT("NLC:  noSpaces2 = %s\n"), noSpaces2.c_str());
      MessageInterface::ShowMessage(
         wxT("NLC: after SeparateBrackets, current chunks = \n"));
      for (Integer jj = 0; jj < (Integer) currentChunks.size(); jj++)
         MessageInterface::ShowMessage(wxT("   %s\n"),
                                       currentChunks[jj].c_str());
   #endif
   bool testForMore = false;
   if ((Integer) currentChunks.size() > 1) testForMore = true;
   Integer end;
   wxString constraintStr = currentChunks[0];
   Integer opSize = 1;
   if ((end = constraintStr.find(wxT(">="), 0)) != (Integer) constraintStr.npos)
   {
      op = GREATER_THAN_OR_EQUAL;
      isInequality = true;
      isIneqString = wxT("IneqConstraint");
      opSize       = 2;
      #ifdef DEBUG_NONLINEAR_CONSTRAINT_INIT
         MessageInterface::ShowMessage(wxT("NLC:InterpretAction: greater_than_or_equal\n"));
      #endif
   }
   else if ((end = constraintStr.find(wxT("<="), 0)) != (Integer) constraintStr.npos)
   {
      op = LESS_THAN_OR_EQUAL;
      isInequality = true;
      isIneqString = wxT("IneqConstraint");
      opSize       = 2;
      #ifdef DEBUG_NONLINEAR_CONSTRAINT_INIT
         MessageInterface::ShowMessage(wxT("NLC:InterpretAction: less_than_or_equal\n"));
      #endif
   }
   else if ((end = constraintStr.find(wxT("=>"), 0)) != (Integer) constraintStr.npos)
   {
      wxString errmsg = wxT("The string \"=>\" is an invalid conditonal operator");
      errmsg            += wxT(" in a NonlinearConstraint command.\n");
      errmsg            += wxT("The allowed values are [=, <=, >=]\n");
      throw CommandException(errmsg);
   }
   else if ((end = constraintStr.find(wxT("=<"), 0)) != (Integer) constraintStr.npos)
   {
      wxString errmsg = wxT("The string \"=<\" is an invalid conditonal operator");
      errmsg            += wxT(" in a NonlinearConstraint command.\n");
      errmsg            += wxT("The allowed values are [=, <=, >=]\n");
      throw CommandException(errmsg);
   }
   else if ((end = constraintStr.find(wxT("=="), 0)) != (Integer) constraintStr.npos)
   {
      wxString errmsg = wxT("The string \"==\" is an invalid conditonal operator");
      errmsg            += wxT(" in a NonlinearConstraint command.\n");
      errmsg            += wxT("The allowed values are [=, <=, >=]\n");
      throw CommandException(errmsg);
   }
   else if ((end = constraintStr.find(wxT("="), 0)) != (Integer) constraintStr.npos)
   {
      //end = constraintStr.find("=", 0);
      op = EQUAL;
      isInequality = false;
      isIneqString = wxT("EqConstraint");
      #ifdef DEBUG_NONLINEAR_CONSTRAINT_INIT
         MessageInterface::ShowMessage(wxT("NLC:InterpretAction: equal\n"));
      #endif
   }
   else
   {
      wxString errmsg = wxT("The conditional operator is missing or invalid ");
      errmsg            += wxT(" in a NonlinearConstraint command.\n");
      errmsg            += wxT("The allowed values are [=, <=, >=]\n");
      throw CommandException(errmsg);
   }
   arg1Name = constraintStr.substr(0,end);
   arg2Name = constraintStr.substr(end+opSize, (constraintStr.npos - end + opSize - 1));
   #ifdef DEBUG_NLC_PARSING
      MessageInterface::ShowMessage(wxT("... arg1Name = %s\n"), arg1Name.c_str());
      MessageInterface::ShowMessage(wxT("... operator = %s\n"), OP_STRINGS[(Integer)op].c_str());
      MessageInterface::ShowMessage(wxT("... arg2Name = %s\n"), arg2Name.c_str());
   #endif
   // Currently, this should not happen ..... 
   if (testForMore)
   {
      wxString noSpaces     = GmatStringUtil::RemoveAll(currentChunks[1],wxT(' '));
      currentChunks = parser.SeparateBrackets(noSpaces, wxT("{}"), wxT(","), false);
      
      #ifdef DEBUG_NLC_PARSING
         MessageInterface::ShowMessage(
            wxT("NLC: After SeparateBrackets, current chunks = \n"));
         for (Integer jj = 0; jj < (Integer) currentChunks.size(); jj++)
            MessageInterface::ShowMessage(wxT("   %s\n"),
                                          currentChunks[jj].c_str());
      #endif
      
      // currentChunks now holds all of the pieces - no need for more separation  
      
      wxString lhs, rhs;
      for (StringArray::iterator i = currentChunks.begin(); 
           i != currentChunks.end(); ++i)
      {
         SeparateEquals(*i, lhs, rhs);
         
         if (IsSettable(lhs))
            SetStringParameter(GetParameterID(lhs), rhs);
         else
         {
            throw CommandException(wxT("The setting \"") + lhs + 
               wxT("\" is not a valid setting for a ") + typeName + 
               wxT(" command.\n"));
         }
      }
   }
   
   interpreted = true;
  
   return true;
}
コード例 #13
0
ファイル: AveragedDoppler.cpp プロジェクト: rockstorm101/GMAT
//------------------------------------------------------------------------------
Real AveragedDoppler::SetRealParameter(const std::string &label,
                                      const Real value, const Integer row,
                                      const Integer col)
{
   return SetRealParameter(GetParameterID(label), value, row, col);
}
コード例 #14
0
ファイル: AveragedDoppler.cpp プロジェクト: rockstorm101/GMAT
//------------------------------------------------------------------------------
Real AveragedDoppler::GetRealParameter(const std::string &label,
                                      const Integer row,
                                      const Integer col) const
{
   return GetRealParameter(GetParameterID(label), row, col);
}
コード例 #15
0
ファイル: AveragedDoppler.cpp プロジェクト: rockstorm101/GMAT
//------------------------------------------------------------------------------
Real AveragedDoppler::SetRealParameter(const std::string &label,
                                      const Real value)
{
   return SetRealParameter(GetParameterID(label), value);
}
コード例 #16
0
//------------------------------------------------------------------------------
std::string FileInterface::GetStringParameter(const std::string& label,
      const Integer index) const
{
   return GetStringParameter(GetParameterID(label), index);
}
コード例 #17
0
//------------------------------------------------------------------------------
bool FileInterface::SetStringParameter(const std::string& label,
      const std::string& value, const Integer index)
{
   return SetStringParameter(GetParameterID(label), value, index);
}
コード例 #18
0
ファイル: RFHardware.cpp プロジェクト: rockstorm101/GMAT
//------------------------------------------------------------------------------
std::string RFHardware::GetStringParameter(const std::string &label) const
{
   return GetStringParameter(GetParameterID(label));
}
コード例 #19
0
ファイル: ChemicalTank.cpp プロジェクト: rockstorm101/GMAT
//---------------------------------------------------------------------------
// Real SetRealParameter(const std::string &label, const Real value)
//---------------------------------------------------------------------------
Real ChemicalTank::SetRealParameter(const std::string &label, const Real value)
{
   return SetRealParameter(GetParameterID(label), value);
}
コード例 #20
0
ファイル: RFHardware.cpp プロジェクト: rockstorm101/GMAT
//------------------------------------------------------------------------------
bool RFHardware::SetStringParameter(const std::string &label,
                                   const std::string &value)
{
   return SetStringParameter(GetParameterID(label), value);
}
コード例 #21
0
ファイル: ChemicalTank.cpp プロジェクト: rockstorm101/GMAT
//---------------------------------------------------------------------------
// bool SetStringParameter(const std::string &label, const std::string &value)
//---------------------------------------------------------------------------
bool ChemicalTank::SetStringParameter(const std::string &label,
                                  const std::string &value)
{
   return SetStringParameter(GetParameterID(label), value);
}
コード例 #22
0
//------------------------------------------------------------------------------
std::string ObjectReferencedAxes::GetStringParameter(
                                  const std::string &label) const
{
   return GetStringParameter(GetParameterID(label));
}
コード例 #23
0
ファイル: BatchEstimator.cpp プロジェクト: ddj116/gmat
//------------------------------------------------------------------------------
std::string BatchEstimator::GetStringParameter(const std::string &label,
      const Integer index) const
{
   return GetStringParameter(GetParameterID(label), index);
}
コード例 #24
0
bool ObjectReferencedAxes::SetStringParameter(const std::string &label,
                                              const std::string &value)
{
   return SetStringParameter(GetParameterID(label), value);
}
コード例 #25
0
ファイル: Burn.cpp プロジェクト: rockstorm101/GMAT
//------------------------------------------------------------------------------
const StringArray& Burn::GetPropertyEnumStrings(const std::string &label) const
{
   return GetPropertyEnumStrings(GetParameterID(label));
}
コード例 #26
0
//------------------------------------------------------------------------------
bool SpiceAttitude::SetStringParameter(const std::string label,
                                       const std::string &value,
                                       const Integer index)
{
   return SetStringParameter(GetParameterID(label), value, index);
}
コード例 #27
0
//------------------------------------------------------------------------------
std::string SolverSequenceCommand::GetStringParameter(const std::string& label) const
{
   return GetStringParameter(GetParameterID(label));
}
コード例 #28
0
//------------------------------------------------------------------------------
bool FileInterface::IsParameterReadOnly(const std::string& label) const
{
   return IsParameterReadOnly(GetParameterID(label));
}
コード例 #29
0
//------------------------------------------------------------------------------
bool SolverSequenceCommand::SetStringParameter(const std::string& label,
      const std::string& value, const Integer index)
{
   return SetStringParameter(GetParameterID(label), value, index);
}
コード例 #30
0
//------------------------------------------------------------------------------
std::string FileInterface::GetStringParameter(const std::string& label) const
{
   return GetStringParameter(GetParameterID(label));
}