| 285 | } |
| 286 | |
| 287 | PyObject *ops_addTimeSeries(PyObject *self, PyObject *args) |
| 288 | { |
| 289 | // check model builder |
| 290 | if(pBuilder.isSet() == false) { |
| 291 | PyErr_SetString(PyExc_RuntimeError,"ERROR builder has not been set"); |
| 292 | return NULL; |
| 293 | } |
| 294 | |
| 295 | OPS_ResetCommandLine(PyTuple_Size(args), 0, args); |
| 296 | |
| 297 | const char *tsType = OPS_GetString(); |
| 298 | TimeSeries* theTimeSeries = OPS_ParseTimeSeriesCommand(tsType); |
| 299 | |
| 300 | if(theTimeSeries == 0) { |
| 301 | PyErr_SetString(PyExc_RuntimeError, "ERROR could not create TimeSeries."); |
| 302 | return NULL; |
| 303 | } |
| 304 | |
| 305 | // Now add the time |
| 306 | if(OPS_addTimeSeries(theTimeSeries) == false) { |
| 307 | PyErr_SetString(PyExc_RuntimeError, "ERROR could not add TimeSeries."); |
| 308 | delete theTimeSeries; // invoke the material objects destructor, otherwise mem leak |
| 309 | return NULL; |
| 310 | } |
| 311 | |
| 312 | return Py_BuildValue("d", theTimeSeries->getTag()); |
| 313 | } |
| 314 | |
| 315 | PyObject *ops_addPattern(PyObject *self, PyObject *args) |
| 316 | { |
nothing calls this directly
no test coverage detected