paskal
July 15th, 1999, 07:39 PM
i would like to create a program which can display electronic circuits and simulate it. i wish to know where should i place my mathematic calculations or functions?
|
Click to See Complete Forum and Search --> : maths functions paskal July 15th, 1999, 07:39 PM i would like to create a program which can display electronic circuits and simulate it. i wish to know where should i place my mathematic calculations or functions? Rail Jon Rogut July 15th, 1999, 07:51 PM I would probably set up a parent class CComponents and derive all my different electronic components from that class... so you would have CResistor, CCapacitor, CInductor, etc all derived from your base class CComponents. Each of these classes would probably have their own member variables and functions to keep track of the number of pins, the package, resistance/capacitance/etc... and any spice functions that you'd need for each component... So each object (CResistor, CCapacitor, etc) would have a member function GetPhaseResponse(), GetCurrent(), GetVoltage()... etc. This is a really involved project and I wish you the best of luck, there are already packages out there that do this... but their prices are pretty high. Regards. Rail Recording Engineer/Software Developer Rail Jon Rogut Software railro@earthlink.net http://home.earthlink.net/~railro/ John Killingbeck July 16th, 1999, 10:55 PM This is a large project. You will need to create lots of classes and member functions. Create these as a separate class family starting with an abstract class as a base class. You may need more than one base class. Maybe start with Passive, Discrete, IC and Connection classes. The Connection class can keep track of your interconnects. Put your component objects in the Document class where you can load/save them easily. Put your calculations in the View class so that they don't take up document space. They can be recalculated when the view is updated. Remember to put #include <math.h> in the StdAfx.h file, so that complex math routines are availabe to all source code files. These are just quick suggestions. Good luck. codeguru.com
Copyright Internet.com Inc., All Rights Reserved. |