int __ses_path_neg (ScfEfunction* f, ScfEline* el);
int __ses_path_va (ScfEfunction* f, ses_path_t* path);
+int __ses_status_check(ScfEcomponent* c, ScfEpin* pb, ScfEpin* pe, ScfEpin* Bn);
+
static inline void vertical(int* px, int* py, int dx, int dy, int d)
{
/*
ses_path_t* child;
ScfEcomponent* c;
+ ScfEcomponent* B;
ScfEline* el;
+ ScfEpin* Bn;
ScfEpin* p0;
ScfEpin* p1;
+ int i;
+
p0 = path->pins->data[0];
p1 = path->pins->data[path->pins->size - 1];
if (ret < 0)
return ret;
+ B = f->components[0];
+ Bn = B->pins[SCF_EDA_Battery_NEG];
+
+ for (i = 0; i < path->pins->size; i++) {
+ p0 = path->pins->data[i];
+
+ c = f->components[p0->cid];
+
+ if (SCF_EDA_NPN == c->type) {
+ if (SCF_EDA_NPN_B == p0->id) {
+
+ p1 = c->pins[SCF_EDA_NPN_E];
+ *changed += __ses_status_check(c, p0, p1, Bn);
+ }
+
+ } else if (SCF_EDA_Diode == c->type) {
+
+ if (SCF_EDA_Diode_POS == p0->id) {
+
+ p1 = c->pins[SCF_EDA_Diode_NEG];
+ *changed += __ses_status_check(c, p0, p1, Bn);
+ }
+ }
+ }
+
return 0;
}
p->cid, p->id, v, r, p->sr, p->a, p->dr);
}
-static int __ses_status_check(ScfEcomponent* c, ScfEpin* pb, ScfEpin* pe, ScfEpin* Bn)
+int __ses_status_check(ScfEcomponent* c, ScfEpin* pb, ScfEpin* pe, ScfEpin* Bn)
{
if (pe->v < SCF_EDA_V_MIN) {
pe->v = pb->v - SCF_EDA_V_Diode_ON;
scf_vector_free (path->bridges);
}
+ scf_logd("path: %d\n", path->index);
+
free(path);
}
}