@thi.ng/axidraw 1.1.33 → 1.1.35
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/CHANGELOG.md +1 -1
- package/README.md +1 -1
- package/axidraw.js +11 -5
- package/control.js +2 -1
- package/package.json +17 -18
- package/serial.js +2 -4
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
package/axidraw.js
CHANGED
|
@@ -42,12 +42,18 @@ export const DEFAULT_OPTS = {
|
|
|
42
42
|
sigint: true,
|
|
43
43
|
};
|
|
44
44
|
export class AxiDraw {
|
|
45
|
+
serial;
|
|
46
|
+
opts;
|
|
47
|
+
isConnected = false;
|
|
48
|
+
isPenDown = false;
|
|
49
|
+
penLimits;
|
|
50
|
+
penState = [];
|
|
51
|
+
pos = [0, 0];
|
|
52
|
+
targetPos = [0, 0];
|
|
53
|
+
homePos;
|
|
54
|
+
scale;
|
|
55
|
+
bounds;
|
|
45
56
|
constructor(opts = {}) {
|
|
46
|
-
this.isConnected = false;
|
|
47
|
-
this.isPenDown = false;
|
|
48
|
-
this.penState = [];
|
|
49
|
-
this.pos = [0, 0];
|
|
50
|
-
this.targetPos = [0, 0];
|
|
51
57
|
this.opts = { ...DEFAULT_OPTS, ...opts };
|
|
52
58
|
this.penLimits = [this.opts.down, this.opts.up];
|
|
53
59
|
this.scale = this.opts.stepsPerInch / this.opts.unitsPerInch;
|
package/control.js
CHANGED
|
@@ -7,9 +7,10 @@ import { AxiDrawState } from "./api.js";
|
|
|
7
7
|
* See {@link AxiDrawOpts.control} for further details.
|
|
8
8
|
*/
|
|
9
9
|
export class AxiDrawControl {
|
|
10
|
+
interval;
|
|
11
|
+
state = AxiDrawState.CONTINUE;
|
|
10
12
|
constructor(interval = 1000) {
|
|
11
13
|
this.interval = interval;
|
|
12
|
-
this.state = AxiDrawState.CONTINUE;
|
|
13
14
|
}
|
|
14
15
|
deref() {
|
|
15
16
|
return this.state;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/axidraw",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.35",
|
|
4
4
|
"description": "Minimal AxiDraw plotter/drawing machine controller for Node.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -28,30 +28,29 @@
|
|
|
28
28
|
"clean": "rimraf --glob '*.js' '*.d.ts' '*.map' doc",
|
|
29
29
|
"doc": "typedoc --excludePrivate --excludeInternal --out doc src/index.ts",
|
|
30
30
|
"doc:ae": "mkdir -p .ae/doc .ae/temp && api-extractor run --local --verbose",
|
|
31
|
-
"doc:readme": "
|
|
32
|
-
"doc:stats": "tools:module-stats",
|
|
31
|
+
"doc:readme": "bun ../../tools/src/module-stats.ts && bun ../../tools/src/readme.ts",
|
|
33
32
|
"pub": "yarn npm publish --access public",
|
|
34
|
-
"test": "
|
|
33
|
+
"test": "bun test"
|
|
35
34
|
},
|
|
36
35
|
"dependencies": {
|
|
37
|
-
"@thi.ng/api": "^8.9.
|
|
38
|
-
"@thi.ng/checks": "^3.4.
|
|
39
|
-
"@thi.ng/compose": "^2.1.
|
|
40
|
-
"@thi.ng/date": "^2.5.
|
|
41
|
-
"@thi.ng/errors": "^2.4.
|
|
42
|
-
"@thi.ng/logger": "^1.4.
|
|
43
|
-
"@thi.ng/math": "^5.7.
|
|
44
|
-
"@thi.ng/transducers": "^8.8.
|
|
45
|
-
"@thi.ng/units": "^0.4.
|
|
46
|
-
"@thi.ng/vectors": "^7.8.
|
|
36
|
+
"@thi.ng/api": "^8.9.8",
|
|
37
|
+
"@thi.ng/checks": "^3.4.8",
|
|
38
|
+
"@thi.ng/compose": "^2.1.47",
|
|
39
|
+
"@thi.ng/date": "^2.5.2",
|
|
40
|
+
"@thi.ng/errors": "^2.4.2",
|
|
41
|
+
"@thi.ng/logger": "^1.4.24",
|
|
42
|
+
"@thi.ng/math": "^5.7.3",
|
|
43
|
+
"@thi.ng/transducers": "^8.8.10",
|
|
44
|
+
"@thi.ng/units": "^0.4.15",
|
|
45
|
+
"@thi.ng/vectors": "^7.8.4",
|
|
47
46
|
"serialport": "^12.0.0"
|
|
48
47
|
},
|
|
49
48
|
"devDependencies": {
|
|
50
|
-
"@microsoft/api-extractor": "^7.38.
|
|
51
|
-
"@thi.ng/testament": "^0.
|
|
49
|
+
"@microsoft/api-extractor": "^7.38.2",
|
|
50
|
+
"@thi.ng/testament": "^0.4.1",
|
|
52
51
|
"rimraf": "^5.0.5",
|
|
53
52
|
"tools": "^0.0.1",
|
|
54
|
-
"typedoc": "^0.25.
|
|
53
|
+
"typedoc": "^0.25.3",
|
|
55
54
|
"typescript": "^5.2.2"
|
|
56
55
|
},
|
|
57
56
|
"keywords": [
|
|
@@ -115,5 +114,5 @@
|
|
|
115
114
|
"status": "alpha",
|
|
116
115
|
"year": 2022
|
|
117
116
|
},
|
|
118
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "669a3151e4302480244fe3e60eff5e732ea5b7a7\n"
|
|
119
118
|
}
|
package/serial.js
CHANGED
|
@@ -20,10 +20,8 @@ export const MOCK_SERIAL = {
|
|
|
20
20
|
* sent messages into an internal string array for later analysis.
|
|
21
21
|
*/
|
|
22
22
|
export class MockSerial {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
this.isClosed = false;
|
|
26
|
-
}
|
|
23
|
+
sent = [];
|
|
24
|
+
isClosed = false;
|
|
27
25
|
/**
|
|
28
26
|
* Clears internal log of "sent" message.
|
|
29
27
|
*/
|