#ifndef MAIN_H
#define MAIN_H


//	Floorplan::IndoorMap* map = Floorplan::Reader::readFromFile("/apps/android/workspace/OTHER2017/data/SHL33a.xml");


//	WiFiFingerprints calib("/apps/android/workspace/OTHER2017/data/wifi_fp.dat");

//	VAPGrouper vap(VAPGrouper::Mode::LAST_MAC_DIGIT_TO_ZERO, VAPGrouper::Aggregation::AVERAGE);

//	WiFiOptimizer opt(map, vap);
//	opt.addFingerprints(calib);
//	WiFiOptimizer::APParamsList list = opt.optimizeAll();

//	for (Floorplan::Floor* floor : map->floors) {
//		for (Floorplan::AccessPoint* ap : floor->accesspoints) {
//			const WiFiOptimizer::APParamsMAC* params = list.get(ap->mac);
//			if (params) {
//				const float delta = ap->getPos(floor).getDistance(Point3(params->params.x, params->params.y, params->params.z));
//				std::cout << ap->mac << ": " << delta << "m" << std::endl;
//			}
//		}
//	}



//	static K::Gnuplot gp;
//	gp << "set view equal xy\n";

//	K::GnuplotSplot splot;
//	K::GnuplotSplotElementPoints points; splot.add(&points); points.setPointType(7); points.setPointSize(0.5);
//	K::GnuplotSplotElementLines lines; splot.add(&lines);

//	for (Floorplan::Floor* floor : map->floors) {
//		for (Floorplan::FloorObstacle* obs : floor->obstacles) {
//			Floorplan::FloorObstacleLine* line = dynamic_cast<Floorplan::FloorObstacleLine*>(obs);
//			if (line) {
//				const K::GnuplotPoint3 p1(line->from.x, line->from.y, floor->atHeight);
//				const K::GnuplotPoint3 p2(line->to.x, line->to.y, floor->atHeight);
//				lines.addSegment(p1, p2);
//			}
//		}
//	}

//	for (const WiFiOptimizer::APParamsMAC& ap : list.get()) {
//		const K::GnuplotPoint3 p3(ap.params.x, ap.params.y, ap.params.z);
//		points.add(p3);
//		const Floorplan::AccessPoint* fap = FloorplanHelper::getAP(map, ap.mac);
//		std::string lbl = (fap) ? (fap->name) : (ap.mac.asString());
//		if (!fap) {
//		gp << "set label '" << lbl << "' at " << ap.params.x+1 << "," << ap.params.y+1 << "," << ap.params.z+0.3 << "\n";

//			std::cout << "AP missing in Map: " << ap.mac.asString() << " @ " << ap.params.x << "," << ap.params.y << "," << ap.params.z << std::endl;
//		}
//	}

//	gp.draw(splot);
//	gp.flush();

//	int i = 0; (void) i;

#endif // MAIN_H
