Erick / Mbed 2 deprecated ICE_BLE_TEST

Dependencies:   NaturalTinyShell_ice libmDot-12Sept mbed-rtos mbed

Fork of ICE by Erick

src/ConfigurationHandler/Controls/ManualControl.h

Committer:
jmarkel44
Date:
2016-09-30
Revision:
164:7cecd731882e
Parent:
131:a290a3934132
Child:
217:d5a2ff093319

File content as of revision 164:7cecd731882e:

/******************************************************************************
 *
 * File:                ManualControl.h
 * Desciption:          ICE Manual Control Class
 *
 *****************************************************************************/
#ifndef MANUALCONTROL_H
#define MANUALCONTROL_H

#include <string>

using namespace std;

class ManualControl
{
private:
    string          controlFile;        // name of the control file
    string          id;                 // identifier
    string          output;             // output 
    unsigned int    type;               // timed, continuous, setpoint
    unsigned int    priority;           // control priority
    unsigned int    duration;
    float           setpoint;
    unsigned int    state;              // ON or OFF
    unsigned int    percent;            // analog/manual value
    
    enum State {
        STATE_INIT,
        STATE_STARTUP,
        STATE_CONTROL_ON,
        STATE_CONTROL_OFF
    };
    State           currentState;
    
public:
    ManualControl() {};
    ~ManualControl() {
        printf("\r%s destructor invoked\n", __func__);
    }
    // load a control from the control file
    bool load(string filename);
    string getControlFile(void) const {
        return controlFile;
    }
    
    void    start(void);
    int     update(void);
    int     powerOutput(void);
    int     unregisterControl();
    void    display(void);
};

#endif