Commit 3ecc37ff authored by MagoKimbra's avatar MagoKimbra

Update V4_2_8

Update Nextion 0.6.9
Add Endtime on display
parent 44f6ee28
### Version 4.2.8 ### Version 4.2.8
* Add board folder with files of various board containing the pins * Add board folder with files of various board containing the pins
* Add End time on Graphics display when SD print
* Rewrite macros * Rewrite macros
* Fix M109 so it won't wait for cooling * Fix M109 so it won't wait for cooling
* Clear code * Clear code
......
This diff is collapsed.
...@@ -308,28 +308,56 @@ static void lcd_implementation_status_screen() { ...@@ -308,28 +308,56 @@ static void lcd_implementation_status_screen() {
u8g.drawBox(55, 50, (unsigned int)(71.f * card.percentDone() / 100.f), 2 - TALL_FONT_CORRECTION); u8g.drawBox(55, 50, (unsigned int)(71.f * card.percentDone() / 100.f), 2 - TALL_FONT_CORRECTION);
} }
u8g.setPrintPos(80, 48); u8g.setPrintPos(53, 47);
if (print_job_start_ms != 0) { if (print_job_start_ms != 0) {
#if HAS(LCD_POWER_SENSOR) #if HAS(LCD_POWER_SENSOR)
if (millis() < print_millis + 1000) { if (millis() < print_millis + 1000) {
uint16_t time = (millis() - print_job_start_ms) / 60000; uint16_t time = (millis() - print_job_start_ms) / 60000;
uint16_t end_time = (time * (100 - card.percentDone())) / card.percentDone();
lcd_print('S');
lcd_print(itostr2(time/60)); lcd_print(itostr2(time/60));
lcd_print(':'); lcd_print(':');
lcd_print(itostr2(time%60)); lcd_print(itostr2(time%60));
u8g.setPrintPos(90,47);
if (end_time > 1380 || end_time == 0)
u8g.print('E--:--');
else if (end_time > 0) {
u8g.print('E');
u8g.print(itostr2(end_time / 60));
u8g.print(':');
u8g.print(itostr2(end_time %60));
}
} }
else { else {
lcd_print(itostr4(power_consumption_hour-startpower)); lcd_print(itostr4(power_consumption_hour - startpower));
lcd_print((char*)"Wh"); lcd_print((char*)"Wh");
} }
#else #else
uint16_t time = (millis() - print_job_start_ms) / 60000; uint16_t time = (millis() - print_job_start_ms) / 60000;
uint16_t end_time = (time * (100 - card.percentDone())) / card.percentDone();
lcd_print('S');
lcd_print(itostr2(time / 60)); lcd_print(itostr2(time / 60));
lcd_print(':'); lcd_print(':');
lcd_print(itostr2(time % 60)); lcd_print(itostr2(time %60));
u8g.setPrintPos(90,47);
if (end_time > (60 * 23))
u8g.print('E--:--');
else if (end_time >= 0) {
u8g.print('E');
u8g.print(itostr2(end_time / 60));
u8g.print(':');
u8g.print(itostr2(end_time %60));
}
#endif #endif
} }
else { else {
lcd_printPGM(PSTR("--:--")); lcd_printPGM(PSTR("S--:--"));
u8g.setPrintPos(90,47);
lcd_printPGM(PSTR("E--:--"));
} }
#endif #endif
......
...@@ -614,7 +614,7 @@ float junction_deviation = 0.1; ...@@ -614,7 +614,7 @@ float junction_deviation = 0.1;
// For a mixing extruder, get steps for each // For a mixing extruder, get steps for each
#if ENABLED(COLOR_MIXING_EXTRUDER) #if ENABLED(COLOR_MIXING_EXTRUDER)
for (uint8_t i = 0; i < DRIVER_EXTRUDERS; i++) for (uint8_t i = 0; i < DRIVER_EXTRUDERS; i++)
block->mix_steps[i] = block->steps[E_AXIS] * mixing_factor[i]; block->mix_event_count[i] = block->step_event_count / mixing_factor[i];
#endif #endif
// Add update block variables for LASER BEAM control // Add update block variables for LASER BEAM control
......
...@@ -31,7 +31,7 @@ typedef struct { ...@@ -31,7 +31,7 @@ typedef struct {
long steps[NUM_AXIS]; // Step count along each axis long steps[NUM_AXIS]; // Step count along each axis
#if ENABLED(COLOR_MIXING_EXTRUDER) #if ENABLED(COLOR_MIXING_EXTRUDER)
float mix_steps[DRIVER_EXTRUDERS]; // Step count for each stepper in a mixing extruder unsigned long mix_event_count[DRIVER_EXTRUDERS]; // Step count for each stepper in a mixing extruder
#endif #endif
unsigned long step_event_count; // The number of step events required to complete this block unsigned long step_event_count; // The number of step events required to complete this block
......
...@@ -658,7 +658,8 @@ ISR(TIMER1_COMPA_vect) { ...@@ -658,7 +658,8 @@ ISR(TIMER1_COMPA_vect) {
counter_x = counter_y = counter_z = counter_e = new_count; counter_x = counter_y = counter_z = counter_e = new_count;
#if ENABLED(COLOR_MIXING_EXTRUDER) #if ENABLED(COLOR_MIXING_EXTRUDER)
for (int8_t i = 0; i < DRIVER_EXTRUDERS; i++) counter_m[i] = new_count; for (uint8_t i = 0; i < DRIVER_EXTRUDERS; i++)
counter_m[i] = -(current_block->mix_event_count[i] >> 1);
#endif #endif
step_events_completed = 0; step_events_completed = 0;
...@@ -703,9 +704,9 @@ ISR(TIMER1_COMPA_vect) { ...@@ -703,9 +704,9 @@ ISR(TIMER1_COMPA_vect) {
#if ENABLED(COLOR_MIXING_EXTRUDER) #if ENABLED(COLOR_MIXING_EXTRUDER)
long dir = TEST(out_bits, E_AXIS) ? -1 : 1; long dir = TEST(out_bits, E_AXIS) ? -1 : 1;
for (uint8_t j = 0; j < DRIVER_EXTRUDERS; j++) { for (uint8_t j = 0; j < DRIVER_EXTRUDERS; j++) {
counter_m[j] += current_block->mix_steps[j]; counter_m[j] += current_block->steps[E_AXIS];
if (counter_m[j] > 0) { if (counter_m[j] > 0) {
counter_m[j] -= current_block->step_event_count; counter_m[j] -= current_block->mix_event_count[j];
e_steps[j] += dir; e_steps[j] += dir;
} }
} }
...@@ -726,13 +727,9 @@ ISR(TIMER1_COMPA_vect) { ...@@ -726,13 +727,9 @@ ISR(TIMER1_COMPA_vect) {
#if DISABLED(ADVANCE) #if DISABLED(ADVANCE)
#if ENABLED(COLOR_MIXING_EXTRUDER) #if ENABLED(COLOR_MIXING_EXTRUDER)
counter_e += current_block->steps[E_AXIS]; counter_e += current_block->steps[E_AXIS];
if (counter_e > 0) { for (uint8_t j = 0; j < DRIVER_EXTRUDERS; j++) {
for (uint8_t j = 0; j < DRIVER_EXTRUDERS; j++) { counter_m[j] += current_block->steps[E_AXIS];
counter_m[j] += current_block->mix_steps[j]; if (counter_m[j] > 0) En_STEP_WRITE(j, !INVERT_E_STEP_PIN);
if (counter_m[j] > 0) En_STEP_WRITE(j, !INVERT_E_STEP_PIN);
}
counter_e -= current_block->step_event_count;
count_position[E_AXIS] += count_direction[E_AXIS];
} }
#else #else
STEP_START(e, E); STEP_START(e, E);
...@@ -755,6 +752,11 @@ ISR(TIMER1_COMPA_vect) { ...@@ -755,6 +752,11 @@ ISR(TIMER1_COMPA_vect) {
STEP_END(z, Z); STEP_END(z, Z);
#if DISABLED(ADVANCE) #if DISABLED(ADVANCE)
#if ENABLED(COLOR_MIXING_EXTRUDER) #if ENABLED(COLOR_MIXING_EXTRUDER)
// Always count the single E axis
if (counter_e > 0) {
counter_e -= current_block->step_event_count;
count_position[E_AXIS] += count_direction[E_AXIS];
}
for (uint8_t j = 0; j < DRIVER_EXTRUDERS; j++) { for (uint8_t j = 0; j < DRIVER_EXTRUDERS; j++) {
if (counter_m[j] > 0) { if (counter_m[j] > 0) {
counter_m[j] -= current_block->step_event_count; counter_m[j] -= current_block->step_event_count;
...@@ -791,7 +793,14 @@ ISR(TIMER1_COMPA_vect) { ...@@ -791,7 +793,14 @@ ISR(TIMER1_COMPA_vect) {
//NOLESS(advance, current_block->advance); //NOLESS(advance, current_block->advance);
// Do E steps + advance steps // Do E steps + advance steps
e_steps[current_block->active_driver] += ((advance >> 8) - old_advance); #if ENABLED(COLOR_MIXING_EXTRUDER)
// Move mixing steppers proportionally
for (uint8_t j = 0; j < DRIVER_EXTRUDERS; j++)
e_steps[j] += ((advance >> 8) - old_advance) * current_block->step_event_count / current_block->mix_event_count[j];
#else
e_steps[current_block->active_driver] += ((advance >> 8) - old_advance);
#endif
old_advance = advance >> 8; old_advance = advance >> 8;
#endif // ADVANCE #endif // ADVANCE
...@@ -819,7 +828,14 @@ ISR(TIMER1_COMPA_vect) { ...@@ -819,7 +828,14 @@ ISR(TIMER1_COMPA_vect) {
// Do E steps + advance steps // Do E steps + advance steps
uint32_t advance_whole = advance >> 8; uint32_t advance_whole = advance >> 8;
e_steps[current_block->active_driver] += advance_whole - old_advance;
#if ENABLED(MIXING_EXTRUDER_FEATURE)
for (uint8_t j = 0; j < DRIVER_EXTRUDERS; j++)
e_steps[current_block->active_driver] += (advance_whole - old_advance) * current_block->mix_factor[j];
#else
e_steps[current_block->active_driver] += advance_whole - old_advance;
#endif
old_advance = advance_whole; old_advance = advance_whole;
#endif //ADVANCE #endif //ADVANCE
} }
......
...@@ -55,4 +55,3 @@ void NexObject::printObjInfo(void) ...@@ -55,4 +55,3 @@ void NexObject::printObjInfo(void)
} }
dbSerialPrintln("]"); dbSerialPrintln("]");
} }
...@@ -56,25 +56,25 @@ protected: /* methods */ ...@@ -56,25 +56,25 @@ protected: /* methods */
/* /*
* Get page id. * Get page id.
* *
* @return the id of page. * @return the id of page.
*/ */
uint8_t getObjPid(void); uint8_t getObjPid(void);
/* /*
* Get component id. * Get component id.
* *
* @return the id of component. * @return the id of component.
*/ */
uint8_t getObjCid(void); uint8_t getObjCid(void);
/* /*
* Get component name. * Get component name.
* *
* @return the name of component. * @return the name of component.
*/ */
const char *getObjName(void); const char *getObjName(void);
private: /* data */ private: /* data */
uint8_t __pid; /* Page ID */ uint8_t __pid; /* Page ID */
uint8_t __cid; /* Component ID */ uint8_t __cid; /* Component ID */
const char *__name; /* An unique name */ const char *__name; /* An unique name */
......
...@@ -42,4 +42,23 @@ bool NexPicture::setPic(uint32_t number) ...@@ -42,4 +42,23 @@ bool NexPicture::setPic(uint32_t number)
sendCommand(cmd.c_str()); sendCommand(cmd.c_str());
return recvRetCommandFinished(); return recvRetCommandFinished();
} }
bool NexPicture::setHide()
{
String cmd;
cmd += "vis ";
cmd += getObjName();
cmd += ",0";
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}
bool NexPicture::setShow()
{
String cmd;
cmd += "vis ";
cmd += getObjName();
cmd += ",1";
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}
...@@ -34,26 +34,34 @@ public: /* methods */ ...@@ -34,26 +34,34 @@ public: /* methods */
* @copydoc NexObject::NexObject(uint8_t pid, uint8_t cid, const char *name); * @copydoc NexObject::NexObject(uint8_t pid, uint8_t cid, const char *name);
*/ */
NexPicture(uint8_t pid, uint8_t cid, const char *name); NexPicture(uint8_t pid, uint8_t cid, const char *name);
/** /**
* Get picture's number. * Get picture's number.
* *
* @param number - an output parameter to save picture number. * @param number - an output parameter to save picture number.
* *
* @retval true - success. * @retval true - success.
* @retval false - failed. * @retval false - failed.
*/ */
bool getPic(uint32_t *number); bool getPic(uint32_t *number);
/** /**
* Set picture's number. * Set picture's number.
* *
* @param number -the picture number. * @param number -the picture number.
* *
* @retval true - success. * @retval true - success.
* @retval false - failed. * @retval false - failed.
*/ */
bool setPic(uint32_t number); bool setPic(uint32_t number);
/**
* Set Hide / Show component
*
* @return true if success, false for failure.
*/
bool setHide();
bool setShow();
}; };
/** /**
......
...@@ -53,3 +53,23 @@ bool NexText::setColor(uint32_t value) ...@@ -53,3 +53,23 @@ bool NexText::setColor(uint32_t value)
sendCommand(cmd.c_str()); sendCommand(cmd.c_str());
return recvRetCommandFinished(); return recvRetCommandFinished();
} }
bool NexText::setHide()
{
String cmd;
cmd += "vis ";
cmd += getObjName();
cmd += ",0";
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}
bool NexText::setShow()
{
String cmd;
cmd += "vis ";
cmd += getObjName();
cmd += ",1";
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}
...@@ -34,24 +34,32 @@ public: /* methods */ ...@@ -34,24 +34,32 @@ public: /* methods */
* @copydoc NexObject::NexObject(uint8_t pid, uint8_t cid, const char *name); * @copydoc NexObject::NexObject(uint8_t pid, uint8_t cid, const char *name);
*/ */
NexText(uint8_t pid, uint8_t cid, const char *name); NexText(uint8_t pid, uint8_t cid, const char *name);
/** /**
* Get text attribute of component. * Get text attribute of component.
* *
* @param buffer - buffer storing text returned. * @param buffer - buffer storing text returned.
* @param len - length of buffer. * @param len - length of buffer.
* @return The real length of text returned. * @return The real length of text returned.
*/ */
uint16_t getText(char *buffer, uint16_t len); uint16_t getText(char *buffer, uint16_t len);
/** /**
* Set text attribute of component. * Set text attribute of component.
* *
* @param buffer - text buffer terminated with '\0'. * @param buffer - text buffer terminated with '\0'.
* @return true if success, false for failure. * @return true if success, false for failure.
*/ */
bool setText(const char *buffer); bool setText(const char *buffer);
bool setColor(uint32_t value); bool setColor(uint32_t value);
/**
* Set Hide / Show component
*
* @return true if success, false for failure.
*/
bool setHide();
bool setShow();
}; };
/** /**
......
...@@ -92,4 +92,3 @@ void NexTouch::iterate(NexTouch **list, uint8_t pid, uint8_t cid, int32_t event) ...@@ -92,4 +92,3 @@ void NexTouch::iterate(NexTouch **list, uint8_t pid, uint8_t cid, int32_t event)
} }
} }
} }
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#define NEXTIONLCD_H #define NEXTIONLCD_H
#if ENABLED(NEXTION) #if ENABLED(NEXTION)
#define LCD_UPDATE_INTERVAL 5000 #define LCD_UPDATE_INTERVAL 4000
void ExitPopCallback(void *ptr); void ExitPopCallback(void *ptr);
void setpagePopCallback(void *ptr); void setpagePopCallback(void *ptr);
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#endif #endif
#if ENABLED(SDSUPPORT) #if ENABLED(SDSUPPORT)
void setpageSDPopCallback(void *ptr);
void sdlistPopCallback(void *ptr); void sdlistPopCallback(void *ptr);
void sdfilePopCallback(void *ptr); void sdfilePopCallback(void *ptr);
void sdfolderPopCallback(void *ptr); void sdfolderPopCallback(void *ptr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment