int main() {

	DBHandler db("/home/sailbot/sailingrobot/asr.db");

	/*"Mock" system state model*/
	SystemStateModel systemStateModel = SystemStateModel(
			GPSModel("",PositionModel(0,0),0,0,0,0),
			WindsensorModel(0,0,0),
			CompassModel(0,0,0,AccelerationModel(0,0,0) ),
			AnalogArduinoModel(0, 0, 0, 0),
			0,
			0
		);

	SystemState systemState(systemStateModel);

	ExternalCommand externalCommand("<timestamp>", false, 0, 0);


	try {
		xBeeSync sync(&externalCommand, &systemState, &db, false, true, true, 0.2);
		/*Insert mock data into db*/
		db.insertDataLog(systemStateModel,1,1,1.0,1.0,1.0,true,true,1,1.0,0);
		sync.run();
	} catch(const char* error) {
		std::cout << error << std::endl;
	}

	/*Uncomment the run section to test integeration*/
	/*This test aims to push one mock datalog up to the server*/


}
Beispiel #2
0
void
ExecutePrefs::applySLOT()
{
  m_cfg->setBool( "External", "exec", startExternal() );  
  m_cfg->setBool( "External", "raising", !externalFalling() );
  m_cfg->setString( "External", "raising-threshold", ui_execRaisingThreshold->text() );
  m_cfg->setString( "External", "falling-threshold", ui_execFallingThreshold->text() );  
  m_cfg->setBool( "External", "disconnect", disconnectExternal() );
  m_cfg->setString( "External", "command", externalCommand() );
}