nbkngspice.cpp

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

CPP
219
字号
//*****************************************************************************//                                NbkNgSpice.cpp                              *//                               ----------------                             *//  Started     : 08/05/2004                                                  *//  Last Update : 14/07/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.                                     *//                                                                            *//*****************************************************************************#include "NbkNgSpice.hpp"//*****************************************************************************// Constructor.//// Arguments://   poParent - The parent window//   oWinID   - The display object ID//   roPosn   - The notebook position//   roSize   - The notebook sizeNbkNgSpice::NbkNgSpice( wxWindow * poParent, wxWindowID oWinID,                        const wxPoint & roPosn, const wxSize & roSize )                      : NbkSimrBase( poParent, oWinID, roPosn, roSize ){  // Set the simulator engine type specifier  bSetSimrType( Simulation::eSIMR_NGSPICE );  // Create the various display objects  m_poPnlNgSpiceDC = new PnlNgSpiceDC( this );  m_poPnlNgSpiceAC = new PnlNgSpiceAC( this );  m_poPnlNgSpiceTR = new PnlNgSpiceTR( this );  // Add the display objects to the note book  AddPage( m_poPnlNgSpiceDC, wxT( "     DC     " ) );  AddPage( m_poPnlNgSpiceAC, wxT( "     AC     " ) );  AddPage( m_poPnlNgSpiceTR, wxT( " Transient  " ) );  SetSelection( 0 ); // Specify the page to be displayed}//*****************************************************************************// Default constructor.// (Used for two stage creation ie. must call Create( ) method.NbkNgSpice::NbkNgSpice( void ) : NbkSimrBase( ){  // Set the simulator engine type specifier  bSetSimrType( Simulation::eSIMR_NGSPICE );}//*****************************************************************************// Destructor.NbkNgSpice::~NbkNgSpice( ){}//*****************************************************************************// Clear the object attributes.//// Return Values://   TRUE  - Success//   FALSE - Failurebool  NbkNgSpice::bClear( void ){  bool  bRtn=TRUE;  if( ! m_poPnlNgSpiceDC->bClear( ) ) bRtn = FALSE;  if( ! m_poPnlNgSpiceAC->bClear( ) ) bRtn = FALSE;  if( ! m_poPnlNgSpiceTR->bClear( ) ) bRtn = FALSE;  return( bRtn );}//*****************************************************************************// Load information from a simulation object.//// Argument List://   roSimultn - The simulation object//// Return Values://   TRUE  - Success//   FALSE - Failurebool  NbkNgSpice::bLoad( Simulation & roSim ){  bool  bRtn=TRUE;  if( ! m_poPnlNgSpiceDC->bLoad( roSim ) ) bRtn = FALSE;  if( ! m_poPnlNgSpiceAC->bLoad( roSim ) ) bRtn = FALSE;  if( ! m_poPnlNgSpiceTR->bLoad( roSim ) ) bRtn = FALSE;  if( ! bSetPage( roSim.eGetAnaType( ) ) ) bRtn = FALSE;  return( bRtn );}//*****************************************************************************// Reload information from a simulation object.//// Argument List://   roSimultn - The simulation object//// Return Values://   TRUE  - Success//   FALSE - Failurebool  NbkNgSpice::bReload( Simulation & roSim ){  bool  bRtn=TRUE;  if( ! m_poPnlNgSpiceDC->bReload( roSim ) ) bRtn = FALSE;  if( ! m_poPnlNgSpiceAC->bReload( roSim ) ) bRtn = FALSE;  if( ! m_poPnlNgSpiceTR->bReload( roSim ) ) bRtn = FALSE;  if( ! bSetPage( roSim.eGetAnaType( ) ) ) bRtn = FALSE;  return( bRtn );}//*****************************************************************************// Save information to a simulation object.//// Argument List://   roSimultn - The simulation object//// Return Values://   TRUE  - Success//   FALSE - Failurebool  NbkNgSpice::bSave( Simulation & roSim ){  wxString  os1;  switch( GetSelection( ) )  {    case 0: // DC analysis      if( ! m_poPnlNgSpiceDC->bSave( roSim ) ) return( FALSE );      break;    case 1: // AC analysis      if( ! m_poPnlNgSpiceAC->bSave( roSim ) ) return( FALSE );      break;    case 2: // TR analysis      if( ! m_poPnlNgSpiceTR->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  NbkNgSpice::bSetPage( Simulation::eAnaType eType ){  int  iPage;  switch( eType )  {    case Simulation::eANA_OP:    case Simulation::eANA_DC: iPage = 0; break;    case Simulation::eANA_AC: iPage = 1; break;    case Simulation::eANA_TR: iPage = 2; 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  NbkNgSpice::bSetPage( const wxChar * psType ){  Simulation::eAnaType  eType=Simulation::eANA_NONE;  wxString  osType;  osType = wxString( psType ).Upper( );  if( osType.Length( ) == 2 )  {         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;  }  return( bSetPage( eType ) );}//*****************************************************************************

⌨️ 快捷键说明

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