dc input
authoryu.dongliang <18588496441@163.com>
Thu, 20 Jul 2023 03:07:12 +0000 (11:07 +0800)
committeryu.dongliang <18588496441@163.com>
Thu, 20 Jul 2023 03:07:12 +0000 (11:07 +0800)
Makefile
ses_layout.c
ses_step_battery.c
ses_step_dc_input.c

index 466ee4a1207cc328ad340db076385d58548fca20..cbd33639b73599260c51b3692f018bb3bef1d05c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -5,6 +5,7 @@ CFILES += ses_layout.c
 CFILES += ses_loop.c
 
 CFILES += ses_steps.c
+CFILES += ses_step_battery.c
 CFILES += ses_step_dc_input.c
 CFILES += ses_step_dc_diode.c
 CFILES += ses_step_dc_transistor.c
index 509d49e776de590dd533e093f9bfbfb3b9752fcf..eeebc8c282f065901e5a968518fe6e9929b7e267 100644 (file)
@@ -980,6 +980,8 @@ int ses_layout_board(ScfEboard* b)
                        return ret;
                }
 
+               ses_steps_analyse(f, 5, 5);
+
                x = f->x;
                y = f->y;
                w = f->w;
index b8256b616265082d4065ea4979075cd43982100f..8bdf125b72e1973b9a1a5c49dfb2c8c1d40fdf6c 100644 (file)
@@ -3,7 +3,6 @@
 static int _battery_handler(ScfEfunction* f, int64_t ns, int64_t count)
 {
        ScfEcomponent*   c;
-       ScfEfunction*    f;
        ScfEline*        el;
        ScfEpin*         p;
 
@@ -12,15 +11,15 @@ static int _battery_handler(ScfEfunction* f, int64_t ns, int64_t count)
        size_t k;
 
        c     = f->components[0];
-       c->V  = 5;
+       c->v  = 5;
 
        p     = c->pins[SCF_EDA_Battery_POS];
        el    = f->elines[p->lid];
-       el->V = 5;
+       el->v = 5;
 
        p     = c->pins[SCF_EDA_Battery_NEG];
        el    = f->elines[p->lid];
-       el->V = 0;
+       el->v = 0;
 
        return 0;
 }
index f27e1f3a8278c48c81d4312638ebd40a697fefc9..6aaf1e08c2cb23a7bd7005800c991e3ab0f70d7c 100644 (file)
@@ -3,7 +3,7 @@
 static int _dc_input_handler(ScfEfunction* f, int64_t ns, int64_t count)
 {
        ScfEcomponent*   c;
-       ScfEfunction*    f;
+       ScfEcomponent*   B;
        ScfEline*        el;
        ScfEpin*         p;
 
@@ -11,6 +11,9 @@ static int _dc_input_handler(ScfEfunction* f, int64_t ns, int64_t count)
        size_t j;
        size_t k;
 
+       B = f->components[0];
+       k = 0;
+
        for (i = 0; i < f->n_elines; i++) {
                el =        f->elines[i];
 
@@ -20,10 +23,18 @@ static int _dc_input_handler(ScfEfunction* f, int64_t ns, int64_t count)
                        p  = c->pins      [el->pins[j + 1]];
 
                        if (SCF_EDA_PIN_IN & p->flags) {
+
+                               el->v = (rand() & 0x1) * B->v;
+
+                               scf_logw("IN el: %ld, V: %lg\n", el->id, el->v);
+
+                               k++;
+                               break;
                        }
                }
        }
 
+       return 0;
 }
 
 ses_step_t   ses_step_dc_input =