Added pause and retract lcd menu items

This commit is contained in:
James Adams 2012-07-26 23:38:33 -06:00 committed by Erik vd Zalm
parent e10355500d
commit 96f4f90cb3

View File

@ -561,7 +561,7 @@ void MainMenu::showPrepare()
enum {
ItemAM_exit,
ItemAM_X, ItemAM_Y, ItemAM_Z, ItemAM_E
ItemAM_X, ItemAM_Y, ItemAM_Z, ItemAM_E, ItemAM_ERetract
};
void MainMenu::showAxisMove()
@ -714,7 +714,11 @@ void MainMenu::showAxisMove()
break;
case ItemAM_E:
// ErikDB: TODO: this length should be changed for volumetric.
MENUITEM( lcdprintPGM(MSG_EXTRUDE) , BLOCK;enquecommand("G92 E0");enquecommand("G1 F700 E5");beepshort(); ) ;
MENUITEM( lcdprintPGM(MSG_EXTRUDE) , BLOCK;enquecommand("G92 E0");enquecommand("G1 F70 E1");beepshort(); ) ;
break;
case ItemAM_ERetract:
// ErikDB: TODO: this length should be changed for volumetric.
MENUITEM( lcdprintPGM(MSG_RETRACT) , BLOCK;enquecommand("G92 E0");enquecommand("G1 F700 E-1");beepshort(); ) ;
break;
default:
break;
@ -2338,7 +2342,7 @@ void MainMenu::showSD()
}
enum {ItemM_watch, ItemM_prepare, ItemM_control, ItemM_file };
enum {ItemM_watch, ItemM_prepare, ItemM_control, ItemM_file, ItemM_pause};
void MainMenu::showMainMenu()
{
@ -2410,9 +2414,52 @@ void MainMenu::showMainMenu()
beepshort();
}
}break;
case ItemM_pause:
{
if(force_lcd_update)
{
lcd.setCursor(0,line);
#ifdef CARDINSERTED
if(CARDINSERTED)
#else
if(true)
#endif
{
if(card.sdprinting)
lcdprintPGM(MSG_PAUSE_PRINT);
else
lcdprintPGM(MSG_RESUME_PRINT);
}
else
{
//lcdprintPGM(MSG_NO_CARD);
}
}
#ifdef CARDINSERTED
if(CARDINSERTED)
#endif
if((activeline==line) && CLICKED)
{
if(card.sdprinting)
{
card.pauseSDPrint();
beepshort();
status = Main_Status;
}
else
{
card.startFileprint();
starttime=millis();
beepshort();
status = Main_Status;
}
}
}break;
#else
case ItemM_file:
break;
case ItemM_pause:
break;
#endif
default:
SERIAL_ERROR_START;
@ -2421,7 +2468,14 @@ void MainMenu::showMainMenu()
}
line++;
}
updateActiveLines(3,encoderpos);
uint8_t numberOfLines = 4;
#ifdef SDSUPPORT
numberOfLines = 4;
#else
numberOfLines = 3;
#endif
updateActiveLines(numberOfLines,encoderpos);
}
void MainMenu::update()