@modular-circuit/transpiler 0.0.109 → 0.1.1
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.
- package/dist/index.d.mts +480 -0
- package/dist/index.d.ts +480 -0
- package/dist/index.js +3039 -0
- package/dist/index.mjs +2936 -0
- package/package.json +15 -12
- package/build/builder/graph_to_kicad/do_convert_graph_to_kicad_project.d.ts +0 -3
- package/build/builder/graph_to_kicad/do_convert_graph_to_kicad_project.d.ts.map +0 -1
- package/build/builder/graph_to_kicad/do_convert_graph_to_kicad_project.js +0 -115
- package/build/builder/graph_to_kicad/index.d.ts +0 -3
- package/build/builder/graph_to_kicad/index.d.ts.map +0 -1
- package/build/builder/graph_to_kicad/index.js +0 -63
- package/build/builder/index.d.ts +0 -2
- package/build/builder/index.d.ts.map +0 -1
- package/build/builder/index.js +0 -1
- package/build/converter/graph_to_netlist/context.d.ts +0 -13
- package/build/converter/graph_to_netlist/context.d.ts.map +0 -1
- package/build/converter/graph_to_netlist/context.js +0 -0
- package/build/converter/graph_to_netlist/graph_converter.d.ts +0 -8
- package/build/converter/graph_to_netlist/graph_converter.d.ts.map +0 -1
- package/build/converter/graph_to_netlist/graph_converter.js +0 -192
- package/build/converter/graph_to_netlist/index.d.ts +0 -3
- package/build/converter/graph_to_netlist/index.d.ts.map +0 -1
- package/build/converter/graph_to_netlist/index.js +0 -2
- package/build/converter/index.d.ts +0 -4
- package/build/converter/index.d.ts.map +0 -1
- package/build/converter/index.js +0 -3
- package/build/converter/kicad_sexpr/eeschema/drawing_sheet/index.d.ts +0 -2
- package/build/converter/kicad_sexpr/eeschema/drawing_sheet/index.d.ts.map +0 -1
- package/build/converter/kicad_sexpr/eeschema/drawing_sheet/index.js +0 -5
- package/build/converter/kicad_sexpr/eeschema/drawing_sheet/sch_default_drawing_sheet.d.ts +0 -2
- package/build/converter/kicad_sexpr/eeschema/drawing_sheet/sch_default_drawing_sheet.d.ts.map +0 -1
- package/build/converter/kicad_sexpr/eeschema/drawing_sheet/sch_default_drawing_sheet.js +0 -1
- package/build/converter/kicad_sexpr/eeschema/index.d.ts +0 -3
- package/build/converter/kicad_sexpr/eeschema/index.d.ts.map +0 -1
- package/build/converter/kicad_sexpr/eeschema/index.js +0 -2
- package/build/converter/kicad_sexpr/eeschema/printer.d.ts +0 -38
- package/build/converter/kicad_sexpr/eeschema/printer.d.ts.map +0 -1
- package/build/converter/kicad_sexpr/eeschema/printer.js +0 -296
- package/build/converter/kicad_sexpr/index.d.ts +0 -3
- package/build/converter/kicad_sexpr/index.d.ts.map +0 -1
- package/build/converter/kicad_sexpr/index.js +0 -2
- package/build/converter/kicad_sexpr/pcb/index.d.ts +0 -2
- package/build/converter/kicad_sexpr/pcb/index.d.ts.map +0 -1
- package/build/converter/kicad_sexpr/pcb/index.js +0 -1
- package/build/converter/link_to_netlist/context.d.ts +0 -12
- package/build/converter/link_to_netlist/context.d.ts.map +0 -1
- package/build/converter/link_to_netlist/context.js +0 -0
- package/build/converter/link_to_netlist/converter.d.ts +0 -13
- package/build/converter/link_to_netlist/converter.d.ts.map +0 -1
- package/build/converter/link_to_netlist/converter.js +0 -154
- package/build/converter/link_to_netlist/index.d.ts +0 -3
- package/build/converter/link_to_netlist/index.d.ts.map +0 -1
- package/build/converter/link_to_netlist/index.js +0 -2
- package/build/converter/link_to_netlist/links/converter_base.d.ts +0 -30
- package/build/converter/link_to_netlist/links/converter_base.d.ts.map +0 -1
- package/build/converter/link_to_netlist/links/converter_base.js +0 -156
- package/build/converter/link_to_netlist/links/converters.d.ts +0 -51
- package/build/converter/link_to_netlist/links/converters.d.ts.map +0 -1
- package/build/converter/link_to_netlist/links/converters.js +0 -1190
- package/build/converter/link_to_netlist/links/index.d.ts +0 -3
- package/build/converter/link_to_netlist/links/index.d.ts.map +0 -1
- package/build/converter/link_to_netlist/links/index.js +0 -2
- package/build/converter/netlist_to_kicad/context.d.ts +0 -10
- package/build/converter/netlist_to_kicad/context.d.ts.map +0 -1
- package/build/converter/netlist_to_kicad/context.js +0 -0
- package/build/converter/netlist_to_kicad/index.d.ts +0 -4
- package/build/converter/netlist_to_kicad/index.d.ts.map +0 -1
- package/build/converter/netlist_to_kicad/index.js +0 -3
- package/build/converter/netlist_to_kicad/layout.d.ts +0 -38
- package/build/converter/netlist_to_kicad/layout.d.ts.map +0 -1
- package/build/converter/netlist_to_kicad/layout.js +0 -194
- package/build/converter/netlist_to_kicad/netlist_converter.d.ts +0 -28
- package/build/converter/netlist_to_kicad/netlist_converter.d.ts.map +0 -1
- package/build/converter/netlist_to_kicad/netlist_converter.js +0 -398
- package/build/converter/netlist_to_kicad/place_blocks.d.ts +0 -6
- package/build/converter/netlist_to_kicad/place_blocks.d.ts.map +0 -1
- package/build/converter/netlist_to_kicad/place_blocks.js +0 -59
- package/build/index.d.ts +0 -6
- package/build/index.d.ts.map +0 -1
- package/build/index.js +0 -5
- package/build/kicad/constraints/index.d.ts +0 -5
- package/build/kicad/constraints/index.d.ts.map +0 -1
- package/build/kicad/constraints/index.js +0 -4
- package/build/kicad/index.d.ts +0 -1
- package/build/kicad/index.d.ts.map +0 -1
- package/build/kicad/index.js +0 -1
- package/build/kicad/label/index.d.ts +0 -3
- package/build/kicad/label/index.d.ts.map +0 -1
- package/build/kicad/label/index.js +0 -2
- package/build/kicad/label/net_label.d.ts +0 -4
- package/build/kicad/label/net_label.d.ts.map +0 -1
- package/build/kicad/label/net_label.js +0 -14
- package/build/kicad/label/sheet_pin.d.ts +0 -5
- package/build/kicad/label/sheet_pin.d.ts.map +0 -1
- package/build/kicad/label/sheet_pin.js +0 -25
- package/build/kicad/project/index.d.ts +0 -3
- package/build/kicad/project/index.d.ts.map +0 -1
- package/build/kicad/project/index.js +0 -2
- package/build/kicad/project/kicad_prl.d.ts +0 -48
- package/build/kicad/project/kicad_prl.d.ts.map +0 -1
- package/build/kicad/project/kicad_prl.js +0 -50
- package/build/kicad/project/kicad_pro.d.ts +0 -176
- package/build/kicad/project/kicad_pro.d.ts.map +0 -1
- package/build/kicad/project/kicad_pro.js +0 -224
- package/build/kicad/project/kicad_project_archive.d.ts +0 -237
- package/build/kicad/project/kicad_project_archive.d.ts.map +0 -1
- package/build/kicad/project/kicad_project_archive.js +0 -53
- package/build/kicad/project/wildcards_and_files_ext.d.ts +0 -62
- package/build/kicad/project/wildcards_and_files_ext.d.ts.map +0 -1
- package/build/kicad/project/wildcards_and_files_ext.js +0 -61
- package/build/kicad/sheet/index.d.ts +0 -2
- package/build/kicad/sheet/index.d.ts.map +0 -1
- package/build/kicad/sheet/index.js +0 -1
- package/build/kicad/sheet/sheet.d.ts +0 -8
- package/build/kicad/sheet/sheet.d.ts.map +0 -1
- package/build/kicad/sheet/sheet.js +0 -44
- package/build/kicad/symbols/index.d.ts +0 -3
- package/build/kicad/symbols/index.d.ts.map +0 -1
- package/build/kicad/symbols/index.js +0 -2
- package/build/kicad/symbols/lib_symbol/gnd.d.ts +0 -3
- package/build/kicad/symbols/lib_symbol/gnd.d.ts.map +0 -1
- package/build/kicad/symbols/lib_symbol/gnd.js +0 -121
- package/build/kicad/symbols/lib_symbol/index.d.ts +0 -3
- package/build/kicad/symbols/lib_symbol/index.d.ts.map +0 -1
- package/build/kicad/symbols/lib_symbol/index.js +0 -2
- package/build/kicad/symbols/lib_symbol/vcc.d.ts +0 -3
- package/build/kicad/symbols/lib_symbol/vcc.d.ts.map +0 -1
- package/build/kicad/symbols/lib_symbol/vcc.js +0 -119
- package/build/kicad/symbols/sch_symbol/gnd.d.ts +0 -4
- package/build/kicad/symbols/sch_symbol/gnd.d.ts.map +0 -1
- package/build/kicad/symbols/sch_symbol/gnd.js +0 -66
- package/build/kicad/symbols/sch_symbol/index.d.ts +0 -3
- package/build/kicad/symbols/sch_symbol/index.d.ts.map +0 -1
- package/build/kicad/symbols/sch_symbol/index.js +0 -2
- package/build/kicad/symbols/sch_symbol/vcc.d.ts +0 -4
- package/build/kicad/symbols/sch_symbol/vcc.d.ts.map +0 -1
- package/build/kicad/symbols/sch_symbol/vcc.js +0 -66
- package/build/kicad/symbols/symbol_utils.d.ts +0 -2
- package/build/kicad/symbols/symbol_utils.d.ts.map +0 -1
- package/build/kicad/symbols/symbol_utils.js +0 -1
- package/build/kicad/wire/gen_wire.d.ts +0 -4
- package/build/kicad/wire/gen_wire.d.ts.map +0 -1
- package/build/kicad/wire/gen_wire.js +0 -12
- package/build/tsconfig.build.tsbuildinfo +0 -1
- package/build/utils/collect_sub_sheets.d.ts +0 -7
- package/build/utils/collect_sub_sheets.d.ts.map +0 -1
- package/build/utils/collect_sub_sheets.js +0 -156
- package/build/utils/collect_sub_sheets_by_id.d.ts +0 -7
- package/build/utils/collect_sub_sheets_by_id.d.ts.map +0 -1
- package/build/utils/collect_sub_sheets_by_id.js +0 -150
- package/build/utils/constraints.d.ts +0 -11
- package/build/utils/constraints.d.ts.map +0 -1
- package/build/utils/constraints.js +0 -17
- package/build/utils/filter_null_undefined.d.ts +0 -2
- package/build/utils/filter_null_undefined.d.ts.map +0 -1
- package/build/utils/filter_null_undefined.js +0 -39
- package/build/utils/index.d.ts +0 -6
- package/build/utils/index.d.ts.map +0 -1
- package/build/utils/index.js +0 -5
- package/build/utils/string_formatter.d.ts +0 -14
- package/build/utils/string_formatter.d.ts.map +0 -1
- package/build/utils/string_formatter.js +0 -35
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { type At, type Color, type VECTOR2 } from '@modular-circuit/electronics-model';
|
|
2
|
-
import { type Drawing, type Effects, type Fill, type Justify, type LIB_SYMBOL, type PIN_DEFINITION, type PIN_DISPLAY_OPT, type PIN_INSTANCE, type SCHEMATIC, type SCH_FIELD, type SCH_LABEL, type SCH_LINE, type SCH_SHEET, type SCH_SHEET_PIN, type SCH_SYMBOL, type Stroke } from '@modular-circuit/ir';
|
|
3
|
-
export declare class SCHEMATIC_PRINTER {
|
|
4
|
-
schematic(sch: SCHEMATIC): string;
|
|
5
|
-
power(power?: boolean): "" | "(power)";
|
|
6
|
-
pin_display_opt(opt?: {
|
|
7
|
-
pin_numbers?: PIN_DISPLAY_OPT;
|
|
8
|
-
pin_names?: PIN_DISPLAY_OPT;
|
|
9
|
-
}): string | undefined;
|
|
10
|
-
lib_symbol(lib_symbol: LIB_SYMBOL): string;
|
|
11
|
-
lib_children(libs?: LIB_SYMBOL[]): string;
|
|
12
|
-
pts(points: VECTOR2[]): string;
|
|
13
|
-
drawings(draws?: Drawing[]): string | undefined;
|
|
14
|
-
drawing(draw: Drawing): string;
|
|
15
|
-
pin_defs(defs?: PIN_DEFINITION[]): string | undefined;
|
|
16
|
-
pin_def(def: PIN_DEFINITION): string;
|
|
17
|
-
label(label: SCH_LABEL): string;
|
|
18
|
-
unit(c?: number): string;
|
|
19
|
-
sch_symbol(sch_symbol: SCH_SYMBOL): string;
|
|
20
|
-
wire(w: SCH_LINE): string;
|
|
21
|
-
lib_id(id?: string | null): string | undefined;
|
|
22
|
-
sch_symbol_pin(pin: PIN_INSTANCE): string;
|
|
23
|
-
sch_sheet(sheet: SCH_SHEET): string;
|
|
24
|
-
sch_sheet_pin(sheet_pin: SCH_SHEET_PIN): string;
|
|
25
|
-
at(pos: At): string;
|
|
26
|
-
uuid(id: string): string;
|
|
27
|
-
effects(e: Effects): string;
|
|
28
|
-
justify(justify?: Justify): string | undefined;
|
|
29
|
-
booleans(it: unknown): string | undefined;
|
|
30
|
-
fields(fields?: SCH_FIELD[]): string | undefined;
|
|
31
|
-
field(field: SCH_FIELD): string;
|
|
32
|
-
fill(f?: Partial<Fill>): string | undefined;
|
|
33
|
-
size(s: VECTOR2): string;
|
|
34
|
-
fields_autoplaced(): string;
|
|
35
|
-
stroke(s?: Stroke): string | undefined;
|
|
36
|
-
color(c?: Color): string | undefined;
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=printer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"printer.d.ts","sourceRoot":"","sources":["../../../../src/converter/kicad_sexpr/eeschema/printer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,KAAK,EAA+B,KAAK,OAAO,EAAE,MAAM,oCAAoC,CAAA;AACnH,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,IAAI,EACT,KAAK,OAAO,EACZ,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,UAAU,EAEf,KAAK,MAAM,EACZ,MAAM,qBAAqB,CAAA;AAU5B,qBAAa,iBAAiB;IAC5B,SAAS,CAAC,GAAG,EAAE,SAAS;IA2CxB,KAAK,CAAC,KAAK,CAAC,EAAE,OAAO;IAKrB,eAAe,CAAC,GAAG,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,eAAe,CAAC;QAAC,SAAS,CAAC,EAAE,eAAe,CAAA;KAAE;IAapF,UAAU,CAAC,UAAU,EAAE,UAAU,GAAG,MAAM;IAc1C,YAAY,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,GAAG,MAAM;IAKzC,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE;IAKrB,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE;IAI1B,OAAO,CAAC,IAAI,EAAE,OAAO;IAgBrB,QAAQ,CAAC,IAAI,CAAC,EAAE,cAAc,EAAE;IAKhC,OAAO,CAAC,GAAG,EAAE,cAAc;IAa3B,KAAK,CAAC,KAAK,EAAE,SAAS;IAUtB,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM;IAIf,UAAU,CAAC,UAAU,EAAE,UAAU;IAWjC,IAAI,CAAC,CAAC,EAAE,QAAQ;IAShB,MAAM,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI;IAKzB,cAAc,CAAC,GAAG,EAAE,YAAY;IAIhC,SAAS,CAAC,KAAK,EAAE,SAAS;IAa1B,aAAa,CAAC,SAAS,EAAE,aAAa;IAQtC,EAAE,CAAC,GAAG,EAAE,EAAE;IAIV,IAAI,CAAC,EAAE,EAAE,MAAM;IAGf,OAAO,CAAC,CAAC,EAAE,OAAO;IASlB,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO;IAKzB,QAAQ,CAAC,EAAE,EAAE,OAAO;IAUpB,MAAM,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE;IAK3B,KAAK,CAAC,KAAK,EAAE,SAAS;IAQtB,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC;IAKtB,IAAI,CAAC,CAAC,EAAE,OAAO;IAGf,iBAAiB;IAKjB,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM;IAUjB,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK;CAIhB"}
|
|
@@ -1,296 +0,0 @@
|
|
|
1
|
-
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
2
|
-
var useValue = arguments.length > 2;
|
|
3
|
-
for (var i = 0; i < initializers.length; i++) {
|
|
4
|
-
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
5
|
-
}
|
|
6
|
-
return useValue ? value : void 0;
|
|
7
|
-
};
|
|
8
|
-
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
9
|
-
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
10
|
-
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
11
|
-
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
12
|
-
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
13
|
-
var _, done = false;
|
|
14
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
15
|
-
var context = {};
|
|
16
|
-
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
17
|
-
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
18
|
-
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
19
|
-
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
20
|
-
if (kind === "accessor") {
|
|
21
|
-
if (result === void 0) continue;
|
|
22
|
-
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
23
|
-
if (_ = accept(result.get)) descriptor.get = _;
|
|
24
|
-
if (_ = accept(result.set)) descriptor.set = _;
|
|
25
|
-
if (_ = accept(result.init)) initializers.unshift(_);
|
|
26
|
-
}
|
|
27
|
-
else if (_ = accept(result)) {
|
|
28
|
-
if (kind === "field") initializers.unshift(_);
|
|
29
|
-
else descriptor[key] = _;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
33
|
-
done = true;
|
|
34
|
-
};
|
|
35
|
-
var __values = (this && this.__values) || function(o) {
|
|
36
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
37
|
-
if (m) return m.call(o);
|
|
38
|
-
if (o && typeof o.length === "number") return {
|
|
39
|
-
next: function () {
|
|
40
|
-
if (o && i >= o.length) o = void 0;
|
|
41
|
-
return { value: o && o[i++], done: !o };
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
45
|
-
};
|
|
46
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
47
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
48
|
-
if (!m) return o;
|
|
49
|
-
var i = m.call(o), r, ar = [], e;
|
|
50
|
-
try {
|
|
51
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
52
|
-
}
|
|
53
|
-
catch (error) { e = { error: error }; }
|
|
54
|
-
finally {
|
|
55
|
-
try {
|
|
56
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
57
|
-
}
|
|
58
|
-
finally { if (e) throw e.error; }
|
|
59
|
-
}
|
|
60
|
-
return ar;
|
|
61
|
-
};
|
|
62
|
-
import { READABLE_ELECTRICAL_PINTYPE } from '@modular-circuit/electronics-model';
|
|
63
|
-
import { SHAPE_T, } from '@modular-circuit/ir';
|
|
64
|
-
import { gen_uuid } from '@modular-circuit/utils';
|
|
65
|
-
import { GENERATOR_NAME, GENERATOR_VERSION, PAPER, SCH_VERSION, filterNullOrUndefined } from '../../../utils';
|
|
66
|
-
var SCOPE_START = '\n\t';
|
|
67
|
-
var SPACE = ' ';
|
|
68
|
-
var SCOPE_END = '\n';
|
|
69
|
-
var IGNORE_BOOLEANS = new Set(['power']);
|
|
70
|
-
var SCHEMATIC_PRINTER = function () {
|
|
71
|
-
var _a;
|
|
72
|
-
var _instanceExtraInitializers = [];
|
|
73
|
-
var _power_decorators;
|
|
74
|
-
var _pin_display_opt_decorators;
|
|
75
|
-
var _lib_children_decorators;
|
|
76
|
-
var _drawings_decorators;
|
|
77
|
-
var _pin_defs_decorators;
|
|
78
|
-
var _unit_decorators;
|
|
79
|
-
var _lib_id_decorators;
|
|
80
|
-
var _justify_decorators;
|
|
81
|
-
var _fields_decorators;
|
|
82
|
-
var _fill_decorators;
|
|
83
|
-
var _stroke_decorators;
|
|
84
|
-
var _color_decorators;
|
|
85
|
-
return _a = /** @class */ (function () {
|
|
86
|
-
function SCHEMATIC_PRINTER() {
|
|
87
|
-
__runInitializers(this, _instanceExtraInitializers);
|
|
88
|
-
}
|
|
89
|
-
SCHEMATIC_PRINTER.prototype.schematic = function (sch) {
|
|
90
|
-
var _this = this;
|
|
91
|
-
var lib_symbols = (function () {
|
|
92
|
-
var _b, _c;
|
|
93
|
-
if (!((_b = sch.lib_symbols) === null || _b === void 0 ? void 0 : _b.symbols.length))
|
|
94
|
-
return '';
|
|
95
|
-
return "".concat(SCOPE_START, "(lib_symbols ").concat((_c = sch.lib_symbols) === null || _c === void 0 ? void 0 : _c.symbols.map(function (it) { return _this.lib_symbol(it); }).join("".concat(SCOPE_END)), "\t)");
|
|
96
|
-
})();
|
|
97
|
-
var wires = (function () {
|
|
98
|
-
var _b;
|
|
99
|
-
if (!((_b = sch.wires) === null || _b === void 0 ? void 0 : _b.length))
|
|
100
|
-
return '';
|
|
101
|
-
return "".concat(SCOPE_START).concat(sch.wires.map(function (it) { return _this.wire(it); }).join("".concat(SCOPE_END)), "\t");
|
|
102
|
-
})();
|
|
103
|
-
var labels = (function () {
|
|
104
|
-
var _b;
|
|
105
|
-
if (!((_b = sch.labels) === null || _b === void 0 ? void 0 : _b.length))
|
|
106
|
-
return '';
|
|
107
|
-
return "".concat(SCOPE_START).concat(sch.labels.map(function (it) { return _this.label(it); }).join("".concat(SCOPE_END)));
|
|
108
|
-
})();
|
|
109
|
-
var sch_sheets = (function () {
|
|
110
|
-
var _b;
|
|
111
|
-
if (!((_b = sch.sheets) === null || _b === void 0 ? void 0 : _b.length))
|
|
112
|
-
return '';
|
|
113
|
-
return "".concat(SCOPE_START).concat(sch.sheets.map(function (it) { return _this.sch_sheet(it); }).join("".concat(SCOPE_END)), "\t");
|
|
114
|
-
})();
|
|
115
|
-
var sch_symbols = (function () {
|
|
116
|
-
var _b;
|
|
117
|
-
if (!((_b = sch.symbols) === null || _b === void 0 ? void 0 : _b.length))
|
|
118
|
-
return '';
|
|
119
|
-
return "".concat(SCOPE_START).concat(sch.symbols.map(function (it) { return _this.sch_symbol(it); }).join("".concat(SCOPE_END)), "\t");
|
|
120
|
-
})();
|
|
121
|
-
return "\n(kicad_sch\n (version ".concat(SCH_VERSION, ")\n (generator \"").concat(GENERATOR_NAME, "\")\n (generator_version \"").concat(GENERATOR_VERSION, "\")\n (uuid \"").concat(gen_uuid(), "\")\n (paper \"").concat(PAPER, "\")\n ").concat(lib_symbols, "\n ").concat(wires, "\n ").concat(labels, "\n ").concat(sch_symbols, "\n ").concat(sch_sheets, "\n)\n ");
|
|
122
|
-
};
|
|
123
|
-
SCHEMATIC_PRINTER.prototype.power = function (power) {
|
|
124
|
-
return power ? '(power)' : '';
|
|
125
|
-
};
|
|
126
|
-
SCHEMATIC_PRINTER.prototype.pin_display_opt = function (opt) {
|
|
127
|
-
if (!opt)
|
|
128
|
-
return;
|
|
129
|
-
var offset = function (off) { return (off ? "(offset ".concat(off, ")") : ''); };
|
|
130
|
-
var hide = function (h) { return (h ? 'hide' : ''); };
|
|
131
|
-
var pin_numbers = "".concat(opt.pin_numbers ? "(pin_numbers ".concat(offset(opt.pin_numbers.offset), " ").concat(hide(opt.pin_numbers.hide), ")") : '');
|
|
132
|
-
var pin_names = "".concat(opt.pin_names ? "(pin_names ".concat(offset(opt.pin_names.offset), " ").concat(hide(opt.pin_names.hide), ")") : '');
|
|
133
|
-
return "".concat(pin_numbers, "\n ").concat(pin_names, "\n ");
|
|
134
|
-
};
|
|
135
|
-
SCHEMATIC_PRINTER.prototype.lib_symbol = function (lib_symbol) {
|
|
136
|
-
return "\n (symbol \"".concat(lib_symbol.name, "\" ").concat(this.power(lib_symbol.power), "\n ").concat(this.pin_display_opt(lib_symbol), "\n ").concat(this.booleans(lib_symbol), "\n ").concat(this.fields(lib_symbol.properties), "\n ").concat(this.pin_defs(lib_symbol.pins), "\n ").concat(this.drawings(lib_symbol.drawings), "\n ").concat(this.lib_children(lib_symbol.children), "\n)\n ");
|
|
137
|
-
};
|
|
138
|
-
SCHEMATIC_PRINTER.prototype.lib_children = function (libs) {
|
|
139
|
-
var _this = this;
|
|
140
|
-
if (!libs)
|
|
141
|
-
return '';
|
|
142
|
-
return libs.map(function (i) { return _this.lib_symbol(i); }).join(SCOPE_END);
|
|
143
|
-
};
|
|
144
|
-
SCHEMATIC_PRINTER.prototype.pts = function (points) {
|
|
145
|
-
return "(pts ".concat(points.map(function (i) { return "(xy ".concat(i.x, " ").concat(i.y, " )"); }).join(SPACE), ")");
|
|
146
|
-
};
|
|
147
|
-
SCHEMATIC_PRINTER.prototype.drawings = function (draws) {
|
|
148
|
-
var _this = this;
|
|
149
|
-
if (!draws)
|
|
150
|
-
return;
|
|
151
|
-
return draws.map(function (i) { return _this.drawing(i); }).join(SCOPE_END);
|
|
152
|
-
};
|
|
153
|
-
SCHEMATIC_PRINTER.prototype.drawing = function (draw) {
|
|
154
|
-
if (!('shape' in draw))
|
|
155
|
-
throw new Error("Unhandled drawing ".concat(draw));
|
|
156
|
-
switch (draw.shape) {
|
|
157
|
-
case SHAPE_T.POLY:
|
|
158
|
-
return "(polyline\n ".concat(this.pts(draw.pts), "\n ").concat(this.stroke(draw.stroke), "\n ").concat(this.fill(draw.fill), "\n\t\t\t\t)");
|
|
159
|
-
}
|
|
160
|
-
throw new Error("Unhandled drawing ".concat(draw));
|
|
161
|
-
};
|
|
162
|
-
SCHEMATIC_PRINTER.prototype.pin_defs = function (defs) {
|
|
163
|
-
var _this = this;
|
|
164
|
-
if (!defs)
|
|
165
|
-
return;
|
|
166
|
-
return defs.map(function (it) { return _this.pin_def(it); }).join(SCOPE_END);
|
|
167
|
-
};
|
|
168
|
-
SCHEMATIC_PRINTER.prototype.pin_def = function (def) {
|
|
169
|
-
return "(pin ".concat(READABLE_ELECTRICAL_PINTYPE[def.type], " ").concat(def.shape, "\n\t\t\t\t\t").concat(this.at(def.at), "\n\t\t\t\t\t(length ").concat(def.length, ")\n\t\t\t\t\t(name \"").concat(def.name.text, "\"\n ").concat(this.effects(def.name.effects), "\n\t\t\t\t\t)\n\t\t\t\t\t(number \"").concat(def.number.text, "\"\n ").concat(this.effects(def.number.effects), "\n\t\t\t\t\t)\n\t\t\t\t)");
|
|
170
|
-
};
|
|
171
|
-
SCHEMATIC_PRINTER.prototype.label = function (label) {
|
|
172
|
-
return "\t(".concat(label.label_type, " \"").concat(label.text, "\"\n\t\t").concat(this.at(label.at), "\n ").concat(this.fields_autoplaced(), "\n ").concat(this.effects(label.effects), "\n\t\t").concat(this.uuid(label.uuid), "\n\t)");
|
|
173
|
-
};
|
|
174
|
-
SCHEMATIC_PRINTER.prototype.unit = function (c) {
|
|
175
|
-
return "(unit ".concat(c, ")");
|
|
176
|
-
};
|
|
177
|
-
SCHEMATIC_PRINTER.prototype.sch_symbol = function (sch_symbol) {
|
|
178
|
-
var _this = this;
|
|
179
|
-
return "(symbol\n\t\t".concat(this.lib_id(sch_symbol.lib_id), "\n\t\t").concat(this.at(sch_symbol.at), "\n\t\t").concat(this.unit(sch_symbol.unit), "\n ").concat(this.booleans(sch_symbol), "\n\t\t").concat(this.fields(sch_symbol.properties), "\n ").concat(sch_symbol.pins.map(function (pin) { return _this.sch_symbol_pin(pin); }).join(SCOPE_START), "\n\t)");
|
|
180
|
-
};
|
|
181
|
-
SCHEMATIC_PRINTER.prototype.wire = function (w) {
|
|
182
|
-
return "(wire\n ".concat(this.pts([w.start, w.end]), "\n ").concat(this.stroke(w.stroke), "\n ").concat(this.uuid(w.uuid), "\n )");
|
|
183
|
-
};
|
|
184
|
-
SCHEMATIC_PRINTER.prototype.lib_id = function (id) {
|
|
185
|
-
if (!id)
|
|
186
|
-
return;
|
|
187
|
-
return "(lib_id \"".concat(id, "\")");
|
|
188
|
-
};
|
|
189
|
-
SCHEMATIC_PRINTER.prototype.sch_symbol_pin = function (pin) {
|
|
190
|
-
return "(pin \"".concat(pin.number, "\" ").concat(this.uuid(pin.uuid), ")");
|
|
191
|
-
};
|
|
192
|
-
SCHEMATIC_PRINTER.prototype.sch_sheet = function (sheet) {
|
|
193
|
-
var _this = this;
|
|
194
|
-
return "(sheet \n ".concat(this.at(sheet.at), "\n ").concat(this.size(sheet.size), "\n ").concat(this.fields_autoplaced(), "\n ").concat(this.stroke(sheet.stroke), "\n ").concat(this.fill(sheet.fill), "\n ").concat(this.uuid(sheet.uuid), "\n ").concat(this.fields(sheet.fields), "\n ").concat(sheet.pins.map(function (sheet_pin) { return _this.sch_sheet_pin(sheet_pin); }).join(SCOPE_START), "\n )");
|
|
195
|
-
};
|
|
196
|
-
SCHEMATIC_PRINTER.prototype.sch_sheet_pin = function (sheet_pin) {
|
|
197
|
-
return "(pin \"".concat(sheet_pin.text, "\" ").concat(sheet_pin.shape, "\n\t\t\t").concat(this.at(sheet_pin.at), "\n ").concat(this.effects(sheet_pin.effects), "\n\t\t\t").concat(this.uuid(sheet_pin.uuid), "\n\t\t)");
|
|
198
|
-
};
|
|
199
|
-
SCHEMATIC_PRINTER.prototype.at = function (pos) {
|
|
200
|
-
return "(at ".concat(pos.position.x, " ").concat(pos.position.y, " ").concat(pos.rotation === undefined ? '' : pos.rotation, ")");
|
|
201
|
-
};
|
|
202
|
-
SCHEMATIC_PRINTER.prototype.uuid = function (id) {
|
|
203
|
-
return "(uuid \"".concat(id, "\")");
|
|
204
|
-
};
|
|
205
|
-
SCHEMATIC_PRINTER.prototype.effects = function (e) {
|
|
206
|
-
return "(effects\n (font\n (size ".concat(e.font.size.x, " ").concat(e.font.size.y, ")\n )").concat(this.justify(e.justify)).concat(e.hide ? '(hide yes)' : '', "\n )");
|
|
207
|
-
};
|
|
208
|
-
SCHEMATIC_PRINTER.prototype.justify = function (justify) {
|
|
209
|
-
if (!justify)
|
|
210
|
-
return;
|
|
211
|
-
return "(justify ".concat(justify.horizontal, " ").concat(justify.vertical, ")");
|
|
212
|
-
};
|
|
213
|
-
SCHEMATIC_PRINTER.prototype.booleans = function (it) {
|
|
214
|
-
var e_1, _b;
|
|
215
|
-
if (typeof it !== 'object' || !it)
|
|
216
|
-
return;
|
|
217
|
-
var res = [];
|
|
218
|
-
try {
|
|
219
|
-
for (var _c = __values(Object.entries(it)), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
220
|
-
var _e = __read(_d.value, 2), k = _e[0], v = _e[1];
|
|
221
|
-
if (typeof v === 'boolean' && !IGNORE_BOOLEANS.has(k))
|
|
222
|
-
res.push("( ".concat(k, " ").concat(v ? 'yes' : 'no', " )"));
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
226
|
-
finally {
|
|
227
|
-
try {
|
|
228
|
-
if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
|
|
229
|
-
}
|
|
230
|
-
finally { if (e_1) throw e_1.error; }
|
|
231
|
-
}
|
|
232
|
-
return res.join(SCOPE_START);
|
|
233
|
-
};
|
|
234
|
-
SCHEMATIC_PRINTER.prototype.fields = function (fields) {
|
|
235
|
-
var _this = this;
|
|
236
|
-
if (!fields)
|
|
237
|
-
return;
|
|
238
|
-
return fields.map(function (f) { return _this.field(f); }).join(SCOPE_START);
|
|
239
|
-
};
|
|
240
|
-
SCHEMATIC_PRINTER.prototype.field = function (field) {
|
|
241
|
-
return "(property \"".concat(field.name, "\" \"").concat(field.text, "\"\n\t\t\t").concat(this.at(field.at), "\n ").concat(this.effects(field.effects), "\n\t\t)");
|
|
242
|
-
};
|
|
243
|
-
SCHEMATIC_PRINTER.prototype.fill = function (f) {
|
|
244
|
-
if (!f)
|
|
245
|
-
return;
|
|
246
|
-
return "(fill".concat(f.type ? " (type ".concat(f.type, ")") : '', " ").concat(this.color(f.color), ")");
|
|
247
|
-
};
|
|
248
|
-
SCHEMATIC_PRINTER.prototype.size = function (s) {
|
|
249
|
-
return "(size ".concat(s.x, " ").concat(s.y, ")");
|
|
250
|
-
};
|
|
251
|
-
SCHEMATIC_PRINTER.prototype.fields_autoplaced = function () {
|
|
252
|
-
return '(fields_autoplaced yes)';
|
|
253
|
-
};
|
|
254
|
-
SCHEMATIC_PRINTER.prototype.stroke = function (s) {
|
|
255
|
-
if (!s)
|
|
256
|
-
return;
|
|
257
|
-
return "(stroke\n\t\t\t(width ".concat(s.width, ")\n\t\t\t(type ").concat(s.type, ")\n ").concat(this.color(s.color), "\n\t\t)");
|
|
258
|
-
};
|
|
259
|
-
SCHEMATIC_PRINTER.prototype.color = function (c) {
|
|
260
|
-
if (!c)
|
|
261
|
-
return;
|
|
262
|
-
return "(color ".concat(c.r, " ").concat(c.g, " ").concat(c.b, " ").concat(c.a, ")");
|
|
263
|
-
};
|
|
264
|
-
return SCHEMATIC_PRINTER;
|
|
265
|
-
}()),
|
|
266
|
-
(function () {
|
|
267
|
-
var _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
268
|
-
_power_decorators = [filterNullOrUndefined];
|
|
269
|
-
_pin_display_opt_decorators = [filterNullOrUndefined];
|
|
270
|
-
_lib_children_decorators = [filterNullOrUndefined];
|
|
271
|
-
_drawings_decorators = [filterNullOrUndefined];
|
|
272
|
-
_pin_defs_decorators = [filterNullOrUndefined];
|
|
273
|
-
_unit_decorators = [filterNullOrUndefined];
|
|
274
|
-
_lib_id_decorators = [filterNullOrUndefined];
|
|
275
|
-
_justify_decorators = [filterNullOrUndefined];
|
|
276
|
-
_fields_decorators = [filterNullOrUndefined];
|
|
277
|
-
_fill_decorators = [filterNullOrUndefined];
|
|
278
|
-
_stroke_decorators = [filterNullOrUndefined];
|
|
279
|
-
_color_decorators = [filterNullOrUndefined];
|
|
280
|
-
__esDecorate(_a, null, _power_decorators, { kind: "method", name: "power", static: false, private: false, access: { has: function (obj) { return "power" in obj; }, get: function (obj) { return obj.power; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
281
|
-
__esDecorate(_a, null, _pin_display_opt_decorators, { kind: "method", name: "pin_display_opt", static: false, private: false, access: { has: function (obj) { return "pin_display_opt" in obj; }, get: function (obj) { return obj.pin_display_opt; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
282
|
-
__esDecorate(_a, null, _lib_children_decorators, { kind: "method", name: "lib_children", static: false, private: false, access: { has: function (obj) { return "lib_children" in obj; }, get: function (obj) { return obj.lib_children; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
283
|
-
__esDecorate(_a, null, _drawings_decorators, { kind: "method", name: "drawings", static: false, private: false, access: { has: function (obj) { return "drawings" in obj; }, get: function (obj) { return obj.drawings; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
284
|
-
__esDecorate(_a, null, _pin_defs_decorators, { kind: "method", name: "pin_defs", static: false, private: false, access: { has: function (obj) { return "pin_defs" in obj; }, get: function (obj) { return obj.pin_defs; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
285
|
-
__esDecorate(_a, null, _unit_decorators, { kind: "method", name: "unit", static: false, private: false, access: { has: function (obj) { return "unit" in obj; }, get: function (obj) { return obj.unit; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
286
|
-
__esDecorate(_a, null, _lib_id_decorators, { kind: "method", name: "lib_id", static: false, private: false, access: { has: function (obj) { return "lib_id" in obj; }, get: function (obj) { return obj.lib_id; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
287
|
-
__esDecorate(_a, null, _justify_decorators, { kind: "method", name: "justify", static: false, private: false, access: { has: function (obj) { return "justify" in obj; }, get: function (obj) { return obj.justify; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
288
|
-
__esDecorate(_a, null, _fields_decorators, { kind: "method", name: "fields", static: false, private: false, access: { has: function (obj) { return "fields" in obj; }, get: function (obj) { return obj.fields; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
289
|
-
__esDecorate(_a, null, _fill_decorators, { kind: "method", name: "fill", static: false, private: false, access: { has: function (obj) { return "fill" in obj; }, get: function (obj) { return obj.fill; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
290
|
-
__esDecorate(_a, null, _stroke_decorators, { kind: "method", name: "stroke", static: false, private: false, access: { has: function (obj) { return "stroke" in obj; }, get: function (obj) { return obj.stroke; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
291
|
-
__esDecorate(_a, null, _color_decorators, { kind: "method", name: "color", static: false, private: false, access: { has: function (obj) { return "color" in obj; }, get: function (obj) { return obj.color; } }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
292
|
-
if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
293
|
-
})(),
|
|
294
|
-
_a;
|
|
295
|
-
}();
|
|
296
|
-
export { SCHEMATIC_PRINTER };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/converter/kicad_sexpr/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,OAAO,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/converter/kicad_sexpr/pcb/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { NL_NetList, PortLike } from '@modular-circuit/electronics-model';
|
|
2
|
-
export interface LinkConverterContext {
|
|
3
|
-
pin_map: {
|
|
4
|
-
[port_uuid: string]: {
|
|
5
|
-
[label_name: string]: string;
|
|
6
|
-
};
|
|
7
|
-
};
|
|
8
|
-
nl_netlist: NL_NetList;
|
|
9
|
-
port_map: Map<PortLike, string>;
|
|
10
|
-
net_names_count: Map<string, number>;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/converter/link_to_netlist/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAA;AAE9E,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE;QACP,CAAC,SAAS,EAAE,MAAM,GAAG;YACnB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAA;SAC7B,CAAA;KACF,CAAA;IACD,UAAU,EAAE,UAAU,CAAA;IACtB,QAAQ,EAAE,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;IAC/B,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACrC"}
|
|
File without changes
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { type ConnectionSubgraph } from '@modular-circuit/electronics-model';
|
|
2
|
-
import type { CG_Visitor } from '@modular-circuit/perc/build/erc/connect_graph_visitor';
|
|
3
|
-
import type { LinkConverterContext } from './context';
|
|
4
|
-
export declare class LINK_CONVERTER implements CG_Visitor {
|
|
5
|
-
private readonly ctx;
|
|
6
|
-
constructor(ctx: LinkConverterContext);
|
|
7
|
-
private link_map;
|
|
8
|
-
private port_id;
|
|
9
|
-
private port_is_composite_port;
|
|
10
|
-
private do_convert;
|
|
11
|
-
visit_cc(cc: ConnectionSubgraph): void;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=converter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"converter.d.ts","sourceRoot":"","sources":["../../../src/converter/link_to_netlist/converter.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,kBAAkB,EAOxB,MAAM,oCAAoC,CAAA;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uDAAuD,CAAA;AACvF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;AAiBrD,qBAAa,cAAe,YAAW,UAAU;IAC5B,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,EAAE,oBAAoB;IAE7D,OAAO,CAAC,QAAQ,CAAU;IAC1B,OAAO,CAAC,OAAO,CAAwB;IAEvC,OAAO,CAAC,sBAAsB;IAI9B,OAAO,CAAC,UAAU;IAMlB,QAAQ,CAAC,EAAE,EAAE,kBAAkB;CAsFhC"}
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
var __values = (this && this.__values) || function(o) {
|
|
2
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
3
|
-
if (m) return m.call(o);
|
|
4
|
-
if (o && typeof o.length === "number") return {
|
|
5
|
-
next: function () {
|
|
6
|
-
if (o && i >= o.length) o = void 0;
|
|
7
|
-
return { value: o && o[i++], done: !o };
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
11
|
-
};
|
|
12
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
13
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
14
|
-
if (!m) return o;
|
|
15
|
-
var i = m.call(o), r, ar = [], e;
|
|
16
|
-
try {
|
|
17
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
18
|
-
}
|
|
19
|
-
catch (error) { e = { error: error }; }
|
|
20
|
-
finally {
|
|
21
|
-
try {
|
|
22
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
23
|
-
}
|
|
24
|
-
finally { if (e) throw e.error; }
|
|
25
|
-
}
|
|
26
|
-
return ar;
|
|
27
|
-
};
|
|
28
|
-
import { ConnectionNodeType, LinkType, gen_link_map, get_port_link_type, } from '@modular-circuit/electronics-model';
|
|
29
|
-
import { CanDiffLinkTester, CanLogicLinkTester, CrystalLinkTester, Dvp8LinkTester, I2cLinkTester, I2sLinkTester, MetaPortConverter, SpeakerLinkTester, SpiLinkTester, SwdLinkTester, UartLinkTester, UsbCcLinkTester, UsbLinkTester, } from './links';
|
|
30
|
-
var LINK_CONVERTER = /** @class */ (function () {
|
|
31
|
-
function LINK_CONVERTER(ctx) {
|
|
32
|
-
this.ctx = ctx;
|
|
33
|
-
}
|
|
34
|
-
LINK_CONVERTER.prototype.port_is_composite_port = function (p) {
|
|
35
|
-
return Object.values(this.ctx.pin_map[this.port_id.get(p)]).length > 1;
|
|
36
|
-
};
|
|
37
|
-
LINK_CONVERTER.prototype.do_convert = function (CtorClass, ports, net_pros) {
|
|
38
|
-
return new CtorClass(this.ctx, ports, net_pros).convert();
|
|
39
|
-
};
|
|
40
|
-
LINK_CONVERTER.prototype.visit_cc = function (cc) {
|
|
41
|
-
var e_1, _a, e_2, _b, e_3, _c;
|
|
42
|
-
if (cc.is_isolated) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
this.link_map = gen_link_map();
|
|
46
|
-
var ports = cc.nodes.filter(function (i) { return i.type === ConnectionNodeType.Port; });
|
|
47
|
-
var meta_ports = [];
|
|
48
|
-
this.port_id = new Map();
|
|
49
|
-
try {
|
|
50
|
-
for (var ports_1 = __values(ports), ports_1_1 = ports_1.next(); !ports_1_1.done; ports_1_1 = ports_1.next()) {
|
|
51
|
-
var p = ports_1_1.value;
|
|
52
|
-
this.port_id.set(p.param, p.uuid);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
56
|
-
finally {
|
|
57
|
-
try {
|
|
58
|
-
if (ports_1_1 && !ports_1_1.done && (_a = ports_1.return)) _a.call(ports_1);
|
|
59
|
-
}
|
|
60
|
-
finally { if (e_1) throw e_1.error; }
|
|
61
|
-
}
|
|
62
|
-
try {
|
|
63
|
-
for (var ports_2 = __values(ports), ports_2_1 = ports_2.next(); !ports_2_1.done; ports_2_1 = ports_2.next()) {
|
|
64
|
-
var v = ports_2_1.value;
|
|
65
|
-
var port = v.param;
|
|
66
|
-
var arr = this.link_map[get_port_link_type(port)];
|
|
67
|
-
if (this.port_is_composite_port(port)) {
|
|
68
|
-
arr.push(port);
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
meta_ports.push(port);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
76
|
-
finally {
|
|
77
|
-
try {
|
|
78
|
-
if (ports_2_1 && !ports_2_1.done && (_b = ports_2.return)) _b.call(ports_2);
|
|
79
|
-
}
|
|
80
|
-
finally { if (e_2) throw e_2.error; }
|
|
81
|
-
}
|
|
82
|
-
var meta_port_converter = new MetaPortConverter(this.ctx, meta_ports, cc);
|
|
83
|
-
meta_port_converter.convert();
|
|
84
|
-
try {
|
|
85
|
-
for (var _d = __values(Object.entries(this.link_map)), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
86
|
-
var _f = __read(_e.value, 2), k = _f[0], v = _f[1];
|
|
87
|
-
if (!v || !v.length)
|
|
88
|
-
continue;
|
|
89
|
-
switch (k) {
|
|
90
|
-
case LinkType.CanLogicLink: {
|
|
91
|
-
this.do_convert(CanLogicLinkTester, v, cc);
|
|
92
|
-
break;
|
|
93
|
-
}
|
|
94
|
-
case LinkType.CanDiffLink: {
|
|
95
|
-
this.do_convert(CanDiffLinkTester, v, cc);
|
|
96
|
-
break;
|
|
97
|
-
}
|
|
98
|
-
case LinkType.CrystalLink: {
|
|
99
|
-
this.do_convert(CrystalLinkTester, v, cc);
|
|
100
|
-
break;
|
|
101
|
-
}
|
|
102
|
-
case LinkType.SwdLink: {
|
|
103
|
-
this.do_convert(SwdLinkTester, v, cc);
|
|
104
|
-
break;
|
|
105
|
-
}
|
|
106
|
-
case LinkType.I2cLink: {
|
|
107
|
-
this.do_convert(I2cLinkTester, v, cc);
|
|
108
|
-
break;
|
|
109
|
-
}
|
|
110
|
-
case LinkType.I2sLink: {
|
|
111
|
-
this.do_convert(I2sLinkTester, v, cc);
|
|
112
|
-
break;
|
|
113
|
-
}
|
|
114
|
-
case LinkType.SpiLink: {
|
|
115
|
-
this.do_convert(SpiLinkTester, v, cc);
|
|
116
|
-
break;
|
|
117
|
-
}
|
|
118
|
-
case LinkType.SpeakerLink: {
|
|
119
|
-
this.do_convert(SpeakerLinkTester, v, cc);
|
|
120
|
-
break;
|
|
121
|
-
}
|
|
122
|
-
case LinkType.UartLink: {
|
|
123
|
-
this.do_convert(UartLinkTester, v, cc);
|
|
124
|
-
break;
|
|
125
|
-
}
|
|
126
|
-
case LinkType.UsbLink: {
|
|
127
|
-
this.do_convert(UsbLinkTester, v, cc);
|
|
128
|
-
break;
|
|
129
|
-
}
|
|
130
|
-
case LinkType.UsbCcLink: {
|
|
131
|
-
this.do_convert(UsbCcLinkTester, v, cc);
|
|
132
|
-
break;
|
|
133
|
-
}
|
|
134
|
-
case LinkType.Dvp8Link: {
|
|
135
|
-
this.do_convert(Dvp8LinkTester, v, cc);
|
|
136
|
-
break;
|
|
137
|
-
}
|
|
138
|
-
default: {
|
|
139
|
-
throw new Error("Unhandled link type: ".concat(k));
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
145
|
-
finally {
|
|
146
|
-
try {
|
|
147
|
-
if (_e && !_e.done && (_c = _d.return)) _c.call(_d);
|
|
148
|
-
}
|
|
149
|
-
finally { if (e_3) throw e_3.error; }
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
return LINK_CONVERTER;
|
|
153
|
-
}());
|
|
154
|
-
export { LINK_CONVERTER };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/converter/link_to_netlist/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { NET_PROPERTIES, PortLike } from '@modular-circuit/electronics-model';
|
|
2
|
-
import type { LinkConverterContext } from '../context';
|
|
3
|
-
export interface Signal {
|
|
4
|
-
name: string;
|
|
5
|
-
ports: {
|
|
6
|
-
parent: PortLike;
|
|
7
|
-
meta_port: PortLike;
|
|
8
|
-
}[];
|
|
9
|
-
}
|
|
10
|
-
export declare abstract class LinkConverterBase<LinkT> {
|
|
11
|
-
protected readonly ctx: LinkConverterContext;
|
|
12
|
-
protected readonly ports: PortLike[];
|
|
13
|
-
protected readonly net_pros: NET_PROPERTIES;
|
|
14
|
-
protected link: LinkT | undefined;
|
|
15
|
-
constructor(ctx: LinkConverterContext, ports: PortLike[], net_pros: NET_PROPERTIES);
|
|
16
|
-
convert(): void;
|
|
17
|
-
protected abstract do_convert(): void;
|
|
18
|
-
protected abstract init_link(): boolean;
|
|
19
|
-
protected get_net_code(): number;
|
|
20
|
-
protected gen_net_name(signal_name?: string): string;
|
|
21
|
-
}
|
|
22
|
-
export declare class MetaPortConverter extends LinkConverterBase<undefined> {
|
|
23
|
-
protected do_convert(): void;
|
|
24
|
-
protected init_link(): boolean;
|
|
25
|
-
}
|
|
26
|
-
export declare abstract class CompositePortLinkConverterBase<LinkT> extends LinkConverterBase<LinkT> {
|
|
27
|
-
do_convert(): void;
|
|
28
|
-
protected abstract get_signals(): Signal[];
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=converter_base.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"converter_base.d.ts","sourceRoot":"","sources":["../../../../src/converter/link_to_netlist/links/converter_base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAuB,cAAc,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAA;AACvG,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEtD,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE;QACL,MAAM,EAAE,QAAQ,CAAA;QAChB,SAAS,EAAE,QAAQ,CAAA;KACpB,EAAE,CAAA;CACJ;AAED,8BAAsB,iBAAiB,CAAC,KAAK;IAIzC,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,oBAAoB;IAC5C,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,EAAE;IACpC,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,cAAc;IAL7C,SAAS,CAAC,IAAI,EAAE,KAAK,GAAG,SAAS,CAAA;gBAGZ,GAAG,EAAE,oBAAoB,EACzB,KAAK,EAAE,QAAQ,EAAE,EACjB,QAAQ,EAAE,cAAc;IAGtC,OAAO;IAKd,SAAS,CAAC,QAAQ,CAAC,UAAU,IAAI,IAAI;IAErC,SAAS,CAAC,QAAQ,CAAC,SAAS,IAAI,OAAO;IAEvC,SAAS,CAAC,YAAY;IAItB,SAAS,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE,MAAM;CAe5C;AAED,qBAAa,iBAAkB,SAAQ,iBAAiB,CAAC,SAAS,CAAC;IACjE,SAAS,CAAC,UAAU,IAAI,IAAI;IAe5B,SAAS,CAAC,SAAS,IAAI,OAAO;CAG/B;AAED,8BAAsB,8BAA8B,CAAC,KAAK,CAAE,SAAQ,iBAAiB,CAAC,KAAK,CAAC;IAC1E,UAAU,IAAI,IAAI;IAoBlC,SAAS,CAAC,QAAQ,CAAC,WAAW,IAAI,MAAM,EAAE;CAC3C"}
|