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.h@28:c410a61238bb, 2016-09-08 (annotated)
- Committer:
- jmarkel44
- Date:
- Thu Sep 08 20:12:04 2016 +0000
- Revision:
- 28:c410a61238bb
- Parent:
- 20:653923c2f37a
- Child:
- 30:738359dfdab1
implement the load function; ;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jmarkel44 | 5:5e77a1db4d45 | 1 | /****************************************************************************** |
jmarkel44 | 5:5e77a1db4d45 | 2 | * |
jmarkel44 | 5:5e77a1db4d45 | 3 | * File: SetpointControl.h |
jmarkel44 | 5:5e77a1db4d45 | 4 | * Desciption: ICE Timer Control Class |
jmarkel44 | 5:5e77a1db4d45 | 5 | * |
jmarkel44 | 5:5e77a1db4d45 | 6 | *****************************************************************************/ |
jmarkel44 | 5:5e77a1db4d45 | 7 | #ifndef SETPOINTCONTROL_H |
jmarkel44 | 5:5e77a1db4d45 | 8 | #define SETPOINTCONTROL_H |
jmarkel44 | 5:5e77a1db4d45 | 9 | |
jmarkel44 | 28:c410a61238bb | 10 | #include "MbedJSONValue.h" |
jmarkel44 | 5:5e77a1db4d45 | 11 | #include <string> |
jmarkel44 | 13:c80c283f9db2 | 12 | using namespace std; |
jmarkel44 | 5:5e77a1db4d45 | 13 | |
jmarkel44 | 5:5e77a1db4d45 | 14 | class SetpointControl |
jmarkel44 | 5:5e77a1db4d45 | 15 | { |
jmarkel44 | 5:5e77a1db4d45 | 16 | private: |
jmarkel44 | 5:5e77a1db4d45 | 17 | string controlFile; // name of the control file |
jmarkel44 | 20:653923c2f37a | 18 | string id; // control identifier |
jmarkel44 | 20:653923c2f37a | 19 | string name; // friendly name |
jmarkel44 | 28:c410a61238bb | 20 | int priority; // control priority |
jmarkel44 | 20:653923c2f37a | 21 | string input; // control input |
jmarkel44 | 28:c410a61238bb | 22 | string output; // control output |
jmarkel44 | 28:c410a61238bb | 23 | double productFactor; |
jmarkel44 | 28:c410a61238bb | 24 | double highAlert; |
jmarkel44 | 28:c410a61238bb | 25 | double lowAlert; |
jmarkel44 | 28:c410a61238bb | 26 | double highFailsafe; |
jmarkel44 | 28:c410a61238bb | 27 | double lowFailsafe; |
jmarkel44 | 28:c410a61238bb | 28 | double tol; |
jmarkel44 | 28:c410a61238bb | 29 | |
jmarkel44 | 28:c410a61238bb | 30 | MbedJSONValue json_value; |
jmarkel44 | 28:c410a61238bb | 31 | |
jmarkel44 | 5:5e77a1db4d45 | 32 | public: |
jmarkel44 | 20:653923c2f37a | 33 | // constructor |
jmarkel44 | 19:9bc8fabeddfa | 34 | SetpointControl() {}; |
jmarkel44 | 12:ea87887ca7ad | 35 | ~SetpointControl() { |
jmarkel44 | 12:ea87887ca7ad | 36 | printf("\r%s destructor invoked\n", __func__); |
jmarkel44 | 28:c410a61238bb | 37 | } |
jmarkel44 | 28:c410a61238bb | 38 | |
jmarkel44 | 28:c410a61238bb | 39 | // Load a control from the control file |
jmarkel44 | 28:c410a61238bb | 40 | bool load(string filename); |
jmarkel44 | 28:c410a61238bb | 41 | |
jmarkel44 | 12:ea87887ca7ad | 42 | string getControlFile(void) { |
jmarkel44 | 12:ea87887ca7ad | 43 | return controlFile; |
jmarkel44 | 12:ea87887ca7ad | 44 | } |
jmarkel44 | 28:c410a61238bb | 45 | string getId(void) { |
jmarkel44 | 28:c410a61238bb | 46 | return id; |
jmarkel44 | 28:c410a61238bb | 47 | } |
jmarkel44 | 28:c410a61238bb | 48 | string getName(void) { |
jmarkel44 | 28:c410a61238bb | 49 | return name; |
jmarkel44 | 28:c410a61238bb | 50 | } |
jmarkel44 | 28:c410a61238bb | 51 | unsigned int getPriority(void) { |
jmarkel44 | 28:c410a61238bb | 52 | return priority; |
jmarkel44 | 28:c410a61238bb | 53 | } |
jmarkel44 | 28:c410a61238bb | 54 | string getInput(void) { |
jmarkel44 | 28:c410a61238bb | 55 | return input; |
jmarkel44 | 28:c410a61238bb | 56 | } |
jmarkel44 | 28:c410a61238bb | 57 | string getOutput(void) { |
jmarkel44 | 28:c410a61238bb | 58 | return output; |
jmarkel44 | 28:c410a61238bb | 59 | } |
jmarkel44 | 28:c410a61238bb | 60 | float getProductFactor(void) { |
jmarkel44 | 28:c410a61238bb | 61 | return productFactor; |
jmarkel44 | 28:c410a61238bb | 62 | } |
jmarkel44 | 28:c410a61238bb | 63 | float getHighAlert(void) { |
jmarkel44 | 28:c410a61238bb | 64 | return highAlert; |
jmarkel44 | 28:c410a61238bb | 65 | } |
jmarkel44 | 28:c410a61238bb | 66 | float getLowAlert(void) { |
jmarkel44 | 28:c410a61238bb | 67 | return lowAlert; |
jmarkel44 | 28:c410a61238bb | 68 | } |
jmarkel44 | 28:c410a61238bb | 69 | float getHighFailsafe(void) { |
jmarkel44 | 28:c410a61238bb | 70 | return highFailsafe; |
jmarkel44 | 28:c410a61238bb | 71 | } |
jmarkel44 | 28:c410a61238bb | 72 | float getLowFailsafe(void) { |
jmarkel44 | 28:c410a61238bb | 73 | return lowFailsafe; |
jmarkel44 | 28:c410a61238bb | 74 | } |
jmarkel44 | 28:c410a61238bb | 75 | float getTol(void) { |
jmarkel44 | 28:c410a61238bb | 76 | return tol; |
jmarkel44 | 20:653923c2f37a | 77 | } |
jmarkel44 | 5:5e77a1db4d45 | 78 | }; |
jmarkel44 | 5:5e77a1db4d45 | 79 | |
jmarkel44 | 5:5e77a1db4d45 | 80 | #endif |