Exemplo n.º 1
0
//------------------------------------------------------------------------------
bool SolverSequenceCommand::IsParameterReadOnly(const std::string& label) const
{
   return IsParameterReadOnly(GetParameterID(label));
}
Exemplo n.º 2
0
//------------------------------------------------------------------------------
bool BulirschStoer::IsParameterReadOnly(const std::string &label) const
{
   return IsParameterReadOnly(GetParameterID(label));
}
Exemplo n.º 3
0
//------------------------------------------------------------------------------
bool FileInterface::IsParameterReadOnly(const std::string& label) const
{
   return IsParameterReadOnly(GetParameterID(label));
}
Exemplo n.º 4
0
//---------------------------------------------------------------------------
bool CalculatedPoint::IsParameterReadOnly(const std::string &label) const
{
   return IsParameterReadOnly(GetParameterID(label));
}
Exemplo n.º 5
0
//---------------------------------------------------------------------------
bool GroundStation::IsParameterReadOnly(const std::string & label) const
{
   return IsParameterReadOnly(GetParameterID(label));
}
Exemplo n.º 6
0
//------------------------------------------------------------------------------
bool Propagator::IsParameterReadOnly(const wxString &label) const
{
   return IsParameterReadOnly(GetParameterID(label));
}
Exemplo n.º 7
0
//------------------------------------------------------------------------------
bool BodyFixedPoint::SetStringParameter(const Integer id,
                                       const std::string &value)
{
   if (IsParameterReadOnly(id))
       return false;

   static bool firstTimeWarning = true;
   bool        retval           = false;
   std::string stateTypeList    = "Cartesian, Spherical";
   std::string horizonList      = "Sphere, Ellipsoid";
   std::string currentStateType = stateType;
   std::string currentHorizon   = horizon;

   if (id == CENTRAL_BODY)
   {
      if (value != SolarSystem::EARTH_NAME)
      {
         std::string errmsg =
            "The value of \"" + value + "\" for field \"CentralBody\""
            " on object \"" + instanceName + "\" is not an allowed value.\n"
            "The allowed values are: [ " + SolarSystem::EARTH_NAME + " ]. ";
         throw AssetException(errmsg);
      }
      if (theBody)
         theBody = NULL;
      cBodyName = value;
      retval = true;
   }
   else if (id == STATE_TYPE)
   {
      std::string v = value;
      if (v == "Geographical") // deprecated value
      {
        v = "Spherical";
        // write one warning per GMAT session
        if (firstTimeWarning)
        {
           std::string msg =
              "The value of \"" + value + "\" for field \"StateType\""
              " on object \"" + instanceName + "\" is not an allowed value.\n"
              "The allowed values are: [ " + stateTypeList + " ]. ";
           MessageInterface::ShowMessage("*** WARNING *** " + msg + "\n");
           firstTimeWarning = false;
        }
      }

      if ((v == "Cartesian") || (v == "Spherical"))
      {
         stateType = v;
         if (v == "Cartesian")
         {
            locationLabels[0] = "X";
            locationLabels[1] = "Y";
            locationLabels[2] = "Z";
            locationUnits[0] = "km";
            locationUnits[1] = "km";
            locationUnits[2] = "km";
         }
         else
         {
            locationLabels[0] = "Latitude";
            locationLabels[1] = "Longitude";
            locationLabels[2] = "Altitude";
            locationUnits[0] = "deg";
            locationUnits[1] = "deg";
            locationUnits[2] = "km";
         }
         if (currentStateType != stateType)
         {
            Rvector3 locIn(location[0], location[1], location[2]);
            Rvector3 locOut = BodyFixedStateConverterUtil::Convert(locIn, currentStateType, horizon, stateType, horizon,
                                                           flattening, meanEquatorialRadius);
            location[0] = locOut[0];
            location[1] = locOut[1];
            location[2] = locOut[2];
         }
         retval = true;
      }
      else
      {
         std::string errmsg =
            "The value of \"" + value + "\" for field \"StateType\""
            " on object \"" + instanceName + "\" is not an allowed value.\n"
            "The allowed values are: [ " + stateTypeList + " ]. ";
         throw AssetException(errmsg);
      }
   }
   else if (id == HORIZON_REFERENCE)
   {
      if ((value == "Sphere") || (value == "Ellipsoid"))
      {
         horizon = value;
         if (currentHorizon != horizon)
         {
            Rvector3 locIn(location[0], location[1], location[2]);
            Rvector3 locOut = BodyFixedStateConverterUtil::Convert(locIn, stateType, currentHorizon, stateType, horizon,
                                                       flattening, meanEquatorialRadius);
            location[0] = locOut[0];
            location[1] = locOut[1];
            location[2] = locOut[2];
         }
         retval = true;
      }
      else
      {
         std::string errmsg =
            "The value of \"" + value + "\" for field \"HorizonReference\""
            " on object \"" + instanceName + "\" is not an allowed value.\n"
            "The allowed values are: [ " + horizonList + " ]. ";
         throw AssetException(errmsg);
      }
   }
   else
      retval = SpacePoint::SetStringParameter(id, value);

   return retval;
}
Exemplo n.º 8
0
//------------------------------------------------------------------------------
bool PredictorCorrector::IsParameterReadOnly(const std::string &label) const
{
   return IsParameterReadOnly(GetParameterID(label));
}
Exemplo n.º 9
0
//------------------------------------------------------------------------------
bool Antenna::IsParameterReadOnly(const std::string& label) const
{
   return IsParameterReadOnly(GetParameterID(label));
}
Exemplo n.º 10
0
//---------------------------------------------------------------------------
bool Solver::IsParameterReadOnly(const wxString &label) const
{
   return IsParameterReadOnly(GetParameterID(label));
}