Aufgrund einer Wartung wird GitLab am 28.09. zwischen 10:00 und 11:00 Uhr kurzzeitig nicht zur Verfügung stehen. / Due to maintenance, GitLab will be temporarily unavailable on 28.09. between 10:00 and 11:00 am.

Commit 9ec3484a authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen

Merge branch 'develop'

parents 4d179334 8dc4c866
cmake_minimum_required( VERSION 2.8 ) cmake_minimum_required( VERSION 2.8 )
if( NOT VA_COMMON_BUILD ) project( VAServer )
list( APPEND CMAKE_MODULE_PATH "$ENV{VISTA_CMAKE_COMMON}" )
project( VAServer ) include( VistaCommon )
list( APPEND CMAKE_MODULE_PATH "$ENV{VISTA_CMAKE_COMMON}" )
include( VistaCommon )
endif()
vista_use_package( VABase REQUIRED FIND_DEPENDENCIES ) vista_use_package( VABase REQUIRED FIND_DEPENDENCIES )
vista_use_package( VACore REQUIRED FIND_DEPENDENCIES ) vista_use_package( VACore REQUIRED FIND_DEPENDENCIES )
vista_use_package( VANet REQUIRED FIND_DEPENDENCIES ) vista_use_package( VANet REQUIRED FIND_DEPENDENCIES )
if( NOT ITA_VASERVER_INSTALL_WITH_DLLS )
set( ITA_VASERVER_INSTALL_WITH_DLLS ON CACHE BOOL "Install VAServer with depending DLLs (use this switch with care)" )
endif( )
if( NOT DEFINED ITA_VISTA_BUILD_STATIC ) if( NOT ITA_VASERVER_DEPLOY_WITH_COMMON_SCRIPTS )
set( ITA_VISTA_BUILD_STATIC OFF CACHE BOOL "Build against static ViSTA libraries" ) set( ITA_VASERVER_DEPLOY_WITH_COMMON_SCRIPTS ON CACHE BOOL "Install VAServer starting scripts" )
endif( NOT DEFINED ITA_VISTA_BUILD_STATIC ) endif( )
if( NOT DEFINED ITA_CORE_LIBS_BUILD_STATIC )
set( ITA_CORE_LIBS_BUILD_STATIC OFF CACHE BOOL "Link against satic ITA core libs" )
endif( NOT DEFINED ITA_CORE_LIBS_BUILD_STATIC )
if( NOT DEFINED ITA_VA_BUILD_STATIC )
set( ITA_VA_BUILD_STATIC OFF CACHE BOOL "Link aginst static VA libs" )
endif( NOT DEFINED ITA_VA_BUILD_STATIC )
if( NOT DEFINED ITA_VASERVER_INSTALL_WITH_DLLS )
set( ITA_VASERVER_INSTALL_WITH_DLLS ON CACHE BOOL "Install VAServer with depending DLLs (use this switch with care)" )
endif( NOT DEFINED ITA_VASERVER_INSTALL_WITH_DLLS )
# compiler # compiler
if( ITA_CORE_LIBS_BUILD_STATIC ) if( ITA_CORE_LIBS_BUILD_STATIC )
add_definitions( -DITA_BASE_STATIC -DITA_DATA_SOURCES_STATIC ) add_definitions( -DITA_BASE_STATIC -DITA_DATA_SOURCES_STATIC )
endif( ITA_CORE_LIBS_BUILD_STATIC ) endif( )
if( ITA_VA_BUILD_STATIC ) if( ITA_VA_BUILD_STATIC )
add_definitions( -DVABASE_STATIC -DVACORE_STATIC -DVANET_STATIC ) add_definitions( -DVABASE_STATIC -DVACORE_STATIC -DVANET_STATIC )
endif( ITA_VA_BUILD_STATIC ) endif( )
if( ITA_VISTA_BUILD_STATIC ) if( ITA_VISTA_BUILD_STATIC )
add_definitions( -DVISTABASE_STATIC -DVISTAINTERPROCCOMM_STATIC -DVISTAASPECTS_STATIC -DVISTATOOLS_STATIC -DVISTAMATH_STATIC ) add_definitions( -DVISTABASE_STATIC -DVISTAINTERPROCCOMM_STATIC -DVISTAASPECTS_STATIC -DVISTATOOLS_STATIC -DVISTAMATH_STATIC )
if( WIN32 ) if( WIN32 )
set( VISTAINTERPROCCOMM_ADDITIONAL_DEPENDENCIES Ws2_32 ) set( VISTAINTERPROCCOMM_ADDITIONAL_DEPENDENCIES Ws2_32 )
endif( WIN32 ) endif( )
endif( ITA_VISTA_BUILD_STATIC ) endif( )
# preprocessor
if( NOT WIN32 )
add_definitions( -std=gnu++11 )
list( APPEND VISTA_USE_PACKAGE_LIBRARIES ncurses )
message( ${VISTA_USE_PACKAGE_LIBRARIES} )
endif( )
# linker # linker
add_executable( VAServer VAServer.cpp ) add_executable( VAServer VAServer.cpp )
...@@ -55,7 +50,7 @@ target_link_libraries( VAServer ${VISTA_USE_PACKAGE_LIBRARIES} ${VISTAINTERPROCC ...@@ -55,7 +50,7 @@ target_link_libraries( VAServer ${VISTA_USE_PACKAGE_LIBRARIES} ${VISTAINTERPROCC
set( ITA_VA_VASERVER_CONFIG_PATH "${VACORE_ROOT_DIR}/conf/VACore.ini" ) set( ITA_VA_VASERVER_CONFIG_PATH "${VACORE_ROOT_DIR}/conf/VACore.ini" )
if( NOT DEFINED ITA_VASERVER_VC_COMMANDLINE_ARGUMENTS ) if( NOT DEFINED ITA_VASERVER_VC_COMMANDLINE_ARGUMENTS )
set( ITA_VASERVER_VC_COMMANDLINE_ARGUMENTS "0.0.0.0:12340 \"${ITA_VA_VASERVER_CONFIG_PATH}\"" CACHE STRING "VAServer command line arguments for execution out of Visual Studio" ) set( ITA_VASERVER_VC_COMMANDLINE_ARGUMENTS "0.0.0.0:12340 \"${ITA_VA_VASERVER_CONFIG_PATH}\"" CACHE STRING "VAServer command line arguments for execution out of Visual Studio" )
endif( NOT DEFINED ITA_VASERVER_VC_COMMANDLINE_ARGUMENTS ) endif( )
vista_set_target_msvc_arguments( VAServer ${ITA_VASERVER_VC_COMMANDLINE_ARGUMENTS} ) vista_set_target_msvc_arguments( VAServer ${ITA_VASERVER_VC_COMMANDLINE_ARGUMENTS} )
...@@ -65,9 +60,19 @@ vista_create_default_info_file( VAServer ) ...@@ -65,9 +60,19 @@ vista_create_default_info_file( VAServer )
set_property( TARGET VAServer PROPERTY FOLDER "VA/Apps" ) set_property( TARGET VAServer PROPERTY FOLDER "VA/Apps" )
if( ITA_VASERVER_INSTALL_WITH_DLLS OR ITA_VA_INSTALL_WITH_DLLS ) # deploy
if( ITA_VASERVER_DEPLOY_WITH_COMMON_SCRIPTS )
if( WIN32 )
install( FILES "run_VAServer.bat" DESTINATION "." )
else( )
install( FILES "run_VAServer.sh" DESTINATION "." )
endif( )
endif( )
if( ITA_VA_INSTALL_WITH_DLLS OR ITA_VASERVER_INSTALL_WITH_DLLS )
vista_install_all_dlls( bin ) vista_install_all_dlls( bin )
endif() endif( )
# dev # dev
...@@ -78,6 +83,6 @@ if( MSVC ) ...@@ -78,6 +83,6 @@ if( MSVC )
vista_add_external_msvc_project_of_package( VABase "VA" DEPENDENT VAServer SILENT ) vista_add_external_msvc_project_of_package( VABase "VA" DEPENDENT VAServer SILENT )
vista_add_external_msvc_project_of_package( VACore "VA" DEPENDENT VAServer SILENT ) vista_add_external_msvc_project_of_package( VACore "VA" DEPENDENT VAServer SILENT )
vista_add_external_msvc_project_of_package( VANet "VA" DEPENDENT VAServer SILENT ) vista_add_external_msvc_project_of_package( VANet "VA" DEPENDENT VAServer SILENT )
endif() endif( )
endif() endif( )
...@@ -12,14 +12,19 @@ ...@@ -12,14 +12,19 @@
*/ */
// STL includes // STL includes
#ifdef WIN32
#include <conio.h> #include <conio.h>
#else
#include <ncurses.h>
#endif
#include <iostream> #include <iostream>
// ITA includes // ITA includes
#include <ITAException.h> #include <ITAException.h>
#include <ITANumericUtils.h> #include <ITANumericUtils.h>
#include <ITAStringUtils.h> #include <ITAStringUtils.h>
#include <ITAFilesystemUtils.h> #include <ITAFileSystemUtils.h>
// VA includes // VA includes
#include <VACore.h> #include <VACore.h>
...@@ -158,7 +163,7 @@ int main( int argc, char* argv[] ) ...@@ -158,7 +163,7 @@ int main( int argc, char* argv[] )
while( true ) while( true )
{ {
const int CTRL_D = 4; const int CTRL_D = 4;
int c = _getch(); int c = getch();
if( c == CTRL_D || c == 'q' ) break; if( c == CTRL_D || c == 'q' ) break;
...@@ -195,14 +200,14 @@ int main( int argc, char* argv[] ) ...@@ -195,14 +200,14 @@ int main( int argc, char* argv[] )
{ {
CVAStruct oArgs, oReturn, oNewArgs; CVAStruct oArgs, oReturn, oNewArgs;
oArgs[ "command" ] = "get"; oArgs[ "command" ] = "get";
oArgs[ "debug" ] = CVAStruct(); oArgs[ std::string("debug") ] = CVAStruct();
oArgs[ "debug" ][ "loglevel" ] = true; oArgs[ std::string("debug") ][ std::string("loglevel") ] = true;
pServer->GetCoreInstance()->CallModule( "VACore", oArgs, oReturn ); pServer->GetCoreInstance()->CallModule( "VACore", oArgs, oReturn );
int iCurrentLogLevel = oReturn[ "debug" ][ "loglevel" ]; int iCurrentLogLevel = oReturn[ std::string("debug") ][ std::string("loglevel") ];
int iNewLogLevel = int( iCurrentLogLevel + 1 ) % 6; int iNewLogLevel = int( iCurrentLogLevel + 1 ) % 6;
oNewArgs[ "command" ] = "set"; oNewArgs[ "command" ] = "set";
oNewArgs[ "debug" ] = CVAStruct(); oNewArgs[ "debug" ] = CVAStruct();
oNewArgs[ "debug" ][ "loglevel" ] = iNewLogLevel; oNewArgs[ std::string("debug") ][ std::string("loglevel") ] = iNewLogLevel;
pServer->GetCoreInstance()->CallModule( "VACore", oNewArgs, oReturn ); pServer->GetCoreInstance()->CallModule( "VACore", oNewArgs, oReturn );
cout << "Switched to log level: " << IVACore::GetLogLevelStr( iNewLogLevel ) << endl; cout << "Switched to log level: " << IVACore::GetLogLevelStr( iNewLogLevel ) << endl;
......
@rem Example how to start the VA server (with configuration file)
bin\VAServer.exe localhost:12340 conf\VACore.ini
\ No newline at end of file
# Example how to start the VA server (with configuration file)
./bin/VAServer localhost:12340 ./conf/VACore.ini
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment