made recommended changes
authormhackney <mhackney@supermac.home>
Sat, 21 Jun 2014 22:19:19 +0000 (18:19 -0400)
committermhackney <mhackney@supermac.home>
Sat, 21 Jun 2014 22:19:19 +0000 (18:19 -0400)
ConfigSamples/AzteegX5Mini.delta/config
ConfigSamples/AzteegX5Mini/config
ConfigSamples/Smoothieboard.delta/config
ConfigSamples/Smoothieboard/config
src/main.cpp [changed mode: 0755->0644]
src/modules/tools/temperatureswitch/TemperatureSwitch.cpp
src/modules/tools/temperatureswitch/TemperatureSwitch.h

index 929abf3..b4183e0 100644 (file)
@@ -106,7 +106,7 @@ switch.fan.output_pin                        2.4              #
 
 # automatically toggle a switch at a specified temperature
 # useful to turn on a fan or water pump to cool the hotend
-#temperatureswitch_module_enable                    true             #
+#temperatureswitch.hotend.enable                 true             #
 #temperatureswitch.hotend.type                misc             # select which MOSFET to use, fan or misc (small MOSFETs)
 #temperatureswitch.hotend.threshold_temp      60.0             # temperature to turn on (if rising) or off the switch
 #temperatureswitch.hotend.heatup_poll         15               # poll heatup at 15 sec intervals
index 158477a..545df37 100755 (executable)
@@ -96,7 +96,7 @@ switch.misc.output_pin                       2.4              #
 
 # automatically toggle a switch at a specified temperature
 # useful to turn on a fan or water pump to cool the hotend
-#temperatureswitch_module_enable                    true             #
+#temperatureswitch.hotend.enable                 true             #
 #temperatureswitch.hotend.type                misc             # select which MOSFET to use, fan or misc (small MOSFETs)
 #temperatureswitch.hotend.threshold_temp      60.0             # temperature to turn on (if rising) or off the switch
 #temperatureswitch.hotend.heatup_poll         15               # poll heatup at 15 sec intervals
index 5356542..acca6d6 100644 (file)
@@ -175,7 +175,7 @@ switch.fan.output_type                       pwm              # pwm output setta
 
 # automatically toggle a switch at a specified temperature
 # useful to turn on a fan or water pump to cool the hotend
-#temperatureswitch_module_enable                    true             #
+#temperatureswitch.hotend.enable                 true             #
 #temperatureswitch.hotend.type                misc             # select which MOSFET to use, fan or misc (small MOSFETs)
 #temperatureswitch.hotend.threshold_temp      60.0             # temperature to turn on (if rising) or off the switch
 #temperatureswitch.hotend.heatup_poll         15               # poll heatup at 15 sec intervals
index a63d4f2..901e579 100644 (file)
@@ -168,7 +168,7 @@ switch.fan.output_type                       pwm              # pwm output setta
 
 # automatically toggle a switch at a specified temperature
 # useful to turn on a fan or water pump to cool the hotend
-#temperatureswitch_module_enable                    true             #
+#temperatureswitch.hotend.enable                 true             #
 #temperatureswitch.hotend.type                misc             # select which MOSFET to use, fan or misc (small MOSFETs)
 #temperatureswitch.hotend.threshold_temp      60.0             # temperature to turn on (if rising) or off the switch
 #temperatureswitch.hotend.heatup_poll         15               # poll heatup at 15 sec intervals
old mode 100755 (executable)
new mode 100644 (file)
index 1a037bb..bf35689
@@ -147,9 +147,9 @@ void init() {
     #ifndef NONETWORK
     kernel->add_module( new Network() );
     #endif
-       #ifndef NO_TOOLS_TEMPERATURESWITCH
-       kernel->add_module( new TemperatureSwitch() );
-       #endif
+    #ifndef NO_TOOLS_TEMPERATURESWITCH
+    kernel->add_module( new TemperatureSwitch() );
+    #endif
 
     // Create and initialize USB stuff
     u.init();
index 6609157..3cb1604 100755 (executable)
@@ -27,6 +27,14 @@ Author: Michael Hackney, mhackney@eclecticangler.com
 #include "PublicData.h"
 #include "StreamOutputPool.h"
 
+#define temperatureswitch_checksum                    CHECKSUM("temperatureswitch")
+#define temperatureswitch_enable_checksum             CHECKSUM("enable")
+#define temperatureswitch_hotend_checksum             CHECKSUM("hotend")
+#define temperatureswitch_threshold_temp_checksum     CHECKSUM("threshold_temp")
+#define temperatureswitch_type_checksum               CHECKSUM("type")
+#define temperatureswitch_heatup_poll_checksum        CHECKSUM("heatup_poll")
+#define temperatureswitch_cooldown_poll_checksum      CHECKSUM("cooldown_poll")
+
 TemperatureSwitch::TemperatureSwitch()
 {
 }
@@ -35,7 +43,7 @@ TemperatureSwitch::TemperatureSwitch()
 void TemperatureSwitch::on_module_loaded()
 {
     // free up space if not loaded
-    if (!THEKERNEL->config->value(temperatureswitch_module_enable_checksum)->by_default(false)->as_bool()) {
+    if (!THEKERNEL->config->value(temperatureswitch_checksum, temperatureswitch_hotend_checksum, temperatureswitch_enable_checksum)->by_default(false)->as_bool()) {
         delete this;
         return;
     }
@@ -52,6 +60,10 @@ void TemperatureSwitch::on_config_reload(void *argument)
 {
     // save the list of temperature controllers
     THEKERNEL->config->get_module_list(&temp_controllers, temperature_control_checksum);
+    if (temp_controllers.empty()) {
+        delete this;
+        return;
+    }
     
     // load settings from config file
     this->temperatureswitch_state = false;
index 05644a0..ca394d7 100755 (executable)
@@ -22,14 +22,6 @@ using namespace std;
 #include <string>
 #include <vector>
 
-#define temperatureswitch_module_enable_checksum      CHECKSUM("temperatureswitch_module_enable")
-#define temperatureswitch_checksum                    CHECKSUM("temperatureswitch")
-#define temperatureswitch_hotend_checksum             CHECKSUM("hotend")
-#define temperatureswitch_threshold_temp_checksum     CHECKSUM("threshold_temp")
-#define temperatureswitch_type_checksum               CHECKSUM("type")
-#define temperatureswitch_heatup_poll_checksum        CHECKSUM("heatup_poll")
-#define temperatureswitch_cooldown_poll_checksum      CHECKSUM("cooldown_poll")
-
 class TemperatureSwitch : public Module
 {
     public: