42 #include <qpOASES/MessageHandling.hpp> 43 #include <qpOASES/Utils.hpp> 86 {
RET_QPOBJECT_NOT_SETUP,
"The QP object has not been setup correctly, use another constructor", VS_VISIBLE },
104 {
RET_QP_NOT_SOLVED,
"Problems occured while solving QP with standard solver", VS_VISIBLE },
146 {
RET_LI_RESOLVED,
"Linear indepence of active contraint matrix successfully resolved", VS_VISIBLE },
147 {
RET_ENSURELI_FAILED,
"Failed to ensure linear indepence of active contraint matrix", VS_VISIBLE },
172 {
RET_NO_REGSTEP_NWSR,
"No additional regularisation step could be performed due to limits", VS_VISIBLE },
173 {
RET_FEWER_REGSTEPS_NWSR,
"Fewer additional regularisation steps have been performed due to limits", VS_VISIBLE },
312 const char* additionaltext,
313 const char* functionname,
314 const char* filename,
315 const unsigned long linenumber,
325 return throwMessage( Enumber,additionaltext,functionname,filename,linenumber,localVisibilityStatus,
"ERROR" );
336 const char* additionaltext,
337 const char* functionname,
338 const char* filename,
339 const unsigned long linenumber,
349 return throwMessage( Wnumber,additionaltext,functionname,filename,linenumber,localVisibilityStatus,
"WARNING" );
360 const char* additionaltext,
361 const char* functionname,
362 const char* filename,
363 const unsigned long linenumber,
373 return throwMessage( Inumber,additionaltext,functionname,filename,linenumber,localVisibilityStatus,
"INFO" );
400 #ifndef __XPCTARGET__ 402 char myPrintfString[160];
407 snprintf( myPrintfString,160,
" %d - %s \n",keypos,returnValueList[keypos].data );
429 const char* additionaltext,
430 const char* functionname,
431 const char* filename,
432 const unsigned long linenumber,
434 const char* RETstring
437 #ifndef __SUPPRESSANYOUTPUT__ 438 #ifndef __XPCTARGET__ 440 char myPrintfString[160];
443 char whitespaces[41];
446 if ( numberOfWhitespaces < 0 )
447 numberOfWhitespaces = 0;
449 if ( numberOfWhitespaces > 40 )
450 numberOfWhitespaces = 40;
452 memset( whitespaces,
' ', (
size_t) numberOfWhitespaces );
453 whitespaces[numberOfWhitespaces] =
'\0';
458 if ( returnValueList[keypos].key == RETnumber )
471 if ( ( returnValueList[keypos].globalVisibilityStatus ==
VS_VISIBLE ) && ( localVisibilityStatus ==
VS_VISIBLE ) )
476 snprintf( myPrintfString,160,
"%s->", whitespaces );
480 if ( additionaltext == 0 )
483 snprintf( myPrintfString,160,
"%s (%s, %s:%d): \t%s\n",
484 RETstring,functionname,filename,(
int)linenumber,returnValueList[keypos].data
487 snprintf( myPrintfString,160,
"%s: %s\n",
488 RETstring,returnValueList[keypos].data
496 snprintf( myPrintfString,160,
"%s (%s, %s:%d): \t%s %s\n",
497 RETstring,functionname,filename,(
int)linenumber,returnValueList[keypos].data,additionaltext
500 snprintf( myPrintfString,160,
"%s: %s %s\n",
501 RETstring,returnValueList[keypos].data,additionaltext
508 if ( RETstring[0] ==
'E' )
537 if ( returnValueList[keypos].key == _returnValue )
545 return "Unknown error code";
548 return (returnValueList[keypos].data != 0) ? returnValueList[keypos].
data :
"No message for this error code";
VisibilityStatus infoVisibility
MessageHandling * getGlobalMessageHandler()
returnValue throwError(returnValue Enumber, const char *additionaltext, const char *functionname, const char *filename, const unsigned long linenumber, VisibilityStatus localVisibilityStatus)
returnValue throwInfo(returnValue Inumber, const char *additionaltext, const char *functionname, const char *filename, const unsigned long linenumber, VisibilityStatus localVisibilityStatus)
Allows to pass back messages to the calling function.
Data structure for entries in global message list.
void setOutputFile(myFILE *_outputFile)
returnValue throwWarning(returnValue Wnumber, const char *additionaltext, const char *functionname, const char *filename, const unsigned long linenumber, VisibilityStatus localVisibilityStatus)
returnValue myPrintf(const char *s)
static const char * getErrorCodeMessage(const returnValue _returnValue)
VisibilityStatus warningVisibility
MessageHandling & operator=(const MessageHandling &rhs)
BEGIN_NAMESPACE_QPOASES MessageHandling::ReturnValueList returnValueList[]
void setInfoVisibilityStatus(VisibilityStatus _infoVisibility)
returnValue setErrorCount(int _errorCount)
Handles all kind of error messages, warnings and other information.
returnValue listAllMessages()
VisibilityStatus errorVisibility
void rhs(const real_t *x, real_t *f)
#define END_NAMESPACE_QPOASES
void setErrorVisibilityStatus(VisibilityStatus _errorVisibility)
returnValue throwMessage(returnValue RETnumber, const char *additionaltext, const char *functionname, const char *filename, const unsigned long linenumber, VisibilityStatus localVisibilityStatus, const char *RETstring)
void setWarningVisibilityStatus(VisibilityStatus _warningVisibility)
#define BEGIN_NAMESPACE_QPOASES
MessageHandling globalMessageHandler(stderr, VS_VISIBLE, VS_VISIBLE, VS_VISIBLE)