Ignore:
Timestamp:
Aug 4, 2016 10:11:45 AM (8 years ago)
Author:
lewis
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
cc03f59
Parents:
18e7309
Message:

Implement getters in python class

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/file_converter/c_ext/bsl_loader.c

    r18e7309 r2760662  
    5353} 
    5454 
     55static PyObject *get_filename(CLoader *self, PyObject *args) { 
     56    return Py_BuildValue("s", self->params.filename); 
     57} 
     58 
     59static PyObject *get_frame(CLoader *self, PyObject *args) { 
     60    return Py_BuildValue("i", self->params.frame); 
     61} 
     62 
     63static PyObject *get_n_pixels(CLoader *self, PyObject *args) { 
     64    return Py_BuildValue("i", self->params.n_pixels); 
     65} 
     66 
     67static PyObject *get_n_rasters(CLoader *self, PyObject *args) { 
     68    return Py_BuildValue("i", self->params.n_rasters); 
     69} 
     70 
    5571static PyObject *load_data(CLoader *self, PyObject *args) { 
    5672    int raster; 
     
    100116static PyMethodDef CLoader_methods[] = { 
    101117    { "to_string", (PyCFunction)to_string, METH_VARARGS, "Print the objects params" }, 
    102     {"load_data", (PyCFunction)load_data, METH_VARARGS, "Load the data into a numpy array"}, 
     118    { "get_filename", (PyCFunction)get_filename, METH_VARARGS, "Get the filename" }, 
     119    { "get_frame", (PyCFunction)get_frame, METH_VARARGS, "Get the frame that will be loaded" }, 
     120    { "get_n_pixels", (PyCFunction)get_n_pixels, METH_VARARGS, "Get n_pixels" }, 
     121    { "get_n_rasters", (PyCFunction)get_n_rasters, METH_VARARGS, "Get n_rasters" }, 
     122    { "load_data", (PyCFunction)load_data, METH_VARARGS, "Load the data into a numpy array" }, 
    103123    {NULL} 
    104124}; 
Note: See TracChangeset for help on using the changeset viewer.