Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
MarlinKimbra
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
MarlinKimbra
Commits
0d88052d
Commit
0d88052d
authored
Mar 22, 2016
by
MagoKimbra
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'refs/remotes/origin/master' into dev
parents
928bcfc7
3ecc37ff
Changes
17
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
419 additions
and
199 deletions
+419
-199
changelog.md
Documentation/changelog.md
+1
-0
marlinkimbra_v0_6_9.HMI
MK/Nextion FW/marlinkimbra_v0_6_9.HMI
+0
-0
marlinkimbra_v0_6_9.tft
MK/Nextion FW/marlinkimbra_v0_6_9.tft
+0
-0
dogm_bitmaps.h
MK/module/lcd/dogm_bitmaps.h
+105
-48
dogm_lcd_implementation.h
MK/module/lcd/dogm_lcd_implementation.h
+32
-4
planner.cpp
MK/module/motion/planner.cpp
+1
-1
planner.h
MK/module/motion/planner.h
+1
-1
stepper.cpp
MK/module/motion/stepper.cpp
+28
-12
NexObject.cpp
MK/module/nextion/NexObject.cpp
+0
-1
NexObject.h
MK/module/nextion/NexObject.h
+7
-7
NexPicture.cpp
MK/module/nextion/NexPicture.cpp
+20
-1
NexPicture.h
MK/module/nextion/NexPicture.h
+17
-9
NexText.cpp
MK/module/nextion/NexText.cpp
+20
-0
NexText.h
MK/module/nextion/NexText.h
+15
-7
NexTouch.cpp
MK/module/nextion/NexTouch.cpp
+0
-1
Nextion_lcd.cpp
MK/module/nextion/Nextion_lcd.cpp
+170
-106
Nextion_lcd.h
MK/module/nextion/Nextion_lcd.h
+2
-1
No files found.
Documentation/changelog.md
View file @
0d88052d
### Version 4.2.8
*
Add board folder with files of various board containing the pins
*
Add End time on Graphics display when SD print
*
Rewrite macros
*
Fix M109 so it won't wait for cooling
*
Clear code
...
...
MK/Nextion FW/marlinkimbra_v0_6_
3
.HMI
→
MK/Nextion FW/marlinkimbra_v0_6_
9
.HMI
View file @
0d88052d
No preview for this file type
MK/Nextion FW/marlinkimbra_v0_6_
3
.tft
→
MK/Nextion FW/marlinkimbra_v0_6_
9
.tft
View file @
0d88052d
No preview for this file type
MK/module/lcd/dogm_bitmaps.h
View file @
0d88052d
...
...
@@ -38,6 +38,62 @@
// be displayed.
#if HOTENDS == 1
#ifdef COLOR_MIXING_EXTRUDER
#define STATUS_SCREENWIDTH 115 //Width in pixels
#define STATUS_SCREENHEIGHT 19 //Height in pixels
#define STATUS_SCREENBYTEWIDTH 15 //Width in bytes
const
unsigned
char
status_screen0_bmp
[]
PROGMEM
=
{
0
,
0
,
0
,
0
,
0
,
0
,
16
,
0
,
0
,
0
,
0
,
0
,
127
,
255
,
224
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
112
,
0
,
224
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
99
,
252
,
96
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
67
,
252
,
32
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
64
,
240
,
32
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
64
,
96
,
32
,
31
,
192
,
15
,
224
,
7
,
240
,
3
,
248
,
0
,
0
,
0
,
0
,
88
,
1
,
160
,
249
,
240
,
124
,
120
,
61
,
220
,
30
,
238
,
0
,
65
,
4
,
0
,
92
,
99
,
160
,
246
,
240
,
123
,
248
,
60
,
156
,
31
,
94
,
0
,
32
,
130
,
0
,
94
,
247
,
160
,
246
,
240
,
123
,
248
,
61
,
92
,
31
,
190
,
0
,
32
,
130
,
0
,
94
,
247
,
160
,
49
,
192
,
27
,
224
,
13
,
208
,
7
,
184
,
0
,
65
,
4
,
0
,
92
,
99
,
160
,
54
,
192
,
27
,
224
,
13
,
208
,
7
,
184
,
0
,
130
,
8
,
0
,
88
,
1
,
160
,
246
,
240
,
123
,
248
,
61
,
220
,
31
,
190
,
1
,
4
,
16
,
0
,
64
,
96
,
32
,
241
,
240
,
124
,
120
,
61
,
220
,
31
,
190
,
1
,
4
,
16
,
0
,
64
,
240
,
32
,
255
,
240
,
127
,
248
,
63
,
252
,
31
,
254
,
0
,
130
,
8
,
0
,
65
,
248
,
32
,
31
,
192
,
15
,
224
,
7
,
240
,
3
,
248
,
0
,
65
,
4
,
0
,
97
,
248
,
96
,
15
,
128
,
7
,
192
,
3
,
224
,
1
,
240
,
0
,
0
,
0
,
0
,
112
,
0
,
224
,
7
,
0
,
3
,
128
,
1
,
192
,
0
,
224
,
1
,
255
,
255
,
128
,
127
,
255
,
224
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
255
,
255
,
128
,
0
,
0
,
0
};
#define STATUS_SCREENWIDTH 115 //Width in pixels
#define STATUS_SCREENHEIGHT 19 //Height in pixels
#define STATUS_SCREENBYTEWIDTH 15 //Width in bytes
const
unsigned
char
status_screen1_bmp
[]
PROGMEM
=
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
127
,
255
,
224
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
112
,
0
,
224
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
103
,
14
,
96
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
79
,
15
,
32
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
95
,
15
,
160
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
95
,
15
,
160
,
31
,
192
,
15
,
224
,
7
,
240
,
3
,
248
,
0
,
0
,
0
,
0
,
95
,
15
,
160
,
249
,
240
,
124
,
120
,
61
,
220
,
30
,
238
,
0
,
65
,
4
,
0
,
64
,
240
,
32
,
246
,
240
,
123
,
248
,
60
,
156
,
31
,
94
,
0
,
32
,
130
,
0
,
64
,
240
,
32
,
246
,
240
,
123
,
248
,
61
,
92
,
31
,
190
,
0
,
32
,
130
,
0
,
64
,
240
,
32
,
49
,
192
,
27
,
224
,
13
,
208
,
7
,
184
,
0
,
65
,
4
,
0
,
64
,
240
,
32
,
54
,
192
,
27
,
224
,
13
,
208
,
7
,
184
,
0
,
130
,
8
,
0
,
95
,
15
,
160
,
246
,
240
,
123
,
248
,
61
,
220
,
31
,
190
,
1
,
4
,
16
,
0
,
95
,
15
,
160
,
241
,
240
,
124
,
120
,
61
,
220
,
31
,
190
,
1
,
4
,
16
,
0
,
95
,
15
,
160
,
255
,
240
,
127
,
248
,
63
,
252
,
31
,
254
,
0
,
130
,
8
,
0
,
79
,
15
,
32
,
31
,
192
,
15
,
224
,
7
,
240
,
3
,
248
,
0
,
65
,
4
,
0
,
103
,
14
,
96
,
15
,
128
,
7
,
192
,
3
,
224
,
1
,
240
,
0
,
0
,
0
,
0
,
112
,
0
,
224
,
7
,
0
,
3
,
128
,
1
,
192
,
0
,
224
,
1
,
255
,
255
,
128
,
127
,
255
,
224
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
255
,
255
,
128
,
0
,
0
,
0
};
#else // no COLOR_MIXING_EXTRUDER
#define STATUS_SCREENWIDTH 115 //Width in pixels
#define STATUS_SCREENHEIGHT 19 //Height in pixels
#define STATUS_SCREENBYTEWIDTH 15 //Width in bytes
...
...
@@ -87,6 +143,7 @@
0x1E
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x01
,
0xFF
,
0xFF
,
0x80
,
0x7F
,
0xFF
,
0xE0
,
0x0C
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x01
,
0xFF
,
0xFF
,
0x80
,
0x00
,
0x00
,
0x00
};
#endif // no COLOR_MIXING_EXTRUDER
#elif HOTENDS == 2
#define STATUS_SCREENWIDTH 115 //Width in pixels
#define STATUS_SCREENHEIGHT 19 //Height in pixels
...
...
MK/module/lcd/dogm_lcd_implementation.h
View file @
0d88052d
...
...
@@ -308,28 +308,56 @@ static void lcd_implementation_status_screen() {
u8g
.
drawBox
(
55
,
50
,
(
unsigned
int
)(
71
.
f
*
card
.
percentDone
()
/
100
.
f
),
2
-
TALL_FONT_CORRECTION
);
}
u8g
.
setPrintPos
(
80
,
48
);
u8g
.
setPrintPos
(
53
,
47
);
if
(
print_job_start_ms
!=
0
)
{
#if HAS(LCD_POWER_SENSOR)
if
(
millis
()
<
print_millis
+
1000
)
{
uint16_t
time
=
(
millis
()
-
print_job_start_ms
)
/
60000
;
uint16_t
end_time
=
(
time
*
(
100
-
card
.
percentDone
()))
/
card
.
percentDone
();
lcd_print
(
'S'
);
lcd_print
(
itostr2
(
time
/
60
));
lcd_print
(
':'
);
lcd_print
(
itostr2
(
time
%
60
));
u8g
.
setPrintPos
(
90
,
47
);
if
(
end_time
>
1380
||
end_time
==
0
)
u8g
.
print
(
'
E
--:--
'
);
else
if
(
end_time
>
0
)
{
u8g
.
print
(
'E'
);
u8g
.
print
(
itostr2
(
end_time
/
60
));
u8g
.
print
(
':'
);
u8g
.
print
(
itostr2
(
end_time
%
60
));
}
}
else
{
lcd_print
(
itostr4
(
power_consumption_hour
-
startpower
));
lcd_print
(
itostr4
(
power_consumption_hour
-
startpower
));
lcd_print
((
char
*
)
"Wh"
);
}
#else
uint16_t
time
=
(
millis
()
-
print_job_start_ms
)
/
60000
;
uint16_t
end_time
=
(
time
*
(
100
-
card
.
percentDone
()))
/
card
.
percentDone
();
lcd_print
(
'S'
);
lcd_print
(
itostr2
(
time
/
60
));
lcd_print
(
':'
);
lcd_print
(
itostr2
(
time
%
60
));
lcd_print
(
itostr2
(
time
%
60
));
u8g
.
setPrintPos
(
90
,
47
);
if
(
end_time
>
(
60
*
23
))
u8g
.
print
(
'
E
--:--
'
);
else
if
(
end_time
>=
0
)
{
u8g
.
print
(
'E'
);
u8g
.
print
(
itostr2
(
end_time
/
60
));
u8g
.
print
(
':'
);
u8g
.
print
(
itostr2
(
end_time
%
60
));
}
#endif
}
else
{
lcd_printPGM
(
PSTR
(
"--:--"
));
lcd_printPGM
(
PSTR
(
"S--:--"
));
u8g
.
setPrintPos
(
90
,
47
);
lcd_printPGM
(
PSTR
(
"E--:--"
));
}
#endif
...
...
MK/module/motion/planner.cpp
View file @
0d88052d
...
...
@@ -614,7 +614,7 @@ float junction_deviation = 0.1;
// For a mixing extruder, get steps for each
#if ENABLED(COLOR_MIXING_EXTRUDER)
for
(
uint8_t
i
=
0
;
i
<
DRIVER_EXTRUDERS
;
i
++
)
block
->
mix_
steps
[
i
]
=
block
->
steps
[
E_AXIS
]
*
mixing_factor
[
i
];
block
->
mix_
event_count
[
i
]
=
block
->
step_event_count
/
mixing_factor
[
i
];
#endif
// Add update block variables for LASER BEAM control
...
...
MK/module/motion/planner.h
View file @
0d88052d
...
...
@@ -31,7 +31,7 @@ typedef struct {
long
steps
[
NUM_AXIS
];
// Step count along each axis
#if ENABLED(COLOR_MIXING_EXTRUDER)
float
mix_steps
[
DRIVER_EXTRUDERS
];
// Step count for each stepper in a mixing extruder
unsigned
long
mix_event_count
[
DRIVER_EXTRUDERS
];
// Step count for each stepper in a mixing extruder
#endif
unsigned
long
step_event_count
;
// The number of step events required to complete this block
...
...
MK/module/motion/stepper.cpp
View file @
0d88052d
...
...
@@ -658,7 +658,8 @@ ISR(TIMER1_COMPA_vect) {
counter_x
=
counter_y
=
counter_z
=
counter_e
=
new_count
;
#if ENABLED(COLOR_MIXING_EXTRUDER)
for
(
int8_t
i
=
0
;
i
<
DRIVER_EXTRUDERS
;
i
++
)
counter_m
[
i
]
=
new_count
;
for
(
uint8_t
i
=
0
;
i
<
DRIVER_EXTRUDERS
;
i
++
)
counter_m
[
i
]
=
-
(
current_block
->
mix_event_count
[
i
]
>>
1
);
#endif
step_events_completed
=
0
;
...
...
@@ -703,9 +704,9 @@ ISR(TIMER1_COMPA_vect) {
#if ENABLED(COLOR_MIXING_EXTRUDER)
long
dir
=
TEST
(
out_bits
,
E_AXIS
)
?
-
1
:
1
;
for
(
uint8_t
j
=
0
;
j
<
DRIVER_EXTRUDERS
;
j
++
)
{
counter_m
[
j
]
+=
current_block
->
mix_steps
[
j
];
counter_m
[
j
]
+=
current_block
->
steps
[
E_AXIS
];
if
(
counter_m
[
j
]
>
0
)
{
counter_m
[
j
]
-=
current_block
->
step_event_count
;
counter_m
[
j
]
-=
current_block
->
mix_event_count
[
j
]
;
e_steps
[
j
]
+=
dir
;
}
}
...
...
@@ -726,14 +727,10 @@ ISR(TIMER1_COMPA_vect) {
#if DISABLED(ADVANCE)
#if ENABLED(COLOR_MIXING_EXTRUDER)
counter_e
+=
current_block
->
steps
[
E_AXIS
];
if
(
counter_e
>
0
)
{
for
(
uint8_t
j
=
0
;
j
<
DRIVER_EXTRUDERS
;
j
++
)
{
counter_m
[
j
]
+=
current_block
->
mix_steps
[
j
];
counter_m
[
j
]
+=
current_block
->
steps
[
E_AXIS
];
if
(
counter_m
[
j
]
>
0
)
En_STEP_WRITE
(
j
,
!
INVERT_E_STEP_PIN
);
}
counter_e
-=
current_block
->
step_event_count
;
count_position
[
E_AXIS
]
+=
count_direction
[
E_AXIS
];
}
#else
STEP_START
(
e
,
E
);
#endif
...
...
@@ -755,6 +752,11 @@ ISR(TIMER1_COMPA_vect) {
STEP_END
(
z
,
Z
);
#if DISABLED(ADVANCE)
#if ENABLED(COLOR_MIXING_EXTRUDER)
// Always count the single E axis
if
(
counter_e
>
0
)
{
counter_e
-=
current_block
->
step_event_count
;
count_position
[
E_AXIS
]
+=
count_direction
[
E_AXIS
];
}
for
(
uint8_t
j
=
0
;
j
<
DRIVER_EXTRUDERS
;
j
++
)
{
if
(
counter_m
[
j
]
>
0
)
{
counter_m
[
j
]
-=
current_block
->
step_event_count
;
...
...
@@ -791,7 +793,14 @@ ISR(TIMER1_COMPA_vect) {
//NOLESS(advance, current_block->advance);
// Do E steps + advance steps
#if ENABLED(COLOR_MIXING_EXTRUDER)
// Move mixing steppers proportionally
for
(
uint8_t
j
=
0
;
j
<
DRIVER_EXTRUDERS
;
j
++
)
e_steps
[
j
]
+=
((
advance
>>
8
)
-
old_advance
)
*
current_block
->
step_event_count
/
current_block
->
mix_event_count
[
j
];
#else
e_steps
[
current_block
->
active_driver
]
+=
((
advance
>>
8
)
-
old_advance
);
#endif
old_advance
=
advance
>>
8
;
#endif // ADVANCE
...
...
@@ -819,7 +828,14 @@ ISR(TIMER1_COMPA_vect) {
// Do E steps + advance steps
uint32_t
advance_whole
=
advance
>>
8
;
#if ENABLED(MIXING_EXTRUDER_FEATURE)
for
(
uint8_t
j
=
0
;
j
<
DRIVER_EXTRUDERS
;
j
++
)
e_steps
[
current_block
->
active_driver
]
+=
(
advance_whole
-
old_advance
)
*
current_block
->
mix_factor
[
j
];
#else
e_steps
[
current_block
->
active_driver
]
+=
advance_whole
-
old_advance
;
#endif
old_advance
=
advance_whole
;
#endif //ADVANCE
}
...
...
MK/module/nextion/NexObject.cpp
View file @
0d88052d
...
...
@@ -55,4 +55,3 @@ void NexObject::printObjInfo(void)
}
dbSerialPrintln
(
"]"
);
}
MK/module/nextion/NexObject.h
View file @
0d88052d
MK/module/nextion/NexPicture.cpp
View file @
0d88052d
...
...
@@ -43,3 +43,22 @@ bool NexPicture::setPic(uint32_t number)
return
recvRetCommandFinished
();
}
bool
NexPicture
::
setHide
()
{
String
cmd
;
cmd
+=
"vis "
;
cmd
+=
getObjName
();
cmd
+=
",0"
;
sendCommand
(
cmd
.
c_str
());
return
recvRetCommandFinished
();
}
bool
NexPicture
::
setShow
()
{
String
cmd
;
cmd
+=
"vis "
;
cmd
+=
getObjName
();
cmd
+=
",1"
;
sendCommand
(
cmd
.
c_str
());
return
recvRetCommandFinished
();
}
MK/module/nextion/NexPicture.h
View file @
0d88052d
...
...
@@ -54,6 +54,14 @@ public: /* methods */
* @retval false - failed.
*/
bool
setPic
(
uint32_t
number
);
/**
* Set Hide / Show component
*
* @return true if success, false for failure.
*/
bool
setHide
();
bool
setShow
();
};
/**
...
...
MK/module/nextion/NexText.cpp
View file @
0d88052d
...
...
@@ -53,3 +53,23 @@ bool NexText::setColor(uint32_t value)
sendCommand
(
cmd
.
c_str
());
return
recvRetCommandFinished
();
}
bool
NexText
::
setHide
()
{
String
cmd
;
cmd
+=
"vis "
;
cmd
+=
getObjName
();
cmd
+=
",0"
;
sendCommand
(
cmd
.
c_str
());
return
recvRetCommandFinished
();
}
bool
NexText
::
setShow
()
{
String
cmd
;
cmd
+=
"vis "
;
cmd
+=
getObjName
();
cmd
+=
",1"
;
sendCommand
(
cmd
.
c_str
());
return
recvRetCommandFinished
();
}
MK/module/nextion/NexText.h
View file @
0d88052d
...
...
@@ -52,6 +52,14 @@ public: /* methods */
*/
bool
setText
(
const
char
*
buffer
);
bool
setColor
(
uint32_t
value
);
/**
* Set Hide / Show component
*
* @return true if success, false for failure.
*/
bool
setHide
();
bool
setShow
();
};
/**
...
...
MK/module/nextion/NexTouch.cpp
View file @
0d88052d
...
...
@@ -92,4 +92,3 @@ void NexTouch::iterate(NexTouch **list, uint8_t pid, uint8_t cid, int32_t event)
}
}
}
MK/module/nextion/Nextion_lcd.cpp
View file @
0d88052d
...
...
@@ -7,13 +7,17 @@
#include "Nextion.h"
bool
NextionON
=
false
;
bool
PageInfo
=
false
;
uint8_t
NextionPage
=
0
;
char
buffer
[
100
]
=
{
0
};
uint32_t
slidermaxval
=
20
;
char
lcd_status_message
[
30
]
=
WELCOME_MSG
;
uint8_t
lcd_status_message_level
=
0
;
static
millis_t
next_lcd_update_ms
;
#if ENABLED(SDSUPPORT)
uint8_t
SDstatus
=
0
;
// 0 SD not insert, 1 SD insert, 2 SD printing
#endif
#if ENABLED(NEXTION_GFX)
GFX
gfx
=
GFX
(
200
,
190
);
#endif
...
...
@@ -26,6 +30,7 @@
NexPage
Psdcard
=
NexPage
(
4
,
0
,
"sdcard"
);
NexPage
Psetup
=
NexPage
(
5
,
0
,
"setup"
);
NexPage
Pmove
=
NexPage
(
6
,
0
,
"move"
);
NexPage
Pfeed
=
NexPage
(
7
,
0
,
"feed"
);
// Page 0 Start
NexTimer
startimer
=
NexTimer
(
0
,
1
,
"tm0"
);
...
...
@@ -35,10 +40,10 @@
NexText
Hotend1
=
NexText
(
1
,
4
,
"t1"
);
NexText
Hotend21
=
NexText
(
1
,
5
,
"h2"
);
NexText
Hotend2
=
NexText
(
1
,
6
,
"t2"
);
NexText
LedStatus
=
NexText
(
1
,
7
,
"
t4
"
);
NexText
LedCoord
=
NexText
(
1
,
8
,
"t5
"
);
NexText
LedStatus
=
NexText
(
1
,
7
,
"
status
"
);
NexText
LedCoord
1
=
NexText
(
1
,
8
,
"icoord
"
);
NexPicture
Menu
=
NexPicture
(
1
,
9
,
"p0"
);
NexPicture
MSD
=
NexPicture
(
1
,
10
,
"p1"
);
NexPicture
MSD
1
=
NexPicture
(
1
,
10
,
"p1"
);
NexPicture
MSetup
=
NexPicture
(
1
,
11
,
"p2"
);
NexPicture
Hend0
=
NexPicture
(
1
,
12
,
"p3"
);
NexHotspot
hot0
=
NexHotspot
(
1
,
13
,
"hot0"
);
...
...
@@ -49,10 +54,14 @@
NexPicture
Fanpic
=
NexPicture
(
1
,
18
,
"p6"
);
NexVar
Hotend
=
NexVar
(
1
,
19
,
"he"
);
NexVar
Bed
=
NexVar
(
1
,
20
,
"bed"
);
NexVar
Fan
=
NexVar
(
1
,
21
,
"fn"
);
NexTimer
fantimer
=
NexTimer
(
1
,
22
,
"tm0"
);
NexProgressBar
sdbar
=
NexProgressBar
(
1
,
23
,
"j0"
);
NexPicture
NPlay
=
NexPicture
(
1
,
24
,
"p7"
);
NexPicture
NStop
=
NexPicture
(
1
,
25
,
"p8"
);
NexVar
SD
=
NexVar
(
1
,
26
,
"sd"
);
NexVar
RFID
=
NexVar
(
1
,
27
,
"rfid"
);
NexPicture
Feedpic
=
NexPicture
(
1
,
18
,
"p9"
);
// Page 2 Temp
NexText
set0
=
NexText
(
2
,
2
,
"set0"
);
...
...
@@ -62,6 +71,7 @@
NexVar
set1
=
NexVar
(
2
,
17
,
"set1"
);
// Page 3 Menu
NexPicture
MSD3
=
NexPicture
(
3
,
2
,
"p1"
);
NexPicture
Exit1
=
NexPicture
(
3
,
4
,
"p3"
);
// Page 4 SDCard
...
...
@@ -85,9 +95,11 @@
NexHotspot
ScrollDown
=
NexHotspot
(
4
,
22
,
"m1"
);
// Page 5 Setup
NexPicture
MSD5
=
NexPicture
(
5
,
2
,
"p1"
);
NexPicture
Exit3
=
NexPicture
(
5
,
4
,
"p3"
);
// Page 6 Move
NexPicture
MSD6
=
NexPicture
(
6
,
2
,
"p1"
);
NexPicture
XYHome
=
NexPicture
(
6
,
5
,
"p4"
);
NexPicture
XYUp
=
NexPicture
(
6
,
6
,
"p5"
);
NexPicture
XYRight
=
NexPicture
(
6
,
7
,
"p6"
);
...
...
@@ -97,14 +109,23 @@
NexPicture
ZUp
=
NexPicture
(
6
,
11
,
"p10"
);
NexPicture
ZDown
=
NexPicture
(
6
,
12
,
"p11"
);
NexVar
movecmd
=
NexVar
(
6
,
18
,
"vacmd"
);
NexText
LedCoord6
=
NexText
(
6
,
19
,
"mcoord"
);
// Page 7 Feed
NexVar
Feedrate
=
NexVar
(
7
,
1
,
"feedrate"
);
NexPicture
Feedok
=
NexPicture
(
7
,
3
,
"p0"
);
NexTouch
*
nex_listen_list
[]
=
{
&
Pstart
,
&
Menu
,
&
MSD
,
&
MSD1
,
&
MSD3
,
&
MSD5
,
&
MSD6
,
&
MSetup
,
&
Fanpic
,
&
Feedpic
,
&
NPlay
,
&
NStop
,
&
hot0
,
...
...
@@ -134,6 +155,7 @@
&
ZHome
,
&
ZUp
,
&
ZDown
,
&
Feedok
,
NULL
};
...
...
@@ -168,45 +190,53 @@
};
void
setpageInfo
()
{
if
(
NextionPage
==
0
)
{
Pinfo
.
show
();
PageInfo
=
true
;
#if ENABLED(NEXTION_GFX)
#if MECH(DELTA)
gfx_clear
((
X_MAX_POS
)
*
2
,
(
Y_MAX_POS
)
*
2
,
Z_MAX_POS
);
#else
gfx_clear
(
X_MAX_POS
,
Y_MAX_POS
,
Z_MAX_POS
);
#endif
#endif
#if HAS_TEMP_0
#if HAS(TEMP_0)
Hotend
.
setValue
(
1
);
#endif
#if HAS_TEMP_1
#if HAS(TEMP_1)
Hotend
.
setValue
(
2
);
#endif
#if HAS_TEMP_2
#if HAS(TEMP_2)
Hotend
.
setValue
(
3
);
#elif HAS_TEMP_BED
Hotend21
.
setText
(
"BED"
);
#elif HAS(TEMP_BED)
Bed
.
setValue
(
1
);
Hotend21
.
setText
(
"BED"
);
#endif
Feedrate
.
setValue
(
100
);
#if HAS(FAN)
Fan
.
setValue
(
1
);
#endif
lcd_setstatus
(
lcd_status_message
);
}
Pinfo
.
show
();
NextionPage
=
1
;
#if ENABLED(NEXTION_GFX)
#if MECH(DELTA)
gfx_clear
((
X_MAX_POS
)
*
2
,
(
Y_MAX_POS
)
*
2
,
Z_MAX_POS
);
#else
gfx_clear
(
X_MAX_POS
,
Y_MAX_POS
,
Z_MAX_POS
);
#endif
#endif
}
#if ENABLED(SDSUPPORT)
void
printrowsd
(
uint8_t
row
,
const
bool
folder
,
const
char
*
filename
)
{
if
(
folder
)
{
folder_list
[
row
]
->
set
Pic
(
18
);
folder_list
[
row
]
->
set
Show
(
);
row_list
[
row
]
->
attachPop
(
sdfolderPopCallback
,
row_list
[
row
]);
}
else
if
(
filename
==
""
)
{
folder_list
[
row
]
->
set
Pic
(
17
);
folder_list
[
row
]
->
set
Hide
(
);
row_list
[
row
]
->
detachPop
();
}
else
{
folder_list
[
row
]
->
set
Pic
(
17
);
folder_list
[
row
]
->
set
Hide
(
);
row_list
[
row
]
->
attachPop
(
sdfilePopCallback
,
row_list
[
row
]);
}
row_list
[
row
]
->
setText
(
filename
);
...
...
@@ -218,12 +248,12 @@
card
.
getWorkDirName
();
if
(
fullName
[
0
]
!=
'/'
)
{
Folderup
.
set
Pic
(
20
);
Folderup
.
set
Show
(
);
Folderup
.
attachPop
(
sdfolderUpPopCallback
);
sdfolder
.
setText
(
fullName
);
}
else
{
Folderup
.
detachPop
();
Folderup
.
set
Pic
(
19
);
Folderup
.
set
Hide
(
);
sdfolder
.
setText
(
""
);
}
...
...
@@ -239,8 +269,23 @@
sendCommand
(
"ref 0"
);
}
static
void
setpagesdcard
()
{
PageInfo
=
false
;
static
void
menu_action_sdfile
(
const
char
*
filename
)
{
char
cmd
[
30
];
char
*
c
;
sprintf_P
(
cmd
,
PSTR
(
"M23 %s"
),
filename
);
for
(
c
=
&
cmd
[
4
];
*
c
;
c
++
)
*
c
=
tolower
(
*
c
);
enqueuecommand
(
cmd
);
enqueuecommands_P
(
PSTR
(
"M24"
));
setpageInfo
();
}
static
void
menu_action_sddirectory
(
const
char
*
filename
)
{
card
.
chdir
(
filename
);
setpageSDPopCallback
(
&
MSD1
);
}
void
setpageSDPopCallback
(
void
*
ptr
)
{
NextionPage
=
4
;
Psdcard
.
show
();
uint16_t
fileCnt
=
card
.
getnrfilenames
();
...
...
@@ -267,21 +312,6 @@
setrowsdcard
(
number
);
}
static
void
menu_action_sdfile
(
const
char
*
filename
)
{
char
cmd
[
30
];
char
*
c
;
sprintf_P
(
cmd
,
PSTR
(
"M23 %s"
),
filename
);
for
(
c
=
&
cmd
[
4
];
*
c
;
c
++
)
*
c
=
tolower
(
*
c
);
enqueuecommand
(
cmd
);
enqueuecommands_P
(
PSTR
(
"M24"
));
setpageInfo
();
}
static
void
menu_action_sddirectory
(
const
char
*
filename
)
{
card
.
chdir
(
filename
);
setpagesdcard
();
}
void
sdfilePopCallback
(
void
*
ptr
)
{
memset
(
buffer
,
0
,
sizeof
(
buffer
));
...
...
@@ -322,9 +352,8 @@
void
sdfolderUpPopCallback
(
void
*
ptr
)
{
card
.
updir
();
setpage
sdcard
(
);
setpage
SDPopCallback
(
&
MSD1
);
}
#endif
void
ExitPopCallback
(
void
*
ptr
)
{
...
...
@@ -337,7 +366,7 @@
void
hotPopCallback
(
void
*
ptr
)
{
Ptemp
.
show
();
PageInfo
=
false
;
NextionPage
=
2
;
memset
(
buffer
,
0
,
sizeof
(
buffer
));
if
(
ptr
==
&
hot0
)
{
if
(
degTargetHotend
(
0
)
!=
0
)
{
...
...
@@ -397,18 +426,17 @@
void
setpagePopCallback
(
void
*
ptr
)
{
if
(
ptr
==
&
Menu
)
{
PageInfo
=
false
;
NextionPage
=
3
;
Pmenu
.
show
();
}
else
if
(
ptr
==
&
MSetup
)
{
PageInfo
=
false
;
NextionPage
=
5
;
Psetup
.
show
();
}
#if ENABLED(SDSUPPORT)
else
if
(
ptr
==
&
MSD
)
setpagesdcard
();
#endif
else
if
(
ptr
==
&
Feedpic
)
{
NextionPage
=
7
;
Pfeed
.
show
();
}
}
void
setfanPopCallback
(
void
*
ptr
)
{
...
...
@@ -422,12 +450,13 @@
enqueuecommands_P
(
PSTR
(
"G91"
));
enqueuecommands_P
(
buffer
);
enqueuecommands_P
(
PSTR
(
"G90"
));
NextionPage
=
6
;
}
#if ENABLED(SDSUPPORT)
void
PlayPausePopCallback
(
void
*
ptr
)
{
if
(
card
.
cardOK
&&
card
.
isFileOpen
())
{
if
(
card
.
sdprinting
)
if
(
IS_SD_PRINTING
)
card
.
pausePrint
();
else
card
.
startPrint
();
...
...
@@ -443,6 +472,8 @@
#endif
void
lcd_init
()
{
HAL
::
delayMilliseconds
(
2000
);
for
(
uint8_t
i
=
0
;
i
<
10
;
i
++
)
{
NextionON
=
nexInit
();
if
(
NextionON
)
break
;
...
...
@@ -468,7 +499,10 @@
#endif
#if ENABLED(SDSUPPORT)
MSD
.
attachPop
(
setpagePopCallback
,
&
MSD
);
MSD1
.
attachPop
(
setpageSDPopCallback
);
MSD3
.
attachPop
(
setpageSDPopCallback
);
MSD5
.
attachPop
(
setpageSDPopCallback
);
MSD6
.
attachPop
(
setpageSDPopCallback
);
sdlist
.
attachPop
(
sdlistPopCallback
);
ScrollUp
.
attachPop
(
sdlistPopCallback
);
ScrollDown
.
attachPop
(
sdlistPopCallback
);
...
...
@@ -489,6 +523,7 @@
Menu
.
attachPop
(
setpagePopCallback
,
&
Menu
);
MSetup
.
attachPop
(
setpagePopCallback
,
&
MSetup
);
Feedpic
.
attachPop
(
setpagePopCallback
,
&
Feedpic
);
Fanpic
.
attachPop
(
setfanPopCallback
,
&
Fanpic
);
m11
.
attachPop
(
sethotPopCallback
,
&
m11
);
tup
.
attachPop
(
settempPopCallback
,
&
tup
);
...
...
@@ -501,6 +536,7 @@
ZHome
.
attachPop
(
setmovePopCallback
);
ZUp
.
attachPop
(
setmovePopCallback
);
ZDown
.
attachPop
(
setmovePopCallback
);
Feedok
.
attachPop
(
ExitPopCallback
);
startimer
.
enable
();
}
...
...
@@ -548,7 +584,7 @@
else
strcat
(
buffer
,
"---"
);
strcat
(
buffer
,
TEST
(
axis_known_position
,
Z_AXIS
)
||
!
TEST
(
axis_was_homed
,
Z_AXIS
)
?
PSTR
(
"Z "
)
:
PSTR
(
"? "
));
strcat
(
buffer
,
TEST
(
axis_known_position
,
Z_AXIS
)
||
!
TEST
(
axis_was_homed
,
Z_AXIS
)
?
PSTR
(
"
Z "
)
:
PSTR
(
"? "
));
if
(
TEST
(
axis_was_homed
,
Z_AXIS
))
{
valuetemp
=
ftostr32sp
(
current_position
[
Z_AXIS
]
+
0.00001
);
strcat
(
buffer
,
valuetemp
);
...
...
@@ -556,7 +592,8 @@
else
strcat
(
buffer
,
"---"
);
LedCoord
.
setText
(
buffer
);
LedCoord1
.
setText
(
buffer
);
LedCoord6
.
setText
(
buffer
);
}
void
lcd_update
()
{
...
...
@@ -567,51 +604,78 @@
millis_t
ms
=
millis
();
if
(
ms
>
next_lcd_update_ms
&&
PageInfo
)
{
if
(
ms
>
next_lcd_update_ms
)
{
if
(
NextionPage
==
1
)
{
if
(
fanSpeed
>
0
)
fantimer
.
enable
();
else
fantimer
.
disable
();
#if HAS_TEMP_0
uint32_t
*
temp_feedrate
;
Feedrate
.
getValue
(
temp_feedrate
);
feedrate_multiplier
=
(
int
)
temp_feedrate
;
#if HAS(TEMP_0)
temptoLCD
(
0
,
degHotend
(
0
),
degTargetHotend
(
0
));
#endif
#if HAS_TEMP_1
#if HAS(TEMP_1)
temptoLCD
(
1
,
degHotend
(
1
),
degTargetHotend
(
1
));
#endif
#if HAS_TEMP_2
#if HAS(TEMP_2)
temptoLCD
(
2
,
degHotend
(
2
),
degTargetHotend
(
2
));
#elif HAS_TEMP_BED
#elif HAS(TEMP_BED)
temptoLCD
(
2
,
degBed
(),
degTargetBed
());
#endif
coordtoLCD
();
#if ENABLED(SDSUPPORT)
if
(
card
.
cardOK
)
{
MSD
.
setPic
(
7
);
NPlay
.
setPic
(
38
);
NStop
.
setPic
(
41
);
}
else
{
MSD
.
setPic
(
6
);
NPlay
.
setPic
(
39
);
NStop
.
setPic
(
42
);
}
if
(
card
.
isFileOpen
())
{
if
(
card
.
sdprinting
)
{
if
(
SDstatus
!=
2
)
{
SDstatus
=
2
;
SD
.
setValue
(
2
);
NPlay
.
setShow
();
NStop
.
setShow
();
}
if
(
IS_SD_PRINTING
)
{
// Progress bar solid part
sdbar
.
setValue
(
card
.
percentDone
());
NPlay
.
setPic
(
40
);
NPlay
.
setPic
(
15
);
// Estimate End Time
uint16_t
time
=
(
millis
()
-
print_job_start_ms
)
/
60000
;
uint16_t
end_time
=
(
time
*
(
100
-
card
.
percentDone
()))
/
card
.
percentDone
();
if
(
end_time
>
(
60
*
23
))
{
lcd_setstatus
(
"End --:--"
);
}
else
if
(
end_time
>=
0
)
{
char
temp
[
30
];
sprintf_P
(
temp
,
PSTR
(
"End %i:%i"
),
end_time
/
60
,
end_time
%
60
);
lcd_setstatus
(
temp
);
}
}
else
{
NPlay
.
setPic
(
38
);
NPlay
.
setPic
(
14
);
}
}
else
if
(
card
.
cardOK
&&
SDstatus
!=
1
)
{
SDstatus
=
1
;
SD
.
setValue
(
1
);
MSD1
.
setShow
();
NPlay
.
setHide
();
NStop
.
setHide
();
}
else
if
(
!
card
.
cardOK
&&
SDstatus
!=
0
)
{
SDstatus
=
0
;
SD
.
setValue
(
0
);
MSD1
.
setHide
();
NPlay
.
setHide
();
NStop
.
setHide
();
}
#endif
}
else
if
(
NextionPage
==
6
)
{
coordtoLCD
();
}
next_lcd_update_ms
=
ms
+
LCD_UPDATE_INTERVAL
;
}
}
...
...
@@ -638,17 +702,17 @@
#if ENABLED(NEXTION_GFX)
void
gfx_clear
(
float
x
,
float
y
,
float
z
)
{
if
(
PageInfo
&&
(
Printing
||
IS_SD_PRINTING
))
if
(
(
NextionPage
==
1
)
&&
(
Printing
||
IS_SD_PRINTING
))
gfx
.
clear
(
x
,
y
,
z
);
}
void
gfx_cursor_to
(
float
x
,
float
y
,
float
z
)
{
if
(
PageInfo
&&
(
Printing
||
IS_SD_PRINTING
))
if
(
(
NextionPage
==
1
)
&&
(
Printing
||
IS_SD_PRINTING
))
gfx
.
cursor_to
(
x
,
y
,
z
);
}
void
gfx_line_to
(
float
x
,
float
y
,
float
z
){
if
(
PageInfo
&&
(
Printing
||
IS_SD_PRINTING
))
if
(
(
NextionPage
==
1
)
&&
(
Printing
||
IS_SD_PRINTING
))
gfx
.
line_to
(
VC_TOOL
,
x
,
y
,
z
);
}
#endif
...
...
MK/module/nextion/Nextion_lcd.h
View file @
0d88052d
...
...
@@ -2,7 +2,7 @@
#define NEXTIONLCD_H
#if ENABLED(NEXTION)
#define LCD_UPDATE_INTERVAL
5
000
#define LCD_UPDATE_INTERVAL
4
000
void
ExitPopCallback
(
void
*
ptr
);
void
setpagePopCallback
(
void
*
ptr
);
...
...
@@ -25,6 +25,7 @@
#endif
#if ENABLED(SDSUPPORT)
void
setpageSDPopCallback
(
void
*
ptr
);
void
sdlistPopCallback
(
void
*
ptr
);
void
sdfilePopCallback
(
void
*
ptr
);
void
sdfolderPopCallback
(
void
*
ptr
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment