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
* Add board folder with files of various board containing the pins
* Add End time on Graphics display when SD print
* Rewrite macros
* Fix M109 so it won't wait for cooling
* Clear code
......
This diff is collapsed.
......@@ -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.setPrintPos(80, 48);
u8g.setPrintPos(53, 47);
if (print_job_start_ms != 0) {
#if HAS(LCD_POWER_SENSOR)
if (millis() < print_millis + 1000) {
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(':');
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 {
lcd_print(itostr4(power_consumption_hour-startpower));
lcd_print(itostr4(power_consumption_hour - startpower));
lcd_print((char*)"Wh");
}
#else
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(':');
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
}
else {
lcd_printPGM(PSTR("--:--"));
lcd_printPGM(PSTR("S--:--"));
u8g.setPrintPos(90,47);
lcd_printPGM(PSTR("E--:--"));
}
#endif
......
......@@ -614,7 +614,7 @@ float junction_deviation = 0.1;
// For a mixing extruder, get steps for each
#if ENABLED(COLOR_MIXING_EXTRUDER)
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
// Add update block variables for LASER BEAM control
......
......@@ -31,7 +31,7 @@ typedef struct {
long steps[NUM_AXIS]; // Step count along each axis
#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
unsigned long step_event_count; // The number of step events required to complete this block
......
......@@ -658,7 +658,8 @@ ISR(TIMER1_COMPA_vect) {
counter_x = counter_y = counter_z = counter_e = new_count;
#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
step_events_completed = 0;
......@@ -703,9 +704,9 @@ ISR(TIMER1_COMPA_vect) {
#if ENABLED(COLOR_MIXING_EXTRUDER)
long dir = TEST(out_bits, E_AXIS) ? -1 : 1;
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) {
counter_m[j] -= current_block->step_event_count;
counter_m[j] -= current_block->mix_event_count[j];
e_steps[j] += dir;
}
}
......@@ -726,13 +727,9 @@ ISR(TIMER1_COMPA_vect) {
#if DISABLED(ADVANCE)
#if ENABLED(COLOR_MIXING_EXTRUDER)
counter_e += current_block->steps[E_AXIS];
if (counter_e > 0) {
for (uint8_t j = 0; j < DRIVER_EXTRUDERS; j++) {
counter_m[j] += current_block->mix_steps[j];
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];
for (uint8_t j = 0; j < DRIVER_EXTRUDERS; j++) {
counter_m[j] += current_block->steps[E_AXIS];
if (counter_m[j] > 0) En_STEP_WRITE(j, !INVERT_E_STEP_PIN);
}
#else
STEP_START(e, E);
......@@ -755,6 +752,11 @@ ISR(TIMER1_COMPA_vect) {
STEP_END(z, Z);
#if DISABLED(ADVANCE)
#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++) {
if (counter_m[j] > 0) {
counter_m[j] -= current_block->step_event_count;
......@@ -791,7 +793,14 @@ ISR(TIMER1_COMPA_vect) {
//NOLESS(advance, current_block->advance);
// 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;
#endif // ADVANCE
......@@ -819,7 +828,14 @@ ISR(TIMER1_COMPA_vect) {
// Do E steps + advance steps
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;
#endif //ADVANCE
}
......
......@@ -55,4 +55,3 @@ void NexObject::printObjInfo(void)
}
dbSerialPrintln("]");
}
......@@ -56,25 +56,25 @@ protected: /* methods */
/*
* Get page id.
*
* @return the id of page.
* @return the id of page.
*/
uint8_t getObjPid(void);
uint8_t getObjPid(void);
/*
* Get component id.
*
* @return the id of component.
* @return the id of component.
*/
uint8_t getObjCid(void);
/*
* Get component name.
*
* @return the name of component.
* @return the name of component.
*/
const char *getObjName(void);
private: /* data */
const char *getObjName(void);
private: /* data */
uint8_t __pid; /* Page ID */
uint8_t __cid; /* Component ID */
const char *__name; /* An unique name */
......
......@@ -42,4 +42,23 @@ bool NexPicture::setPic(uint32_t number)
sendCommand(cmd.c_str());
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 */
* @copydoc NexObject::NexObject(uint8_t pid, uint8_t cid, const char *name);
*/
NexPicture(uint8_t pid, uint8_t cid, const char *name);
/**
* Get picture's number.
*
* @param number - an output parameter to save picture number.
*
* @retval true - success.
* @retval false - failed.
*
* @param number - an output parameter to save picture number.
*
* @retval true - success.
* @retval false - failed.
*/
bool getPic(uint32_t *number);
/**
* Set picture's number.
*
*
* @param number -the picture number.
*
* @retval true - success.
* @retval false - failed.
* @retval false - failed.
*/
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)
sendCommand(cmd.c_str());
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 */
* @copydoc NexObject::NexObject(uint8_t pid, uint8_t cid, const char *name);
*/
NexText(uint8_t pid, uint8_t cid, const char *name);
/**
* Get text attribute of component.
*
* @param buffer - buffer storing text returned.
* @param len - length of buffer.
* @return The real length of text returned.
* @param buffer - buffer storing text returned.
* @param len - length of buffer.
* @return The real length of text returned.
*/
uint16_t getText(char *buffer, uint16_t len);
/**
* Set text attribute of component.
*
* @param buffer - text buffer terminated with '\0'.
* @return true if success, false for failure.
* @param buffer - text buffer terminated with '\0'.
* @return true if success, false for failure.
*/
bool setText(const char *buffer);
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)
}
}
}
This diff is collapsed.
......@@ -2,7 +2,7 @@
#define NEXTIONLCD_H
#if ENABLED(NEXTION)
#define LCD_UPDATE_INTERVAL 5000
#define LCD_UPDATE_INTERVAL 4000
void ExitPopCallback(void *ptr);
void setpagePopCallback(void *ptr);
......@@ -25,6 +25,7 @@
#endif
#if ENABLED(SDSUPPORT)
void setpageSDPopCallback(void *ptr);
void sdlistPopCallback(void *ptr);
void sdfilePopCallback(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