fixed some compiler errors. disabled qscript agent
authorKevron Rees <tripzero.kev@gmail.com>
Thu, 12 Sep 2013 15:14:32 +0000 (08:14 -0700)
committerKevron Rees <tripzero.kev@gmail.com>
Thu, 12 Sep 2013 15:14:32 +0000 (08:14 -0700)
examples/bluemonkey/bluemonkeyconfig
examples/opencvluxconfig
lib/debugout.cpp
lib/debugout.h
plugins/bluemonkey/bluemonkey.cpp
plugins/gpsnmea/gpsnmea.cpp
plugins/gpsnmea/gpsnmea.h
plugins/openxc/openxcplugin.cpp
plugins/openxc/openxcplugin.h

index e6db4f7..0c15bef 100644 (file)
@@ -3,7 +3,7 @@
 
        "sources" : [ 
                {
 
        "sources" : [ 
                {
-                       "path" : "/usr/lib/automotive-message-broker/murphysourceplugin.so"
+                       "path" : "/usr/lib/automotive-message-broker/examplesourceplugin.so"
                }
        ],
        "sinks": [
                }
        ],
        "sinks": [
index 27b6cd7..b348e4b 100644 (file)
@@ -7,7 +7,7 @@
                        "threaded" : "true",
                        "kinect" : "false",
                        "opencl" : "false",
                        "threaded" : "true",
                        "kinect" : "false",
                        "opencl" : "false",
-                       "cuda" : "false",
+                       "cuda" : "true",
                        "pixelLowerBound" : "0",
                        "pixelUpperBound" : "255",
                        "fps" : "30",
                        "pixelLowerBound" : "0",
                        "pixelUpperBound" : "255",
                        "fps" : "30",
index 102de07..ee7fa8b 100644 (file)
@@ -28,5 +28,5 @@ const int DebugOut::Warning = 1 << 24;
 
 void debugOut(string message)
 {
 
 void debugOut(string message)
 {
-       DebugOut()<<"DEBUG: "<<message<<endl;
+       DebugOut()<<"DEBUG: "<<message.c_str()<<endl;
 }
 }
index 660fbfb..ce6f038 100644 (file)
@@ -23,7 +23,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 #include <iostream>
 #include <fstream>
 #include <sstream>
 #include <iostream>
 #include <fstream>
 #include <sstream>
-
 #include "timestamp.h"
 
 using namespace std;
 #include "timestamp.h"
 
 using namespace std;
@@ -53,7 +52,6 @@ public:
                                out<<"WARNING ";
                }
        }
                                out<<"WARNING ";
                }
        }
