diff --git a/chamsin/src/analogic/Device.cpp b/chamsin/src/analogic/AnalogComponent.cpp similarity index 100% rename from chamsin/src/analogic/Device.cpp rename to chamsin/src/analogic/AnalogComponent.cpp diff --git a/chamsin/src/analogic/Device.h b/chamsin/src/analogic/AnalogComponent.h similarity index 78% rename from chamsin/src/analogic/Device.h rename to chamsin/src/analogic/AnalogComponent.h index 644eb9f8..98ee0dea 100644 --- a/chamsin/src/analogic/Device.h +++ b/chamsin/src/analogic/AnalogComponent.h @@ -1,12 +1,12 @@ -#ifndef DEVICE_H -#define DEVICE_H +#ifndef ANALOGCOMPONENT_H +#define ANALOGCOMPONENT_H #include "hurricane/Cell.h" using namespace Hurricane; //#include "DeviceParameter.h" -class Device : public Cell { +class AnalogComponent : public Cell { #if 0 public: struct ParameterCompare: @@ -20,7 +20,7 @@ class Device : public Cell { Parameter* getParameter(const string& parameterId) const; #endif protected: - Device(Library* library, const Name& name): Cell(library, name) {} + AnalogComponent(Library* library, const Name& name): Cell(library, name) {} #if 0 void addParameter(const Parameter* parameter) { _parameterSet.insert(parameter); @@ -31,4 +31,4 @@ class Device : public Cell { }; -#endif // DEVICE_H +#endif // ANALOGCOMPONENT_H diff --git a/chamsin/src/analogic/CMakeLists.txt b/chamsin/src/analogic/CMakeLists.txt index 6940659d..a65b6ef2 100644 --- a/chamsin/src/analogic/CMakeLists.txt +++ b/chamsin/src/analogic/CMakeLists.txt @@ -1,6 +1,6 @@ INCLUDE_DIRECTORIES(${CHAMSIN_SOURCE_DIR}/src/technology ${HURRICANE_INCLUDE_DIR}) -ADD_LIBRARY(analogic SHARED Transistor.cpp) +ADD_LIBRARY(analogic SHARED Transistor.cpp Capacitor.cpp Resistor.cpp) TARGET_LINK_LIBRARIES(analogic atechnology ${HURRICANE_LIBRARIES}) diff --git a/chamsin/src/analogic/Capacitor.cpp b/chamsin/src/analogic/Capacitor.cpp new file mode 100644 index 00000000..1a38ecab --- /dev/null +++ b/chamsin/src/analogic/Capacitor.cpp @@ -0,0 +1,24 @@ +#include "hurricane/UpdateSession.h" +using namespace Hurricane; + +#include "Capacitor.h" + +Capacitor::Capacitor(Library* library, const Name& name): + AnalogComponent(library, name) +{} + +Capacitor* Capacitor::create(Library* library, const Name& name) { + Capacitor* capacitor = new Capacitor(library, name); + + capacitor->_postCreate(); + + return capacitor; +} + +void Capacitor::_postCreate() { + Inherit::_postCreate(); + + UpdateSession::open(); + ///// + UpdateSession::close(); +} diff --git a/chamsin/src/analogic/Capacitor.h b/chamsin/src/analogic/Capacitor.h new file mode 100644 index 00000000..4406c105 --- /dev/null +++ b/chamsin/src/analogic/Capacitor.h @@ -0,0 +1,19 @@ +#ifndef CAPACITOR_H +#define CAPACITOR_H + +#include "AnalogComponent.h" + +class Capacitor : public AnalogComponent { + public: + static Capacitor* create(Library* library, const Name& name); + + protected: + void _postCreate(); + + private: + + Capacitor(Library* library, const Name& name); +}; + + +#endif // CAPACITOR_H diff --git a/chamsin/src/analogic/Resistor.cpp b/chamsin/src/analogic/Resistor.cpp new file mode 100644 index 00000000..1f073870 --- /dev/null +++ b/chamsin/src/analogic/Resistor.cpp @@ -0,0 +1,24 @@ +#include "hurricane/UpdateSession.h" +using namespace Hurricane; + +#include "Resistor.h" + +Resistor::Resistor(Library* library, const Name& name): + AnalogComponent(library, name) +{} + +Resistor* Resistor::create(Library* library, const Name& name) { + Resistor* resistor = new Resistor(library, name); + + resistor->_postCreate(); + + return resistor; +} + +void Resistor::_postCreate() { + Inherit::_postCreate(); + + UpdateSession::open(); + ///// + UpdateSession::close(); +} diff --git a/chamsin/src/analogic/Resistor.h b/chamsin/src/analogic/Resistor.h new file mode 100644 index 00000000..1cb8ccaa --- /dev/null +++ b/chamsin/src/analogic/Resistor.h @@ -0,0 +1,19 @@ +#ifndef RESISTOR_H +#define RESISTOR_H + +#include "AnalogComponent.h" + +class Resistor : public AnalogComponent { + public: + static Resistor* create(Library* library, const Name& name); + + protected: + void _postCreate(); + + private: + + Resistor(Library* library, const Name& name); +}; + + +#endif // RESISTOR_H diff --git a/chamsin/src/analogic/Transistor.cpp b/chamsin/src/analogic/Transistor.cpp index fcdd3fde..4aeb68f7 100644 --- a/chamsin/src/analogic/Transistor.cpp +++ b/chamsin/src/analogic/Transistor.cpp @@ -48,7 +48,7 @@ Transistor::Type& Transistor::Type::operator=(const Type& type) { } Transistor::Transistor(Library* library, const Name& name): - Device(library, name), + AnalogComponent(library, name), _drain(NULL), _source(NULL), _grid(NULL), diff --git a/chamsin/src/analogic/Transistor.h b/chamsin/src/analogic/Transistor.h index 2dbd2998..79dc6529 100644 --- a/chamsin/src/analogic/Transistor.h +++ b/chamsin/src/analogic/Transistor.h @@ -1,9 +1,9 @@ #ifndef TRANSISTOR_H #define TRANSISTOR_H -#include "Device.h" +#include "AnalogComponent.h" -class Transistor : public Device { +class Transistor : public AnalogComponent { public: class Type { public: