wsn.cc
/*
 * Temperature and RH are taken from 'data.csv'
 */
Temperature and RH are taken from 'data.csv'
Temperature and RH are taken from ' data . csv '
static void updateTemp(double time) {
	std::string str = readData();
	std::istringstream iss(str);
	double tim;
	iss >> tim >> temp >> hum;
	tdataset.Add(Time::FromDouble(time*100, Time::S).ToDouble(Time::H), temp, hum);
	if(!stateA && !stateB && (temp >= maxTemp || hum <= minH) && 
			(soilMoisture <= minMoisture + 2*(maxMoisture-minMoisture)/5)) {
		stateB = true;
	}
	else if(stateA && hum <= minH - (maxH - minH) / 3 && 
			temp >= maxTemp + (maxTemp - minTemp) / 3) {
		stateB = true;
	}
	else if(stateA && stateB && (hum >= maxH || temp <= maxTemp) 
			&& soilMoisture < maxMoisture) {
		stateA = true;
		stateB = false;
	}
	else if(stateB && (hum >= maxH || temp <= maxTemp) && 
			(soilMoisture > minMoisture)) {
		stateA = stateB = false;
	}
	else if(stateB && soilMoisture <= minMoisture) { 
		stateA = true;
	}
	updateState(time);
}
static void updateTemp ( double time ) { std :: string str = readData ( ) ; std :: istringstream iss ( str ) ; double tim ; iss >> tim >> temp >> hum ; tdataset . Add ( Time :: FromDouble ( time * 100 , Time :: S ) . ToDouble ( Time :: H ) , temp , hum ) ; if ( ! stateA && ! stateB && ( temp >= maxTemp || hum <= minH ) && ( soilMoisture <= minMoisture + 2 * ( maxMoisture - minMoisture ) / 5 ) ) { stateB = true ; } else if ( stateA && hum <= minH - ( maxH - minH ) / 3 && temp >= maxTemp + ( maxTemp - minTemp ) / 3 ) { stateB = true ; } else if ( stateA && stateB && ( hum >= maxH || temp <= maxTemp ) && soilMoisture < maxMoisture ) { stateA = true ; stateB = false ; } else if ( stateB && ( hum >= maxH || temp <= maxTemp ) && ( soilMoisture > minMoisture ) ) { stateA = stateB = false ; } else if ( stateB && soilMoisture <= minMoisture ) { stateA = true ; } updateState ( time ) ; }
Temperature and RH are taken from 'data.csv'
Temperature and RH are taken from ' data . csv '
//updating states //C->B // A->O // O -> A // B->C // B -> O