dechatter 0.1.1 → 0.3.0
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 +167 -0
- package/README.md +93 -19
- package/package.json +3 -1
- package/web/dechatter.zip +0 -0
- package/web/engine.js +3 -2
- package/web/index.html +15 -3
- package/web/stepper.js +402 -0
- package/web/units.js +43 -0
- package/web/widget.css +15 -1
- package/web/widget.js +613 -208
- package/web/wizard.js +210 -47
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
What changed for people who use the dechatter widget and command line. The format follows
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and versions follow
|
|
5
|
+
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
## [0.3.0] - 2026-11-12
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- The widget runs a round itself: press Start in the widget instead of loading the program
|
|
14
|
+
into cncjs and pressing play. It sends one move at a time through cncjs and waits for the
|
|
15
|
+
controller to report Idle at its end, so it knows exactly when each cut starts and ends
|
|
16
|
+
and records those windows with the sound. Hold, Resume and Stop are in the widget; Stop
|
|
17
|
+
always holds first and resets the controller only once it has reported the hold complete
|
|
18
|
+
(or Idle) and nothing has changed for a second; if the connection drops meanwhile, nothing
|
|
19
|
+
is reset, then or on reconnect. An alarm (its state or an `ALARM:` line) ends the round with
|
|
20
|
+
nothing more sent and is left for you to clear (the widget never unlocks). With a
|
|
21
|
+
manual spindle no `M0` is sent: the widget asks for each speed and waits for Continue, so
|
|
22
|
+
the "set the spindle" prompt shows only once the machine has stopped. Start is refused
|
|
23
|
+
while cncjs runs a job of its own, in alarm or hold, or before the machine's units are
|
|
24
|
+
known, and a job cncjs starts during the round stops it. If the machine refuses, or the
|
|
25
|
+
microphone closes, while the round is being prepared, it does not start and no recording
|
|
26
|
+
is kept. While a round runs,
|
|
27
|
+
or starts, its session stays open: the session list, New, Import and Setup wait for it to
|
|
28
|
+
end.
|
|
29
|
+
`program.nc` is still written, unchanged, for the command line.
|
|
30
|
+
|
|
31
|
+
- On a machine in G20 the whole widget shows inches, not only the wizard and the programs:
|
|
32
|
+
the session summary, round headings and pass table, the front face position, the best
|
|
33
|
+
cuts, the chip-load sweep result and the stability map's axes. Inches have 4 decimals
|
|
34
|
+
(chip loads 5), with millimetres alongside where there is room. Files stay in mm.
|
|
35
|
+
|
|
36
|
+
### Added
|
|
37
|
+
|
|
38
|
+
- **Reset** next to the widget's session list, and `dechatter reset <session>` (with
|
|
39
|
+
`--yes` to skip the question), discard every round of a session and keep its setup. The
|
|
40
|
+
session starts again from round 1 and its setup can be changed freely, for instance after
|
|
41
|
+
a run in the air to check the toolpath, or one with Z zero set wrong. It asks first,
|
|
42
|
+
naming the rounds and recordings lost, offers Export first, and is refused while the
|
|
43
|
+
session records or a cncjs job of its program runs, and for a session whose setup does
|
|
44
|
+
not load (delete that one instead); rounds that do not load are no obstacle. A stale `report.html` in the session goes too.
|
|
45
|
+
- **Delete** next to the widget's session list removes a session from the browser for good,
|
|
46
|
+
after a confirmation that names its rounds and recordings and offers Export first. It
|
|
47
|
+
works for sessions that no longer load, such as ones from dechatter 0.1.x. One whose setup
|
|
48
|
+
does not load cannot be exported, and the confirmation says so instead. It is refused while the session
|
|
49
|
+
records or a cncjs job of its program runs.
|
|
50
|
+
|
|
51
|
+
### Fixed
|
|
52
|
+
|
|
53
|
+
- Cuts were matched to the wrong passes, seen on a real manual-spindle session: light cuts at
|
|
54
|
+
a low speed fell under one level threshold for the whole recording, and the rest slid onto
|
|
55
|
+
the wrong passes; passes never run had cuts forced onto them. A round the widget runs is
|
|
56
|
+
now analysed from the cut and dwell windows it recorded. A recording without them is
|
|
57
|
+
searched against the spindle's own noise around each cut, keeps the pass order with the
|
|
58
|
+
narrowest cuts taken as the unheard ones, and marks passes after the last cut as "likely
|
|
59
|
+
not run". A widget run that ended before its first cut leaves the round to run again,
|
|
60
|
+
and a cut stopped before the cutter reached the stock counts as not run. A hold before
|
|
61
|
+
the cutter reaches the stock no longer puts air into the cut analysed. Silence in a
|
|
62
|
+
recording, even most of it (a recorder left running after the round), short pauses with
|
|
63
|
+
the spindle off, or silence broken up by knocks, is told from a quiet spindle under loud
|
|
64
|
+
cuts, and no longer hides the spindle's level.
|
|
65
|
+
A pass whose spindle speed was found at the edge of its search is flagged.
|
|
66
|
+
- A recording could get stuck with no way to stop it, and Export was disabled meanwhile. The
|
|
67
|
+
recording now follows the widget's own run, which always ends (Stop, the last pass, an
|
|
68
|
+
error or a lost connection) and keeps the cuts made. A run held for a minute, or a machine
|
|
69
|
+
idle but not where its move ends, points to Stop. Export works during a run, without the
|
|
70
|
+
round in progress, and says so.
|
|
71
|
+
|
|
72
|
+
## [0.2.0] - 2026-11-12
|
|
73
|
+
|
|
74
|
+
### Changed
|
|
75
|
+
|
|
76
|
+
- **Breaking:** the spindle motor power is given in horsepower. `spindle_power_w` in
|
|
77
|
+
`[machine]` is now `spindle_power_hp` (1 hp = 745.7 W), and the wizard asks for hp.
|
|
78
|
+
- **Breaking:** sessions from 0.1.x do not load in 0.2.0, in the widget or the command line:
|
|
79
|
+
their setup, plans and results are in the older format. Start a new session for each
|
|
80
|
+
tool. dechatter refuses them with a message that says so: a 0.1.x setup (it has
|
|
81
|
+
`spindle_power_w`) is named as one, and a round in the older format says it was written
|
|
82
|
+
by an older dechatter. A round damaged otherwise is named with its file and the problem.
|
|
83
|
+
- **Breaking:** once a round has been cut (recorded or analysed), the setup can no longer
|
|
84
|
+
change in anything that shapes the cut or its sound: the machine's weight and spindle
|
|
85
|
+
control, the tool, the work material, depth, direction and chip load, the stock length,
|
|
86
|
+
the dwell and the coolant. The wizard and `dechatter plan` refuse such a change and say
|
|
87
|
+
which fields differ. Start a new session for the new setup.
|
|
88
|
+
- Programs are written in the machine's units: on a machine in G20 the program is in
|
|
89
|
+
inches, so a job never switches the machine's units, even one stopped part-way. Comments,
|
|
90
|
+
plans and results stay in millimetres. "Load into cncjs" waits until cncjs reports G20 or
|
|
91
|
+
G21; until it does, you can say which the machine is in.
|
|
92
|
+
- A round planned but not yet run is discarded when the setup changes its program, and the
|
|
93
|
+
widget says so. Plan it again. Program names now carry a short code, so a program loaded
|
|
94
|
+
into cncjs before such a change, or before a widget reload, is not taken for the new one:
|
|
95
|
+
load it again before running it.
|
|
96
|
+
- The machine's speed range and power, the cut's speed and width limits and shallower
|
|
97
|
+
depths, the machine's name, the safe height, clearance, plunge feed, truing width, stock
|
|
98
|
+
width and the planner's settings may change at any time. Cuts outside narrowed limits stay
|
|
99
|
+
in their round but are not recommended, nor are cuts over a lowered power cap, and the
|
|
100
|
+
chip-load sweep is offered only for a cut the power cap leaves room to sweep. A sweep's
|
|
101
|
+
result stays within the power cap as it is now. On the map, a stable cut wider than a narrowed
|
|
102
|
+
width limit counts as stable at the widest width searched; chatter that wide, and cuts at
|
|
103
|
+
speeds outside the limits, are left out. Cuts at the edges of the search, such as a width
|
|
104
|
+
the grid rounds just above the limit, or speeds a coarser speed step no longer reaches,
|
|
105
|
+
keep counting.
|
|
106
|
+
- The setup wizard shows on each step only what has to be answered about the machine, tool
|
|
107
|
+
and stock. Settings with a default or a computed value sit in a collapsed Advanced section,
|
|
108
|
+
showing what an empty entry becomes; a section holding a changed setting opens by itself.
|
|
109
|
+
- The setup cannot be saved while a job runs in cncjs or while a round is being recorded.
|
|
110
|
+
|
|
111
|
+
### Added
|
|
112
|
+
|
|
113
|
+
- A chip-load sweep after convergence: the widget offers it, and `dechatter plan --sweep`
|
|
114
|
+
plans it. The best stable cut runs again at five chip loads, by default 0.6 to 1.7 times
|
|
115
|
+
the session's, lightest first and inside the power cap. The result, the highest chip load
|
|
116
|
+
that stayed stable with its feed, shows beside the best cuts, in `dechatter report` and in
|
|
117
|
+
the printed report. Its cuts do not change the stability map. The bounds are two new
|
|
118
|
+
planner settings, `chip_load_sweep_low` and `chip_load_sweep_high`.
|
|
119
|
+
- A printable report: one HTML page for Letter or A4 with the recommended cuts per depth
|
|
120
|
+
(feed, removal rate, spindle power), the stability map, every round's passes with
|
|
121
|
+
verdicts set by hand marked, and the setup. The widget offers it on convergence and beside
|
|
122
|
+
the best cuts, exports include it as `report.html`, and `dechatter report <session>
|
|
123
|
+
--html <file> [--units in]` writes it. An export still succeeds, without the report, if
|
|
124
|
+
the report cannot be made.
|
|
125
|
+
- An (i) button on every wizard field with a longer explanation: what it changes, its
|
|
126
|
+
default, and whether it may change after a cut.
|
|
127
|
+
|
|
128
|
+
### Removed
|
|
129
|
+
|
|
130
|
+
- The "Use mm instead" button and the `G20` line at the end of programs: programs no longer
|
|
131
|
+
change the machine's units, so neither is needed.
|
|
132
|
+
|
|
133
|
+
### Fixed
|
|
134
|
+
|
|
135
|
+
- A new session could plan round 1 from the example setup when the wizard was cancelled.
|
|
136
|
+
Planning now waits until the setup is filled in, and the widget points to the wizard.
|
|
137
|
+
- Saving a new setup after rounds existed kept rounds planned for the old one.
|
|
138
|
+
|
|
139
|
+
## [0.1.1] - 2026-11-10
|
|
140
|
+
|
|
141
|
+
### Changed
|
|
142
|
+
|
|
143
|
+
- No changes to the widget or the command line. The first release published by the release
|
|
144
|
+
workflow, with npm provenance.
|
|
145
|
+
|
|
146
|
+
## [0.1.0] - 2026-11-10
|
|
147
|
+
|
|
148
|
+
### Added
|
|
149
|
+
|
|
150
|
+
- Command line: `dechatter init`, `plan`, `analyze`, `report`, `materials` and `widget`.
|
|
151
|
+
Each round of test cuts is a G-code program; a recording of the run is split into passes
|
|
152
|
+
and each is classified as stable or chatter from its sound.
|
|
153
|
+
- A Bayesian stability map over spindle speed and radial width that chooses the next cuts,
|
|
154
|
+
and stops when no cut promises enough extra removal rate.
|
|
155
|
+
- Shallower depths to compare once the deepest one is settled.
|
|
156
|
+
- Manual spindle control: the program stops before each speed for you to set it.
|
|
157
|
+
- The cncjs widget: runs a whole session in the browser (Pyodide), records with the
|
|
158
|
+
browser's microphone while the job runs, loads programs into cncjs, and shows verdicts,
|
|
159
|
+
the stability map and the best cuts. A setup wizard follows the machine's G20/G21 units.
|
|
160
|
+
Sessions export to a zip the command line reads, and import in another browser.
|
|
161
|
+
- Published on npm as `dechatter`, with third-party notices for the bundled Pyodide.
|
|
162
|
+
|
|
163
|
+
[Unreleased]: https://github.com/pedropaulovc/dechatter/compare/v0.3.0...HEAD
|
|
164
|
+
[0.3.0]: https://github.com/pedropaulovc/dechatter/compare/v0.2.0...v0.3.0
|
|
165
|
+
[0.2.0]: https://github.com/pedropaulovc/dechatter/compare/v0.1.1...v0.2.0
|
|
166
|
+
[0.1.1]: https://github.com/pedropaulovc/dechatter/compare/v0.1.0...v0.1.1
|
|
167
|
+
[0.1.0]: https://github.com/pedropaulovc/dechatter/releases/tag/v0.1.0
|
package/README.md
CHANGED
|
@@ -59,18 +59,61 @@ a page the microphone on those. Then, in the widget:
|
|
|
59
59
|
|
|
60
60
|
1. Create a session. A short wizard asks for the machine, the tool, the cut and the stock. It
|
|
61
61
|
shows lengths in inches when the machine is in G20 and in millimetres when it is in G21,
|
|
62
|
-
or with no machine connected. Its last step holds the planner's settings, which rarely
|
|
63
|
-
need changing.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
showing
|
|
62
|
+
or with no machine connected; so does the rest of the widget. Its last step holds the planner's settings, which rarely
|
|
63
|
+
need changing. Settings with a sensible default or a computed value (the machine's name,
|
|
64
|
+
the holder, the cut's limits and chip load, the program's dwell, clearance, plunge feed,
|
|
65
|
+
truing width and coolant, and the planner) sit in a collapsed Advanced section of their
|
|
66
|
+
step, showing what an empty entry becomes. A section holding a changed setting opens by
|
|
67
|
+
itself. Every field has an (i) button with a longer explanation: what it changes, its
|
|
68
|
+
default, and whether it may change after a cut. Saving from the wizard rewrites the
|
|
69
|
+
session's setup file without comments.
|
|
70
|
+
Programs are written in the machine's units too (G20 or G21, as cncjs reports it), so a
|
|
71
|
+
job never changes them, even one stopped part-way. Their comments, like the plan and the
|
|
72
|
+
results, stay in millimetres.
|
|
73
|
+
Nothing is planned until the wizard has been saved: a new session holds only an example
|
|
74
|
+
setup. Each round keeps a copy of the setup it was planned from. Once a round has been
|
|
75
|
+
cut, the setup can no longer change in anything that shapes the cut or its sound (the
|
|
76
|
+
machine's weight and spindle control, the tool, the work material, depth, direction and
|
|
77
|
+
chip load, the stock length, the dwell and the coolant), since the stability map belongs
|
|
78
|
+
to the setup it was measured with: start a new session instead. What only bounds the
|
|
79
|
+
search may still change (the machine's speed range and power, the cut's speed and width
|
|
80
|
+
limits and shallower depths), as may the machine's name, the safe height, clearance,
|
|
81
|
+
plunge feed, truing width, stock width and the planner's settings. Cuts outside narrowed
|
|
82
|
+
bounds stay in their round but are not recommended, nor are cuts over a lowered power
|
|
83
|
+
cap. On the map, a stable cut wider than a narrowed width limit counts as stable at the
|
|
84
|
+
widest width searched; chatter that wide, and cuts at speeds outside the limits, are left
|
|
85
|
+
out. A round
|
|
86
|
+
planned but not yet run is discarded when the setup changes its program, so the next
|
|
87
|
+
plan uses the new setup. `dechatter plan` refuses the same changes made by hand.
|
|
67
88
|
2. Plan a round. Round 1 is a coarse grid of speeds and widths.
|
|
68
89
|
3. Set the work zero at the left end of the stock, on its front face, at the top.
|
|
69
|
-
4.
|
|
70
|
-
|
|
71
|
-
|
|
90
|
+
4. Press Start. The widget runs the round itself through cncjs, one move at a time: it
|
|
91
|
+
sends a move, waits until the controller reports Idle at its end, then sends the next.
|
|
92
|
+
So it knows when every cut starts and ends, and records those times with the sound; at
|
|
93
|
+
most one move is ever queued, so if the tab closes or the connection drops the machine
|
|
94
|
+
finishes that move and stands. Hold, Resume and Stop are in the widget (cncjs's own feed
|
|
95
|
+
hold works too). Stop holds, waits until the controller reports the hold complete (or
|
|
96
|
+
Idle) and nothing changes for a second, then resets it; if the hold never completes, or
|
|
97
|
+
the connection drops meanwhile, it does not reset, and says so. An alarm stops the round with nothing more sent and is left for you
|
|
98
|
+
to clear in cncjs (home, or unlock): the widget never unlocks. While a round runs, its
|
|
99
|
+
session stays open: the session list, New, Import and Setup wait for it to end. Start is refused while cncjs runs a job of its own, while the machine is in
|
|
100
|
+
alarm or held, or before its G20/G21 mode is known, and a job cncjs starts during the
|
|
101
|
+
round stops the round. To check the toolpath first, raise Z zero and run the round in the
|
|
102
|
+
air, then Reset the session (next to the session list) and set Z zero back on the top of
|
|
103
|
+
the stock.
|
|
104
|
+
5. Recording starts with Start and stops when the last pass ends, or on Stop. The widget
|
|
105
|
+
then shows each pass as stable or chatter, the stability map and the best cuts so far.
|
|
72
106
|
6. If your ears disagree with a verdict, change it in the table. Plan the next round and
|
|
73
107
|
repeat until the widget reports convergence.
|
|
108
|
+
7. Optionally, plan the chip-load sweep it then offers: the best cut once more at five
|
|
109
|
+
chip loads, from 0.6 to 1.7 times the session's (both Advanced planner settings), lightest
|
|
110
|
+
first and inside the power cap. The result is the highest chip load that stayed stable,
|
|
111
|
+
with its feed. Its cuts do not change the map, which stays at the session's chip load.
|
|
112
|
+
8. Download the report: one HTML page to print (Letter or A4, black and white) and keep with
|
|
113
|
+
the tool. It holds the recommended cuts per depth with feed, removal rate and spindle
|
|
114
|
+
power, the stability map, every round's passes (marking verdicts set by hand) and the
|
|
115
|
+
setup. Lengths follow the machine's G20/G21, with mm beside. It is offered on convergence
|
|
116
|
+
and any time beside the best cuts.
|
|
74
117
|
|
|
75
118
|
Everything runs in the browser tab. The same Python that the command line uses runs there
|
|
76
119
|
under [Pyodide](https://pyodide.org), which `dechatter widget` downloads once and copies into
|
|
@@ -81,17 +124,26 @@ browser kept any of that processing on.
|
|
|
81
124
|
|
|
82
125
|
Sessions are stored in that browser (IndexedDB), per cncjs address. Export saves one as a zip
|
|
83
126
|
holding `setup.toml` and each round's plan, program, `recording.wav`, results and the job
|
|
84
|
-
timeline
|
|
127
|
+
timeline of the run (each pass's cut and dwell windows), plus `report.html`. Import loads it in another browser, and unzipped it is a session
|
|
85
128
|
folder the command line reads. Keep the tab open while a round runs: the recording lives in
|
|
86
|
-
the page until the
|
|
129
|
+
the page until the round ends. Export works during a run too, without that round. If a run
|
|
130
|
+
seems stuck (held for a minute, or the machine idle but not where its move ends), the widget
|
|
131
|
+
says so and points to Stop, which keeps and analyses the cuts made so far. Reset, next to the session list, discards every round and
|
|
132
|
+
keeps the setup, so the session starts again from round 1 and its setup can be changed
|
|
133
|
+
freely (`dechatter reset <session>` on the command line); it needs a setup that loads,
|
|
134
|
+
though its rounds need not. Delete removes a session for good after asking, and offers
|
|
135
|
+
Export first. It also removes sessions that no longer load, such as ones from dechatter
|
|
136
|
+
0.1.x; one whose setup does not load cannot be exported.
|
|
137
|
+
Both are refused while that session records or its job runs.
|
|
87
138
|
|
|
88
139
|
### Manual spindle
|
|
89
140
|
|
|
90
141
|
If the spindle is started and set by hand, choose "me, by hand" on the wizard's first step
|
|
91
142
|
(`spindle = "manual"` under `[machine]` in a setup file). The program then never commands the
|
|
92
|
-
spindle.
|
|
93
|
-
|
|
94
|
-
|
|
143
|
+
spindle. In the widget, the round stops before each speed with the cutter clear of the work
|
|
144
|
+
and shows the speed to set: set it and press Continue. The program file (`program.nc`, for
|
|
145
|
+
the command line) stops with `M0` at the same places instead: set the speed and press resume
|
|
146
|
+
in cncjs. Cuts are grouped by speed, lightest first, so a round has one stop per
|
|
95
147
|
speed: five in round 1. The first stop is where you start the spindle, and you stop it yourself
|
|
96
148
|
after the program ends.
|
|
97
149
|
|
|
@@ -113,7 +165,10 @@ continuous recording, run the program, stop recording after `M30`. Then:
|
|
|
113
165
|
```sh
|
|
114
166
|
dechatter analyze al-10mm recording.wav # classifies each pass
|
|
115
167
|
dechatter plan al-10mm # next round, or "converged"
|
|
168
|
+
dechatter plan al-10mm --sweep # once converged: chip-load sweep of the best cut
|
|
116
169
|
dechatter report al-10mm # stability map and best cuts so far
|
|
170
|
+
dechatter reset al-10mm # discard every round, keep the setup (asks first)
|
|
171
|
+
dechatter report al-10mm --html al-10mm.html --units in # printable report
|
|
117
172
|
```
|
|
118
173
|
|
|
119
174
|
Repeat until `plan` reports convergence. WAV, FLAC, OGG and MP3 load directly. Phone formats
|
|
@@ -144,9 +199,19 @@ remaining spectrum and at least 10 dB above the same frequency in the dwell just
|
|
|
144
199
|
pass, when the spindle was turning in air. The second test rejects tones the machine makes
|
|
145
200
|
without cutting, such as drive whine.
|
|
146
201
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
202
|
+
When the widget ran the round, it recorded where every cut and every dwell is, and those
|
|
203
|
+
windows are used as they are: the cut from where the cutter meets the stock to where it
|
|
204
|
+
leaves it, without any time the machine was held, and the dwell before it as the air
|
|
205
|
+
reference. A pass the run never reached is "not run". A run that ended before its first cut
|
|
206
|
+
is not analysed, and the round stays planned to run again.
|
|
207
|
+
|
|
208
|
+
A recording made otherwise (the command line, a phone) is searched for its cuts by their
|
|
209
|
+
level over the spindle's own noise around them, since the spindle gets louder as it speeds
|
|
210
|
+
up and a light cut is only a few dB over it. The cuts found are matched in order to the
|
|
211
|
+
planned passes by how long each should last; at one speed the narrowest cuts are the ones
|
|
212
|
+
that can go unheard, so those are the ones taken as missing. Passes after the last cut heard
|
|
213
|
+
are "likely not run" (a verdict can still be set by hand, should one have run unheard), and a pass whose spindle speed was found at the edge of its ±5% search is
|
|
214
|
+
flagged ("speed?" in the widget). If matching fails, mark the cuts yourself and pass
|
|
150
215
|
`--segments labels.txt` (start and end seconds per pass; an Audacity label export works).
|
|
151
216
|
|
|
152
217
|
`results.json` in each round holds the verdicts and the numbers behind them. If your ears
|
|
@@ -217,15 +282,24 @@ mount it, reset the face to `Y0` and run `dechatter plan --new-stock`.
|
|
|
217
282
|
uv sync
|
|
218
283
|
uv run pytest
|
|
219
284
|
uv run ruff check .
|
|
285
|
+
node --test tests/js/stepper.test.mjs # the widget's stepper against a scripted controller
|
|
220
286
|
uv run validation/purdue.py ~/purdue-cache # downloads about 370 MB once
|
|
221
287
|
```
|
|
222
288
|
|
|
223
289
|
`e2e/` runs real cncjs against a simulated Grbl inside WSL, for driving the widget without a
|
|
224
290
|
machine. See `e2e/README.md`.
|
|
225
291
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
292
|
+
Every change users can notice adds a line under `## [Unreleased]` in
|
|
293
|
+
[`CHANGELOG.md`](CHANGELOG.md), in the same pull request: what they will notice and, for a
|
|
294
|
+
breaking change, what to do about it.
|
|
295
|
+
|
|
296
|
+
To release, set the same version in `src/dechatter/__init__.py` (`__version__`, which
|
|
297
|
+
`pyproject.toml` reads) and `package.json`, rename `## [Unreleased]` in `CHANGELOG.md` to
|
|
298
|
+
`## [X.Y.Z] - YYYY-MM-DD` above a fresh empty Unreleased section (and update the links at
|
|
299
|
+
its end), merge to `main`, and push a tag `vX.Y.Z` on that commit. The `release` workflow
|
|
300
|
+
refuses a tag without that dated section, tests on Linux and Windows, builds the widget
|
|
301
|
+
once, publishes that build to npm, and creates the GitHub release with the section as its
|
|
302
|
+
notes. npm trusts the workflow itself, so no token
|
|
229
303
|
is stored; version 0.1.0 was published by hand, because that trust can only be registered
|
|
230
304
|
for a package that exists.
|
|
231
305
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dechatter",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "CNCjs custom widget that finds chatter-free milling speeds, widths and depths from test cuts heard through the microphone.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cncjs",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"files": [
|
|
29
29
|
"web",
|
|
30
|
+
"CHANGELOG.md",
|
|
30
31
|
"THIRD_PARTY_NOTICES.md"
|
|
31
32
|
],
|
|
32
33
|
"publishConfig": {
|
|
@@ -34,6 +35,7 @@
|
|
|
34
35
|
},
|
|
35
36
|
"scripts": {
|
|
36
37
|
"build": "node .github/build_widget.mjs",
|
|
38
|
+
"test": "node --test tests/js/stepper.test.mjs",
|
|
37
39
|
"prepack": "npm run build"
|
|
38
40
|
}
|
|
39
41
|
}
|
package/web/dechatter.zip
CHANGED
|
Binary file
|
package/web/engine.js
CHANGED
|
@@ -5,7 +5,7 @@ import { loadPyodide } from './pyodide/pyodide.js';
|
|
|
5
5
|
|
|
6
6
|
const ROOT = '/sessions';
|
|
7
7
|
// Calls that change files; the filesystem is flushed to IndexedDB after each of them.
|
|
8
|
-
const WRITES = new Set(['create', 'save_setup', 'plan', 'record_stop', 'analyze', 'set_verdict', 'import_zip']);
|
|
8
|
+
const WRITES = new Set(['create', 'delete', 'reset', 'save_setup', 'plan', 'plan_sweep', 'record_stop', 'analyze', 'set_verdict', 'import_zip']);
|
|
9
9
|
|
|
10
10
|
let pyodide;
|
|
11
11
|
let call;
|
|
@@ -68,7 +68,8 @@ async function handle({ method, args }) {
|
|
|
68
68
|
return { ok: bytes };
|
|
69
69
|
}
|
|
70
70
|
const reply = JSON.parse(result);
|
|
71
|
-
|
|
71
|
+
// Also after a refused or failed write: memory may have changed before it failed.
|
|
72
|
+
if (WRITES.has(method)) {
|
|
72
73
|
await sync(false);
|
|
73
74
|
}
|
|
74
75
|
return reply;
|
package/web/index.html
CHANGED
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
<div id="main" hidden>
|
|
14
14
|
<header>
|
|
15
15
|
<select id="sessions" aria-label="Session"></select>
|
|
16
|
+
<button id="reset-session" disabled>Reset</button>
|
|
17
|
+
<button id="delete-session" disabled>Delete</button>
|
|
16
18
|
<button id="new-session">New</button>
|
|
17
19
|
<button id="edit-setup" disabled>Setup</button>
|
|
18
20
|
<button id="export" disabled>Export</button>
|
|
@@ -43,10 +45,19 @@
|
|
|
43
45
|
<button id="setup-next" class="primary" type="submit" form="setup-form">Next</button>
|
|
44
46
|
<button id="cancel-setup" type="button">Cancel</button>
|
|
45
47
|
<span id="units" class="muted"></span>
|
|
46
|
-
<button id="follow-machine" type="button" hidden>Use mm instead</button>
|
|
47
48
|
</p>
|
|
48
49
|
</section>
|
|
49
50
|
|
|
51
|
+
<dialog id="confirm-dialog" aria-labelledby="confirm-question">
|
|
52
|
+
<p id="confirm-question"></p>
|
|
53
|
+
<p id="confirm-note" class="muted"></p>
|
|
54
|
+
<p class="wizard-buttons">
|
|
55
|
+
<button id="confirm-export" type="button">Export first</button>
|
|
56
|
+
<button id="confirm-go" type="button" class="danger">Delete</button>
|
|
57
|
+
<button id="confirm-cancel" type="button">Cancel</button>
|
|
58
|
+
</p>
|
|
59
|
+
</dialog>
|
|
60
|
+
|
|
50
61
|
<section id="step" hidden></section>
|
|
51
62
|
|
|
52
63
|
<section id="round" hidden>
|
|
@@ -68,11 +79,12 @@
|
|
|
68
79
|
</section>
|
|
69
80
|
|
|
70
81
|
<section id="best-section" hidden>
|
|
71
|
-
<h2>Best stable cuts</h2>
|
|
82
|
+
<h2>Best stable cuts <button id="download-report" type="button">Download report</button></h2>
|
|
72
83
|
<table>
|
|
73
|
-
<thead><tr><th>rpm</th><th>width</th><th>depth</th><th>feed</th><th>
|
|
84
|
+
<thead><tr><th>rpm</th><th>width</th><th>depth</th><th>feed</th><th>removal</th></tr></thead>
|
|
74
85
|
<tbody id="best"></tbody>
|
|
75
86
|
</table>
|
|
87
|
+
<p id="sweep-result" class="muted legend" hidden></p>
|
|
76
88
|
</section>
|
|
77
89
|
</div>
|
|
78
90
|
|