Compare commits

..

10 Commits

Author SHA1 Message Date
cdanesi 947f28ee45 chore: update Configuration.h 2026-06-01 19:16:59 -04:00
ssjrocks c4d2d5ba90 Merge pull request #1 from eduard-sukharev/bed_level_grid_rendering
Add option for compact bed level grid view
2025-01-26 08:52:02 +10:00
Eduard Sukharev afd9e96cab Add option for compact Z-offset grid view
Rewrote cell boundaries calculation and text rendering logic so that cell sise is calculated
based on the screen size and grid density.
Added an option for compact value rendering, which utilizes more of vertical space and properly
renders up to 10x10 bed leveling grid.
Added some sanity checks.
2025-01-13 14:48:46 +03:00
ssjrocks bae13edd11 enable debugging pins 2024-12-01 13:49:46 +10:00
ssjrocks bdad0afab7 Update Version.h 2024-12-01 13:16:14 +10:00
ssjrocks 95468d817e Update Configuration.h 2024-12-01 13:13:50 +10:00
ssjrocks d607a7808e Update Configuration.h 2024-12-01 13:13:00 +10:00
ssjrocks 622d0fafa8 Update Configuration.h 2024-12-01 13:12:11 +10:00
ssjrocks 0d1257c035 Update Configuration.h 2024-12-01 13:11:08 +10:00
ssjrocks 593f9ab795 Delete Marlin.ino 2024-12-01 13:10:05 +10:00
7 changed files with 174 additions and 139 deletions
-57
View File
@@ -1,57 +0,0 @@
/*==============================================================================
Marlin Firmware
(c) 2011-2020 MarlinFirmware
Portions of Marlin are (c) by their respective authors.
All code complies with GPLv2 and/or GPLv3
================================================================================
Greetings! Thank you for choosing Marlin 2 as your 3D printer firmware.
To configure Marlin you must edit Configuration.h and Configuration_adv.h
located in the root 'Marlin' folder. Check our Configurations repository to
see if there's a more suitable starting-point for your specific hardware.
Before diving in, we recommend the following essential links:
Marlin Firmware Official Website
- https://marlinfw.org/
The official Marlin Firmware website contains the most up-to-date
documentation. Contributions are always welcome!
Configuration
- https://github.com/MarlinFirmware/Configurations
Example configurations for several printer models.
- https://www.youtube.com/watch?v=3gwWVFtdg-4
A good 20-minute overview of Marlin configuration by Tom Sanladerer.
(Applies to Marlin 1.0.x, so Jerk and Acceleration should be halved.)
Also... https://www.google.com/search?tbs=vid%3A1&q=configure+marlin
- https://marlinfw.org/docs/configuration/configuration.html
Marlin's configuration options are explained in more detail here.
Getting Help
- https://reprap.org/forum/list.php?415
The Marlin Discussion Forum is a great place to get help from other Marlin
users who may have experienced similar issues to your own.
- https://github.com/MarlinFirmware/Marlin/issues
With a free GitHub account you can provide us with feedback, bug reports,
and feature requests via the Marlin Issue Queue.
Contributing
- https://marlinfw.org/docs/development/contributing.html
If you'd like to contribute to Marlin, read this first!
- https://marlinfw.org/docs/development/coding_standards.html
Before submitting code get to know the Coding Standards.
------------------------------------------------------------------------------*/
+11 -4
View File
@@ -168,6 +168,7 @@
#define HIGH_SPEED 1 //高速模式 1:打开高速模式 150mm/s; 0:低速模式 80mm/s #define HIGH_SPEED 1 //高速模式 1:打开高速模式 150mm/s; 0:低速模式 80mm/s
#define HIGH_SPEED_1 1 //只开关高速的宏 #define HIGH_SPEED_1 1 //只开关高速的宏
#define SHOW_GRID_VALUES 1 //1 显示自动调平网格值 0 不显示自动调平网格值 #define SHOW_GRID_VALUES 1 //1 显示自动调平网格值 0 不显示自动调平网格值
#define COMPACT_GRID_VALUES 1 // 0 - original Creality style, 1 - compact style for tight grids
#define K8_EXTRUDER 0 //1 是K8挤出机 0 是精灵挤出机 #define K8_EXTRUDER 0 //1 是K8挤出机 0 是精灵挤出机
#define USER_LEVEL_CHECK 1 // 调平校准使能 #define USER_LEVEL_CHECK 1 // 调平校准使能
#define WUHAN_CHENGE_PLATFORM 1 // 武汉改平台板 20230913_Rock #define WUHAN_CHENGE_PLATFORM 1 // 武汉改平台板 20230913_Rock
@@ -872,11 +873,11 @@
* Override with M203 * Override with M203
* X, Y, Z, E0 [, E1[, E2...]] * X, Y, Z, E0 [, E1[, E2...]]
*/ */
#define DEFAULT_MAX_FEEDRATE { 250, 250, 20, 40 } #define DEFAULT_MAX_FEEDRATE { 500, 500, 20, 30 }
#define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2 #define LIMITED_MAX_FR_EDITING // Limit edit via M203 or LCD to DEFAULT_MAX_FEEDRATE * 2
#if ENABLED(LIMITED_MAX_FR_EDITING) #if ENABLED(LIMITED_MAX_FR_EDITING)
#define MAX_FEEDRATE_EDIT_VALUES { 500, 500, 40, 80 } // ...or, set your own edit limits #define MAX_FEEDRATE_EDIT_VALUES { 1000, 1000, 40, 60 } // ...or, set your own edit limits
#endif #endif
/** /**
@@ -1835,12 +1836,18 @@
#define PREHEAT_1_TEMP_CHAMBER 35 #define PREHEAT_1_TEMP_CHAMBER 35
#define PREHEAT_1_FAN_SPEED 0//255 // Value from 0 to 255 #define PREHEAT_1_FAN_SPEED 0//255 // Value from 0 to 255
#define PREHEAT_2_LABEL "TPU" #define PREHEAT_2_LABEL "PETG"
#define PREHEAT_2_TEMP_HOTEND 230 #define PREHEAT_2_TEMP_HOTEND 220
#define PREHEAT_2_TEMP_BED 70 #define PREHEAT_2_TEMP_BED 70
#define PREHEAT_2_TEMP_CHAMBER 35 #define PREHEAT_2_TEMP_CHAMBER 35
#define PREHEAT_2_FAN_SPEED 0//255 // Value from 0 to 255 #define PREHEAT_2_FAN_SPEED 0//255 // Value from 0 to 255
#define PREHEAT_3_LABEL "TPU"
#define PREHEAT_3_TEMP_HOTEND 230
#define PREHEAT_3_TEMP_BED 70
#define PREHEAT_3_TEMP_CHAMBER 35
#define PREHEAT_3_FAN_SPEED 0//255 // Value from 0 to 255
/** /**
* Nozzle Park * Nozzle Park
* *
+1 -1
View File
@@ -4113,7 +4113,7 @@
// //
// M43 - display pin status, toggle pins, watch pins, watch endstops & toggle LED, test servo probe // M43 - display pin status, toggle pins, watch pins, watch endstops & toggle LED, test servo probe
// //
//#define PINS_DEBUGGING #define PINS_DEBUGGING
// Enable Marlin dev mode which adds some special commands // Enable Marlin dev mode which adds some special commands
//#define MARLIN_DEV_MODE //#define MARLIN_DEV_MODE
+2 -2
View File
@@ -26,7 +26,7 @@
*/ */
#ifndef SHORT_BUILD_VERSION #ifndef SHORT_BUILD_VERSION
#if ENABLED(HIGH_SPEED_1) #if ENABLED(HIGH_SPEED_1)
#define SHORT_BUILD_VERSION "V1.0.8" #define SHORT_BUILD_VERSION "V1.0.9"
#else #else
#define SHORT_BUILD_VERSION "Ender-3V3 SE_Ten_P1T14T" // GD32F303RET6 + Multilanguage 1.Chinese 2.English 3.German 4.Russian 5.French 6.Turkish 7.Spanish 8.Italian 9.Portuguese #define SHORT_BUILD_VERSION "Ender-3V3 SE_Ten_P1T14T" // GD32F303RET6 + Multilanguage 1.Chinese 2.English 3.German 4.Russian 5.French 6.Turkish 7.Spanish 8.Italian 9.Portuguese
#endif #endif
@@ -46,7 +46,7 @@
* version was tagged. * version was tagged.
*/ */
#ifndef STRING_DISTRIBUTION_DATE #ifndef STRING_DISTRIBUTION_DATE
#define STRING_DISTRIBUTION_DATE "2024-10-20" #define STRING_DISTRIBUTION_DATE "2024-12-01"
#endif #endif
/** /**
+29 -19
View File
@@ -552,16 +552,32 @@ static void Show_JPN_pause_title(void)
void DWIN_Draw_Z_Offset_Float(uint8_t size, uint16_t color,uint16_t bcolor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, long value) void DWIN_Draw_Z_Offset_Float(uint8_t size, uint16_t color,uint16_t bcolor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, long value)
{ {
#if ENABLED(COMPACT_GRID_VALUES)
char valueStr[48] = "\0";
if (value < 0) if (value < 0)
{ {
DWIN_Draw_FloatValue(true, true, 0, size, color, bcolor, iNum, fNum, x+2, y, -value); DWIN_Draw_String(false, true, font6x12, bcolor == Color_Bg_Black ? Color_Blue : color, bcolor, x+5, y, F("-")); // draw minus sign above
DWIN_Draw_String(false, true, font6x12, color, bcolor, x+2, y, F("-")); value *= -1;
} else {
DWIN_Draw_String(false, true, font6x12, bcolor == Color_Bg_Black ? Color_Red : color, bcolor, x+5, y, F("+")); // draw plus sign above
}
if (value < 100) {
sprintf_P(valueStr, ".%02d", static_cast<int>(value & 0xFF));
} else {
sprintf_P(valueStr, "%d.%d", static_cast<int>((value & 0xFF) / 100), static_cast<int>(((value & 0xFF) % 100) / 10));
}
DWIN_Draw_String(false, true, size, color, bcolor, x, y+8, F(valueStr));
#else // COMPACT_GRID_VALUES
if (value < 0)
{
DWIN_Draw_FloatValue(true, true, 0, size, color, bcolor, iNum, fNum, x+1, y, -value);
DWIN_Draw_String(false, true, font6x12, color, bcolor, x, y, F("-"));
} }
else else
{ {
DWIN_Draw_FloatValue(true, true, 0, size, color, bcolor, iNum, fNum, x+1, y, value); DWIN_Draw_FloatValue(true, true, 0, size, color, bcolor, iNum, fNum, x, y, value);
DWIN_Draw_String(false, true, font6x12, color, bcolor, x, y, F(""));
} }
#endif // COMPACT_GRID_VALUES
} }
#endif #endif
void DWIN_Draw_Signed_Float(uint8_t size, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, long value) void DWIN_Draw_Signed_Float(uint8_t size, uint16_t bColor, uint8_t iNum, uint8_t fNum, uint16_t x, uint16_t y, long value)
@@ -2270,15 +2286,13 @@ static uint16_t Choose_BG_Color(float offset_value)
//计算矩形区域 //计算矩形区域
rec_LU_x=Rect_LU_X_POS + mesh_Count->x * X_Axis_Interval; rec_LU_x=Rect_LU_X_POS + mesh_Count->x * X_Axis_Interval;
// rec_LU_y=Rect_LU_Y_POS+mesh_Count->y*Y_Axis_Interval;
rec_LU_y=Rect_LU_Y_POS - mesh_Count->y * Y_Axis_Interval; rec_LU_y=Rect_LU_Y_POS - mesh_Count->y * Y_Axis_Interval;
rec_RD_x=Rect_RD_X_POS + mesh_Count->x * X_Axis_Interval; rec_RD_x=Rect_RD_X_POS + mesh_Count->x * X_Axis_Interval;
// rec_RD_y=Rect_RD_Y_POS+mesh_Count->y*Y_Axis_Interval;
rec_RD_y=Rect_RD_Y_POS - mesh_Count->y * Y_Axis_Interval; rec_RD_y=Rect_RD_Y_POS - mesh_Count->y * Y_Axis_Interval;
//补偿值的位置 //补偿值的位置
value_LU_x=rec_LU_x+1; value_LU_x = rec_LU_x + (rec_RD_x - rec_LU_x) / 2 - CELL_TEXT_WIDTH / 2;
// value_LU_y=rec_LU_y+4; value_LU_y = rec_LU_y + (rec_RD_y - rec_LU_y) / 2 - CELL_TEXT_HEIGHT / 2 + 1;
value_LU_y=rec_LU_y+(rec_RD_y-rec_LU_y)/2-6;
//填充颜色 //填充颜色
if(!Set_En)rec_fill_color=Choose_BG_Color(z_offset_value);//自动设置 if(!Set_En)rec_fill_color=Choose_BG_Color(z_offset_value);//自动设置
else if(1==Set_En)rec_fill_color=Set_BG_Color; //手动填充选中块颜色, else if(1==Set_En)rec_fill_color=Set_BG_Color; //手动填充选中块颜色,
@@ -5746,15 +5760,13 @@ void HMI_Levling_Change()
xy_int8_t mesh_Count=Converted_Grid_Point(select_level.now); //转换网格点 xy_int8_t mesh_Count=Converted_Grid_Point(select_level.now); //转换网格点
//计算矩形区域 //计算矩形区域
rec_LU_x=Rect_LU_X_POS + mesh_Count.x * X_Axis_Interval; rec_LU_x=Rect_LU_X_POS + mesh_Count.x * X_Axis_Interval;
// rec_LU_y=Rect_LU_Y_POS+mesh_Count.y*Y_Axis_Interval;
rec_LU_y=Rect_LU_Y_POS - mesh_Count.y * Y_Axis_Interval; rec_LU_y=Rect_LU_Y_POS - mesh_Count.y * Y_Axis_Interval;
rec_RD_x=Rect_RD_X_POS + mesh_Count.x * X_Axis_Interval; rec_RD_x=Rect_RD_X_POS + mesh_Count.x * X_Axis_Interval;
// rec_RD_y=Rect_RD_Y_POS+mesh_Count.y*Y_Axis_Interval;
rec_RD_y=Rect_RD_Y_POS - mesh_Count.y * Y_Axis_Interval; rec_RD_y=Rect_RD_Y_POS - mesh_Count.y * Y_Axis_Interval;
//补偿值的位置 //补偿值的位置
value_LU_x=rec_LU_x+1; value_LU_x = rec_LU_x + (rec_RD_x - rec_LU_x) / 2 - CELL_TEXT_WIDTH / 2;
// value_LU_y=rec_LU_y+4; value_LU_y = rec_LU_y + (rec_RD_y - rec_LU_y) / 2 - CELL_TEXT_HEIGHT / 2 + 1;
value_LU_y=rec_LU_y+(rec_RD_y-rec_LU_y)/2-6;
if (Apply_Encoder(encoder_diffState, HMI_ValueStruct.Temp_Leveling_Value)) //点击了确认键 if (Apply_Encoder(encoder_diffState, HMI_ValueStruct.Temp_Leveling_Value)) //点击了确认键
{ {
checkkey = Leveling; checkkey = Leveling;
@@ -5814,15 +5826,13 @@ void HMI_Levling_Change()
xy_int8_t mesh_Count=Converted_Grid_Point(select_level.now); //转换网格点 xy_int8_t mesh_Count=Converted_Grid_Point(select_level.now); //转换网格点
//计算矩形区域 //计算矩形区域
rec_LU_x=Rect_LU_X_POS + mesh_Count.x * X_Axis_Interval; rec_LU_x=Rect_LU_X_POS + mesh_Count.x * X_Axis_Interval;
// rec_LU_y=Rect_LU_Y_POS+mesh_Count.y*Y_Axis_Interval;
rec_LU_y=Rect_LU_Y_POS - mesh_Count.y * Y_Axis_Interval; rec_LU_y=Rect_LU_Y_POS - mesh_Count.y * Y_Axis_Interval;
rec_RD_x=Rect_RD_X_POS + mesh_Count.x * X_Axis_Interval; rec_RD_x=Rect_RD_X_POS + mesh_Count.x * X_Axis_Interval;
// rec_RD_y=Rect_RD_Y_POS+mesh_Count.y*Y_Axis_Interval;
rec_RD_y=Rect_RD_Y_POS - mesh_Count.y * Y_Axis_Interval; rec_RD_y=Rect_RD_Y_POS - mesh_Count.y * Y_Axis_Interval;
//补偿值的位置 //补偿值的位置
value_LU_x=rec_LU_x+1; value_LU_x = rec_LU_x + (rec_RD_x - rec_LU_x) / 2 - CELL_TEXT_WIDTH / 2;
// value_LU_y=rec_LU_y+4; value_LU_y = rec_LU_y + (rec_RD_y - rec_LU_y) / 2 - CELL_TEXT_HEIGHT / 2 + 1;
value_LU_y=rec_LU_y+(rec_RD_y-rec_LU_y)/2-6;
//临时代码 需要继续优化 //临时代码 需要继续优化
// xy_int8_t mesh_Count=Converted_Grid_Point(select_level.now); //转换网格点 // xy_int8_t mesh_Count=Converted_Grid_Point(select_level.now); //转换网格点
Draw_Dots_On_Screen(&mesh_Count,2,Select_Color); //设置字体背景色,不改变选中块颜色 Draw_Dots_On_Screen(&mesh_Count,2,Select_Color); //设置字体背景色,不改变选中块颜色
+2
View File
@@ -601,6 +601,8 @@ extern enum DC_language current_language;
// Color FE29 // Color FE29
#define Color_White 0xFFFF #define Color_White 0xFFFF
#define Color_Yellow 0xFE29 #define Color_Yellow 0xFE29
#define Color_Blue 0x19FF
#define Color_Red 0xF44F
#define Color_Bg_Window 0x31E8 // Popup background color #define Color_Bg_Window 0x31E8 // Popup background color
#define Color_Bg_Blue 0x1145 // Dark blue background color #define Color_Bg_Blue 0x1145 // Dark blue background color
#define Color_Bg_Black 0x0841 // Black background color #define Color_Bg_Black 0x0841 // Black background color
+93 -20
View File
@@ -4,35 +4,108 @@
#if ENABLED(DWIN_CREALITY_480_LCD) // #if ENABLED(DWIN_CREALITY_480_LCD) //
#elif ENABLED(DWIN_CREALITY_320_LCD)//3.2寸屏幕 #elif ENABLED(DWIN_CREALITY_320_LCD) //3.2-inch screen
//主界面 //Main Interface
#define LOGO_LITTLE_X 72 //小LOGO坐标 //Coordinates of the small logo
#define LOGO_LITTLE_X 72
#define LOGO_LITTLE_Y 36 #define LOGO_LITTLE_Y 36
//自动调平界面 //Auto-Leveling Interface
//编辑调平页面 //Edit Leveling Page
#define WORD_TITLE_X 29 #define WORD_TITLE_X 29
#define WORD_TITLE_Y 1 #define WORD_TITLE_Y 1
#define OUTLINE_LEFT_X 12//40 #if GRID_MAX_POINTS_X <= 5
#define OUTLINE_LEFT_Y 30//72 #define OUTLINE_HORIZONTAL_MARGIN 12
#define OUTLINE_RIGHT_X OUTLINE_LEFT_X+220//OUTLINE_LEFT_X+200//OUTLINE_LEFT_X+160 #else
#define OUTLINE_RIGHT_Y OUTLINE_LEFT_Y+220//OUTLINE_LEFT_Y+160 #define OUTLINE_HORIZONTAL_MARGIN 2
#endif
#define OUTLINE_INNER_WIDTH (DWIN_WIDTH - (OUTLINE_HORIZONTAL_MARGIN * 2))
#define OUTLINE_INNER_HEIGHT 220
#define OUTLINE_LEFT_X OUTLINE_HORIZONTAL_MARGIN
#define OUTLINE_LEFT_Y 30
#define OUTLINE_RIGHT_X (OUTLINE_HORIZONTAL_MARGIN + OUTLINE_INNER_WIDTH)
#define OUTLINE_RIGHT_Y (OUTLINE_LEFT_Y + OUTLINE_INNER_HEIGHT)
//button——position //button——position
#define BUTTON_W 82 #define BUTTON_W 82
#define BUTTON_H 32 #define BUTTON_H 32
#define BUTTON_EDIT_X OUTLINE_LEFT_X #define BUTTON_EDIT_X OUTLINE_LEFT_X
#define BUTTON_EDIT_Y OUTLINE_RIGHT_Y+20//OUTLINE_RIGHT_Y+27 #define BUTTON_EDIT_Y OUTLINE_RIGHT_Y+20
#define BUTTON_OK_X OUTLINE_RIGHT_X-BUTTON_W #define BUTTON_OK_X OUTLINE_RIGHT_X-BUTTON_W
#define BUTTON_OK_Y BUTTON_EDIT_Y// #define BUTTON_OK_Y BUTTON_EDIT_Y
//数据坐标 //data coordinates
#define X_Axis_Interval 50//54 //x轴上间隔距离像素
#define Y_Axis_Interval 52//35 //y轴上间隔距离像素
#define Rect_LU_X_POS OUTLINE_LEFT_X+10//32 //第一个左上x坐标
// #define Rect_LU_Y_POS OUTLINE_LEFT_Y+10//157-4 //第一个左上y坐标
#define Rect_LU_Y_POS (OUTLINE_LEFT_Y+20)+3*Y_Axis_Interval//157-4 //第一个左上y坐标
#define Rect_RD_X_POS Rect_LU_X_POS+45//X_Axis_Interval//X_Axis_Interval//78 //第一个右下x坐标 #if ENABLED(SHOW_GRID_VALUES) && GRID_MAX_POINTS_X >= 7 && DISABLED(COMPACT_GRID_VALUES)
// #define Rect_RD_Y_POS Rect_LU_Y_POS+20//Y_Axis_Interval//Y_Axis_Interval//177-4 //第一个右下y坐标 #error "Cannot fit GRID_MAX_POINTS_X >= 7 into LCD screen. Either set GRID_MAX_POINTS_X to lower value or enable COMPACT_GRID_VALUES"
#define Rect_RD_Y_POS (Rect_LU_Y_POS+30)//Y_Axis_Interval//Y_Axis_Interval//177-4 //第一个右下y坐标 #endif
#if ENABLED(SHOW_GRID_VALUES) && GRID_MAX_POINTS_X > 10
#error "Cannot fit GRID_MAX_POINTS_X > 10 into LCD screen. Either set GRID_MAX_POINTS_X to lower value or disable SHOW_GRID_VALUES"
#endif
#if ENABLED(SHOW_GRID_VALUES) && GRID_MAX_POINTS_Y > 10
#error "Cannot fit GRID_MAX_POINTS_Y > 10 into LCD screen. Either set GRID_MAX_POINTS_Y to lower value or disable SHOW_GRID_VALUES"
#endif
#if ENABLED(COMPACT_GRID_VALUES)
#define CELL_TEXT_WIDTH (3 * 8 + 1) // ".00" or "1.0" gives maximum 3 chars of 8x12 font per cell
#define CELL_TEXT_HEIGHT 22 // 12px for character height of 8x12 font + 10px for padding per cell
#else // COMPACT_GRID_VALUES
#define CELL_TEXT_WIDTH (5 * 8) // "-0.00" gives maximum 5 chars of 8x12 font per cell
#define CELL_TEXT_HEIGHT 14 // 12px for character height of 8x12 font + 14px for padding per cell
#endif // COMPACT_GRID_VALUES
#define _TOTAL_MIN_CELL_WIDTH (CELL_TEXT_WIDTH * GRID_MAX_POINTS_X)
#define _TOTAL_MIN_CELL_HEIGHT (CELL_TEXT_HEIGHT * GRID_MAX_POINTS_Y)
#define _SPACE_TO_SPREAD_HORIZONTAL (OUTLINE_INNER_WIDTH - _TOTAL_MIN_CELL_WIDTH)
#define _SPACE_TO_SPREAD_VERTICAL (OUTLINE_INNER_HEIGHT - _TOTAL_MIN_CELL_HEIGHT)
#if (_SPACE_TO_SPREAD_HORIZONTAL / (GRID_MAX_POINTS_X + GRID_MAX_POINTS_X + 1)) != 0 // allocate space evenly to celss and cell spacing and outer spacing
#define _CELL_GROW_HORIZONTAL (_SPACE_TO_SPREAD_HORIZONTAL / (GRID_MAX_POINTS_X + GRID_MAX_POINTS_X + 1))
#define _CELL_SPACING_HORIZONTAL (_SPACE_TO_SPREAD_HORIZONTAL / (GRID_MAX_POINTS_X + GRID_MAX_POINTS_X + 1))
#elif (_SPACE_TO_SPREAD_HORIZONTAL / (GRID_MAX_POINTS_X + GRID_MAX_POINTS_X - 1)) != 0 // allocate space evenly to celss and cell spacing
#define _CELL_GROW_HORIZONTAL (_SPACE_TO_SPREAD_HORIZONTAL / (GRID_MAX_POINTS_X + GRID_MAX_POINTS_X - 1))
#define _CELL_SPACING_HORIZONTAL (_SPACE_TO_SPREAD_HORIZONTAL / (GRID_MAX_POINTS_X + GRID_MAX_POINTS_X - 1))
#elif (_SPACE_TO_SPREAD_HORIZONTAL / GRID_MAX_POINTS_X) != 0 // allocate space evenly to cells
#define _CELL_GROW_HORIZONTAL (_SPACE_TO_SPREAD_HORIZONTAL / GRID_MAX_POINTS_X)
#define _CELL_SPACING_HORIZONTAL 0
#elif (_SPACE_TO_SPREAD_HORIZONTAL / GRID_MAX_POINTS_X - 1) != 0 // allocate space evenly to cell spacing
#define _CELL_GROW_HORIZONTAL 0
#define _CELL_SPACING_HORIZONTAL (_SPACE_TO_SPREAD_HORIZONTAL / GRID_MAX_POINTS_X - 1)
#else
#define _CELL_GROW_HORIZONTAL 0
#define _CELL_SPACING_HORIZONTAL 0
#endif
#if (_SPACE_TO_SPREAD_VERTICAL / (GRID_MAX_POINTS_Y + GRID_MAX_POINTS_Y + 1)) != 0 // allocate space evenly to celss and cell spacing
#define _CELL_GROW_VERTICAL (_SPACE_TO_SPREAD_VERTICAL / (GRID_MAX_POINTS_Y + GRID_MAX_POINTS_Y + 1))
#define _CELL_SPACING_VERTICAL (_SPACE_TO_SPREAD_VERTICAL / (GRID_MAX_POINTS_Y + GRID_MAX_POINTS_Y + 1))
#elif (_SPACE_TO_SPREAD_VERTICAL / (GRID_MAX_POINTS_Y + GRID_MAX_POINTS_Y - 1)) != 0 // allocate space evenly to celss and cell spacing
#define _CELL_GROW_VERTICAL (_SPACE_TO_SPREAD_VERTICAL / (GRID_MAX_POINTS_Y + GRID_MAX_POINTS_Y - 1))
#define _CELL_SPACING_VERTICAL (_SPACE_TO_SPREAD_VERTICAL / (GRID_MAX_POINTS_Y + GRID_MAX_POINTS_Y - 1))
#elif (_SPACE_TO_SPREAD_VERTICAL / GRID_MAX_POINTS_Y) != 0 // allocate space evenly to cells
#define _CELL_GROW_VERTICAL (_SPACE_TO_SPREAD_VERTICAL / GRID_MAX_POINTS_Y)
#define _CELL_SPACING_VERTICAL 0
#elif (_SPACE_TO_SPREAD_VERTICAL / GRID_MAX_POINTS_Y - 1) != 0 // allocate space evenly to cell spacing
#define _CELL_GROW_VERTICAL 0
#define _CELL_SPACING_VERTICAL (_SPACE_TO_SPREAD_VERTICAL / GRID_MAX_POINTS_Y - 1)
#else
#define _CELL_GROW_VERTICAL 0
#define _CELL_SPACING_VERTICAL 0
#endif
#define CELL_WIDTH (CELL_TEXT_WIDTH + _CELL_GROW_HORIZONTAL)
#define CELL_HEIGHT (CELL_TEXT_HEIGHT + _CELL_GROW_VERTICAL)
#define X_Axis_Interval (CELL_WIDTH + _CELL_SPACING_HORIZONTAL)
#define Y_Axis_Interval (CELL_HEIGHT + _CELL_SPACING_VERTICAL)
#define _CELLS_WITH_SPACING_WIDTH ((GRID_MAX_POINTS_X * CELL_WIDTH) + ((GRID_MAX_POINTS_X - 1) * _CELL_SPACING_HORIZONTAL))
#define _CELLS_WITH_SPACING_HEIGHT ((GRID_MAX_POINTS_Y * CELL_HEIGHT) + ((GRID_MAX_POINTS_Y - 1) * _CELL_SPACING_VERTICAL))
#define _OUTLINE_PADDING_HORIZONTAL ((OUTLINE_INNER_WIDTH - _CELLS_WITH_SPACING_WIDTH) / 2)
#define _OUTLINE_PADDING_VERTICAL ((OUTLINE_INNER_HEIGHT - _CELLS_WITH_SPACING_HEIGHT) / 2)
#define Rect_LU_X_POS (OUTLINE_LEFT_X + _OUTLINE_PADDING_HORIZONTAL) // top-left X of the first (bottom-left) cell
#define Rect_LU_Y_POS (OUTLINE_LEFT_Y + OUTLINE_INNER_HEIGHT - _OUTLINE_PADDING_VERTICAL - CELL_HEIGHT) // top-left Y of the first (bottom-left) cell
#define Rect_RD_X_POS (Rect_LU_X_POS + CELL_WIDTH) // bottom-right X of the first (bottom-left) cell
#define Rect_RD_Y_POS (Rect_LU_Y_POS + CELL_HEIGHT) // bottom-right Y of the first (bottom-left) cell
#define TITLE_X 29 #define TITLE_X 29
#define TITLE_Y 1 #define TITLE_Y 1