@modular-circuit/transpiler 0.0.59 → 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.
Files changed (49) hide show
  1. package/build/builder/graph_to_kicad/do_convert_graph_to_kicad_project.js +15 -12
  2. package/build/builder/graph_to_kicad/index.js +8 -5
  3. package/build/builder/index.js +5 -1
  4. package/build/converter/graph_to_netlist/context.js +2 -0
  5. package/build/converter/graph_to_netlist/graph_converter.js +9 -5
  6. package/build/converter/graph_to_netlist/index.js +18 -2
  7. package/build/converter/index.js +19 -3
  8. package/build/converter/kicad_sexpr/eeschema/drawing_sheet/index.js +7 -4
  9. package/build/converter/kicad_sexpr/eeschema/drawing_sheet/sch_default_drawing_sheet.js +4 -1
  10. package/build/converter/kicad_sexpr/eeschema/index.js +18 -2
  11. package/build/converter/kicad_sexpr/eeschema/printer.js +28 -24
  12. package/build/converter/kicad_sexpr/index.js +18 -2
  13. package/build/converter/kicad_sexpr/pcb/index.js +2 -1
  14. package/build/converter/link_to_netlist/context.js +2 -0
  15. package/build/converter/link_to_netlist/converter.js +35 -31
  16. package/build/converter/link_to_netlist/index.js +18 -2
  17. package/build/converter/link_to_netlist/links/converter_base.js +9 -3
  18. package/build/converter/link_to_netlist/links/converters.js +54 -39
  19. package/build/converter/link_to_netlist/links/index.js +18 -2
  20. package/build/converter/netlist_to_kicad/context.js +2 -0
  21. package/build/converter/netlist_to_kicad/index.js +19 -3
  22. package/build/converter/netlist_to_kicad/layout.js +11 -6
  23. package/build/converter/netlist_to_kicad/netlist_converter.js +32 -28
  24. package/build/index.js +21 -5
  25. package/build/kicad/constraints/index.js +4 -1
  26. package/build/kicad/label/index.js +18 -2
  27. package/build/kicad/label/net_label.js +9 -5
  28. package/build/kicad/label/sheet_pin.js +10 -6
  29. package/build/kicad/project/index.js +18 -2
  30. package/build/kicad/project/kicad_prl.js +5 -1
  31. package/build/kicad/project/kicad_pro.js +7 -3
  32. package/build/kicad/project/kicad_project_achieve.js +18 -14
  33. package/build/kicad/project/wildcards_and_files_ext.js +65 -61
  34. package/build/kicad/sheet/index.js +17 -1
  35. package/build/kicad/sheet/sheet.js +10 -6
  36. package/build/kicad/symbols/index.js +18 -2
  37. package/build/kicad/symbols/lib_symbol/gnd.js +19 -15
  38. package/build/kicad/symbols/lib_symbol/index.js +18 -2
  39. package/build/kicad/symbols/lib_symbol/vcc.js +19 -15
  40. package/build/kicad/symbols/sch_symbol/gnd.js +15 -11
  41. package/build/kicad/symbols/sch_symbol/index.js +18 -2
  42. package/build/kicad/symbols/sch_symbol/vcc.js +15 -11
  43. package/build/kicad/symbols/symbol_utils.js +5 -1
  44. package/build/utils/collect_sub_sheets.js +9 -6
  45. package/build/utils/constraints.js +9 -6
  46. package/build/utils/filter_null_undefined.js +4 -1
  47. package/build/utils/index.js +20 -4
  48. package/build/utils/string_formatter.js +7 -3
  49. package/package.json +5 -5
