X-Git-Url: https://git.llucax.com/z.facultad/75.68/celdas.git/blobdiff_plain/651df9d4bd2ec484ec71c80d7dd2165d7cf4290e..22822a747c21df2f9d99acd8dd2f3f3a9ea54a9a:/trunk/src/plugin.cpp diff --git a/trunk/src/plugin.cpp b/trunk/src/plugin.cpp index 20096f3..cea7975 100644 --- a/trunk/src/plugin.cpp +++ b/trunk/src/plugin.cpp @@ -50,20 +50,13 @@ int SAbrTeoriaGetAccion(brEval args[], brEval* result, void* data) return EC_OK; } -// void TeoriaDelete(pointer{Teoria}) -int SAbrTeoriaDelete(brEval args[], brEval* result, void* data) -{ - delete (CTeoria*) BRPOINTER(args); - return EC_OK; -} - /////////////////////////// CSistemaAutonomo ///////////////////////// -// pointer{SistemaAutonomo} SistemaAutonomoNew() +// pointer{SistemaAutonomo} SistemaAutonomoNew(int, int) int SAbrSistemaAutonomoNew(brEval args[], brEval* result, void* data) { - result->set(new CSistemaAutonomo()); + result->set(new CSistemaAutonomo(BRINT(args), BRINT(args+1))); return EC_OK; } @@ -74,10 +67,13 @@ int SAbrSistemaAutonomoAddTeoria(brEval args[], brEval* result, void* data) CTeoria* t = (CTeoria*) BRPOINTER(args+1); 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"; + std::cout << "Agrega teoria " << *t << ":\n"; + std::cout << "\tdatos_iniciales:\n" << t->datos_iniciales << "\n"; + std::cout << "\tdatos_finales:\n" << t->datos_finales << "\n"; #endif // DEBUG +#ifdef LOG + std::cout << "Agrega teoria: " << *t << "," << t->datos_iniciales << "," << t->datos_finales << "\n"; +#endif // LOG return EC_OK; } @@ -149,10 +145,8 @@ 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); + AT_POINTER, AT_INT, AT_INT, 0); brNewBreveCall(data, "SistemaAutonomoAddTeoria", SAbrSistemaAutonomoAddTeoria, AT_NULL, AT_POINTER, AT_POINTER, 0); brNewBreveCall(data, "SistemaAutonomoSetValue", SAbrSistemaAutonomoSetValue,