added autostart procedure trigger to the ultralcd menu
This commit is contained in:
parent
61c943b4bf
commit
cc4a9cdb69
|
@ -44,6 +44,7 @@ public:
|
|||
bool cardOK ;
|
||||
char filename[11];
|
||||
bool filenameIsDir;
|
||||
int lastnr; //last number of the autostart;
|
||||
private:
|
||||
SdFile root,*curDir,workDir,workDirParent,workDirParentParent;
|
||||
Sd2Card card;
|
||||
|
|
|
@ -14,6 +14,7 @@ CardReader::CardReader()
|
|||
autostart_atmillis=0;
|
||||
|
||||
autostart_stilltocheck=true; //the sd start is delayed, because otherwise the serial cannot answer fast enought to make contact with the hostsoftware.
|
||||
lastnr=0;
|
||||
//power to SD reader
|
||||
#if SDPOWER > -1
|
||||
SET_OUTPUT(SDPOWER);
|
||||
|
@ -334,7 +335,7 @@ void CardReader::checkautostart(bool force)
|
|||
if(!cardOK) //fail
|
||||
return;
|
||||
}
|
||||
static int lastnr=0;
|
||||
|
||||
char autoname[30];
|
||||
sprintf(autoname,"auto%i.g",lastnr);
|
||||
for(int8_t i=0;i<(int)strlen(autoname);i++)
|
||||
|
@ -434,7 +435,8 @@ void CardReader::printingHasFinished()
|
|||
sdprinting = false;
|
||||
if(SD_FINISHED_STEPPERRELEASE)
|
||||
{
|
||||
finishAndDisableSteppers();
|
||||
//finishAndDisableSteppers();
|
||||
enquecommand("M84");
|
||||
}
|
||||
autotempShutdown();
|
||||
}
|
||||
|
|
|
@ -437,7 +437,7 @@ void MainMenu::showStatus()
|
|||
force_lcd_update=false;
|
||||
}
|
||||
|
||||
enum {ItemP_exit, ItemP_home, ItemP_origin, ItemP_preheat, ItemP_extrude, ItemP_disstep};
|
||||
enum {ItemP_exit, ItemP_autostart,ItemP_disstep,ItemP_home, ItemP_origin, ItemP_preheat, ItemP_extrude};
|
||||
|
||||
//any action must not contain a ',' character anywhere, or this breaks:
|
||||
#define MENUITEM(repaint_action, click_action) \
|
||||
|
@ -458,6 +458,12 @@ void MainMenu::showPrepare()
|
|||
case ItemP_exit:
|
||||
MENUITEM( lcdprintPGM(" Main \003") , BLOCK;status=Main_Menu;beepshort(); ) ;
|
||||
break;
|
||||
case ItemP_autostart:
|
||||
MENUITEM( lcdprintPGM(" Autostart") , BLOCK;card.lastnr=0;card.checkautostart(true);beepshort(); ) ;
|
||||
break;
|
||||
case ItemP_disstep:
|
||||
MENUITEM( lcdprintPGM(" Disable Steppers") , BLOCK;enquecommand("M84");beepshort(); ) ;
|
||||
break;
|
||||
case ItemP_home:
|
||||
MENUITEM( lcdprintPGM(" Auto Home") , BLOCK;enquecommand("G28 X-105 Y-105 Z0");beepshort(); ) ;
|
||||
break;
|
||||
|
@ -470,15 +476,14 @@ void MainMenu::showPrepare()
|
|||
case ItemP_extrude:
|
||||
MENUITEM( lcdprintPGM(" Extrude") , BLOCK;enquecommand("G92 E0");enquecommand("G1 F700 E50");beepshort(); ) ;
|
||||
break;
|
||||
case ItemP_disstep:
|
||||
MENUITEM( lcdprintPGM(" Disable Steppers") , BLOCK;enquecommand("M84");beepshort(); ) ;
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
line++;
|
||||
}
|
||||
updateActiveLines(ItemP_disstep,encoderpos);
|
||||
updateActiveLines(ItemP_extrude,encoderpos);
|
||||
}
|
||||
|
||||
enum {ItemT_exit,ItemT_speed,ItemT_flow,ItemT_nozzle,ItemT_fan};
|
||||
|
|
Loading…
Reference in a new issue