Changeset 900 for branches/prototype-v0/zoo-project/zoo-kernel
- Timestamp:
- Mar 28, 2019, 11:31:26 PM (6 years ago)
- Location:
- branches/prototype-v0/zoo-project/zoo-kernel
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/prototype-v0/zoo-project/zoo-kernel/ZOOMakefile.opts.in
r873 r900 80 80 MS_FILE=@MS_FILE@ 81 81 82 ZOO_CFLAGS= @GETTEXT_CFLAGS@-I${ZRPATH}/../thirds/cgic206/ -I${ZRPATH}/zoo-kernel/83 ZOO_LDFLAGS=@ GETTEXT_LDFLAGS@ @OPENSSL_LDFLAGS@ @UUID_LDFLAGS@82 ZOO_CFLAGS=-I${ZRPATH}/../thirds/cgic206/ -I${ZRPATH}/zoo-kernel/ 83 ZOO_LDFLAGS=@OPENSSL_LDFLAGS@ @UUID_LDFLAGS@ 84 84 85 85 JAVACFLAGS=@JAVA_CPPFLAGS@ … … 119 119 MONO_FILE=@MONO_FILE@ 120 120 121 CFLAGS=@SSH2_CPPFLAGS@ @ GETTEXT_CFLAGS@ @PROJ_CPPFLAGS@ @RELY_ON_DB@ @DEB_DEF@ -fpic @OPENSSL_CFLAGS@ @UUID_CFLAGS@ ${FCGI_CFLAGS} ${YAML_CFLAGS} ${MACOS_CFLAGS} ${MS_CFLAGS} -I../../thirds/cgic206 -I. -DLINUX_FREE_ISSUE #-DDEBUG #-DDEBUG_SERVICE_CONF122 LDFLAGS=-lzoo_service @SSH2_LDFLAGS@ @PROJ_LDFLAGS@ @DEFAULT_LIBS@ -L../../thirds/cgic206 -lcgic ${GDAL_LIBS} ${XML2LDFLAGS} ${PYTHONLDFLAGS} ${PERLLDFLAGS} ${PHPLDFLAGS} ${JAVALDFLAGS} ${JSLDFLAGS} ${FCGI_LDFLAGS} @OPENSSL_LDFLAGS@ @UUID_LDFLAGS@ ${MS_LDFLAGS} ${MACOS_LD_FLAGS} ${MACOS_LD_NET_FLAGS} ${YAML_LDFLAGS} ${OTBLDFLAGS} ${SAGA_LDFLAGS} ${MONO_LDFLAGS} ${RLDFLAGS} @ GETTEXT_LDFLAGS@ @JSON_LDFLAGS@ @XSLT_LDFLAGS@121 CFLAGS=@SSH2_CPPFLAGS@ @PROJ_CPPFLAGS@ @RELY_ON_DB@ @DEB_DEF@ -fpic @OPENSSL_CFLAGS@ @UUID_CFLAGS@ ${FCGI_CFLAGS} ${YAML_CFLAGS} ${MACOS_CFLAGS} ${MS_CFLAGS} -I../../thirds/cgic206 -I. -DLINUX_FREE_ISSUE #-DDEBUG #-DDEBUG_SERVICE_CONF 122 LDFLAGS=-lzoo_service @SSH2_LDFLAGS@ @PROJ_LDFLAGS@ @DEFAULT_LIBS@ -L../../thirds/cgic206 -lcgic ${GDAL_LIBS} ${XML2LDFLAGS} ${PYTHONLDFLAGS} ${PERLLDFLAGS} ${PHPLDFLAGS} ${JAVALDFLAGS} ${JSLDFLAGS} ${FCGI_LDFLAGS} @OPENSSL_LDFLAGS@ @UUID_LDFLAGS@ ${MS_LDFLAGS} ${MACOS_LD_FLAGS} ${MACOS_LD_NET_FLAGS} ${YAML_LDFLAGS} ${OTBLDFLAGS} ${SAGA_LDFLAGS} ${MONO_LDFLAGS} ${RLDFLAGS} @JSON_LDFLAGS@ @XSLT_LDFLAGS@ 123 123 124 124 DATAROOTDIR=@datarootdir@/zoo-project -
branches/prototype-v0/zoo-project/zoo-kernel/configure.ac
r877 r900 114 114 #============================================================================ 115 115 116 AC_ARG_WITH([gettext],117 [AS_HELP_STRING([--with-gettext=PATH], [Specifies an alternative location for the openssl library])],118 [GETTEXT_DIR="$withval"], [GETTEXT_DIR="/usr/"])119 120 GETTEXT_CFLAGS="-I$GETTEXT_DIR/include"121 GETTEXT_LDFLAGS="-L$GETTEXT_DIR/lib -lintl"116 #AC_ARG_WITH([gettext], 117 # [AS_HELP_STRING([--with-gettext=PATH], [Specifies an alternative location for the openssl library])], 118 # [GETTEXT_DIR="$withval"], [GETTEXT_DIR="/usr/"]) 119 120 #GETTEXT_CFLAGS="-I$GETTEXT_DIR/include" 121 #GETTEXT_LDFLAGS="-L$GETTEXT_DIR/lib -lintl" 122 122 #CFLAGS_SAVE="$CFLAGS" 123 123 #CFLAGS="$GETTEXT_CFLAGS" … … 127 127 #AC_CHECK_LIB(intl, 128 128 # [dgettext], [] , [AC_MSG_ERROR([could not find $i function in gettext library])]) 129 AC_SUBST([GETTEXT_CFLAGS])130 AC_SUBST([GETTEXT_LDFLAGS])129 #AC_SUBST([GETTEXT_CFLAGS]) 130 #AC_SUBST([GETTEXT_LDFLAGS]) 131 131 132 132 #============================================================================ … … 1049 1049 [SAGAPATH="$withval"], [SAGAPATH=""]) 1050 1050 1051 AC_ARG_WITH([saga-version], 1052 [AS_HELP_STRING([--with-saga-version=VERSION], [Specifies the SAGA-GIS version number])], 1053 [SAGAVERS="$withval"], [SAGAVERS="2"]) 1054 1051 1055 if test -z "$SAGAPATH" 1052 1056 then … … 1064 1068 WX_ISSUE="-D_WX_WXCRTVARARG_H_" 1065 1069 SAGA_DEFS="-D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD -DMODULE_LIBRARY_PATH=\\\"$SAGAPATH/lib/saga\\\"" 1066 SAGA_CPPFLAGS=" -fPIC -I$SAGAPATH/include/saga/saga_core/saga_api/ `$WXCFG --unicode=yes --static=no --cxxflags` -D_SAGA_UNICODE $SAGA_DEFS $WX_ISSUE"1070 SAGA_CPPFLAGS="-DSAGA_VERSION=${SAGAVERS} -fPIC -I$SAGAPATH/include/saga/saga_core/saga_api/ `$WXCFG --unicode=yes --static=no --cxxflags` -D_SAGA_UNICODE $SAGA_DEFS $WX_ISSUE" 1067 1071 SAGA_LDFLAGS="-fPIC `$WXCFG --unicode=yes --static=no --libs` -lsaga_api" 1068 1072 SAGA_ENABLED="-DUSE_SAGA" … … 1075 1079 LIBS_SAVE="$LIBS" 1076 1080 LIBS="$SAGA_LDFLAGS" 1077 AC_CHECK_HEADERS([module_library.h], 1078 [], [AC_MSG_ERROR([could not find header file $i related to SAGA-GIS])]) 1079 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "module_library.h"],[SG_Get_Module_Library_Manager();]])], 1080 [AC_MSG_RESULT([checking for SG_Get_Module_Library_Manager... yes])],[AC_MSG_ERROR([checking for SG_Get_Module_Library_Manager... failed])]) 1081 if test "$SAGAVERS" == "2"; then 1082 AC_CHECK_HEADERS([module_library.h], 1083 [], [AC_MSG_ERROR([could not find header file $i related to SAGA-GIS])]) 1084 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "module_library.h"],[SG_Get_Module_Library_Manager();]])], 1085 [AC_MSG_RESULT([checking for SG_Get_Module_Library_Manager... yes])],[AC_MSG_ERROR([checking for SG_Get_Module_Library_Manager... failed])]) 1086 else 1087 AC_CHECK_HEADERS([tool_library.h], 1088 [], [AC_MSG_ERROR([could not find header file $i related to SAGA-GIS])]) 1089 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "tool_library.h"],[SG_Get_Tool_Library_Manager();]])], 1090 [AC_MSG_RESULT([checking for SG_Get_Tool_Library_Manager... yes])],[AC_MSG_ERROR([checking for SG_Get_Tool_Library_Manager... failed])]) 1091 fi 1092 1081 1093 LIBS="$LIBS_SAVE" 1082 1094 AC_LANG_POP([C++]) -
branches/prototype-v0/zoo-project/zoo-kernel/response_print.h
r899 r900 81 81 #ifndef WIN32 82 82 //#include <locale.h> 83 #include < xlocale.h> // knut: this appears to be a non-standard header file that has been removed in newer versions of glibc; it may be sufficient to include <locale.h> (see above)83 #include <locale.h> // knut: this appears to be a non-standard header file that has been removed in newer versions of glibc; it may be sufficient to include <locale.h> (see above) 84 84 #endif 85 85 #include "ulinet.h" -
branches/prototype-v0/zoo-project/zoo-kernel/service.c
r899 r900 25 25 #include "service.h" 26 26 27 27 // knut: time utilities required for new log function (logMessage) 28 28 #include <ctime> 29 29 #include <chrono> -
branches/prototype-v0/zoo-project/zoo-kernel/service_internal.h
r899 r900 81 81 #endif 82 82 #ifndef WIN32 83 #include < xlocale.h>83 #include <locale.h> 84 84 #endif 85 85 -
branches/prototype-v0/zoo-project/zoo-kernel/service_internal_saga.c
r790 r900 30 30 #include <api_core.h> 31 31 #include <data_manager.h> 32 #include < module_library.h>32 #include <saga_api.h> 33 33 #define _ZOO_SAGA 34 34 #include "service_internal_saga.h" … … 237 237 return false; 238 238 } 239 return( param->Set_Value(SG_Get_Data_Manager().Find(&fileName)) ); 239 fprintf(stderr,"%s %s\n",carg->name,carg->value); 240 fflush(stderr); 241 return( param->Set_Value(SG_Get_Data_Manager().Find(&fileName,false)) ); 240 242 } 241 243 else … … 250 252 SG_Get_Data_Manager().Add(&fileName); 251 253 } 252 param->asList()->Add_Item(SG_Get_Data_Manager().Find(&fileName ));254 param->asList()->Add_Item(SG_Get_Data_Manager().Find(&fileName,false)); 253 255 } 254 256 } … … 327 329 inmap=getMap(argument,(CSG_String(param->Get_Identifier())+"_MIN").b_str()); 328 330 if(inmap!=NULL) 331 #if SAGA_MAJOR_VERSION == 2 329 332 param->asRange()->Set_LoVal(strtod(inmap->value,NULL)); 333 #else 334 param->asRange()->Set_Min(strtod(inmap->value,NULL)); 335 #endif 330 336 inmap=getMap(argument,(CSG_String(param->Get_Identifier())+"_MAX").b_str()); 331 337 if(inmap!=NULL) 338 #if SAGA_MAJOR_VERSION == 2 332 339 param->asRange()->Set_HiVal(strtod(inmap->value,NULL)); 340 #else 341 param->asRange()->Set_Max(strtod(inmap->value,NULL)); 342 #endif 333 343 } 334 344 if(inmap==NULL){ … … 386 396 else if( param->is_DataObject_List() ) 387 397 { 388 for(int i=0; i<param->asList()->Get_Count(); i++) 398 for(int i=0; i< 399 #if SAGA_MAJOR_VERSION == 2 400 param->asList()->Get_Count() 401 #else 402 param->asList()->Get_Data_Count() 403 #endif 404 ; i++) 389 405 { 390 CSG_Data_Object *pObject = param->asList()->asDataObject(i); 406 CSG_Data_Object *pObject = 407 #if SAGA_MAJOR_VERSION == 2 408 param->asList()->asDataObject(i) 409 #else 410 param->asList()->Get_Data(i) 411 #endif 412 ; 391 413 392 414 if( pObject->is_Modified() && SG_File_Exists(pObject->Get_File_Name()) ) … … 439 461 } 440 462 } 441 463 #if SAGA_MAJOR_VERSION == 2 442 464 int nFileNames = param->asList()->Get_Count() <= fileNames.Get_Count() ? fileNames.Get_Count() : fileNames.Get_Count() - 1; 443 465 for(int i=0; i<param->asList()->Get_Count(); i++) … … 458 480 CSG_String(param->asList()->asDataObject(i)->Get_File_Name()).b_str()); 459 481 } 482 #else 483 int nFileNames = param->asList()->Get_Data_Count() <= fileNames.Get_Count() ? fileNames.Get_Count() : fileNames.Get_Count() - 1; 484 for(int i=0; i<param->asList()->Get_Data_Count(); i++) 485 { 486 if( i < nFileNames ) 487 { 488 param->asList()->Get_Data(i)->Save(fileNames[i]); 489 } 490 else 491 { 492 param->asList()->Get_Data(i)->Save(CSG_String::Format(SG_T("%s_%0*d"), 493 fileNames[fileNames.Get_Count() - 1].c_str(), 494 SG_Get_Digit_Count(param->asList()->Get_Data_Count()), 495 1 + i - nFileNames 496 )); 497 } 498 setMapArray(cMaps->content,"generated_file",i, 499 CSG_String(param->asList()->Get_Data(i)->Get_File_Name()).b_str()); 500 } 501 502 #endif 460 503 } 461 504 } … … 477 520 int res=SERVICE_FAILED; 478 521 522 #if SAGA_MAJOR_VERSION == 2 479 523 CSG_Module_Library * library=SG_Get_Module_Library_Manager().Get_Library(CSG_String(lib_name),true); 524 #else 525 CSG_Tool_Library * library=SG_Get_Tool_Library_Manager().Get_Library(CSG_String(lib_name),true); 526 #endif 480 527 if( library == NULL){ 481 528 char tmp[255]; … … 486 533 } 487 534 535 #if SAGA_MAJOR_VERSION == 2 488 536 CSG_Module * module=library->Get_Module(atoi(module_name)); 537 #else 538 CSG_Tool * module=library->Get_Tool(atoi(module_name)); 539 #endif 489 540 if(module == NULL){ 490 541 char tmp[255]; … … 985 1036 SG_Set_UI_Callback(Get_Callback(watcher)); 986 1037 1038 #if SAGA_MAJOR_VERSION == 2 987 1039 int n = SG_Get_Module_Library_Manager().Add_Directory(wxT(MODULE_LIBRARY_PATH),false); 988 if( SG_Get_Module_Library_Manager().Get_Count() <= 0 ){ 1040 if( SG_Get_Module_Library_Manager().Get_Count() <= 0 ) 1041 #else 1042 int n = SG_Get_Tool_Library_Manager().Add_Directory(wxT(MODULE_LIBRARY_PATH),false); 1043 if( SG_Get_Tool_Library_Manager().Get_Count() <= 0 ) 1044 #endif 1045 { 989 1046 setMapInMaps(*main_conf,"lenv","message","Could not load any SAGA tool library"); 990 1047 res=SERVICE_FAILED; … … 995 1052 996 1053 // Load the SAGA-GIS library corresponding to the serviceProvider 1054 #if SAGA_MAJOR_VERSION == 2 997 1055 CSG_Module_Library * library=SG_Get_Module_Library_Manager().Get_Library(CSG_String(serviceProvider->value),true); 1056 #else 1057 CSG_Tool_Library * library=SG_Get_Tool_Library_Manager().Get_Library(CSG_String(serviceProvider->value),true); 1058 #endif 998 1059 if( library == NULL){ 999 1060 char tmp[255]; … … 1005 1066 1006 1067 // Load the SAGA-GIS module corresponding to the service name from the library 1068 #if SAGA_MAJOR_VERSION == 2 1007 1069 CSG_Module * module=library->Get_Module(atoi(s->name)); 1070 #else 1071 CSG_Tool * module=library->Get_Tool(atoi(s->name)); 1072 #endif 1008 1073 if(module == NULL){ 1009 1074 char tmp[255]; … … 1017 1082 // Load all the parameters defined for the module 1018 1083 CSG_Parameters * params=module->Get_Parameters(); 1019 int pc=params->Get_Count();1020 1084 if(!params){ 1021 1085 char tmp[255]; … … 1026 1090 return res; 1027 1091 } 1092 int pc=params->Get_Count(); 1028 1093 1029 1094 // Loop over each inputs to transform raster files to grid when needed,
Note: See TracChangeset
for help on using the changeset viewer.