| 2144 | |
| 2145 | |
| 2146 | int |
| 2147 | TclAddAlgorithmRecorder(ClientData clientData, Tcl_Interp *interp, int argc, |
| 2148 | TCL_Char **argv, Domain &theDomain, EquiSolnAlgo *theAlgo) |
| 2149 | { |
| 2150 | Recorder *theRecorder = 0; |
| 2151 | theAlgorithm = theAlgo; |
| 2152 | |
| 2153 | TclCreateRecorder(clientData, interp, argc, argv, theDomain, &theRecorder); |
| 2154 | |
| 2155 | if (theRecorder == 0) { |
| 2156 | char buffer[] = "-1"; |
| 2157 | Tcl_SetResult(interp, buffer, TCL_VOLATILE); |
| 2158 | // sprintf(interp->result,"-1"); |
| 2159 | return TCL_ERROR; |
| 2160 | } |
| 2161 | |
| 2162 | // add the recorder to the domain, |
| 2163 | // NOTE: will not be called with theALgo == 0 |
| 2164 | // see ~/g3/SRC/tcl/commands.C file |
| 2165 | if (theAlgorithm != 0) { |
| 2166 | if ((theAlgorithm->addRecorder(*theRecorder)) < 0) { |
| 2167 | opserr << "WARNING could not add to domain - recorder " << argv[1]<< endln; |
| 2168 | delete theRecorder; |
| 2169 | return TCL_ERROR; |
| 2170 | } |
| 2171 | } |
| 2172 | |
| 2173 | int recorderTag = theRecorder->getTag(); |
| 2174 | char buffer[30]; |
| 2175 | sprintf(buffer,"%d",recorderTag); |
| 2176 | Tcl_SetResult(interp, buffer, TCL_VOLATILE); |
| 2177 | |
| 2178 | return TCL_OK; |
| 2179 | } |
| 2180 |
no test coverage detected