battery + -, in out
authoryu.dongliang <18588496441@163.com>
Mon, 10 Jul 2023 14:54:20 +0000 (22:54 +0800)
committeryu.dongliang <18588496441@163.com>
Mon, 10 Jul 2023 14:54:20 +0000 (22:54 +0800)
ses_layout.c

index 0d50a4ce60752f3c230e8c67f851ff01a5eb28f1..84f77f4f438d3a88a3f8f24837e8613f14449c31 100644 (file)
@@ -431,6 +431,30 @@ int ses_layout_draw(ScfEboard* b, uint32_t bx, uint32_t by, uint32_t bw, uint32_
 
                        cairo_set_source_rgb(cr, red, green, blue);
 
+                       for (k = 0; k + 1 < el->n_pins; k += 2) {
+
+                               c  = f->components[el->pins[k]];
+
+                               p  = c->pins[el->pins[k + 1]];
+
+                               if (SCF_EDA_Battery == c->type) {
+
+                                       if (SCF_EDA_Battery_POS == p->id)
+                                               cairo_set_source_rgb(cr, 1, 0, 0);
+                                       else
+                                               cairo_set_source_rgb(cr, 0, 0, 1);
+                                       break;
+
+                               } else if (SCF_EDA_PIN_IN & p->flags) {
+                                       cairo_set_source_rgb(cr, 0, 1, 0);
+                                       break;
+
+                               } else if (SCF_EDA_PIN_OUT & p->flags) {
+                                       cairo_set_source_rgb(cr, 0, 0, 0);
+                                       break;
+                               }
+                       }
+
                        for (k = 0; k < el->n_lines; k++) {
                                l  =        el->lines[k];