@@ -1,5 +1,8 @@
1
- import { DrawingSheetFileExtension } from './wildcards_and_files_ext';
2
- export const kicad_pro = (project_name) => ({
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.kicad_pro = void 0;
4
+ const wildcards_and_files_ext_1 = require("./wildcards_and_files_ext");
5
+ const kicad_pro = (project_name) => ({
3
6
  board: {
4
7
  '3dviewports': [],
5
8
  ipc2581: {
@@ -208,7 +211,7 @@ export const kicad_pro = (project_name) => ({
208
211
  version: 1,
209
212
  },
210
213
  net_format_name: '',
211
- page_layout_descr_file: `${project_name}.${DrawingSheetFileExtension}`,
214
+ page_layout_descr_file: `${project_name}.${wildcards_and_files_ext_1.DrawingSheetFileExtension}`,
212
215
  plot_directory: '',
213
216
  spice_current_sheet_as_root: false,
214
217
  spice_external_command: 'spice "%I"',
@@ -222,3 +225,4 @@ export const kicad_pro = (project_name) => ({
222
225
  sheets: [],
223
226
  text_variables: {},
224
227
  });
228
+ exports.kicad_pro = kicad_pro;
@@ -1,10 +1,13 @@
1
- import { zipFiles } from '@modular-circuit/utils';
2
- import { get_sch_default_drawing_sheet } from '../../converter';
3
- import { kicad_prl } from './kicad_prl';
4
- import { kicad_pro } from './kicad_pro';
5
- import { DrawingSheetFileExtension, ProjectFileExtension, ProjectLocalSettingsFileExtension, } from './wildcards_and_files_ext';
6
- export const KICAD_SCH_FRAME = get_sch_default_drawing_sheet();
7
- export class KiCadProjectAchieve {
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 {
8
11
  project_name;
9
12
  sheets;
10
13
  kicad_sym;
@@ -13,13 +16,13 @@ export class KiCadProjectAchieve {
13
16
  pcb;
14
17
  sym_lib_table;
15
18
  get sch_frame() {
16
- return KICAD_SCH_FRAME;
19
+ return exports.KICAD_SCH_FRAME;
17
20
  }
18
21
  get kicad_prl() {
19
- return kicad_prl(this.project_name);
22
+ return (0, kicad_prl_1.kicad_prl)(this.project_name);
20
23
  }
21
24
  get kicad_pro() {
22
- return kicad_pro(this.project_name);
25
+ return (0, kicad_pro_1.kicad_pro)(this.project_name);
23
26
  }
24
27
  constructor(project_name, sheets) {
25
28
  this.project_name = project_name;
@@ -29,11 +32,12 @@ export class KiCadProjectAchieve {
29
32
  return `${this.project_name}.${ext}`;
30
33
  }
31
34
  toZip() {
32
- return zipFiles({
33
- [this.get_project_directive_file_name(ProjectLocalSettingsFileExtension)]: JSON.stringify(this.kicad_prl),
34
- [this.get_project_directive_file_name(ProjectFileExtension)]: JSON.stringify(this.kicad_pro),
35
- [this.get_project_directive_file_name(DrawingSheetFileExtension)]: this.sch_frame,
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,
36
39
  ...this.sheets,
37
40
  });
38
41
  }
39
42
  }
43
+ exports.KiCadProjectAchieve = KiCadProjectAchieve;
@@ -1,61 +1,65 @@
1
- export const KiCadSymbolLibFileExtension = 'kicad_sym';
2
- export const SchematicSymbolFileExtension = 'sym';
3
- export const LegacySymbolLibFileExtension = 'lib';
4
- export const LegacySymbolDocumentFileExtension = 'dcm';
5
- export const VrmlFileExtension = 'wrl';
6
- export const ProjectFileExtension = 'kicad_pro';
7
- export const LegacyProjectFileExtension = 'pro';
8
- export const ProjectLocalSettingsFileExtension = 'kicad_prl';
9
- export const LegacySchematicFileExtension = 'sch';
10
- export const CadstarSchematicFileExtension = 'csa';
11
- export const CadstarPartsLibraryFileExtension = 'lib';
12
- export const KiCadSchematicFileExtension = 'kicad_sch';
13
- export const SpiceFileExtension = 'cir';
14
- export const CadstarNetlistFileExtension = 'frp';
15
- export const OrCadPcb2NetlistFileExtension = 'net';
16
- export const NetlistFileExtension = 'net';
17
- export const AllegroNetlistFileExtension = 'txt';
18
- export const FootprintAssignmentFileExtension = 'cmp';
19
- export const GerberFileExtension = 'gbr';
20
- export const GerberJobFileExtension = 'gbrjob';
21
- export const HtmlFileExtension = 'html';
22
- export const EquFileExtension = 'equ';
23
- export const HotkeyFileExtension = 'hotkeys';
24
- export const DatabaseLibraryFileExtension = 'kicad_dbl';
25
- export const HTTPLibraryFileExtension = 'kicad_httplib';
26
- export const ArchiveFileExtension = 'zip';
27
- export const LegacyPcbFileExtension = 'brd';
28
- export const EaglePcbFileExtension = 'brd';
29
- export const CadstarPcbFileExtension = 'cpa';
30
- export const KiCadPcbFileExtension = 'kicad_pcb';
31
- export const DrawingSheetFileExtension = 'kicad_wks';
32
- export const DesignRulesFileExtension = 'kicad_dru';
33
- export const PdfFileExtension = 'pdf';
34
- export const MacrosFileExtension = 'mcr';
35
- export const DrillFileExtension = 'drl';
36
- export const SVGFileExtension = 'svg';
37
- export const ReportFileExtension = 'rpt';
38
- export const FootprintPlaceFileExtension = 'pos';
39
- export const KiCadFootprintLibPathExtension = 'pretty'; // this is a directory
40
- export const LegacyFootprintLibPathExtension = 'mod'; // this is a file
41
- export const AltiumFootprintLibPathExtension = 'PcbLib'; // this is a file
42
- export const CadstarFootprintLibPathExtension = 'cpa'; // this is a file
43
- export const EagleFootprintLibPathExtension = 'lbr'; // this is a file
44
- export const GedaPcbFootprintLibFileExtension = 'fp'; // this is a file
45
- export const KiCadFootprintFileExtension = 'kicad_mod';
46
- export const SpecctraDsnFileExtension = 'dsn';
47
- export const SpecctraSessionFileExtension = 'ses';
48
- export const IpcD356FileExtension = 'd356';
49
- export const Ipc2581FileExtension = 'xml';
50
- export const WorkbookFileExtension = 'wbk';
51
- export const PngFileExtension = 'png';
52
- export const JpegFileExtension = 'jpg';
53
- export const TextFileExtension = 'txt';
54
- export const MarkdownFileExtension = 'md';
55
- export const CsvFileExtension = 'csv';
56
- export const XmlFileExtension = 'xml';
57
- export const JsonFileExtension = 'json';
58
- export const StepFileExtension = 'step';
59
- export const StepFileAbrvExtension = 'stp';
60
- export const GltfBinaryFileExtension = 'glb';
61
- export const GerberFileExtensionsRegex = /(gbr|gko|pho|(g[tb][alops])|(gm?\\d\\d*)|(gp[tb]))/;
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
- export * from './sheet';
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
- import { gen_uuid } from '@modular-circuit/utils';
2
- import { DEFAULT_FONT_SIZE } from '../constraints';
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");
3
6
  const TEXT_MARGIN = 0.7116;
4
- export const gen_sch_sheet = (rect, pins, fields) => ({
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 const gen_sch_sheet = (rect, pins, fields) => ({
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 const gen_sch_sheet = (rect, pins, fields) => ({
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 const gen_sch_sheet = (rect, pins, fields) => ({
40
43
  fill: {
41
44
  color: { r: 0, g: 0, b: 0, a: 0.0 },
42
45
  },
43
- uuid: gen_uuid(),
46
+ uuid: (0, utils_1.gen_uuid)(),
44
47
  });
48
+ exports.gen_sch_sheet = gen_sch_sheet;
@@ -1,2 +1,18 @@
1
- export * from './lib_symbol';
2
- export * from './sch_symbol';
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,7 +1,10 @@
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 const gen_lib_gnd = (value) => ({
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) => ({
5
8
  name: `power:${value}`,
6
9
  pin_numbers: {
7
10
  offset: 0,
@@ -20,7 +23,7 @@ export const gen_lib_gnd = (value) => ({
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
  },
@@ -29,7 +32,7 @@ export const gen_lib_gnd = (value) => ({
29
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 const gen_lib_gnd = (value) => ({
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 const gen_lib_gnd = (value) => ({
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 const gen_lib_gnd = (value) => ({
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,7 +67,7 @@ export const gen_lib_gnd = (value) => ({
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
  },
@@ -74,7 +77,7 @@ export const gen_lib_gnd = (value) => ({
74
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 },
@@ -97,21 +100,21 @@ export const gen_lib_gnd = (value) => ({
97
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
  },
@@ -119,3 +122,4 @@ export const gen_lib_gnd = (value) => ({
119
122
  },
120
123
  ],
121
124
  });
125
+ exports.gen_lib_gnd = gen_lib_gnd;
@@ -1,2 +1,18 @@
1
- export * from './gnd';
2
- export * from './vcc';
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,7 +1,10 @@
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 const gen_lib_vcc = (value) => ({
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) => ({
5
8
  name: `power:${value}`,
6
9
  power: true,
7
10
  pin_numbers: {
@@ -21,7 +24,7 @@ export const gen_lib_vcc = (value) => ({
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
  },
@@ -30,7 +33,7 @@ export const gen_lib_vcc = (value) => ({
30
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 const gen_lib_vcc = (value) => ({
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,7 +50,7 @@ export const gen_lib_vcc = (value) => ({
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
  },
@@ -56,7 +59,7 @@ export const gen_lib_vcc = (value) => ({
56
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,7 +68,7 @@ export const gen_lib_vcc = (value) => ({
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
  },
@@ -75,7 +78,7 @@ export const gen_lib_vcc = (value) => ({
75
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 },
@@ -95,21 +98,21 @@ export const gen_lib_vcc = (value) => ({
95
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
  },
@@ -117,3 +120,4 @@ export const gen_lib_vcc = (value) => ({
117
120
  },
118
121
  ],
119
122
  });
123
+ exports.gen_lib_vcc = gen_lib_vcc;
@@ -1,7 +1,10 @@
1
- import { gen_uuid } from '@modular-circuit/utils';
2
- import { DEFAULT_FONT_SIZE } from '../../constraints';
3
- import { gen_pwr_ref } from '../symbol_utils';
4
- export const gen_sch_gnd = (value, pwr_number, port_id, position) => ({
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.gen_sch_gnd = void 0;
4
+ const utils_1 = require("@modular-circuit/utils");
5
+ const constraints_1 = require("../../constraints");
6
+ const symbol_utils_1 = require("../symbol_utils");
7
+ const gen_sch_gnd = (value, pwr_number, port_id, position) => ({
5
8
  lib_id: `power:${value}`,
6
9
  at: { position, rotation: 0 },
7
10
  unit: 1,
@@ -10,14 +13,14 @@ export const gen_sch_gnd = (value, pwr_number, port_id, position) => ({
10
13
  on_board: true,
11
14
  dnp: false,
12
15
  fields_autoplaced: true,
13
- uuid: gen_uuid(),
16
+ uuid: (0, utils_1.gen_uuid)(),
14
17
  properties: [
15
18
  {
16
19
  name: 'Reference',
17
- text: gen_pwr_ref(pwr_number),
20
+ text: (0, symbol_utils_1.gen_pwr_ref)(pwr_number),
18
21
  at: { position: { x: position.x, y: position.y + 6.35 }, rotation: 0 },
19
22
  effects: {
20
- font: { size: DEFAULT_FONT_SIZE },
23
+ font: { size: constraints_1.DEFAULT_FONT_SIZE },
21
24
  hide: true,
22
25
  },
23
26
  },
@@ -26,7 +29,7 @@ export const gen_sch_gnd = (value, pwr_number, port_id, position) => ({
26
29
  text: `${value}`,
27
30
  at: { position: { x: position.x, y: position.y + 5.08 }, rotation: 0 },
28
31
  effects: {
29
- font: { size: DEFAULT_FONT_SIZE },
32
+ font: { size: constraints_1.DEFAULT_FONT_SIZE },
30
33
  },
31
34
  },
32
35
  {
@@ -34,7 +37,7 @@ export const gen_sch_gnd = (value, pwr_number, port_id, position) => ({
34
37
  text: '',
35
38
  at: { position, rotation: 0 },
36
39
  effects: {
37
- font: { size: DEFAULT_FONT_SIZE },
40
+ font: { size: constraints_1.DEFAULT_FONT_SIZE },
38
41
  hide: true,
39
42
  },
40
43
  },
@@ -43,7 +46,7 @@ export const gen_sch_gnd = (value, pwr_number, port_id, position) => ({
43
46
  text: '',
44
47
  at: { position, rotation: 0 },
45
48
  effects: {
46
- font: { size: DEFAULT_FONT_SIZE },
49
+ font: { size: constraints_1.DEFAULT_FONT_SIZE },
47
50
  hide: true,
48
51
  },
49
52
  },
@@ -52,7 +55,7 @@ export const gen_sch_gnd = (value, pwr_number, port_id, position) => ({
52
55
  text: `Power symbol creates a global label with name \\"${value}\\" , ground`,
53
56
  at: { position, rotation: 0 },
54
57
  effects: {
55
- font: { size: DEFAULT_FONT_SIZE },
58
+ font: { size: constraints_1.DEFAULT_FONT_SIZE },
56
59
  hide: true,
57
60
  },
58
61
  },
@@ -64,3 +67,4 @@ export const gen_sch_gnd = (value, pwr_number, port_id, position) => ({
64
67
  },
65
68
  ],
66
69
  });
70
+ exports.gen_sch_gnd = gen_sch_gnd;
@@ -1,2 +1,18 @@
1
- export * from './gnd';
2
- export * from './vcc';
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);