apply uncrust to anycubic_touchscreen
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -21,9 +21,9 @@
|
|||||||
#ifndef anycubic_touchscreen_h
|
#ifndef anycubic_touchscreen_h
|
||||||
#define anycubic_touchscreen_h
|
#define anycubic_touchscreen_h
|
||||||
|
|
||||||
//#include <stdio.h>
|
// #include <stdio.h>
|
||||||
//#include "../inc/MarlinConfig.h"
|
// #include "../inc/MarlinConfig.h"
|
||||||
//#include "../module/configuration_store.h"
|
// #include "../module/configuration_store.h"
|
||||||
|
|
||||||
#include "./src/inc/MarlinConfigPre.h"
|
#include "./src/inc/MarlinConfigPre.h"
|
||||||
#include "./src/feature/bedlevel/bedlevel.h"
|
#include "./src/feature/bedlevel/bedlevel.h"
|
||||||
@@ -38,8 +38,8 @@ void initializeGrid();
|
|||||||
char *itostr2(const uint8_t &x);
|
char *itostr2(const uint8_t &x);
|
||||||
|
|
||||||
#ifndef ULTRA_LCD
|
#ifndef ULTRA_LCD
|
||||||
char *itostr3(const int);
|
char *itostr3(const int);
|
||||||
char *ftostr32(const float &);
|
char *ftostr32(const float &);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define TFTBUFSIZE 4
|
#define TFTBUFSIZE 4
|
||||||
@@ -244,22 +244,22 @@ char *ftostr32(const float &);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
class AnycubicTouchscreenClass {
|
class AnycubicTouchscreenClass {
|
||||||
public:
|
public:
|
||||||
AnycubicTouchscreenClass();
|
AnycubicTouchscreenClass();
|
||||||
void Setup();
|
void Setup();
|
||||||
void CommandScan();
|
void CommandScan();
|
||||||
void BedHeatingStart();
|
void BedHeatingStart();
|
||||||
void BedHeatingDone();
|
void BedHeatingDone();
|
||||||
void HeatingDone();
|
void HeatingDone();
|
||||||
void HeatingStart();
|
void HeatingStart();
|
||||||
void FilamentRunout();
|
void FilamentRunout();
|
||||||
void KillTFT();
|
void KillTFT();
|
||||||
#if BOTH(ANYCUBIC_TFT_DEBUG, KNUTWURST_DGUS2_TFT)
|
#if BOTH(ANYCUBIC_TFT_DEBUG, KNUTWURST_DGUS2_TFT)
|
||||||
void Command(const char * const command);
|
void Command(const char * const command);
|
||||||
#endif
|
#endif
|
||||||
char TFTstate = ANYCUBIC_TFT_STATE_IDLE;
|
char TFTstate = ANYCUBIC_TFT_STATE_IDLE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Anycubic TFT pause states:
|
* Anycubic TFT pause states:
|
||||||
*
|
*
|
||||||
* 0 - printing / stopped
|
* 0 - printing / stopped
|
||||||
@@ -270,131 +270,132 @@ class AnycubicTouchscreenClass {
|
|||||||
* 5 - nozzle timeout on M600 // OBSOLETE
|
* 5 - nozzle timeout on M600 // OBSOLETE
|
||||||
* 6 - nozzle timeout on filament runout // OBSOLETE
|
* 6 - nozzle timeout on filament runout // OBSOLETE
|
||||||
*/
|
*/
|
||||||
uint8_t ai3m_pause_state = 0;
|
uint8_t ai3m_pause_state = 0;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
char TFTcmdbuffer[TFTBUFSIZE][TFT_MAX_CMD_SIZE];
|
char TFTcmdbuffer[TFTBUFSIZE][TFT_MAX_CMD_SIZE];
|
||||||
int TFTbuflen = 0;
|
int TFTbuflen = 0;
|
||||||
int TFTbufindr = 0;
|
int TFTbufindr = 0;
|
||||||
int TFTbufindw = 0;
|
int TFTbufindw = 0;
|
||||||
char serial3_char;
|
char serial3_char;
|
||||||
int serial3_count = 0;
|
int serial3_count = 0;
|
||||||
char *TFTstrchr_pointer;
|
char *TFTstrchr_pointer;
|
||||||
char FlagResumFromOutage = 0;
|
char FlagResumFromOutage = 0;
|
||||||
int filenumber = 0;
|
int filenumber = 0;
|
||||||
unsigned long starttime = 0;
|
unsigned long starttime = 0;
|
||||||
unsigned long stoptime = 0;
|
unsigned long stoptime = 0;
|
||||||
uint8_t tmp_extruder = 0;
|
uint8_t tmp_extruder = 0;
|
||||||
char LastSDstatus = 0;
|
char LastSDstatus = 0;
|
||||||
uint16_t HeaterCheckCount = 0;
|
uint16_t HeaterCheckCount = 0;
|
||||||
bool IsParked = false;
|
bool IsParked = false;
|
||||||
int currentFlowRate = 0;
|
int currentFlowRate = 0;
|
||||||
bool PrintdoneAndPowerOFF = true;
|
bool PrintdoneAndPowerOFF = true;
|
||||||
bool powerOFFflag = 0;
|
bool powerOFFflag = 0;
|
||||||
|
|
||||||
#if defined(POWER_OUTAGE_TEST)
|
#if defined(POWER_OUTAGE_TEST)
|
||||||
struct OutageDataStruct {
|
struct OutageDataStruct {
|
||||||
char OutageDataVersion;
|
char OutageDataVersion;
|
||||||
char OutageFlag;
|
char OutageFlag;
|
||||||
float last_position[XYZE];
|
float last_position[XYZE];
|
||||||
float last_bed_temp;
|
float last_bed_temp;
|
||||||
float last_hotend_temp;
|
float last_hotend_temp;
|
||||||
long lastSDposition;
|
long lastSDposition;
|
||||||
} OutageData;
|
}
|
||||||
#endif
|
OutageData;
|
||||||
|
#endif
|
||||||
|
|
||||||
int CodeValueInt();
|
int CodeValueInt();
|
||||||
float CodeValue();
|
float CodeValue();
|
||||||
bool CodeSeen(char);
|
bool CodeSeen(char);
|
||||||
void PrintList();
|
void PrintList();
|
||||||
void StartPrint();
|
void StartPrint();
|
||||||
void PausePrint();
|
void PausePrint();
|
||||||
void StopPrint();
|
void StopPrint();
|
||||||
void StateHandler();
|
void StateHandler();
|
||||||
void GetCommandFromTFT();
|
void GetCommandFromTFT();
|
||||||
void CheckSDCardChange();
|
void CheckSDCardChange();
|
||||||
void CheckHeaterError();
|
void CheckHeaterError();
|
||||||
void HandleSpecialMenu();
|
void HandleSpecialMenu();
|
||||||
void FilamentChangePause();
|
void FilamentChangePause();
|
||||||
void FilamentChangeResume();
|
void FilamentChangeResume();
|
||||||
void ReheatNozzle();
|
void ReheatNozzle();
|
||||||
void ParkAfterStop();
|
void ParkAfterStop();
|
||||||
|
|
||||||
char currentTouchscreenSelection[64];
|
char currentTouchscreenSelection[64];
|
||||||
char currentFileOrDirectory[64];
|
char currentFileOrDirectory[64];
|
||||||
String flowRateBuffer;
|
String flowRateBuffer;
|
||||||
String zOffsetBuffer;
|
String zOffsetBuffer;
|
||||||
uint16_t MyFileNrCnt = 0;
|
uint16_t MyFileNrCnt = 0;
|
||||||
uint8_t FilamentSensorEnabled = true;
|
uint8_t FilamentSensorEnabled = true;
|
||||||
|
|
||||||
uint8_t SpecialMenu = false;
|
uint8_t SpecialMenu = false;
|
||||||
uint8_t MMLMenu = false;
|
uint8_t MMLMenu = false;
|
||||||
uint8_t FlowMenu = false;
|
uint8_t FlowMenu = false;
|
||||||
uint8_t BLTouchMenu = false;
|
uint8_t BLTouchMenu = false;
|
||||||
uint8_t LevelMenu = false;
|
uint8_t LevelMenu = false;
|
||||||
uint8_t CaseLight = true;
|
uint8_t CaseLight = true;
|
||||||
|
|
||||||
#if ENABLED(ANYCUBIC_FILAMENT_RUNOUT_SENSOR)
|
#if ENABLED(ANYCUBIC_FILAMENT_RUNOUT_SENSOR)
|
||||||
char FilamentTestStatus = false;
|
char FilamentTestStatus = false;
|
||||||
char FilamentTestLastStatus = false;
|
char FilamentTestLastStatus = false;
|
||||||
bool FilamentSetMillis = true;
|
bool FilamentSetMillis = true;
|
||||||
int FilamentRunoutCounter = 0;
|
int FilamentRunoutCounter = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLED(KNUTWURST_MEGA_P_LASER)
|
#if ENABLED(KNUTWURST_MEGA_P_LASER)
|
||||||
typedef struct {
|
typedef struct {
|
||||||
unsigned char bfType[2];
|
unsigned char bfType[2];
|
||||||
unsigned char bfSize[4];
|
unsigned char bfSize[4];
|
||||||
unsigned char bfReserved1[2];
|
unsigned char bfReserved1[2];
|
||||||
unsigned char bfReserved2[2];
|
unsigned char bfReserved2[2];
|
||||||
unsigned char bfOffBits[4];
|
unsigned char bfOffBits[4];
|
||||||
unsigned char biSize[4];
|
unsigned char biSize[4];
|
||||||
unsigned char biWidth[4];
|
unsigned char biWidth[4];
|
||||||
unsigned char biHeight[4];
|
unsigned char biHeight[4];
|
||||||
unsigned char biPlanes[2];
|
unsigned char biPlanes[2];
|
||||||
unsigned char biBitCount[2];
|
unsigned char biBitCount[2];
|
||||||
unsigned char biCompression[4];
|
unsigned char biCompression[4];
|
||||||
unsigned char biSizeImage[4];
|
unsigned char biSizeImage[4];
|
||||||
unsigned char biXPelsPerMeter[4];
|
unsigned char biXPelsPerMeter[4];
|
||||||
unsigned char biYPelsPerMeter[4];
|
unsigned char biYPelsPerMeter[4];
|
||||||
unsigned char biClrUsed[4];
|
unsigned char biClrUsed[4];
|
||||||
unsigned char biClrImportant[4];
|
unsigned char biClrImportant[4];
|
||||||
} BMP_HEAD;
|
} BMP_HEAD;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
unsigned long pic_file_size;
|
unsigned long pic_file_size;
|
||||||
unsigned long pic_ptr;
|
unsigned long pic_ptr;
|
||||||
unsigned long pic_start;
|
unsigned long pic_start;
|
||||||
|
|
||||||
float pic_pixel_distance;
|
float pic_pixel_distance;
|
||||||
float laser_height;
|
float laser_height;
|
||||||
float x_offset;
|
float x_offset;
|
||||||
float y_offset;
|
float y_offset;
|
||||||
|
|
||||||
unsigned int pic_realy_widht;
|
unsigned int pic_realy_widht;
|
||||||
unsigned int pic_widht;
|
unsigned int pic_widht;
|
||||||
unsigned int pic_hight;
|
unsigned int pic_hight;
|
||||||
unsigned char pic_bit;
|
unsigned char pic_bit;
|
||||||
unsigned char pic_widht_odd;
|
unsigned char pic_widht_odd;
|
||||||
unsigned char pic_hight_odd;
|
unsigned char pic_hight_odd;
|
||||||
|
|
||||||
unsigned char pic_print_status;
|
unsigned char pic_print_status;
|
||||||
unsigned char pic_dir;
|
unsigned char pic_dir;
|
||||||
|
|
||||||
unsigned char pic_vector;
|
unsigned char pic_vector;
|
||||||
unsigned char pic_x_mirror;
|
unsigned char pic_x_mirror;
|
||||||
unsigned char pic_y_mirror;
|
unsigned char pic_y_mirror;
|
||||||
unsigned char pic_laser_time;
|
unsigned char pic_laser_time;
|
||||||
} PRINTER_STRUCT;
|
} PRINTER_STRUCT;
|
||||||
|
|
||||||
#define PIC_FIXED 0.1f // // POINT/MM
|
#define PIC_FIXED 0.1f // // POINT/MM
|
||||||
#define PIC_OPEN 50 // // ms
|
#define PIC_OPEN 50 // // ms
|
||||||
#define PIC_SPEDD 20000
|
#define PIC_SPEDD 20000
|
||||||
#define MIN_GRAY_VLAUE 20
|
#define MIN_GRAY_VLAUE 20
|
||||||
#define LASER_PRINT_SPEED 30 //50*60
|
#define LASER_PRINT_SPEED 30 // 50*60
|
||||||
#endif
|
#endif // if ENABLED(KNUTWURST_MEGA_P_LASER)
|
||||||
};
|
};
|
||||||
|
|
||||||
extern AnycubicTouchscreenClass AnycubicTouchscreen;
|
extern AnycubicTouchscreenClass AnycubicTouchscreen;
|
||||||
|
|
||||||
#endif
|
#endif // ifndef anycubic_touchscreen_h
|
||||||
|
Reference in New Issue
Block a user