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 )
if( NOT VA_COMMON_BUILD )
project( VAServer )
list( APPEND CMAKE_MODULE_PATH "$ENV{VISTA_CMAKE_COMMON}" )
include( VistaCommon )
endif()
project( VAServer )
list( APPEND CMAKE_MODULE_PATH "$ENV{VISTA_CMAKE_COMMON}" )
include( VistaCommon )
vista_use_package( VABase REQUIRED FIND_DEPENDENCIES )
vista_use_package( VACore 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 )
set( ITA_VISTA_BUILD_STATIC OFF CACHE BOOL "Build against static ViSTA libraries" )
endif( NOT DEFINED ITA_VISTA_BUILD_STATIC )
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 )
if( NOT ITA_VASERVER_DEPLOY_WITH_COMMON_SCRIPTS )
set( ITA_VASERVER_DEPLOY_WITH_COMMON_SCRIPTS ON CACHE BOOL "Install VAServer starting scripts" )
endif( )
# compiler
if( ITA_CORE_LIBS_BUILD_STATIC )
add_definitions( -DITA_BASE_STATIC -DITA_DATA_SOURCES_STATIC )
endif( ITA_CORE_LIBS_BUILD_STATIC )
endif( )
if( ITA_VA_BUILD_STATIC )
add_definitions( -DVABASE_STATIC -DVACORE_STATIC -DVANET_STATIC )
endif( ITA_VA_BUILD_STATIC )
endif( )
if( ITA_VISTA_BUILD_STATIC )
add_definitions( -DVISTABASE_STATIC -DVISTAINTERPROCCOMM_STATIC -DVISTAASPECTS_STATIC -DVISTATOOLS_STATIC -DVISTAMATH_STATIC )
if( WIN32 )
set( VISTAINTERPROCCOMM_ADDITIONAL_DEPENDENCIES Ws2_32 )
endif( WIN32 )
endif( ITA_VISTA_BUILD_STATIC )
endif( )
endif( )
# preprocessor
if( NOT WIN32 )
add_definitions( -std=gnu++11 )
list( APPEND VISTA_USE_PACKAGE_LIBRARIES ncurses )
message( ${VISTA_USE_PACKAGE_LIBRARIES} )
endif( )
# linker
add_executable( VAServer VAServer.cpp )
......@@ -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" )
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" )
endif( NOT DEFINED ITA_VASERVER_VC_COMMANDLINE_ARGUMENTS )
endif( )
vista_set_target_msvc_arguments( VAServer ${ITA_VASERVER_VC_COMMANDLINE_ARGUMENTS} )
......@@ -65,9 +60,19 @@ vista_create_default_info_file( VAServer )
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 )
endif()
endif( )
# dev
......@@ -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( VACore "VA" DEPENDENT VAServer SILENT )
vista_add_external_msvc_project_of_package( VANet "VA" DEPENDENT VAServer SILENT )
endif()
endif()
endif( )
endif( )
......@@ -12,14 +12,19 @@
*/
// STL includes
#ifdef WIN32
#include <conio.h>
#else
#include <ncurses.h>
#endif
#include <iostream>
// ITA includes
#include <ITAException.h>
#include <ITANumericUtils.h>
#include <ITAStringUtils.h>
#include <ITAFilesystemUtils.h>
#include <ITAFileSystemUtils.h>
// VA includes
#include <VACore.h>
......@@ -158,7 +163,7 @@ int main( int argc, char* argv[] )
while( true )
{
const int CTRL_D = 4;
int c = _getch();
int c = getch();
if( c == CTRL_D || c == 'q' ) break;
......@@ -195,14 +200,14 @@ int main( int argc, char* argv[] )
{
CVAStruct oArgs, oReturn, oNewArgs;
oArgs[ "command" ] = "get";
oArgs[ "debug" ] = CVAStruct();
oArgs[ "debug" ][ "loglevel" ] = true;
oArgs[ std::string("debug") ] = CVAStruct();
oArgs[ std::string("debug") ][ std::string("loglevel") ] = true;
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;
oNewArgs[ "command" ] = "set";
oNewArgs[ "debug" ] = CVAStruct();
oNewArgs[ "debug" ][ "loglevel" ] = iNewLogLevel;
oNewArgs[ std::string("debug") ][ std::string("loglevel") ] = iNewLogLevel;
pServer->GetCoreInstance()->CallModule( "VACore", oNewArgs, oReturn );
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