mirror of
https://github.com/synthetos/g2.git
synced 2026-09-22 11:29:24 +08:00
Removed MOTION_PLANNING from motion state. Not needed anymore.
This commit is contained in:
@@ -262,7 +262,6 @@ void cm_set_motion_state(const cmMotionState motion_state)
|
||||
|
||||
switch (motion_state) {
|
||||
case (MOTION_STOP): { ACTIVE_MODEL = MODEL; break; }
|
||||
case (MOTION_PLANNING): { ACTIVE_MODEL = RUNTIME; break; }
|
||||
case (MOTION_RUN): { ACTIVE_MODEL = RUNTIME; break; }
|
||||
case (MOTION_HOLD): { ACTIVE_MODEL = RUNTIME; break; }
|
||||
}
|
||||
@@ -311,7 +310,6 @@ cmCombinedState cm_get_combined_state(cmMachine_t *_cm)
|
||||
case CYCLE_MACHINING: case CYCLE_NONE: {
|
||||
switch(_cm->motion_state) {
|
||||
case MOTION_STOP: { return (COMBINED_RUN); } // See NOTE_1, above
|
||||
case MOTION_PLANNING: { return (COMBINED_RUN); }
|
||||
case MOTION_RUN: { return (COMBINED_RUN); }
|
||||
case MOTION_HOLD: { return (COMBINED_HOLD); }
|
||||
default: {
|
||||
|
||||
@@ -93,6 +93,12 @@ typedef enum {
|
||||
MACHINE_PANIC // machine is in panic state
|
||||
} cmMachineState;
|
||||
|
||||
typedef enum {
|
||||
MOTION_STOP = 0, // motion has stopped: set when the steppers reach the end of the planner queue
|
||||
MOTION_RUN, // machine is in motion: set when the steppers execute an ALINE segment
|
||||
MOTION_HOLD // feedhold in progress: set whenever we leave FEEDHOLD_OFF, unset whenever we enter FEEDHOLD_OFF
|
||||
} cmMotionState;
|
||||
|
||||
typedef enum {
|
||||
CYCLE_NONE = 0, // machine is not ins a cycle
|
||||
CYCLE_MACHINING, // in normal machining cycle
|
||||
@@ -103,13 +109,6 @@ typedef enum {
|
||||
// ...
|
||||
} cmCycleType;
|
||||
|
||||
typedef enum {
|
||||
MOTION_STOP = 0, // motion has stopped: set when the steppers reach the end of the planner queue
|
||||
MOTION_PLANNING, // machine has planned an ALINE segment, but not yet started to execute them
|
||||
MOTION_RUN, // machine is in motion: set when the steppers execute an ALINE segment
|
||||
MOTION_HOLD // feedhold in progress: set whenever we leave FEEDHOLD_OFF, unset whenever we enter FEEDHOLD_OFF
|
||||
} cmMotionState;
|
||||
|
||||
typedef enum { // feedhold requests
|
||||
FEEDHOLD_NO_REQUEST = 0, // no pending request; reverts here when complete (read-only; cannot be set)
|
||||
FEEDHOLD_HOLD_P1, // enter p1 feedhold, enter HOLD state in p1
|
||||
|
||||
+1
-5
@@ -785,11 +785,7 @@ void mp_commit_write_buffer(const blockType block_type)
|
||||
q->w->block_type = block_type;
|
||||
q->w->block_state = BLOCK_INITIAL_ACTION;
|
||||
|
||||
if (block_type == BLOCK_TYPE_ALINE) {
|
||||
if (cm->motion_state == MOTION_STOP) {
|
||||
cm_set_motion_state(MOTION_PLANNING);
|
||||
}
|
||||
} else {
|
||||
if (block_type != BLOCK_TYPE_ALINE) {
|
||||
if ((mp->planner_state > PLANNER_STARTUP) && (cm->hold_state == FEEDHOLD_OFF)) {
|
||||
// NB: BEWARE! the requested exec may result in the planner buffer being
|
||||
// processed IMMEDIATELY and then freed - invalidating the contents
|
||||
|
||||
Reference in New Issue
Block a user