@modular-circuit/transpiler 0.0.58 → 0.0.61
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/build/builder/graph_to_kicad/do_convert_graph_to_kicad_project.js +25 -109
- package/build/builder/graph_to_kicad/index.js +9 -61
- package/build/builder/index.js +5 -1
- package/build/converter/graph_to_netlist/context.js +2 -0
- package/build/converter/graph_to_netlist/graph_converter.js +57 -173
- package/build/converter/graph_to_netlist/index.js +18 -2
- package/build/converter/index.js +19 -3
- package/build/converter/kicad_sexpr/eeschema/drawing_sheet/index.js +7 -4
- package/build/converter/kicad_sexpr/eeschema/drawing_sheet/sch_default_drawing_sheet.js +4 -1
- package/build/converter/kicad_sexpr/eeschema/index.js +18 -2
- package/build/converter/kicad_sexpr/eeschema/printer.js +232 -281
- package/build/converter/kicad_sexpr/index.js +18 -2
- package/build/converter/kicad_sexpr/pcb/index.js +2 -1
- package/build/converter/link_to_netlist/context.js +2 -0
- package/build/converter/link_to_netlist/converter.js +84 -138
- package/build/converter/link_to_netlist/index.js +18 -2
- package/build/converter/link_to_netlist/links/converter_base.js +44 -131
- package/build/converter/link_to_netlist/links/converters.js +333 -556
- package/build/converter/link_to_netlist/links/index.js +18 -2
- package/build/converter/netlist_to_kicad/context.js +2 -0
- package/build/converter/netlist_to_kicad/index.js +19 -3
- package/build/converter/netlist_to_kicad/layout.js +26 -25
- package/build/converter/netlist_to_kicad/netlist_converter.js +93 -182
- package/build/index.js +21 -5
- package/build/kicad/constraints/index.js +4 -1
- package/build/kicad/label/index.js +18 -2
- package/build/kicad/label/net_label.js +10 -6
- package/build/kicad/label/sheet_pin.js +19 -23
- package/build/kicad/project/index.js +18 -2
- package/build/kicad/project/kicad_prl.js +7 -3
- package/build/kicad/project/kicad_pro.js +9 -5
- package/build/kicad/project/kicad_project_achieve.js +40 -50
- package/build/kicad/project/wildcards_and_files_ext.js +65 -61
- package/build/kicad/sheet/index.js +17 -1
- package/build/kicad/sheet/sheet.js +12 -8
- package/build/kicad/symbols/index.js +18 -2
- package/build/kicad/symbols/lib_symbol/gnd.js +24 -20
- package/build/kicad/symbols/lib_symbol/index.js +18 -2
- package/build/kicad/symbols/lib_symbol/vcc.js +25 -21
- package/build/kicad/symbols/sch_symbol/gnd.js +23 -19
- package/build/kicad/symbols/sch_symbol/index.js +18 -2
- package/build/kicad/symbols/sch_symbol/vcc.js +23 -19
- package/build/kicad/symbols/symbol_utils.js +5 -1
- package/build/utils/collect_sub_sheets.js +35 -146
- package/build/utils/constraints.js +9 -6
- package/build/utils/filter_null_undefined.js +6 -32
- package/build/utils/index.js +20 -4
- package/build/utils/string_formatter.js +27 -29
- package/package.json +5 -5
|
@@ -1,53 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KiCadProjectAchieve = exports.KICAD_SCH_FRAME = void 0;
|
|
4
|
+
const utils_1 = require("@modular-circuit/utils");
|
|
5
|
+
const converter_1 = require("../../converter");
|
|
6
|
+
const kicad_prl_1 = require("./kicad_prl");
|
|
7
|
+
const kicad_pro_1 = require("./kicad_pro");
|
|
8
|
+
const wildcards_and_files_ext_1 = require("./wildcards_and_files_ext");
|
|
9
|
+
exports.KICAD_SCH_FRAME = (0, converter_1.get_sch_default_drawing_sheet)();
|
|
10
|
+
class KiCadProjectAchieve {
|
|
11
|
+
project_name;
|
|
12
|
+
sheets;
|
|
13
|
+
kicad_sym;
|
|
14
|
+
fp_lib_table;
|
|
15
|
+
layout_frame;
|
|
16
|
+
pcb;
|
|
17
|
+
sym_lib_table;
|
|
18
|
+
get sch_frame() {
|
|
19
|
+
return exports.KICAD_SCH_FRAME;
|
|
20
|
+
}
|
|
21
|
+
get kicad_prl() {
|
|
22
|
+
return (0, kicad_prl_1.kicad_prl)(this.project_name);
|
|
23
|
+
}
|
|
24
|
+
get kicad_pro() {
|
|
25
|
+
return (0, kicad_pro_1.kicad_pro)(this.project_name);
|
|
26
|
+
}
|
|
27
|
+
constructor(project_name, sheets) {
|
|
20
28
|
this.project_name = project_name;
|
|
21
29
|
this.sheets = sheets;
|
|
22
30
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
});
|
|
37
|
-
Object.defineProperty(KiCadProjectAchieve.prototype, "kicad_pro", {
|
|
38
|
-
get: function () {
|
|
39
|
-
return kicad_pro(this.project_name);
|
|
40
|
-
},
|
|
41
|
-
enumerable: false,
|
|
42
|
-
configurable: true
|
|
43
|
-
});
|
|
44
|
-
KiCadProjectAchieve.prototype.get_project_directive_file_name = function (ext) {
|
|
45
|
-
return "".concat(this.project_name, ".").concat(ext);
|
|
46
|
-
};
|
|
47
|
-
KiCadProjectAchieve.prototype.toZip = function () {
|
|
48
|
-
var _a;
|
|
49
|
-
return zipFiles(__assign((_a = {}, _a[this.get_project_directive_file_name(ProjectLocalSettingsFileExtension)] = JSON.stringify(this.kicad_prl), _a[this.get_project_directive_file_name(ProjectFileExtension)] = JSON.stringify(this.kicad_pro), _a[this.get_project_directive_file_name(DrawingSheetFileExtension)] = this.sch_frame, _a), this.sheets));
|
|
50
|
-
};
|
|
51
|
-
return KiCadProjectAchieve;
|
|
52
|
-
}());
|
|
53
|
-
export { KiCadProjectAchieve };
|
|
31
|
+
get_project_directive_file_name(ext) {
|
|
32
|
+
return `${this.project_name}.${ext}`;
|
|
33
|
+
}
|
|
34
|
+
toZip() {
|
|
35
|
+
return (0, utils_1.zipFiles)({
|
|
36
|
+
[this.get_project_directive_file_name(wildcards_and_files_ext_1.ProjectLocalSettingsFileExtension)]: JSON.stringify(this.kicad_prl),
|
|
37
|
+
[this.get_project_directive_file_name(wildcards_and_files_ext_1.ProjectFileExtension)]: JSON.stringify(this.kicad_pro),
|
|
38
|
+
[this.get_project_directive_file_name(wildcards_and_files_ext_1.DrawingSheetFileExtension)]: this.sch_frame,
|
|
39
|
+
...this.sheets,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.KiCadProjectAchieve = KiCadProjectAchieve;
|
|
@@ -1,61 +1,65 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WorkbookFileExtension = exports.Ipc2581FileExtension = exports.IpcD356FileExtension = exports.SpecctraSessionFileExtension = exports.SpecctraDsnFileExtension = exports.KiCadFootprintFileExtension = exports.GedaPcbFootprintLibFileExtension = exports.EagleFootprintLibPathExtension = exports.CadstarFootprintLibPathExtension = exports.AltiumFootprintLibPathExtension = exports.LegacyFootprintLibPathExtension = exports.KiCadFootprintLibPathExtension = exports.FootprintPlaceFileExtension = exports.ReportFileExtension = exports.SVGFileExtension = exports.DrillFileExtension = exports.MacrosFileExtension = exports.PdfFileExtension = exports.DesignRulesFileExtension = exports.DrawingSheetFileExtension = exports.KiCadPcbFileExtension = exports.CadstarPcbFileExtension = exports.EaglePcbFileExtension = exports.LegacyPcbFileExtension = exports.ArchiveFileExtension = exports.HTTPLibraryFileExtension = exports.DatabaseLibraryFileExtension = exports.HotkeyFileExtension = exports.EquFileExtension = exports.HtmlFileExtension = exports.GerberJobFileExtension = exports.GerberFileExtension = exports.FootprintAssignmentFileExtension = exports.AllegroNetlistFileExtension = exports.NetlistFileExtension = exports.OrCadPcb2NetlistFileExtension = exports.CadstarNetlistFileExtension = exports.SpiceFileExtension = exports.KiCadSchematicFileExtension = exports.CadstarPartsLibraryFileExtension = exports.CadstarSchematicFileExtension = exports.LegacySchematicFileExtension = exports.ProjectLocalSettingsFileExtension = exports.LegacyProjectFileExtension = exports.ProjectFileExtension = exports.VrmlFileExtension = exports.LegacySymbolDocumentFileExtension = exports.LegacySymbolLibFileExtension = exports.SchematicSymbolFileExtension = exports.KiCadSymbolLibFileExtension = void 0;
|
|
4
|
+
exports.GerberFileExtensionsRegex = exports.GltfBinaryFileExtension = exports.StepFileAbrvExtension = exports.StepFileExtension = exports.JsonFileExtension = exports.XmlFileExtension = exports.CsvFileExtension = exports.MarkdownFileExtension = exports.TextFileExtension = exports.JpegFileExtension = exports.PngFileExtension = void 0;
|
|
5
|
+
exports.KiCadSymbolLibFileExtension = 'kicad_sym';
|
|
6
|
+
exports.SchematicSymbolFileExtension = 'sym';
|
|
7
|
+
exports.LegacySymbolLibFileExtension = 'lib';
|
|
8
|
+
exports.LegacySymbolDocumentFileExtension = 'dcm';
|
|
9
|
+
exports.VrmlFileExtension = 'wrl';
|
|
10
|
+
exports.ProjectFileExtension = 'kicad_pro';
|
|
11
|
+
exports.LegacyProjectFileExtension = 'pro';
|
|
12
|
+
exports.ProjectLocalSettingsFileExtension = 'kicad_prl';
|
|
13
|
+
exports.LegacySchematicFileExtension = 'sch';
|
|
14
|
+
exports.CadstarSchematicFileExtension = 'csa';
|
|
15
|
+
exports.CadstarPartsLibraryFileExtension = 'lib';
|
|
16
|
+
exports.KiCadSchematicFileExtension = 'kicad_sch';
|
|
17
|
+
exports.SpiceFileExtension = 'cir';
|
|
18
|
+
exports.CadstarNetlistFileExtension = 'frp';
|
|
19
|
+
exports.OrCadPcb2NetlistFileExtension = 'net';
|
|
20
|
+
exports.NetlistFileExtension = 'net';
|
|
21
|
+
exports.AllegroNetlistFileExtension = 'txt';
|
|
22
|
+
exports.FootprintAssignmentFileExtension = 'cmp';
|
|
23
|
+
exports.GerberFileExtension = 'gbr';
|
|
24
|
+
exports.GerberJobFileExtension = 'gbrjob';
|
|
25
|
+
exports.HtmlFileExtension = 'html';
|
|
26
|
+
exports.EquFileExtension = 'equ';
|
|
27
|
+
exports.HotkeyFileExtension = 'hotkeys';
|
|
28
|
+
exports.DatabaseLibraryFileExtension = 'kicad_dbl';
|
|
29
|
+
exports.HTTPLibraryFileExtension = 'kicad_httplib';
|
|
30
|
+
exports.ArchiveFileExtension = 'zip';
|
|
31
|
+
exports.LegacyPcbFileExtension = 'brd';
|
|
32
|
+
exports.EaglePcbFileExtension = 'brd';
|
|
33
|
+
exports.CadstarPcbFileExtension = 'cpa';
|
|
34
|
+
exports.KiCadPcbFileExtension = 'kicad_pcb';
|
|
35
|
+
exports.DrawingSheetFileExtension = 'kicad_wks';
|
|
36
|
+
exports.DesignRulesFileExtension = 'kicad_dru';
|
|
37
|
+
exports.PdfFileExtension = 'pdf';
|
|
38
|
+
exports.MacrosFileExtension = 'mcr';
|
|
39
|
+
exports.DrillFileExtension = 'drl';
|
|
40
|
+
exports.SVGFileExtension = 'svg';
|
|
41
|
+
exports.ReportFileExtension = 'rpt';
|
|
42
|
+
exports.FootprintPlaceFileExtension = 'pos';
|
|
43
|
+
exports.KiCadFootprintLibPathExtension = 'pretty'; // this is a directory
|
|
44
|
+
exports.LegacyFootprintLibPathExtension = 'mod'; // this is a file
|
|
45
|
+
exports.AltiumFootprintLibPathExtension = 'PcbLib'; // this is a file
|
|
46
|
+
exports.CadstarFootprintLibPathExtension = 'cpa'; // this is a file
|
|
47
|
+
exports.EagleFootprintLibPathExtension = 'lbr'; // this is a file
|
|
48
|
+
exports.GedaPcbFootprintLibFileExtension = 'fp'; // this is a file
|
|
49
|
+
exports.KiCadFootprintFileExtension = 'kicad_mod';
|
|
50
|
+
exports.SpecctraDsnFileExtension = 'dsn';
|
|
51
|
+
exports.SpecctraSessionFileExtension = 'ses';
|
|
52
|
+
exports.IpcD356FileExtension = 'd356';
|
|
53
|
+
exports.Ipc2581FileExtension = 'xml';
|
|
54
|
+
exports.WorkbookFileExtension = 'wbk';
|
|
55
|
+
exports.PngFileExtension = 'png';
|
|
56
|
+
exports.JpegFileExtension = 'jpg';
|
|
57
|
+
exports.TextFileExtension = 'txt';
|
|
58
|
+
exports.MarkdownFileExtension = 'md';
|
|
59
|
+
exports.CsvFileExtension = 'csv';
|
|
60
|
+
exports.XmlFileExtension = 'xml';
|
|
61
|
+
exports.JsonFileExtension = 'json';
|
|
62
|
+
exports.StepFileExtension = 'step';
|
|
63
|
+
exports.StepFileAbrvExtension = 'stp';
|
|
64
|
+
exports.GltfBinaryFileExtension = 'glb';
|
|
65
|
+
exports.GerberFileExtensionsRegex = /(gbr|gko|pho|(g[tb][alops])|(gm?\\d\\d*)|(gp[tb]))/;
|
|
@@ -1 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./sheet"), exports);
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.gen_sch_sheet = void 0;
|
|
4
|
+
const utils_1 = require("@modular-circuit/utils");
|
|
5
|
+
const constraints_1 = require("../constraints");
|
|
6
|
+
const TEXT_MARGIN = 0.7116;
|
|
7
|
+
const gen_sch_sheet = (rect, pins, fields) => ({
|
|
5
8
|
// NOTE no rotation in the sheet
|
|
6
9
|
at: { position: rect.pos },
|
|
7
10
|
size: rect.size,
|
|
@@ -12,7 +15,7 @@ export var gen_sch_sheet = function (rect, pins, fields) { return ({
|
|
|
12
15
|
text: fields.Sheetname,
|
|
13
16
|
at: { position: { x: rect.pos.x, y: rect.pos.y - TEXT_MARGIN }, rotation: 0 },
|
|
14
17
|
effects: {
|
|
15
|
-
font: { size: DEFAULT_FONT_SIZE },
|
|
18
|
+
font: { size: constraints_1.DEFAULT_FONT_SIZE },
|
|
16
19
|
justify: {
|
|
17
20
|
vertical: 'bottom',
|
|
18
21
|
horizontal: 'left',
|
|
@@ -24,7 +27,7 @@ export var gen_sch_sheet = function (rect, pins, fields) { return ({
|
|
|
24
27
|
text: fields.Sheetfile,
|
|
25
28
|
at: { position: { x: rect.pos.x, y: rect.pos.y + rect.size.y + TEXT_MARGIN }, rotation: 0 },
|
|
26
29
|
effects: {
|
|
27
|
-
font: { size: DEFAULT_FONT_SIZE },
|
|
30
|
+
font: { size: constraints_1.DEFAULT_FONT_SIZE },
|
|
28
31
|
justify: {
|
|
29
32
|
vertical: 'top',
|
|
30
33
|
horizontal: 'left',
|
|
@@ -40,5 +43,6 @@ export var gen_sch_sheet = function (rect, pins, fields) { return ({
|
|
|
40
43
|
fill: {
|
|
41
44
|
color: { r: 0, g: 0, b: 0, a: 0.0 },
|
|
42
45
|
},
|
|
43
|
-
uuid: gen_uuid(),
|
|
44
|
-
});
|
|
46
|
+
uuid: (0, utils_1.gen_uuid)(),
|
|
47
|
+
});
|
|
48
|
+
exports.gen_sch_sheet = gen_sch_sheet;
|
|
@@ -1,2 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./lib_symbol"), exports);
|
|
18
|
+
__exportStar(require("./sch_symbol"), exports);
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.gen_lib_gnd = void 0;
|
|
4
|
+
const electronics_model_1 = require("@modular-circuit/electronics-model");
|
|
5
|
+
const ir_1 = require("@modular-circuit/ir");
|
|
6
|
+
const constraints_1 = require("../../constraints");
|
|
7
|
+
const gen_lib_gnd = (value) => ({
|
|
8
|
+
name: `power:${value}`,
|
|
6
9
|
pin_numbers: {
|
|
7
10
|
offset: 0,
|
|
8
11
|
hide: true,
|
|
@@ -20,16 +23,16 @@ export var gen_lib_gnd = function (value) { return ({
|
|
|
20
23
|
text: '#PWR',
|
|
21
24
|
at: { position: { x: 0, y: -6.35 }, rotation: 0 },
|
|
22
25
|
effects: {
|
|
23
|
-
font: { size: DEFAULT_FONT_SIZE },
|
|
26
|
+
font: { size: constraints_1.DEFAULT_FONT_SIZE },
|
|
24
27
|
hide: true,
|
|
25
28
|
},
|
|
26
29
|
},
|
|
27
30
|
{
|
|
28
31
|
name: 'Value',
|
|
29
|
-
text:
|
|
32
|
+
text: `${value}`,
|
|
30
33
|
at: { position: { x: 0, y: -3.81 }, rotation: 0 },
|
|
31
34
|
effects: {
|
|
32
|
-
font: { size: DEFAULT_FONT_SIZE },
|
|
35
|
+
font: { size: constraints_1.DEFAULT_FONT_SIZE },
|
|
33
36
|
},
|
|
34
37
|
},
|
|
35
38
|
{
|
|
@@ -37,7 +40,7 @@ export var gen_lib_gnd = function (value) { return ({
|
|
|
37
40
|
text: '',
|
|
38
41
|
at: { position: { x: 0, y: 0 }, rotation: 0 },
|
|
39
42
|
effects: {
|
|
40
|
-
font: { size: DEFAULT_FONT_SIZE },
|
|
43
|
+
font: { size: constraints_1.DEFAULT_FONT_SIZE },
|
|
41
44
|
hide: true,
|
|
42
45
|
},
|
|
43
46
|
},
|
|
@@ -46,7 +49,7 @@ export var gen_lib_gnd = function (value) { return ({
|
|
|
46
49
|
text: '',
|
|
47
50
|
at: { position: { x: 0, y: 0 }, rotation: 0 },
|
|
48
51
|
effects: {
|
|
49
|
-
font: { size: DEFAULT_FONT_SIZE },
|
|
52
|
+
font: { size: constraints_1.DEFAULT_FONT_SIZE },
|
|
50
53
|
hide: true,
|
|
51
54
|
},
|
|
52
55
|
},
|
|
@@ -55,7 +58,7 @@ export var gen_lib_gnd = function (value) { return ({
|
|
|
55
58
|
text: 'Power symbol creates a global label with name \\"GND\\" , ground',
|
|
56
59
|
at: { position: { x: 0, y: 0 }, rotation: 0 },
|
|
57
60
|
effects: {
|
|
58
|
-
font: { size: DEFAULT_FONT_SIZE },
|
|
61
|
+
font: { size: constraints_1.DEFAULT_FONT_SIZE },
|
|
59
62
|
hide: true,
|
|
60
63
|
},
|
|
61
64
|
},
|
|
@@ -64,17 +67,17 @@ export var gen_lib_gnd = function (value) { return ({
|
|
|
64
67
|
text: 'global power',
|
|
65
68
|
at: { position: { x: 0, y: 0 }, rotation: 0 },
|
|
66
69
|
effects: {
|
|
67
|
-
font: { size: DEFAULT_FONT_SIZE },
|
|
70
|
+
font: { size: constraints_1.DEFAULT_FONT_SIZE },
|
|
68
71
|
hide: true,
|
|
69
72
|
},
|
|
70
73
|
},
|
|
71
74
|
],
|
|
72
75
|
children: [
|
|
73
76
|
{
|
|
74
|
-
name:
|
|
77
|
+
name: `${value}_0_1`,
|
|
75
78
|
drawings: [
|
|
76
79
|
{
|
|
77
|
-
shape: SHAPE_T.POLY,
|
|
80
|
+
shape: ir_1.SHAPE_T.POLY,
|
|
78
81
|
pts: [
|
|
79
82
|
{ x: 0, y: 0 },
|
|
80
83
|
{ x: 0, y: -1.27 },
|
|
@@ -94,28 +97,29 @@ export var gen_lib_gnd = function (value) { return ({
|
|
|
94
97
|
],
|
|
95
98
|
},
|
|
96
99
|
{
|
|
97
|
-
name:
|
|
100
|
+
name: `${value}_0_1`,
|
|
98
101
|
pins: [
|
|
99
102
|
{
|
|
100
|
-
type: ELECTRICAL_PINTYPE.PT_POWER_IN,
|
|
101
|
-
shape: GRAPHIC_PINSHAPE.LINE,
|
|
103
|
+
type: electronics_model_1.ELECTRICAL_PINTYPE.PT_POWER_IN,
|
|
104
|
+
shape: electronics_model_1.GRAPHIC_PINSHAPE.LINE,
|
|
102
105
|
hide: false,
|
|
103
106
|
at: { position: { x: 0, y: 0 }, rotation: 270 },
|
|
104
107
|
length: 0,
|
|
105
108
|
name: {
|
|
106
109
|
text: '~',
|
|
107
110
|
effects: {
|
|
108
|
-
font: { size: DEFAULT_FONT_SIZE },
|
|
111
|
+
font: { size: constraints_1.DEFAULT_FONT_SIZE },
|
|
109
112
|
},
|
|
110
113
|
},
|
|
111
114
|
number: {
|
|
112
115
|
text: '1',
|
|
113
116
|
effects: {
|
|
114
|
-
font: { size: DEFAULT_FONT_SIZE },
|
|
117
|
+
font: { size: constraints_1.DEFAULT_FONT_SIZE },
|
|
115
118
|
},
|
|
116
119
|
},
|
|
117
120
|
},
|
|
118
121
|
],
|
|
119
122
|
},
|
|
120
123
|
],
|
|
121
|
-
});
|
|
124
|
+
});
|
|
125
|
+
exports.gen_lib_gnd = gen_lib_gnd;
|
|
@@ -1,2 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./gnd"), exports);
|
|
18
|
+
__exportStar(require("./vcc"), exports);
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.gen_lib_vcc = void 0;
|
|
4
|
+
const electronics_model_1 = require("@modular-circuit/electronics-model");
|
|
5
|
+
const ir_1 = require("@modular-circuit/ir");
|
|
6
|
+
const constraints_1 = require("../../constraints");
|
|
7
|
+
const gen_lib_vcc = (value) => ({
|
|
8
|
+
name: `power:${value}`,
|
|
6
9
|
power: true,
|
|
7
10
|
pin_numbers: {
|
|
8
11
|
offset: 0,
|
|
@@ -21,16 +24,16 @@ export var gen_lib_vcc = function (value) { return ({
|
|
|
21
24
|
text: '#PWR',
|
|
22
25
|
at: { position: { x: 0, y: -3.81 }, rotation: 0 },
|
|
23
26
|
effects: {
|
|
24
|
-
font: { size: DEFAULT_FONT_SIZE },
|
|
27
|
+
font: { size: constraints_1.DEFAULT_FONT_SIZE },
|
|
25
28
|
hide: true,
|
|
26
29
|
},
|
|
27
30
|
},
|
|
28
31
|
{
|
|
29
32
|
name: 'Value',
|
|
30
|
-
text:
|
|
33
|
+
text: `${value}`,
|
|
31
34
|
at: { position: { x: 0, y: 3.556 }, rotation: 0 },
|
|
32
35
|
effects: {
|
|
33
|
-
font: { size: DEFAULT_FONT_SIZE },
|
|
36
|
+
font: { size: constraints_1.DEFAULT_FONT_SIZE },
|
|
34
37
|
},
|
|
35
38
|
},
|
|
36
39
|
{
|
|
@@ -38,7 +41,7 @@ export var gen_lib_vcc = function (value) { return ({
|
|
|
38
41
|
text: '',
|
|
39
42
|
at: { position: { x: 0, y: 0 }, rotation: 0 },
|
|
40
43
|
effects: {
|
|
41
|
-
font: { size: DEFAULT_FONT_SIZE },
|
|
44
|
+
font: { size: constraints_1.DEFAULT_FONT_SIZE },
|
|
42
45
|
hide: true,
|
|
43
46
|
},
|
|
44
47
|
},
|
|
@@ -47,16 +50,16 @@ export var gen_lib_vcc = function (value) { return ({
|
|
|
47
50
|
text: '',
|
|
48
51
|
at: { position: { x: 0, y: 0 }, rotation: 0 },
|
|
49
52
|
effects: {
|
|
50
|
-
font: { size: DEFAULT_FONT_SIZE },
|
|
53
|
+
font: { size: constraints_1.DEFAULT_FONT_SIZE },
|
|
51
54
|
hide: true,
|
|
52
55
|
},
|
|
53
56
|
},
|
|
54
57
|
{
|
|
55
58
|
name: 'Description',
|
|
56
|
-
text:
|
|
59
|
+
text: `Power symbol creates a global label with name \\"${value}\\"`,
|
|
57
60
|
at: { position: { x: 0, y: 0 }, rotation: 0 },
|
|
58
61
|
effects: {
|
|
59
|
-
font: { size: DEFAULT_FONT_SIZE },
|
|
62
|
+
font: { size: constraints_1.DEFAULT_FONT_SIZE },
|
|
60
63
|
hide: true,
|
|
61
64
|
},
|
|
62
65
|
},
|
|
@@ -65,17 +68,17 @@ export var gen_lib_vcc = function (value) { return ({
|
|
|
65
68
|
text: 'global power',
|
|
66
69
|
at: { position: { x: 0, y: 0 }, rotation: 0 },
|
|
67
70
|
effects: {
|
|
68
|
-
font: { size: DEFAULT_FONT_SIZE },
|
|
71
|
+
font: { size: constraints_1.DEFAULT_FONT_SIZE },
|
|
69
72
|
hide: true,
|
|
70
73
|
},
|
|
71
74
|
},
|
|
72
75
|
],
|
|
73
76
|
children: [
|
|
74
77
|
{
|
|
75
|
-
name:
|
|
78
|
+
name: `${value}_0_1`,
|
|
76
79
|
drawings: [
|
|
77
80
|
{
|
|
78
|
-
shape: SHAPE_T.POLY,
|
|
81
|
+
shape: ir_1.SHAPE_T.POLY,
|
|
79
82
|
pts: [
|
|
80
83
|
{ x: -0.762, y: 1.27 },
|
|
81
84
|
{ x: 0, y: 2.54 },
|
|
@@ -92,28 +95,29 @@ export var gen_lib_vcc = function (value) { return ({
|
|
|
92
95
|
],
|
|
93
96
|
},
|
|
94
97
|
{
|
|
95
|
-
name:
|
|
98
|
+
name: `${value}_1_1`,
|
|
96
99
|
pins: [
|
|
97
100
|
{
|
|
98
|
-
type: ELECTRICAL_PINTYPE.PT_POWER_IN,
|
|
99
|
-
shape: GRAPHIC_PINSHAPE.LINE,
|
|
101
|
+
type: electronics_model_1.ELECTRICAL_PINTYPE.PT_POWER_IN,
|
|
102
|
+
shape: electronics_model_1.GRAPHIC_PINSHAPE.LINE,
|
|
100
103
|
hide: false,
|
|
101
104
|
at: { position: { x: 0, y: 0 }, rotation: 90 },
|
|
102
105
|
length: 0,
|
|
103
106
|
name: {
|
|
104
107
|
text: '~',
|
|
105
108
|
effects: {
|
|
106
|
-
font: { size: DEFAULT_FONT_SIZE },
|
|
109
|
+
font: { size: constraints_1.DEFAULT_FONT_SIZE },
|
|
107
110
|
},
|
|
108
111
|
},
|
|
109
112
|
number: {
|
|
110
113
|
text: '1',
|
|
111
114
|
effects: {
|
|
112
|
-
font: { size: DEFAULT_FONT_SIZE },
|
|
115
|
+
font: { size: constraints_1.DEFAULT_FONT_SIZE },
|
|
113
116
|
},
|
|
114
117
|
},
|
|
115
118
|
},
|
|
116
119
|
],
|
|
117
120
|
},
|
|
118
121
|
],
|
|
119
|
-
});
|
|
122
|
+
});
|
|
123
|
+
exports.gen_lib_vcc = gen_lib_vcc;
|