ScfEcomponent* c;
ScfEcomponent* B;
ScfEline* el;
- ScfEpin* pb;
- ScfEpin* pc;
- ScfEpin* pe;
+ ScfEline* el2;
+ ScfEline* elp;
+ ScfEline* eln;
+ ScfEpin* p;
size_t i;
size_t j;
size_t k;
+ B = f->components[0];
+
+ elp = f->elines[B->pins[SCF_EDA_Battery_POS]->lid];
+ eln = f->elines[B->pins[SCF_EDA_Battery_NEG]->lid];
+
+ for (i = 0; i < f->n_elines; i++) {
+ el = f->elines[i];
+
+ if (!(SCF_EDA_PIN_IN & el->flags))
+ continue;
+
+ if (el->v == elp->v)
+ el2 = elp;
+ else if (el->v == eln->v)
+ el2 = eln;
+ else
+ continue;
+
+ for (j = 0; j + 1 < el->n_pins; j += 2) {
+
+ c = f->components[el->pins[j]];
+ p = c->pins [el->pins[j + 1]];
+
+ if (SCF_EDA_Status_OFF == c->status)
+ continue;
+
+ int ret = scf_eline__add_pin(el2, c->id, p->id);
+ if (ret < 0)
+ return ret;
+
+ p->lid = el2->id;
+
+ scf_logw("c%ld, p%ld, l%ld --> l%ld\n", c->id, p->id, p->c_lid, p->lid);
+ }
+ }
+
_simplify_draw(f, f->x, f->y, f->w, f->h);
return 0;