#include "../cdev/rnsQueryCollector.h"

void populate1 ( rnsQueryCollector & collector )
	{
	cdevData data;
	static int index = 0;

	cdev_TS_STAMP ts;
	ts.nsec         = index;
	ts.secPastEpoch = index;
		
	char str[50];
	sprintf(str, "I am the value - %i", index);

	if(index%10==0) {}
	else if(index%1==0) data.insert("value", str);
	else           data.insert("value", index);
	
	data.insert("status", (short) -index);
	data.insert("severity", (unsigned short) index);
	if(index%1==0) data.insert("controlLow", (double)((double)index)+0.5);
	if(index%2==0) data.insert("controlHigh", (float)(((float)index)+0.25));
	if(index%3==0) data.insert("displayLow", (long)-(index+10000));
	if(index%4==0) data.insert("displayHigh", (unsigned long)index+10000);
	data.insert("time", ts);
	data.insert("alarmHigh", (unsigned char *)str, 50);
	if((index+1)%200==0) data.insert("alarmLow", (unsigned char)index);
	collector.collect(data);

	index++;
	}


int main()
{
cdevData data;
char flat[50];
memset(flat, 0, sizeof(char));
rnsQueryCollector collector(data);
data.insert("controlLow", (unsigned char *)flat, 50);
for(int i=0; i<200; i++) populate1(collector);
data.asciiDump();
}

