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)
}
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;
PropertyList props;
props.push_back(VehicleProperty::ExteriorBrightness);
props.push_back(VideoLogging);
-
+
return props;
}
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);
if(lux != lastLux && shared->mRequests.size())
{
lastLux = lux;
- routingEngine->updateProperty(&l, uuid());
+ routingEngine->updateProperty(extBrightness, uuid());
}
bool threaded;
bool kinect;
bool useOpenCl;
- bool useCuda;
+ bool useCuda;
int pixelLowerBound;
int pixelUpperBound;
bool loggingOn;
OpenCvLuxPlugin(AbstractRoutingEngine* re, map<string, string> config);
~OpenCvLuxPlugin();
-
+
const string uuid();
void getPropertyAsync(AsyncPropertyReply *reply);
void getRangePropertyAsync(AsyncRangePropertyReply *reply);
int supportedOperations();
void propertyChanged(AbstractPropertyType* value);
-
+
void supportedChanged(const PropertyList &);
-
+
void updateProperty(uint lux);
void writeVideoFrame(cv::Mat frame);
public Q_SLOTS:
void imgProcResult();
-
+
private: /// methods:
bool init();
-private:
+private:
uint speed;
uint latitude;
uint longitude;
std::string device;
std::list<AsyncPropertyReply*> replyQueue;
+ VehicleProperty::ExteriorBrightnessType* extBrightness;
+
Shared* shared;
QMutex mutex;
};