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