ses_graph.h
authoryu.dongliang <18588496441@163.com>
Tue, 14 Nov 2023 02:24:53 +0000 (10:24 +0800)
committeryu.dongliang <18588496441@163.com>
Tue, 14 Nov 2023 02:24:53 +0000 (10:24 +0800)
ses_core.h
ses_layout.c
test/main.c

index 431968d93a6af0180778c59ddb4b7b1b1132df5b..26f2d1691444c03ba94271b17e083c3bf1b962a2 100644 (file)
@@ -3,7 +3,6 @@
 
 #include"scf_vector.h"
 #include"scf_eda_pb.h"
-#include"ses_graph.h"
 
 typedef struct ses_step_s    ses_step_t;
 typedef struct ses_path_s    ses_path_t;
index 570b1ff82340d55dc5517ec54c3a2bd96f42a5f2..2f18ed6bd3cb7edfef1d50afec93c046e577d12a 100644 (file)
@@ -1,5 +1,6 @@
 #include<cairo/cairo.h>
 #include"ses_core.h"
+#include"ses_graph.h"
 
 int epin_cmp(const void* v0, const void* v1)
 {
index dfafc94b4acd2abd1c6592afe5d147098e5bfef0..c38a20b510ab4943834bff94812679df4d40905b 100644 (file)
@@ -6,11 +6,12 @@
 int main(int argc, char* argv[])
 {
        ScfEcomponent* B;
-       ScfEcomponent* D0;
        ScfEcomponent* T0;
        ScfEcomponent* R0;
        ScfEcomponent* R1;
        ScfEcomponent* R2;
+       ScfEcomponent* R3;
+       ScfEcomponent* C0;
        ScfEfunction*  f;
        ScfEboard*     b;
 
@@ -22,21 +23,24 @@ int main(int argc, char* argv[])
        B->pins[SCF_EDA_Battery_NEG]->flags = SCF_EDA_PIN_NEG;
        B->pins[SCF_EDA_Battery_POS]->flags = SCF_EDA_PIN_POS;
 
-       EDA_INST_ADD_COMPONENT(f, D0, SCF_EDA_Diode); // 1
-       EDA_INST_ADD_COMPONENT(f, T0, SCF_EDA_Transistor); // 2
-       EDA_INST_ADD_COMPONENT(f, R0, SCF_EDA_Resistor); // 3
-       EDA_INST_ADD_COMPONENT(f, R1, SCF_EDA_Resistor); // 4
-       EDA_INST_ADD_COMPONENT(f, R2, SCF_EDA_Resistor); // 5
+       EDA_INST_ADD_COMPONENT(f, T0, SCF_EDA_NPN);
+       EDA_INST_ADD_COMPONENT(f, R0, SCF_EDA_Resistor);
+       EDA_INST_ADD_COMPONENT(f, R1, SCF_EDA_Resistor);
+       EDA_INST_ADD_COMPONENT(f, R2, SCF_EDA_Resistor);
+       EDA_INST_ADD_COMPONENT(f, R3, SCF_EDA_Resistor);
+       EDA_INST_ADD_COMPONENT(f, C0, SCF_EDA_Inductor);
 
-       EDA_PIN_ADD_PIN(B,  SCF_EDA_Battery_POS,  D0, SCF_EDA_Diode_POS);
-       EDA_PIN_ADD_PIN(D0, SCF_EDA_Diode_NEG,    R0, 1);
+       EDA_PIN_ADD_PIN(B,  SCF_EDA_Battery_POS,  R0, 1);
        EDA_PIN_ADD_PIN(R0, 0,                    R1, 1);
        EDA_PIN_ADD_PIN(R1, 0,                    B,  SCF_EDA_Battery_NEG);
-       EDA_PIN_ADD_PIN(T0, SCF_EDA_Transistor_B, R1, 1);
+       EDA_PIN_ADD_PIN(T0, SCF_EDA_NPN_B,        R1, 1);
 
        EDA_PIN_ADD_PIN(B,  SCF_EDA_Battery_POS,  R2, 1);
-       EDA_PIN_ADD_PIN(R2, 0,                    T0, SCF_EDA_Transistor_C);
-       EDA_PIN_ADD_PIN(T0, SCF_EDA_Transistor_E, B,  SCF_EDA_Battery_NEG);
+       EDA_PIN_ADD_PIN(R2, 0,                    T0, SCF_EDA_NPN_C);
+       EDA_PIN_ADD_PIN(T0, SCF_EDA_NPN_E,        R3, 1);
+       EDA_PIN_ADD_PIN(T0, SCF_EDA_NPN_E,        C0, 1);
+       EDA_PIN_ADD_PIN(R3, 0,                    B,  SCF_EDA_Battery_NEG);
+       EDA_PIN_ADD_PIN(C0, 0,                    B,  SCF_EDA_Battery_NEG);
 
        scf_eboard__add_function(b, f);