from .. import Availability, Class, Constant, Define, Method, Parameter, Type

gx_class = Class('NGRD',
                 doc="Neargrid")

gx_defines = [
]


gx_methods = {
    '': [

        Method('_Clear_NGRD', module='geocslib', version='6.0.0',
               availability=Availability.EXTENSION,
               doc="Clears all the parameters in a NGRD object",
               return_type=Type.VOID,
               return_doc="Nothing",
               parameters = [
                   Parameter('param0', type="NGRD",
                             doc="Handle to NGRD object (stores control parameters)")
               ]),

        Method('Create_NGRD', module='geocslib', version='6.0.0',
               availability=Availability.EXTENSION,
               doc="Create a NGRD.",
               return_type="NGRD",
               return_doc="NGRD if OK (NULL if error)"),

        Method('Destroy_NGRD', module='geocslib', version='6.0.0',
               availability=Availability.EXTENSION,
               doc="Destroy a NGRD.",
               return_type=Type.VOID,
               return_doc="Nothing",
               parameters = [
                   Parameter('param0', type="NGRD",
                             doc="NGRD to destroy.")
               ]),

        Method('iLoadParms_NGRD', module='geocslib', version='6.3.0',
               availability=Availability.EXTENSION,
               notes="""
               If the control file name passed into this function is a file
               which does not exist, then the defaults for a Neargrid control
               file will be generated and put into the NGRD object.
               Otherwise, the control file's settings are retrieved from
               the file and loaded into the NGRD object.
               """,
               doc="Retrieves a Neargrid object's control parameters from a file.",
               return_type=Type.INT32_T,
               return_doc="0 OK, 1 Error.",
               parameters = [
                   Parameter('param0', type="NGRD",
                             doc="NGRD to load parameter settings into"),
                   Parameter('param1', type=Type.STRING,
                             doc="Name of file to get the parameter settings from")
               ]),

        Method('iRun_NGRD', module='geocslib', version='6.3.0',
               availability=Availability.EXTENSION,
               doc="""
               Executes the Neargrid program, using the input channel and
               output file parameters.
               """,
               return_type=Type.INT32_T,
               return_doc="0 OK, 1 Error.",
               parameters = [
                   Parameter('param0', type="NGRD",
                             doc="Handle to NGRD object (stores control parameters)"),
                   Parameter('param1', type=Type.STRING,
                             doc="Name of Z Channel to perfrom gridding on"),
                   Parameter('param2', type="DAT",
                             doc="Handle to source DAT object (from database)"),
                   Parameter('param3', type="DAT",
                             doc="Handle to output grid file DAT")
               ]),

        Method('iSaveParms_NGRD', module='geocslib', version='6.3.0',
               availability=Availability.EXTENSION,
               notes="""
               If the control file did not previously exist, it will be
               created. Otherwise, the old file will be overwritten.
               """,
               doc="""
               Puts the Neargrid object's control parameters back into
               its control file.
               """,
               return_type=Type.INT32_T,
               return_doc="0 OK, 1 Error.",
               parameters = [
                   Parameter('param0', type="NGRD",
                             doc="NGRD object to get parameters from and put into the control file"),
                   Parameter('param1', type=Type.STRING,
                             doc="Name of file to put the parameter settings into")
               ])
    ]
}

