Michael Spencer / Smoothie

Dependencies:   mbed

Fork of Smoothie by Stéphane Cachat

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers TemperatureControlPool.cpp Source File

TemperatureControlPool.cpp

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 #include "libs/Module.h"
00009 #include "libs/Kernel.h"
00010 #include <math.h>
00011 using namespace std;
00012 #include <vector>
00013 #include "TemperatureControlPool.h"
00014 #include "TemperatureControl.h"
00015 #include "PID_Autotuner.h"
00016 
00017 TemperatureControlPool::TemperatureControlPool(){}
00018 
00019 void TemperatureControlPool::on_module_loaded(){
00020 
00021     vector<uint16_t> modules;
00022     THEKERNEL->config->get_module_list( &modules, temperature_control_checksum );
00023 
00024     for( unsigned int i = 0; i < modules.size(); i++ ){
00025         // If module is enabled
00026         if( THEKERNEL->config->value(temperature_control_checksum, modules[i], enable_checksum )->as_bool() == true ){
00027             TemperatureControl* controller = new TemperatureControl(modules[i]);
00028             controller->pool = this;
00029             controllers.push_back( controller );
00030             controller->pool_index = controllers.size() - 1;
00031             THEKERNEL->add_module(controller);
00032         }
00033     }
00034 
00035     THEKERNEL->add_module( this->PIDtuner = new PID_Autotuner() );
00036 }
00037 
00038 
00039 
00040 
00041