Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: NaturalTinyShell_ice libmDot-12Sept mbed-rtos mbed
Fork of ICE by
Diff: src/ConfigurationHandler/Controls/SetpointControl.cpp
- Revision:
- 115:1558e01d04c6
- Parent:
- 96:807f04bd5256
- Child:
- 131:a290a3934132
--- a/src/ConfigurationHandler/Controls/SetpointControl.cpp Thu Sep 22 19:38:03 2016 +0000 +++ b/src/ConfigurationHandler/Controls/SetpointControl.cpp Thu Sep 22 21:19:44 2016 +0000 @@ -136,7 +136,7 @@ flimit = setpoint + tolerance; return (value.value > flimit); } else { - flimit = setpoint - tolerance; + flimit = setpoint - tolerance; return (value.value < flimit); } } @@ -156,7 +156,7 @@ float flimit; if ( !actingDir ) { - flimit = setpoint - tolerance; + flimit = setpoint - tolerance; return (value.value < flimit); } else { flimit = setpoint + tolerance; @@ -178,9 +178,12 @@ OutputControlMsg_t *output_mail = OutputMasterMailBox.alloc(); memset(output_mail, 0, sizeof(OutputControlMsg_t)); - output_mail->action = ACTION_CONTROL_ON; + + output_mail->action = ACTION_CONTROL_ON; + output_mail->controlType = CONTROL_SETPOINT; + strncpy(output_mail->input_tag, this->input.c_str(), sizeof(output_mail->input_tag)-1); + strncpy(output_mail->output_tag, this->output.c_str(), sizeof(output_mail->output_tag)-1); output_mail->priority = this->priority; - strncpy(output_mail->output, this->output.c_str(), sizeof(output_mail->output)-1); strncpy(output_mail->id, this->id.c_str(), sizeof(output_mail->id)-1); OutputMasterMailBox.put(output_mail); } @@ -199,9 +202,12 @@ OutputControlMsg_t *output_mail = OutputMasterMailBox.alloc(); memset(output_mail, 0, sizeof(OutputControlMsg_t)); - output_mail->action = ACTION_CONTROL_OFF; + + output_mail->action = ACTION_CONTROL_OFF; + output_mail->controlType = CONTROL_SETPOINT; + strncpy(output_mail->input_tag, this->input.c_str(), sizeof(output_mail->input_tag)-1); + strncpy(output_mail->output_tag, this->output.c_str(), sizeof(output_mail->output_tag)-1); output_mail->priority = this->priority; - strncpy(output_mail->output, this->output.c_str(), sizeof(output_mail->output)-1); strncpy(output_mail->id, this->id.c_str(), sizeof(output_mail->id)-1); OutputMasterMailBox.put(output_mail); } @@ -214,15 +220,18 @@ // @return none void SetpointControl::unregisterControl(void) { - logInfo("%s: %s attempting to stop feed on relay %s\n", - __func__, controlFile.c_str(), output.c_str()); + logInfo("%s: %s attempting to unregister %s\n", + __func__, controlFile.c_str()); OutputControlMsg_t *output_mail = OutputMasterMailBox.alloc(); memset(output_mail, 0, sizeof(OutputControlMsg_t)); - output_mail->action = ACTION_CONTROL_UNREGISTER; - output_mail->priority = this->priority; - strncpy(output_mail->output, this->output.c_str(), sizeof(output_mail->output)-1); + + output_mail->action = ACTION_CONTROL_UNREGISTER; + output_mail->controlType = CONTROL_MANUAL; + output_mail->priority = this->priority; + strncpy(output_mail->output_tag, this->output.c_str(), sizeof(output_mail->output_tag)-1); strncpy(output_mail->id, this->id.c_str(), sizeof(output_mail->id)-1); + OutputMasterMailBox.put(output_mail); } @@ -233,9 +242,10 @@ "CONTROL_ON", "CONTROL_DISABLE", "CONTROL_PAUSE", - "CONTROL_MAX" }; - - + "CONTROL_MAX" + }; + + printf("\r controlFile : %s \n", controlFile.c_str()); printf("\r id : %s \n", id.c_str()); printf("\r priority : %d \n", priority); @@ -248,7 +258,7 @@ printf("\r lalert : %0.2f\n", lowAlert); printf("\r hfs : %0.2f\n", highFailsafe); printf("\r lfs : %0.2f\n", lowFailsafe); - printf("\r tol : %0.2f\n", tolerance); + printf("\r tol : %0.2f\n", tolerance); printf("\r\n"); printf("\r currentState : %s\n", mapper[currentState].c_str()); printf("\r high band : %0.2f\n", setpoint + tolerance);