diff options
-rw-r--r-- | CMakeLists.txt | 18 | ||||
-rw-r--r-- | apps/samples/miles/miles.html | 2 | ||||
-rw-r--r-- | apps/samples/miles/miles.js | 32 | ||||
-rw-r--r-- | apps/samples/miles/miles.scxml | 16 | ||||
-rw-r--r-- | src/uscxml/URL.cpp | 3 | ||||
-rw-r--r-- | src/uscxml/plugins/invoker/miles/MilesSessionInvoker.cpp | 2 |
6 files changed, 48 insertions, 25 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index b1d5bcf..533106e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -653,15 +653,15 @@ endif() find_package(MILES) if (MILES_FOUND) # openal is only needed for miles - find_package(OpenAL REQUIRED) - find_package(JPEG REQUIRED) - list (APPEND MILES_LIBRARIES "iconv") - list (APPEND MILES_LIBRARIES ${JPEG_LIBRARIES}) - list (APPEND USCXML_INCLUDE_DIRS ${OPENAL_INCLUDE_DIR}) + # find_package(OpenAL REQUIRED) + # find_package(JPEG REQUIRED) + # list (APPEND MILES_LIBRARIES "iconv") + # list (APPEND MILES_LIBRARIES ${JPEG_LIBRARIES}) + # list (APPEND USCXML_INCLUDE_DIRS ${OPENAL_INCLUDE_DIR}) include_directories (${MILES_INCLUDE_DIR}) list (APPEND USCXML_OPT_LIBS ${MILES_LIBRARIES}) - list (APPEND USCXML_OPT_LIBS ${OPENAL_LIBRARY}) + # list (APPEND USCXML_OPT_LIBS ${OPENAL_LIBRARY}) endif() set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) @@ -756,12 +756,18 @@ else() endif() if (NOT CMAKE_CROSSCOMPILING) set_target_properties(uscxml PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "src/uscxml/pch.h") + set_target_properties(uscxml PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE) cotire(uscxml) endif() if (NOT CMAKE_CROSSCOMPILING) add_executable(uscxml-browser apps/uscxml-browser.cpp) target_link_libraries(uscxml-browser uscxml) + if (NOT CMAKE_CROSSCOMPILING) + set_target_properties(uscxml-browser PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE) + cotire(uscxml-browser) + endif() + set_target_properties(uscxml-browser PROPERTIES FOLDER "Apps") install_executable(TARGETS uscxml-browser COMPONENT tools) diff --git a/apps/samples/miles/miles.html b/apps/samples/miles/miles.html index 019ead4..9cee058 100644 --- a/apps/samples/miles/miles.html +++ b/apps/samples/miles/miles.html @@ -10,7 +10,7 @@ <script type="text/javascript"> </script> - <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.8.3/dojo/dojo.js"></script> + <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.9.1/dojo/dojo.js"></script> <script src="miles.js"></script> <script type="text/javascript"> diff --git a/apps/samples/miles/miles.js b/apps/samples/miles/miles.js index b9348e8..22d536a 100644 --- a/apps/samples/miles/miles.js +++ b/apps/samples/miles/miles.js @@ -13,8 +13,8 @@ function Miles(element, params) { this.imageIteration = 0; // private attributes - var scxmlURL = "127.0.0.1:8080" - var reflectorIp = "127.0.0.1" + var scxmlURL = "localhost:8080" + var reflectorIp = "localhost" var email = "me@somehost.de"; var problemName = "some really hard problem"; @@ -29,7 +29,7 @@ function Miles(element, params) { self.xhr.post({ // The URL to request url: "http://" + scxmlURL + "/miles/connect", - handleAs:"json", + // handleAs:"text", postData: dojo.toJson({ reflectorIp: reflectorIp, email: email, @@ -37,7 +37,10 @@ function Miles(element, params) { }), headers:{ "X-Requested-With": null, - "Content-Type": "application/json", + "Content-Type": "application/json" + }, + error: function(err) { + console.log(err); }, load: function(result) { // we expect nothing in return @@ -52,15 +55,15 @@ function Miles(element, params) { self.xhr.get({ // The URL to request url: "http://" + scxmlURL + "/miles/image", - handleAs:"text", - postData: dojo.toJson({ - reflectorIp: reflectorIp, - email: email, - problemName: problemName - }), headers:{ - "X-Requested-With": null, - "Content-Type": "application/json", + "X-Requested-With":null + }, + error: function(err) { + console.log(err); + if (self.connected) { + self.messageElem.innerHTML = self.imageIteration++; + refreshImage(); + } }, load: function(result) { self.pictureElem.src = "data:image/jpeg;base64," + result; @@ -97,7 +100,7 @@ function Miles(element, params) { <tr>\ <td valign="top">\ <div style="position: relative; padding: 0px">\ - <img class="picture" src="test.jpeg"></img>\ + <img class="picture" src="test1.jpeg"></img>\ <div style="position: absolute; left: 10px; top: 10px">\ <table></tr>\ <td class="control" style="vertical-align: middle"></td>\ @@ -124,6 +127,9 @@ function Miles(element, params) { self.controlDropDown = new DropDownButton({ label: "Connect", dropDown: self.controlToolTip }); self.controlElem.appendChild(self.controlDropDown.domNode); + // self.connected = true; + // refreshImage(); + self.connect(); }) diff --git a/apps/samples/miles/miles.scxml b/apps/samples/miles/miles.scxml index 7014502..746e37f 100644 --- a/apps/samples/miles/miles.scxml +++ b/apps/samples/miles/miles.scxml @@ -5,9 +5,11 @@ <param name="foo" expr="'asdf'" /> <finalize> <if cond="_event.data.origin"> - <!-- log label="Reply-length" expr="_event.data.base64.length" / --> + <!-- <log label="Reply-length" expr="_event.data.base64.length" /> --> <respond status="200" to="_event.data.origin"> - <header name="Content-Type" value="text/ascii" /> + <header name="Cache-Control" value="no-cache" /> <!-- force IE to actually reload --> + <header name="Content-Type" value="text/plain" /> + <header name="Access-Control-Allow-Origin" value="*" /> <content expr="_event.data.base64" /> </respond> </if> @@ -20,8 +22,8 @@ <script>//dump(_event);</script> <respond status="200" to="_event.origin"> <header name="Access-Control-Allow-Origin" value="*" /> - <header name="Access-Control-Allow-Methods" value="GET, OPTIONS" /> - <header name="Access-Control-Allow-Headers" value="X-Requested-With" /> + <header name="Access-Control-Allow-Methods" value="POST, GET, OPTIONS" /> + <header name="Access-Control-Allow-Headers" value="X-Requested-With, Content-Type" /> </respond> </transition> @@ -36,7 +38,11 @@ <param name="email" expr="_event.data.content.email" /> <param name="problemName" expr="_event.data.content.problemName" /> </send> - <respond status="200" to="_event.origin" /> + <respond status="200" to="_event.origin"> + <header name="Connection" value="close" /> + <header name="Content-Type" value="application/json" /> + <header name="Access-Control-Allow-Origin" value="*" /> + </respond> <elseif cond="_event.data.pathComponent[1] === 'disconnect'" /> <send target="#_miles" event="disconnect"> diff --git a/src/uscxml/URL.cpp b/src/uscxml/URL.cpp index 8332c1d..93d4c40 100644 --- a/src/uscxml/URL.cpp +++ b/src/uscxml/URL.cpp @@ -530,6 +530,9 @@ void URLFetcher::fetchURL(URL& url) { (curlError = curl_easy_setopt(handle, CURLOPT_URL, url.asString().c_str())) == CURLE_OK || LOG(ERROR) << "Cannot set url to " << url.asString() << ": " << curl_easy_strerror(curlError); + +// (curlError = curl_easy_setopt(handle, CURLOPT_NOSIGNAL, 1)) == CURLE_OK || +// LOG(ERROR) << "Cannot set curl to ignore signals: " << curl_easy_strerror(curlError); (curlError = curl_easy_setopt(handle, CURLOPT_WRITEDATA, url._impl.get())) == CURLE_OK || LOG(ERROR) << "Cannot register this as write userdata: " << curl_easy_strerror(curlError); diff --git a/src/uscxml/plugins/invoker/miles/MilesSessionInvoker.cpp b/src/uscxml/plugins/invoker/miles/MilesSessionInvoker.cpp index 80bcce8..3a3354a 100644 --- a/src/uscxml/plugins/invoker/miles/MilesSessionInvoker.cpp +++ b/src/uscxml/plugins/invoker/miles/MilesSessionInvoker.cpp @@ -91,6 +91,8 @@ void MilesSessionInvoker::send(const SendRequest& req) { std::string problemName = "Generic"; Event::getParam(req.params, "problemname", problemName); + return; + int rv; rv = miles_connect_reflector_session((char*)reflectorIP.c_str(), (char*)problemName.c_str()); if (!rv) { |