diff --git a/UP3DTRANSCODE/make.sh b/UP3DTRANSCODE/make.sh index 5259a6f..55784e3 100755 --- a/UP3DTRANSCODE/make.sh +++ b/UP3DTRANSCODE/make.sh @@ -12,7 +12,7 @@ fi if [[ "$OSTYPE" == "msys" ]]; then -$CC -std=c99 -O2 \ +$CC -std=c99 -Ofast -fwhole-program -flto \ -I../UP3DCOMMON \ -o up3dtranscode.exe up3dconf.c hoststepper.c hostplanner.c gcodeparser.c ../UP3DCOMMON/up3ddata.c umcwriter.c up3dtranscode.c -lm @@ -21,7 +21,7 @@ $STRIP up3dtranscode.exe elif [[ "$OSTYPE" == "darwin"* ]]; then -$CC -std=c99 -O2 \ +$CC -std=c99 -Ofast \ -I../UP3DCOMMON \ -framework IOKit \ -framework CoreFoundation \ @@ -31,9 +31,9 @@ $CC -std=c99 -O2 \ $STRIP up3dtranscode -elif [[ "$OSTYPE" == "linux-gnu" ]]; then +elif [[ "$OSTYPE" == "linux-gnu"* ]]; then -$CC -std=c99 -O2 \ +$CC -std=c99 -Ofast -fwhole-program -flto \ -I../UP3DCOMMON \ -o up3dtranscode up3dconf.c hoststepper.c hostplanner.c gcodeparser.c ../UP3DCOMMON/up3ddata.c umcwriter.c up3dtranscode.c -lm diff --git a/UP3DTRANSCODE/umcwriter.c b/UP3DTRANSCODE/umcwriter.c index bd91b53..1ce6ffd 100644 --- a/UP3DTRANSCODE/umcwriter.c +++ b/UP3DTRANSCODE/umcwriter.c @@ -32,6 +32,7 @@ static double umcwriter_Z; static double umcwriter_Z_height; static double umcwriter_print_time; static char umcwriter_machine_type; +static int32_t umcwriter_bed_temp; #ifdef X_REF_CALC static double g_r0, g_r1, g_r2; @@ -51,7 +52,8 @@ bool umcwriter_init(const char* filename, const double heightZ, const char machi umcwriter_Z_height = heightZ; umcwriter_print_time = 0; umcwriter_machine_type = machine_type; - + umcwriter_bed_temp = 0; + st_reset(); plan_reset(); @@ -163,11 +165,12 @@ void umcwriter_finish() blk.pdat2.l = (time*100)/umcwriter_print_time; change=true; } - + if( change ) { fseek( umcwriter_file, -sizeof(UP3D_BLK), SEEK_CUR ); fwrite( &blk, sizeof(UP3D_BLK), 1, umcwriter_file ); + fseek( umcwriter_file, 0, SEEK_CUR ); //workaround for windows bug } } } @@ -422,12 +425,12 @@ void umcwriter_set_bed_temp(int32_t temp, bool wait) UP3D_PROG_BLK_SetParameter(&blk,PARA_HEATER_BED_ON,(temp)?1:0); _umcwriter_write_file(&blk, 1); - if(wait) + if(wait && (temp>umcwriter_bed_temp) ) //only wait if new temperature is higher { UP3D_PROG_BLK_SetParameter(&blk,PARA_RED_BLUE_BLINK,400); _umcwriter_write_file(&blk, 1); - uint32_t waitsec = (temp/settings.heatbed_wait_factor)*60; + uint32_t waitsec = ((temp-umcwriter_bed_temp)/settings.heatbed_wait_factor)*60; umcwriter_pause(waitsec*1000); UP3D_PROG_BLK_SetParameter(&blk,PARA_RED_BLUE_BLINK,200); @@ -435,6 +438,7 @@ void umcwriter_set_bed_temp(int32_t temp, bool wait) umcwriter_set_report_data(-1,-1); } + umcwriter_bed_temp = temp; } void umcwriter_set_report_data(int32_t layer, double height) diff --git a/UP3DTRANSCODE/up3dtranscode.c b/UP3DTRANSCODE/up3dtranscode.c index ad4b890..4fbece2 100644 --- a/UP3DTRANSCODE/up3dtranscode.c +++ b/UP3DTRANSCODE/up3dtranscode.c @@ -84,8 +84,8 @@ int main(int argc, char *argv[]) } gcp_reset(); - - char line[1024]; + + char line[1024]; while( fgets(line,sizeof(line),fgcode) ) if( !gcp_process_line(line) ) return 0; @@ -100,6 +100,6 @@ int main(int argc, char *argv[]) int m = print_time/60; printf("%02dm:",m); print_time -= m*60; printf("%02ds",print_time); printf(" / Nozzle Height: %.2fmm\n", nozzle_height); - - return 0; + + return 0; }