#include #include //#include "Chassis.h" //#include "ServerWeb.h" int Web_nouvelle_entree; int type_requete; struct chassis_emission_t chassis_emission_web; #define FORM \ "\n" \ "\n" \ "\n" \ "\n" \ "A simple form\n" \ "\n" \ "\n" \ "
\n" \ "
" \ "\n" \ "
" \ "\n" \ "
" \ "\n" \ "
" \ "\n" \ "
" \ "\n" \ "
" \ "\n" \ "
" \ "\n" \ "
" \ "\n" \ "
" \ "
" \ "\n" \ "
" \ "\n" \ "
" \ "
" \ "\n" \ "
" \ "
" \ "\n" \ "
" \ "
" \ "\n" \ "
\n" \ "\n" \ "\n" WebServer server(80); void Web_init(){ server.begin(); server.on("/form", handleForm); } bool Web_nouveau_message(){ if(Web_nouvelle_entree){ Web_nouvelle_entree = 0; return 1; } return 0; } int Web_type_requete(){ return type_requete; } void Web_gestion(){ server.handleClient(); } struct chassis_emission_t Web_get_donnees(){ return chassis_emission_web; } void handleForm() { String message; type_requete = WEB_DEPLACEMENT_RELATIF; message += FORM; server.send(200, "text/html", message); String myString0 = server.arg("X"); //positon de cmd en X mm // x= myString0.toInt() * coef_mvt/10; chassis_emission_web.translation_x_mm = myString0.toInt(); String myString1 = server.arg("Y"); //positon de cmd en Y mm // y= myString1.toInt() * coef_mvt/10; chassis_emission_web.translation_y_mm = myString1.toInt(); String myString2 = server.arg("R"); //positon de cmd en Rotation Deg ° chassis_emission_web.rotation_z_rad = myString2.toInt() * 13.88888; String myString3 = server.arg("V"); // Vitesse de cmd en chassis_emission_web.vitesse = myString3.toInt(); String myString4 = server.arg("A"); // Acceleration de cmd chassis_emission_web.acceleration = myString4.toInt(); Web_nouvelle_entree=1; }