From: Ron F. <ro...@us...> - 2005-03-21 17:57:06
|
Update of /cvsroot/nsclspectcl/SpecTcl/Events In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17536/Events Modified Files: Tag: SpecTcl-3-0_developmentreally TCLRunFileHandler.cpp TCLRunFileHandler.h Log Message: - Modify TCLRunFileHandler to allow dynamic modification of the I/O poll dwell time via the Tcl variable SpecTclIODwellMax. - Fix a few unit tests that got broken when the analyzer started to retain a global variable that we cared about. - Fix a couple of old style header warnings that slipped through the cracks in TestFiles. Index: TCLRunFileHandler.cpp =================================================================== RCS file: /cvsroot/nsclspectcl/SpecTcl/Events/TCLRunFileHandler.cpp,v retrieving revision 5.1.2.1 retrieving revision 5.1.2.2 diff -C2 -d -r5.1.2.1 -r5.1.2.2 *** TCLRunFileHandler.cpp 21 Dec 2004 17:51:18 -0000 5.1.2.1 --- TCLRunFileHandler.cpp 21 Mar 2005 17:56:18 -0000 5.1.2.2 *************** *** 297,302 **** --- 297,304 ---- #include "TCLInterpreter.h" #include "TKRunControl.h" + #include "TCLVariable.h" #include <tcl.h> #include <tk.h> + #include <stdio.h> #ifdef HAVE_STD_NAMESPACE *************** *** 305,312 **** ! static const UInt_t knWaitTime = 500; // Ms to wait for file to be readable. // Functions for class CTCLRunFileHandler ////////////////////////////////////////////////////////////////////////// // --- 307,338 ---- ! ! const UInt_t knWaitTime = 500; // default Ms to wait for file to be readable. ! ULong_t nWaitTime(knWaitTime); // Functions for class CTCLRunFileHandler + /*! + Construct the run file handler. We init our data elements, and + bind knWaitTime to the the TCL Variable SpecTclIODwellMax. + */ + CTCLRunFileHandler::CTCLRunFileHandler(CTCLInterpreter* pInterp, + CRunControl& rRun) : + CTCLIdleProcess(pInterp), + m_pRun(&rRun), + m_nBufferSize(0), + m_pInterp(pInterp) + { + CTCLVariable Dwell(pInterp, "SpecTclIODwellMax", false); + + UInt_t nCurrentDwell(nWaitTime); + Dwell.Link(&nWaitTime, TCL_LINK_INT); + + char sDwell[100]; + snprintf(sDwell, sizeof(sDwell), "%d", nCurrentDwell); + Dwell.Set(sDwell); + } + + ////////////////////////////////////////////////////////////////////////// // *************** *** 341,345 **** const CFile* pSource = m_pRun->getEventSource(); ! if(pSource->IsReadable(knWaitTime)) { m_pRun->OnBuffer(m_nBufferSize); // If a buffer is available process else. } --- 367,371 ---- const CFile* pSource = m_pRun->getEventSource(); ! if(pSource->IsReadable(nWaitTime)) { m_pRun->OnBuffer(m_nBufferSize); // If a buffer is available process else. } Index: TCLRunFileHandler.h =================================================================== RCS file: /cvsroot/nsclspectcl/SpecTcl/Events/TCLRunFileHandler.h,v retrieving revision 5.1.2.1 retrieving revision 5.1.2.2 diff -C2 -d -r5.1.2.1 -r5.1.2.2 *** TCLRunFileHandler.h 21 Dec 2004 17:51:18 -0000 5.1.2.1 --- TCLRunFileHandler.h 21 Mar 2005 17:56:19 -0000 5.1.2.2 *************** *** 317,326 **** public: ! CTCLRunFileHandler (CTCLInterpreter* pInterp, CRunControl& rRun) : ! CTCLIdleProcess(pInterp), ! m_pRun(&rRun), ! m_nBufferSize(0), ! m_pInterp(pInterp) ! { } ~ CTCLRunFileHandler ( ) { } //Destructor --- 317,321 ---- public: ! CTCLRunFileHandler (CTCLInterpreter* pInterp, CRunControl& rRun); ~ CTCLRunFileHandler ( ) { } //Destructor |