/*
 * aoutput.h
 *
 *  Created on: 08 Jun 2015
 *      Author: john
 */

#ifndef INCLUDE_AOUTPUT_H_
#define INCLUDE_AOUTPUT_H_

#include <port.h>

class cObjectAOutput : public cObjectPort
{
public:
   cObjectAOutput();
   cObjectAOutput(cObjectAOutput *obj);
   ~cObjectAOutput();
   cTagList * getTags();
   bool parse(KourierObject *,std::vector<KTag*>* ct = NULL);

   //potential problem with conversion as library returns double and we are casting to float.
   	bool parse(json_t *dataArray); //JSON
   	   //uses the append_new function for return arrays so that the json ref stays at 1
   	   //returns an array of all the values
   	json_t * getJSONObj(); //for JSON

   bool compIndex(cObject *);
   bool operator <(cObject &);
   char * printKey();
   cObject * clone();
   float getAlarmHighError() const;
   void setAlarmHighError(float alarmHighError);
   float getAlarmHighWarn() const;
   void setAlarmHighWarn(float alarmHighWarn);
   float getAlarmLowError() const;
   void setAlarmLowError(float alarmLowError);
   float getAlarmLowWarn() const;
   void setAlarmLowWarn(float alarmLowWarn);
   float getOutputValue() const;
   void setOutputValue(float outputValue);
   const char* getDisplayUnit() const;
   void setDisplayUnit(const char* displayUnit);
   float getGain() const;
   void setGain(float gain);
   float getOffset() const;
   void setOffset(float offset);
   float getSampledValue() const;
   void setSampledValue(float sampledValue);
   float getMaximumValue() const;
   void setMaximumValue(float maxValue);
   float getMinimumValue() const;
   void setMinimumValue(float minValue);

private:

   void populate_tags(KTag* tag);

   float mSampledValue;
   float mOffset;
   float mGain;
   float mOutputValue;
   float mAlarmLowWarn;
   float mAlarmLowError;
   float mAlarmHighWarn;
   float mAlarmHighError;
   char * mDisplayUnit;
   float mMaximumValue;
   float mMinimumValue;

};



#endif /* INCLUDE_AOUTPUT_H_ */
