@modular-circuit/transpiler 0.0.85 → 0.0.86
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.
|
@@ -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;AAatD,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;IAId,gBAAgB;IAa7B;;;;;;OAMG;YACW,WAAW;IAsEzB,OAAO,CAAC,0BAA0B;IAYlC,OAAO,CAAC,kBAAkB;IAY1B,OAAO,CAAC,2BAA2B;IA8CnC,OAAO,CAAC,oBAAoB;IAqC5B,OAAO,CAAC,iBAAiB;IAgCzB,OAAO,CAAC,iBAAiB;CAQ1B"}
|
|
@@ -68,9 +68,8 @@ import { gen_hierarchical_label, gen_net_label, gen_sheet_pin } from '../../kica
|
|
|
68
68
|
import { gen_sch_sheet } from '../../kicad/sheet';
|
|
69
69
|
import { gen_lib_gnd, gen_lib_vcc, gen_sch_gnd, gen_sch_vcc } from '../../kicad/symbols';
|
|
70
70
|
import { DEFAULT_PAPER_SIZE, GENERATOR_NAME, GENERATOR_VERSION, SCH_VERSION } from '../../utils/constraints';
|
|
71
|
-
import { BLOCK_PIN_GAP, FONT_SIZE, GRID_SIZE, Layout, WIRE_PADDING, get_power_pos } from './layout';
|
|
71
|
+
import { BLOCK_PIN_GAP, FONT_SIZE, GRID_SIZE, Layout, WIRE_PADDING, get_power_pos, } from './layout';
|
|
72
72
|
import { gen_wire } from '../../kicad/wire/gen_wire';
|
|
73
|
-
import { place_blocks } from './place_blocks';
|
|
74
73
|
var NetListConverter = /** @class */ (function () {
|
|
75
74
|
function NetListConverter(ctx) {
|
|
76
75
|
var e_1, _a, e_2, _b;
|
|
@@ -163,7 +162,7 @@ var NetListConverter = /** @class */ (function () {
|
|
|
163
162
|
*/
|
|
164
163
|
NetListConverter.prototype.convert_sch = function (name, schematic) {
|
|
165
164
|
return __awaiter(this, void 0, void 0, function () {
|
|
166
|
-
var powers, sch, _a, _b, it_2, sheet_names_count, ordered_sheets,
|
|
165
|
+
var powers, sch, _a, _b, it_2, sheet_names_count, ordered_sheets, sheet_box, ordered_sheets_1, ordered_sheets_1_1, it_3, sheet_padding, block_geo, ordered_sheets_2, ordered_sheets_2_1, it_4, _c, _d, it_5;
|
|
167
166
|
var e_4, _e, e_5, _f, e_6, _g, e_7, _h;
|
|
168
167
|
var _j, _k;
|
|
169
168
|
return __generator(this, function (_l) {
|
|
@@ -221,18 +220,13 @@ var NetListConverter = /** @class */ (function () {
|
|
|
221
220
|
ordered_sheets = schematic.sheet_symbols.sort(function (a, b) {
|
|
222
221
|
return b.pins.length - a.pins.length;
|
|
223
222
|
});
|
|
224
|
-
|
|
225
|
-
sheet_size = {};
|
|
223
|
+
sheet_box = {};
|
|
226
224
|
try {
|
|
227
225
|
for (ordered_sheets_1 = __values(ordered_sheets), ordered_sheets_1_1 = ordered_sheets_1.next(); !ordered_sheets_1_1.done; ordered_sheets_1_1 = ordered_sheets_1.next()) {
|
|
228
226
|
it_3 = ordered_sheets_1_1.value;
|
|
229
227
|
sheet_padding = this.get_sheet_symbol_lb_padding(it_3);
|
|
230
228
|
block_geo = this.block_calc.get_block_geometry(sheet_padding);
|
|
231
|
-
|
|
232
|
-
x: block_geo.box.size.x / GRID_SIZE,
|
|
233
|
-
y: block_geo.box.size.y / GRID_SIZE,
|
|
234
|
-
};
|
|
235
|
-
sheet_size[it_3.uuid] = block_geo.box.size;
|
|
229
|
+
sheet_box[it_3.uuid] = block_geo.box;
|
|
236
230
|
}
|
|
237
231
|
}
|
|
238
232
|
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
@@ -242,18 +236,10 @@ var NetListConverter = /** @class */ (function () {
|
|
|
242
236
|
}
|
|
243
237
|
finally { if (e_5) throw e_5.error; }
|
|
244
238
|
}
|
|
245
|
-
sheet_pos = place_blocks(sheet_bounding_boxes, 1, DEFAULT_PAPER_SIZE.width / GRID_SIZE);
|
|
246
239
|
try {
|
|
247
240
|
for (ordered_sheets_2 = __values(ordered_sheets), ordered_sheets_2_1 = ordered_sheets_2.next(); !ordered_sheets_2_1.done; ordered_sheets_2_1 = ordered_sheets_2.next()) {
|
|
248
241
|
it_4 = ordered_sheets_2_1.value;
|
|
249
|
-
|
|
250
|
-
this.convert_sheet_symbol(it_4, {
|
|
251
|
-
pos: {
|
|
252
|
-
x: scaled_pos.x * GRID_SIZE,
|
|
253
|
-
y: scaled_pos.y * GRID_SIZE,
|
|
254
|
-
},
|
|
255
|
-
size: sheet_size[it_4.uuid],
|
|
256
|
-
}, sch, sheet_names_count);
|
|
242
|
+
this.convert_sheet_symbol(it_4, sheet_box[it_4.uuid], sch, sheet_names_count);
|
|
257
243
|
}
|
|
258
244
|
}
|
|
259
245
|
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
@@ -283,7 +269,6 @@ var NetListConverter = /** @class */ (function () {
|
|
|
283
269
|
};
|
|
284
270
|
NetListConverter.prototype.convert_hierarchical_label = function (pin, sch) {
|
|
285
271
|
var _a;
|
|
286
|
-
// FIXME: layout them in the Yoga layout
|
|
287
272
|
var pin_pos = this.block_calc.get_block_geometry({
|
|
288
273
|
internal: { l_side: 0, r_side: 0 },
|
|
289
274
|
outer: { l_side: 0, r_side: 0 },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modular-circuit/transpiler",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.86",
|
|
4
4
|
"description": "Intermediate representation of the modular circuit",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"files": [
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"js-base64": "^3.7.7",
|
|
28
28
|
"jszip": "^3.10.1",
|
|
29
|
-
"@modular-circuit/electronics-model": "0.0.54",
|
|
30
29
|
"@modular-circuit/ir": "0.0.61",
|
|
31
30
|
"@modular-circuit/perc": "0.0.61",
|
|
31
|
+
"@modular-circuit/electronics-model": "0.0.54",
|
|
32
32
|
"@modular-circuit/utils": "0.0.40"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|