Skip to content

Commit 826232c

Browse files
committed
Multispindle: CLean up some commands that needed a spindle choice but lacked one
Signed-off-by: andy pugh <andy@bodgesoc.org>
1 parent 9b5e9dc commit 826232c

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

src/emc/rs274ngc/interp_check.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,15 +255,16 @@ int Interp::check_other_codes(block_pointer block) //!< pointer to a block
255255
CHKS(((block->g_modes[7] != G_41) && (block->g_modes[7] != G_42) &&
256256
(block->g_modes[7] != G_41_1) && (block->g_modes[7] != G_42_1) &&
257257
(block->g_modes[14] != G_96)),
258-
_("D word with no G41, G41.1, G42, G42.1, G76 or G96 to use it"));
258+
_("D word with no G41, G41.1, G42, G42.1, or G96 to use it"));
259259
}
260260

261261
if (block->dollar_flag) {
262262
CHKS(((motion != G_76) && (motion != G_33) && (motion != G_33_1) &&
263+
(motion != G_95) && (motion != G_96) && (motion != G_97) &&
263264
(block->m_modes[7] != 3) && (block->m_modes[7] != 4) &&
264265
(block->m_modes[7] != 5) && (block->m_modes[7] != 19) &&
265266
(! block->s_flag)),
266-
_("$ (spindle selection) word with no G41, G41.1, G42, G42.1, G76 or G96 to use it"));
267+
_("$ (spindle selection) word with no G41, G41.1, G42, G42.1, G76 G95 or G96 to use it"));
267268
}
268269

269270
if (block->e_flag) {

src/emc/rs274ngc/interp_cycles.cc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2049,6 +2049,11 @@ int Interp::convert_cycle_wu(int motion, //!< a g-code between G_81 and G_89, a
20492049
NCE_DWELL_TIME_P_WORD_MISSING_WITH_G86);
20502050
block->p_number =
20512051
block->p_number == -1.0 ? settings->cycle_p : block->p_number;
2052+
if (block->dollar_flag){
2053+
CHKS((block->dollar_number < 0 || block->dollar_number >= settings->num_spindles),
2054+
(_("Invalid spindle ($) number in G74/G84 cycle")));
2055+
settings->active_spindle = (int)block->dollar_number;
2056+
}
20522057
CYCLE_MACRO(convert_cycle_g86(block, CANON_PLANE_UW, aa, bb, clear_cc, cc,
20532058
block->p_number,
20542059
settings->spindle_turning[settings->active_spindle],
@@ -2061,6 +2066,11 @@ int Interp::convert_cycle_wu(int motion, //!< a g-code between G_81 and G_89, a
20612066
CHKS((!block->j_flag), NCE_J_WORD_MISSING_WITH_G87);
20622067
CHKS((!block->k_flag), NCE_K_WORD_MISSING_WITH_G87);
20632068
}
2069+
if (block->dollar_flag){
2070+
CHKS((block->dollar_number < 0 || block->dollar_number >= settings->num_spindles),
2071+
(_("Invalid spindle ($) number in G74/G84 cycle")));
2072+
settings->active_spindle = (int)block->dollar_number;
2073+
}
20642074
i = block->i_flag ? block->i_number : settings->cycle_i;
20652075
j = block->j_flag ? block->j_number : settings->cycle_j;
20662076
k = block->k_flag ? block->k_number : settings->cycle_k;
@@ -2080,6 +2090,11 @@ int Interp::convert_cycle_wu(int motion, //!< a g-code between G_81 and G_89, a
20802090
NCE_DWELL_TIME_P_WORD_MISSING_WITH_G88);
20812091
block->p_number =
20822092
block->p_number == -1.0 ? settings->cycle_p : block->p_number;
2093+
if (block->dollar_flag){
2094+
CHKS((block->dollar_number < 0 || block->dollar_number >= settings->num_spindles),
2095+
(_("Invalid spindle ($) number in G74/G84 cycle")));
2096+
settings->active_spindle = (int)block->dollar_number;
2097+
}
20832098
CYCLE_MACRO(convert_cycle_g88(block, CANON_PLANE_UW, aa, bb, cc,
20842099
block->p_number,
20852100
settings->spindle_turning[settings->active_spindle],

0 commit comments

Comments
 (0)