Bläddra i källkod

Rename cell index vars

Scott Lahteine 9 år sedan
förälder
incheckning
d0009e013b
1 ändrade filer med 13 tillägg och 13 borttagningar
  1. 13
    13
      Marlin/Marlin_main.cpp

+ 13
- 13
Marlin/Marlin_main.cpp Visa fil

7842
 
7842
 
7843
 // This function is used to split lines on mesh borders so each segment is only part of one mesh area
7843
 // This function is used to split lines on mesh borders so each segment is only part of one mesh area
7844
 void mesh_buffer_line(float x, float y, float z, const float e, float fr_mm_s, const uint8_t& extruder, uint8_t x_splits = 0xff, uint8_t y_splits = 0xff) {
7844
 void mesh_buffer_line(float x, float y, float z, const float e, float fr_mm_s, const uint8_t& extruder, uint8_t x_splits = 0xff, uint8_t y_splits = 0xff) {
7845
-  int pcx = mbl.cell_index_x(RAW_CURRENT_POSITION(X_AXIS)),
7846
-      pcy = mbl.cell_index_y(RAW_CURRENT_POSITION(Y_AXIS)),
7847
-      cx = mbl.cell_index_x(RAW_POSITION(x, X_AXIS)),
7848
-      cy = mbl.cell_index_y(RAW_POSITION(y, Y_AXIS));
7849
-  NOMORE(pcx, MESH_NUM_X_POINTS - 2);
7850
-  NOMORE(pcy, MESH_NUM_Y_POINTS - 2);
7851
-  NOMORE(cx, MESH_NUM_X_POINTS - 2);
7852
-  NOMORE(cy, MESH_NUM_Y_POINTS - 2);
7853
-
7854
-  if (pcx == cx && pcy == cy) {
7845
+  int cx1 = mbl.cell_index_x(RAW_CURRENT_POSITION(X_AXIS)),
7846
+      cy1 = mbl.cell_index_y(RAW_CURRENT_POSITION(Y_AXIS)),
7847
+      cx2 = mbl.cell_index_x(RAW_POSITION(x, X_AXIS)),
7848
+      cy2 = mbl.cell_index_y(RAW_POSITION(y, Y_AXIS));
7849
+  NOMORE(cx1, MESH_NUM_X_POINTS - 2);
7850
+  NOMORE(cy1, MESH_NUM_Y_POINTS - 2);
7851
+  NOMORE(cx2, MESH_NUM_X_POINTS - 2);
7852
+  NOMORE(cy2, MESH_NUM_Y_POINTS - 2);
7853
+
7854
+  if (cx1 == cx2 && cy1 == cy2) {
7855
     // Start and end on same mesh square
7855
     // Start and end on same mesh square
7856
     planner.buffer_line(x, y, z, e, fr_mm_s, extruder);
7856
     planner.buffer_line(x, y, z, e, fr_mm_s, extruder);
7857
     set_current_to_destination();
7857
     set_current_to_destination();
7859
   }
7859
   }
7860
 
7860
 
7861
   float nx, ny, nz, ne, normalized_dist;
7861
   float nx, ny, nz, ne, normalized_dist;
7862
-  int8_t gcx = max(pcx, cx), gcy = max(pcy, cy);
7863
-  if (cx != pcx && TEST(x_splits, gcx)) {
7862
+  int8_t gcx = max(cx1, cx2), gcy = max(cy1, cy2);
7863
+  if (cx2 != cx1 && TEST(x_splits, gcx)) {
7864
     nx = mbl.get_probe_x(gcx) + home_offset[X_AXIS] + position_shift[X_AXIS];
7864
     nx = mbl.get_probe_x(gcx) + home_offset[X_AXIS] + position_shift[X_AXIS];
7865
     normalized_dist = (nx - current_position[X_AXIS]) / (x - current_position[X_AXIS]);
7865
     normalized_dist = (nx - current_position[X_AXIS]) / (x - current_position[X_AXIS]);
7866
     ny = current_position[Y_AXIS] + (y - current_position[Y_AXIS]) * normalized_dist;
7866
     ny = current_position[Y_AXIS] + (y - current_position[Y_AXIS]) * normalized_dist;
7868
     ne = current_position[E_AXIS] + (e - current_position[E_AXIS]) * normalized_dist;
7868
     ne = current_position[E_AXIS] + (e - current_position[E_AXIS]) * normalized_dist;
7869
     CBI(x_splits, gcx);
7869
     CBI(x_splits, gcx);
7870
   }
7870
   }
7871
-  else if (cy != pcy && TEST(y_splits, gcy)) {
7871
+  else if (cy2 != cy1 && TEST(y_splits, gcy)) {
7872
     ny = mbl.get_probe_y(gcy) + home_offset[Y_AXIS] + position_shift[Y_AXIS];
7872
     ny = mbl.get_probe_y(gcy) + home_offset[Y_AXIS] + position_shift[Y_AXIS];
7873
     normalized_dist = (ny - current_position[Y_AXIS]) / (y - current_position[Y_AXIS]);
7873
     normalized_dist = (ny - current_position[Y_AXIS]) / (y - current_position[Y_AXIS]);
7874
     nx = current_position[X_AXIS] + (x - current_position[X_AXIS]) * normalized_dist;
7874
     nx = current_position[X_AXIS] + (x - current_position[X_AXIS]) * normalized_dist;

Laddar…
Avbryt
Spara