MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / ops_addTimeSeries

Function ops_addTimeSeries

SRC/interpreter/PythonModelBuilder.cpp:287–313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

285}
286
287PyObject *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
315PyObject *ops_addPattern(PyObject *self, PyObject *args)
316{

Callers

nothing calls this directly

Calls 5

OPS_ResetCommandLineFunction · 0.85
OPS_addTimeSeriesFunction · 0.85
isSetMethod · 0.80
OPS_GetStringFunction · 0.70
getTagMethod · 0.45

Tested by

no test coverage detected