##// END OF EJS Templates
PCB Viewer is working but still WIP.
PCB Viewer is working but still WIP.

File last commit:

r3:e85fcd939626 default
r7:f3cd68e05582 default
Show More
qicadnetlist.h
213 lines | 6.3 KiB | text/x-c | CLexer
Sync
r1 /*------------------------------------------------------------------------------
-- This file is a part of the Kicad Tools Software
-- Copyright (C) 2014, Plasma Physics Laboratory - CNRS
--
-- 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.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-------------------------------------------------------------------------------*/
/*-- Author : Alexis Jeandet
-- Mail : alexis.jeandet@member.fsf.org
----------------------------------------------------------------------------*/
Sync
r3 #ifndef QICADNETLIST_H
#define QICADNETLIST_H
#include <QString>
#include <QStringList>
First Init, kicad lisp-like files abstract parser done.
r0 #include <QList>
#include <QFile>
#include <parsers/lispLike_driver.h>
Sync
r3 #include <qicadlisplikelexique.h>
First Init, kicad lisp-like files abstract parser done.
r0
namespace QIlib{
Sync
r1
Netlist parsing and loading ok, get in memory abstract syntax tree and concrete...
r2 class QIcadNetListDesign : public QIcadAbstractNodeWrapper
Sync
r1 {
public:
Netlist parsing and loading ok, get in memory abstract syntax tree and concrete...
r2 QIcadNetListDesign(QIlib::AbstractNode* node);
QIcadNetListDesign(){}
Sync
r1 QIcadAbstractNodeWrapper source;
QIcadAbstractNodeWrapper date;
QIcadAbstractNodeWrapper tool;
Netlist parsing and loading ok, get in memory abstract syntax tree and concrete...
r2 void setNode(QIlib::AbstractNode* node);
Sync
r1 };
Netlist parsing and loading ok, get in memory abstract syntax tree and concrete...
r2
Sync
r1 /*
* (comp (ref IC1)
(value 24L-MOD-8)
(libsource (lib guan) (part 24L-MOD-8))
(sheetpath (names /) (tstamps /))
(tstamp 52533BBE))
*/
class QIcadNetListComponent:public QIcadAbstractNodeWrapper
{
Netlist parsing and loading ok, get in memory abstract syntax tree and concrete...
r2 class QIcadNetListLibSource : QIcadAbstractNodeWrapper
{
public:
QIcadNetListLibSource(AbstractNode* node);
QIcadNetListLibSource(){}
QIcadAbstractNodeWrapper lib;
QIcadAbstractNodeWrapper part;
void setNode(AbstractNode* node);
};
class QIcadNetListSheetPath : QIcadAbstractNodeWrapper
{
public:
QIcadNetListSheetPath(AbstractNode* node);
QIcadNetListSheetPath(){}
QIcadAbstractNodeWrapper names;
QIcadAbstractNodeWrapper tstamps;
void setNode(AbstractNode* node);
};
Sync
r1 public:
QIcadNetListComponent(AbstractNode* node);
QIcadAbstractNodeWrapper ref;
QIcadAbstractNodeWrapper value;
Netlist parsing and loading ok, get in memory abstract syntax tree and concrete...
r2 QIcadNetListLibSource libsource;
QIcadNetListSheetPath sheetpath;
Sync
r1 QIcadAbstractNodeWrapper tstamp;
Netlist parsing and loading ok, get in memory abstract syntax tree and concrete...
r2 void setNode(QIlib::AbstractNode* node);
Sync
r1 };
/*
(libparts
(libpart (lib guan) (part 24L-MOD-8)
(fields
(field (name Reference) IC)
(field (name Value) 24L-MOD-8))
(pins
(pin (num 1) (name GND) (type power_in))
(pin (num 2) (name VCC) (type power_in))
*/
class QIcadNetListField : QIcadAbstractNodeWrapper
{
public:
QIcadNetListField(AbstractNode* node);
QIcadAbstractNodeWrapper name;
Netlist parsing and loading ok, get in memory abstract syntax tree and concrete...
r2 void setNode(AbstractNode* node);
First Init, kicad lisp-like files abstract parser done.
r0 };
Sync
r1
class QIcadNetListLibPart : QIcadAbstractNodeWrapper
{
class QIcadNetListPin : QIcadAbstractNodeWrapper
{
public:
QIcadNetListPin(AbstractNode* node);
QIcadAbstractNodeWrapper type;
QIcadAbstractNodeWrapper num;
QIcadAbstractNodeWrapper name;
Netlist parsing and loading ok, get in memory abstract syntax tree and concrete...
r2 void setNode(AbstractNode* node);
Sync
r1 };
public:
QIcadNetListLibPart(AbstractNode* node);
Netlist parsing and loading ok, get in memory abstract syntax tree and concrete...
r2 QIcadAbstractNodeWrapper lib;
QIcadAbstractNodeWrapper part;
Sync
r1 QList<QIcadNetListField*> fields;
QList<QIcadNetListPin*> pins;
Netlist parsing and loading ok, get in memory abstract syntax tree and concrete...
r2 void setNode(AbstractNode* node);
void setFields(QIlib::AbstractNode* node);
void apendFields(QIlib::AbstractNode* node);
void setPins(QIlib::AbstractNode* node);
void apendPins(QIlib::AbstractNode* node);
Sync
r1 };
/*
(libraries
(library (logical guan)
(uri /home/guan/boards/guan.lib))
(library (logical device)
(uri /usr/share/kicad/library/device.lib))
(library (logical conn)
(uri /usr/share/kicad/library/conn.lib)))
*/
class QIcadNetListLibrary : QIcadAbstractNodeWrapper
{
public:
QIcadNetListLibrary(AbstractNode* node);
QIcadAbstractNodeWrapper uri;
Netlist parsing and loading ok, get in memory abstract syntax tree and concrete...
r2 QIcadAbstractNodeWrapper logical;
void setNode(AbstractNode* node);
Sync
r1 };
/*
(nets
(net (code 15) (name "")
(node (ref C4) (pin 1))
(node (ref U2) (pin 4)))
(net (code 16) (name GND)
(node (ref D1) (pin 2))
(node (ref C1) (pin 2))
(node (ref IC1) (pin 1))
*/
class QIcadNetListNet : QIcadAbstractNodeWrapper
{
class QIcadNetListNetNode: QIcadAbstractNodeWrapper
{
public:
QIcadNetListNetNode(AbstractNode* node);
QIcadAbstractNodeWrapper ref;
QIcadAbstractNodeWrapper pin;
Netlist parsing and loading ok, get in memory abstract syntax tree and concrete...
r2 void setNode(AbstractNode* node);
Sync
r1 };
public:
QIcadNetListNet(AbstractNode* node);
QList<QIcadNetListNetNode*> NetNodes;
Netlist parsing and loading ok, get in memory abstract syntax tree and concrete...
r2 QIcadAbstractNodeWrapper code;
QIcadAbstractNodeWrapper name;
void setNode(AbstractNode* node);
Sync
r1 };
Netlist parsing and loading ok, get in memory abstract syntax tree and concrete...
r2 class QIcadNetListRoot : public QIcadAbstractNodeWrapper
{
public:
QIcadNetListRoot(QIlib::AbstractNode* node);
QIcadNetListDesign design;
QList<QIcadNetListComponent*> components;
QList<QIcadNetListLibPart*> libparts;
QList<QIcadNetListLibrary*> libraries;
QList<QIcadNetListNet*> nets;
void setNode(QIlib::AbstractNode* node);
void setComponents(QIlib::AbstractNode* node);
void apendComponents(QIlib::AbstractNode* node);
void setLibParts(QIlib::AbstractNode* node);
void apendLibParts(QIlib::AbstractNode* node);
void setLibraries(QIlib::AbstractNode* node);
void apendLibraries(QIlib::AbstractNode* node);
void setNets(QIlib::AbstractNode* node);
void apendNets(QIlib::AbstractNode* node);
};
Sync
r1
First Init, kicad lisp-like files abstract parser done.
r0 class QIcadNetList : private lispLike_Driver
{
public:
QIcadNetList();
bool parseNetList(const QString& netlist);
Sync
r3 // QString toString();
First Init, kicad lisp-like files abstract parser done.
r0 QString fileName;
QString print();
Netlist parsing and loading ok, get in memory abstract syntax tree and concrete...
r2 QIcadNetListRoot* netlistRoot;
First Init, kicad lisp-like files abstract parser done.
r0 private:
QIlib::AbstractNode* getAbstractNode(const QString& node,int index);
QIlib::AbstractNode* getAbstractNode(QIlib::AbstractNode* rootNode,const QString& node,int* index);
void updateConcreteTree();
};
}
#endif // QICADNETLIST_H