summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevron Rees <tripzero.kev@gmail.com>2013-09-12 08:14:32 -0700
committerKevron Rees <tripzero.kev@gmail.com>2013-09-12 08:14:32 -0700
commit304063596de3e12c31922a74c79cc27d10e2c63f (patch)
tree40c64fc1b2c47258190b2f816c39551f9550da90
parent5be75837f899181ce27221e258027cd10f23d790 (diff)
downloadautomotive-message-broker-304063596de3e12c31922a74c79cc27d10e2c63f.tar.gz
fixed some compiler errors. disabled qscript agent
-rw-r--r--examples/bluemonkey/bluemonkeyconfig2
-rw-r--r--examples/opencvluxconfig2
-rw-r--r--lib/debugout.cpp2
-rw-r--r--lib/debugout.h2
-rw-r--r--plugins/bluemonkey/bluemonkey.cpp26
-rw-r--r--plugins/gpsnmea/gpsnmea.cpp2
-rw-r--r--plugins/gpsnmea/gpsnmea.h2
-rw-r--r--plugins/openxc/openxcplugin.cpp2
-rw-r--r--plugins/openxc/openxcplugin.h2
9 files changed, 18 insertions, 24 deletions
diff --git a/examples/bluemonkey/bluemonkeyconfig b/examples/bluemonkey/bluemonkeyconfig
index e6db4f72..0c15befe 100644
--- a/examples/bluemonkey/bluemonkeyconfig
+++ b/examples/bluemonkey/bluemonkeyconfig
@@ -3,7 +3,7 @@
"sources" : [
{
- "path" : "/usr/lib/automotive-message-broker/murphysourceplugin.so"
+ "path" : "/usr/lib/automotive-message-broker/examplesourceplugin.so"
}
],
"sinks": [
diff --git a/examples/opencvluxconfig b/examples/opencvluxconfig
index 27b6cd78..b348e4ba 100644
--- a/examples/opencvluxconfig
+++ b/examples/opencvluxconfig
@@ -7,7 +7,7 @@
"threaded" : "true",
"kinect" : "false",
"opencl" : "false",
- "cuda" : "false",
+ "cuda" : "true",
"pixelLowerBound" : "0",
"pixelUpperBound" : "255",
"fps" : "30",
diff --git a/lib/debugout.cpp b/lib/debugout.cpp
index 102de07b..ee7fa8b7 100644
--- a/lib/debugout.cpp
+++ b/lib/debugout.cpp
@@ -28,5 +28,5 @@ const int DebugOut::Warning = 1 << 24;
void debugOut(string message)
{
- DebugOut()<<"DEBUG: "<<message<<endl;
+ DebugOut()<<"DEBUG: "<<message.c_str()<<endl;
}
diff --git a/lib/debugout.h b/lib/debugout.h
index 660fbfb4..ce6f038a 100644
--- a/lib/debugout.h
+++ b/lib/debugout.h
@@ -23,7 +23,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#include <iostream>
#include <fstream>
#include <sstream>
-
#include "timestamp.h"
using namespace std;
@@ -53,7 +52,6 @@ public:
out<<"WARNING ";
}
}
-
DebugOut const& operator << (string message) const
{
if(mDebugLevel <= debugThreshhold || mDebugLevel == Error || mDebugLevel == Warning)
diff --git a/plugins/bluemonkey/bluemonkey.cpp b/plugins/bluemonkey/bluemonkey.cpp
index 6ee363ef..c57eba2d 100644
--- a/plugins/bluemonkey/bluemonkey.cpp
+++ b/plugins/bluemonkey/bluemonkey.cpp
@@ -93,13 +93,13 @@ BluemonkeySink::BluemonkeySink(AbstractRoutingEngine* e, map<string, string> con
{
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 ) {
- if(codes.contains("authenticate"))
+ if(codes.startsWith("authenticate"))
{
int i = codes.indexOf("authenticate");
@@ -185,17 +185,6 @@ bool BluemonkeySink::authenticate(QString pass)
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))
{
@@ -207,7 +196,7 @@ void BluemonkeySink::loadConfigPriv()
file.close();
- DebugOut()<<"evaluating script: "<<script.toStdString();
+ DebugOut()<<"evaluating script: "<<script.toStdString()<<endl;
QScriptValue val = engine->evaluate(script);
@@ -225,7 +214,7 @@ void BluemonkeySink::reloadEngine()
agent = new BluemonkeyAgent(engine);
- engine->setAgent(agent);
+ //engine->setAgent(agent);
QScriptValue value = engine->newQObject(this);
engine->globalObject().setProperty("bluemonkey", value);
@@ -241,6 +230,13 @@ void BluemonkeySink::reloadEngine()
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))
diff --git a/plugins/gpsnmea/gpsnmea.cpp b/plugins/gpsnmea/gpsnmea.cpp
index c0a1ce87..1bebf7ce 100644
--- a/plugins/gpsnmea/gpsnmea.cpp
+++ b/plugins/gpsnmea/gpsnmea.cpp
@@ -380,7 +380,7 @@ GpsNmeaSource::~GpsNmeaSource()
device->close();
}
-string GpsNmeaSource::uuid()
+const string GpsNmeaSource::uuid()
{
return mUuid;
}
diff --git a/plugins/gpsnmea/gpsnmea.h b/plugins/gpsnmea/gpsnmea.h
index 456e4ea9..c260604a 100644
--- a/plugins/gpsnmea/gpsnmea.h
+++ b/plugins/gpsnmea/gpsnmea.h
@@ -35,7 +35,7 @@ public:
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);
diff --git a/plugins/openxc/openxcplugin.cpp b/plugins/openxc/openxcplugin.cpp
index 94ce8eb2..75c75487 100644
--- a/plugins/openxc/openxcplugin.cpp
+++ b/plugins/openxc/openxcplugin.cpp
@@ -121,7 +121,7 @@ extern "C" AbstractSource * create(AbstractRoutingEngine* routingengine, map<str
}
-string OpenXCPlugin::uuid()
+const string OpenXCPlugin::uuid()
{
return "openxc";
}
diff --git a/plugins/openxc/openxcplugin.h b/plugins/openxc/openxcplugin.h
index ec44999a..86dc9aea 100644
--- a/plugins/openxc/openxcplugin.h
+++ b/plugins/openxc/openxcplugin.h
@@ -31,7 +31,7 @@ class OpenXCPlugin: public AbstractSource
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);