@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,62 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return function (d, b) {
|
|
9
|
-
if (typeof b !== "function" && b !== null)
|
|
10
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
-
extendStatics(d, b);
|
|
12
|
-
function __() { this.constructor = d; }
|
|
13
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
-
};
|
|
15
|
-
})();
|
|
16
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
17
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
18
|
-
if (!m) return o;
|
|
19
|
-
var i = m.call(o), r, ar = [], e;
|
|
20
|
-
try {
|
|
21
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
22
|
-
}
|
|
23
|
-
catch (error) { e = { error: error }; }
|
|
24
|
-
finally {
|
|
25
|
-
try {
|
|
26
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
27
|
-
}
|
|
28
|
-
finally { if (e) throw e.error; }
|
|
29
|
-
}
|
|
30
|
-
return ar;
|
|
31
|
-
};
|
|
32
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
33
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
34
|
-
if (ar || !(i in from)) {
|
|
35
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
36
|
-
ar[i] = from[i];
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
40
|
-
};
|
|
41
|
-
var __values = (this && this.__values) || function(o) {
|
|
42
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
43
|
-
if (m) return m.call(o);
|
|
44
|
-
if (o && typeof o.length === "number") return {
|
|
45
|
-
next: function () {
|
|
46
|
-
if (o && i >= o.length) o = void 0;
|
|
47
|
-
return { value: o && o[i++], done: !o };
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
51
|
-
};
|
|
52
|
-
import { PortType, } from '@modular-circuit/electronics-model';
|
|
53
|
-
import { CompositePortLinkConverterBase } from './converter_base';
|
|
54
|
-
var CanLogicLinkTester = /** @class */ (function (_super) {
|
|
55
|
-
__extends(CanLogicLinkTester, _super);
|
|
56
|
-
function CanLogicLinkTester() {
|
|
57
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
58
|
-
}
|
|
59
|
-
CanLogicLinkTester.prototype.get_signals = function () {
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Dvp8LinkTester = exports.UsbCcLinkTester = exports.UsbLinkTester = exports.UartLinkTester = exports.SpeakerLinkTester = exports.SpiLinkTester = exports.I2sLinkTester = exports.I2cLinkTester = exports.SwdLinkTester = exports.CrystalLinkTester = exports.CanDiffLinkTester = exports.CanLogicLinkTester = void 0;
|
|
4
|
+
const electronics_model_1 = require("@modular-circuit/electronics-model");
|
|
5
|
+
const converter_base_1 = require("./converter_base");
|
|
6
|
+
class CanLogicLinkTester extends converter_base_1.CompositePortLinkConverterBase {
|
|
7
|
+
get_signals() {
|
|
60
8
|
if (!this.link)
|
|
61
9
|
return [];
|
|
62
10
|
// const txd = [this.link.controller.txd, this.link.transceiver.rxd, ...this.link.passive!.map((port) => port.rxd)]
|
|
@@ -64,7 +12,7 @@ var CanLogicLinkTester = /** @class */ (function (_super) {
|
|
|
64
12
|
return [
|
|
65
13
|
{
|
|
66
14
|
name: 'txd',
|
|
67
|
-
ports:
|
|
15
|
+
ports: [
|
|
68
16
|
{
|
|
69
17
|
parent: this.link.controller,
|
|
70
18
|
meta_port: this.link.controller.txd,
|
|
@@ -72,17 +20,18 @@ var CanLogicLinkTester = /** @class */ (function (_super) {
|
|
|
72
20
|
{
|
|
73
21
|
parent: this.link.transceiver,
|
|
74
22
|
meta_port: this.link.transceiver.rxd,
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
23
|
+
},
|
|
24
|
+
...this.link.passive.map((port) => {
|
|
25
|
+
return {
|
|
26
|
+
parent: port,
|
|
27
|
+
meta_port: port.rxd,
|
|
28
|
+
};
|
|
29
|
+
}),
|
|
30
|
+
],
|
|
82
31
|
},
|
|
83
32
|
{
|
|
84
33
|
name: 'rxd',
|
|
85
|
-
ports:
|
|
34
|
+
ports: [
|
|
86
35
|
{
|
|
87
36
|
parent: this.link.controller,
|
|
88
37
|
meta_port: this.link.controller.rxd,
|
|
@@ -90,47 +39,37 @@ var CanLogicLinkTester = /** @class */ (function (_super) {
|
|
|
90
39
|
{
|
|
91
40
|
parent: this.link.transceiver,
|
|
92
41
|
meta_port: this.link.transceiver.txd,
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
42
|
+
},
|
|
43
|
+
...this.link.passive.map((port) => {
|
|
44
|
+
return {
|
|
45
|
+
parent: port,
|
|
46
|
+
meta_port: port.txd,
|
|
47
|
+
};
|
|
48
|
+
}),
|
|
49
|
+
],
|
|
100
50
|
},
|
|
101
51
|
];
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
case PortType.CanPassivePort: {
|
|
121
|
-
passive.push(v);
|
|
122
|
-
break;
|
|
123
|
-
}
|
|
52
|
+
}
|
|
53
|
+
init_link() {
|
|
54
|
+
const controllers = [];
|
|
55
|
+
const transceivers = [];
|
|
56
|
+
const passive = [];
|
|
57
|
+
for (const v of this.ports) {
|
|
58
|
+
switch (v.type) {
|
|
59
|
+
case electronics_model_1.PortType.CanControllerPort: {
|
|
60
|
+
controllers.push(v);
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
case electronics_model_1.PortType.CanTransceiverPort: {
|
|
64
|
+
transceivers.push(v);
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
case electronics_model_1.PortType.CanPassivePort: {
|
|
68
|
+
passive.push(v);
|
|
69
|
+
break;
|
|
124
70
|
}
|
|
125
71
|
}
|
|
126
72
|
}
|
|
127
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
128
|
-
finally {
|
|
129
|
-
try {
|
|
130
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
131
|
-
}
|
|
132
|
-
finally { if (e_1) throw e_1.error; }
|
|
133
|
-
}
|
|
134
73
|
if (controllers.length !== 1) {
|
|
135
74
|
return false;
|
|
136
75
|
}
|
|
@@ -140,19 +79,14 @@ var CanLogicLinkTester = /** @class */ (function (_super) {
|
|
|
140
79
|
this.link = {
|
|
141
80
|
controller: controllers[0],
|
|
142
81
|
transceiver: transceivers[0],
|
|
143
|
-
passive
|
|
82
|
+
passive,
|
|
144
83
|
};
|
|
145
84
|
return true;
|
|
146
|
-
};
|
|
147
|
-
return CanLogicLinkTester;
|
|
148
|
-
}(CompositePortLinkConverterBase));
|
|
149
|
-
export { CanLogicLinkTester };
|
|
150
|
-
var CanDiffLinkTester = /** @class */ (function (_super) {
|
|
151
|
-
__extends(CanDiffLinkTester, _super);
|
|
152
|
-
function CanDiffLinkTester() {
|
|
153
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
154
85
|
}
|
|
155
|
-
|
|
86
|
+
}
|
|
87
|
+
exports.CanLogicLinkTester = CanLogicLinkTester;
|
|
88
|
+
class CanDiffLinkTester extends converter_base_1.CompositePortLinkConverterBase {
|
|
89
|
+
get_signals() {
|
|
156
90
|
if (!this.link)
|
|
157
91
|
return [];
|
|
158
92
|
// const canh = this.link.nodes.map((node) => node.canh)
|
|
@@ -160,63 +94,51 @@ var CanDiffLinkTester = /** @class */ (function (_super) {
|
|
|
160
94
|
return [
|
|
161
95
|
{
|
|
162
96
|
name: 'canh',
|
|
163
|
-
ports:
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
97
|
+
ports: [
|
|
98
|
+
...this.link.nodes.map((port) => {
|
|
99
|
+
return {
|
|
100
|
+
parent: port,
|
|
101
|
+
meta_port: port.canh,
|
|
102
|
+
};
|
|
103
|
+
}),
|
|
104
|
+
],
|
|
169
105
|
},
|
|
170
106
|
{
|
|
171
107
|
name: 'canl',
|
|
172
|
-
ports:
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
108
|
+
ports: [
|
|
109
|
+
...this.link.nodes.map((port) => {
|
|
110
|
+
return {
|
|
111
|
+
parent: port,
|
|
112
|
+
meta_port: port.canl,
|
|
113
|
+
};
|
|
114
|
+
}),
|
|
115
|
+
],
|
|
178
116
|
},
|
|
179
117
|
];
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
var v = _c.value;
|
|
187
|
-
if (v.type === PortType.CanDiffPort) {
|
|
188
|
-
nodes.push(v);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
193
|
-
finally {
|
|
194
|
-
try {
|
|
195
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
118
|
+
}
|
|
119
|
+
init_link() {
|
|
120
|
+
const nodes = [];
|
|
121
|
+
for (const v of this.ports) {
|
|
122
|
+
if (v.type === electronics_model_1.PortType.CanDiffPort) {
|
|
123
|
+
nodes.push(v);
|
|
196
124
|
}
|
|
197
|
-
finally { if (e_2) throw e_2.error; }
|
|
198
125
|
}
|
|
199
126
|
if (nodes.length === 0) {
|
|
200
127
|
return false;
|
|
201
128
|
}
|
|
202
129
|
this.link = {
|
|
203
|
-
nodes
|
|
130
|
+
nodes,
|
|
204
131
|
};
|
|
205
132
|
return true;
|
|
206
|
-
};
|
|
207
|
-
return CanDiffLinkTester;
|
|
208
|
-
}(CompositePortLinkConverterBase));
|
|
209
|
-
export { CanDiffLinkTester };
|
|
210
|
-
var CrystalLinkTester = /** @class */ (function (_super) {
|
|
211
|
-
__extends(CrystalLinkTester, _super);
|
|
212
|
-
function CrystalLinkTester() {
|
|
213
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
214
133
|
}
|
|
215
|
-
|
|
134
|
+
}
|
|
135
|
+
exports.CanDiffLinkTester = CanDiffLinkTester;
|
|
136
|
+
class CrystalLinkTester extends converter_base_1.CompositePortLinkConverterBase {
|
|
137
|
+
get_signals() {
|
|
216
138
|
if (!this.link)
|
|
217
139
|
return [];
|
|
218
|
-
|
|
219
|
-
|
|
140
|
+
const driver = this.link.driver;
|
|
141
|
+
const crystal = this.link.crystal;
|
|
220
142
|
return [
|
|
221
143
|
{
|
|
222
144
|
name: 'xtal',
|
|
@@ -245,33 +167,22 @@ var CrystalLinkTester = /** @class */ (function (_super) {
|
|
|
245
167
|
],
|
|
246
168
|
},
|
|
247
169
|
];
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
case PortType.CrystalPort: {
|
|
262
|
-
crystals.push(v);
|
|
263
|
-
break;
|
|
264
|
-
}
|
|
170
|
+
}
|
|
171
|
+
init_link() {
|
|
172
|
+
const drivers = [];
|
|
173
|
+
const crystals = [];
|
|
174
|
+
for (const v of this.ports) {
|
|
175
|
+
switch (v.type) {
|
|
176
|
+
case electronics_model_1.PortType.CrystalDriver: {
|
|
177
|
+
drivers.push(v);
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
case electronics_model_1.PortType.CrystalPort: {
|
|
181
|
+
crystals.push(v);
|
|
182
|
+
break;
|
|
265
183
|
}
|
|
266
184
|
}
|
|
267
185
|
}
|
|
268
|
-
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
269
|
-
finally {
|
|
270
|
-
try {
|
|
271
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
272
|
-
}
|
|
273
|
-
finally { if (e_3) throw e_3.error; }
|
|
274
|
-
}
|
|
275
186
|
if (drivers.length !== 1) {
|
|
276
187
|
return false;
|
|
277
188
|
}
|
|
@@ -283,16 +194,11 @@ var CrystalLinkTester = /** @class */ (function (_super) {
|
|
|
283
194
|
crystal: crystals[0],
|
|
284
195
|
};
|
|
285
196
|
return true;
|
|
286
|
-
};
|
|
287
|
-
return CrystalLinkTester;
|
|
288
|
-
}(CompositePortLinkConverterBase));
|
|
289
|
-
export { CrystalLinkTester };
|
|
290
|
-
var SwdLinkTester = /** @class */ (function (_super) {
|
|
291
|
-
__extends(SwdLinkTester, _super);
|
|
292
|
-
function SwdLinkTester() {
|
|
293
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
294
197
|
}
|
|
295
|
-
|
|
198
|
+
}
|
|
199
|
+
exports.CrystalLinkTester = CrystalLinkTester;
|
|
200
|
+
class SwdLinkTester extends converter_base_1.CompositePortLinkConverterBase {
|
|
201
|
+
get_signals() {
|
|
296
202
|
if (!this.link)
|
|
297
203
|
return [];
|
|
298
204
|
// const swdio = [this.link.host.swdio, this.link.device.swdio, ...this.link.pull!.map((port) => port.swdio)]
|
|
@@ -300,7 +206,7 @@ var SwdLinkTester = /** @class */ (function (_super) {
|
|
|
300
206
|
return [
|
|
301
207
|
{
|
|
302
208
|
name: 'swdio',
|
|
303
|
-
ports:
|
|
209
|
+
ports: [
|
|
304
210
|
{
|
|
305
211
|
parent: this.link.host,
|
|
306
212
|
meta_port: this.link.host.swdio,
|
|
@@ -308,17 +214,18 @@ var SwdLinkTester = /** @class */ (function (_super) {
|
|
|
308
214
|
{
|
|
309
215
|
parent: this.link.device,
|
|
310
216
|
meta_port: this.link.device.swdio,
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
217
|
+
},
|
|
218
|
+
...this.link.pull.map((port) => {
|
|
219
|
+
return {
|
|
220
|
+
parent: port,
|
|
221
|
+
meta_port: port.swdio,
|
|
222
|
+
};
|
|
223
|
+
}),
|
|
224
|
+
],
|
|
318
225
|
},
|
|
319
226
|
{
|
|
320
227
|
name: 'swclk',
|
|
321
|
-
ports:
|
|
228
|
+
ports: [
|
|
322
229
|
{
|
|
323
230
|
parent: this.link.host,
|
|
324
231
|
meta_port: this.link.host.swclk,
|
|
@@ -326,47 +233,37 @@ var SwdLinkTester = /** @class */ (function (_super) {
|
|
|
326
233
|
{
|
|
327
234
|
parent: this.link.device,
|
|
328
235
|
meta_port: this.link.device.swclk,
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
236
|
+
},
|
|
237
|
+
...this.link.pull.map((port) => {
|
|
238
|
+
return {
|
|
239
|
+
parent: port,
|
|
240
|
+
meta_port: port.swclk,
|
|
241
|
+
};
|
|
242
|
+
}),
|
|
243
|
+
],
|
|
336
244
|
},
|
|
337
245
|
];
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
case PortType.SwdPullPort: {
|
|
357
|
-
pull.push(v);
|
|
358
|
-
break;
|
|
359
|
-
}
|
|
246
|
+
}
|
|
247
|
+
init_link() {
|
|
248
|
+
const hosts = [];
|
|
249
|
+
const devices = [];
|
|
250
|
+
const pull = [];
|
|
251
|
+
for (const v of this.ports) {
|
|
252
|
+
switch (v.type) {
|
|
253
|
+
case electronics_model_1.PortType.SwdHostPort: {
|
|
254
|
+
hosts.push(v);
|
|
255
|
+
break;
|
|
256
|
+
}
|
|
257
|
+
case electronics_model_1.PortType.SwdTargetPort: {
|
|
258
|
+
devices.push(v);
|
|
259
|
+
break;
|
|
260
|
+
}
|
|
261
|
+
case electronics_model_1.PortType.SwdPullPort: {
|
|
262
|
+
pull.push(v);
|
|
263
|
+
break;
|
|
360
264
|
}
|
|
361
265
|
}
|
|
362
266
|
}
|
|
363
|
-
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
364
|
-
finally {
|
|
365
|
-
try {
|
|
366
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
367
|
-
}
|
|
368
|
-
finally { if (e_4) throw e_4.error; }
|
|
369
|
-
}
|
|
370
267
|
if (hosts.length !== 1) {
|
|
371
268
|
return false;
|
|
372
269
|
}
|
|
@@ -376,45 +273,44 @@ var SwdLinkTester = /** @class */ (function (_super) {
|
|
|
376
273
|
this.link = {
|
|
377
274
|
host: hosts[0],
|
|
378
275
|
device: devices[0],
|
|
379
|
-
pull
|
|
276
|
+
pull,
|
|
380
277
|
};
|
|
381
278
|
return true;
|
|
382
|
-
};
|
|
383
|
-
return SwdLinkTester;
|
|
384
|
-
}(CompositePortLinkConverterBase));
|
|
385
|
-
export { SwdLinkTester };
|
|
386
|
-
var I2cLinkTester = /** @class */ (function (_super) {
|
|
387
|
-
__extends(I2cLinkTester, _super);
|
|
388
|
-
function I2cLinkTester() {
|
|
389
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
390
279
|
}
|
|
391
|
-
|
|
280
|
+
}
|
|
281
|
+
exports.SwdLinkTester = SwdLinkTester;
|
|
282
|
+
class I2cLinkTester extends converter_base_1.CompositePortLinkConverterBase {
|
|
283
|
+
get_signals() {
|
|
392
284
|
if (!this.link)
|
|
393
285
|
return [];
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
286
|
+
const scl = [
|
|
287
|
+
...this.link.pull.map((device) => ({
|
|
288
|
+
parent: device,
|
|
289
|
+
meta_port: device.scl,
|
|
290
|
+
})),
|
|
398
291
|
{
|
|
399
292
|
parent: this.link.controller,
|
|
400
293
|
meta_port: this.link.controller.scl,
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
294
|
+
},
|
|
295
|
+
...this.link.targets.map((device) => ({
|
|
296
|
+
parent: device,
|
|
297
|
+
meta_port: device.scl,
|
|
298
|
+
})),
|
|
299
|
+
];
|
|
300
|
+
const sda = [
|
|
301
|
+
...this.link.pull.map((device) => ({
|
|
302
|
+
parent: device,
|
|
303
|
+
meta_port: device.sda,
|
|
304
|
+
})),
|
|
410
305
|
{
|
|
411
306
|
parent: this.link.controller,
|
|
412
307
|
meta_port: this.link.controller.sda,
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
308
|
+
},
|
|
309
|
+
...this.link.targets.map((device) => ({
|
|
310
|
+
parent: device,
|
|
311
|
+
meta_port: device.sda,
|
|
312
|
+
})),
|
|
313
|
+
];
|
|
418
314
|
return [
|
|
419
315
|
{
|
|
420
316
|
name: 'scl',
|
|
@@ -425,38 +321,27 @@ var I2cLinkTester = /** @class */ (function (_super) {
|
|
|
425
321
|
ports: sda,
|
|
426
322
|
},
|
|
427
323
|
];
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
case PortType.I2cTarget: {
|
|
447
|
-
targets.push(v);
|
|
448
|
-
break;
|
|
449
|
-
}
|
|
324
|
+
}
|
|
325
|
+
init_link() {
|
|
326
|
+
const pull = [];
|
|
327
|
+
const controllers = [];
|
|
328
|
+
const targets = [];
|
|
329
|
+
for (const v of this.ports) {
|
|
330
|
+
switch (v.type) {
|
|
331
|
+
case electronics_model_1.PortType.I2cPullupPort: {
|
|
332
|
+
pull.push(v);
|
|
333
|
+
break;
|
|
334
|
+
}
|
|
335
|
+
case electronics_model_1.PortType.I2cController: {
|
|
336
|
+
controllers.push(v);
|
|
337
|
+
break;
|
|
338
|
+
}
|
|
339
|
+
case electronics_model_1.PortType.I2cTarget: {
|
|
340
|
+
targets.push(v);
|
|
341
|
+
break;
|
|
450
342
|
}
|
|
451
343
|
}
|
|
452
344
|
}
|
|
453
|
-
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
454
|
-
finally {
|
|
455
|
-
try {
|
|
456
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
457
|
-
}
|
|
458
|
-
finally { if (e_5) throw e_5.error; }
|
|
459
|
-
}
|
|
460
345
|
if (controllers.length !== 1) {
|
|
461
346
|
return false;
|
|
462
347
|
}
|
|
@@ -464,25 +349,20 @@ var I2cLinkTester = /** @class */ (function (_super) {
|
|
|
464
349
|
return false;
|
|
465
350
|
}
|
|
466
351
|
this.link = {
|
|
467
|
-
pull
|
|
352
|
+
pull,
|
|
468
353
|
controller: controllers[0],
|
|
469
|
-
targets
|
|
354
|
+
targets,
|
|
470
355
|
};
|
|
471
356
|
return true;
|
|
472
|
-
};
|
|
473
|
-
return I2cLinkTester;
|
|
474
|
-
}(CompositePortLinkConverterBase));
|
|
475
|
-
export { I2cLinkTester };
|
|
476
|
-
var I2sLinkTester = /** @class */ (function (_super) {
|
|
477
|
-
__extends(I2sLinkTester, _super);
|
|
478
|
-
function I2sLinkTester() {
|
|
479
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
480
357
|
}
|
|
481
|
-
|
|
358
|
+
}
|
|
359
|
+
exports.I2cLinkTester = I2cLinkTester;
|
|
360
|
+
class I2sLinkTester extends converter_base_1.CompositePortLinkConverterBase {
|
|
361
|
+
get_signals() {
|
|
482
362
|
if (!this.link)
|
|
483
363
|
return [];
|
|
484
|
-
|
|
485
|
-
|
|
364
|
+
const controller = this.link.controller;
|
|
365
|
+
const target_receiver = this.link.target_receiver;
|
|
486
366
|
// const sck = [controller.sck, target_receiver.sck]
|
|
487
367
|
// const ws = [controller.ws, target_receiver.ws]
|
|
488
368
|
// const sd = [controller.sd, target_receiver.sd]
|
|
@@ -527,33 +407,22 @@ var I2sLinkTester = /** @class */ (function (_super) {
|
|
|
527
407
|
],
|
|
528
408
|
},
|
|
529
409
|
];
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
case PortType.I2sTargetReceiver: {
|
|
544
|
-
target_receivers.push(v);
|
|
545
|
-
break;
|
|
546
|
-
}
|
|
410
|
+
}
|
|
411
|
+
init_link() {
|
|
412
|
+
const controllers = [];
|
|
413
|
+
const target_receivers = [];
|
|
414
|
+
for (const v of this.ports) {
|
|
415
|
+
switch (v.type) {
|
|
416
|
+
case electronics_model_1.PortType.I2sController: {
|
|
417
|
+
controllers.push(v);
|
|
418
|
+
break;
|
|
419
|
+
}
|
|
420
|
+
case electronics_model_1.PortType.I2sTargetReceiver: {
|
|
421
|
+
target_receivers.push(v);
|
|
422
|
+
break;
|
|
547
423
|
}
|
|
548
424
|
}
|
|
549
425
|
}
|
|
550
|
-
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
551
|
-
finally {
|
|
552
|
-
try {
|
|
553
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
554
|
-
}
|
|
555
|
-
finally { if (e_6) throw e_6.error; }
|
|
556
|
-
}
|
|
557
426
|
if (controllers.length !== 1) {
|
|
558
427
|
return false;
|
|
559
428
|
}
|
|
@@ -565,88 +434,75 @@ var I2sLinkTester = /** @class */ (function (_super) {
|
|
|
565
434
|
target_receiver: target_receivers[0],
|
|
566
435
|
};
|
|
567
436
|
return true;
|
|
568
|
-
};
|
|
569
|
-
return I2sLinkTester;
|
|
570
|
-
}(CompositePortLinkConverterBase));
|
|
571
|
-
export { I2sLinkTester };
|
|
572
|
-
var SpiLinkTester = /** @class */ (function (_super) {
|
|
573
|
-
__extends(SpiLinkTester, _super);
|
|
574
|
-
function SpiLinkTester() {
|
|
575
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
576
437
|
}
|
|
577
|
-
|
|
438
|
+
}
|
|
439
|
+
exports.I2sLinkTester = I2sLinkTester;
|
|
440
|
+
class SpiLinkTester extends converter_base_1.CompositePortLinkConverterBase {
|
|
441
|
+
get_signals() {
|
|
578
442
|
if (!this.link)
|
|
579
443
|
return [];
|
|
580
|
-
|
|
581
|
-
|
|
444
|
+
const controller = this.link.controller;
|
|
445
|
+
const peripherals = this.link.peripherals;
|
|
582
446
|
// const sck = [controller.sck, ...peripherals.map((device) => device.sck)]
|
|
583
447
|
// const miso = [controller.miso, ...peripherals.map((device) => device.miso)]
|
|
584
448
|
// const mosi = [controller.mosi, ...peripherals.map((device) => device.mosi)]
|
|
585
449
|
return [
|
|
586
450
|
{
|
|
587
451
|
name: 'sck',
|
|
588
|
-
ports:
|
|
452
|
+
ports: [
|
|
589
453
|
{
|
|
590
454
|
parent: controller,
|
|
591
455
|
meta_port: controller.sck,
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
456
|
+
},
|
|
457
|
+
...peripherals.map((device) => ({
|
|
458
|
+
parent: device,
|
|
459
|
+
meta_port: device.sck,
|
|
460
|
+
})),
|
|
461
|
+
],
|
|
597
462
|
},
|
|
598
463
|
{
|
|
599
464
|
name: 'miso',
|
|
600
|
-
ports:
|
|
465
|
+
ports: [
|
|
601
466
|
{
|
|
602
467
|
parent: controller,
|
|
603
468
|
meta_port: controller.miso,
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
469
|
+
},
|
|
470
|
+
...peripherals.map((device) => ({
|
|
471
|
+
parent: device,
|
|
472
|
+
meta_port: device.miso,
|
|
473
|
+
})),
|
|
474
|
+
],
|
|
609
475
|
},
|
|
610
476
|
{
|
|
611
477
|
name: 'mosi',
|
|
612
|
-
ports:
|
|
478
|
+
ports: [
|
|
613
479
|
{
|
|
614
480
|
parent: controller,
|
|
615
481
|
meta_port: controller.mosi,
|
|
616
|
-
}
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
482
|
+
},
|
|
483
|
+
...peripherals.map((device) => ({
|
|
484
|
+
parent: device,
|
|
485
|
+
meta_port: device.mosi,
|
|
486
|
+
})),
|
|
487
|
+
],
|
|
621
488
|
},
|
|
622
489
|
];
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
case PortType.SpiPeripheral: {
|
|
637
|
-
peripherals.push(v);
|
|
638
|
-
break;
|
|
639
|
-
}
|
|
490
|
+
}
|
|
491
|
+
init_link() {
|
|
492
|
+
const controllers = [];
|
|
493
|
+
const peripherals = [];
|
|
494
|
+
for (const v of this.ports) {
|
|
495
|
+
switch (v.type) {
|
|
496
|
+
case electronics_model_1.PortType.SpiController: {
|
|
497
|
+
controllers.push(v);
|
|
498
|
+
break;
|
|
499
|
+
}
|
|
500
|
+
case electronics_model_1.PortType.SpiPeripheral: {
|
|
501
|
+
peripherals.push(v);
|
|
502
|
+
break;
|
|
640
503
|
}
|
|
641
504
|
}
|
|
642
505
|
}
|
|
643
|
-
catch (e_7_1) { e_7 = { error: e_7_1 }; }
|
|
644
|
-
finally {
|
|
645
|
-
try {
|
|
646
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
647
|
-
}
|
|
648
|
-
finally { if (e_7) throw e_7.error; }
|
|
649
|
-
}
|
|
650
506
|
if (controllers.length !== 1) {
|
|
651
507
|
return false;
|
|
652
508
|
}
|
|
@@ -655,19 +511,14 @@ var SpiLinkTester = /** @class */ (function (_super) {
|
|
|
655
511
|
}
|
|
656
512
|
this.link = {
|
|
657
513
|
controller: controllers[0],
|
|
658
|
-
peripherals
|
|
514
|
+
peripherals,
|
|
659
515
|
};
|
|
660
516
|
return true;
|
|
661
|
-
};
|
|
662
|
-
return SpiLinkTester;
|
|
663
|
-
}(CompositePortLinkConverterBase));
|
|
664
|
-
export { SpiLinkTester };
|
|
665
|
-
var SpeakerLinkTester = /** @class */ (function (_super) {
|
|
666
|
-
__extends(SpeakerLinkTester, _super);
|
|
667
|
-
function SpeakerLinkTester() {
|
|
668
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
669
517
|
}
|
|
670
|
-
|
|
518
|
+
}
|
|
519
|
+
exports.SpiLinkTester = SpiLinkTester;
|
|
520
|
+
class SpeakerLinkTester extends converter_base_1.CompositePortLinkConverterBase {
|
|
521
|
+
get_signals() {
|
|
671
522
|
if (!this.link)
|
|
672
523
|
return [];
|
|
673
524
|
// const a = [this.link.source.a, this.link.sink.a]
|
|
@@ -700,33 +551,22 @@ var SpeakerLinkTester = /** @class */ (function (_super) {
|
|
|
700
551
|
],
|
|
701
552
|
},
|
|
702
553
|
];
|
|
703
|
-
}
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
case PortType.SpeakerPort: {
|
|
717
|
-
sinks.push(v);
|
|
718
|
-
break;
|
|
719
|
-
}
|
|
554
|
+
}
|
|
555
|
+
init_link() {
|
|
556
|
+
const sources = [];
|
|
557
|
+
const sinks = [];
|
|
558
|
+
for (const v of this.ports) {
|
|
559
|
+
switch (v.type) {
|
|
560
|
+
case electronics_model_1.PortType.SpeakerDriverPort: {
|
|
561
|
+
sources.push(v);
|
|
562
|
+
break;
|
|
563
|
+
}
|
|
564
|
+
case electronics_model_1.PortType.SpeakerPort: {
|
|
565
|
+
sinks.push(v);
|
|
566
|
+
break;
|
|
720
567
|
}
|
|
721
568
|
}
|
|
722
569
|
}
|
|
723
|
-
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
|
724
|
-
finally {
|
|
725
|
-
try {
|
|
726
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
727
|
-
}
|
|
728
|
-
finally { if (e_8) throw e_8.error; }
|
|
729
|
-
}
|
|
730
570
|
if (sources.length !== 1) {
|
|
731
571
|
return false;
|
|
732
572
|
}
|
|
@@ -738,16 +578,11 @@ var SpeakerLinkTester = /** @class */ (function (_super) {
|
|
|
738
578
|
sink: sinks[0],
|
|
739
579
|
};
|
|
740
580
|
return true;
|
|
741
|
-
};
|
|
742
|
-
return SpeakerLinkTester;
|
|
743
|
-
}(CompositePortLinkConverterBase));
|
|
744
|
-
export { SpeakerLinkTester };
|
|
745
|
-
var UartLinkTester = /** @class */ (function (_super) {
|
|
746
|
-
__extends(UartLinkTester, _super);
|
|
747
|
-
function UartLinkTester() {
|
|
748
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
749
581
|
}
|
|
750
|
-
|
|
582
|
+
}
|
|
583
|
+
exports.SpeakerLinkTester = SpeakerLinkTester;
|
|
584
|
+
class UartLinkTester extends converter_base_1.CompositePortLinkConverterBase {
|
|
585
|
+
get_signals() {
|
|
751
586
|
if (!this.link)
|
|
752
587
|
return [];
|
|
753
588
|
// const tx = [this.link.a.tx, this.link.b.rx]
|
|
@@ -780,24 +615,13 @@ var UartLinkTester = /** @class */ (function (_super) {
|
|
|
780
615
|
],
|
|
781
616
|
},
|
|
782
617
|
];
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
var v = _c.value;
|
|
790
|
-
if (v.type === PortType.UartPort) {
|
|
791
|
-
ports.push(v);
|
|
792
|
-
}
|
|
793
|
-
}
|
|
794
|
-
}
|
|
795
|
-
catch (e_9_1) { e_9 = { error: e_9_1 }; }
|
|
796
|
-
finally {
|
|
797
|
-
try {
|
|
798
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
618
|
+
}
|
|
619
|
+
init_link() {
|
|
620
|
+
const ports = [];
|
|
621
|
+
for (const v of this.ports) {
|
|
622
|
+
if (v.type === electronics_model_1.PortType.UartPort) {
|
|
623
|
+
ports.push(v);
|
|
799
624
|
}
|
|
800
|
-
finally { if (e_9) throw e_9.error; }
|
|
801
625
|
}
|
|
802
626
|
if (ports.length !== 2) {
|
|
803
627
|
return false;
|
|
@@ -807,16 +631,11 @@ var UartLinkTester = /** @class */ (function (_super) {
|
|
|
807
631
|
b: ports[1],
|
|
808
632
|
};
|
|
809
633
|
return true;
|
|
810
|
-
};
|
|
811
|
-
return UartLinkTester;
|
|
812
|
-
}(CompositePortLinkConverterBase));
|
|
813
|
-
export { UartLinkTester };
|
|
814
|
-
var UsbLinkTester = /** @class */ (function (_super) {
|
|
815
|
-
__extends(UsbLinkTester, _super);
|
|
816
|
-
function UsbLinkTester() {
|
|
817
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
818
634
|
}
|
|
819
|
-
|
|
635
|
+
}
|
|
636
|
+
exports.UartLinkTester = UartLinkTester;
|
|
637
|
+
class UsbLinkTester extends converter_base_1.CompositePortLinkConverterBase {
|
|
638
|
+
get_signals() {
|
|
820
639
|
if (!this.link)
|
|
821
640
|
return [];
|
|
822
641
|
// const dp = [this.link.host.dp, this.link.device.dp, ...this.link.passive!.map((port) => port.dp)]
|
|
@@ -824,7 +643,7 @@ var UsbLinkTester = /** @class */ (function (_super) {
|
|
|
824
643
|
return [
|
|
825
644
|
{
|
|
826
645
|
name: 'dp',
|
|
827
|
-
ports:
|
|
646
|
+
ports: [
|
|
828
647
|
{
|
|
829
648
|
parent: this.link.host,
|
|
830
649
|
meta_port: this.link.host.dp,
|
|
@@ -832,15 +651,16 @@ var UsbLinkTester = /** @class */ (function (_super) {
|
|
|
832
651
|
{
|
|
833
652
|
parent: this.link.device,
|
|
834
653
|
meta_port: this.link.device.dp,
|
|
835
|
-
}
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
654
|
+
},
|
|
655
|
+
...this.link.passive.map((port) => ({
|
|
656
|
+
parent: port,
|
|
657
|
+
meta_port: port.dp,
|
|
658
|
+
})),
|
|
659
|
+
],
|
|
840
660
|
},
|
|
841
661
|
{
|
|
842
662
|
name: 'dm',
|
|
843
|
-
ports:
|
|
663
|
+
ports: [
|
|
844
664
|
{
|
|
845
665
|
parent: this.link.host,
|
|
846
666
|
meta_port: this.link.host.dm,
|
|
@@ -848,45 +668,35 @@ var UsbLinkTester = /** @class */ (function (_super) {
|
|
|
848
668
|
{
|
|
849
669
|
parent: this.link.device,
|
|
850
670
|
meta_port: this.link.device.dm,
|
|
851
|
-
}
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
671
|
+
},
|
|
672
|
+
...this.link.passive.map((port) => ({
|
|
673
|
+
parent: port,
|
|
674
|
+
meta_port: port.dm,
|
|
675
|
+
})),
|
|
676
|
+
],
|
|
856
677
|
},
|
|
857
678
|
];
|
|
858
|
-
}
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
case PortType.UsbPassivePort: {
|
|
877
|
-
passive.push(v);
|
|
878
|
-
break;
|
|
879
|
-
}
|
|
679
|
+
}
|
|
680
|
+
init_link() {
|
|
681
|
+
const hosts = [];
|
|
682
|
+
const devices = [];
|
|
683
|
+
const passive = [];
|
|
684
|
+
for (const v of this.ports) {
|
|
685
|
+
switch (v.type) {
|
|
686
|
+
case electronics_model_1.PortType.UsbHostPort: {
|
|
687
|
+
hosts.push(v);
|
|
688
|
+
break;
|
|
689
|
+
}
|
|
690
|
+
case electronics_model_1.PortType.UsbDevicePort: {
|
|
691
|
+
devices.push(v);
|
|
692
|
+
break;
|
|
693
|
+
}
|
|
694
|
+
case electronics_model_1.PortType.UsbPassivePort: {
|
|
695
|
+
passive.push(v);
|
|
696
|
+
break;
|
|
880
697
|
}
|
|
881
698
|
}
|
|
882
699
|
}
|
|
883
|
-
catch (e_10_1) { e_10 = { error: e_10_1 }; }
|
|
884
|
-
finally {
|
|
885
|
-
try {
|
|
886
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
887
|
-
}
|
|
888
|
-
finally { if (e_10) throw e_10.error; }
|
|
889
|
-
}
|
|
890
700
|
if (hosts.length !== 1) {
|
|
891
701
|
return false;
|
|
892
702
|
}
|
|
@@ -896,19 +706,14 @@ var UsbLinkTester = /** @class */ (function (_super) {
|
|
|
896
706
|
this.link = {
|
|
897
707
|
host: hosts[0],
|
|
898
708
|
device: devices[0],
|
|
899
|
-
passive
|
|
709
|
+
passive,
|
|
900
710
|
};
|
|
901
711
|
return true;
|
|
902
|
-
};
|
|
903
|
-
return UsbLinkTester;
|
|
904
|
-
}(CompositePortLinkConverterBase));
|
|
905
|
-
export { UsbLinkTester };
|
|
906
|
-
var UsbCcLinkTester = /** @class */ (function (_super) {
|
|
907
|
-
__extends(UsbCcLinkTester, _super);
|
|
908
|
-
function UsbCcLinkTester() {
|
|
909
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
910
712
|
}
|
|
911
|
-
|
|
713
|
+
}
|
|
714
|
+
exports.UsbLinkTester = UsbLinkTester;
|
|
715
|
+
class UsbCcLinkTester extends converter_base_1.CompositePortLinkConverterBase {
|
|
716
|
+
get_signals() {
|
|
912
717
|
if (!this.link)
|
|
913
718
|
return [];
|
|
914
719
|
// const cc1 = [this.link.a.cc1, this.link.b.cc1]
|
|
@@ -941,24 +746,13 @@ var UsbCcLinkTester = /** @class */ (function (_super) {
|
|
|
941
746
|
],
|
|
942
747
|
},
|
|
943
748
|
];
|
|
944
|
-
}
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
var v = _c.value;
|
|
951
|
-
if (v.type === PortType.UsbCcPort) {
|
|
952
|
-
nodes.push(v);
|
|
953
|
-
}
|
|
954
|
-
}
|
|
955
|
-
}
|
|
956
|
-
catch (e_11_1) { e_11 = { error: e_11_1 }; }
|
|
957
|
-
finally {
|
|
958
|
-
try {
|
|
959
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
749
|
+
}
|
|
750
|
+
init_link() {
|
|
751
|
+
const nodes = [];
|
|
752
|
+
for (const v of this.ports) {
|
|
753
|
+
if (v.type === electronics_model_1.PortType.UsbCcPort) {
|
|
754
|
+
nodes.push(v);
|
|
960
755
|
}
|
|
961
|
-
finally { if (e_11) throw e_11.error; }
|
|
962
756
|
}
|
|
963
757
|
if (nodes.length !== 2) {
|
|
964
758
|
return false;
|
|
@@ -968,20 +762,15 @@ var UsbCcLinkTester = /** @class */ (function (_super) {
|
|
|
968
762
|
b: nodes[1],
|
|
969
763
|
};
|
|
970
764
|
return true;
|
|
971
|
-
};
|
|
972
|
-
return UsbCcLinkTester;
|
|
973
|
-
}(CompositePortLinkConverterBase));
|
|
974
|
-
export { UsbCcLinkTester };
|
|
975
|
-
var Dvp8LinkTester = /** @class */ (function (_super) {
|
|
976
|
-
__extends(Dvp8LinkTester, _super);
|
|
977
|
-
function Dvp8LinkTester() {
|
|
978
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
979
765
|
}
|
|
980
|
-
|
|
766
|
+
}
|
|
767
|
+
exports.UsbCcLinkTester = UsbCcLinkTester;
|
|
768
|
+
class Dvp8LinkTester extends converter_base_1.CompositePortLinkConverterBase {
|
|
769
|
+
get_signals() {
|
|
981
770
|
if (!this.link)
|
|
982
771
|
return [];
|
|
983
|
-
|
|
984
|
-
|
|
772
|
+
const host = this.link.host;
|
|
773
|
+
const cam = this.link.cam;
|
|
985
774
|
// const digitalLinks = [
|
|
986
775
|
// [host.xclk, cam.xclk],
|
|
987
776
|
// [host.pclk, cam.pclk],
|
|
@@ -1146,33 +935,22 @@ var Dvp8LinkTester = /** @class */ (function (_super) {
|
|
|
1146
935
|
],
|
|
1147
936
|
},
|
|
1148
937
|
];
|
|
1149
|
-
}
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
case PortType.Dvp8Camera: {
|
|
1163
|
-
cams.push(v);
|
|
1164
|
-
break;
|
|
1165
|
-
}
|
|
938
|
+
}
|
|
939
|
+
init_link() {
|
|
940
|
+
const hosts = [];
|
|
941
|
+
const cams = [];
|
|
942
|
+
for (const v of this.ports) {
|
|
943
|
+
switch (v.type) {
|
|
944
|
+
case electronics_model_1.PortType.Dvp8Host: {
|
|
945
|
+
hosts.push(v);
|
|
946
|
+
break;
|
|
947
|
+
}
|
|
948
|
+
case electronics_model_1.PortType.Dvp8Camera: {
|
|
949
|
+
cams.push(v);
|
|
950
|
+
break;
|
|
1166
951
|
}
|
|
1167
952
|
}
|
|
1168
953
|
}
|
|
1169
|
-
catch (e_12_1) { e_12 = { error: e_12_1 }; }
|
|
1170
|
-
finally {
|
|
1171
|
-
try {
|
|
1172
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1173
|
-
}
|
|
1174
|
-
finally { if (e_12) throw e_12.error; }
|
|
1175
|
-
}
|
|
1176
954
|
if (hosts.length !== 1) {
|
|
1177
955
|
return false;
|
|
1178
956
|
}
|
|
@@ -1184,7 +962,6 @@ var Dvp8LinkTester = /** @class */ (function (_super) {
|
|
|
1184
962
|
cam: cams[0],
|
|
1185
963
|
};
|
|
1186
964
|
return true;
|
|
1187
|
-
}
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
export { Dvp8LinkTester };
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
exports.Dvp8LinkTester = Dvp8LinkTester;
|