-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathemc_nml.hh
More file actions
2061 lines (1709 loc) · 56 KB
/
emc_nml.hh
File metadata and controls
2061 lines (1709 loc) · 56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/********************************************************************
* Description: emc_nml.hh
* Declarations for EMC NML vocabulary
*
* Derived from a work by Fred Proctor & Will Shackleford
*
* Author:
* License: GPL Version 2
* System: Linux
*
* Copyright (c) 2004 All rights reserved.
*
* Last change:
********************************************************************/
#ifndef EMC_NML_HH
#define EMC_NML_HH
#include "linuxcnc.h"
#include "emc.hh"
#include "rcs.hh"
#include "cmd_msg.hh"
#include "stat_msg.hh"
#include "emcpos.h"
#include "modal_state.hh"
#include "canon.hh" // CANON_TOOL_TABLE, CANON_UNITS
#include "rs274ngc.hh" // ACTIVE_G_CODES, etc
// ------------------
// CLASS DECLARATIONS
// ------------------
// declarations for EMC general classes
/**
* Send a textual error message to the operator.
* The message is put in the errlog buffer to be read by the GUI.
* This allows the controller a generic way to send error messages to
* the operator.
*/
class EMC_OPERATOR_ERROR:public RCS_CMD_MSG {
public:
EMC_OPERATOR_ERROR()
: RCS_CMD_MSG(EMC_OPERATOR_ERROR_TYPE, sizeof(EMC_OPERATOR_ERROR)),
error{}
{};
// For internal NML/CMS use only.
void update(CMS * cms);
char error[LINELEN];
};
/**
* Send a textual information message to the operator.
* This is similar to EMC_OPERATOR_ERROR message except that the messages are
* sent in situations not necessarily considered to be errors.
*/
class EMC_OPERATOR_TEXT:public RCS_CMD_MSG {
public:
EMC_OPERATOR_TEXT()
: RCS_CMD_MSG(EMC_OPERATOR_TEXT_TYPE, sizeof(EMC_OPERATOR_TEXT)),
text{}
{};
// For internal NML/CMS use only.
void update(CMS * cms);
char text[LINELEN];
};
/**
* Send the URL or filename of a document to display.
* This message is placed in the errlog buffer to be read by the GUI.
* If the GUI is capable of doing so it will show the operator a
* previously created document, using the URL or filename provided.
* This message is placed in the errlog channel to be read by the GUI.
* This provides a general means of reporting an error from within the
* controller without having to program the GUI to recognize each error type.
*/
class EMC_OPERATOR_DISPLAY:public RCS_CMD_MSG {
public:
EMC_OPERATOR_DISPLAY()
: RCS_CMD_MSG(EMC_OPERATOR_DISPLAY_TYPE, sizeof(EMC_OPERATOR_DISPLAY)),
display{}
{};
// For internal NML/CMS use only.
void update(CMS * cms);
char display[LINELEN];
};
#define EMC_SYSTEM_CMD_LEN 256
/*
execute a system command
*/
class EMC_SYSTEM_CMD:public RCS_CMD_MSG {
public:
EMC_SYSTEM_CMD()
: RCS_CMD_MSG(EMC_SYSTEM_CMD_TYPE, sizeof(EMC_SYSTEM_CMD)),
string{}
{};
// For internal NML/CMS use only.
void update(CMS * cms);
char string[EMC_SYSTEM_CMD_LEN];
};
class EMC_NULL:public RCS_CMD_MSG {
public:
EMC_NULL():RCS_CMD_MSG(EMC_NULL_TYPE, sizeof(EMC_NULL)) {
};
// For internal NML/CMS use only.
void update(CMS * cms);
};
class EMC_SET_DEBUG:public RCS_CMD_MSG {
public:
EMC_SET_DEBUG()
: RCS_CMD_MSG(EMC_SET_DEBUG_TYPE, sizeof(EMC_SET_DEBUG)),
debug(0)
{};
// For internal NML/CMS use only.
void update(CMS * cms);
unsigned debug;
};
/*
* EMC_JOG_CMD_MSG class.
*/
class EMC_JOG_CMD_MSG:public RCS_CMD_MSG {
public:
EMC_JOG_CMD_MSG(NMLTYPE t, size_t s)
: RCS_CMD_MSG(t, s),
joint_or_axis(0)
{};
// For internal NML/CMS use only.
void update(CMS * cms);
// joint_or_axis == joint_number for joint jogs (jjogmode==1)
// joint_or_axis == 0 for X, 1 for Y,... for axis jogs (jjogmode==0)
int joint_or_axis;
};
// AXIS status base class
class EMC_AXIS_STAT_MSG:public RCS_STAT_MSG {
public:
EMC_AXIS_STAT_MSG(NMLTYPE t, size_t s)
: RCS_STAT_MSG(t, s),
axis(0)
{};
// For internal NML/CMS use only.
void update(CMS * cms);
int axis;
};
class EMC_AXIS_STAT:public EMC_AXIS_STAT_MSG {
public:
EMC_AXIS_STAT();
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
double minPositionLimit;
double maxPositionLimit;
double velocity; // current velocity
};
// declarations for EMC_JOINT classes
/*
* JOINT command base class.
* This is the base class for all commands that operate on a single joint.
* The joint parameter specifies which joint the command affects.
* These commands are sent to the emcCommand buffer to be read by the
* TASK program that will then pass along corresponding messages to the
* motion system.
*/
class EMC_JOINT_CMD_MSG:public RCS_CMD_MSG {
public:
EMC_JOINT_CMD_MSG(NMLTYPE t, size_t s)
: RCS_CMD_MSG(t, s),
joint(0)
{};
// For internal NML/CMS use only.
void update(CMS * cms);
int joint;
};
/**
* Set the Axis backlash.
* This command sets the backlash value.
*/
class EMC_JOINT_SET_BACKLASH:public EMC_JOINT_CMD_MSG {
public:
EMC_JOINT_SET_BACKLASH()
: EMC_JOINT_CMD_MSG(EMC_JOINT_SET_BACKLASH_TYPE, sizeof(EMC_JOINT_SET_BACKLASH)),
backlash(0.0)
{};
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
double backlash;
};
class EMC_JOINT_SET_MIN_POSITION_LIMIT:public EMC_JOINT_CMD_MSG {
public:
EMC_JOINT_SET_MIN_POSITION_LIMIT()
: EMC_JOINT_CMD_MSG (EMC_JOINT_SET_MIN_POSITION_LIMIT_TYPE, sizeof(EMC_JOINT_SET_MIN_POSITION_LIMIT)),
limit(0.0)
{};
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
double limit;
};
class EMC_JOINT_SET_MAX_POSITION_LIMIT:public EMC_JOINT_CMD_MSG {
public:
EMC_JOINT_SET_MAX_POSITION_LIMIT()
: EMC_JOINT_CMD_MSG (EMC_JOINT_SET_MAX_POSITION_LIMIT_TYPE, sizeof(EMC_JOINT_SET_MAX_POSITION_LIMIT)),
limit(0.0)
{};
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
double limit;
};
class EMC_JOINT_SET_FERROR:public EMC_JOINT_CMD_MSG {
public:
EMC_JOINT_SET_FERROR()
: EMC_JOINT_CMD_MSG(EMC_JOINT_SET_FERROR_TYPE, sizeof(EMC_JOINT_SET_FERROR)),
ferror(0.0)
{};
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
double ferror;
};
class EMC_JOINT_SET_MIN_FERROR:public EMC_JOINT_CMD_MSG {
public:
EMC_JOINT_SET_MIN_FERROR()
: EMC_JOINT_CMD_MSG (EMC_JOINT_SET_MIN_FERROR_TYPE, sizeof(EMC_JOINT_SET_MIN_FERROR)),
ferror(0.0)
{};
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
double ferror;
};
class EMC_JOINT_SET_HOMING_PARAMS:public EMC_JOINT_CMD_MSG {
public:
// False positive. Triggers on 'offset'
// cppcheck-suppress uninitMemberVar
EMC_JOINT_SET_HOMING_PARAMS()
: EMC_JOINT_CMD_MSG(EMC_JOINT_SET_HOMING_PARAMS_TYPE, sizeof(EMC_JOINT_SET_HOMING_PARAMS)),
home(0.0),
offset(0.0),
home_final_vel(0.0),
search_vel(0.0),
latch_vel(0.0),
use_index(0),
encoder_does_not_reset(0),
ignore_limits(0),
is_shared(0),
home_sequence(0),
volatile_home(0),
locking_indexer(0),
absolute_encoder(0)
{};
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
double home;
double offset;
double home_final_vel;
double search_vel;
double latch_vel;
int use_index;
int encoder_does_not_reset;
int ignore_limits;
int is_shared;
int home_sequence;
int volatile_home;
int locking_indexer;
int absolute_encoder;
};
class EMC_JOINT_HALT:public EMC_JOINT_CMD_MSG {
public:
EMC_JOINT_HALT()
: EMC_JOINT_CMD_MSG(EMC_JOINT_HALT_TYPE, sizeof(EMC_JOINT_HALT))
{};
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
};
class EMC_JOINT_HOME:public EMC_JOINT_CMD_MSG {
public:
EMC_JOINT_HOME()
: EMC_JOINT_CMD_MSG(EMC_JOINT_HOME_TYPE, sizeof(EMC_JOINT_HOME))
{};
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
};
class EMC_JOINT_UNHOME:public EMC_JOINT_CMD_MSG {
public:
EMC_JOINT_UNHOME()
: EMC_JOINT_CMD_MSG(EMC_JOINT_UNHOME_TYPE, sizeof(EMC_JOINT_UNHOME))
{};
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
};
class EMC_JOG_CONT:public EMC_JOG_CMD_MSG {
public:
EMC_JOG_CONT()
: EMC_JOG_CMD_MSG(EMC_JOG_CONT_TYPE, sizeof(EMC_JOG_CONT)),
vel(0.0),
jjogmode(0)
{};
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
double vel;
int jjogmode; // 1==> joint jog, 0==> axis jog
};
class EMC_JOG_INCR:public EMC_JOG_CMD_MSG {
public:
EMC_JOG_INCR()
: EMC_JOG_CMD_MSG(EMC_JOG_INCR_TYPE, sizeof(EMC_JOG_INCR)),
incr(0.0),
vel(0.0),
jjogmode(0)
{};
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
double incr;
double vel;
int jjogmode; // 1==> joint jog, 0==> axis jog
};
class EMC_JOG_ABS:public EMC_JOG_CMD_MSG {
public:
EMC_JOG_ABS()
: EMC_JOG_CMD_MSG(EMC_JOG_ABS_TYPE, sizeof(EMC_JOG_ABS)),
pos(0.0),
vel(0.0),
jjogmode(0)
{};
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
double pos;
double vel;
int jjogmode; // 1==> joint jog, 0==> axis jog
};
class EMC_JOG_STOP:public EMC_JOG_CMD_MSG {
public:
EMC_JOG_STOP()
: EMC_JOG_CMD_MSG(EMC_JOG_STOP_TYPE, sizeof(EMC_JOG_STOP)),
jjogmode(0)
{};
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
int jjogmode; // 1==> joint jog, 0==> axis jog
};
class EMC_JOINT_OVERRIDE_LIMITS:public EMC_JOINT_CMD_MSG {
public:
EMC_JOINT_OVERRIDE_LIMITS()
: EMC_JOINT_CMD_MSG(EMC_JOINT_OVERRIDE_LIMITS_TYPE, sizeof(EMC_JOINT_OVERRIDE_LIMITS))
{};
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
};
class EMC_JOINT_LOAD_COMP:public EMC_JOINT_CMD_MSG {
public:
EMC_JOINT_LOAD_COMP()
: EMC_JOINT_CMD_MSG(EMC_JOINT_LOAD_COMP_TYPE, sizeof(EMC_JOINT_LOAD_COMP)),
file{},
type(0)
{};
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
char file[LINELEN];
int type; // type of the comp file. type==0 means nom, forw, rev triplets
// type != 0 means nom, forw_trim, rev_trim triplets
};
// JOINT status base class
class EMC_JOINT_STAT_MSG:public RCS_STAT_MSG {
public:
EMC_JOINT_STAT_MSG(NMLTYPE t, size_t s)
: RCS_STAT_MSG(t, s),
joint(0)
{};
// For internal NML/CMS use only.
void update(CMS * cms);
int joint;
};
class EMC_JOINT_STAT:public EMC_JOINT_STAT_MSG {
public:
EMC_JOINT_STAT();
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
// configuration parameters
unsigned char jointType; // EMC_JOINT_LINEAR, EMC_JOINT_ANGULAR
double units; // units per mm, deg for linear, angular
double backlash;
double minPositionLimit;
double maxPositionLimit;
double maxFerror;
double minFerror;
// dynamic status
double ferrorCurrent; // current following error
double ferrorHighMark; // magnitude of max following error
/*! \todo FIXME - is this really position, or the DAC output? */
double output; // commanded output position
double input; // current input position
double velocity; // current velocity
unsigned char inpos; // non-zero means in position
unsigned char homing; // non-zero means homing
unsigned char homed; // non-zero means has been homed
unsigned char fault; // non-zero means axis amp fault
unsigned char enabled; // non-zero means enabled
unsigned char minSoftLimit; // non-zero means min soft limit exceeded
unsigned char maxSoftLimit; // non-zero means max soft limit exceeded
unsigned char minHardLimit; // non-zero means min hard limit exceeded
unsigned char maxHardLimit; // non-zero means max hard limit exceeded
unsigned char overrideLimits; // non-zero means limits are overridden
};
// declarations for EMC_TRAJ classes
// EMC_TRAJ command base class
class EMC_TRAJ_CMD_MSG:public RCS_CMD_MSG {
public:
EMC_TRAJ_CMD_MSG(NMLTYPE t, size_t s)
: RCS_CMD_MSG(t, s),
tag()
{};
//NOTE this does NOT have a corresponding CMS update. This only works
//because motion commands don't actually go through NML.
StateTag tag;
// For internal NML/CMS use only.
void update(CMS * cms);
};
class EMC_TRAJ_SET_MODE:public EMC_TRAJ_CMD_MSG {
public:
EMC_TRAJ_SET_MODE()
: EMC_TRAJ_CMD_MSG(EMC_TRAJ_SET_MODE_TYPE, sizeof(EMC_TRAJ_SET_MODE)),
mode(EMC_TRAJ_MODE::FREE)
{};
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
EMC_TRAJ_MODE mode;
};
class EMC_TRAJ_SET_VELOCITY:public EMC_TRAJ_CMD_MSG {
public:
EMC_TRAJ_SET_VELOCITY()
: EMC_TRAJ_CMD_MSG(EMC_TRAJ_SET_VELOCITY_TYPE, sizeof(EMC_TRAJ_SET_VELOCITY)),
velocity(0.0),
ini_maxvel(0.0)
{};
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
double velocity;
double ini_maxvel;
};
class EMC_TRAJ_SET_ACCELERATION:public EMC_TRAJ_CMD_MSG {
public:
EMC_TRAJ_SET_ACCELERATION()
: EMC_TRAJ_CMD_MSG(EMC_TRAJ_SET_ACCELERATION_TYPE, sizeof(EMC_TRAJ_SET_ACCELERATION)),
acceleration(0.0)
{};
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
double acceleration;
};
class EMC_TRAJ_SET_MAX_VELOCITY:public EMC_TRAJ_CMD_MSG {
public:
EMC_TRAJ_SET_MAX_VELOCITY()
: EMC_TRAJ_CMD_MSG(EMC_TRAJ_SET_MAX_VELOCITY_TYPE, sizeof(EMC_TRAJ_SET_MAX_VELOCITY)),
velocity(0.0)
{};
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
double velocity;
};
class EMC_TRAJ_SET_SCALE:public EMC_TRAJ_CMD_MSG {
public:
EMC_TRAJ_SET_SCALE()
: EMC_TRAJ_CMD_MSG(EMC_TRAJ_SET_SCALE_TYPE, sizeof(EMC_TRAJ_SET_SCALE)),
scale(0.0)
{};
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
double scale;
};
class EMC_TRAJ_SET_RAPID_SCALE:public EMC_TRAJ_CMD_MSG {
public:
EMC_TRAJ_SET_RAPID_SCALE()
: EMC_TRAJ_CMD_MSG(EMC_TRAJ_SET_RAPID_SCALE_TYPE, sizeof(EMC_TRAJ_SET_RAPID_SCALE)),
scale(0.0)
{};
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
double scale;
};
class EMC_TRAJ_SET_SPINDLE_SCALE:public EMC_TRAJ_CMD_MSG {
public:
EMC_TRAJ_SET_SPINDLE_SCALE()
: EMC_TRAJ_CMD_MSG(EMC_TRAJ_SET_SPINDLE_SCALE_TYPE, sizeof(EMC_TRAJ_SET_SPINDLE_SCALE)),
spindle(0),
scale(0.0)
{};
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
int spindle;
double scale;
};
class EMC_TRAJ_SET_FO_ENABLE:public EMC_TRAJ_CMD_MSG {
public:
EMC_TRAJ_SET_FO_ENABLE()
: EMC_TRAJ_CMD_MSG(EMC_TRAJ_SET_FO_ENABLE_TYPE, sizeof(EMC_TRAJ_SET_FO_ENABLE)),
mode(0)
{};
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
unsigned char mode; //mode=0, override off (will work with 100% FO), mode != 0, override on, user can change FO
};
class EMC_TRAJ_SET_SO_ENABLE:public EMC_TRAJ_CMD_MSG {
public:
EMC_TRAJ_SET_SO_ENABLE()
: EMC_TRAJ_CMD_MSG(EMC_TRAJ_SET_SO_ENABLE_TYPE, sizeof(EMC_TRAJ_SET_SO_ENABLE)),
spindle(0),
mode(0)
{};
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
int spindle;
unsigned char mode; //mode=0, override off (will work with 100% SO), mode != 0, override on, user can change SO
};
class EMC_TRAJ_SET_FH_ENABLE:public EMC_TRAJ_CMD_MSG {
public:
EMC_TRAJ_SET_FH_ENABLE()
: EMC_TRAJ_CMD_MSG(EMC_TRAJ_SET_FH_ENABLE_TYPE, sizeof(EMC_TRAJ_SET_FH_ENABLE)),
mode(0)
{};
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
unsigned char mode; //mode=0, override off (feedhold is disabled), mode != 0, override on, user can use feedhold
};
class EMC_TRAJ_ABORT:public EMC_TRAJ_CMD_MSG {
public:
EMC_TRAJ_ABORT()
: EMC_TRAJ_CMD_MSG(EMC_TRAJ_ABORT_TYPE, sizeof(EMC_TRAJ_ABORT))
{};
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
};
class EMC_TRAJ_PAUSE:public EMC_TRAJ_CMD_MSG {
public:
EMC_TRAJ_PAUSE()
: EMC_TRAJ_CMD_MSG(EMC_TRAJ_PAUSE_TYPE, sizeof(EMC_TRAJ_PAUSE))
{};
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
};
class EMC_TRAJ_RESUME:public EMC_TRAJ_CMD_MSG {
public:
EMC_TRAJ_RESUME()
: EMC_TRAJ_CMD_MSG(EMC_TRAJ_RESUME_TYPE, sizeof(EMC_TRAJ_RESUME))
{};
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
};
class EMC_TRAJ_DELAY:public EMC_TRAJ_CMD_MSG {
public:
EMC_TRAJ_DELAY()
: EMC_TRAJ_CMD_MSG(EMC_TRAJ_DELAY_TYPE, sizeof(EMC_TRAJ_DELAY)),
delay(0.0)
{};
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
double delay; // delay in seconds
};
class EMC_TRAJ_LINEAR_MOVE:public EMC_TRAJ_CMD_MSG {
public:
EMC_TRAJ_LINEAR_MOVE()
: EMC_TRAJ_CMD_MSG(EMC_TRAJ_LINEAR_MOVE_TYPE, sizeof(EMC_TRAJ_LINEAR_MOVE)),
type(0),
end{},
vel(0.0),
ini_maxvel(0.0),
acc(0.0),
feed_mode(0),
indexer_jnum(0)
{};
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
int type;
EmcPose end; // end point
double vel, ini_maxvel, acc, ini_maxjerk;
int feed_mode;
int indexer_jnum;
};
class EMC_TRAJ_CIRCULAR_MOVE:public EMC_TRAJ_CMD_MSG {
public:
EMC_TRAJ_CIRCULAR_MOVE()
: EMC_TRAJ_CMD_MSG(EMC_TRAJ_CIRCULAR_MOVE_TYPE, sizeof(EMC_TRAJ_CIRCULAR_MOVE)),
end{},
center{},
normal{},
turn(0),
type(0),
vel(0.0),
ini_maxvel(0.0),
acc(0.0),
feed_mode(0)
{};
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
EmcPose end;
PM_CARTESIAN center;
PM_CARTESIAN normal;
int turn;
int type;
double vel, ini_maxvel, acc, ini_maxjerk;
int feed_mode;
};
class EMC_TRAJ_SET_TERM_COND:public EMC_TRAJ_CMD_MSG {
public:
EMC_TRAJ_SET_TERM_COND()
: EMC_TRAJ_CMD_MSG(EMC_TRAJ_SET_TERM_COND_TYPE, sizeof(EMC_TRAJ_SET_TERM_COND)),
cond(false),
tolerance(0.0)
{};
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
int cond;
double tolerance; // used to set the precision/tolerance of path deviation
// during CONTINUOUS motion mode.
};
class EMC_TRAJ_SET_SPINDLESYNC:public EMC_TRAJ_CMD_MSG {
public:
EMC_TRAJ_SET_SPINDLESYNC()
: EMC_TRAJ_CMD_MSG(EMC_TRAJ_SET_SPINDLESYNC_TYPE, sizeof(EMC_TRAJ_SET_SPINDLESYNC)),
spindle(0),
feed_per_revolution(0.0),
velocity_mode(false)
{};
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
int spindle;
double feed_per_revolution;
bool velocity_mode;
};
class EMC_TRAJ_SET_OFFSET:public EMC_TRAJ_CMD_MSG {
public:
EMC_TRAJ_SET_OFFSET()
: EMC_TRAJ_CMD_MSG(EMC_TRAJ_SET_OFFSET_TYPE, sizeof(EMC_TRAJ_SET_OFFSET)),
offset{}
{};
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
// For internal NML/CMS use only.
void update(CMS * cms);
EmcPose offset;
};
class EMC_TRAJ_SET_G5X:public EMC_TRAJ_CMD_MSG {
public:
EMC_TRAJ_SET_G5X()
: EMC_TRAJ_CMD_MSG(EMC_TRAJ_SET_G5X_TYPE, sizeof(EMC_TRAJ_SET_G5X)),
g5x_index(0),
origin{}
{};
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
int g5x_index;
EmcPose origin;
};
class EMC_TRAJ_SET_G92:public EMC_TRAJ_CMD_MSG {
public:
EMC_TRAJ_SET_G92()
: EMC_TRAJ_CMD_MSG(EMC_TRAJ_SET_G92_TYPE, sizeof(EMC_TRAJ_SET_G92)),
origin{}
{};
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
EmcPose origin;
};
class EMC_TRAJ_SET_ROTATION:public EMC_TRAJ_CMD_MSG {
public:
EMC_TRAJ_SET_ROTATION()
: EMC_TRAJ_CMD_MSG(EMC_TRAJ_SET_ROTATION_TYPE, sizeof(EMC_TRAJ_SET_ROTATION)),
rotation(0.0)
{};
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
double rotation;
};
class EMC_TRAJ_CLEAR_PROBE_TRIPPED_FLAG:public EMC_TRAJ_CMD_MSG {
public:
EMC_TRAJ_CLEAR_PROBE_TRIPPED_FLAG()
: EMC_TRAJ_CMD_MSG(EMC_TRAJ_CLEAR_PROBE_TRIPPED_FLAG_TYPE, sizeof(EMC_TRAJ_CLEAR_PROBE_TRIPPED_FLAG))
{};
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
};
class EMC_TRAJ_SET_TELEOP_ENABLE:public EMC_TRAJ_CMD_MSG {
public:
EMC_TRAJ_SET_TELEOP_ENABLE()
: EMC_TRAJ_CMD_MSG(EMC_TRAJ_SET_TELEOP_ENABLE_TYPE, sizeof(EMC_TRAJ_SET_TELEOP_ENABLE)),
enable(0)
{};
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
int enable;
};
class EMC_TRAJ_PROBE:public EMC_TRAJ_CMD_MSG {
public:
EMC_TRAJ_PROBE()
: EMC_TRAJ_CMD_MSG(EMC_TRAJ_PROBE_TYPE, sizeof(EMC_TRAJ_PROBE)),
pos{},
type(0),
vel(0.0),
ini_maxvel(0.0),
acc(0.0),
probe_type(0)
{};
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
EmcPose pos;
int type;
double vel, ini_maxvel, acc, ini_maxjerk;
unsigned char probe_type;
};
class EMC_TRAJ_RIGID_TAP:public EMC_TRAJ_CMD_MSG {
public:
EMC_TRAJ_RIGID_TAP()
: EMC_TRAJ_CMD_MSG(EMC_TRAJ_RIGID_TAP_TYPE, sizeof(EMC_TRAJ_RIGID_TAP)),
pos{},
vel(0.0),
ini_maxvel(0.0),
acc(0.0),
scale(1.0)
{};
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
EmcPose pos;
double vel, ini_maxvel, acc, scale, ini_maxjerk;
};
// EMC_TRAJ status base class
class EMC_TRAJ_STAT_MSG:public RCS_STAT_MSG {
public:
EMC_TRAJ_STAT_MSG(NMLTYPE t, size_t s)
: RCS_STAT_MSG(t, s)
{};
// For internal NML/CMS use only.
void update(CMS * cms);
};
class EMC_TRAJ_STAT:public EMC_TRAJ_STAT_MSG {
public:
EMC_TRAJ_STAT();
// For internal NML/CMS use only.
// Sub-class update() calls base-class update()
// cppcheck-suppress duplInheritedMember
void update(CMS * cms);
double linearUnits; // units per mm
double angularUnits; // units per degree
double cycleTime; // cycle time, in seconds
int joints; // maximum joint number
int spindles; // maximum spindle number
int axis_mask; // mask of axes actually present
EMC_TRAJ_MODE mode; // EMC_TRAJ_MODE::FREE,
// EMC_TRAJ_MODE::COORD
bool enabled; // non-zero means enabled
bool inpos; // non-zero means in position
int queue; // number of pending motions, counting
// current
int activeQueue; // number of motions blending
bool queueFull; // non-zero means can't accept another motion
emcmot_motion_id_t id; // id of the currently executing motion
bool paused; // non-zero means motion paused
bool single_stepping; // non-zero means motion stepping single block
double scale; // velocity scale factor
double rapid_scale; // rapid scale factor
//double spindle_scale; // moved to EMC_SPINDLE_STAT
EmcPose position; // current commanded position
EmcPose actualPosition; // current actual position, from forward kins
double velocity; // system velocity, for subsequent motions
double acceleration; // system acceleration, for subsequent
// motions
double maxVelocity; // max system velocity
double maxAcceleration; // system acceleration
EmcPose probedPosition; // last position where probe was tripped.