/* parse message in case of fault*/ int ParseFaultMessage(OpenSOAPBlockPtr body) { static char FuncName[] = "ParseFaultMessage"; int error = OPENSOAP_NO_ERROR; char *paramValue = NULL; fprintf(stderr, "Fault message:\n"); /* parse faultcode */ error = GetStringParameter(body, "faultcode", ¶mValue); ERROR_RETURN(error, FuncName, "get faultcode"); fprintf(stderr, " faultcode: %s\n", paramValue); free(paramValue); paramValue = NULL; /* parse faultstring */ error = GetStringParameter(body, "faultstring", ¶mValue); ERROR_RETURN(error, FuncName, "get faultstring"); fprintf(stderr, " faultstring: %s\n", paramValue); free(paramValue); paramValue = NULL; /* parse faultactor */ error = GetStringParameter(body, "faultactor", ¶mValue); ERROR_RETURN(error, FuncName, "get faultactor"); fprintf(stderr, " faultactor: %s\n", paramValue ? paramValue : "(null)"); free(paramValue); paramValue = NULL; /* parse detail (as plane string) */ error = GetStringParameter(body, "detail", ¶mValue); ERROR_RETURN(error, FuncName, "get detail"); fprintf(stderr, " detail: %s\n", paramValue ? paramValue : "(null)"); free(paramValue); paramValue = NULL; return error; }
//------------------------------------------------------------------------------ // 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)); }
string NXConnection::GetLogPath() const { string file_path = ""; if( GetStateId() < NX_ProxyReady ) file_path = options->GetNXSshLogPath(); else { char *pLogPath = GetStringParameter( pSession, NX_ProxyLogPath, "" ); file_path = pLogPath; delete pLogPath; } return file_path; }
void CBasicLog::EndTrial() { if(!m_bStarted) return; std::string strFileName(GetStringParameter(SP_USER_LOC)); strFileName.append("dasher_basic.log"); std::ofstream oFile; oFile.open(strFileName.c_str(), ios::out | ios::app); oFile << "\"" << m_strStartDate << "\":\"" << GetDateStamp() << "\":" << m_iSymbolCount << ":" << m_dBits << ":" << m_iKeyCount << ":" << m_iInitialRate / 100.0 << ":" << GetLongParameter(LP_MAX_BITRATE) / 100.0 << ":\"" << GetStringParameter(SP_INPUT_FILTER) << "\":\"" << GetStringParameter(SP_ALPHABET_ID) << "\"" << std::endl; oFile.close(); m_bStarted = false; }
Real BodyFixedPoint::SetRealParameter(const Integer id, const Real value) { if (id == EPOCH_PARAM) // from SpacePoint { A1Mjd a1(value); GetMJ2000State(a1); return lastStateTime.Get(); } #ifdef DEBUG_BODYFIXED_SET_REAL MessageInterface::ShowMessage("Entering BFP::SetRealParameter with id = %d (%s) and value = %12.10f\n", id, (GetParameterText(id)).c_str(), value); // MessageInterface::ShowMessage("stateType = %s and horizon = %s\n", // stateType.c_str(), horizon.c_str()); #endif if (((id == LOCATION_1) || (id == LOCATION_2)) && stateType == "Spherical") { // if Spherical statetype, then check if Latitude/Longitude are in the correct range if (id == LOCATION_1) // latitude { if ((value >= -90.0) && (value <= 90)) location[id-LOCATION_1] = value * GmatMathConstants::RAD_PER_DEG; else { AssetException aException(""); aException.SetDetails(errorMessageFormat.c_str(), GmatStringUtil::ToString(value, 16).c_str(), GetStringParameter(id-LOCATION_1+LOCATION_LABEL_1).c_str(), "Real Number >= -90.0 and <= 90.0"); throw aException; } } else // longitude (0-360) location[id-LOCATION_1] = (GmatMathUtil::Mod(value,360)) * GmatMathConstants::RAD_PER_DEG; return location[id-LOCATION_1]; } else if ((id >= LOCATION_1) && (id <= LOCATION_3)) // not Spherical { location[id-LOCATION_1] = value; return location[id-LOCATION_1]; } return SpacePoint::SetRealParameter(id, value); }
//------------------------------------------------------------------------------ // wxString GetStringParameter(const wxString &label) const //------------------------------------------------------------------------------ wxString CallFunction::GetStringParameter(const wxString &label) const { return GetStringParameter(GetParameterID(label)); }
//------------------------------------------------------------------------------ std::string ObjectReferencedAxes::GetStringParameter( const std::string &label) const { return GetStringParameter(GetParameterID(label)); }
//------------------------------------------------------------------------------ std::string RFHardware::GetStringParameter(const std::string &label) const { return GetStringParameter(GetParameterID(label)); }
string NXConnection::GetSessionId() const { return GetStringParameter(pSession, NX_SessionId, "undefined"); }
//------------------------------------------------------------------------------ std::string SolverSequenceCommand::GetStringParameter(const std::string& label) const { return GetStringParameter(GetParameterID(label)); }
//------------------------------------------------------------------------------ std::string BatchEstimator::GetStringParameter(const std::string &label) const { return GetStringParameter(GetParameterID(label)); }
//------------------------------------------------------------------------------ std::string FileInterface::GetStringParameter(const std::string& label, const Integer index) const { return GetStringParameter(GetParameterID(label), index); }
//------------------------------------------------------------------------------ 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; return retval; }
//------------------------------------------------------------------------------ std::string CalculatedPoint::GetStringParameter(const std::string &label, const Integer index) const { return GetStringParameter(GetParameterID(label), index); }
string NXConnection::GetState() const { if( ErrorOccurred() ) return "Connection error"; string sRet = ""; switch( GetCurrentState( pSession ) ) { case NX_ReadyForConnection: sRet = "Initializing connection"; break; case NX_Connecting: sRet = "Connecting to '"; sRet += string( GetStringParameter( pSession, NX_HostName, "unknown" ) ); sRet += "'"; break; case NX_Connected: sRet = "Connected to '"; sRet += string( GetStringParameter( pSession, NX_HostName, "unknown" ) ); sRet += "'"; break; case NX_SendingVersion: case NX_AcceptingVersion: sRet = "Negotiating protocol version"; break; case NX_VersionAccepted: sRet = "NX protocol version accepted"; break; case NX_WaitingForAuth: case NX_SendingAuth: case NX_Authenticating: sRet = "Waiting for authentication"; break; case NX_Authenticated: case NX_StartingSession: sRet = "Authentication completed"; break; case NX_SendingParameters: case NX_Negotiating: sRet = "Negotiating session parameters"; break; case NX_SessionAccepted: sRet = "Starting session"; break; case NX_ConnectionEnd: sRet = ""; break; case NX_ProxyReady: sRet = "Starting session"; break; case NX_ProxyConnecting: sRet = "Initializing X protocol compression"; break; case NX_ProxyNegotiating: sRet = "Negotiating link parameters"; break; case NX_ProxyConnected: sRet = "Established X server connection"; break; case NX_ProxyConnectionEnd: sRet = ""; break; default: sRet = ""; } return sRet; }
//------------------------------------------------------------------------------ std::string BodyFixedPoint::GetStringParameter(const std::string &label) const { return GetStringParameter(GetParameterID(label)); }
//------------------------------------------------------------------------------ // std::string GetStringParameter(const std::string &label) const //------------------------------------------------------------------------------ std::string Array::GetStringParameter(const std::string &label) const { return GetStringParameter(GetParameterID(label)); }
//------------------------------------------------------------------------------ // wxString GetStringParameter(const wxString &label) const //------------------------------------------------------------------------------ wxString PointMassForce::GetStringParameter(const wxString &label) const { return GetStringParameter(GetParameterID(label)); }
//------------------------------------------------------------------------------ std::string FileInterface::GetStringParameter(const std::string& label) const { return GetStringParameter(GetParameterID(label)); }
//------------------------------------------------------------------------------ std::string GroundStation::GetStringParameter(const std::string & label) const { return GetStringParameter(GetParameterID(label)); }
//--------------------------------------------------------------------------- // std::string GetStringParameter(const std::string &label) const //--------------------------------------------------------------------------- std::string ChemicalTank::GetStringParameter(const std::string &label) const { return GetStringParameter(GetParameterID(label)); }
//------------------------------------------------------------------------------ std::string GroundStation::GetStringParameter(const std::string & label, const Integer index) const { return GetStringParameter(GetParameterID(label), index); }
//------------------------------------------------------------------------------ std::string BatchEstimator::GetStringParameter(const std::string &label, const Integer index) const { return GetStringParameter(GetParameterID(label), index); }
//------------------------------------------------------------------------------ // wxString GetStringParameter(const wxString &label) const //------------------------------------------------------------------------------ wxString StringVar::GetStringParameter(const wxString &label) const { return GetStringParameter(GetParameterID(label)); }
//------------------------------------------------------------------------------ std::string SolverSequenceCommand::GetStringParameter(const std::string& label, const Integer index) const { return GetStringParameter(GetParameterID(label), index); }
//--------------------------------------------------------------------------- // std::string GetStringParameter(const std::string &label) const //--------------------------------------------------------------------------- std::string SolarPowerSystem::GetStringParameter(const std::string &label) const { return GetStringParameter(GetParameterID(label)); }