messages capture config output, still to find a way to capture all cerr output

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@95 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
l_maliakal_d
2012-10-16 08:29:44 +00:00
parent 863662a5eb
commit e104b1d529
6 changed files with 45 additions and 17 deletions

View File

@ -40,9 +40,12 @@ private:
class qDebugStream : public basic_streambuf<char> {
public:
qDebugStream(ostream &stream, QWidget* w) : m_stream(stream), log_window(w) {
qDebugStream(ostream &stream, ostream &estream, QWidget* w) : m_stream(stream), e_stream(estream), log_window(w) {
m_old_buf = stream.rdbuf();
stream.rdbuf(this);
//e_old_buf = stream.rdbuf();
//estream.rdbuf(this);
};
//-------------------------------------------------------------------------------------------------------------------------------------------------
@ -57,6 +60,7 @@ public:
#endif
}
m_stream.rdbuf(m_old_buf);
e_stream.rdbuf(e_old_buf);
}
//-------------------------------------------------------------------------------------------------------------------------------------------------
@ -104,6 +108,8 @@ protected:
private:
ostream &m_stream;
streambuf *m_old_buf;
ostream &e_stream;
streambuf *e_old_buf;
string m_string;
QWidget* log_window;
};

View File

@ -113,8 +113,9 @@ private:
int isDeveloper;
/**Sets up the layout of the widget
* @param fName file name of the config file at start up
* */
void SetUpWidgetWindow();
void SetUpWidgetWindow(const string fName);
/**Sets up detector
* @param fName file name of the config file at start up

View File

@ -28,14 +28,18 @@ class qTabMessages:public QWidget{
public:
/** \short The constructor
* @param parent is the parent tab widget
* @param detector is the detector returned from the detector tab
*/
qTabMessages(QWidget *parent,multiSlsDetector*& detector);
qTabMessages(QWidget *parent);
/** Destructor
*/
~qTabMessages();
/** Set the detetor reference
* @param det the detector reference
*/
void SetDetectorReference(multiSlsDetector*& detector){myDet = detector;};
private:
/** The sls detector object */
@ -52,6 +56,7 @@ private:
/** This class creates the log */
qDebugStream *qout;
//qDebugStream *qerr;
/** methods */
/** Sets up the widget */