diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/uscxml-browser.cpp | 43 | ||||
-rw-r--r-- | apps/uscxml-debugger.html | 5 |
2 files changed, 34 insertions, 14 deletions
diff --git a/apps/uscxml-browser.cpp b/apps/uscxml-browser.cpp index a57b79b..5f48842 100644 --- a/apps/uscxml-browser.cpp +++ b/apps/uscxml-browser.cpp @@ -1,6 +1,8 @@ #include "uscxml/config.h" #include "uscxml/Interpreter.h" +#include "uscxml/InterpreterOptions.h" #include "uscxml/debug/InterpreterIssue.h" +#include "uscxml/debug/DebuggerServlet.h" #include "uscxml/interpreter/InterpreterMonitor.h" #include "uscxml/util/DOM.h" @@ -87,22 +89,37 @@ int main(int argc, char** argv) { } } + if (options.withDebugger) { + DebuggerServlet* debugger; + debugger = new DebuggerServlet(); + debugger->copyToInvokers(true); + HTTPServer::getInstance()->registerServlet("/debug", debugger); + for (auto interpreter : interpreters) { + interpreter.addMonitor(debugger); + } + } + // run interpreters - try { - std::list<Interpreter>::iterator interpreterIter = interpreters.begin(); - while (interpreters.size() > 0) { - while(interpreterIter != interpreters.end()) { - InterpreterState state = interpreterIter->step(); - if (state == USCXML_FINISHED) { - interpreterIter = interpreters.erase(interpreterIter); - } else { - interpreterIter++; + if (interpreters.size() > 0) { + try { + std::list<Interpreter>::iterator interpreterIter = interpreters.begin(); + while (interpreters.size() > 0) { + while(interpreterIter != interpreters.end()) { + InterpreterState state = interpreterIter->step(); + if (state == USCXML_FINISHED) { + interpreterIter = interpreters.erase(interpreterIter); + } else { + interpreterIter++; + } } + interpreterIter = interpreters.begin(); } - interpreterIter = interpreters.begin(); + } catch (Event e) { + std::cout << e << std::endl; } - } catch (Event e) { - std::cout << e << std::endl; - } + } else if (options.withDebugger) { + while(true) + std::this_thread::sleep_for(std::chrono::seconds(1)); + } return EXIT_SUCCESS; }
\ No newline at end of file diff --git a/apps/uscxml-debugger.html b/apps/uscxml-debugger.html index 3aece02..fa49554 100644 --- a/apps/uscxml-debugger.html +++ b/apps/uscxml-debugger.html @@ -1099,11 +1099,14 @@ // we found a document, enable "recent" button $(this.recentDocumentsNode).prev().attr('disabled', false); + console.log(recentURL); + var recentDocumentItem = $('\ <li><a href="#"><!-- i class="glyphicon glyphicon-floppy-open" style="margin-right: 0.7em" / -->' + key + '<span class="recent-document-features"></span></a></li>\ '); var recentDocumentFeatures = $(recentDocumentItem).find("span.recent-document-features"); - $(recentDocumentItem).children("a").click(function() { + $(recentDocumentItem).children("a").unbind('click').click(function() { + console.log("recentURL: " + recentURL); $(debug.loadFromURLModalNode).find("input#loadFromURLModalInput").val(recentURL); $(debug.recentDocumentsNode).dropdown("toggle"); return false; |