tmp
authoryu.dongliang <18588496441@163.com>
Tue, 5 Sep 2023 12:09:26 +0000 (20:09 +0800)
committeryu.dongliang <18588496441@163.com>
Tue, 5 Sep 2023 12:09:26 +0000 (20:09 +0800)
ses_step_battery.c
ses_step_dc_diode.c
ses_step_dc_input.c
ses_step_dc_transistor.c

index 6f3c6178f2d59b132c834c91b26c68283d4a8ac1..af66bdcb8c9306c28f5fc1a1390e460dccf5300d 100644 (file)
@@ -20,11 +20,13 @@ static int _battery_handler(ScfEfunction* f, int64_t ns, int64_t count, ses_ctx_
        p->v  = 6;
        el    = f->elines[p->lid];
        el->v = 6;
+       el->vconst = 1;
 
        p     = c->pins[SCF_EDA_Battery_NEG];
        p ->v = 0;
        el    = f->elines[p->lid];
        el->v = 0;
+       el->vconst = 1;
 
        return 0;
 }
index 0f342e8e329088cd992720c5fae287c2869964fa..63d9a459498178c1baba978e7931d4222b563b09 100644 (file)
@@ -44,8 +44,9 @@ static int _dc_diode_handler(ScfEfunction* f, int64_t ns, int64_t count, ses_ctx
                                el1 = f->elines[p1->lid];
 
                                if (el1->v < SCF_EDA_V_MIN || el1->v >= p1->v) {
-                                       el1->v = p1->v;
-                                       c->status = SCF_EDA_Status_ON;
+                                       el1->v      = p1->v;
+                                       el1->vconst = 1;
+                                       c->status   = SCF_EDA_Status_ON;
                                } else
                                        c->status = SCF_EDA_Status_OFF;
                        }
index 30b9657c38bceb49642a032962114a7524562a24..2a280439f9a7a384e31ac8734e98537317b574ce 100644 (file)
@@ -18,7 +18,7 @@ static int _dc_input_handler(ScfEfunction* f, int64_t ns, int64_t count, ses_ctx
                if (SCF_EDA_PIN_IN & el->flags) {
 
                        el->v = (rand() & 0x1) * B->v;
-//                     el->v = B->v;
+                       el->vconst = 1;
 
                        scf_logw("IN el: %ld, V: %lg\n", el->id, el->v);
                }
index 3dc6af26f7e2d25d62ebb9d67a15681be1106c8d..cfed3efcad08482c6d570a0298033d4071c4b0d6 100644 (file)
@@ -38,10 +38,10 @@ static int _dc_transistor_handler(ScfEfunction* f, int64_t ns, int64_t count, se
                if (pb->v > pe->v + 0.7) {
                        pb->v = pe->v + 0.7;
                        el->v = pb->v;
-
-                       c->status = SCF_EDA_Status_ON;
+                       el->vconst = 1;
+                       c->status  = SCF_EDA_Status_ON;
                } else
-                       c->status = SCF_EDA_Status_OFF;
+                       c->status  = SCF_EDA_Status_OFF;
 
                scf_loge("Transistor c%ld, status: %d\n", c->id, c->status);
        }