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:
- 202:d6011a00bfb8
- Parent:
- 198:2fe695f5cb42
- Child:
- 205:3c84af5f711f
diff -r 1bbe488d2dde -r d6011a00bfb8 src/ConfigurationHandler/Controls/SetpointControl.cpp --- a/src/ConfigurationHandler/Controls/SetpointControl.cpp Fri Oct 07 11:59:28 2016 +0000 +++ b/src/ConfigurationHandler/Controls/SetpointControl.cpp Fri Oct 07 14:47:39 2016 +0000 @@ -10,6 +10,8 @@ #include "ModbusMasterApi.h" #include "global.h" #include <string> +#include <iostream> +#include <iomanip> extern mDot *GLOBAL_mdot; @@ -286,23 +288,18 @@ ModbusValue inputValue; ModbusMasterReadRegister(input, &inputValue); - printf("\r controlFile : %s \n", controlFile.c_str()); - printf("\r id : %s \n", id.c_str()); - printf("\r priority : %d \n", priority); - printf("\r input : %s \n", input.c_str()); - printf("\r output : %s \n", output.c_str()); - printf("\r setpoint : %0.2f\n", setpoint); - printf("\r prodfact : %0.2f\n", productFactor); - printf("\r actingDir : %s \n", (actingDir) ? "DIRECT" : "INDIRECT"); - printf("\r halert : %0.2f\n", highAlert); - 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\n"); - printf("\r currentState : %s\n", mapper[currentState].c_str()); - printf("\r high band : %0.2f\n", setpoint + tolerance); - printf("\r current reading : %0.2f [0x%04x]\n", inputValue.value, inputValue.errflag ); - printf("\r low band : %0.2f\n", setpoint - tolerance); - printf("\r\n"); + std::cout << left << setw(32) << setfill(' ') << controlFile; + std::cout << left << setw(20) << setfill(' ') << id; + std::cout << left << setw(6) << setfill(' ') << priority; + std::cout << left << setw(20) << setfill(' ') << input; + std::cout << left << setw(20) << setfill(' ') << output; + std::cout << left << setw(8) << setfill(' ') << setpoint; + std::cout << left << setw(12) << setfill(' ') << (actingDir ? "direct" : "indirect"); + std::cout << left << setw(16) << setfill(' ') << mapper[currentState]; + std::cout << right << setw(8) << setfill(' ') << setpoint + tolerance << " <- "; + std::cout << left << setw(8) << setfill(' ') << inputValue.value << " -> "; + std::cout << left << setw(8) << setfill(' ') << setpoint - tolerance; + + std::cout.flush(); } \ No newline at end of file