NetList.hpp
4.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
//**************************************************************************************************
// NetList.hpp *
// ------------- *
// Description : This class provides an interface to the circuit description (netlist) file. The *
// raw netlist data is loaded from file into memory and stored as a string array. *
// The individual netlist types (component definitions, models, etc.) are extracted *
// and stored as object attributes. *
// Started : 2003-09-01 *
// Last Update : 2016-10-10 *
// Copyright : (C) 2003-2016 MSWaters *
//**************************************************************************************************
//**************************************************************************************************
// *
// 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 3 of the License, or (at your option) any later version. *
// *
//**************************************************************************************************
#ifndef NETLIST_HPP
#define NETLIST_HPP
// Application Includes
#include "Version.hpp"
#include "TypeDefs.hpp"
#include "utility/StrUtils.hpp"
#include "netlist/Component.hpp"
// wxWidgets Includes
#include <wx/filename.h>
#include <wx/textfile.h>
#include <wx/tokenzr.h>
//**************************************************************************************************
class NetList
{
protected :
// File names
static wxFileName m_ofnLoadFile;
static wxFileName m_ofnSaveFile;
static ArrayFileName m_oaSchemFiles;
public :
// String array containing the netlist data
static wxArrayString m_osaNetLst;
// String arrays containing data extracted from the netlist
static wxArrayString m_osaTitle;
static wxArrayString m_osaIncludes;
static ArrayComponent m_oaCpnts;
static wxArrayString m_osaModels;
static wxArrayString m_osaSubCcts;
// String arrays containing node labels only
static wxArrayString m_osaNodeLbls;
private :
static bool m_bIsValid;
// Functions to transfer circuit description information to or from m_osaNetLst
bool bLoadTitle ( void );
bool bLoadIncludes ( void );
bool bLoadCpnts ( void );
bool bLoadModels ( void );
bool bLoadSubCcts ( void );
bool bLoadNodeLbls ( void );
bool bLoadSchemFiles( void );
bool bIsSubCkt( wxString & roLine );
public :
NetList( void );
~NetList( );
static bool bClear ( void );
bool bIsEmpty ( void ) { return( m_osaNetLst.IsEmpty( ) ); }
virtual bool bValidate( void );
virtual bool bIsValid ( void ) { return( m_bIsValid ); }
static bool bLoadFile( const wxString & rosFName=wxT("") );
static bool bSaveFile( const wxString & rosFName=wxT("") );
virtual bool bLoad ( void );
virtual bool bSave ( void );
static bool bSetLoadFile ( const wxString & rosFName );
static bool bSetSaveFile ( const wxString & rosFName );
bool bSetSchemFiles( const wxArrayString & rosaFNames );
bool bSetSchemFiles( const wxString & rosFNames );
static const wxFileName & roGetLoadFile ( void ) { return( m_ofnLoadFile ); }
static const wxFileName & roGetSaveFile ( void ) { return( m_ofnSaveFile ); }
static const ArrayFileName & roGetSchemFiles( void ) { return( m_oaSchemFiles ); }
static const wxArrayString & roasGetSchemFiles( void );
static const wxString & rosGetSchemFiles( void );
static const Component & roGetCpnt ( const wxString & rosName );
virtual void Print( const wxString & rosPrefix=wxT(" ") );
friend class PrcGnuCap;
friend class PrcNgSpice;
};
//**************************************************************************************************
#endif // NETLIST_HPP