First commit for Ender-3V3 SE
First commit for Ender-3V3 SE
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(SDSUPPORT)
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../sd/cardreader.h"
|
||||
#include "../../lcd/dwin/e3v2/dwin.h"
|
||||
#include "../../sd/cardreader.h"
|
||||
|
||||
/**
|
||||
* Marlin\src\sd\cardreader.h
|
||||
* Ender-3S_ONE\Marlin\src\gcode\stats\M72.cpp
|
||||
* M72: Open a file
|
||||
*
|
||||
* The path is relative to the root directory
|
||||
*/
|
||||
void GcodeSuite::M72()
|
||||
{
|
||||
// Simplify3D includes the size, so zero out all spaces (#7227)
|
||||
for (char *fn = parser.string_arg; *fn; ++fn)
|
||||
{
|
||||
if (*fn == ' ')
|
||||
{
|
||||
*fn = '\0';
|
||||
}
|
||||
}
|
||||
SERIAL_ECHOLNPAIR("Rec_parser.string_arg:", parser.string_arg, ".\r\n");
|
||||
#if ENABLED(DWIN_CREALITY_LCD)
|
||||
int fileselect = 0;
|
||||
for(int i = 0;i < 20;i ++)
|
||||
{
|
||||
// clean print file
|
||||
// rtscheck.RTS_SndData(0, PRINT_FILE_TEXT_VP + i);
|
||||
}
|
||||
char *cloudfilename = parser.string_arg;
|
||||
int cloudnamelen = strlen(parser.string_arg);
|
||||
uint16_t fileCnt = card.countFilesInWorkDir();
|
||||
SERIAL_ECHOLNPAIR(" \r\n sdcard_fileCnt=: ", fileCnt);
|
||||
// Check whether the current file is the same as the SD card file one by one
|
||||
for(fileselect = 0;fileselect < CardRecbuf.Filesum;fileselect++)
|
||||
{
|
||||
// To prevent duplicate file names on the card surface,
|
||||
if(!strncmp(CardRecbuf.Cardshowfilename[fileselect], cloudfilename , cloudnamelen))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
int j = 1;
|
||||
while((strncmp(&cloudfilename[j], ".gcode", 6) && strncmp(&cloudfilename[j], ".GCODE", 6)) && ((j ++) < cloudnamelen));
|
||||
|
||||
if (j >= TEXTBYTELEN)
|
||||
{
|
||||
strncpy(&parser.string_arg[TEXTBYTELEN - 3], "..", 2);
|
||||
parser.string_arg[TEXTBYTELEN - 1] = '\0';
|
||||
j = TEXTBYTELEN - 1;
|
||||
}
|
||||
// card.filename[FILENAME_LENGTH]=cloudfilename;
|
||||
// strncpy(CardRecbuf.Cardshowfilename[fileselect], parser.string_arg, j);
|
||||
strncpy(card.filename, parser.string_arg, j);
|
||||
// rtscheck.RTS_SndData(CardRecbuf.Cardshowfilename[fileselect], PRINT_FILE_TEXT_VP);
|
||||
#endif
|
||||
|
||||
TERN_(LCD_SET_PROGRESS_MANUALLY, ui.set_progress(0));
|
||||
}
|
||||
|
||||
#endif // SDSUPPORT
|
||||
@@ -0,0 +1,210 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#include "../gcode.h"
|
||||
#include "../../module/printcounter.h"
|
||||
#include "../../lcd/dwin/e3v2/dwin.h"
|
||||
#include "../../feature/powerloss.h"
|
||||
#include "../queue.h"
|
||||
|
||||
/**
|
||||
* M79: cloud print statistics
|
||||
*/
|
||||
void GcodeSuite::M79()
|
||||
{
|
||||
if(parser.seenval('S'))
|
||||
{
|
||||
const int16_t cloudvalue = parser.value_celsius();
|
||||
switch (cloudvalue)
|
||||
{
|
||||
case 0:
|
||||
// 0:cloud connect
|
||||
#if ENABLED(DWIN_CREALITY_LCD)
|
||||
if(recovery.info.sd_printing_flag == false)
|
||||
{
|
||||
// rtscheck.RTS_SndData(1, WIFI_CONNECTED_DISPLAY_ICON_VP);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||
case 1:
|
||||
// 1:cloud print satrt
|
||||
#if ENABLED(DWIN_CREALITY_LCD)
|
||||
if(recovery.info.sd_printing_flag == false)
|
||||
{
|
||||
// rock_20210831 Solve the problem of remaining time not being zero.
|
||||
_remain_time=0;
|
||||
// Show the remaining time
|
||||
Draw_Print_ProgressRemain();
|
||||
Cloud_Progress_Bar=0;
|
||||
print_job_timer.start();
|
||||
// Cloud printing start flag bit
|
||||
HMI_flag.cloud_printing_flag=true;
|
||||
// Enable automatic compensation function rock_2021.10.29
|
||||
process_subcommands_now_P(PSTR("M420 S1 Z10"));
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||
case 2:
|
||||
// 2:cloud print pause
|
||||
#if ENABLED(DWIN_CREALITY_LCD)
|
||||
if(!recovery.info.sd_printing_flag && !HMI_flag.filement_resume_flag)
|
||||
{
|
||||
// Update_Time_Value = 0;
|
||||
print_job_timer.pause();
|
||||
queue.inject_P(PSTR("M25"));
|
||||
if(HMI_flag.cloud_printing_flag && (checkkey = PrintProcess))
|
||||
{
|
||||
// ICONS continue to print
|
||||
ICON_Continue();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||
case 3:
|
||||
// 3:cloud print resume
|
||||
#if ENABLED(DWIN_CREALITY_LCD)
|
||||
if(recovery.info.sd_printing_flag == false)
|
||||
{
|
||||
// Update_Time_Value = 0;
|
||||
if(false == HMI_flag.filement_resume_flag)
|
||||
{
|
||||
print_job_timer.start();
|
||||
queue.inject_P(PSTR("M24"));
|
||||
if(HMI_flag.cloud_printing_flag)
|
||||
{
|
||||
// Pause screen
|
||||
ICON_Pause();
|
||||
}
|
||||
}
|
||||
// // The APP can also exit the power-off and resume interface
|
||||
// if(!HMI_flag.filement_resume_flag)
|
||||
// {
|
||||
// // resume
|
||||
// HMI_flag.cutting_line_flag = false;
|
||||
// if(HMI_flag.cloud_printing_flag)
|
||||
// {
|
||||
// gcode.process_subcommands_now_P(PSTR("M24"));
|
||||
// Goto_PrintProcess();
|
||||
// // Pause screen
|
||||
// ICON_Pause();
|
||||
// }
|
||||
// }
|
||||
// else queue.clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Cloud control SD print pause recovery
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||
case 4:
|
||||
// 4:cloud print stop
|
||||
#if ENABLED(DWIN_CREALITY_LCD)
|
||||
if(recovery.info.sd_printing_flag == false)
|
||||
{
|
||||
print_job_timer.stop();
|
||||
// rock_20210831 Solve the problem of remaining time not being clear.
|
||||
_remain_time = 0;
|
||||
// Added a jump page to stop printing
|
||||
Draw_Print_ProgressRemain();
|
||||
// Cloud printing start flag bit
|
||||
HMI_flag.cloud_printing_flag = false;
|
||||
// queue.inject_P(PSTR("G1 F1200 X0 Y0"));
|
||||
// card.flag.abort_sd_printing = true;
|
||||
Goto_MainMenu();
|
||||
// rock_20210729
|
||||
// gcode.process_subcommands_now_P(PSTR(EVENT_GCODE_SD_ABORT));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Cloud control SD card printing stops.
|
||||
// abortFilePrintSoon();
|
||||
card.flag.abort_sd_printing = true;
|
||||
// rock_20210729
|
||||
gcode.process_subcommands_now_P(PSTR(EVENT_GCODE_SD_ABORT));
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||
case 5:
|
||||
// 5:cloud print finish
|
||||
#if ENABLED(DWIN_CREALITY_LCD)
|
||||
if(recovery.info.sd_printing_flag == false)
|
||||
{
|
||||
print_job_timer.stop();
|
||||
//rock_20210831 Solve the problem of remaining time not being clear.
|
||||
_remain_time = 0;
|
||||
Draw_Print_ProgressRemain();
|
||||
// Added a jump page to stop printing
|
||||
Goto_MainMenu();
|
||||
// Cloud printing start flag bit
|
||||
HMI_flag.cloud_printing_flag = false;
|
||||
// rock_20210729
|
||||
gcode.process_subcommands_now_P(PSTR(EVENT_GCODE_SD_ABORT));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Cloud control SD card printing is complete.
|
||||
// Handle end of file reached
|
||||
card.fileHasFinished();
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(parser.seenval('T'))
|
||||
{
|
||||
Cloud_Progress_Bar = parser.value_celsius();
|
||||
#if ENABLED(RTS_AVAILABLE)
|
||||
rtscheck.RTS_SndData(Cloud_Progress_Bar, PRINT_PROCESS_VP);
|
||||
rtscheck.RTS_SndData(Cloud_Progress_Bar, PRINT_PROCESS_ICON_VP);
|
||||
#endif
|
||||
}
|
||||
|
||||
if(parser.seenval('C'))
|
||||
{
|
||||
// millis_t print_time_update = parser.value_celsius();
|
||||
#if ENABLED(RTS_AVAILABLE)
|
||||
rtscheck.RTS_SndData(print_time_update / 3600, PRINT_TIME_HOUR_VP);
|
||||
rtscheck.RTS_SndData((print_time_update % 3600) / 60, PRINT_TIME_MIN_VP);
|
||||
#endif
|
||||
}
|
||||
|
||||
if(parser.seenval('D'))
|
||||
{
|
||||
// millis_t next_remain_time_update = parser.value_celsius();
|
||||
#if ENABLED(RTS_AVAILABLE)
|
||||
rtscheck.RTS_SndData(next_remain_time_update / 3600, PRINT_REMAIN_TIME_HOUR_VP);
|
||||
rtscheck.RTS_SndData((next_remain_time_update % 3600) / 60, PRINT_REMAIN_TIME_MIN_VP);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../inc/MarlinConfig.h"
|
||||
|
||||
#if ENABLED(HAS_CREALITY_WIFI)
|
||||
|
||||
#include "../gcode.h"
|
||||
#if ENABLED(RTS_AVAILABLE)
|
||||
#include "../../lcd/dwin/lcd_rts.h"
|
||||
#elif ENABLED(DWIN_CREALITY_LCD)
|
||||
#include "../../lcd/dwin/e3v2/dwin.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* M930: WIFI Box Function
|
||||
*/
|
||||
void GcodeSuite::M930()
|
||||
{
|
||||
const int16_t WIFI_F = parser.intval('F');
|
||||
|
||||
if(WIFI_F)
|
||||
{
|
||||
const int16_t WIFI_S = parser.intval('S');
|
||||
if(WIFI_S == 1)
|
||||
{
|
||||
#if ENABLED(RTS_AVAILABLE)
|
||||
if(flag_counter_wifireset)
|
||||
{
|
||||
flag_counter_wifireset = false;
|
||||
rtscheck.RTS_SndData(ExchangePageBase + 33, ExchangepageAddr);
|
||||
change_page_font = 33;
|
||||
}
|
||||
rtscheck.RTS_SndData(1, WIFI_CONNECTED_DISPLAY_ICON_VP);
|
||||
#endif
|
||||
}
|
||||
else if(WIFI_S == 2)
|
||||
{
|
||||
#if ENABLED(RTS_AVAILABLE)
|
||||
rtscheck.RTS_SndData(0, ADV_SETTING_WIFI_ICON_VP);
|
||||
rtscheck.RTS_SndData(1, WIFI_CONNECTED_DISPLAY_ICON_VP);
|
||||
#endif
|
||||
}
|
||||
else if(WIFI_S == 3)
|
||||
{
|
||||
#if ENABLED(RTS_AVAILABLE)
|
||||
rtscheck.RTS_SndData(1, ADV_SETTING_WIFI_ICON_VP);
|
||||
rtscheck.RTS_SndData(0, WIFI_CONNECTED_DISPLAY_ICON_VP);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif // HAS_CREALITY_WIFI
|
||||
Reference in New Issue
Block a user