grblHAL core  20241107
report.h
Go to the documentation of this file.
1 /*
2  report.h - reporting and messaging methods
3 
4  Part of grblHAL
5 
6  Copyright (c) 2018-2024 Terje Io
7  Copyright (c) 2012-2016 Sungeun K. Jeon for Gnea Research LLC
8 
9  Grbl is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  Grbl is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with Grbl. If not, see <http://www.gnu.org/licenses/>.
21 */
22 
23 #ifndef _REPORT_H_
24 #define _REPORT_H_
25 
26 #include "system.h"
27 #include "ngc_params.h"
28 
29 typedef enum {
35 
36 // Initialize reporting subsystem
37 void report_init (void);
38 void report_init_fns (void);
39 
40 // Prints feedback message, typically from gcode.
41 void report_message (const char *msg, message_type_t type);
42 
43 // Message helper to be run as foreground task.
44 void report_plain (void *message);
45 
46 // Message helper to be run as foreground task.
47 void report_info (void *message);
48 
49 // Message helper to be run as foreground task.
50 void report_warning (void *message);
51 
52 // Prints Grbl help.
53 status_code_t report_help (char *args);
54 
55 void report_plugin (const char *name, const char *version);
56 
57 // Prints Grbl settings
58 void report_grbl_settings (bool all, void *data);
59 
60 // Prints Grbl setting
61 status_code_t report_grbl_setting (setting_id_t id, void *data);
62 
63 // Prints an echo of the pre-parsed line received right before execution.
64 void report_echo_line_received (char *line);
65 
66 // Prints realtime status report.
67 void report_realtime_status (void);
68 
69 // Prints recorded probe position.
70 void report_probe_parameters (void);
71 
72 // Prints current tool offsets.
73 void report_tool_offsets (void);
74 
75 #if NGC_PARAMETERS_ENABLE
76 
77 // Prints NIST/LinuxCNC NGC parameter value
78 status_code_t report_ngc_parameter (ngc_param_id_t id);
79 
80 // Prints named LinuxCNC NGC parameter value
81 status_code_t report_named_ngc_parameter (char *arg);
82 
83 #endif
84 
85 // Prints Grbl NGC parameters (coordinate offsets, probe).
86 void report_ngc_parameters (void);
87 
88 // Prints current g-code parser mode state.
89 void report_gcode_modes (void);
90 
91 // Prints startup line when requested and executed.
92 void report_startup_line (uint8_t n, char *line);
93 void report_execute_startup_message (char *line, status_code_t status_code);
94 
95 // Prints build info and user info.
96 void report_build_info (char *line, bool extended);
97 
98 status_code_t report_alarm_details (bool grbl_format);
99 status_code_t report_error_details (bool grbl_format);
100 status_code_t report_setting_group_details (bool by_id, char *prefix);
101 status_code_t report_settings_details (settings_format_t format, setting_id_t setting, setting_group_t group);
102 #ifndef NO_SETTINGS_DESCRIPTIONS
104 #endif
105 
106 status_code_t report_last_signals_event (sys_state_t state, char *args);
107 status_code_t report_current_limit_state (sys_state_t state, char *args);
108 status_code_t report_current_home_signal_state (sys_state_t state, char *args);
109 
110 // Prints spindle data (encoder pulse and index count, angular position).
111 status_code_t report_spindle_data (sys_state_t state, char *args);
112 
113 // Prints pin assignments.
114 status_code_t report_pins (sys_state_t state, char *args);
115 
116 status_code_t report_pin_states (sys_state_t state, char *args);
117 
118 // Prints registered spindles.
119 status_code_t report_spindles (bool machine_readable);
120 
121 // Prints current RTC datetime in ISO8601 format (when available)
122 status_code_t report_time (void);
123 
124 // Prints current PID log.
125 void report_pid_log (void);
126 
127 #endif
message_type_t
Definition: messages.h:53
uint16_t ngc_param_id_t
Definition: ngc_params.h:39
settings_format_t
Definition: report.h:29
@ SettingsFormat_MachineReadable
Definition: report.h:30
@ SettingsFormat_HumanReadable
Definition: report.h:31
@ SettingsFormat_Grbl
Definition: report.h:32
@ SettingsFormat_grblHAL
Definition: report.h:33
void report_plain(void *message)
Definition: report.c:291
void report_ngc_parameters(void)
Definition: report.c:606
void report_execute_startup_message(char *line, status_code_t status_code)
Definition: report.c:830
status_code_t report_spindles(bool machine_readable)
Definition: report.c:2574
void report_init(void)
Definition: report.c:215
status_code_t report_last_signals_event(sys_state_t state, char *args)
Definition: report.c:2161
void report_grbl_settings(bool all, void *data)
Definition: report.c:478
status_code_t report_pin_states(sys_state_t state, char *args)
Definition: report.c:2370
status_code_t report_error_details(bool grbl_format)
Definition: report.c:2031
void report_tool_offsets(void)
Definition: report.c:556
void report_echo_line_received(char *line)
Definition: report.c:1116
void report_gcode_modes(void)
Definition: report.c:699
void report_plugin(const char *name, const char *version)
Definition: report.c:344
void report_probe_parameters(void)
Definition: report.c:533
status_code_t report_current_home_signal_state(sys_state_t state, char *args)
Definition: report.c:2191
void report_init_fns(void)
Definition: report.c:2642
status_code_t report_alarm_details(bool grbl_format)
Definition: report.c:1971
void report_pid_log(void)
Definition: report.c:2606
status_code_t report_named_ngc_parameter(char *arg)
Definition: report.c:587
status_code_t report_grbl_setting(setting_id_t id, void *data)
Definition: report.c:451
void report_message(const char *msg, message_type_t type)
Definition: report.c:257
status_code_t report_time(void)
Definition: report.c:2466
void report_startup_line(uint8_t n, char *line)
Definition: report.c:823
void report_warning(void *message)
Definition: report.c:303
void report_realtime_status(void)
Definition: report.c:1138
void report_info(void *message)
Definition: report.c:297
status_code_t report_setting_description(settings_format_t format, setting_id_t id)
Definition: report.c:1925
status_code_t report_spindle_data(sys_state_t state, char *args)
Definition: report.c:2211
void report_build_info(char *line, bool extended)
Definition: report.c:839
status_code_t report_current_limit_state(sys_state_t state, char *args)
Definition: report.c:2177
status_code_t report_pins(sys_state_t state, char *args)
Definition: report.c:2301
status_code_t report_settings_details(settings_format_t format, setting_id_t setting, setting_group_t group)
Definition: report.c:1905
status_code_t report_help(char *args)
Definition: report.c:380
status_code_t report_setting_group_details(bool by_id, char *prefix)
Definition: report.c:2108
status_code_t report_ngc_parameter(ngc_param_id_t id)
Definition: report.c:570
setting_id_t
Definition: settings.h:46
setting_group_t
Definition: settings.h:840
uint_fast16_t sys_state_t
See sys_state.
Definition: system.h:108