Make Gcode from .txt data. It is 2D array, for Robot Path.
Dependents: WRS_mechanamu_test WRS2019_master
Diff: MakeSequencer.cpp
- Revision:
- 5:9b4fcc87af6a
- Parent:
- 4:1e606e2301f9
diff -r 1e606e2301f9 -r 9b4fcc87af6a MakeSequencer.cpp --- a/MakeSequencer.cpp Wed Oct 17 08:39:42 2018 +0000 +++ b/MakeSequencer.cpp Wed Oct 17 09:11:24 2018 +0000 @@ -3,7 +3,7 @@ #include "mbed.h" #include "MakeSequencer.h" -#define SIZE 5 +#define SIZE 6 #define ArraySize(array) (sizeof(array) / sizeof(array[0])) //A row is from 1 @@ -21,8 +21,19 @@ printf("%d,",array[i]); printf("\n\r%d\n\r",code.getGcodeSize()); //getGcodeSize() //return Gcode row -} + +Solves arrays bug(Dynamic allocation,Initialize,release) +//out.txt +//x0y0z0a0b0c0 +//x10y10 +//x20a20c20 +//c30 + +//output +//20,10,0,20,0,20, (3 rows data output) +//4 (this code has 4 rows) */ + #include "MakeSequencer.h" MakeSequencer::MakeSequencer(FILE *fp) { @@ -131,7 +142,6 @@ else return false; } - //printf("#(%d) ",i); for(int n = 0;n < _ele;n++) { _tempnum[n] = atoi(_tempstr[n].c_str()); @@ -142,9 +152,7 @@ _element[n][i] = (i != 0 && _check[n][i] && _element[n][i] != _element[n][0]) ? _element[n][0] : _element[n][i]; - //printf("%c:%d",_element[n][i],_data[n][i]); } - //printf("\n\r"); delete[] _tempstr; } }