Ejemplo n.º 1
0
void mct_ShowNozzle(uint8_t line, uint8_t extruder)
{
    mct_Show(line, itostr3(intround(degTargetHotend(extruder))));
}
Ejemplo n.º 2
0
static void lcd_fc()
{
if (fil_temp == 200)
{
setTargetHotend0(plaPreheatHotendTemp);
}
if (fil_temp == 230)
{
setTargetHotend0(absPreheatHotendTemp);
}
setWatch(); // heater sanity check timer
if (!isHeatingHotend(0)&&(filament_seq == 0))
{
filament_seq = 1;
}
if ((filament_seq == 0)&&(pausa_display == 0))
{
pausa_display = 1;
}
if (filament_seq == 1)
{   
if (st_message == 0)  
    {
	lcdDrawUpdate = 2;  
	lcd_implementation_message0(PSTR("Introducir el nuevo"));
    lcd_implementation_message1(PSTR("filamento y girar el  "));
	lcd_implementation_message2(PSTR("boton hasta que"));
	lcd_implementation_message3(PSTR("salga el filamento"));
	if (encoder_zero == 0)
	{
	encoderPosition = 0;
	encoder_zero = 1;
	}
	}
    if (encoderPosition != 0)
    {
	    move_menu_scale = 1.0;
        current_position[E_AXIS] += float((int)encoderPosition) * move_menu_scale;
        encoderPosition = 0;
		 #ifdef DELTA
        calculate_delta(current_position);
        plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], manual_feedrate[E_AXIS]/60, active_extruder);
        #else
        plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], manual_feedrate[E_AXIS]/60, active_extruder);
        #endif
        lcdDrawUpdate = 2;
		st_message = 1;
    }
	
    if ((lcdDrawUpdate) && (st_message == 1))
    {
	lcd_implementation_drawedit(PSTR("Extruder"), ftostr31(current_position[E_AXIS]));
    }

}
else
    {
    lcd_implementation_message4(PSTR(" Calentando..."));
    _draw_heater_status(6, 0);
	lcdDrawUpdate = 1;
	u8g.drawBitmapP(9,1,STATUS_SCREENBYTEWIDTH,STATUS_SCREENHEIGHT, (blink % 2) && fanSpeed ? status_screen0_bmp : status_screen1_bmp);
	
	}
	
if ((LCD_CLICKED) || (degTargetHotend(0) == 0)  || (currentMenu == lcd_status_screen))
	{
 	filament_seq = 0;
	st_message = 0;
	pausa_display = 0;
	encoder_zero = 0;
	setTargetHotend0(0);
	lcd_return_to_status();
    }
}
Ejemplo n.º 3
0
  void lcd_update() {

    if (!NextionON) return;

    nexLoop(nex_listen_list);

    millis_t ms = millis();

    if (ms > next_lcd_update_ms) {

      sendCurrentPageId(&NextionPage);

      if (NextionPage == 1) {
        if (fanSpeed > 0) fantimer.enable();
        else fantimer.disable();

        uint32_t temp_feedrate = 0;
        VSpeed.getValue(&temp_feedrate);
        feedrate_multiplier = (int)temp_feedrate;

        #if HAS(TEMP_0)
          temptoLCD(0, degHotend(0), degTargetHotend(0));
        #endif
        #if HAS(TEMP_1)
          temptoLCD(1, degHotend(1), degTargetHotend(1));
        #endif
        #if HAS(TEMP_2)
          temptoLCD(2, degHotend(2), degTargetHotend(2));
        #elif HAS(TEMP_BED)
          temptoLCD(2, degBed(), degTargetBed());
        #endif

        coordtoLCD();

        #if ENABLED(SDSUPPORT)
          if (card.isFileOpen()) {
            if (SDstatus != 2) {
              SDstatus = 2;
              SD.setValue(2);
              NPlay.setShow();
              NStop.setShow();
            }
            if(IS_SD_PRINTING) {
              // Progress bar solid part
              sdbar.setValue(card.percentDone());
              NPlay.setPic(17);

              // Estimate End Time
              uint16_t time = print_job_timer.duration() / 60;
              uint16_t end_time = (time * (100 - card.percentDone())) / card.percentDone();
              if (end_time > (60 * 23)) {
                lcd_setstatus("End --:--");
              }
              else if (end_time >= 0) {
                char temp[30];
                sprintf_P(temp, PSTR("End %i:%i"), end_time / 60, end_time%60);
                lcd_setstatus(temp);
              }
            }
            else {
              NPlay.setPic(16);
            }
          }
          else if (card.cardOK && SDstatus != 1) {
            SDstatus = 1;
            SD.setValue(1);
            MSD1.setShow();
            NPlay.setHide();
            NStop.setHide();
          }
          else if (!card.cardOK && SDstatus != 0) {
            SDstatus = 0;
            SD.setValue(0);
            MSD1.setHide();
            NPlay.setHide();
            NStop.setHide();
          }
        #endif
      }
      else if (NextionPage == 6) {
        coordtoLCD();
      }
      next_lcd_update_ms = ms + LCD_UPDATE_INTERVAL;
    }
  }