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
src/ConfigurationHandler/Controls/SetpointControl.cpp@17:dfa2c53b3f38, 2016-09-07 (annotated)
- Committer:
- jmarkel44
- Date:
- Wed Sep 07 18:43:59 2016 +0000
- Revision:
- 17:dfa2c53b3f38
- Parent:
- 14:cc916fa8dd11
new commands added for mDot stats;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jmarkel44 | 14:cc916fa8dd11 | 1 | /****************************************************************************** |
jmarkel44 | 14:cc916fa8dd11 | 2 | * |
jmarkel44 | 14:cc916fa8dd11 | 3 | * File: SetpointControl.c |
jmarkel44 | 14:cc916fa8dd11 | 4 | * Desciption: ICE Timer Control Class implementation |
jmarkel44 | 14:cc916fa8dd11 | 5 | * |
jmarkel44 | 14:cc916fa8dd11 | 6 | *****************************************************************************/ |
jmarkel44 | 13:c80c283f9db2 | 7 | #include "SetpointControl.h" |
jmarkel44 | 14:cc916fa8dd11 | 8 | #include "mDot.h" |
jmarkel44 | 13:c80c283f9db2 | 9 | |
jmarkel44 | 14:cc916fa8dd11 | 10 | extern mDot *GLOBAL_mdot; |
jmarkel44 | 14:cc916fa8dd11 | 11 | |
jmarkel44 | 14:cc916fa8dd11 | 12 | /***************************************************************************** |
jmarkel44 | 14:cc916fa8dd11 | 13 | * Function: SetpointControl() |
jmarkel44 | 14:cc916fa8dd11 | 14 | * Description: Setpoint control constructor |
jmarkel44 | 14:cc916fa8dd11 | 15 | * |
jmarkel44 | 14:cc916fa8dd11 | 16 | * @param filename (unused) |
jmarkel44 | 14:cc916fa8dd11 | 17 | * @return none |
jmarkel44 | 14:cc916fa8dd11 | 18 | *****************************************************************************/ |
jmarkel44 | 13:c80c283f9db2 | 19 | SetpointControl::SetpointControl(string filename) : controlFile(filename) |
jmarkel44 | 13:c80c283f9db2 | 20 | { |
jmarkel44 | 14:cc916fa8dd11 | 21 | // attempt to open the control file (established by the data handlers) |
jmarkel44 | 14:cc916fa8dd11 | 22 | printf("\r%s: opening control file %s\n", __func__, controlFile.c_str()); |
jmarkel44 | 14:cc916fa8dd11 | 23 | mDot::mdot_file file = GLOBAL_mdot->openUserFile(controlFile.c_str(), mDot::FM_RDONLY); |
jmarkel44 | 17:dfa2c53b3f38 | 24 | |
jmarkel44 | 17:dfa2c53b3f38 | 25 | // TODO: throw an exception if this fails |
jmarkel44 | 14:cc916fa8dd11 | 26 | printf("\r %s: file.fd = %d\n", __func__, file.fd); |
jmarkel44 | 14:cc916fa8dd11 | 27 | |
jmarkel44 | 14:cc916fa8dd11 | 28 | // use the jSON parser to extract the data |
jmarkel44 | 14:cc916fa8dd11 | 29 | |
jmarkel44 | 14:cc916fa8dd11 | 30 | // close the file |
jmarkel44 | 14:cc916fa8dd11 | 31 | GLOBAL_mdot->closeUserFile(file); |
jmarkel44 | 14:cc916fa8dd11 | 32 | } |