[Oplot-cvsupdate] oplot/src/octave CMakeLists.txt, 1.2, 1.3 oplotcom.cc, 1.16, 1.17
Brought to you by:
waterthrill
From: Ole J. H. <wat...@us...> - 2009-07-23 18:22:47
|
Update of /cvsroot/oplot/oplot/src/octave In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv20913/src/octave Modified Files: CMakeLists.txt oplotcom.cc Log Message: Windows preparation. Hopefully it will work in Linux. Index: oplotcom.cc =================================================================== RCS file: /cvsroot/oplot/oplot/src/octave/oplotcom.cc,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- oplotcom.cc 20 Jul 2009 21:05:01 -0000 1.16 +++ oplotcom.cc 23 Jul 2009 18:22:41 -0000 1.17 @@ -16,7 +16,9 @@ //***************************************************************************** #ifdef WIN32 +#ifndef HAVE_STDINT_H #define HAVE_STDINT_H +#endif #include <winsock2.h> #include "ptcpchannel.h" #define TRANSPORT_CHANNEL "tcp" @@ -57,6 +59,7 @@ //! Generating a Matrix from a parser argument (assume pages=1) static + Matrix toMatrix ( pParser::pArgument* p ) { @@ -256,7 +259,8 @@ @end table\n\ @end deftypefn\n" ) { - return oplotcom_instance()->do_command ( args ); + + return oplotcom_instance()->do_command ( args ); } @@ -291,8 +295,10 @@ return false; - connectiondata = server->get_connectiondata(); - if ( ! program_is_running() ) + + connectiondata = server->get_connectiondata(); + + if ( ! program_is_running() ) if ( ! start_program() ) @@ -364,8 +370,8 @@ octave_value_list OplotCom::do_command ( const octave_value_list& arguments ) { - - octave_value_list retval; + + octave_value_list retval; if ( arguments.length() > 0 ) { @@ -696,9 +702,7 @@ ZeroMemory ( &process, sizeof ( PROCESS_INFORMATION ) ); WSADATA wsa; WSAStartup ( MAKEWORD ( 2,2 ), &wsa ); - - - + } @@ -706,21 +710,21 @@ bool WinOplotCom::start_program() { - + std::cout << "attempting to start program...\n"; // for now: // assume that oplot.exe is in the current working directory // - std::string application_name ( "c:\\oplot\\oplot\\src\\relwithdebinfo\\oplot.exe" ); + std::string application_name; DWORD type; char path_to_oplot[MAX_PATH]; DWORD size = MAX_PATH; long ret; HKEY regKey; - ret = RegOpenKeyEx ( HKEY_LOCAL_MACHINE, "Software\\Oplot\\oplot 0.5.0", 0, KEY_QUERY_VALUE, ®Key ); + ret = RegOpenKeyEx ( HKEY_CURRENT_USER, "Software\\Oplot", 0, KEY_QUERY_VALUE, ®Key ); if ( ( ret = RegQueryValueEx ( regKey, NULL, NULL, &type, ( BYTE* ) &path_to_oplot, &size ) ) == ERROR_SUCCESS ) { application_name = path_to_oplot; @@ -735,9 +739,10 @@ return false; } RegCloseKey ( regKey ); - application_name += "\\bin\\oplot.exe"; + application_name += "\\oplot.exe"; + std::cout << application_name << std::endl; STARTUPINFO si; @@ -766,22 +771,26 @@ } - bool WinOplotCom::setup_channel() { - + std::cout << "setting up channel\n"; if ( connectiondata.length() == 0 ) { - connectiondata = "127.0.0.1:27012"; - } + + std::cout << "trying to create server...\n"; - server = new pTCPChannel ( connectiondata, true ); - - server->listen(); + server = new pTCPChannel ( connectiondata, true ); + + std::cout << "created new server...\n"; + + server->listen(); + + std::cout << "setting channel to listen...\n"; + std::cout << "finished channel\n"; return true; } @@ -1057,7 +1066,7 @@ // return false; - //} + //} Index: CMakeLists.txt =================================================================== RCS file: /cvsroot/oplot/oplot/src/octave/CMakeLists.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- CMakeLists.txt 18 Apr 2008 11:35:41 -0000 1.2 +++ CMakeLists.txt 23 Jul 2009 18:22:41 -0000 1.3 @@ -13,18 +13,21 @@ #SET(LINKS ) #MAKE_LINK(props.oct ${LINKS}) IF(WIN32) -SET(PIOOSLIBS "-ladvapi32") +SET(PIOOSLIBS -ladvapi32 -lws2_32) +SET(PIOSOURCES ../pio/pparser.cc ../pio/pchannel.cc ../pio/ptcpchannel.cc ../../props/pmatrix.cc) +ELSE(WIN32) +SET(PIOSOURCES ../pio/pparser.cc ../pio/pchannel.cc ../pio/pudschannel.cc) ENDIF(WIN32) ADD_CUSTOM_COMMAND(OUTPUT oplotcom.oct COMMAND ${OCTAVE_MKOCT} - ARGS oplotcom.cc -I${oplot_SOURCE_DIR}/props -I../pio -L../pio -L../pio/relwithdebinfo -L${oplot_SOURCE_DIR}/props/relwithdebinfo -L${oplot_SOURCE_DIR}/props -lprops -lpio ${PIOOSLIBS} + ARGS oplotcom.cc ${PIOSOURCES} -I${oplot_SOURCE_DIR}/props -I../pio -L../pio -L../pio/Debug -L../pio/relwithdebinfo -L${oplot_SOURCE_DIR}/props/relwithdebinfo -L${oplot_SOURCE_DIR}/props -lprops ${PIOOSLIBS} DEPENDS oplotcom.cc ) ADD_CUSTOM_COMMAND(OUTPUT ocontourl.oct COMMAND ${OCTAVE_MKOCT} - ARGS ocontourl.cc -I${oplot_SOURCE_DIR}/props -I../pio -L../pio -L../pio/relwithdebinfo -L${oplot_SOURCE_DIR}/props/relwithdebinfo -L${oplot_SOURCE_DIR}/props -lprops -lpio ${PIOOSLIBS} + ARGS ocontourl.cc ${PIOSOURCES} -I${oplot_SOURCE_DIR}/props -I../pio -L../pio -L../pio/relwithdebinfo -L${oplot_SOURCE_DIR}/props/relwithdebinfo -L${oplot_SOURCE_DIR}/props -lprops ${PIOOSLIBS} DEPENDS ocontourl.cc ) |