From: <ha...@us...> - 2009-12-09 18:59:53
|
Revision: 11884 http://jmol.svn.sourceforge.net/jmol/?rev=11884&view=rev Author: hansonr Date: 2009-12-09 18:59:42 +0000 (Wed, 09 Dec 2009) Log Message: ----------- multitouch Modified Paths: -------------- trunk/Jmol/src/com/sparshui/cpp/hp_multitouch/JmolMultiTouchDriver.cpp Modified: trunk/Jmol/src/com/sparshui/cpp/hp_multitouch/JmolMultiTouchDriver.cpp =================================================================== --- trunk/Jmol/src/com/sparshui/cpp/hp_multitouch/JmolMultiTouchDriver.cpp 2009-12-09 06:40:05 UTC (rev 11883) +++ trunk/Jmol/src/com/sparshui/cpp/hp_multitouch/JmolMultiTouchDriver.cpp 2009-12-09 18:59:42 UTC (rev 11884) @@ -34,7 +34,9 @@ #include "math.h" #include "NWMultiTouch.h" #include "time.h" +#include <string> + // The desired time to wait for more touch move events before sending the touch death. #define TOUCH_WAIT_TIME_MS (75) #define TOUCH_SLOPXY (1) @@ -441,10 +443,8 @@ DWORD deviceID = 0; inittouchPoints(); bool isOK = false; + bool testing = (argc > 1 && ((string) argv[1]) == "-test"); - - cout << getTimeNow(); - // If we have at least one connected device then try to connect to it. if(numDevices > 0) { // Get the serial number of the device which uniquely identifies the device. @@ -480,8 +480,13 @@ DWORD displayMode = RM_MULTITOUCH; // same as RM_SLOPESMODE ? SetReportMode(deviceID, displayMode); - haveSocket = initSocket(); + haveSocket = (testing ? false : initSocket()); + if (!haveSocket && !testing) { + cout << "No socket and no -test flag -- quitting" << endl; + return 0; + } + cout << "Press ESC to Quit or I to re-initialize socket" << endl; // Enter run loop, exit on user hitting "Escape" key. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |