ses layout
authoryu.dongliang <18588496441@163.com>
Thu, 13 Jul 2023 10:00:39 +0000 (18:00 +0800)
committeryu.dongliang <18588496441@163.com>
Thu, 13 Jul 2023 10:00:39 +0000 (18:00 +0800)
ses_layout.c

index 1ba003a264debe1e12dd892072957c845abe05f7..862e2573759e7020c65aebb378f8c6ac964b1062 100644 (file)
@@ -417,14 +417,20 @@ int ses_layout_function(ScfEfunction* f, uint32_t d, uint32_t bx, uint32_t by, u
                                p0 = c->pins[el0->pins[m + 1]];
                                p1 = c->pins[el1->pins[n + 1]];
 
-                               p0->x = el0->lines[0]->x1 + j * d;
-                               p0->y = el0->lines[0]->y0;
+                               if (SCF_EDA_Battery == c->type) {
 
-                               p1->x = el1->lines[0]->x1 + j * d;
-                               p1->y = el1->lines[0]->y0;
+                                       p0->x = el0->lines[0]->x0;
+                                       p1->x = el1->lines[0]->x0;
+                               } else {
+                                       p0->x = el0->lines[0]->x1 + j * d;
+                                       p1->x = el1->lines[0]->x1 + j * d;
 
-                               el0->lines[0]->x1 += j * d;
-                               el1->lines[0]->x1 += j * d;
+                                       el0->lines[0]->x1 += j * d;
+                                       el1->lines[0]->x1 += j * d;
+                               }
+
+                               p0->y = el0->lines[0]->y0;
+                               p1->y = el1->lines[0]->y0;
 
                                if (f->w < el0->lines[0]->x1 - f->x)
                                        f->w = el0->lines[0]->x1 - f->x;
@@ -448,10 +454,14 @@ int ses_layout_function(ScfEfunction* f, uint32_t d, uint32_t bx, uint32_t by, u
                        p0 = c->pins[el0->pins[m + 1]];
 
                        if (0 == p0->x) {
-                               p0->x = el0->lines[0]->x1 + d;
-                               p0->y = el0->lines[0]->y1;
 
-                               el0->lines[0]->x1 += d;
+                               if (SCF_EDA_Battery == c->type)
+                                       p0->x = el0->lines[0]->x0;
+                               else {
+                                       p0->x = el0->lines[0]->x1 + d;
+                                       el0->lines[0]->x1 += d;
+                               }
+                               p0->y = el0->lines[0]->y1;
 
                                if (f->w < el0->lines[0]->x1 - f->x)
                                        f->w = el0->lines[0]->x1 - f->x;
@@ -785,7 +795,7 @@ int ses_layout_board(ScfEboard* b, uint32_t x, uint32_t y, uint32_t w, uint32_t
 
                ses_lines_same_components(f);
 
-               int ret = ses_layout_function(f, 30, x + 30, y + 30, w - 40, h - 40);
+               int ret = ses_layout_function(f, 50, x + 50, y + 50, w - 50, h - 50);
                if (ret < 0) {
                        scf_loge("\n");
                        return ret;