Simple Nano Circuit 0.0.2
CapacitorObject.h
1#ifndef _CapacitorObject_H_
2#define _CapacitorObject_H_
3
4#include <SDL.h>
5#include "../BaseIcObject.h"
6#include "../symbols/capacitor.c"
7
8class NetlistClass;
9
11{
12 private:
13 double capacitance = 1e-6; // 1uF
14 double initialVoltage = 3;//1e-3; // 1mV;
15 std::list<double> voltageHistory;
16
17 void init() override;
18 void setupFootPins() override;
19
20 struct StoreData
21 {
22 ICType id;
23 SDL_Point centerPos;
24 int rotateNumber;
25 int mirrowNumber;
26 double capacitance;
27 double initialVoltage;
28 };
29 StoreData storeData;
30
31 public:
34 CapacitorObject(const unsigned char*, AsgardClass*);
36
37 const ICType getType() const override {return ICType::Capacitor;}
38
39 BaseElectronObject* deepDuplicateSelf() override;
40
41 double getCapacitance();
42 double getAdmittance();
43
44 bool havePopupWindow() override {return true;}
45 const char* popupWindowName() const override {return "CapacitorObject";}
46 void CreateImGuiForm() override;
47
48 double getVoltage(const NetlistClass*);
49 double getVoltage(const FootPinNode*);
50 void updateVoltage(const FootPinNode*);
51 double getVoltDiff(const FootPinNode*);
52 void clearVoltageHistory();
53
54 void saveToFile(std::ofstream&) override;
55};
56
57#endif
Definition: AsgardClass.h:17
Definition: BaseElectronObject.h:13
Definition: BaseIcObject.h:11
Definition: CapacitorObject.h:11
Definition: FootPinNode.h:15
Definition: NetlistClass.h:19