prcbase.hpp
来自「gspiceui电子CAD仿真程序.用于电路参数模拟仿真」· HPP 代码 · 共 90 行
HPP
90 行
//*****************************************************************************// PrcBase.hpp *// ------------- *// Description : Provides a wrapper for the wxProcess class adding a bit of *// desirable functionality. *// Started : 29/01/2004 *// Last Update : 08/06/2005 *// Copyright : (C) 2004 by MSWaters *// Email : M.Waters@bom.gov.au *//*****************************************************************************//*****************************************************************************// *// This program is free software; you can redistribute it and/or modify *// it under the terms of the GNU General Public License as published by *// the Free Software Foundation; either version 2 of the License, or *// (at your option) any later version. *// *//*****************************************************************************#ifndef PRCBASE_HPP#define PRCBASE_HPP// System Includes#include <iostream>// wxWindows Includes#include <wx/wx.h>#include <wx/filename.h>#include <wx/process.h>#include <wx/tokenzr.h>// Application Includes#include "TextCtrl.hpp"// Local Constant Declarations#define DEFLOGFILE wxT("./prcbase.log") // Default log file path and name//*****************************************************************************class PrcBase : public wxProcess{ protected: wxFileName m_oFnmBinary; // The file name of the binary to be executed wxString m_osArgLst; // The argument list appended to the binary name int m_iPid; // The process ID wxFileName m_oFnmLog; // The file name of the simulation log wxString m_osError; // Error message bool bFindBinary( wxFileName & oFnmBin ); bool bLogOutput ( void ); public: PrcBase( int iFlags=wxPROCESS_REDIRECT ); ~PrcBase( ); bool bBinExists( void ); bool bIsExec ( void ) { return( m_iPid>0 ? TRUE : FALSE ); } bool bIsError( void ) { return( ! m_osError.IsEmpty( ) ); } bool bSetBinary ( const wxString & rosFName ); bool bSetArgLst ( const wxString & rosArgLst ); bool bSetLogFile( const wxString & rosFName ); const wxFileName & roGetBinary ( void ) { return( m_oFnmBinary ); } const wxChar * psGetArgLst ( void ) { return( m_osArgLst.c_str( ) ); } const wxFileName & roGetLogFile( void ) { return( m_oFnmLog ); } const wxChar * psGetError ( void ) { return( m_osError.c_str( ) ); } bool bRmLogFile( void ); bool bExec( const wxChar * psArgLst=NULL ); bool bKill( void ); void OnTerminate( int iPid, int iStatus ); void Print( TextCtrl & roTxtCtl );};//*****************************************************************************#endif // PRCBASE_HPP
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?