From: yu.dongliang <18588496441@163.com> Date: Sat, 30 Sep 2023 07:05:17 +0000 (+0800) Subject: ses_layout_function() X-Git-Url: http://baseworks.info/?a=commitdiff_plain;h=60495e1411c1e8369c2ee73e05ade90bea4d72b4;p=ses.git ses_layout_function() --- diff --git a/ses_layout.c b/ses_layout.c index 461d709..019c994 100644 --- a/ses_layout.c +++ b/ses_layout.c @@ -393,8 +393,8 @@ int ses_layout_function(ScfEfunction* f, int d) if (!l0) return -ENOMEM; - l0->x0 = 0; - l0->x1 = d; + l0->x0 = d * abs(i - f->n_elines / 2); + l0->x1 = d + l0->x0; l0->y0 = d + i * d; l0->y1 = l0->y0; diff --git a/test/main.c b/test/main.c index a624c11..eaa6325 100644 --- a/test/main.c +++ b/test/main.c @@ -7,10 +7,10 @@ int main(int argc, char* argv[]) { ScfEcomponent* B; ScfEcomponent* D0; - ScfEcomponent* D1; - ScfEcomponent* D2; + ScfEcomponent* T0; ScfEcomponent* R0; ScfEcomponent* R1; + ScfEcomponent* R2; ScfEfunction* f; ScfEboard* b; @@ -23,19 +23,20 @@ int main(int argc, char* argv[]) B->pins[SCF_EDA_Battery_POS]->flags = SCF_EDA_PIN_POS; EDA_INST_ADD_COMPONENT(f, D0, SCF_EDA_Diode); - EDA_INST_ADD_COMPONENT(f, D1, SCF_EDA_Diode); - EDA_INST_ADD_COMPONENT(f, D2, SCF_EDA_Diode); + EDA_INST_ADD_COMPONENT(f, T0, SCF_EDA_Transistor); 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_PIN_ADD_PIN(D0, SCF_EDA_Diode_POS, B, SCF_EDA_Battery_POS); - EDA_PIN_ADD_PIN(D0, SCF_EDA_Diode_NEG, D1, SCF_EDA_Diode_POS); - EDA_PIN_ADD_PIN(D1, SCF_EDA_Diode_NEG, R0, 1); - EDA_PIN_ADD_PIN(R0, 0, B, SCF_EDA_Battery_NEG); + 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(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(D2, SCF_EDA_Diode_POS, B, SCF_EDA_Battery_POS); - EDA_PIN_ADD_PIN(D2, SCF_EDA_Diode_NEG, R1, 1); - EDA_PIN_ADD_PIN(R1, 0, D1, SCF_EDA_Battery_NEG); + 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); scf_eboard__add_function(b, f);