bool PowerMonitor::handleGetPowerPoint(Request &req, Response &resp) { Json::Value root; OctaveBuiltin test; Json::Value in, out; std::vector<double> fwd, ref; double xincr; if (m_fake) { getWavesDummy("1", "2", fwd, ref, xincr); } else { getWaves("3", "4", fwd, ref, xincr); } std::cout << "Data array size = " << fwd.size() << std::endl; for (int i = 0; i < fwd.size(); i++) { //root["data"]["ref"][i] = ref[i]; //root["data"]["fwd"][i] = fwd[i]; in["data"]["ref"][i] = ref[i]; in["data"]["fwd"][i] = fwd[i]; } //root["data"]["xincr"] = xincr; in["data"]["xincr"] = xincr; in["base_freq"] = req.m_json["base_freq"].asFloat(); test.runScript("analyze", in, out); root["out"] = out; root["status"] = "success"; resp = root; return true; }
std::vector<std::vector<t_stage *> > Stage::getStage(int level) { std::vector<std::vector<t_stage *> > tmp; for (int i = 0; i < 6; i++) // 6 vagues { tmp.push_back(getWaves()); } return (tmp); }