fixed opencvlux plugin
authorKevron Rees <kevron.m.rees@intel.com>
Mon, 22 Sep 2014 17:06:54 +0000 (10:06 -0700)
committerKevron Rees <kevron.m.rees@intel.com>
Mon, 22 Sep 2014 17:06:54 +0000 (10:06 -0700)
plugins/opencvlux/CMakeLists.txt
plugins/opencvlux/opencvluxplugin.cpp
plugins/opencvlux/opencvluxplugin.h

index e149a73..acb48ed 100644 (file)
@@ -36,9 +36,6 @@ if(Qt5Core_FOUND)
   set(QT_LIBRARIES ${Qt5Core_LIBRARIES} )
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}")
   message(STATUS "size of void_p: ${CMAKE_SIZEOF_VOID_P}")
-  #if(CMAKE_SIZEOF_VOID_P MATCHES "8")
-  #    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcmodel=large")
-  #endif(CMAKE_SIZEOF_VOID_P MATCHES "8")
   add_definitions(${Qt5Core_DEFINITIONS})
 
 endif(Qt5Core_FOUND)
index 2ec673b..81bb035 100644 (file)
@@ -52,7 +52,7 @@ extern "C" AbstractSource * create(AbstractRoutingEngine* routingengine, map<str
 }
 
 OpenCvLuxPlugin::OpenCvLuxPlugin(AbstractRoutingEngine* re, map<string, string> config)
-       :AbstractSource(re, config), lastLux(0), speed(0), latitude(0), longitude(0)
+       :AbstractSource(re, config), lastLux(0), speed(0), latitude(0), longitude(0), extBrightness(new VehicleProperty::ExteriorBrightnessType(0))
 {
        shared = new Shared;
        shared->parent = this;
@@ -275,7 +275,7 @@ PropertyList OpenCvLuxPlugin::supported()
        PropertyList props;
        props.push_back(VehicleProperty::ExteriorBrightness);
        props.push_back(VideoLogging);
-       
+
        return props;
 }
 
@@ -506,11 +506,11 @@ void OpenCvLuxPlugin::writeVideoFrame(cv::Mat f)
 
 void OpenCvLuxPlugin::updateProperty(uint lux)
 {
-       VehicleProperty::ExteriorBrightnessType l(lux);
+        extBrightness->setValue(lux);
 
        for(auto reply : replyQueue)
        {
-               reply->value = &l;
+               reply->value = extBrightness;
                reply->success = true;
                try{
                        reply->completed(reply);
@@ -526,7 +526,7 @@ void OpenCvLuxPlugin::updateProperty(uint lux)
        if(lux != lastLux && shared->mRequests.size())
        {
                lastLux = lux;
-               routingEngine->updateProperty(&l, uuid());
+               routingEngine->updateProperty(extBrightness, uuid());
        }
 
 
index b5d189b..8c280ad 100644 (file)
@@ -46,7 +46,7 @@ public:
                bool threaded;
                bool kinect;
                bool useOpenCl;
-        bool useCuda;
+               bool useCuda;
                int pixelLowerBound;
                int pixelUpperBound;
                bool loggingOn;
@@ -55,7 +55,7 @@ public:
        OpenCvLuxPlugin(AbstractRoutingEngine* re, map<string, string> config);
 
        ~OpenCvLuxPlugin();
-       
+
        const string uuid();
        void getPropertyAsync(AsyncPropertyReply *reply);
        void getRangePropertyAsync(AsyncRangePropertyReply *reply);
@@ -67,9 +67,9 @@ public:
        int supportedOperations();
 
        void propertyChanged(AbstractPropertyType* value);
-       
+
        void supportedChanged(const PropertyList &);
-       
+
        void updateProperty(uint lux);
 
        void writeVideoFrame(cv::Mat frame);
@@ -77,11 +77,11 @@ public:
 public Q_SLOTS:
        void imgProcResult();
 
-       
+
 private: /// methods:
        bool init();
 
-private:       
+private:
        uint speed;
        uint latitude;
        uint longitude;
@@ -90,6 +90,8 @@ private:
        std::string device;
        std::list<AsyncPropertyReply*> replyQueue;
 
+       VehicleProperty::ExteriorBrightnessType* extBrightness;
+
        Shared* shared;
        QMutex mutex;
 };