X-Git-Url: https://git.llucax.com/z.facultad/75.68/celdas.git/blobdiff_plain/bf82eb53ad2ee702d3b950555a1e579c47b6a7d5..91255c290904e2384ec5ff2e07223f3977b879bc:/trunk/src/plugin.cpp?ds=inline diff --git a/trunk/src/plugin.cpp b/trunk/src/plugin.cpp index 3669ba5..52e1404 100644 --- a/trunk/src/plugin.cpp +++ b/trunk/src/plugin.cpp @@ -1,6 +1,9 @@ #include "sistemaautonomo.h" #include "slBrevePluginAPI.h" + +#ifdef DEBUG #include +#endif // DEBUG /////////////////////////// CTeoria ///////////////////////// @@ -42,16 +45,8 @@ int SAbrTeoriaGetNombre(brEval args[], brEval* result, void* data) // string TeoriaGetAccion(pointer{Teoria}) int SAbrTeoriaGetAccion(brEval args[], brEval* result, void* data) { - // TODO CTeoria* t = (CTeoria*) BRPOINTER(args); - // TODO result->set(t->accion.c_str()); - result->set("avanzar"); // FIXME - return EC_OK; -} - -// void TeoriaDelete(pointer{Teoria}) -int SAbrTeoriaDelete(brEval args[], brEval* result, void* data) -{ - delete (CTeoria*) BRPOINTER(args); + CTeoria* t = (CTeoria*) BRPOINTER(args); + result->set(t->funcion.c_str()); return EC_OK; } @@ -70,7 +65,12 @@ int SAbrSistemaAutonomoAddTeoria(brEval args[], brEval* result, void* data) { CSistemaAutonomo* sa = (CSistemaAutonomo*) BRPOINTER(args); CTeoria* t = (CTeoria*) BRPOINTER(args+1); - sa->teorias.add(t->nombre.c_str(), *t); + sa->teorias.add(t->nombre, t); +#ifdef DEBUG + std::cout << "Agrega teoria " << t->nombre << ":\n"; + std::cout << " .datos_iniciales:\n" << t->datos_iniciales << "\n"; + std::cout << " .datos_finales:\n" << t->datos_finales << "\n"; +#endif // DEBUG return EC_OK; } @@ -142,8 +142,6 @@ DLLEXPORT void SAbrFunctions(void *data) AT_STRING, AT_POINTER, 0); brNewBreveCall(data, "TeoriaGetAccion", SAbrTeoriaGetAccion, AT_STRING, AT_POINTER, 0); - brNewBreveCall(data, "TeoriaDelete", SAbrTeoriaDelete, - AT_NULL, AT_POINTER, 0); brNewBreveCall(data, "SistemaAutonomoNew", SAbrSistemaAutonomoNew, AT_POINTER, 0); brNewBreveCall(data, "SistemaAutonomoAddTeoria", SAbrSistemaAutonomoAddTeoria,