Faulhaber Serial Com Test  Version 1
A Qt interface to test Faulhaber MCBL 3006 motion controller
Public Member Functions | Protected Attributes | List of all members
ErrorHandler Class Reference

Class for handling all the errors that occur in the Lpr Control library. More...

#include "ErrorHandler.h"

Public Member Functions

 ErrorHandler ()
 ErrorHandler constructor. More...
 
 ~ErrorHandler ()
 ErrorHandler destructor. More...
 
QString getLastError ()
 Get the last error that occured. More...
 
void setCurrentError (const QString pClassName, const QString pMethodName, const QString pErrorString, const bool pIsLastError)
 Store the error that currently occured. More...
 

Protected Attributes

QVector< QString > mClassName
 List of classes mapping the path taken by the error. More...
 
QVector< QString > mMethodName
 List of methods mapping the path taken by the error. More...
 
QVector< QString > mErrorString
 List of error descriptions caused by the error's path throughout the member classes. More...
 
bool mResetOnNextError
 When True, the next call to setCurrentError will reset the mClassName, mMethodName, mErrorString QVectors. More...
 

Detailed Description


Constructor & Destructor Documentation

ErrorHandler::ErrorHandler ( )

Sets the mClassName, mMethodName, mErrorString variables to the empty string ("").

ErrorHandler::~ErrorHandler ( )
inline

Doesn't do anything.

Member Function Documentation

bool ErrorHandler::getLastError ( )

Returns the last error in the format: "SourceErrorClass::SourceErrorMethod --> SecondAffectedMemberClass::SecondAffectedMethod --> ... --> Error description at the source class". An example output is as follows: "Control::initialize --> "Kinematics::initialize" --> "Unable to initialize kinematics class."

Returns
String representing the last error that occured.
void ErrorHandler::setCurrentError ( const QString  pClassName,
const QString  pMethodName,
const QString  pErrorString,
const bool  pIsLastError 
)

Stores all the details of the current error in the member QVectors, depending on the class ID.

Parameters
[in]pClassIDClass ID within which the error occured (should be filled in by parameter definitions found in ClassID.
[in]pClassNameList of class names, see mClassName.
[in]pMethodNameList of method names, see mMethodName.
[in]pErrorStringList of error description strings, see mErrorString.
[in]pErrorSourceIf true then this is the source error and mClassName, mMethodName, mErrorString member variables will all be reset.
See also
getLastError(), ClassID, mClassName, mMethodName, mErrorString

Member Data Documentation

QVector<QString> ErrorHandler::mClassName
protected
QVector<QString> ErrorHandler::mErrorString
protected
QVector<QString> ErrorHandler::mMethodName
protected
bool ErrorHandler::mResetOnNextError
protected

The documentation for this class was generated from the following files: