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