@modular-circuit/transpiler 0.0.87 → 0.0.88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -10,7 +10,7 @@ export function get_power_pos(pwr_number) {
|
|
|
10
10
|
}
|
|
11
11
|
var BLOCK_START_Y = 36 * GRID_SIZE;
|
|
12
12
|
var BLOCK_START_X = BLOCK_START_Y;
|
|
13
|
-
export var BLOCK_PIN_GAP =
|
|
13
|
+
export var BLOCK_PIN_GAP = 4 * GRID_SIZE;
|
|
14
14
|
var BLOCK_MARGIN_TOP = 8 * GRID_SIZE;
|
|
15
15
|
var MIN_BLOCK_WIDTH = 8 * GRID_SIZE;
|
|
16
16
|
var BLOCK_MARGIN_LEFT = 16 * GRID_SIZE;
|
|
@@ -24,7 +24,7 @@ var Layout = /** @class */ (function () {
|
|
|
24
24
|
this.max_height = 0;
|
|
25
25
|
}
|
|
26
26
|
Layout.prototype.get_block_geometry = function (factor) {
|
|
27
|
-
var block_height = (
|
|
27
|
+
var block_height = Math.ceil(factor.total_pin_num / 2) * BLOCK_PIN_GAP;
|
|
28
28
|
var block_width = Math.max(MIN_BLOCK_WIDTH, factor.internal.l_side + factor.internal.r_side + INTERNAL_LABEL_MARGIN);
|
|
29
29
|
var block_bounding_width = Math.max(block_width, factor.internal.l_side +
|
|
30
30
|
factor.internal.r_side +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"netlist_converter.d.ts","sourceRoot":"","sources":["../../../src/converter/netlist_to_kicad/netlist_converter.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,SAAS,EAGf,MAAM,qBAAqB,CAAA;AAM5B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"netlist_converter.d.ts","sourceRoot":"","sources":["../../../src/converter/netlist_to_kicad/netlist_converter.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,SAAS,EAGf,MAAM,qBAAqB,CAAA;AAM5B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAA;AAKtD,qBAAa,gBAAgB;IASR,OAAO,CAAC,GAAG;IAR9B,OAAO,CAAC,UAAU,CAAS;IAE3B,OAAO,CAAC,eAAe,CAAI;IAE3B,OAAO,CAAC,QAAQ,CAA6B;IAE7C,OAAO,CAAC,KAAK,CAAiB;gBAEH,GAAG,EAAE,qBAAqB;IAQrD,gBAAgB,CAAC,EAAE,EAAE,MAAM;IAI3B,gBAAgB,CAAC,EAAE,EAAE,MAAM;IAIpB,gBAAgB;IAYvB;;;;;;OAMG;IACH,OAAO,CAAC,WAAW;IA+DnB,OAAO,CAAC,0BAA0B;IAYlC,OAAO,CAAC,kBAAkB;IAY1B,OAAO,CAAC,2BAA2B;IA+CnC,OAAO,CAAC,oBAAoB;IAsC5B,OAAO,CAAC,iBAAiB;IAgCzB,OAAO,CAAC,iBAAiB;CAQ1B"}
|
|
@@ -32,7 +32,7 @@ import { gen_hierarchical_label, gen_net_label, gen_sheet_pin } from '../../kica
|
|
|
32
32
|
import { gen_sch_sheet } from '../../kicad/sheet';
|
|
33
33
|
import { gen_lib_gnd, gen_lib_vcc, gen_sch_gnd, gen_sch_vcc } from '../../kicad/symbols';
|
|
34
34
|
import { GENERATOR_NAME, GENERATOR_VERSION, SCH_VERSION } from '../../utils/constraints';
|
|
35
|
-
import { BLOCK_PIN_GAP, FONT_SIZE, Layout, WIRE_PADDING, get_power_pos
|
|
35
|
+
import { BLOCK_PIN_GAP, FONT_SIZE, Layout, WIRE_PADDING, get_power_pos } from './layout';
|
|
36
36
|
import { gen_wire } from '../../kicad/wire/gen_wire';
|
|
37
37
|
var NetListConverter = /** @class */ (function () {
|
|
38
38
|
function NetListConverter(ctx) {
|
|
@@ -220,8 +220,9 @@ var NetListConverter = /** @class */ (function () {
|
|
|
220
220
|
total_pin_num: sheet_sym.pins.length,
|
|
221
221
|
};
|
|
222
222
|
var port_count = sheet_sym.pins.length;
|
|
223
|
+
var h_count = Math.ceil(port_count / 2);
|
|
223
224
|
for (var i = 0; i < port_count; i++) {
|
|
224
|
-
var is_left = i <
|
|
225
|
+
var is_left = i < h_count;
|
|
225
226
|
var cur_pin = sheet_sym.pins[i];
|
|
226
227
|
if (is_left) {
|
|
227
228
|
factor.internal.l_side = Math.max(factor.internal.l_side, cur_pin.name.length);
|
|
@@ -254,10 +255,11 @@ var NetListConverter = /** @class */ (function () {
|
|
|
254
255
|
NetListConverter.prototype.convert_sheet_symbol = function (sheet_sym, rect, sch, sheet_names_count) {
|
|
255
256
|
var port_count = sheet_sym.pins.length;
|
|
256
257
|
var pins = [];
|
|
258
|
+
var h_count = Math.ceil(port_count / 2);
|
|
257
259
|
for (var i = 0; i < port_count; i++) {
|
|
258
|
-
var is_left = i <
|
|
260
|
+
var is_left = i < h_count;
|
|
259
261
|
var x = is_left ? rect.pos.x : rect.pos.x + rect.size.x;
|
|
260
|
-
var y = rect.pos.y + BLOCK_PIN_GAP * (
|
|
262
|
+
var y = rect.pos.y + BLOCK_PIN_GAP * Math.abs(i - h_count);
|
|
261
263
|
var justify = is_left ? 'left' : 'right';
|
|
262
264
|
var rotation = is_left ? 180 : 0;
|
|
263
265
|
pins.push(this.convert_sheet_pin(sheet_sym.pins[i], { x: x, y: y }, sch, justify, rotation, is_left));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modular-circuit/transpiler",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.88",
|
|
4
4
|
"description": "Intermediate representation of the modular circuit",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"files": [
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"js-base64": "^3.7.7",
|
|
28
28
|
"jszip": "^3.10.1",
|
|
29
29
|
"@modular-circuit/electronics-model": "0.0.54",
|
|
30
|
+
"@modular-circuit/utils": "0.0.40",
|
|
30
31
|
"@modular-circuit/ir": "0.0.61",
|
|
31
|
-
"@modular-circuit/perc": "0.0.61"
|
|
32
|
-
"@modular-circuit/utils": "0.0.40"
|
|
32
|
+
"@modular-circuit/perc": "0.0.61"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"clean": "rimraf build",
|