From 27a794a4e25e795dae4a4fa255dec880732db8a6 Mon Sep 17 00:00:00 2001 From: Siddhant Ranade Date: Sun, 6 Jul 2014 12:33:35 +0530 Subject: Component and ComponentInstance are now independent. fixComp and fixInst are now separate. Component::print changed. Is more accurate now. --- lib/component.cpp | 10 +++++++--- lib/component.h | 2 +- lib/header.h | 1 - lib/misc.cpp | 21 ++++++++++++++++++--- lib/misc.h | 5 ++--- 5 files changed, 28 insertions(+), 11 deletions(-) diff --git a/lib/component.cpp b/lib/component.cpp index 16eb6ca..9ccb936 100644 --- a/lib/component.cpp +++ b/lib/component.cpp @@ -70,7 +70,7 @@ void Pin::print(ostream& out, int shiftx, int shifty){ } //print function of class component to print all the components to output's cache lib file void Component::print(ostream& out){ - out<<"#\n# "< pins; Design des; //create object of design class to access its method Component(); //default constructor of Component class diff --git a/lib/header.h b/lib/header.h index 3da78c8..0f0beb2 100644 --- a/lib/header.h +++ b/lib/header.h @@ -23,6 +23,5 @@ extern const int MULT; //Pspice coordinates are too small. They need to be sca extern const string nameAppend; extern const vector REMOVEDCOMPONENTS; -//~ extern Component _dummy_Component; #endif diff --git a/lib/misc.cpp b/lib/misc.cpp index 4c2217a..37e3b2e 100644 --- a/lib/misc.cpp +++ b/lib/misc.cpp @@ -94,8 +94,8 @@ string stripNumFromRef(const string& ref){ return ref.substr(0, i+1); } -void fixComp(ComponentInstance& ci, Component& c){ - string ref=stripNumFromRef(ci.attrs[0].value); +void fixComp(Component& c){ + string& ref=c.ref; if(ref=="Q"){ for(int i=0; i