Commit | Line | Data |
---|---|---|
df27a6a3 | 1 | /* |
4cff3ded AW |
2 | This file is part of Smoothie (http://smoothieware.org/). The motion control part is heavily based on Grbl (https://github.com/simen/grbl). |
3 | Smoothie is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. | |
4 | Smoothie is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. | |
df27a6a3 | 5 | You should have received a copy of the GNU General Public License along with Smoothie. If not, see <http://www.gnu.org/licenses/>. |
4cff3ded AW |
6 | */ |
7 | ||
8 | #ifndef CONFIG_H | |
9 | #define CONFIG_H | |
3c132bd0 AW |
10 | |
11 | ||
12 | using namespace std; | |
13 | #include <vector> | |
4cff3ded | 14 | #include <string> |
4cff3ded | 15 | |
61134a65 | 16 | class ConfigValue; |
7af0714f | 17 | class ConfigSource; |
a2f7633f | 18 | class ConfigCache; |
32891c60 | 19 | |
4cff3ded AW |
20 | class Config : public Module { |
21 | public: | |
22 | Config(); | |
93ea6adb JM |
23 | Config(ConfigSource*); |
24 | ~Config(); | |
cebe90b6 AW |
25 | |
26 | void on_module_loaded(); | |
27 | void on_console_line_received( void* argument ); | |
a2f7633f | 28 | void config_cache_load(bool parse= true); |
d272dd3c | 29 | void config_cache_clear(); |
3c132bd0 | 30 | void set_string( string setting , string value); |
fc82a1ee | 31 | |
a2f7633f | 32 | ConfigValue* value(uint16_t check_sum_a, uint16_t check_sum_b= 0, uint16_t check_sum_c= 0 ); |
4464301d | 33 | ConfigValue* value(uint16_t check_sums[3] ); |
3c132bd0 AW |
34 | |
35 | void get_module_list(vector<uint16_t>* list, uint16_t family); | |
a2f7633f | 36 | bool is_config_cache_loaded() { return config_cache != NULL; }; // Whether or not the cache is currently popluated |
3c132bd0 | 37 | |
a2f7633f JM |
38 | friend class Configurator; |
39 | ||
40 | private: | |
a699b669 | 41 | bool has_characters(uint16_t check_sum, string str ); |
4cff3ded | 42 | |
a2f7633f | 43 | ConfigCache* config_cache; // A cache in which ConfigValues are kept |
c295905f | 44 | vector<ConfigSource*> config_sources; // A list of all possible coniguration sources |
4cff3ded AW |
45 | }; |
46 | ||
47 | #endif |