X-Git-Url: http://git.hcoop.net/clinton/Smoothieware.git/blobdiff_plain/a952dcbda773427bc5cca5926e587daef420c8c1..d82b3e847e0c88f45b8ab27950d614acefbc5aa2:/src/libs/Kernel.h diff --git a/src/libs/Kernel.h b/src/libs/Kernel.h index 790b3841..4a2feb7c 100644 --- a/src/libs/Kernel.h +++ b/src/libs/Kernel.h @@ -9,6 +9,8 @@ #define KERNEL_H #define THEKERNEL Kernel::instance +#define THECONVEYOR THEKERNEL->conveyor +#define THEROBOT THEKERNEL->robot #include "Module.h" #include @@ -20,16 +22,16 @@ class Config; class Module; class Conveyor; class SlowTicker; -class Pauser; class SerialConsole; class StreamOutputPool; class GcodeDispatch; class Robot; -class Stepper; class Planner; class StepTicker; class Adc; class PublicData; +class SimpleShell; +class Configurator; class Kernel { public: @@ -39,31 +41,50 @@ class Kernel { void add_module(Module* module); void register_for_event(_EVENT_ENUM id_event, Module *module); - void call_event(_EVENT_ENUM id_event); - void call_event(_EVENT_ENUM id_event, void * argument); + void call_event(_EVENT_ENUM id_event, void * argument= nullptr); + + bool kernel_has_event(_EVENT_ENUM id_event, Module *module); + void unregister_for_event(_EVENT_ENUM id_event, Module *module); + + bool is_using_leds() const { return use_leds; } + bool is_halted() const { return halted; } + bool is_grbl_mode() const { return grbl_mode; } + bool is_ok_per_line() const { return ok_per_line; } + + void set_feed_hold(bool f) { feed_hold= f; } + bool get_feed_hold() const { return feed_hold; } + + std::string get_query_string(); // These modules are available to all other modules SerialConsole* serial; StreamOutputPool* streams; - + GcodeDispatch* gcode_dispatch; Robot* robot; - Stepper* stepper; Planner* planner; Config* config; Conveyor* conveyor; - Pauser* pauser; + Configurator* configurator; + SimpleShell* simpleshell; int debug; SlowTicker* slow_ticker; StepTicker* step_ticker; Adc* adc; - bool use_leds; std::string current_path; - int base_stepping_frequency; + uint32_t base_stepping_frequency; + uint32_t acceleration_ticks_per_second; private: // When a module asks to be called for a specific event ( a hook ), this is where that request is remembered std::array, NUMBER_OF_DEFINED_EVENTS> hooks; + struct { + bool use_leds:1; + bool halted:1; + bool grbl_mode:1; + bool feed_hold:1; + bool ok_per_line:1; + }; };