nbkgnucap.cpp

来自「gspiceui电子CAD仿真程序.用于电路参数模拟仿真」· C++ 代码 · 共 243 行

CPP
243
字号
//*****************************************************************************//                                 NbkGnuCap.cpp                              *//                                ---------------                             *//  Started     : 05/09/2003                                                  *//  Last Update : 08/06/2005                                                  *//  Copyright   : (C) 2003 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.                                     *//                                                                            *//*****************************************************************************#include "NbkGnuCap.hpp"//*****************************************************************************// Constructor.//// Arguments://   poParent - The parent window//   oWinID   - The display object ID//   roPosn   - The notebook position//   roSize   - The notebook sizeNbkGnuCap::NbkGnuCap( wxWindow * poParent, wxWindowID oWinID,                      const wxPoint & roPosn, const wxSize & roSize )                    : NbkSimrBase( poParent, oWinID, roPosn, roSize ){  // Set the simulator engine type specifier  bSetSimrType( Simulation::eSIMR_GNUCAP );  // Create the various display objects  m_poPnlGnuCapOP = new PnlGnuCapOP( this );  m_poPnlGnuCapDC = new PnlGnuCapDC( this );  m_poPnlGnuCapAC = new PnlGnuCapAC( this );  m_poPnlGnuCapTR = new PnlGnuCapTR( this );  m_poPnlGnuCapFO = new PnlGnuCapFO( this );  // Add the display objects to the note book  AddPage( m_poPnlGnuCapOP, wxT( " Quiescent  " ) );  AddPage( m_poPnlGnuCapDC, wxT( "     DC      " ) );  AddPage( m_poPnlGnuCapAC, wxT( "     AC      " ) );  AddPage( m_poPnlGnuCapTR, wxT( " Transient  " ) );//  AddPage( m_poPnlGnuCapFO, wxT( "   Fourier   " ) );  SetSelection( 0 ); // Specify the page to be displayed}//*****************************************************************************// Default constructor.// (Used for two stage creation ie. must call Create( ) method.NbkGnuCap::NbkGnuCap( void ) : NbkSimrBase( ){  // Set the simulator engine type specifier  bSetSimrType( Simulation::eSIMR_GNUCAP );}//*****************************************************************************// Destructor.NbkGnuCap::~NbkGnuCap( ){}//*****************************************************************************// Clear the object attributes.//// Return Values://   TRUE  - Success//   FALSE - Failurebool  NbkGnuCap::bClear( void ){  bool  bRtn=TRUE;  if( ! m_poPnlGnuCapOP->bClear( ) ) bRtn = FALSE;  if( ! m_poPnlGnuCapDC->bClear( ) ) bRtn = FALSE;  if( ! m_poPnlGnuCapAC->bClear( ) ) bRtn = FALSE;  if( ! m_poPnlGnuCapTR->bClear( ) ) bRtn = FALSE;  if( ! m_poPnlGnuCapFO->bClear( ) ) bRtn = FALSE;  return( bRtn );}//*****************************************************************************// Load information from a Simulation object.//// Argument List://   roSim - The simulation object//// Return Values://   TRUE  - Success//   FALSE - Failurebool  NbkGnuCap::bLoad( Simulation & roSim ){  bool  bRtn=TRUE;  if( ! m_poPnlGnuCapOP->bLoad( roSim ) ) bRtn = FALSE;  if( ! m_poPnlGnuCapDC->bLoad( roSim ) ) bRtn = FALSE;  if( ! m_poPnlGnuCapAC->bLoad( roSim ) ) bRtn = FALSE;  if( ! m_poPnlGnuCapTR->bLoad( roSim ) ) bRtn = FALSE;  if( ! m_poPnlGnuCapFO->bLoad( roSim ) ) bRtn = FALSE;  if( ! bSetPage( roSim.eGetAnaType( ) ) ) bRtn = FALSE;  return( bRtn );}//*****************************************************************************// Reload information from a Simulation object.//// Argument List://   roSim - The simulation object//// Return Values://   TRUE  - Success//   FALSE - Failurebool  NbkGnuCap::bReload( Simulation & roSim ){  bool  bRtn=TRUE;  if( ! m_poPnlGnuCapOP->bReload( roSim ) ) bRtn = FALSE;  if( ! m_poPnlGnuCapDC->bReload( roSim ) ) bRtn = FALSE;  if( ! m_poPnlGnuCapAC->bReload( roSim ) ) bRtn = FALSE;  if( ! m_poPnlGnuCapTR->bReload( roSim ) ) bRtn = FALSE;  if( ! m_poPnlGnuCapFO->bReload( roSim ) ) bRtn = FALSE;  if( ! bSetPage( roSim.eGetAnaType( ) ) ) bRtn = FALSE;  return( bRtn );}//*****************************************************************************// Save information to a simulation object.//// Argument List://   roSim - The simulation object//// Return Values://   TRUE  - Success//   FALSE - Failurebool  NbkGnuCap::bSave( Simulation & roSim ){  wxString  os1;  switch( GetSelection( ) )  {    case 0: // OP analysis      if( ! m_poPnlGnuCapOP->bSave( roSim ) ) return( FALSE );      break;    case 1: // DC analysis      if( ! m_poPnlGnuCapDC->bSave( roSim ) ) return( FALSE );      break;    case 2: // AC analysis      if( ! m_poPnlGnuCapAC->bSave( roSim ) ) return( FALSE );      break;    case 3: // TR analysis      if( ! m_poPnlGnuCapTR->bSave( roSim ) ) return( FALSE );      break;    case 4: // FO analysis      if( ! m_poPnlGnuCapFO->bSave( roSim ) ) return( FALSE );      break;    default:      return( FALSE );  }  return( TRUE );}//*****************************************************************************// Set the page to be displayed.//// Argument List://   eType - The enumerated analysis type specifier//// Return Values://   TRUE  - Success//   FALSE - Failurebool  NbkGnuCap::bSetPage( Simulation::eAnaType eType ){  int  iPage;  switch( eType )  {    case Simulation::eANA_OP: iPage = 0; break;    case Simulation::eANA_DC: iPage = 1; break;    case Simulation::eANA_AC: iPage = 2; break;    case Simulation::eANA_TR: iPage = 3; break;    case Simulation::eANA_FO: iPage = 4; break;    default: return( FALSE );  }  SetSelection( iPage ); // Specify the page to be displayed  return( TRUE );}//*****************************************************************************// Set the page to be displayed.//// Argument List://   psType - The two letter analysis type specifier (case ignored)//// Return Values://   TRUE  - Success//   FALSE - Failurebool  NbkGnuCap::bSetPage( const wxChar * psType ){  Simulation::eAnaType  eType=Simulation::eANA_NONE;  wxString  osType;  osType = wxString( psType ).Upper( );  if( osType.Length( ) == 2 )  {         if( osType == wxT("OP") ) eType = Simulation::eANA_OP;    else if( osType == wxT("DC") ) eType = Simulation::eANA_DC;    else if( osType == wxT("AC") ) eType = Simulation::eANA_AC;    else if( osType == wxT("TR") ) eType = Simulation::eANA_TR;    else if( osType == wxT("FO") ) eType = Simulation::eANA_FO;    else if( osType == wxT("DI") ) eType = Simulation::eANA_DI;    else if( osType == wxT("NO") ) eType = Simulation::eANA_NO;    else if( osType == wxT("PZ") ) eType = Simulation::eANA_PZ;    else if( osType == wxT("SE") ) eType = Simulation::eANA_SE;    else if( osType == wxT("TF") ) eType = Simulation::eANA_TF;  }  return( bSetPage( eType ) );}//*****************************************************************************

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?