[Qgis-developer] Re: [saga-gis-developer] saga - qgis interface

gianluca.massei g_massa at libero.it
Mon Feb 14 13:05:03 EST 2011


Thanks,
your suggest is very usefull and I'm going to  follow it.
About the xml output (like --interface-description)I was referring to 
"save" button in each form.  Output is an xml file that I hope to be 
able to use for generating interfaces on-the-flyin qgis.

best regards,
Gianluca


Il 14/02/2011 12.11, Volker Wichmann ha scritto:
> I'm not aware of a switch like --interface-description for saga_cmd,
> but it prints out usage information in case you provide a module
> library and module name.
>
> But instead of extending saga_cmd to write out a xml description for a
> module, I would suggest to rebuild the saga_cmd logic in python in
> order to get the parameters (and their descriptions). This is possible
> by using the SAGA python API, e.g. the following snippet lists all
> modules available within a module library:
>
>
>
> import saga_api, sys, os
>
>
> #*******************************************************************************
>
> def printLibraries(modlib):
>     mlb     = saga_api.CSG_Module_Library()
>
>     if mlb.Create(saga_api.CSG_String(modlib)) == 0:
>         print 'ERROR loading ' + modlib
>         return 0
>
>     for i in range(0, mlb.Get_Count()):
>         m = mlb.Get_Module(i)
>
>         if m.is_Interactive():
>             print i, ' ' + m.Get_Name() + ' (interactive)'
>         else:
>             print i, ' ' + m.Get_Name()
>
>     return 1
>
>
> #*******************************************************************************
>
> if __name__ == '__main__':
>
>     if len( sys.argv ) != 2:
>         print 'Usage: get_info_modulelib.py <in: module library>'
>     else:
>         modlib    = os.environ['SAGA_MLB'] + '/' + sys.argv[1]
>
>         printLibraries(modlib)
>
>
>
> Starting from this, you could write out/query the parameters of each
> module and use that to execute the module directly from python or to
> execute it by calling saga_cmd with the appropriate parameters.
>
> Best regards,
> Volker
>
>
> On 02/13/2011 10:29 PM, g_massa at libero.it wrote:
>> based on Paolo Cavallini's idea I'm trying to  build a plugin for
>> interface
>> SAGA modules in Qgis.
>> In saga we can obtain a xml file from each graphical input interface
>> (like "--
>> interface-description" in grass). Can I use that xml file for generate
>> graphical interface in qgis plugin ? In other words, I'm  trying to
>> avoid to
>> build by hand single form for each saga module in qgis's plugin.
>> Thanks
>>
>> GM
>>
>> ------------------------------------------------------------------------------
>>
>> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio
>> XE:
>> Pinpoint memory and threading errors before they happen.
>> Find and fix more than 250 security defects in the development cycle.
>> Locate bottlenecks in serial and parallel code that limit performance.
>> http://p.sf.net/sfu/intel-dev2devfeb
>> _______________________________________________
>> saga-gis-developer mailing list
>> saga-gis-developer at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/saga-gis-developer
>
>
>
> -----
> Nessun virus nel messaggio.
> Controllato da AVG - www.avg.com
> Versione: 10.0.1204 / Database dei virus: 1435/3442 -  Data di
> rilascio: 13/02/2011
>
>



More information about the Qgis-developer mailing list