-
        DebugOut const& operator << (string message) const
        {
                if(mDebugLevel <= debugThreshhold || mDebugLevel == Error || mDebugLevel == Warning)
        DebugOut const& operator << (string message) const
        {
                if(mDebugLevel <= debugThreshhold || mDebugLevel == Error || mDebugLevel == Warning)
index 6ee363e..c57eba2 100644 (file)
@@ -93,13 +93,13 @@ BluemonkeySink::BluemonkeySink(AbstractRoutingEngine* e, map<string, string> con
 {
        irc = new IrcCommunication(config, this);
 
 {
        irc = new IrcCommunication(config, this);
 
-       reloadEngine();
+       QTimer::singleShot(1,this,SLOT(reloadEngine()));
 
        auth = new Authenticate(config, this);
 
        connect(irc, &IrcCommunication::message, [&](QString sender, QString prefix, QString codes ) {
 
 
        auth = new Authenticate(config, this);
 
        connect(irc, &IrcCommunication::message, [&](QString sender, QString prefix, QString codes ) {
 
-               if(codes.contains("authenticate"))
+               if(codes.startsWith("authenticate"))
                {
 
                        int i = codes.indexOf("authenticate");
                {
 
                        int i = codes.indexOf("authenticate");
@@ -185,17 +185,6 @@ bool BluemonkeySink::authenticate(QString pass)
 
 void BluemonkeySink::loadConfig(QString str)
 {
 
 void BluemonkeySink::loadConfig(QString str)
 {
-       configsToLoad.append(str);
-       QTimer::singleShot(1,this,SLOT(loadConfigPriv()));
-}
-
-void BluemonkeySink::loadConfigPriv()
-{
-       if(!configsToLoad.count()) return;
-
-       QString str = configsToLoad.first();
-       configsToLoad.pop_front();
-
        QFile file(str);
        if(!file.open(QIODevice::ReadOnly))
        {
        QFile file(str);
        if(!file.open(QIODevice::ReadOnly))
        {
@@ -207,7 +196,7 @@ void BluemonkeySink::loadConfigPriv()
 
        file.close();
 
 
        file.close();
 
-       DebugOut()<<"evaluating script: "<<script.toStdString();
+       DebugOut()<<"evaluating script: "<<script.toStdString()<<endl;
 
        QScriptValue val = engine->evaluate(script);
 
 
        QScriptValue val = engine->evaluate(script);
 
@@ -225,7 +214,7 @@ void BluemonkeySink::reloadEngine()
 
        agent = new BluemonkeyAgent(engine);
 
 
        agent = new BluemonkeyAgent(engine);
 
-       engine->setAgent(agent);
+       //engine->setAgent(agent);
 
        QScriptValue value = engine->newQObject(this);
        engine->globalObject().setProperty("bluemonkey", value);
 
        QScriptValue value = engine->newQObject(this);
        engine->globalObject().setProperty("bluemonkey", value);
@@ -241,6 +230,13 @@ void BluemonkeySink::reloadEngine()
 
 void BluemonkeySink::writeProgram(QString program)
 {
 
 void BluemonkeySink::writeProgram(QString program)
 {
+       QScriptSyntaxCheckResult result = QScriptEngine::checkSyntax(program);
+       if(result.state() != QScriptSyntaxCheckResult::Valid)
+       {
+               DebugOut(DebugOut::Error)<<"Syntax error in program: "<<result.errorMessage().toStdString()<<endl;
+               return;
+       }
+
        QFile file(configuration["customPrograms"].c_str());
 
        if(!file.open(QIODevice::ReadWrite | QIODevice::Append))
        QFile file(configuration["customPrograms"].c_str());
 
        if(!file.open(QIODevice::ReadWrite | QIODevice::Append))
index c0a1ce8..1bebf7c 100644 (file)
@@ -380,7 +380,7 @@ GpsNmeaSource::~GpsNmeaSource()
        device->close();
 }
 
        device->close();
 }
 
-string GpsNmeaSource::uuid()
+const string GpsNmeaSource::uuid()
 {
        return mUuid;
 }
 {
        return mUuid;
 }
index 456e4ea..c260604 100644 (file)
@@ -35,7 +35,7 @@ public:
        GpsNmeaSource(AbstractRoutingEngine* re, map<string, string> config);
        ~GpsNmeaSource();
        
        GpsNmeaSource(AbstractRoutingEngine* re, map<string, string> config);
        ~GpsNmeaSource();
        
-       string uuid();
+       const string uuid();
        void getPropertyAsync(AsyncPropertyReply *reply);
        void getRangePropertyAsync(AsyncRangePropertyReply *reply);
        AsyncPropertyReply * setProperty(AsyncSetPropertyRequest request);
        void getPropertyAsync(AsyncPropertyReply *reply);
        void getRangePropertyAsync(AsyncRangePropertyReply *reply);
        AsyncPropertyReply * setProperty(AsyncSetPropertyRequest request);
index 94ce8eb..75c7548 100644 (file)
@@ -121,7 +121,7 @@ extern "C" AbstractSource * create(AbstractRoutingEngine* routingengine, map<str
        
 }
 
        
 }
 
-string OpenXCPlugin::uuid()
+const string OpenXCPlugin::uuid()
 {
        return "openxc";
 }
 {
        return "openxc";
 }
index ec44999..86dc9ae 100644 (file)
@@ -31,7 +31,7 @@ class OpenXCPlugin: public AbstractSource
 public:
        OpenXCPlugin(AbstractRoutingEngine* re, map<string, string> config);
        
 public:
        OpenXCPlugin(AbstractRoutingEngine* re, map<string, string> config);
        
-       string uuid();
+       const string uuid();
        void getPropertyAsync(AsyncPropertyReply *reply);
        void getRangePropertyAsync(AsyncRangePropertyReply *reply);
        AsyncPropertyReply * setProperty(AsyncSetPropertyRequest request);
        void getPropertyAsync(AsyncPropertyReply *reply);
        void getRangePropertyAsync(AsyncRangePropertyReply *reply);
        AsyncPropertyReply * setProperty(AsyncSetPropertyRequest request);