Rev 2271 | Rev 2280 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed
| Rev 2271 | Rev 2275 | ||
|---|---|---|---|
| Line 1... | Line 1... | ||
| 1 | 1 | ||
| 2 | PID_ModuleNames = [ "PID" ]; |
2 | PID_ModuleNames = [ "PID" ]; |
| - | 3 | PID_SensorModuleNames = [ "DS18x20", "FOST02", "DHT11", "NTC", "TC1047A", "LM335", "TCN75A" ]; |
|
| - | 4 | PID_ActModuleNames = [ "hwPWM", "softPWM", "SlowPWM", "PCAPWM" ]; |
|
| - | 5 | ||
| 3 | PID_Intervals = function() { return [ 1, 5, 10, 15, 20 ]; }; |
6 | PID_Intervals = function() { return [ 1, 5, 10, 15, 20 ]; }; |
| 4 | //PID_Energy = function() { return [ 0, 500, 1000, 5000, 10000 ]; }; |
7 | //PID_Energy = function() { return [ 0, 500, 1000, 5000, 10000 ]; }; |
| 5 | PID_Temperatures = function() { return [ 20, 25, 30, 35 ]; }; |
8 | PID_Temperatures = function() { return [ 20, 25, 30, 35 ]; }; |
| 6 | PID_Constants = function() { return [ 0, 0.1, 0.5, 1, 10, 100, 1000 ]; }; |
9 | PID_Constants = function() { return [ 0, 0.1, 0.5, 1, 10, 100, 1000 ]; }; |
| 7 | PID_TimeUnits = function() { return [ "s", "ms"]; }; |
10 | PID_TimeUnits = function() { return [ "s", "ms"]; }; |
| 8 | PID_Times = function() { return [ 1, 5, 10, 15, 20, 40, 60]; }; |
11 | PID_Times = function() { return [ 1, 5, 10, 15, 20, 40, 60]; }; |
| 9 | PID_Aliases = function() { return Module_GetAliasNames(PID_ModuleNames); }; |
12 | PID_Aliases = function() { return Module_GetAliasNames(PID_ModuleNames); }; |
| 10 | PID_AvailableIds = function() { return Module_GetAvailableIds(PID_ModuleNames); }; |
13 | PID_AvailableIds = function() { return Module_GetAvailableIds(PID_ModuleNames); }; |
| - | 14 | PID_SensorAliases = function() { return Module_GetAliasNames(PID_SensorModuleNames); }; |
|
| - | 15 | PID_ActAliases = function() { return Module_GetAliasNames(PID_ActModuleNames); }; |
|
| 11 | 16 | ||
| 12 | function PID_SetReportInterval(alias_name, interval) |
17 | function PID_SetReportInterval(alias_name, interval) |
| 13 | { |
18 | { |
| 14 | if (arguments.length < 2) |
19 | if (arguments.length < 2) |
| 15 | { |
20 | { |
| 16 | Log("\033[31mNot enough parameters given.\033[0m\n"); |
21 | Log("\033[31mNot enough parameters given.\033[0m\n"); |
| 17 | return false; |
22 | return false; |
| 18 | } |
23 | } |
| 19 | 24 | ||
| 20 | var aliases_data = Module_ResolveAlias(alias_name, PID_ModuleNames); |
25 | var aliases_data = Module_ResolveAlias(alias_name, PID_ModuleNames); |
| 21 | var found = false; |
26 | var found = false; |
| 22 | 27 | ||
| 23 | for (var name in aliases_data) |
28 | for (var name in aliases_data) |
| 24 | { |
29 | { |
| 25 | var variables = {"Time" : interval }; |
30 | var variables = {"Time" : interval }; |
| 26 | 31 | ||
| 27 | if (Module_SendMessage(aliases_data[name]["module_name"], aliases_data[name]["module_id"], "Report_Interval", variables)) |
32 | if (Module_SendMessage(aliases_data[name]["module_name"], aliases_data[name]["module_id"], "Report_Interval", variables)) |
| 28 | { |
33 | { |
| 29 | //Log("\033[32mCommand sent successfully to " + name + ".\033[0m\n"); |
34 | //Log("\033[32mCommand sent successfully to " + name + ".\033[0m\n"); |
| 30 | } |
35 | } |
| 31 | else |
36 | else |
| 32 | { |
37 | { |
| 33 | Log("\033[31mFailed to send command to " + name + ".\033[0m\n"); |
38 | Log("\033[31mFailed to send command to " + name + ".\033[0m\n"); |
| 34 | } |
39 | } |
| 35 | 40 | ||
| 36 | found = true; |
41 | found = true; |
| 37 | } |
42 | } |
| 38 | 43 | ||
| 39 | if (!found) |
44 | if (!found) |
| 40 | { |
45 | { |
| 41 | Log("\033[31mNo aliases by the name " + alias_name + " were applicable for this command.\033[0m\n"); |
46 | Log("\033[31mNo aliases by the name " + alias_name + " were applicable for this command.\033[0m\n"); |
| 42 | return false; |
47 | return false; |
| 43 | } |
48 | } |
| 44 | 49 | ||
| 45 | return true; |
50 | return true; |
| 46 | } |
51 | } |
| 47 | Console_RegisterCommand(PID_SetReportInterval, function(arg_index, args) { return Console_StandardAutocomplete(arg_index, args, PID_Aliases(), PID_Intervals()); }); |
52 | Console_RegisterCommand(PID_SetReportInterval, function(arg_index, args) { return Console_StandardAutocomplete(arg_index, args, PID_Aliases(), PID_Intervals()); }); |
| 48 | 53 | ||
| 49 | 54 | ||
| 50 | function PID_setValue(alias_name, temperature) |
55 | function PID_setValue(alias_name, temperature) |
| 51 | { |
56 | { |
| 52 | if (arguments.length < 2) |
57 | if (arguments.length < 2) |
| 53 | { |
58 | { |
| 54 | Log("\033[31mNot enough parameters given.\033[0m\n"); |
59 | Log("\033[31mNot enough parameters given.\033[0m\n"); |
| 55 | return false; |
60 | return false; |
| 56 | } |
61 | } |
| 57 | var aliases_data = Module_ResolveAlias(alias_name, PID_ModuleNames); |
62 | var aliases_data = Module_ResolveAlias(alias_name, PID_ModuleNames); |
| 58 | var found = false; |
63 | var found = false; |
| 59 | 64 | ||
| 60 | Log ("Called SetValue: "+temperature+"\n"); |
65 | Log ("Called SetValue: "+temperature+"\n"); |
| 61 | 66 | ||
| 62 | for (var name in aliases_data) |
67 | for (var name in aliases_data) |
| 63 | { |
68 | { |
| 64 | var variables = { "Value" : temperature, |
69 | var variables = { "Value" : temperature, |
| 65 | "SensorId" : 0 }; |
70 | "SensorId" : 0 }; |
| 66 | 71 | ||
| 67 | if (Module_SendMessage(aliases_data[name]["module_name"], aliases_data[name]["module_id"], "Temperature_Celsius", variables)) |
72 | if (Module_SendMessage(aliases_data[name]["module_name"], aliases_data[name]["module_id"], "Temperature_Celsius", variables)) |
| 68 | { |
73 | { |
| 69 | Log("\033[32mCommand sent successfully to " + name + ".\033[0m\n"); |
74 | Log("\033[32mCommand sent successfully to " + name + ".\033[0m\n"); |
| 70 | } |
75 | } |
| 71 | else |
76 | else |
| 72 | { |
77 | { |
| 73 | Log("\033[31mFailed to send command to " + name + ".\033[0m\n"); |
78 | Log("\033[31mFailed to send command to " + name + ".\033[0m\n"); |
| 74 | } |
79 | } |
| 75 | 80 | ||
| 76 | found = true; |
81 | found = true; |
| 77 | } |
82 | } |
| 78 | 83 | ||
| 79 | if (!found) |
84 | if (!found) |
| 80 | { |
85 | { |
| 81 | Log("\033[31mNo aliases by the name " + alias_name + " were applicable for this command.\033[0m\n"); |
86 | Log("\033[31mNo aliases by the name " + alias_name + " were applicable for this command.\033[0m\n"); |
| - | 87 | return false; |
|
| - | 88 | } |
|
| - | 89 | ||
| - | 90 | return true; |
|
| - | 91 | } |
|
| - | 92 | Console_RegisterCommand(PID_setValue, function(arg_index, args) { return Console_StandardAutocomplete(arg_index, args, PID_Aliases(), PID_Temperatures()); }); |
|
| - | 93 | ||
| - | 94 | function PID_setSensor(alias_name, alias_sensor) |
|
| - | 95 | { |
|
| - | 96 | if (arguments.length < 2) |
|
| - | 97 | { |
|
| - | 98 | Log("\033[31mNot enough parameters given.\033[0m\n"); |
|
| - | 99 | return false; |
|
| - | 100 | } |
|
| - | 101 | var aliases_data = Module_ResolveAlias(alias_name, PID_ModuleNames); |
|
| - | 102 | var found = false; |
|
| - | 103 | ||
| - | 104 | var sensor_aliases_data = Module_ResolveAlias(alias_sensor, PID_SensorModuleNames); |
|
| - | 105 | var first = true; |
|
| - | 106 | for (var sensor in sensor_aliases_data) |
|
| - | 107 | { |
|
| - | 108 | if (first == false) |
|
| - | 109 | { |
|
| - | 110 | Log("\033[31mNo sensor by the name " + alias_sensor + " were applicable for this command, or alias was a group.\033[0m\n"); |
|
| - | 111 | return false; |
|
| - | 112 | } |
|
| - | 113 | Log ("Called Set Sensor:\n"); |
|
| - | 114 | Log ("sensorModuleType: " + sensor_aliases_data[sensor]["module_name"]+"\n"); |
|
| - | 115 | Log ("sensorModuleId: " + sensor_aliases_data[sensor]["module_id"]+"\n"); |
|
| - | 116 | Log ("SensorId: " + sensor_aliases_data[sensor]["specific"]["SensorId"]+"\n"); |
|
| - | 117 | var id = 0; |
|
| - | 118 | switch (sensor_aliases_data[sensor]["module_name"]) |
|
| - | 119 | { |
|
| - | 120 | case "DS18x20": id = 3; break; |
|
| - | 121 | case "FOST02": id = 5; break; |
|
| - | 122 | case "TC1047A": id = 17; break; |
|
| - | 123 | case "TCN75A": id = 46; break; |
|
| - | 124 | case "LM335": id = 51; break; |
|
| - | 125 | case "NTC": id = 55; break; |
|
| - | 126 | case "DHT11": id = 61; break; |
|
| - | 127 | default: |
|
| - | 128 | Log("\033[31mCould not resolve sensor module type.\033[0m\n"); |
|
| - | 129 | return; break; |
|
| - | 130 | } |
|
| - | 131 | ||
| - | 132 | ||
| - | 133 | for (var name in aliases_data) |
|
| - | 134 | { |
|
| - | 135 | var variables = { "sensorModuleType" : id, |
|
| - | 136 | "sensorModuleId" : sensor_aliases_data[sensor]["module_id"], |
|
| - | 137 | "sensorId" : sensor_aliases_data[sensor]["specific"]["SensorId"] }; |
|
| - | 138 | ||
| - | 139 | if (Module_SendMessage(aliases_data[name]["module_name"], aliases_data[name]["module_id"], "CONFIG_SENSOR", variables)) |
|
| - | 140 | { |
|
| - | 141 | Log("\033[32mCommand sent successfully to " + name + ".\033[0m\n"); |
|
| - | 142 | } |
|
| - | 143 | else |
|
| - | 144 | { |
|
| - | 145 | Log("\033[31mFailed to send command to " + name + ".\033[0m\n"); |
|
| - | 146 | } |
|
| - | 147 | ||
| - | 148 | found = true; |
|
| - | 149 | } |
|
| - | 150 | first = false; |
|
| - | 151 | if (!found) |
|
| - | 152 | { |
|
| - | 153 | Log("\033[31mNo aliases by the name " + alias_name + " were applicable for this command.\033[0m\n"); |
|
| - | 154 | return false; |
|
| - | 155 | } |
|
| - | 156 | } |
|
| - | 157 | ||
| - | 158 | if (!found) |
|
| - | 159 | { |
|
| - | 160 | Log("\033[31mNo sensor aliases by the name " + alias_sensor + " were applicable for this command.\033[0m\n"); |
|
| - | 161 | return false; |
|
| - | 162 | } |
|
| - | 163 | ||
| - | 164 | return true; |
|
| - | 165 | } |
|
| - | 166 | Console_RegisterCommand(PID_setSensor, function(arg_index, args) { return Console_StandardAutocomplete(arg_index, args, PID_Aliases(), PID_SensorAliases()); }); |
|
| - | 167 | ||
| - | 168 | function PID_setActuator(alias_name, alias_actuator) |
|
| - | 169 | { |
|
| - | 170 | if (arguments.length < 2) |
|
| - | 171 | { |
|
| - | 172 | Log("\033[31mNot enough parameters given.\033[0m\n"); |
|
| - | 173 | return false; |
|
| - | 174 | } |
|
| - | 175 | var aliases_data = Module_ResolveAlias(alias_name, PID_ModuleNames); |
|
| - | 176 | var found = false; |
|
| - | 177 | ||
| - | 178 | var act_aliases_data = Module_ResolveAlias(alias_actuator, PID_ActModuleNames); |
|
| - | 179 | var first = true; |
|
| - | 180 | for (var act in act_aliases_data) |
|
| - | 181 | { |
|
| - | 182 | if (first == false) |
|
| - | 183 | { |
|
| - | 184 | Log("\033[31mNo actuator by the name " + alias_actuator + " were applicable for this command, or alias was a group.\033[0m\n"); |
|
| - | 185 | return false; |
|
| - | 186 | } |
|
| - | 187 | Log ("Called Set Actuator:\n"); |
|
| - | 188 | Log ("actModuleType: " + act_aliases_data[act]["module_name"]+"\n"); |
|
| - | 189 | Log ("actModuleId: " + act_aliases_data[act]["module_id"]+"\n"); |
|
| - | 190 | Log ("actId: " + act_aliases_data[act]["specific"]["Channel"]+"\n"); |
|
| - | 191 | var id = 0; |
|
| - | 192 | switch (act_aliases_data[act]["module_name"]) |
|
| - | 193 | { |
|
| - | 194 | case "hwPWM": id = 13; break; |
|
| - | 195 | case "softPWM": id = 21; break; |
|
| - | 196 | case "SlowPWM": id = 19; break; |
|
| - | 197 | case "PCAPWM": id = 29; break; |
|
| - | 198 | default: |
|
| - | 199 | Log("\033[31mCould not resolve actuator module type.\033[0m\n"); |
|
| - | 200 | return; break; |
|
| - | 201 | } |
|
| - | 202 | ||
| - | 203 | ||
| - | 204 | for (var name in aliases_data) |
|
| - | 205 | { |
|
| - | 206 | var variables = { "actuatorModuleType" : id, |
|
| - | 207 | "actuatorModuleId" : act_aliases_data[act]["module_id"], |
|
| - | 208 | "actuatorId" : act_aliases_data[act]["specific"]["Channel"] }; |
|
| - | 209 | ||
| - | 210 | if (Module_SendMessage(aliases_data[name]["module_name"], aliases_data[name]["module_id"], "CONFIG_ACTUATOR", variables)) |
|
| - | 211 | { |
|
| - | 212 | Log("\033[32mCommand sent successfully to " + name + ".\033[0m\n"); |
|
| - | 213 | } |
|
| - | 214 | else |
|
| - | 215 | { |
|
| - | 216 | Log("\033[31mFailed to send command to " + name + ".\033[0m\n"); |
|
| - | 217 | } |
|
| - | 218 | ||
| - | 219 | found = true; |
|
| - | 220 | } |
|
| - | 221 | first = false; |
|
| - | 222 | if (!found) |
|
| - | 223 | { |
|
| - | 224 | Log("\033[31mNo aliases by the name " + alias_name + " were applicable for this command.\033[0m\n"); |
|
| - | 225 | return false; |
|
| - | 226 | } |
|
| - | 227 | } |
|
| - | 228 | ||
| - | 229 | if (!found) |
|
| - | 230 | { |
|
| - | 231 | Log("\033[31mNo actuator aliases by the name " + alias_actuator + " were applicable for this command.\033[0m\n"); |
|
| 82 | return false; |
232 | return false; |
| 83 | } |
233 | } |
| 84 | 234 | ||
| 85 | return true; |
235 | return true; |
| 86 | } |
236 | } |
| 87 | Console_RegisterCommand( |
237 | Console_RegisterCommand(PID_setActuator, function(arg_index, args) { return Console_StandardAutocomplete(arg_index, args, PID_Aliases(), PID_ActAliases()); }); |
| 88 | 238 | ||
| 89 | 239 | ||
| 90 | function PID_setParameters(alias_name, KP,KI,KD,Time,Unit) |
240 | function PID_setParameters(alias_name, KP,KI,KD,Time,Unit) |
| 91 | { |
241 | { |
| 92 | if (arguments.length < 6) |
242 | if (arguments.length < 6) |
| Line 100... | Line 250... | ||
| 100 | for (var name in aliases_data) |
250 | for (var name in aliases_data) |
| 101 | { |
251 | { |
| 102 | var variables = { "K_P" : KP, |
252 | var variables = { "K_P" : KP, |
| 103 | "K_I" : KI, |
253 | "K_I" : KI, |
| 104 | "K_D" : KD, |
254 | "K_D" : KD, |
| 105 | "RegulatorTime" : Time, |
255 | "RegulatorTime" : Time, |
| 106 | "TimeUnit" : Unit }; |
256 | "TimeUnit" : Unit }; |
| 107 | var variables_P_I = { "K_P" : KP, |
257 | var variables_P_I = { "K_P" : KP, |
| 108 | "K_I" : KI }; |
258 | "K_I" : KI }; |
| 109 | var variables_D_T = { "K_D" : KD, |
259 | var variables_D_T = { "K_D" : KD, |
| 110 | "RegulatorTime" : Time, |
260 | "RegulatorTime" : Time, |
| Line 147... | Line 297... | ||
| 147 | } |
297 | } |
| 148 | 298 | ||
| 149 | return true; |
299 | return true; |
| 150 | } |
300 | } |
| 151 | Console_RegisterCommand(PID_setParameters, function(arg_index, args) { return Console_StandardAutocomplete(arg_index, args, PID_Aliases(), PID_Constants(), PID_Constants(), PID_Constants(), PID_Times(), PID_TimeUnits()); }); |
301 | Console_RegisterCommand(PID_setParameters, function(arg_index, args) { return Console_StandardAutocomplete(arg_index, args, PID_Aliases(), PID_Constants(), PID_Constants(), PID_Constants(), PID_Times(), PID_TimeUnits()); }); |
| - | 302 | ||
| - | 303 | ||
| - | 304 | function PID_setOutputMaxMin(alias_name, Max,Min) |
|
| - | 305 | { |
|
| - | 306 | if (arguments.length < 3) |
|
| - | 307 | { |
|
| - | 308 | Log("\033[31mNot enough parameters given.\033[0m\n"); |
|
| - | 309 | return false; |
|
| - | 310 | } |
|
| - | 311 | var aliases_data = Module_ResolveAlias(alias_name, PID_ModuleNames); |
|
| - | 312 | var found = false; |
|
| - | 313 | ||
| - | 314 | for (var name in aliases_data) |
|
| - | 315 | { |
|
| - | 316 | var variables = { "Min" : Min, |
|
| - | 317 | "Max" : Max }; |
|
| - | 318 | ||
| - | 319 | if (Module_SendMessage(aliases_data[name]["module_name"], aliases_data[name]["module_id"], "OutMinMax", variables)) |
|
| - | 320 | { |
|
| - | 321 | Log("\033[32mMin = " + Min + "Max = " + Max + ".\033[0m\n"); |
|
| - | 322 | } |
|
| - | 323 | else |
|
| - | 324 | { |
|
| - | 325 | Log("\033[31mFailed to send command to " + name + ".\033[0m\n"); |
|
| - | 326 | } |
|
| - | 327 | ||
| - | 328 | found = true; |
|
| - | 329 | } |
|
| - | 330 | ||
| - | 331 | if (!found) |
|
| - | 332 | { |
|
| - | 333 | Log("\033[31mNo aliases by the name " + alias_name + " were applicable for this command.\033[0m\n"); |
|
| - | 334 | return false; |
|
| - | 335 | } |
|
| - | 336 | ||
| - | 337 | return true; |
|
| - | 338 | } |
|
| - | 339 | Console_RegisterCommand(PID_setOutputMaxMin, function(arg_index, args) { return Console_StandardAutocomplete(arg_index, args, PID_Aliases(), PID_Constants(), PID_Constants()); }); |
|
| 152 | 340 | ||
| 153 | function PID_getConfiguration(alias_name) |
341 | function PID_getConfiguration(alias_name) |
| 154 | { |
342 | { |
| 155 | if (arguments.length < 1) |
343 | if (arguments.length < 1) |
| 156 | { |
344 | { |
| 157 | Log("\033[31mNot enough parameters given.\033[0m\n"); |
345 | Log("\033[31mNot enough parameters given.\033[0m\n"); |
| 158 | return false; |
346 | return false; |
| 159 | } |
347 | } |
| 160 | var aliases_data = Module_ResolveAlias(alias_name, PID_ModuleNames); |
348 | var aliases_data = Module_ResolveAlias(alias_name, PID_ModuleNames); |
| 161 | var found = false; |
349 | var found = false; |
| Line 163... | Line 351... | ||
| 163 | for (var name in aliases_data) |
351 | for (var name in aliases_data) |
| 164 | { |
352 | { |
| 165 | var variables = {}; |
353 | var variables = {}; |
| 166 | 354 | ||
| 167 | if (Module_SendMessage(aliases_data[name]["module_name"], aliases_data[name]["module_id"], "CONFIG_SENSOR", variables)) |
355 | if (Module_SendMessage(aliases_data[name]["module_name"], aliases_data[name]["module_id"], "CONFIG_SENSOR", variables)) |
| 168 | { |
356 | { |
| 169 | //Log("\033[32mCommand sent successfully to " + name + ".\033[0m\n"); |
357 | //Log("\033[32mCommand sent successfully to " + name + ".\033[0m\n"); |
| 170 | } |
358 | } |
| 171 | else |
359 | else |
| 172 | { |
360 | { |
| 173 | Log("\033[31mFailed to send command 1 to " + name + ".\033[0m\n"); |
361 | Log("\033[31mFailed to send command 1 to " + name + ".\033[0m\n"); |
| 174 | } |
362 | } |
| 175 | if (Module_SendMessage(aliases_data[name]["module_name"], aliases_data[name]["module_id"], "CONFIG_ACTUATOR", variables)) |
363 | if (Module_SendMessage(aliases_data[name]["module_name"], aliases_data[name]["module_id"], "CONFIG_ACTUATOR", variables)) |
| 176 | { |
364 | { |
| 177 | //Log("\033[32mCommand sent successfully to " + name + ".\033[0m\n"); |
365 | //Log("\033[32mCommand sent successfully to " + name + ".\033[0m\n"); |
| 178 | } |
366 | } |
| 179 | else |
367 | else |
| 180 | { |
368 | { |
| 181 | Log("\033[31mFailed to send command 2 to " + name + ".\033[0m\n"); |
369 | Log("\033[31mFailed to send command 2 to " + name + ".\033[0m\n"); |
| 182 | } |
370 | } |
| 183 | if (Module_SendMessage(aliases_data[name]["module_name"], aliases_data[name]["module_id"], "CONFIG_PARAMETER", variables)) |
371 | if (Module_SendMessage(aliases_data[name]["module_name"], aliases_data[name]["module_id"], "CONFIG_PARAMETER", variables)) |
| 184 | { |
372 | { |
| 185 | //Log("\033[32mCommand sent successfully to " + name + ".\033[0m\n"); |
373 | //Log("\033[32mCommand sent successfully to " + name + ".\033[0m\n"); |
| 186 | } |
374 | } |
| 187 | else |
375 | else |
| 188 | { |
376 | { |
| 189 | Log("\033[31mFailed to send command 3 to " + name + ".\033[0m\n"); |
377 | Log("\033[31mFailed to send command 3 to " + name + ".\033[0m\n"); |
| 190 | } |
378 | } |
| 191 | if (Module_SendMessage(aliases_data[name]["module_name"], aliases_data[name]["module_id"], "Report_Interval", variables)) |
379 | if (Module_SendMessage(aliases_data[name]["module_name"], aliases_data[name]["module_id"], "Report_Interval", variables)) |
| 192 | { |
380 | { |
| 193 | //Log("\033[32mCommand sent successfully to " + name + ".\033[0m\n"); |
381 | //Log("\033[32mCommand sent successfully to " + name + ".\033[0m\n"); |
| 194 | } |
382 | } |
| 195 | else |
383 | else |
| 196 | { |
384 | { |
| 197 | Log("\033[31mFailed to send command 4 to " + name + ".\033[0m\n"); |
385 | Log("\033[31mFailed to send command 4 to " + name + ".\033[0m\n"); |
| 198 | } |
386 | } |
| 199 | if (Module_SendMessage(aliases_data[name]["module_name"], aliases_data[name]["module_id"], "CONFIG_PARAMETER_P_I", variables)) |
387 | if (Module_SendMessage(aliases_data[name]["module_name"], aliases_data[name]["module_id"], "CONFIG_PARAMETER_P_I", variables)) |
| 200 | { |
388 | { |
| - | 389 | //Log("\033[32mCommand sent successfully to " + name + ".\033[0m\n"); |
|
| - | 390 | } |
|
| - | 391 | else |
|
| - | 392 | { |
|
| - | 393 | Log("\033[31mFailed to send command 5 to " + name + ".\033[0m\n"); |
|
| - | 394 | } |
|
| - | 395 | if (Module_SendMessage(aliases_data[name]["module_name"], aliases_data[name]["module_id"], "CONFIG_PARAMETER_D_T", variables)) |
|
| - | 396 | { |
|
| 201 | //Log("\033[32mCommand sent successfully to " + name + ".\033[0m\n"); |
397 | //Log("\033[32mCommand sent successfully to " + name + ".\033[0m\n"); |
| 202 | } |
398 | } |
| 203 | else |
399 | else |
| 204 | { |
400 | { |
| 205 | Log("\033[31mFailed to send command |
401 | Log("\033[31mFailed to send command 6 to " + name + ".\033[0m\n"); |
| 206 | } |
402 | } |
| 207 | if (Module_SendMessage(aliases_data[name]["module_name"], aliases_data[name]["module_id"], " |
403 | if (Module_SendMessage(aliases_data[name]["module_name"], aliases_data[name]["module_id"], "OutMinMax", variables)) |
| 208 | { |
404 | { |
| 209 | //Log("\033[32mCommand sent successfully to " + name + ".\033[0m\n"); |
405 | //Log("\033[32mCommand sent successfully to " + name + ".\033[0m\n"); |
| 210 | } |
406 | } |
| 211 | else |
407 | else |
| 212 | { |
408 | { |