Stéphane Cachat
/
Smoothie
smoothie port to mbed online compiler (smoothieware.org)
Embed:
(wiki syntax)
Show/hide line numbers
FileConfigSource.h
00001 /* 00002 This file is part of Smoothie (http://smoothieware.org/). The motion control part is heavily based on Grbl (https://github.com/simen/grbl). 00003 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. 00004 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. 00005 You should have received a copy of the GNU General Public License along with Smoothie. If not, see <http://www.gnu.org/licenses/>. 00006 */ 00007 00008 #ifndef FILECONFIGSOURCE_H 00009 #define FILECONFIGSOURCE_H 00010 00011 #include "ConfigValue.h" 00012 #include "ConfigSource.h" 00013 #include "ConfigCache.h" 00014 00015 using namespace std; 00016 #include <string> 00017 00018 #define FILE_CONFIGSOURCE_CHECKSUM 5281 // "file" 00019 00020 class FileConfigSource : public ConfigSource { 00021 public: 00022 FileConfigSource(string config_file = "/sd/config", uint16_t name_checksum = FILE_CONFIGSOURCE_CHECKSUM); 00023 virtual void transfer_values_to_cache( ConfigCache* cache ); 00024 virtual bool is_named( uint16_t check_sum ); 00025 virtual void write( string setting, string value ); 00026 virtual string read( vector<uint16_t> check_sums ); 00027 bool has_config_file(); 00028 void try_config_file(string candidate); 00029 string get_config_file(); 00030 00031 string config_file; // Path to the config file 00032 bool config_file_found; // Wether or not the config file's location is known 00033 00034 00035 }; 00036 00037 00038 00039 #endif
Generated on Tue Jul 12 2022 14:14:40 by 1.7.2