checkpoint gx util
This commit is contained in:
parent
da0af16894
commit
073be5ae61
2 changed files with 29 additions and 32 deletions
|
|
@ -224,18 +224,13 @@ class GXSender {
|
|||
if (len < 4096) {
|
||||
chunk = Buffer.concat([chunk, new Buffer(4096-len).fill(0)]);
|
||||
}
|
||||
// let crc = crc32.unsigned(chunk);
|
||||
let block = Buffer.concat([
|
||||
preamble,
|
||||
uint32b(slice),
|
||||
uint32b(len),
|
||||
// length,
|
||||
uint32b(crc),
|
||||
chunk
|
||||
]);
|
||||
// console.log(block);
|
||||
// console.log(block.slice(4080));
|
||||
// console.log(block.length);
|
||||
ctrl.sendBuffer(block, lines => { console.log(lines) });
|
||||
}
|
||||
ctrl.sendCommand("M29", lines => { console.log(lines) }); // end of send
|
||||
|
|
@ -327,10 +322,11 @@ const crc32 = require('buffer-crc32');
|
|||
const net = require('net');
|
||||
const fs = require('fs');
|
||||
|
||||
const arg = process.argv.slice(2);
|
||||
const cmd = arg.shift();
|
||||
if (!module.parent) {
|
||||
const arg = process.argv.slice(2);
|
||||
const cmd = arg.shift();
|
||||
|
||||
switch (cmd) {
|
||||
switch (cmd) {
|
||||
case 'pipe':
|
||||
new TCPipe(parseInt(arg.shift()), arg.shift(), parseInt(arg.shift()));
|
||||
break;
|
||||
|
|
@ -354,4 +350,5 @@ switch (cmd) {
|
|||
" print [file]"
|
||||
].join("\n"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
<div class="print-sel">
|
||||
<table><tr><th>
|
||||
<button id="print-download">download gcode file</button>
|
||||
<button id="print-download">download .gcode</button>
|
||||
<button id="print-serial">use gcode sender</button>
|
||||
</th></tr></table>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue