linuxcnc-grpc 1.0.0-beta.4 → 1.1.0-rc.1
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/README.md +74 -0
- package/dist/__tests__/client.test.js +52 -10
- package/dist/__tests__/int64.test.d.ts +11 -0
- package/dist/__tests__/int64.test.js +135 -0
- package/dist/hal.d.ts +43 -19
- package/dist/hal.js +20 -7
- package/dist/linuxcnc.d.ts +490 -25
- package/dist/linuxcnc.js +1707 -92
- package/package.json +3 -3
- package/src/__tests__/client.test.ts +78 -10
- package/src/__tests__/int64.test.ts +183 -0
- package/src/hal.ts +64 -24
- package/src/linuxcnc.ts +2327 -118
package/dist/linuxcnc.d.ts
CHANGED
|
@@ -147,7 +147,12 @@ export declare enum JogType {
|
|
|
147
147
|
}
|
|
148
148
|
export declare function jogTypeFromJSON(object: any): JogType;
|
|
149
149
|
export declare function jogTypeToJSON(object: JogType): string;
|
|
150
|
-
/**
|
|
150
|
+
/**
|
|
151
|
+
* Auto command type.
|
|
152
|
+
* Deprecated together with AutoCommand: SendCommand has never accepted it.
|
|
153
|
+
*
|
|
154
|
+
* @deprecated
|
|
155
|
+
*/
|
|
151
156
|
export declare enum AutoCommandType {
|
|
152
157
|
AUTO_RUN = 0,
|
|
153
158
|
AUTO_PAUSE = 1,
|
|
@@ -292,7 +297,7 @@ export interface AxisStatus {
|
|
|
292
297
|
export interface SpindleStatus {
|
|
293
298
|
spindleNumber: number;
|
|
294
299
|
brake: boolean;
|
|
295
|
-
/** 0=stopped, 1=forward
|
|
300
|
+
/** LinuxCNC's value: -1=reverse, 0=stopped, 1=forward */
|
|
296
301
|
direction: number;
|
|
297
302
|
enabled: boolean;
|
|
298
303
|
overrideEnabled: boolean;
|
|
@@ -322,15 +327,28 @@ export interface ToolEntry {
|
|
|
322
327
|
backAngle: number;
|
|
323
328
|
orientation: number;
|
|
324
329
|
comment: string;
|
|
330
|
+
/**
|
|
331
|
+
* Index of this entry in the tool table as LinuxCNC's status lists it.
|
|
332
|
+
* tool_table leaves out entries without a tool, so an entry's position in
|
|
333
|
+
* that list is not this index. Unset when the server is older than 1.1.
|
|
334
|
+
* An entry's id can be -1 for an empty slot (index 0 is the spindle, and
|
|
335
|
+
* holds -1 when no tool is loaded): ignore entries whose id is not positive.
|
|
336
|
+
*/
|
|
337
|
+
tableIndex?: number | undefined;
|
|
325
338
|
}
|
|
326
339
|
/** Tool status */
|
|
327
340
|
export interface ToolStatus {
|
|
328
|
-
/**
|
|
341
|
+
/**
|
|
342
|
+
* Index, in LinuxCNC's own tool table, of the entry prepared for the next
|
|
343
|
+
* tool change (-1 if none). It is not an index into tool_table below: find
|
|
344
|
+
* the entry whose table_index equals it.
|
|
345
|
+
*/
|
|
329
346
|
pocketPrepped: number;
|
|
330
347
|
/** Tool number in spindle (0 if none) */
|
|
331
348
|
toolInSpindle: number;
|
|
332
349
|
/** Pocket of current tool (0 if none) */
|
|
333
350
|
toolFromPocket: number;
|
|
351
|
+
/** Entries that hold a tool (tool number not 0); see ToolEntry.table_index */
|
|
334
352
|
toolTable: ToolEntry[];
|
|
335
353
|
}
|
|
336
354
|
/** I/O status */
|
|
@@ -361,19 +379,29 @@ export interface GCodeStatus {
|
|
|
361
379
|
}
|
|
362
380
|
/** Limit status for a joint (bitmask: 1=min_hard, 2=max_hard, 4=min_soft, 8=max_soft) */
|
|
363
381
|
export interface LimitStatus {
|
|
364
|
-
/** One per joint */
|
|
382
|
+
/** One per joint the machine has, in joint order */
|
|
365
383
|
limitFlags: number[];
|
|
366
|
-
/** Homed status per joint */
|
|
384
|
+
/** Homed status, one per joint the machine has */
|
|
367
385
|
homed: boolean[];
|
|
368
|
-
/**
|
|
386
|
+
/**
|
|
387
|
+
* LinuxCNC's misc error inputs. The length is that of LinuxCNC's own array,
|
|
388
|
+
* not one entry per joint. Empty if LinuxCNC's status does not report it.
|
|
389
|
+
*/
|
|
369
390
|
miscError: number[];
|
|
370
391
|
}
|
|
371
392
|
/** Error/message from error channel */
|
|
372
393
|
export interface ErrorMessage {
|
|
373
394
|
type: ErrorMessage_ErrorType;
|
|
374
395
|
message: string;
|
|
375
|
-
/**
|
|
396
|
+
/** When the server read the message, unix timestamp in nanoseconds */
|
|
376
397
|
timestamp: number;
|
|
398
|
+
/**
|
|
399
|
+
* Position in the order the server read messages: starts at 1 and grows by
|
|
400
|
+
* one per message while the server runs. The same message has the same
|
|
401
|
+
* sequence in StreamErrors and in LinuxCNCStatus.errors, so clients can
|
|
402
|
+
* drop duplicates and notice gaps. It restarts when the server restarts.
|
|
403
|
+
*/
|
|
404
|
+
sequence: number;
|
|
377
405
|
}
|
|
378
406
|
export declare enum ErrorMessage_ErrorType {
|
|
379
407
|
ERROR_TYPE_UNSPECIFIED = 0,
|
|
@@ -398,17 +426,23 @@ export interface LinuxCNCStatus {
|
|
|
398
426
|
task: TaskStatus | undefined;
|
|
399
427
|
trajectory: TrajectoryStatus | undefined;
|
|
400
428
|
position: PositionStatus | undefined;
|
|
401
|
-
/**
|
|
429
|
+
/** One per joint the machine has (trajectory.joints of them); 1.0 servers sent 16 */
|
|
402
430
|
joints: JointStatus[];
|
|
403
431
|
/** Up to 9 axes (XYZABCUVW) */
|
|
404
432
|
axes: AxisStatus[];
|
|
405
|
-
/**
|
|
433
|
+
/** One per spindle the machine has (trajectory.spindles of them); 1.0 servers sent 8 */
|
|
406
434
|
spindles: SpindleStatus[];
|
|
407
435
|
tool: ToolStatus | undefined;
|
|
408
436
|
io: IOStatus | undefined;
|
|
409
437
|
gcode: GCodeStatus | undefined;
|
|
410
438
|
limits: LimitStatus | undefined;
|
|
411
|
-
/**
|
|
439
|
+
/**
|
|
440
|
+
* The most recent messages the server has read from LinuxCNC's error
|
|
441
|
+
* channel (at most 20, oldest first). They stay here until newer ones push
|
|
442
|
+
* them out, so use ErrorMessage.sequence to tell new from already seen.
|
|
443
|
+
* Empty unless the server reads the error channel: see the server's
|
|
444
|
+
* --error-channel option.
|
|
445
|
+
*/
|
|
412
446
|
errors: ErrorMessage[];
|
|
413
447
|
}
|
|
414
448
|
/** Set machine state (estop, on, off) */
|
|
@@ -447,7 +481,11 @@ export interface UnhomeCommand {
|
|
|
447
481
|
/** Spindle command */
|
|
448
482
|
export interface SpindleControlCommand {
|
|
449
483
|
command: SpindleCommand;
|
|
450
|
-
/**
|
|
484
|
+
/**
|
|
485
|
+
* For FORWARD/REVERSE only, where it must be zero or more and finite. The
|
|
486
|
+
* direction comes from the command, not from the sign. The other commands
|
|
487
|
+
* ignore it.
|
|
488
|
+
*/
|
|
451
489
|
speed: number;
|
|
452
490
|
/** Spindle number (default 0) */
|
|
453
491
|
spindle: number;
|
|
@@ -456,7 +494,7 @@ export interface SpindleControlCommand {
|
|
|
456
494
|
}
|
|
457
495
|
/** Spindle override command */
|
|
458
496
|
export interface SpindleOverrideCommand {
|
|
459
|
-
/** Override scale */
|
|
497
|
+
/** Override scale; must be finite and not negative */
|
|
460
498
|
scale: number;
|
|
461
499
|
/** Spindle number */
|
|
462
500
|
spindle: number;
|
|
@@ -468,16 +506,17 @@ export interface BrakeCommand {
|
|
|
468
506
|
}
|
|
469
507
|
/** Feed rate override command */
|
|
470
508
|
export interface FeedrateCommand {
|
|
471
|
-
/** Feed rate scale (0.0-2.0+) */
|
|
509
|
+
/** Feed rate scale (0.0-2.0+); must be finite and not negative */
|
|
472
510
|
scale: number;
|
|
473
511
|
}
|
|
474
512
|
/** Rapid rate override command */
|
|
475
513
|
export interface RapidrateCommand {
|
|
476
|
-
/** Rapid rate scale (0.0-1.0) */
|
|
514
|
+
/** Rapid rate scale (0.0-1.0); must be finite and not negative */
|
|
477
515
|
scale: number;
|
|
478
516
|
}
|
|
479
517
|
/** Maximum velocity command */
|
|
480
518
|
export interface MaxVelCommand {
|
|
519
|
+
/** Must be finite and not negative */
|
|
481
520
|
velocity: number;
|
|
482
521
|
}
|
|
483
522
|
/** Coolant command */
|
|
@@ -510,7 +549,15 @@ export interface ProgramCommand {
|
|
|
510
549
|
/** Abort program */
|
|
511
550
|
abort?: boolean | undefined;
|
|
512
551
|
}
|
|
513
|
-
/**
|
|
552
|
+
/**
|
|
553
|
+
* Auto mode command.
|
|
554
|
+
* Deprecated: LinuxCNCCommand has no field for this message, so SendCommand
|
|
555
|
+
* has never been able to carry it. Use ProgramCommand to run, pause, resume,
|
|
556
|
+
* step or abort a program. The message stays in the 1.x protos only so that
|
|
557
|
+
* code referring to it keeps compiling; it will be removed in 2.0.
|
|
558
|
+
*
|
|
559
|
+
* @deprecated
|
|
560
|
+
*/
|
|
514
561
|
export interface AutoCommand {
|
|
515
562
|
command: AutoCommandType;
|
|
516
563
|
/** For AUTO_RUN, starting line */
|
|
@@ -526,7 +573,10 @@ export interface AnalogOutputCommand {
|
|
|
526
573
|
index: number;
|
|
527
574
|
value: number;
|
|
528
575
|
}
|
|
529
|
-
/**
|
|
576
|
+
/**
|
|
577
|
+
* Set joint limits. min_limit must be below max_limit and both must be finite;
|
|
578
|
+
* otherwise neither is sent.
|
|
579
|
+
*/
|
|
530
580
|
export interface SetLimitCommand {
|
|
531
581
|
joint: number;
|
|
532
582
|
minLimit: number;
|
|
@@ -618,28 +668,103 @@ export interface LinuxCNCCommand {
|
|
|
618
668
|
operatorMessage?: OperatorMessageCommand | undefined;
|
|
619
669
|
}
|
|
620
670
|
export interface CommandResponse {
|
|
621
|
-
/**
|
|
671
|
+
/**
|
|
672
|
+
* The request's serial, or one from the server's own counter if the request
|
|
673
|
+
* left it at 0. A label only: it is NOT LinuxCNC's serial.
|
|
674
|
+
*/
|
|
622
675
|
serial: number;
|
|
623
|
-
/**
|
|
676
|
+
/**
|
|
677
|
+
* From SendCommand: RCS_DONE means the command was dispatched to LinuxCNC,
|
|
678
|
+
* not that it finished (a stop is answered the same way, once its send
|
|
679
|
+
* has returned). From WaitComplete: the outcome of the wait.
|
|
680
|
+
*/
|
|
624
681
|
status: RcsStatus;
|
|
625
682
|
/** Error message if status is RCS_ERROR */
|
|
626
683
|
errorMessage: string;
|
|
684
|
+
/**
|
|
685
|
+
* LinuxCNC's own serial number for the command the server handed to
|
|
686
|
+
* LinuxCNC, set by SendCommand when the command was dispatched. It
|
|
687
|
+
* identifies the command; it does not prove the task received it.
|
|
688
|
+
* LinuxCNC's send normally returns once the task has echoed the serial
|
|
689
|
+
* (TaskStatus.echo_serial_number), but it gives up after about 5 seconds
|
|
690
|
+
* without an error if the task does not answer; acknowledged says which
|
|
691
|
+
* of the two happened. Use WaitComplete, or the status, to confirm
|
|
692
|
+
* completion: compare this value with echo_serial_number, or pass it to
|
|
693
|
+
* WaitComplete. For a command sent as several LinuxCNC messages (coolant,
|
|
694
|
+
* set_limit, override_config, program_options, and program open, a close
|
|
695
|
+
* followed by the open) it is the serial of the last one LinuxCNC took. Unset
|
|
696
|
+
* when the command was not dispatched, which includes a command LinuxCNC
|
|
697
|
+
* did not take.
|
|
698
|
+
*/
|
|
699
|
+
linuxcncSerial?: number | undefined;
|
|
700
|
+
/**
|
|
701
|
+
* From SendCommand: what a good status read made after the server's send
|
|
702
|
+
* returned showed. True: the task had echoed linuxcnc_serial. False: the
|
|
703
|
+
* command was written to LinuxCNC's command queue, but the task had not
|
|
704
|
+
* echoed it (LinuxCNC's own wait of about 5 seconds ran out), so the task
|
|
705
|
+
* is not answering. The command is not withdrawn: it stays in the queue
|
|
706
|
+
* and runs when the task answers again, unless that LinuxCNC has shut
|
|
707
|
+
* down or been restarted meanwhile. Unset when the server cannot tell:
|
|
708
|
+
* nothing was dispatched, no good status read was made after the send
|
|
709
|
+
* (the status could not be read), the server's status turned out to belong to another LinuxCNC than the one
|
|
710
|
+
* that took the command (the server then stops), or the server is older
|
|
711
|
+
* than this field. It does not change status: RCS_DONE still means
|
|
712
|
+
* "dispatched". For a command sent as several LinuxCNC messages it
|
|
713
|
+
* describes the last one LinuxCNC took.
|
|
714
|
+
*/
|
|
715
|
+
acknowledged?: boolean | undefined;
|
|
716
|
+
/**
|
|
717
|
+
* From SendCommand, with RCS_ERROR: true when the server is certain that
|
|
718
|
+
* nothing was written to LinuxCNC for this request, so sending it again
|
|
719
|
+
* cannot run it twice. False does not mean that something was written,
|
|
720
|
+
* only that the server cannot rule it out (a failure during a send, a
|
|
721
|
+
* command of several messages that failed part-way or that a stop cut
|
|
722
|
+
* short, a command helper process that died while it had the command). A
|
|
723
|
+
* command refused because of a stop before any of its messages was
|
|
724
|
+
* written is true. A server older than this
|
|
725
|
+
* field never sets it.
|
|
726
|
+
*/
|
|
727
|
+
notSent: boolean;
|
|
627
728
|
}
|
|
628
729
|
/** Empty - returns full status */
|
|
629
730
|
export interface GetStatusRequest {
|
|
630
731
|
}
|
|
631
732
|
export interface WaitCompleteRequest {
|
|
632
|
-
/**
|
|
733
|
+
/**
|
|
734
|
+
* Ignored by the server and only echoed back in the response. Without
|
|
735
|
+
* linuxcnc_serial, the wait is on the latest command sent through the server.
|
|
736
|
+
*/
|
|
633
737
|
serial: number;
|
|
634
|
-
/** Timeout in seconds */
|
|
738
|
+
/** Timeout in seconds (default 5) */
|
|
635
739
|
timeout: number;
|
|
740
|
+
/**
|
|
741
|
+
* Wait on this serial: the linuxcnc_serial that SendCommand returned for a
|
|
742
|
+
* command. The wait follows LinuxCNC's own serial rule. While the task's
|
|
743
|
+
* echo serial equals this value, the answer is that command's outcome. Once
|
|
744
|
+
* a later command has been echoed, sent through this server or by any other
|
|
745
|
+
* client of the same LinuxCNC, the answer is RCS_DONE and does not say how
|
|
746
|
+
* the earlier command ended. So the wait is exact only as long as nothing
|
|
747
|
+
* else is sent to LinuxCNC meanwhile; read the status as well to know that
|
|
748
|
+
* a motion has finished. A value this server did not issue on its current
|
|
749
|
+
* connection to LinuxCNC gets RCS_ERROR. When unset, the wait is on the
|
|
750
|
+
* latest command sent through the server, as it always was.
|
|
751
|
+
*/
|
|
752
|
+
linuxcncSerial?: number | undefined;
|
|
636
753
|
}
|
|
637
754
|
export interface StreamStatusRequest {
|
|
638
|
-
/**
|
|
755
|
+
/**
|
|
756
|
+
* Update interval in milliseconds (default: 100). Values above 60000 are
|
|
757
|
+
* treated as 60000.
|
|
758
|
+
*/
|
|
639
759
|
intervalMs: number;
|
|
640
760
|
}
|
|
641
|
-
/** Empty - streams all errors */
|
|
642
761
|
export interface StreamErrorsRequest {
|
|
762
|
+
/**
|
|
763
|
+
* If true, the stream starts with the messages the server already holds in
|
|
764
|
+
* its buffer (the most recent 256), oldest first, and then continues with
|
|
765
|
+
* new ones. If false, only messages read from now on are sent.
|
|
766
|
+
*/
|
|
767
|
+
replayBuffered: boolean;
|
|
643
768
|
}
|
|
644
769
|
/** Upload a G-code file */
|
|
645
770
|
export interface UploadFileRequest {
|
|
@@ -688,6 +813,221 @@ export interface DeleteFileResponse {
|
|
|
688
813
|
/** Absolute path of deleted file */
|
|
689
814
|
path: string;
|
|
690
815
|
}
|
|
816
|
+
/**
|
|
817
|
+
* Read a file from the nc_files directory, whole or in chunks.
|
|
818
|
+
* One response carries at most 1 MiB of content, so every response fits in a
|
|
819
|
+
* client's default 4 MB receive limit. To read a larger file, call again with
|
|
820
|
+
* offset advanced by len(content) until end_of_file is true.
|
|
821
|
+
*/
|
|
822
|
+
export interface ReadFileRequest {
|
|
823
|
+
/** Relative path within nc_files dir */
|
|
824
|
+
filename: string;
|
|
825
|
+
/** Byte offset to start reading from (default 0) */
|
|
826
|
+
offset: number;
|
|
827
|
+
/** Most bytes to return (0 or more than 1 MiB means 1 MiB) */
|
|
828
|
+
maxBytes: number;
|
|
829
|
+
}
|
|
830
|
+
export interface ReadFileResponse {
|
|
831
|
+
/** Absolute, canonical path of the file read */
|
|
832
|
+
path: string;
|
|
833
|
+
/** File bytes from offset (a chunk may end inside a UTF-8 character) */
|
|
834
|
+
content: Uint8Array;
|
|
835
|
+
/** Offset this content starts at */
|
|
836
|
+
offset: number;
|
|
837
|
+
/** Size of the whole file when it was read */
|
|
838
|
+
totalSizeBytes: number;
|
|
839
|
+
/** True if this content reaches the end of the file */
|
|
840
|
+
endOfFile: boolean;
|
|
841
|
+
/** Last modified time (unix timestamp in nanoseconds). A change in it or in total_size_bytes between chunks means the file was modified */
|
|
842
|
+
modifiedTimestamp: number;
|
|
843
|
+
}
|
|
844
|
+
/** Resolve a name in the nc_files directory */
|
|
845
|
+
export interface ResolveFileRequest {
|
|
846
|
+
/** Relative path within nc_files dir */
|
|
847
|
+
filename: string;
|
|
848
|
+
}
|
|
849
|
+
export interface ResolveFileResponse {
|
|
850
|
+
/** Absolute, canonical path (symlinks resolved): the file UploadFile, DeleteFile and ReadFile act on for this name */
|
|
851
|
+
path: string;
|
|
852
|
+
/** True if something exists at that path */
|
|
853
|
+
exists: boolean;
|
|
854
|
+
/** True if it is a directory */
|
|
855
|
+
isDirectory: boolean;
|
|
856
|
+
/** True if resolving the name goes through a symbolic link at any component */
|
|
857
|
+
isSymlink: boolean;
|
|
858
|
+
/** True if this is the file LinuxCNC has loaded (TaskStatus.file), by canonical path or by being the same file on disk */
|
|
859
|
+
isLoadedProgram: boolean;
|
|
860
|
+
/** Canonical path of the loaded program, empty if none */
|
|
861
|
+
loadedProgram: string;
|
|
862
|
+
/** Interpreter state when checked; anything but INTERP_IDLE means the loaded program is in use */
|
|
863
|
+
interpState: InterpState;
|
|
864
|
+
}
|
|
865
|
+
/** Empty - returns the full configuration */
|
|
866
|
+
export interface GetMachineConfigRequest {
|
|
867
|
+
}
|
|
868
|
+
/**
|
|
869
|
+
* Configuration of one joint.
|
|
870
|
+
* Limits come from live status; velocity, acceleration and home sequence come
|
|
871
|
+
* from the [JOINT_n] section of the INI file.
|
|
872
|
+
*/
|
|
873
|
+
export interface JointConfig {
|
|
874
|
+
jointNumber: number;
|
|
875
|
+
/** Linear or angular */
|
|
876
|
+
jointType: JointType;
|
|
877
|
+
/**
|
|
878
|
+
* Axis this joint drives ("X", "Y", ...). Empty if the mapping is not known
|
|
879
|
+
* (joint_axis_mapping_known is false), and empty with the mapping known if
|
|
880
|
+
* the joint drives no axis, which is the case for an extra joint.
|
|
881
|
+
*/
|
|
882
|
+
axisLetter: string;
|
|
883
|
+
/** Soft limit, machine units */
|
|
884
|
+
minLimit: number;
|
|
885
|
+
/** Soft limit, machine units */
|
|
886
|
+
maxLimit: number;
|
|
887
|
+
/** [JOINT_n]MAX_VELOCITY, machine units per second; 0 if not set or the INI is unreadable */
|
|
888
|
+
maxVelocity: number;
|
|
889
|
+
/** [JOINT_n]MAX_ACCELERATION, machine units per second squared; 0 if not set */
|
|
890
|
+
maxAcceleration: number;
|
|
891
|
+
/** [JOINT_n]HOME_SEQUENCE; unset if the INI has none */
|
|
892
|
+
homeSequence?: number | undefined;
|
|
893
|
+
/** Joint units per mm (linear) or per degree (angular) */
|
|
894
|
+
units: number;
|
|
895
|
+
}
|
|
896
|
+
/**
|
|
897
|
+
* Configuration of one axis in the machine's axis mask.
|
|
898
|
+
* Limits come from live status; velocity and acceleration come from the
|
|
899
|
+
* [AXIS_<letter>] section of the INI file.
|
|
900
|
+
*/
|
|
901
|
+
export interface AxisConfig {
|
|
902
|
+
/** 0=X, 1=Y, 2=Z, 3=A, 4=B, 5=C, 6=U, 7=V, 8=W */
|
|
903
|
+
axisNumber: number;
|
|
904
|
+
/** "X", "Y", ... */
|
|
905
|
+
letter: string;
|
|
906
|
+
/** Soft limit, machine units */
|
|
907
|
+
minLimit: number;
|
|
908
|
+
/** Soft limit, machine units */
|
|
909
|
+
maxLimit: number;
|
|
910
|
+
/** [AXIS_<letter>]MAX_VELOCITY; 0 if not set or the INI is unreadable */
|
|
911
|
+
maxVelocity: number;
|
|
912
|
+
/** [AXIS_<letter>]MAX_ACCELERATION; 0 if not set */
|
|
913
|
+
maxAcceleration: number;
|
|
914
|
+
/** Joints that drive this axis (two for a gantry); empty if the mapping is not known or no joint drives it */
|
|
915
|
+
joints: number[];
|
|
916
|
+
}
|
|
917
|
+
export interface MachineConfig {
|
|
918
|
+
/** INI file LinuxCNC was started with */
|
|
919
|
+
iniFilename: string;
|
|
920
|
+
/** False if the server could not read that file; INI-based fields are then empty or 0 */
|
|
921
|
+
iniReadable: boolean;
|
|
922
|
+
/** [EMC]MACHINE */
|
|
923
|
+
machineName: string;
|
|
924
|
+
/** Kinematics */
|
|
925
|
+
kinematics: string;
|
|
926
|
+
/** Its first word, e.g. "trivkins" */
|
|
927
|
+
kinematicsModule: string;
|
|
928
|
+
/** From status */
|
|
929
|
+
kinematicsType: KinematicsType;
|
|
930
|
+
/** [TRAJ]COORDINATES without spaces, upper case, e.g. "XYZ" or "XYYZ" */
|
|
931
|
+
coordinates: string;
|
|
932
|
+
/** Bit 0=X ... bit 8=W, from status */
|
|
933
|
+
axisMask: number;
|
|
934
|
+
jointCount: number;
|
|
935
|
+
spindleCount: number;
|
|
936
|
+
/**
|
|
937
|
+
* True when the server could work out which axis each joint drives. That
|
|
938
|
+
* is the case for trivkins, where joints follow the coordinates= letters in
|
|
939
|
+
* order. For other kinematics modules there is no fixed joint-to-axis
|
|
940
|
+
* relation, so JointConfig.axis_letter and AxisConfig.joints stay empty.
|
|
941
|
+
*
|
|
942
|
+
* Extra joints (motmod's num_extrajoints, the machine's last joints) are
|
|
943
|
+
* not part of the kinematics. They are listed in joints like any other
|
|
944
|
+
* joint, but with an empty axis_letter even when this is true, and they are
|
|
945
|
+
* in no AxisConfig.joints. TrajectoryStatus.num_extrajoints says how many
|
|
946
|
+
* of the last joints they are.
|
|
947
|
+
*/
|
|
948
|
+
jointAxisMappingKnown: boolean;
|
|
949
|
+
/** Units */
|
|
950
|
+
linearUnits: number;
|
|
951
|
+
/** Machine units per degree, from status */
|
|
952
|
+
angularUnits: number;
|
|
953
|
+
/** "mm", "inch" or "cm", derived from linear_units; empty if it is none of these */
|
|
954
|
+
linearUnitsName: string;
|
|
955
|
+
/** "degree", "radian" or "grad", derived from angular_units; empty if none of these */
|
|
956
|
+
angularUnitsName: string;
|
|
957
|
+
/** Velocities, in machine units per second; 0 if not set in the INI */
|
|
958
|
+
maxLinearVelocity: number;
|
|
959
|
+
/** [TRAJ]DEFAULT_LINEAR_VELOCITY */
|
|
960
|
+
defaultLinearVelocity: number;
|
|
961
|
+
/** [TRAJ]MAX_ANGULAR_VELOCITY */
|
|
962
|
+
maxAngularVelocity: number;
|
|
963
|
+
/** [TRAJ]DEFAULT_ANGULAR_VELOCITY */
|
|
964
|
+
defaultAngularVelocity: number;
|
|
965
|
+
/** Display hints from the [DISPLAY] section */
|
|
966
|
+
lathe: boolean;
|
|
967
|
+
/** [DISPLAY]BACK_TOOL_LATHE = 1 */
|
|
968
|
+
backToolLathe: boolean;
|
|
969
|
+
/** [DISPLAY]MAX_FEED_OVERRIDE (1.2 = 120%); 0 if not set */
|
|
970
|
+
maxFeedOverride: number;
|
|
971
|
+
/** [DISPLAY]MIN_SPINDLE_OVERRIDE; 0 if not set */
|
|
972
|
+
minSpindleOverride: number;
|
|
973
|
+
/** [DISPLAY]MAX_SPINDLE_OVERRIDE; 0 if not set */
|
|
974
|
+
maxSpindleOverride: number;
|
|
975
|
+
/** Directory the server's file RPCs and program open work in */
|
|
976
|
+
ncFilesDirectory: string;
|
|
977
|
+
/** One per joint */
|
|
978
|
+
joints: JointConfig[];
|
|
979
|
+
/** One per axis in axis_mask */
|
|
980
|
+
axes: AxisConfig[];
|
|
981
|
+
}
|
|
982
|
+
/** Empty - returns the server information */
|
|
983
|
+
export interface GetServerInfoRequest {
|
|
984
|
+
}
|
|
985
|
+
/**
|
|
986
|
+
* What the server is and whether it has LinuxCNC. Returned by GetServerInfo,
|
|
987
|
+
* which a 1.0 server answers with UNIMPLEMENTED.
|
|
988
|
+
*/
|
|
989
|
+
export interface ServerInfo {
|
|
990
|
+
/**
|
|
991
|
+
* Version of the linuxcnc-grpc package the server runs, e.g. "1.1.0".
|
|
992
|
+
* The package version is the API version.
|
|
993
|
+
*/
|
|
994
|
+
serverVersion: string;
|
|
995
|
+
/**
|
|
996
|
+
* True once the server has connected to LinuxCNC. False while it is waiting
|
|
997
|
+
* for LinuxCNC to start; the RPCs that need LinuxCNC answer UNAVAILABLE then.
|
|
998
|
+
* It is what the server holds, not a check of LinuxCNC made for this call.
|
|
999
|
+
*/
|
|
1000
|
+
linuxcncConnected: boolean;
|
|
1001
|
+
/**
|
|
1002
|
+
* Version of LinuxCNC as its Python module on the server's machine reports
|
|
1003
|
+
* it, e.g. "2.9.4"; empty if the module does not say. It comes from the
|
|
1004
|
+
* installed module, so it is also set while linuxcnc_connected is false and
|
|
1005
|
+
* does not by itself mean that LinuxCNC is running.
|
|
1006
|
+
*/
|
|
1007
|
+
linuxcncVersion: string;
|
|
1008
|
+
/**
|
|
1009
|
+
* When the server reads LinuxCNC's error channel right now: "on-demand"
|
|
1010
|
+
* (only while a StreamErrors client is connected, so without one
|
|
1011
|
+
* status.errors holds only what earlier streams read), "always" (from the
|
|
1012
|
+
* connect on) or "off" (never; StreamErrors is refused). A server started with "auto", the default,
|
|
1013
|
+
* reports "auto" until it has connected and then the mode it chose from the
|
|
1014
|
+
* INI file's [DISPLAY]DISPLAY.
|
|
1015
|
+
*/
|
|
1016
|
+
errorChannelMode: string;
|
|
1017
|
+
/**
|
|
1018
|
+
* How many stops this server wrote to LinuxCNC that its task is not
|
|
1019
|
+
* known to have taken: a stop whose send returned with the echo behind
|
|
1020
|
+
* its serial (CommandResponse.acknowledged false) counts until a good
|
|
1021
|
+
* status read shows the echo at or past it; a stop lost with the
|
|
1022
|
+
* server's command helper process (it may still be in LinuxCNC's queue)
|
|
1023
|
+
* counts until a stop written after it has been taken. While it is above
|
|
1024
|
+
* 0, commands that are not stops are held and then refused (see
|
|
1025
|
+
* SendCommand). A reconnect to the same LinuxCNC keeps it; one that
|
|
1026
|
+
* finds an echo serial that went backwards (a LinuxCNC that started
|
|
1027
|
+
* again) clears it.
|
|
1028
|
+
*/
|
|
1029
|
+
stopsNotTaken: number;
|
|
1030
|
+
}
|
|
691
1031
|
export declare const Position: MessageFns<Position>;
|
|
692
1032
|
export declare const TaskStatus: MessageFns<TaskStatus>;
|
|
693
1033
|
export declare const TrajectoryStatus: MessageFns<TrajectoryStatus>;
|
|
@@ -744,6 +1084,16 @@ export declare const FileInfo: MessageFns<FileInfo>;
|
|
|
744
1084
|
export declare const ListFilesResponse: MessageFns<ListFilesResponse>;
|
|
745
1085
|
export declare const DeleteFileRequest: MessageFns<DeleteFileRequest>;
|
|
746
1086
|
export declare const DeleteFileResponse: MessageFns<DeleteFileResponse>;
|
|
1087
|
+
export declare const ReadFileRequest: MessageFns<ReadFileRequest>;
|
|
1088
|
+
export declare const ReadFileResponse: MessageFns<ReadFileResponse>;
|
|
1089
|
+
export declare const ResolveFileRequest: MessageFns<ResolveFileRequest>;
|
|
1090
|
+
export declare const ResolveFileResponse: MessageFns<ResolveFileResponse>;
|
|
1091
|
+
export declare const GetMachineConfigRequest: MessageFns<GetMachineConfigRequest>;
|
|
1092
|
+
export declare const JointConfig: MessageFns<JointConfig>;
|
|
1093
|
+
export declare const AxisConfig: MessageFns<AxisConfig>;
|
|
1094
|
+
export declare const MachineConfig: MessageFns<MachineConfig>;
|
|
1095
|
+
export declare const GetServerInfoRequest: MessageFns<GetServerInfoRequest>;
|
|
1096
|
+
export declare const ServerInfo: MessageFns<ServerInfo>;
|
|
747
1097
|
export type LinuxCNCServiceService = typeof LinuxCNCServiceService;
|
|
748
1098
|
export declare const LinuxCNCServiceService: {
|
|
749
1099
|
/** Get current status (poll equivalent) */
|
|
@@ -786,7 +1136,13 @@ export declare const LinuxCNCServiceService: {
|
|
|
786
1136
|
readonly responseSerialize: (value: LinuxCNCStatus) => Buffer;
|
|
787
1137
|
readonly responseDeserialize: (value: Buffer) => LinuxCNCStatus;
|
|
788
1138
|
};
|
|
789
|
-
/**
|
|
1139
|
+
/**
|
|
1140
|
+
* Stream messages from LinuxCNC's error channel. Each message the server
|
|
1141
|
+
* reads goes to every subscriber. The server keeps the newest 256 messages;
|
|
1142
|
+
* a subscriber that falls further behind loses the overflow, visible only
|
|
1143
|
+
* as a jump in ErrorMessage.sequence. Reading the channel takes messages
|
|
1144
|
+
* away from the machine's GUI; see the server's --error-channel option.
|
|
1145
|
+
*/
|
|
790
1146
|
readonly streamErrors: {
|
|
791
1147
|
readonly path: "/linuxcnc.LinuxCNCService/StreamErrors";
|
|
792
1148
|
readonly requestStream: false;
|
|
@@ -826,6 +1182,57 @@ export declare const LinuxCNCServiceService: {
|
|
|
826
1182
|
readonly responseSerialize: (value: DeleteFileResponse) => Buffer;
|
|
827
1183
|
readonly responseDeserialize: (value: Buffer) => DeleteFileResponse;
|
|
828
1184
|
};
|
|
1185
|
+
/** Read a file (or one chunk of it) from the nc_files directory */
|
|
1186
|
+
readonly readFile: {
|
|
1187
|
+
readonly path: "/linuxcnc.LinuxCNCService/ReadFile";
|
|
1188
|
+
readonly requestStream: false;
|
|
1189
|
+
readonly responseStream: false;
|
|
1190
|
+
readonly requestSerialize: (value: ReadFileRequest) => Buffer;
|
|
1191
|
+
readonly requestDeserialize: (value: Buffer) => ReadFileRequest;
|
|
1192
|
+
readonly responseSerialize: (value: ReadFileResponse) => Buffer;
|
|
1193
|
+
readonly responseDeserialize: (value: Buffer) => ReadFileResponse;
|
|
1194
|
+
};
|
|
1195
|
+
/**
|
|
1196
|
+
* Resolve a name in the nc_files directory to its canonical path and say
|
|
1197
|
+
* whether it is the program LinuxCNC currently has loaded
|
|
1198
|
+
*/
|
|
1199
|
+
readonly resolveFile: {
|
|
1200
|
+
readonly path: "/linuxcnc.LinuxCNCService/ResolveFile";
|
|
1201
|
+
readonly requestStream: false;
|
|
1202
|
+
readonly responseStream: false;
|
|
1203
|
+
readonly requestSerialize: (value: ResolveFileRequest) => Buffer;
|
|
1204
|
+
readonly requestDeserialize: (value: Buffer) => ResolveFileRequest;
|
|
1205
|
+
readonly responseSerialize: (value: ResolveFileResponse) => Buffer;
|
|
1206
|
+
readonly responseDeserialize: (value: Buffer) => ResolveFileResponse;
|
|
1207
|
+
};
|
|
1208
|
+
/**
|
|
1209
|
+
* Get the machine's static configuration: kinematics, joint-to-axis
|
|
1210
|
+
* mapping, limits, velocities and units
|
|
1211
|
+
*/
|
|
1212
|
+
readonly getMachineConfig: {
|
|
1213
|
+
readonly path: "/linuxcnc.LinuxCNCService/GetMachineConfig";
|
|
1214
|
+
readonly requestStream: false;
|
|
1215
|
+
readonly responseStream: false;
|
|
1216
|
+
readonly requestSerialize: (value: GetMachineConfigRequest) => Buffer;
|
|
1217
|
+
readonly requestDeserialize: (value: Buffer) => GetMachineConfigRequest;
|
|
1218
|
+
readonly responseSerialize: (value: MachineConfig) => Buffer;
|
|
1219
|
+
readonly responseDeserialize: (value: Buffer) => MachineConfig;
|
|
1220
|
+
};
|
|
1221
|
+
/**
|
|
1222
|
+
* Get the server's version and whether it is connected to LinuxCNC.
|
|
1223
|
+
* Answers also while the server is waiting for LinuxCNC, and never waits
|
|
1224
|
+
* behind a command. A 1.0 server does not have this RPC and answers
|
|
1225
|
+
* UNIMPLEMENTED, which is how a client tells a 1.0 server from a later one.
|
|
1226
|
+
*/
|
|
1227
|
+
readonly getServerInfo: {
|
|
1228
|
+
readonly path: "/linuxcnc.LinuxCNCService/GetServerInfo";
|
|
1229
|
+
readonly requestStream: false;
|
|
1230
|
+
readonly responseStream: false;
|
|
1231
|
+
readonly requestSerialize: (value: GetServerInfoRequest) => Buffer;
|
|
1232
|
+
readonly requestDeserialize: (value: Buffer) => GetServerInfoRequest;
|
|
1233
|
+
readonly responseSerialize: (value: ServerInfo) => Buffer;
|
|
1234
|
+
readonly responseDeserialize: (value: Buffer) => ServerInfo;
|
|
1235
|
+
};
|
|
829
1236
|
};
|
|
830
1237
|
export interface LinuxCNCServiceServer extends UntypedServiceImplementation {
|
|
831
1238
|
/** Get current status (poll equivalent) */
|
|
@@ -836,7 +1243,13 @@ export interface LinuxCNCServiceServer extends UntypedServiceImplementation {
|
|
|
836
1243
|
waitComplete: handleUnaryCall<WaitCompleteRequest, CommandResponse>;
|
|
837
1244
|
/** Stream status updates */
|
|
838
1245
|
streamStatus: handleServerStreamingCall<StreamStatusRequest, LinuxCNCStatus>;
|
|
839
|
-
/**
|
|
1246
|
+
/**
|
|
1247
|
+
* Stream messages from LinuxCNC's error channel. Each message the server
|
|
1248
|
+
* reads goes to every subscriber. The server keeps the newest 256 messages;
|
|
1249
|
+
* a subscriber that falls further behind loses the overflow, visible only
|
|
1250
|
+
* as a jump in ErrorMessage.sequence. Reading the channel takes messages
|
|
1251
|
+
* away from the machine's GUI; see the server's --error-channel option.
|
|
1252
|
+
*/
|
|
840
1253
|
streamErrors: handleServerStreamingCall<StreamErrorsRequest, ErrorMessage>;
|
|
841
1254
|
/** Upload a G-code file to the nc_files directory */
|
|
842
1255
|
uploadFile: handleUnaryCall<UploadFileRequest, UploadFileResponse>;
|
|
@@ -844,6 +1257,25 @@ export interface LinuxCNCServiceServer extends UntypedServiceImplementation {
|
|
|
844
1257
|
listFiles: handleUnaryCall<ListFilesRequest, ListFilesResponse>;
|
|
845
1258
|
/** Delete a file from the nc_files directory */
|
|
846
1259
|
deleteFile: handleUnaryCall<DeleteFileRequest, DeleteFileResponse>;
|
|
1260
|
+
/** Read a file (or one chunk of it) from the nc_files directory */
|
|
1261
|
+
readFile: handleUnaryCall<ReadFileRequest, ReadFileResponse>;
|
|
1262
|
+
/**
|
|
1263
|
+
* Resolve a name in the nc_files directory to its canonical path and say
|
|
1264
|
+
* whether it is the program LinuxCNC currently has loaded
|
|
1265
|
+
*/
|
|
1266
|
+
resolveFile: handleUnaryCall<ResolveFileRequest, ResolveFileResponse>;
|
|
1267
|
+
/**
|
|
1268
|
+
* Get the machine's static configuration: kinematics, joint-to-axis
|
|
1269
|
+
* mapping, limits, velocities and units
|
|
1270
|
+
*/
|
|
1271
|
+
getMachineConfig: handleUnaryCall<GetMachineConfigRequest, MachineConfig>;
|
|
1272
|
+
/**
|
|
1273
|
+
* Get the server's version and whether it is connected to LinuxCNC.
|
|
1274
|
+
* Answers also while the server is waiting for LinuxCNC, and never waits
|
|
1275
|
+
* behind a command. A 1.0 server does not have this RPC and answers
|
|
1276
|
+
* UNIMPLEMENTED, which is how a client tells a 1.0 server from a later one.
|
|
1277
|
+
*/
|
|
1278
|
+
getServerInfo: handleUnaryCall<GetServerInfoRequest, ServerInfo>;
|
|
847
1279
|
}
|
|
848
1280
|
export interface LinuxCNCServiceClient extends Client {
|
|
849
1281
|
/** Get current status (poll equivalent) */
|
|
@@ -861,7 +1293,13 @@ export interface LinuxCNCServiceClient extends Client {
|
|
|
861
1293
|
/** Stream status updates */
|
|
862
1294
|
streamStatus(request: StreamStatusRequest, options?: Partial<CallOptions>): ClientReadableStream<LinuxCNCStatus>;
|
|
863
1295
|
streamStatus(request: StreamStatusRequest, metadata?: Metadata, options?: Partial<CallOptions>): ClientReadableStream<LinuxCNCStatus>;
|
|
864
|
-
/**
|
|
1296
|
+
/**
|
|
1297
|
+
* Stream messages from LinuxCNC's error channel. Each message the server
|
|
1298
|
+
* reads goes to every subscriber. The server keeps the newest 256 messages;
|
|
1299
|
+
* a subscriber that falls further behind loses the overflow, visible only
|
|
1300
|
+
* as a jump in ErrorMessage.sequence. Reading the channel takes messages
|
|
1301
|
+
* away from the machine's GUI; see the server's --error-channel option.
|
|
1302
|
+
*/
|
|
865
1303
|
streamErrors(request: StreamErrorsRequest, options?: Partial<CallOptions>): ClientReadableStream<ErrorMessage>;
|
|
866
1304
|
streamErrors(request: StreamErrorsRequest, metadata?: Metadata, options?: Partial<CallOptions>): ClientReadableStream<ErrorMessage>;
|
|
867
1305
|
/** Upload a G-code file to the nc_files directory */
|
|
@@ -876,6 +1314,33 @@ export interface LinuxCNCServiceClient extends Client {
|
|
|
876
1314
|
deleteFile(request: DeleteFileRequest, callback: (error: ServiceError | null, response: DeleteFileResponse) => void): ClientUnaryCall;
|
|
877
1315
|
deleteFile(request: DeleteFileRequest, metadata: Metadata, callback: (error: ServiceError | null, response: DeleteFileResponse) => void): ClientUnaryCall;
|
|
878
1316
|
deleteFile(request: DeleteFileRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: DeleteFileResponse) => void): ClientUnaryCall;
|
|
1317
|
+
/** Read a file (or one chunk of it) from the nc_files directory */
|
|
1318
|
+
readFile(request: ReadFileRequest, callback: (error: ServiceError | null, response: ReadFileResponse) => void): ClientUnaryCall;
|
|
1319
|
+
readFile(request: ReadFileRequest, metadata: Metadata, callback: (error: ServiceError | null, response: ReadFileResponse) => void): ClientUnaryCall;
|
|
1320
|
+
readFile(request: ReadFileRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: ReadFileResponse) => void): ClientUnaryCall;
|
|
1321
|
+
/**
|
|
1322
|
+
* Resolve a name in the nc_files directory to its canonical path and say
|
|
1323
|
+
* whether it is the program LinuxCNC currently has loaded
|
|
1324
|
+
*/
|
|
1325
|
+
resolveFile(request: ResolveFileRequest, callback: (error: ServiceError | null, response: ResolveFileResponse) => void): ClientUnaryCall;
|
|
1326
|
+
resolveFile(request: ResolveFileRequest, metadata: Metadata, callback: (error: ServiceError | null, response: ResolveFileResponse) => void): ClientUnaryCall;
|
|
1327
|
+
resolveFile(request: ResolveFileRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: ResolveFileResponse) => void): ClientUnaryCall;
|
|
1328
|
+
/**
|
|
1329
|
+
* Get the machine's static configuration: kinematics, joint-to-axis
|
|
1330
|
+
* mapping, limits, velocities and units
|
|
1331
|
+
*/
|
|
1332
|
+
getMachineConfig(request: GetMachineConfigRequest, callback: (error: ServiceError | null, response: MachineConfig) => void): ClientUnaryCall;
|
|
1333
|
+
getMachineConfig(request: GetMachineConfigRequest, metadata: Metadata, callback: (error: ServiceError | null, response: MachineConfig) => void): ClientUnaryCall;
|
|
1334
|
+
getMachineConfig(request: GetMachineConfigRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: MachineConfig) => void): ClientUnaryCall;
|
|
1335
|
+
/**
|
|
1336
|
+
* Get the server's version and whether it is connected to LinuxCNC.
|
|
1337
|
+
* Answers also while the server is waiting for LinuxCNC, and never waits
|
|
1338
|
+
* behind a command. A 1.0 server does not have this RPC and answers
|
|
1339
|
+
* UNIMPLEMENTED, which is how a client tells a 1.0 server from a later one.
|
|
1340
|
+
*/
|
|
1341
|
+
getServerInfo(request: GetServerInfoRequest, callback: (error: ServiceError | null, response: ServerInfo) => void): ClientUnaryCall;
|
|
1342
|
+
getServerInfo(request: GetServerInfoRequest, metadata: Metadata, callback: (error: ServiceError | null, response: ServerInfo) => void): ClientUnaryCall;
|
|
1343
|
+
getServerInfo(request: GetServerInfoRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: ServerInfo) => void): ClientUnaryCall;
|
|
879
1344
|
}
|
|
880
1345
|
export declare const LinuxCNCServiceClient: {
|
|
881
1346
|
new (address: string, credentials: ChannelCredentials, options?: Partial<ClientOptions>): LinuxCNCServiceClient;
|