Method: RCSimCinterface.rcsim_make_systemI
- Defined in:
- ext/hruby_sim/hruby_rcsim_build.c
.rcsim_make_systemI(name, systemT) ⇒ Object
Creating a system instance C object.
363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 |
# File 'ext/hruby_sim/hruby_rcsim_build.c', line 363 VALUE rcsim_make_systemI(VALUE mod, VALUE name, VALUE systemT) { // printf("rcsim_make_systemI\n"); /* Allocates the system instance. */ SystemI systemI = (SystemI)malloc(sizeof(SystemIS)); // printf("systemI=%p\n",systemI); /* Set it up. */ systemI->kind = SYSTEMI; systemI->owner = NULL; systemI->name = strdup(StringValueCStr(name)); // printf("systemI->name=%p\n",systemI->name); // /* Name is made empty since redundant with Eigen system. */ // systemI->name = ""; value_to_rcsim(SystemTS,systemT,systemI->system); systemI->num_systems = 1; systemI->systems = (SystemT*)malloc(sizeof(SystemT[1])); // printf("systemI->systems=%p\n",systemI->systems); fflush(stdout); systemI->systems[0] = systemI->system; /* Configure the systemI to execute the default systemT. */ configure(systemI,0); /* Returns the C system instance embedded into a ruby VALUE. */ VALUE res; rcsim_to_value(SystemIS,systemI,res); return res; } |