diff --git a/.gitignore b/.gitignore index 8cc4dca7..c60e2170 100644 --- a/.gitignore +++ b/.gitignore @@ -120,3 +120,9 @@ Projects/img_mill/side/YOLOV4-C-official-AlexeyAB/* Projects/img_mill/side/YOLOV4-C-official-AlexeyAB Projects/img_mill/side/dlib Projects/img_mill/side/dlib/* +Projects/img_mill/Debug_CPU_ONLY +Projects/img_mill/Debug_CPU_ONLY/* +Projects/img_mill/side/DarkHelp +Projects/img_mill/side/codeberg_darknet +Projects/img_mill/side/DarkHelp/* +Projects/img_mill/side/codeberg_darknet/* \ No newline at end of file diff --git a/Projects/img_mill/IM_DLibWorker.cpp b/Projects/img_mill/IM_DLibWorker.cpp index b732411a..4680e283 100644 --- a/Projects/img_mill/IM_DLibWorker.cpp +++ b/Projects/img_mill/IM_DLibWorker.cpp @@ -17,19 +17,19 @@ // Constructor implementation -IM_DlibWorker::IM_DlibWorker( config_setting_t * Settings ) : basicThread(), m_mBufferProtectorMutex(){ - m_pLog = basicLogCollection::getInstance(); +IM_DlibWorker::IM_DlibWorker( config_setting_t * Settings ) : imageParser(), basicThread(), m_mBufferProtectorMutex(){ + //m_pLog = basicLogCollection::getInstance(); m_pSettings = basicSettingsProvider::getInstance()->getSubNode( Settings, "DLIB" ); - m_pEvtHeap = basicEventHeap::getInstance(); + //m_pEvtHeap = basicEventHeap::getInstance(); m_pDBA = IM_DataBaseAdapter::getInstance(); // m_eBackendEngine = cv::dnn::DNN_BACKEND_DEFAULT; // m_eTargetDevice = cv::dnn::DNN_TARGET_CPU; - m_pActiveJob = NULL; + //m_pActiveJob = NULL; m_fDetectionProbability = .7f; m_bUseShapePredictor = false; m_bUseFaceRecognition = false; - m_bDataIsActive = false; + //m_bDataIsActive = false; }; // Destructor implementation diff --git a/Projects/img_mill/IM_DLibWorker.h b/Projects/img_mill/IM_DLibWorker.h index ce4f86e6..9683cf0c 100644 --- a/Projects/img_mill/IM_DLibWorker.h +++ b/Projects/img_mill/IM_DLibWorker.h @@ -4,9 +4,8 @@ #include "../../lib/components/base/basicThread.h" #include "../../lib/components/base/basicMutex.h" #include "../../lib/components/base/basicSettingsProvider.h" -#include "../../lib/components/base/basicEventHeap.h" - -#include "IM_DataStructs.h" +#include "../../lib/App/common/imageParser.h" +//#include "IM_DataStructs.h" #include "IM_DataBaseAdapter.h" #define DLIB @@ -18,8 +17,8 @@ #undef GPU #endif -#include -#include +//#include +//#include #include #include #include @@ -75,7 +74,7 @@ std::vector> jitter_image( const matrix& img ); * * @author Gagua */ -class IM_DlibWorker : public basicThread{ +class IM_DlibWorker : public imageParser, public basicThread{ private: frontal_face_detector m_oFaceDetector; @@ -84,10 +83,10 @@ class IM_DlibWorker : public basicThread{ IM_DataBaseAdapter * m_pDBA; //matrix m_oInputImg; //std::vector> m_vFacesImg; - basicLogCollection * m_pLog; +// basicLogCollection * m_pLog; config_setting_t * m_pSettings; - basicEventHeap * m_pEvtHeap; - cv::Mat m_oWorkingMat; + //basicEventHeap * m_pEvtHeap; + //cv::Mat m_oWorkingMat; float m_fDetectionProbability; bool m_bUseShapePredictor; bool m_bUseFaceRecognition; @@ -98,10 +97,10 @@ class IM_DlibWorker : public basicThread{ char m_sChownUser[64]; char m_sChownGroup[64]; basicMutex m_mBufferProtectorMutex; - IM_JOB * m_pActiveJob; - bool m_bDataIsActive; + //IM_JOB * m_pActiveJob; + //bool m_bDataIsActive; CSTR m_fSaveFace( matrix &Picture, CSTR md5, uint32_t index ); - IM_RESULT * m_fImageAnalyzer( cv::Mat &Picture ); + virtual IM_RESULT * m_fImageAnalyzer( cv::Mat &Picture ); protected: virtual void m_fThreadProc( void );//getLayerNames() public: @@ -109,8 +108,8 @@ class IM_DlibWorker : public basicThread{ explicit IM_DlibWorker( config_setting_t * Settings = NULL ); // Destructor virtual ~IM_DlibWorker(); - bool create( void ); - bool enqueueJob( IM_JOB *ptr ); + virtual bool create( void ); + virtual bool enqueueJob( IM_JOB *ptr ); }; diff --git a/Projects/img_mill/IM_DataBaseAdapter.h b/Projects/img_mill/IM_DataBaseAdapter.h index 1c2480bc..190f846c 100644 --- a/Projects/img_mill/IM_DataBaseAdapter.h +++ b/Projects/img_mill/IM_DataBaseAdapter.h @@ -3,7 +3,8 @@ #include "../../lib/data/mysql/mysql_class.h" #include "../../lib/components/base/basicSettingsProvider.h" -#include "IM_DataStructs.h" +#include "../../lib/App/common/imageParser.h" +//#include "IM_DataStructs.h" /** * TODO: Add class description diff --git a/Projects/img_mill/IM_DnnWorker.cpp b/Projects/img_mill/IM_DnnWorker.cpp index b5ff7731..99efb59e 100644 --- a/Projects/img_mill/IM_DnnWorker.cpp +++ b/Projects/img_mill/IM_DnnWorker.cpp @@ -22,16 +22,23 @@ IM_DnnWorker::IM_DnnWorker( config_setting_t * Settings ) : basicThread(), m_mBu m_pActiveJob = NULL; #ifdef DARKNET - m_pDarknetDetector = NULL; + #ifdef DIRECT_DARKNET + m_pDarknetWraper = NULL; + #else + m_pDarknetDetector = NULL; + #endif #endif - m_bDataIsActive = false; }; // Destructor implementation IM_DnnWorker::~IM_DnnWorker(){ #ifdef DARKNET - if( m_pDarknetDetector ) delete( m_pDarknetDetector ); + #ifdef DIRECT_DARKNET + if( m_pDarknetWraper ) delete( m_pDarknetWraper ); + #else + if( m_pDarknetDetector ) delete( m_pDarknetDetector ); + #endif #endif }; @@ -166,25 +173,46 @@ bool IM_DnnWorker::create( void ){ #ifdef DARKNET try { LOG("Trying Load DARKNET"); - m_pDarknetDetector = new Detector( m_pConfigPath, m_pWeightsPath ); - LOG("After New ..."); - if( m_pDarknetDetector ) { - LOG("DarkNet Detector Created"); - } else { - LOG_ERROR("Failure during DarkNet Detector Creation!"); - }; + #ifdef DIRECT_DARKNET + // The arguments are: config file, weights file, clear (0 for no clear), batch size (1 for inference) + m_pDarknetWraper = new darknetWraper(); + LOG("After New ..."); + if( m_pDarknetWraper ) { + LOG("DarkNet Wraper Created"); + if( !m_pDarknetWraper->l_n( m_pConfigPath, m_pWeightsPath, 0 ) ){ + LOG_ERROR("Network Load Error!"); + delete( m_pDarknetWraper ); + m_pDarknetWraper = NULL; + } else LOG("Network Loadded"); + } else { + LOG_ERROR("Failure during DarkNet Detector Creation!"); + }; + #else + m_pDarknetDetector = new Detector( m_pConfigPath, m_pWeightsPath ); + LOG("After New ..."); + if( m_pDarknetDetector ) { + LOG("DarkNet Detector Created"); + } else { + LOG_ERROR("Failure during DarkNet Detector Creation!"); + }; + #endif + } catch ( exception e ) { LOG_ERROR( e.what() ); }; #else LOG("Trying Load CV::DARKNET"); - m_net = cv::dnn::readNetFromDarknet( m_pConfigPath, m_pWeightsPath ); - m_net.setPreferableBackend( m_eBackendEngine ); - m_net.setPreferableTarget( m_eTargetDevice ); - std::vector outNames = m_net.getUnconnectedOutLayersNames(); - LOG("OutNames"); - for( std::vector::iterator idx = outNames.begin(); idx < outNames.end(); idx++ ) { - LOG( (*idx).c_str() ); + try { + m_net = cv::dnn::readNetFromDarknet(m_pConfigPath, m_pWeightsPath); + m_net.setPreferableBackend( m_eBackendEngine ); + m_net.setPreferableTarget( m_eTargetDevice ); + std::vector outNames = m_net.getUnconnectedOutLayersNames(); + LOG("OutNames"); + for( std::vector::iterator idx = outNames.begin(); idx < outNames.end(); idx++ ) { + LOG( (*idx).c_str() ); + }; + } catch ( exception e ) { + LOG_ERROR( e.what() ); }; #endif LOG("ALL Good ... "); @@ -236,41 +264,48 @@ IM_RESULT *IM_DnnWorker::m_fImageAnalyzer( Mat &Picture ){ LOG_ERROR( e.what() ); }; #else - std::shared_ptr img = m_pDarknetDetector->mat_to_image_resize( Picture ); - std::vector result_vec; - //result_vec = detector.detect_resized( * img, inpSize.width, inpSize.height, thresh, true); - result_vec = m_pDarknetDetector->detect_resized( *img, inpSize.width, inpSize.height, m_fDetectionProbability, true); - if( result_vec.size() ) { - retVal = (IM_RESULT *)malloc(sizeof(IM_RESULT)); - if( retVal ) { - retVal->pJOB = m_pActiveJob; - retVal->nBoxCount = result_vec.size(); - retVal->boxes = (IM_CLASS_BOUNDARY_BOX *) calloc( retVal->nBoxCount,sizeof(IM_CLASS_BOUNDARY_BOX)); - if( retVal->boxes ) { - for( int i=0; i< result_vec.size(); i++ ) { - bbox_t * b = &(result_vec.at(i)); - retVal->boxes[i].weight = b->prob; - retVal->boxes[i].x = b->x; - retVal->boxes[i].y = b->y; - retVal->boxes[i].width = b->w; - retVal->boxes[i].height = b->h; - if( m_bUseClassMapping ){ - retVal->boxes[i].classID = m_vClassesMap[b->obj_id]; - } else { - retVal->boxes[i].classID = b->obj_id; - }; + #ifdef DIRECT_DARKNET + if ( !m_pDarknetWraper ) { + } else { + m_pDarknetWraper->detect( Picture ); + }; + #else + std::shared_ptr img = m_pDarknetDetector->mat_to_image_resize( Picture ); + std::vector result_vec; + //result_vec = detector.detect_resized( * img, inpSize.width, inpSize.height, thresh, true); + result_vec = m_pDarknetDetector->detect_resized( *img, inpSize.width, inpSize.height, m_fDetectionProbability, true); + if( result_vec.size() ) { + retVal = (IM_RESULT *)malloc(sizeof(IM_RESULT)); + if( retVal ) { + retVal->pJOB = m_pActiveJob; + retVal->nBoxCount = result_vec.size(); + retVal->boxes = (IM_CLASS_BOUNDARY_BOX *) calloc( retVal->nBoxCount,sizeof(IM_CLASS_BOUNDARY_BOX)); + if( retVal->boxes ) { + for( int i=0; i< result_vec.size(); i++ ) { + bbox_t * b = &(result_vec.at(i)); + retVal->boxes[i].weight = b->prob; + retVal->boxes[i].x = b->x; + retVal->boxes[i].y = b->y; + retVal->boxes[i].width = b->w; + retVal->boxes[i].height = b->h; + if( m_bUseClassMapping ){ + retVal->boxes[i].classID = m_vClassesMap[b->obj_id]; + } else { + retVal->boxes[i].classID = b->obj_id; + }; #ifdef DEBUG - char msg[256]; - sprintf( msg, "[%d] Class: %d Prob: %.2f X:%d Y:%d W:%d H:%d", i, retVal->boxes[i].classID, retVal->boxes[i].weight, b->x, b->y, b->w, b->h ); - LOG( msg ); + char msg[256]; + sprintf( msg, "[%d] Class: %d Prob: %.2f X:%d Y:%d W:%d H:%d", i, retVal->boxes[i].classID, retVal->boxes[i].weight, b->x, b->y, b->w, b->h ); + LOG( msg ); #endif + }; + } else { + free(retVal); + retVal = NULL; }; - } else { - free(retVal); - retVal = NULL; }; }; - }; + #endif // DIRECT_DARKNET #endif return retVal; }; diff --git a/Projects/img_mill/IM_DnnWorker.h b/Projects/img_mill/IM_DnnWorker.h index 41fc07f4..f2677a03 100644 --- a/Projects/img_mill/IM_DnnWorker.h +++ b/Projects/img_mill/IM_DnnWorker.h @@ -4,15 +4,25 @@ #include "../../lib/components/base/basicThread.h" #include "../../lib/components/base/basicMutex.h" #include "../../lib/components/base/basicSettingsProvider.h" -#include "../../lib/components/base/basicEventHeap.h" -#include "IM_DataStructs.h" +//#include "../../lib/components/base/basicEventHeap.h" +#include "../../lib/App/common/imageParser.h" #define DARKNET +//#define GPU #ifdef DARKNET - #define GPU - //#include - #include + #ifndef GPU + #define DIRECT_DARKNET + #endif + + #ifdef DIRECT_DARKNET + //#include + #include "../../lib/data/darknet/darknetWraper.h" + #endif + //#include +#endif + +#ifdef GPU #undef GPU #endif @@ -31,7 +41,11 @@ using namespace cv; class IM_DnnWorker : public basicThread { private: #ifdef DARKNET + #ifndef DIRECT_DARKNET Detector * m_pDarknetDetector; + #else + darknetWraper * m_pDarknetWraper; + #endif #else #endif basicLogCollection * m_pLog; diff --git a/Projects/img_mill/IM_Kernel.h b/Projects/img_mill/IM_Kernel.h index b7eaf64c..5ba332b9 100644 --- a/Projects/img_mill/IM_Kernel.h +++ b/Projects/img_mill/IM_Kernel.h @@ -4,7 +4,7 @@ #include "../../lib/data/net/netServiceEngine.h" #include "../../lib/components/base/basicThread.h" #include "../../lib/components/base/basicSettingsProvider.h" -#include "IM_DataStructs.h" +//#include "IM_DataStructs.h" #include "IM_DnnWorker.h" #include "IM_DLibWorker.h" #include "IM_DataBaseAdapter.h" diff --git a/Projects/img_mill/build b/Projects/img_mill/build index 649499fc..4d6c4d20 100755 --- a/Projects/img_mill/build +++ b/Projects/img_mill/build @@ -1,8 +1,8 @@ #! /bin/sh -make clean -e "CFG=Debug" -make -j$(nproc) -e "CFG=Debug" +make clean -e "CFG=Debug_CPU_ONLY" +make -j$(nproc) -e "CFG=Debug_CPU_ONLY" #make clean -e "CFG=Release" diff --git a/Projects/img_mill/img_mill.vpj b/Projects/img_mill/img_mill.vpj index d3cab5d5..92b58089 100644 --- a/Projects/img_mill/img_mill.vpj +++ b/Projects/img_mill/img_mill.vpj @@ -264,6 +264,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + @@ -314,14 +437,16 @@ Filters="*.h;*.H;*.hh;*.hpp;*.hxx;*.inc;*.sh;*.cpy;*.if" GUID="{02B83E64-7572-484A-94DB-15BE03E07219}"> + - + + diff --git a/Projects/img_mill/makefile b/Projects/img_mill/makefile index 71858273..456bf969 100644 --- a/Projects/img_mill/makefile +++ b/Projects/img_mill/makefile @@ -35,10 +35,11 @@ COMMON_OBJ=$(OUTDIR)/basicDualThread.o $(OUTDIR)/basicEngine.o \ $(OUTDIR)/basicObject.o $(OUTDIR)/basicRing.o \ $(OUTDIR)/basicSettings.o $(OUTDIR)/basicSettingsProvider.o \ $(OUTDIR)/basicThread.o $(OUTDIR)/basicTransport.o \ - $(OUTDIR)/IM_Backend.o $(OUTDIR)/IM_ClientHandler.o \ - $(OUTDIR)/IM_ClientProtocol.o $(OUTDIR)/IM_DataBaseAdapter.o \ - $(OUTDIR)/IM_DataStructs.o $(OUTDIR)/IM_DLibWorker.o \ + $(OUTDIR)/darknetWraper.o $(OUTDIR)/IM_Backend.o \ + $(OUTDIR)/IM_ClientHandler.o $(OUTDIR)/IM_ClientProtocol.o \ + $(OUTDIR)/IM_DataBaseAdapter.o $(OUTDIR)/IM_DLibWorker.o \ $(OUTDIR)/IM_DnnWorker.o $(OUTDIR)/IM_Kernel.o \ + $(OUTDIR)/imageParser.o $(OUTDIR)/imageParserDataStructs.o \ $(OUTDIR)/json_reader.o $(OUTDIR)/json_value.o \ $(OUTDIR)/json_writer.o $(OUTDIR)/md5.o $(OUTDIR)/mysql_class.o \ $(OUTDIR)/netClientHandler.o $(OUTDIR)/netServer.o \ @@ -56,10 +57,11 @@ ALL_OBJ=$(OUTDIR)/basicDualThread.o $(OUTDIR)/basicEngine.o \ $(OUTDIR)/basicObject.o $(OUTDIR)/basicRing.o \ $(OUTDIR)/basicSettings.o $(OUTDIR)/basicSettingsProvider.o \ $(OUTDIR)/basicThread.o $(OUTDIR)/basicTransport.o \ - $(OUTDIR)/IM_Backend.o $(OUTDIR)/IM_ClientHandler.o \ - $(OUTDIR)/IM_ClientProtocol.o $(OUTDIR)/IM_DataBaseAdapter.o \ - $(OUTDIR)/IM_DataStructs.o $(OUTDIR)/IM_DLibWorker.o \ + $(OUTDIR)/darknetWraper.o $(OUTDIR)/IM_Backend.o \ + $(OUTDIR)/IM_ClientHandler.o $(OUTDIR)/IM_ClientProtocol.o \ + $(OUTDIR)/IM_DataBaseAdapter.o $(OUTDIR)/IM_DLibWorker.o \ $(OUTDIR)/IM_DnnWorker.o $(OUTDIR)/IM_Kernel.o \ + $(OUTDIR)/imageParser.o $(OUTDIR)/imageParserDataStructs.o \ $(OUTDIR)/json_reader.o $(OUTDIR)/json_value.o \ $(OUTDIR)/json_writer.o $(OUTDIR)/md5.o $(OUTDIR)/mysql_class.o \ $(OUTDIR)/netClientHandler.o $(OUTDIR)/netServer.o \ @@ -78,6 +80,9 @@ LINK=g++ -g -ggdb -o "$(OUTFILE)" $(ALL_OBJ) $(OUTDIR)/%.o : ../../lib/components/object/%.cpp $(COMPILE) +$(OUTDIR)/%.o : ../../lib/data/darknet/%.cpp + $(COMPILE) + $(OUTDIR)/%.o : ../../lib/data/json/%.cpp $(COMPILE) @@ -90,6 +95,9 @@ $(OUTDIR)/%.o : ../../lib/data/protocol/%.cpp $(OUTDIR)/%.o : ../../lib/data/net/%.cpp $(COMPILE) +$(OUTDIR)/%.o : ../../lib/App/common/%.cpp + $(COMPILE) + $(OUTDIR)/%.o : ../../lib/data/mysql/%.cpp $(COMPILE) @@ -145,10 +153,11 @@ COMMON_OBJ=$(OUTDIR)/basicDualThread.o $(OUTDIR)/basicEngine.o \ $(OUTDIR)/basicObject.o $(OUTDIR)/basicRing.o \ $(OUTDIR)/basicSettings.o $(OUTDIR)/basicSettingsProvider.o \ $(OUTDIR)/basicThread.o $(OUTDIR)/basicTransport.o \ - $(OUTDIR)/IM_Backend.o $(OUTDIR)/IM_ClientHandler.o \ - $(OUTDIR)/IM_ClientProtocol.o $(OUTDIR)/IM_DataBaseAdapter.o \ - $(OUTDIR)/IM_DataStructs.o $(OUTDIR)/IM_DLibWorker.o \ + $(OUTDIR)/darknetWraper.o $(OUTDIR)/IM_Backend.o \ + $(OUTDIR)/IM_ClientHandler.o $(OUTDIR)/IM_ClientProtocol.o \ + $(OUTDIR)/IM_DataBaseAdapter.o $(OUTDIR)/IM_DLibWorker.o \ $(OUTDIR)/IM_DnnWorker.o $(OUTDIR)/IM_Kernel.o \ + $(OUTDIR)/imageParser.o $(OUTDIR)/imageParserDataStructs.o \ $(OUTDIR)/json_reader.o $(OUTDIR)/json_value.o \ $(OUTDIR)/json_writer.o $(OUTDIR)/md5.o $(OUTDIR)/mysql_class.o \ $(OUTDIR)/netClientHandler.o $(OUTDIR)/netServer.o \ @@ -166,10 +175,11 @@ ALL_OBJ=$(OUTDIR)/basicDualThread.o $(OUTDIR)/basicEngine.o \ $(OUTDIR)/basicObject.o $(OUTDIR)/basicRing.o \ $(OUTDIR)/basicSettings.o $(OUTDIR)/basicSettingsProvider.o \ $(OUTDIR)/basicThread.o $(OUTDIR)/basicTransport.o \ - $(OUTDIR)/IM_Backend.o $(OUTDIR)/IM_ClientHandler.o \ - $(OUTDIR)/IM_ClientProtocol.o $(OUTDIR)/IM_DataBaseAdapter.o \ - $(OUTDIR)/IM_DataStructs.o $(OUTDIR)/IM_DLibWorker.o \ + $(OUTDIR)/darknetWraper.o $(OUTDIR)/IM_Backend.o \ + $(OUTDIR)/IM_ClientHandler.o $(OUTDIR)/IM_ClientProtocol.o \ + $(OUTDIR)/IM_DataBaseAdapter.o $(OUTDIR)/IM_DLibWorker.o \ $(OUTDIR)/IM_DnnWorker.o $(OUTDIR)/IM_Kernel.o \ + $(OUTDIR)/imageParser.o $(OUTDIR)/imageParserDataStructs.o \ $(OUTDIR)/json_reader.o $(OUTDIR)/json_value.o \ $(OUTDIR)/json_writer.o $(OUTDIR)/md5.o $(OUTDIR)/mysql_class.o \ $(OUTDIR)/netClientHandler.o $(OUTDIR)/netServer.o \ @@ -188,6 +198,9 @@ LINK=g++ -O3 -s -o "$(OUTFILE)" $(ALL_OBJ) $(OUTDIR)/%.o : ../../lib/components/object/%.cpp $(COMPILE) +$(OUTDIR)/%.o : ../../lib/data/darknet/%.cpp + $(COMPILE) + $(OUTDIR)/%.o : ../../lib/data/json/%.cpp $(COMPILE) @@ -200,6 +213,125 @@ $(OUTDIR)/%.o : ../../lib/data/protocol/%.cpp $(OUTDIR)/%.o : ../../lib/data/net/%.cpp $(COMPILE) +$(OUTDIR)/%.o : ../../lib/App/common/%.cpp + $(COMPILE) + +$(OUTDIR)/%.o : ../../lib/data/mysql/%.cpp + $(COMPILE) + +$(OUTDIR)/%.o : ../../lib/components/base/%.cpp + $(COMPILE) + +$(OUTDIR)/%.o : ../../lib/alg/generic/%.cpp + $(COMPILE) + +$(OUTDIR)/%.o : %.cpp + $(COMPILE) + +# Build rules +all: $(OUTFILE) + +$(OUTFILE): $(OUTDIR) $(OBJ) + $(LINK) + +$(OUTDIR): + $(MKDIR) -p "$(OUTDIR)" + +# Rebuild this project +rebuild: cleanall + @$(MAKE) -f "$(strip $(MAKEFILE_LIST))" $(MAKEFLAGS) all + +# Clean this project +clean: + $(RM) -f $(OUTFILE) + $(RM) -f $(OBJ) + +# Clean this project and all dependencies +cleanall: clean +endif + +# +# Configuration: Debug_CPU_ONLY +# +ifeq "$(CFG)" "Debug_CPU_ONLY" +OUTDIR=Debug_CPU_ONLY +OUTFILE=$(OUTDIR)/img_mill +CFG_INC=-I/usr/local/include/opencv4 -I../../lib/include +CFG_LIB=-lmysqlclient -lssl -lcrypto -lpthread `pkg-config --libs \ + libcurl opencv4 dlib-1` -lconfig -ljpeg -lc -lm -lz -ldarknet -lc \ + -lm -lz -lstdc++fs +CFG_OBJ= +COMMON_OBJ=$(OUTDIR)/basicDualThread.o $(OUTDIR)/basicEngine.o \ + $(OUTDIR)/basicEvent.o $(OUTDIR)/basicEventHandler.o \ + $(OUTDIR)/basicEventHeap.o $(OUTDIR)/basicFunctionality.o \ + $(OUTDIR)/basicLogCollection.o $(OUTDIR)/basicLoggingService.o \ + $(OUTDIR)/basicMediaDestination.o $(OUTDIR)/basicMediaSource.o \ + $(OUTDIR)/basicMediaViewer.o $(OUTDIR)/basicMutex.o \ + $(OUTDIR)/basicObject.o $(OUTDIR)/basicRing.o \ + $(OUTDIR)/basicSettings.o $(OUTDIR)/basicSettingsProvider.o \ + $(OUTDIR)/basicThread.o $(OUTDIR)/basicTransport.o \ + $(OUTDIR)/darknetWraper.o $(OUTDIR)/IM_Backend.o \ + $(OUTDIR)/IM_ClientHandler.o $(OUTDIR)/IM_ClientProtocol.o \ + $(OUTDIR)/IM_DataBaseAdapter.o $(OUTDIR)/IM_DLibWorker.o \ + $(OUTDIR)/IM_DnnWorker.o $(OUTDIR)/IM_Kernel.o \ + $(OUTDIR)/imageParser.o $(OUTDIR)/imageParserDataStructs.o \ + $(OUTDIR)/json_reader.o $(OUTDIR)/json_value.o \ + $(OUTDIR)/json_writer.o $(OUTDIR)/md5.o $(OUTDIR)/mysql_class.o \ + $(OUTDIR)/netClientHandler.o $(OUTDIR)/netServer.o \ + $(OUTDIR)/objectConsoleLoggingService.o \ + $(OUTDIR)/objectFileLoggingService.o $(OUTDIR)/protocol.o \ + $(OUTDIR)/serverPort.o $(OUTDIR)/transportSocket.o \ + $(OUTDIR)/xmlParser.o +OBJ=$(COMMON_OBJ) $(CFG_OBJ) +ALL_OBJ=$(OUTDIR)/basicDualThread.o $(OUTDIR)/basicEngine.o \ + $(OUTDIR)/basicEvent.o $(OUTDIR)/basicEventHandler.o \ + $(OUTDIR)/basicEventHeap.o $(OUTDIR)/basicFunctionality.o \ + $(OUTDIR)/basicLogCollection.o $(OUTDIR)/basicLoggingService.o \ + $(OUTDIR)/basicMediaDestination.o $(OUTDIR)/basicMediaSource.o \ + $(OUTDIR)/basicMediaViewer.o $(OUTDIR)/basicMutex.o \ + $(OUTDIR)/basicObject.o $(OUTDIR)/basicRing.o \ + $(OUTDIR)/basicSettings.o $(OUTDIR)/basicSettingsProvider.o \ + $(OUTDIR)/basicThread.o $(OUTDIR)/basicTransport.o \ + $(OUTDIR)/darknetWraper.o $(OUTDIR)/IM_Backend.o \ + $(OUTDIR)/IM_ClientHandler.o $(OUTDIR)/IM_ClientProtocol.o \ + $(OUTDIR)/IM_DataBaseAdapter.o $(OUTDIR)/IM_DLibWorker.o \ + $(OUTDIR)/IM_DnnWorker.o $(OUTDIR)/IM_Kernel.o \ + $(OUTDIR)/imageParser.o $(OUTDIR)/imageParserDataStructs.o \ + $(OUTDIR)/json_reader.o $(OUTDIR)/json_value.o \ + $(OUTDIR)/json_writer.o $(OUTDIR)/md5.o $(OUTDIR)/mysql_class.o \ + $(OUTDIR)/netClientHandler.o $(OUTDIR)/netServer.o \ + $(OUTDIR)/objectConsoleLoggingService.o \ + $(OUTDIR)/objectFileLoggingService.o $(OUTDIR)/protocol.o \ + $(OUTDIR)/serverPort.o $(OUTDIR)/transportSocket.o \ + $(OUTDIR)/xmlParser.o -lmysqlclient -lssl -lcrypto -lpthread \ + `pkg-config --libs libcurl opencv4 dlib-1` -lconfig -ljpeg -lc -lm \ + -lz -ldarknet -lc -lm -lz -lstdc++fs + +COMPILE=g++ -c -x c++ "-D_OPENCV_" "-DDEBUG" "-DOPENCV" -g -ggdb -std=c++17 -Wno-write-strings -I../../lib/include `pkg-config opencv4 libavcodec libavdevice libavfilter libavformat libavutil libpostproc libswresample libswscale live555 --cflags` -o "$(OUTDIR)/$(*F).o" $(CFG_INC) $< +LINK=g++ -g -ggdb -o "$(OUTFILE)" $(ALL_OBJ) + +# Pattern rules +$(OUTDIR)/%.o : ../../lib/components/object/%.cpp + $(COMPILE) + +$(OUTDIR)/%.o : ../../lib/data/darknet/%.cpp + $(COMPILE) + +$(OUTDIR)/%.o : ../../lib/data/json/%.cpp + $(COMPILE) + +$(OUTDIR)/%.o : ../../lib/data/transport/%.cpp + $(COMPILE) + +$(OUTDIR)/%.o : ../../lib/data/protocol/%.cpp + $(COMPILE) + +$(OUTDIR)/%.o : ../../lib/data/net/%.cpp + $(COMPILE) + +$(OUTDIR)/%.o : ../../lib/App/common/%.cpp + $(COMPILE) + $(OUTDIR)/%.o : ../../lib/data/mysql/%.cpp $(COMPILE) @@ -255,14 +387,16 @@ $(OUTDIR)/basicSettings.o: ../../lib/components/base/basicSettings.cpp ../../lib $(OUTDIR)/basicSettingsProvider.o: ../../lib/components/base/basicSettingsProvider.cpp ../../lib/components/base/basicSettingsProvider.h $(OUTDIR)/basicThread.o: ../../lib/components/base/basicThread.cpp ../../lib/components/base/basicThread.h $(OUTDIR)/basicTransport.o: ../../lib/components/base/basicTransport.cpp ../../lib/components/base/basicTransport.h ../../lib/data/protocol/protocol.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicThread.h -$(OUTDIR)/IM_Backend.o: IM_Backend.cpp IM_Backend.h ../../lib/components/base/basicSettings.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicMemoryOperation.h ../../lib/components/object/objectFileLoggingService.h ../../lib/components/object/objectConsoleLoggingService.h ../../lib/data/net/netServer.h IM_Kernel.h ../../lib/data/net/netServiceEngine.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicSettingsProvider.h IM_DataStructs.h ../../lib/components/base/basicFunctionality.h IM_DnnWorker.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicEventHeap.h IM_DLibWorker.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicEventHeap.h IM_DataBaseAdapter.h ../../lib/data/mysql/mysql_class.h IM_DataBaseAdapter.h ../../lib/data/mysql/mysql_class.h -$(OUTDIR)/IM_ClientHandler.o: IM_ClientHandler.cpp IM_ClientHandler.h ../../lib/data/net/netClientHandler.h ../../lib/data/protocol/protocol.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicEventHandler.h ../../lib/components/base/basicLogCollection.h ../../lib/data/net/serverPort.h ../../lib/data/net/netServiceEngine.h IM_ClientProtocol.h ../../lib/data/protocol/protocol.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicThread.h IM_DataBaseAdapter.h ../../lib/data/mysql/mysql_class.h IM_Kernel.h ../../lib/data/net/netServiceEngine.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicSettingsProvider.h IM_DataStructs.h ../../lib/components/base/basicFunctionality.h IM_DnnWorker.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicEventHeap.h IM_DLibWorker.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicEventHeap.h IM_DataBaseAdapter.h ../../lib/data/mysql/mysql_class.h IM_DataBaseAdapter.h ../../lib/data/mysql/mysql_class.h ../../lib/components/base/basicFunctionality.h ../../lib/data/json/json_tool.h ../../lib/data/protocol/xmlParser.h ../../lib/include/json/value.h ../../lib/include/json/writer.h ../../lib/include/json/reader.h +$(OUTDIR)/darknetWraper.o: ../../lib/data/darknet/darknetWraper.cpp ../../lib/data/darknet/darknetWraper.h ../../lib/components/base/basicFunctionality.h +$(OUTDIR)/IM_Backend.o: IM_Backend.cpp IM_Backend.h ../../lib/components/base/basicSettings.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicMemoryOperation.h ../../lib/components/object/objectFileLoggingService.h ../../lib/components/object/objectConsoleLoggingService.h ../../lib/data/net/netServer.h IM_Kernel.h ../../lib/data/net/netServiceEngine.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicSettingsProvider.h IM_DnnWorker.h ../../lib/components/base/basicMutex.h ../../lib/App/common/imageParser.h ../../lib/App/common/imageParserDataStructs.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicEventHeap.h ../../lib/data/darknet/darknetWraper.h ../../lib/components/base/basicFunctionality.h IM_DLibWorker.h ../../lib/components/base/basicMutex.h ../../lib/App/common/imageParser.h ../../lib/App/common/imageParserDataStructs.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicEventHeap.h IM_DataBaseAdapter.h ../../lib/data/mysql/mysql_class.h IM_DataBaseAdapter.h ../../lib/data/mysql/mysql_class.h +$(OUTDIR)/IM_ClientHandler.o: IM_ClientHandler.cpp IM_ClientHandler.h ../../lib/data/net/netClientHandler.h ../../lib/data/protocol/protocol.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicEventHandler.h ../../lib/components/base/basicLogCollection.h ../../lib/data/net/serverPort.h ../../lib/data/net/netServiceEngine.h IM_ClientProtocol.h ../../lib/data/protocol/protocol.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicThread.h IM_DataBaseAdapter.h ../../lib/data/mysql/mysql_class.h IM_Kernel.h ../../lib/data/net/netServiceEngine.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicSettingsProvider.h IM_DnnWorker.h ../../lib/components/base/basicMutex.h ../../lib/App/common/imageParser.h ../../lib/App/common/imageParserDataStructs.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicEventHeap.h ../../lib/data/darknet/darknetWraper.h ../../lib/components/base/basicFunctionality.h IM_DLibWorker.h ../../lib/components/base/basicMutex.h ../../lib/App/common/imageParser.h ../../lib/App/common/imageParserDataStructs.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicEventHeap.h IM_DataBaseAdapter.h ../../lib/data/mysql/mysql_class.h IM_DataBaseAdapter.h ../../lib/data/mysql/mysql_class.h ../../lib/components/base/basicFunctionality.h ../../lib/data/json/json_tool.h ../../lib/data/protocol/xmlParser.h ../../lib/include/json/value.h ../../lib/include/json/writer.h ../../lib/include/json/reader.h $(OUTDIR)/IM_ClientProtocol.o: IM_ClientProtocol.cpp IM_ClientProtocol.h ../../lib/data/protocol/protocol.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicThread.h $(OUTDIR)/IM_DataBaseAdapter.o: IM_DataBaseAdapter.cpp IM_DataBaseAdapter.h ../../lib/data/mysql/mysql_class.h ../../lib/alg/generic/md5.h -$(OUTDIR)/IM_DataStructs.o: IM_DataStructs.cpp IM_DataStructs.h ../../lib/components/base/basicFunctionality.h -$(OUTDIR)/IM_DLibWorker.o: IM_DLibWorker.cpp IM_DLibWorker.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicEventHeap.h IM_DataBaseAdapter.h ../../lib/data/mysql/mysql_class.h ../../lib/alg/generic/md5.h ../../lib/components/base/basicFunctionality.h -$(OUTDIR)/IM_DnnWorker.o: IM_DnnWorker.cpp IM_DnnWorker.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicEventHeap.h ../../lib/components/base/basicFunctionality.h -$(OUTDIR)/IM_Kernel.o: IM_Kernel.cpp IM_Kernel.h ../../lib/data/net/netServiceEngine.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicSettingsProvider.h IM_DataStructs.h ../../lib/components/base/basicFunctionality.h IM_DnnWorker.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicEventHeap.h IM_DLibWorker.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicEventHeap.h IM_DataBaseAdapter.h ../../lib/data/mysql/mysql_class.h IM_DataBaseAdapter.h ../../lib/data/mysql/mysql_class.h IM_ClientHandler.h ../../lib/data/net/netClientHandler.h ../../lib/data/protocol/protocol.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicEventHandler.h ../../lib/components/base/basicLogCollection.h ../../lib/data/net/serverPort.h ../../lib/data/net/netServiceEngine.h IM_ClientProtocol.h ../../lib/data/protocol/protocol.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicThread.h IM_DataBaseAdapter.h ../../lib/data/mysql/mysql_class.h +$(OUTDIR)/IM_DLibWorker.o: IM_DLibWorker.cpp IM_DLibWorker.h ../../lib/components/base/basicMutex.h ../../lib/App/common/imageParser.h ../../lib/App/common/imageParserDataStructs.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicEventHeap.h IM_DataBaseAdapter.h ../../lib/data/mysql/mysql_class.h ../../lib/alg/generic/md5.h ../../lib/components/base/basicFunctionality.h +$(OUTDIR)/IM_DnnWorker.o: IM_DnnWorker.cpp IM_DnnWorker.h ../../lib/components/base/basicMutex.h ../../lib/App/common/imageParser.h ../../lib/App/common/imageParserDataStructs.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicEventHeap.h ../../lib/data/darknet/darknetWraper.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicFunctionality.h +$(OUTDIR)/IM_Kernel.o: IM_Kernel.cpp IM_Kernel.h ../../lib/data/net/netServiceEngine.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicSettingsProvider.h IM_DnnWorker.h ../../lib/components/base/basicMutex.h ../../lib/App/common/imageParser.h ../../lib/App/common/imageParserDataStructs.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicEventHeap.h ../../lib/data/darknet/darknetWraper.h ../../lib/components/base/basicFunctionality.h IM_DLibWorker.h ../../lib/components/base/basicMutex.h ../../lib/App/common/imageParser.h ../../lib/App/common/imageParserDataStructs.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicEventHeap.h IM_DataBaseAdapter.h ../../lib/data/mysql/mysql_class.h IM_DataBaseAdapter.h ../../lib/data/mysql/mysql_class.h IM_ClientHandler.h ../../lib/data/net/netClientHandler.h ../../lib/data/protocol/protocol.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicEventHandler.h ../../lib/components/base/basicLogCollection.h ../../lib/data/net/serverPort.h ../../lib/data/net/netServiceEngine.h IM_ClientProtocol.h ../../lib/data/protocol/protocol.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicThread.h IM_DataBaseAdapter.h ../../lib/data/mysql/mysql_class.h +$(OUTDIR)/imageParser.o: ../../lib/App/common/imageParser.cpp ../../lib/App/common/imageParser.h ../../lib/App/common/imageParserDataStructs.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicEventHeap.h +$(OUTDIR)/imageParserDataStructs.o: ../../lib/App/common/imageParserDataStructs.cpp ../../lib/App/common/imageParserDataStructs.h ../../lib/components/base/basicFunctionality.h $(OUTDIR)/json_reader.o: ../../lib/data/json/json_reader.cpp ../../lib/data/json/json_tool.h ../../lib/include/json/assertions.h ../../lib/include/json/reader.h ../../lib/include/json/value.h $(OUTDIR)/json_value.o: ../../lib/data/json/json_value.cpp ../../lib/include/json/assertions.h ../../lib/include/json/value.h ../../lib/include/json/writer.h ../../lib/data/json/json_valueiterator.inl $(OUTDIR)/json_writer.o: ../../lib/data/json/json_writer.cpp ../../lib/data/json/json_tool.h ../../lib/include/json/writer.h diff --git a/Projects/img_mill/side/DarkHelp.tar.bz2 b/Projects/img_mill/side/DarkHelp.tar.bz2 new file mode 100644 index 00000000..53fc583c Binary files /dev/null and b/Projects/img_mill/side/DarkHelp.tar.bz2 differ diff --git a/Projects/img_mill/side/darknet-codeberg.tar.bz2 b/Projects/img_mill/side/darknet-codeberg.tar.bz2 new file mode 100644 index 00000000..a3a08fe0 Binary files /dev/null and b/Projects/img_mill/side/darknet-codeberg.tar.bz2 differ diff --git a/Projects/img_mill/side/darknet-master.zip b/Projects/img_mill/side/darknet-master.zip new file mode 100644 index 00000000..b3b3ee0c Binary files /dev/null and b/Projects/img_mill/side/darknet-master.zip differ diff --git a/Projects/img_mill/side/darknet_AlexeyAB.tar.bz2 b/Projects/img_mill/side/darknet_AlexeyAB.tar.bz2 index 278a1124..64764bbc 100644 Binary files a/Projects/img_mill/side/darknet_AlexeyAB.tar.bz2 and b/Projects/img_mill/side/darknet_AlexeyAB.tar.bz2 differ diff --git a/Projects/img_mill/side/old_darknet_AlexeyAB.tar.bz2 b/Projects/img_mill/side/old_darknet_AlexeyAB.tar.bz2 new file mode 100644 index 00000000..278a1124 Binary files /dev/null and b/Projects/img_mill/side/old_darknet_AlexeyAB.tar.bz2 differ diff --git a/Projects/img_mill/side/tkDNN.tar.bz2 b/Projects/img_mill/side/tkDNN.tar.bz2 new file mode 100644 index 00000000..72af9e6f Binary files /dev/null and b/Projects/img_mill/side/tkDNN.tar.bz2 differ diff --git a/Projects/img_mill/side/websocket-master.zip b/Projects/img_mill/side/websocket-master.zip new file mode 100644 index 00000000..1dda931a Binary files /dev/null and b/Projects/img_mill/side/websocket-master.zip differ diff --git a/Projects/la_mojo/makefile b/Projects/la_mojo/makefile index 1a8b0e7f..3bba07b1 100644 --- a/Projects/la_mojo/makefile +++ b/Projects/la_mojo/makefile @@ -874,7 +874,7 @@ $(OUTDIR)/json_value.o: ../../lib/data/json/json_value.cpp ../../lib/data/json/j $(OUTDIR)/json_writer.o: ../../lib/data/json/json_writer.cpp ../../lib/data/json/json_tool.h $(OUTDIR)/kernelEventFilter.o: ../../lib/App/common/kernelEventFilter.cpp ../../lib/App/common/kernelEventFilter.h ../../lib/App/common/MySQL_dataBinder.h ../../lib/App/common/SQLite_dataBinder.h $(OUTDIR)/kernelEventFilterAPF.o: ../../lib/App/common/kernelEventFilterAPF.cpp ../../lib/App/common/kernelEventFilterAPF.h -$(OUTDIR)/kernelEventFilterBubble.o: ../../lib/App/common/kernelEventFilterBubble.cpp ../../lib/App/common/kernelEventFilterBubble.h ../../lib/App/common/kernelEventFilter.h ../../lib/App/common/kernelPrototype.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicMutex.h +$(OUTDIR)/kernelEventFilterBubble.o: ../../lib/App/common/kernelEventFilterBubble.cpp ../../lib/App/common/kernelEventFilterBubble.h ../../lib/App/common/kernelEventFilter.h ../../lib/App/common/kernelPrototype.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicMutex.h ../../lib/components/object/objectSystemAnchor.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/Transform.h $(OUTDIR)/kernelEventFilterTrain.o: ../../lib/App/common/kernelEventFilterTrain.cpp ../../lib/App/common/kernelEventFilterTrain.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/App/common/deviceNodeFactory.h $(OUTDIR)/kernelModule.o: ../../lib/App/common/kernelModule.cpp ../../lib/App/common/kernelModule.h ../../lib/App/common/MySQL_dataBinder.h ../../lib/App/common/SQLite_dataBinder.h $(OUTDIR)/kernelModuleEmbedVideo.o: ../../lib/App/common/kernelModuleEmbedVideo.cpp ../../lib/App/common/kernelModuleEmbedVideo.h ../../lib/App/common/deviceNodeCamera.h ../../lib/App/common/deviceNodeFactory.h @@ -891,7 +891,7 @@ $(OUTDIR)/libzip.o: ../../lib/alg/generic/libzip.cpp ../../lib/alg/generic/libzi $(OUTDIR)/mask.o: ../../lib/alg/lgs/mask.cpp ../../lib/alg/lgs/mask.h ../../lib/components/base/basicTypes.h ../../lib/hardware/soc/general/3DLRF.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/gui/gui.h $(OUTDIR)/md5.o: ../../lib/alg/generic/md5.cpp ../../lib/alg/generic/md5.h $(OUTDIR)/mojoBackend.o: ../../lib/App/mojo/mojoBackend.cpp ../../lib/App/mojo/mojoBackend.h ../../lib/components/base/basicSettings.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicMemoryOperation.h ../../lib/components/object/objectFileLoggingService.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/App/mojo/mojoKernel.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicEventHeap.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/Transform.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/Transform.h ../../lib/alg/lgs/detectorStructures.h ../../lib/components/base/basicTypes.h ../../lib/alg/lgs/detector.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicValidatable.h ../../lib/alg/lgs/detectorStructures.h ../../lib/components/base/basicTypes.h ../../lib/alg/lgs/mask.h ../../lib/components/base/basicTypes.h ../../lib/hardware/soc/general/3DLRF.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/gui/gui.h ../../lib/alg/generic/md5.h ../../lib/App/common/kernelPrototype.h ../../lib/App/mojo/mojoRemoteClient.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/data/net/clientPort.h ../../lib/data/transport/transportSocket.h ../../lib/components/base/basicDualThread.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicTransport.h ../../lib/data/protocol/protocol.h ../../lib/data/protocol/protocolARGUS_DATA.h ../../lib/App/common/dataBinder.h ../../lib/App/common/dataBinder_structures.h ../../lib/App/common/dataBinder_ReportAux.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/Transform.h ../../lib/App/common/MySQL_dataBinder.h ../../lib/App/common/SQLite_dataBinder.h -$(OUTDIR)/mojoKernel.o: ../../lib/App/mojo/mojoKernel.cpp ../../lib/App/mojo/mojoKernel.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicEventHeap.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/Transform.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/Transform.h ../../lib/alg/lgs/detectorStructures.h ../../lib/components/base/basicTypes.h ../../lib/alg/lgs/detector.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicValidatable.h ../../lib/alg/lgs/detectorStructures.h ../../lib/components/base/basicTypes.h ../../lib/alg/lgs/mask.h ../../lib/components/base/basicTypes.h ../../lib/hardware/soc/general/3DLRF.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/gui/gui.h ../../lib/alg/generic/md5.h ../../lib/App/common/kernelPrototype.h ../../lib/App/mojo/mojoRemoteClient.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/data/net/clientPort.h ../../lib/data/transport/transportSocket.h ../../lib/components/base/basicDualThread.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicTransport.h ../../lib/data/protocol/protocol.h ../../lib/data/protocol/protocolARGUS_DATA.h ../../lib/App/common/dataBinder.h ../../lib/App/common/dataBinder_structures.h ../../lib/App/common/dataBinder_ReportAux.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/Transform.h ../../lib/App/common/kernelEventFilterAPF.h ../../lib/App/common/kernelEventFilterTrain.h ../../lib/App/common/kernelModuleEmbedVideo.h ../../lib/App/common/MySQL_dataBinder.h ../../lib/App/common/SQLite_dataBinder.h +$(OUTDIR)/mojoKernel.o: ../../lib/App/mojo/mojoKernel.cpp ../../lib/App/mojo/mojoKernel.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicEventHeap.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/Transform.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/Transform.h ../../lib/alg/lgs/detectorStructures.h ../../lib/components/base/basicTypes.h ../../lib/alg/lgs/detector.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicValidatable.h ../../lib/alg/lgs/detectorStructures.h ../../lib/components/base/basicTypes.h ../../lib/alg/lgs/mask.h ../../lib/components/base/basicTypes.h ../../lib/hardware/soc/general/3DLRF.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/gui/gui.h ../../lib/alg/generic/md5.h ../../lib/App/common/kernelPrototype.h ../../lib/App/mojo/mojoRemoteClient.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/data/net/clientPort.h ../../lib/data/transport/transportSocket.h ../../lib/components/base/basicDualThread.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicTransport.h ../../lib/data/protocol/protocol.h ../../lib/data/protocol/protocolARGUS_DATA.h ../../lib/App/common/dataBinder.h ../../lib/App/common/dataBinder_structures.h ../../lib/App/common/dataBinder_ReportAux.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/Transform.h ../../lib/App/common/kernelEventFilterAPF.h ../../lib/App/common/kernelEventFilterTrain.h ../../lib/App/common/kernelEventFilterBubble.h ../../lib/App/common/kernelEventFilter.h ../../lib/App/common/kernelPrototype.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicMutex.h ../../lib/App/common/kernelModuleEmbedVideo.h ../../lib/App/common/MySQL_dataBinder.h ../../lib/App/common/SQLite_dataBinder.h $(OUTDIR)/mojoRemoteClient.o: ../../lib/App/mojo/mojoRemoteClient.cpp ../../lib/App/mojo/mojoRemoteClient.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/data/net/clientPort.h ../../lib/data/transport/transportSocket.h ../../lib/components/base/basicDualThread.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicTransport.h ../../lib/data/protocol/protocol.h ../../lib/data/protocol/protocolARGUS_DATA.h ../../lib/App/common/dataBinder.h ../../lib/App/common/dataBinder_structures.h ../../lib/App/common/dataBinder_ReportAux.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/Transform.h ../../lib/App/mojo/mojoKernel.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicSettingsProvider.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicEventHeap.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/Transform.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/Transform.h ../../lib/alg/lgs/detectorStructures.h ../../lib/components/base/basicTypes.h ../../lib/alg/lgs/detector.h ../../lib/components/base/basicObject.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicValidatable.h ../../lib/alg/lgs/detectorStructures.h ../../lib/components/base/basicTypes.h ../../lib/alg/lgs/mask.h ../../lib/components/base/basicTypes.h ../../lib/hardware/soc/general/3DLRF.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/gui/gui.h ../../lib/alg/generic/md5.h ../../lib/App/common/kernelPrototype.h ../../lib/App/mojo/mojoRemoteClient.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/data/net/clientPort.h ../../lib/data/transport/transportSocket.h ../../lib/components/base/basicDualThread.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicTransport.h ../../lib/data/protocol/protocol.h ../../lib/data/protocol/protocolARGUS_DATA.h ../../lib/App/common/dataBinder.h ../../lib/App/common/dataBinder_structures.h ../../lib/App/common/dataBinder_ReportAux.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/Transform.h ../../lib/App/common/deviceNodeCamera.h ../../lib/App/common/deviceNodeSensor.h ../../lib/App/common/deviceNodeFactory.h $(OUTDIR)/mysql_class.o: ../../lib/data/mysql/mysql_class.cpp ../../lib/data/mysql/mysql_class.h $(OUTDIR)/MySQL_dataBinder.o: ../../lib/App/common/MySQL_dataBinder.cpp ../../lib/App/common/MySQL_dataBinder.h @@ -916,7 +916,7 @@ $(OUTDIR)/protocolPTZ_VISCA.o: ../../lib/data/protocol/protocolPTZ_VISCA.cpp ../ $(OUTDIR)/serverPort.o: ../../lib/data/net/serverPort.cpp ../../lib/data/net/serverPort.h ../../lib/data/transport/transportSocket.h ../../lib/components/base/basicDualThread.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicTransport.h $(OUTDIR)/sqlite_class.o: ../../lib/data/sqlite/sqlite_class.cpp ../../lib/data/sqlite/sqlite_class.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicFunctionality.h ../../lib/components/base/basicBuildTimeStamp.h ../../lib/components/base/basicTypes.h $(OUTDIR)/SQLite_dataBinder.o: ../../lib/App/common/SQLite_dataBinder.cpp ../../lib/App/common/SQLite_dataBinder.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/Transform.h -$(OUTDIR)/targetPipeLine.o: ../../lib/App/common/targetPipeLine.cpp ../../lib/App/common/targetPipeLine.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h +$(OUTDIR)/targetPipeLine.o: ../../lib/App/common/targetPipeLine.cpp ../../lib/App/common/targetPipeLine.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/Transform.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/App/common/dataBinder.h ../../lib/App/common/dataBinder_structures.h ../../lib/App/common/dataBinder_ReportAux.h ../../lib/components/base/basicEvent.h ../../lib/components/base/basicTypes.h ../../lib/components/base/basicPosition.h ../../lib/alg/generic/Transform.h ../../lib/App/common/kernelEventFilter.h ../../lib/App/common/kernelPrototype.h ../../lib/App/common/MySQL_dataBinder.h ../../lib/App/common/SQLite_dataBinder.h $(OUTDIR)/Transform.o: ../../lib/alg/generic/Transform.cpp ../../lib/alg/generic/Transform.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h $(OUTDIR)/transportSocket.o: ../../lib/data/transport/transportSocket.cpp ../../lib/data/transport/transportSocket.h ../../lib/components/base/basicDualThread.h ../../lib/components/base/basicThread.h ../../lib/components/base/basicLogCollection.h ../../lib/components/base/basicLoggingService.h ../../lib/components/base/basicRing.h ../../lib/components/base/basicMutex.h ../../lib/components/base/basicTransport.h ../../lib/data/protocol/protocol.h $(OUTDIR)/utm.o: ../../lib/alg/generic/utm.cpp ../../lib/alg/generic/utm.h diff --git a/lib/App/common/SQLite_dataBinder.cpp b/lib/App/common/SQLite_dataBinder.cpp index 1452616a..337ba6c7 100644 --- a/lib/App/common/SQLite_dataBinder.cpp +++ b/lib/App/common/SQLite_dataBinder.cpp @@ -860,7 +860,10 @@ uint32_t sqliteDBC::addEvent( DBC_EVT_RECORD *ptr ){ case EVT_FLT_LATF_DISABLED: case EVT_FLT_LATF_SUSP_DET: case EVT_FLT_LATF_DIFF_DET: - case EVT_FLT_BUBBLE_POPED:{ + case EVT_FLT_BUBBLE_POPED: + case EVT_FLT_BUBBLE_CREATED: + case EVT_FLT_BUBBLE_BLOCK_T: + case EVT_FLT_BUBBLE_BLOCK_P:{ updateStats(); sprintf( tQBuf, "INSERT INTO `events`(`node_id`,`uuid`,`ts`,`ts_ms`,`evt_type`,`lrf_id`,`range_digital`,`azimuth`,`range`,`area`,`lat`,`lon`,`alt`)" \ " VALUES(%d,'%s',%d,%d,%d,%d,%d,%0.2f,%0.2f,%0.2f,%0.7f,%0.7f,%0.2f)", @@ -2792,13 +2795,13 @@ uint32_t sqliteDBC::getNetworkInfrastructureID( uint32_t nif_id ){ return tVal; }; -TARGET_SEGMENT *sqliteDBC::getRegisteredBubble( uint32_t ID, uint8_t Blocking_Count ){ +TARGET_SEGMENT *sqliteDBC::getRegisteredBubble( uint32_t ID ){ TARGET_SEGMENT *tVal = NULL; - if( m_bStaIsCreated ){ + if( m_bStoIsConnected ){ char tQBuf[CTEXT]; AAssoc *result; sprintf(tQBuf, "SELECT * FROM `target_bubbles` WHERE `id`=%d", ID ); -#ifdef DEBUG_ALL +#ifdef DEBUG LOG(tQBuf); #endif result = m_pDataStorage->Query( tQBuf ); @@ -2827,6 +2830,10 @@ TARGET_SEGMENT *sqliteDBC::getRegisteredBubble( uint32_t ID, uint8_t Blocking_Co if( it != cArr->end() ){ tVal->boundary = atof(it->second.c_str()); }; + it = cArr->find("BLOCK_COUNS"); + if( it != cArr->end() ){ + tVal->hit_count = atoi(it->second.c_str()); + }; }; }; }; @@ -3787,12 +3794,16 @@ DBC_INT_LIST *sqliteDBC::listPhonebook( ){ return tVal; }; -DBC_INT_LIST *sqliteDBC::listRegisteredBubbles(){ +DBC_INT_LIST *sqliteDBC::listFrozenBubbles( uint8_t cc ){ DBC_INT_LIST * tVal = NULL; if( m_bStoIsConnected ){ char tQBuf[CTEXT]; AAssoc *result; - sprintf(tQBuf, "SELECT `id` FROM `target_bubbles`" ); + if ( cc ) { + sprintf(tQBuf, "SELECT `id` FROM `target_bubbles` WHERE `BLOCK_COUNS`>%d", cc); + } else { + sprintf(tQBuf, "SELECT `id` FROM `target_bubbles` WHERE `BLOCKED`=1"); + } #ifdef DEBUG_ALL LOG(tQBuf); #endif @@ -4256,7 +4267,7 @@ BUBBLE_FILTER_DATA *sqliteDBC::getBubbleFilterData( uint32_t id ){ if( it != cArr->end() ){ tVal->min_block_counts = atoi( it->second.c_str() ); }; -#ifdef BUBBLE_TIME_BUCKLE +#ifdef BUBBLE_TIME_BUCKET it = cArr->find("BUCKET_TIME"); if( it != cArr->end() ){ tVal->bucket_time = atoi( it->second.c_str() ); @@ -4283,7 +4294,7 @@ BUBBLE_FILTER_DATA *sqliteDBC::getBubbleFilterData( uint32_t id ){ tVal->enable_evt = (bool) atoi( it->second.c_str() ); }; }; -#ifdef BUBBLE_TIME_BUCKLE +#ifdef BUBBLE_TIME_BUCKET if ( tVal->bucket_time < BUBBLE_FILTER_MIN_BUCKET_TIME ) tVal->bucket_time = BUBBLE_FILTER_MIN_BUCKET_TIME; #endif }; @@ -4910,38 +4921,76 @@ bool sqliteDBC::updateLRFVerison( uint32_t lrfID, CSTR version ){ }; return false; }; -bool sqliteDBC::updateRegisteredBubble( TARGET_SEGMENT *ptr ){ - if ( ptr == NULL ) return false; + +uint32_t sqliteDBC::getRegisteredBubbleId( float X, float Y, float Z ){ + uint32_t RetVal = 0; + if (m_bStoIsConnected) { + char tQBuf[MAX_PATH_LEN]; + sprintf(tQBuf, "SELECT `id` FROM `target_bubbles` WHERE ( ABS(`CENTER_X`-(%0.3f)) < `BOUNDARY` ) AND " + "( ABS(`CENTER_Y`-(%0.3f)) < `BOUNDARY` ) AND " + "( ABS(`CENTER_Z`-(%0.3f)) < `BOUNDARY` ) LIMIT 1", + X, + Y, + Z ); +#ifdef DEBUG + LOG(tQBuf); +#endif + AAssoc *result = m_pDataStorage->Query( tQBuf ); + if( result!= NULL ) { + if( result->size() > 0 ) { + Assoc *cArr; + Assoc::iterator it; + cArr = result->at(0); + it = cArr->find("id"); + if( it != cArr->end() ){ + RetVal = atoi( it->second.c_str() ); + }; + }; + }; + deleteResult( result ); + }; + return RetVal; +}; + +uint8_t sqliteDBC::updateRegisteredBubble( TARGET_SEGMENT *ptr ){ + uint8_t RetVal = 0; + if ( ptr == NULL ) return RetVal; if (m_bStoIsConnected) { char tQBuf[MAX_PATH_LEN]; - if( ptr->db_id > 0 ) { + uint32_t tID = getRegisteredBubbleId( ptr->system_center.x, ptr->system_center.y, ptr->system_center.z ); + if( tID ) { // Old record exists - sprintf(tQBuf, "UPDATE `target_bubbles` SET `CENTER_X`=%0.3f, `CENTER_Y`=%0.3f, `CENTER_Z`=%0.3f, `BOUNDARY`=%0.3f, `BLOCK_COUNS`=`BLOCK_COUNS`+1 WHERE `id`=%d", + sprintf(tQBuf, "UPDATE `target_bubbles` SET `CENTER_X`=%0.3f, `CENTER_Y`=%0.3f, `CENTER_Z`=%0.3f, `BOUNDARY`=%0.3f, `BLOCK_COUNS`=`BLOCK_COUNS`+1 WHERE `id`=%d RETURNING `BLOCK_COUNS`", ptr->system_center.x, ptr->system_center.y, ptr->system_center.z, ptr->boundary, - ptr->db_id ); + tID ); + AAssoc *result = m_pDataStorage->Query( tQBuf ); + if( result!= NULL ) { + if( result->size() > 0 ) { + Assoc *cArr; + Assoc::iterator it; + cArr = result->at(0); + it = cArr->find("BLOCK_COUNS"); + if( it != cArr->end() ){ + RetVal = atoi( it->second.c_str() ); + }; + }; + }; + deleteResult( result ); } else { //Create New Record for Bubble - sprintf(tQBuf, "INSERT INTO `target_bubbles` SET `CENTER_X`=%0.3f, `CENTER_Y`=%0.3f, `CENTER_Z`=%0.3f, `BOUNDARY`=%0.3f, `TTL`=%d, `BLOCK_COUNS`=1", + sprintf(tQBuf, "INSERT INTO `target_bubbles`(`CENTER_X`,`CENTER_Y`,`CENTER_Z`,`BOUNDARY`,`BLOCK_COUNS`) VALUES(%0.3f,%0.3f,%0.3f,%0.3f,1)", ptr->system_center.x, ptr->system_center.y, ptr->system_center.z, ptr->boundary ); - }; -#ifdef DEBUG_ALL - LOG(tQBuf); -#endif - if ( ptr->db_id ) { m_pDataStorage->SilentQuery( tQBuf ); - } else { - ptr->db_id = m_pDataStorage->QueryID( tQBuf ); }; - return true; }; - return false; + return RetVal; }; bool sqliteDBC::updateServerIdentity( uint32_t m_nServerID, CSTR m_sIdentity ){ if( m_bStoIsConnected ) { diff --git a/lib/App/common/SQLite_dataBinder.h b/lib/App/common/SQLite_dataBinder.h index 22b10c48..9c4a467e 100644 --- a/lib/App/common/SQLite_dataBinder.h +++ b/lib/App/common/SQLite_dataBinder.h @@ -136,14 +136,14 @@ class sqliteDBC: public dataBinder { virtual DBC_NET_IF_DATA * getNIF_Data( uint32_t ID ); virtual uint32_t getNIF_ID( CSTR key ); virtual uint32_t getNIF_IDbyDevice( CSTR device ); - virtual uint32_t getWiFi_ID( uint32_t nif_id ); virtual uint32_t getNetworkInfrastructureID( uint32_t nif_id ); virtual uint32_t getNodeAuxParam( uint32_t NodeID ); virtual DBC_NODE_DATA * getNodeData( uint32_t ID ); virtual uint32_t getNodeIdByTypeAndAux( uint8_t type, uint32_t aux_id ); virtual CSTR getNodeName( uint32_t NodeID ); virtual DBC_PUSHED_CMD * getNodePushedCMD( uint32_t NodeID ); - virtual TARGET_SEGMENT * getRegisteredBubble( uint32_t ID, uint8_t cc ); + virtual TARGET_SEGMENT * getRegisteredBubble( uint32_t ID ); + virtual uint32_t getRegisteredBubbleId( float X, float Y, float Z ); virtual REPORT_DIRINFO * getReportDirInfo( uint32_t id ); virtual DBC_RESOURCE_DATA * getResourceData( uint32_t ResourceID ); virtual uint32_t getResourceID( uint32_t NodeID, uint8_t type, uint32_t auxID ); @@ -154,6 +154,7 @@ class sqliteDBC: public dataBinder { virtual TRAIN_FILTER_DATA * getTrainFilterData( uint32_t ID ); virtual DBC_UART_DATA * getUartData( uint32_t UartID ); virtual uint32_t getUartID( uint32_t NodeID, uint8_t Type, CSTR path ); + virtual uint32_t getWiFi_ID( uint32_t nif_id ); virtual DBC_INT_LIST * listCameras(); virtual DBC_INT_LIST * listCamPresets( uint32_t SETID ); virtual DBC_INT_LIST * listFilters( uint32_t ServerID ); @@ -168,7 +169,7 @@ class sqliteDBC: public dataBinder { virtual DBC_INT_LIST * listOlderReportStat( CSTR Y, CSTR M, CSTR D ); virtual DBC_INT_LIST * listOlderReportStat( uint32_t TS ); virtual DBC_INT_LIST * listPhonebook( ); - virtual DBC_INT_LIST * listRegisteredBubbles(); + virtual DBC_INT_LIST * listFrozenBubbles( uint8_t cc = 0 ); virtual DBC_INT_LIST * listResources( uint32_t NodeID = 0 ); virtual bool pushMemCMD( uint32_t NODE_ID, uint8_t CMD, CSTR DATA ); virtual void registerServer( uint32_t SiteID, CSTR identity, int PID, uint32_t *ServID, uint32_t *ServNode ); @@ -203,7 +204,7 @@ class sqliteDBC: public dataBinder { virtual bool updateModemManagerActivePhoneBookID( uint32_t MMID, uint32_t pbID ); virtual bool updateModemManagerActiveSMS( uint32_t MMID, int32_t smsID ); virtual bool updateNodePushedCMD( uint32_t CmdID, uint8_t status ); - virtual bool updateRegisteredBubble( TARGET_SEGMENT *ptr ); + virtual uint8_t updateRegisteredBubble( TARGET_SEGMENT *ptr ); virtual bool updateServerIdentity( uint32_t m_nServerID, CSTR m_sIdentity ); virtual bool updateServerUtilisation( DBC_SYS_LOAD_INFO *ptr ); virtual bool updateSystemInfo( DBC_SYS_INFO *ptr ); diff --git a/lib/App/common/dataBinder.h b/lib/App/common/dataBinder.h index 0b9a16cc..41b21950 100644 --- a/lib/App/common/dataBinder.h +++ b/lib/App/common/dataBinder.h @@ -80,7 +80,7 @@ class dataBinder{ virtual DBC_INT_LIST * listNodes( bool all = false ){ return NULL;}; //virtual DBC_INT_LIST * listSockets( uint32_t NodeID ){ return NULL;}; virtual DBC_INT_LIST * listPhonebook( ){ return NULL;}; - virtual DBC_INT_LIST * listRegisteredBubbles(){ return NULL;}; + virtual DBC_INT_LIST * listFrozenBubbles( uint8_t cc = 0 ){ return NULL;}; virtual DBC_INT_LIST * listResources( uint32_t NodeID = 0 ){ return NULL;}; virtual DBC_INT_LIST * listNodeFilters( uint32_t NodeID = 0 ){ return NULL;}; virtual DBC_INT_LIST * listOlderReportStat( CSTR Y, CSTR M, CSTR D ){ return NULL;}; @@ -147,8 +147,9 @@ class dataBinder{ virtual DBC_PUSHED_CMD * getActivePushedCMD( uint32_t NodeID ){ return NULL;}; - virtual DBC_PUSHED_CMD * getPushedCMD( uint32_t CmdID ){ return NULL;}; - virtual TARGET_SEGMENT * getRegisteredBubble( uint32_t ID, uint8_t cc ){ return NULL;}; + virtual DBC_PUSHED_CMD * getPushedCMD( uint32_t CmdID ){ return NULL;}; + virtual TARGET_SEGMENT * getRegisteredBubble( uint32_t ID ){ return NULL;}; + virtual uint32_t getRegisteredBubbleId( float X, float Y, float Z ){ return 0;}; //virtual uint32_t getNodeSocketID( uint32_t NodeID, uint32_t auxID, uint8_t SocketType, CSTR path ); virtual REPORT_DIRINFO * getReportDirInfo( uint32_t id ){ return NULL;}; virtual DBC_RESOURCE_DATA * getResourceData( uint32_t ResourceID ){ return NULL;}; @@ -223,7 +224,7 @@ class dataBinder{ virtual bool updateMediaServerStream( uint32_t id, CSTR mrl=NULL, CSTR key = NULL ){ return false;}; virtual bool updateNetworkNode( bool OnlineStatus ){ return false;}; virtual bool updateNodePushedCMD( uint32_t CmdID, uint8_t status ){ return false;}; - virtual bool updateRegisteredBubble( TARGET_SEGMENT *ptr ){ return false;}; + virtual uint8_t updateRegisteredBubble( TARGET_SEGMENT *ptr ){ return false;}; virtual bool updateResourceAUX( uint32_t ResID, uint32_t AUX ){ return false;}; virtual bool updateServerIdentity( uint32_t m_nServerID, CSTR m_sIdentity ){ return false;}; virtual bool updateServerUtilisation( DBC_SYS_LOAD_INFO *ptr ){ return false;}; diff --git a/lib/App/common/dataBinder_structures.h b/lib/App/common/dataBinder_structures.h index c34518b5..74c07907 100644 --- a/lib/App/common/dataBinder_structures.h +++ b/lib/App/common/dataBinder_structures.h @@ -393,6 +393,10 @@ typedef struct S_DBC_RESOURCE_DATA{ #define CMD_PTZ_MOVE 43 #define CMD_HARDWARE_DETECT 27 +#define CMD_FORCE_FREEZE_BUBBLES 210 +#define CMD_FORCE_POP_BUBBLE 211 +#define CMD_FORCE_RELOAD_BUBBLES 212 + #define CMD_STATUS_NEW 0 #define CMD_STATUS_ACTIVE 1 #define CMD_STATUS_FINISHED 2 diff --git a/lib/App/common/deviceNode2D.cpp b/lib/App/common/deviceNode2D.cpp index 2fc1a649..03bc9544 100644 --- a/lib/App/common/deviceNode2D.cpp +++ b/lib/App/common/deviceNode2D.cpp @@ -38,7 +38,9 @@ device2DSensor::device2DSensor( uint32_t id ):deviceNodeSensor( id ), protocolLG memset( m_vDrawRanges, 0, sizeof( m_vDrawRanges )); memset( &m_sShadowHelper, 0 , sizeof(SHADOW_IO_HELPER)); memset( &m_sShadow, 0 , sizeof(SHADOW)); - +#ifdef PERSISTED_TARGET_SIM + m_nTargSimAngle = m_nTargSimRange = 0; +#endif cleanupDeviceStructures(); if( m_sLRF_DATA.uart_id ) { @@ -184,7 +186,9 @@ bool device2DSensor::validate(){ setWM( LRF_WM_IDLE ); }; } else m_bTargetArived = false; - //simulateTarget(); +#ifdef SIMULATE_2D_TARGETS + simulateTarget(); +#endif // Check Settings if( !deviceNodeSensor::validate() ) return false; return true; @@ -3397,10 +3401,23 @@ TARGET_DATA *device2DSensor::prepareTargetData( uint16_t AZ, uint16_t RANGE, uin void device2DSensor::simulateTarget( void ){ uint16_t AZ, RANGE; uint32_t WIDTH; +#ifdef PERSISTED_TARGET_SIM + if ( m_nTargSimAngle == 0 ) { + m_nTargSimAngle = uint16_t( rand() * (6000.0f / (float)RAND_MAX)); + m_nTargSimRange = uint16_t ( rand() * ( 2048.0f /(float) RAND_MAX )); + }; + AZ = m_nTargSimAngle + uint16_t( rand() * (5.0f / (float)RAND_MAX) ); + RANGE = m_nTargSimRange + uint16_t( rand() * ( 5.0f /(float) RAND_MAX )); +#else AZ = uint16_t ( rand() * ( 6000.0f /(float) RAND_MAX )); RANGE = uint16_t ( rand() * ( 2048.0f /(float) RAND_MAX )); +#endif WIDTH = 4000; -#ifndef SKIP_REAL_TARGETS +#ifndef SKIP_REAL_TARGETS + //Triggering Session in Kernel + kernelPrototype *AK = kernelPrototype::getInstance(); + if ( AK ) AK->startSession(); + TARGET_DATA * tData = prepareTargetData( AZ, RANGE, WIDTH ); if( tData != NULL ){ diff --git a/lib/App/common/deviceNode2D.h b/lib/App/common/deviceNode2D.h index 060029bd..0db890ef 100644 --- a/lib/App/common/deviceNode2D.h +++ b/lib/App/common/deviceNode2D.h @@ -19,6 +19,9 @@ //#define SIMULATE_2D_TARGETS +#ifdef SIMULATE_2D_TARGETS + #define PERSISTED_TARGET_SIM +#endif //To Save rasterized masks #ifdef DEBUG #include @@ -155,6 +158,10 @@ class device2DSensor: public deviceNodeSensor, public protocolLGS_2D{ FS_DATA_EX m_sInFSData; FS_DATA_EX m_sOutFSData; */ + #ifdef PERSISTED_TARGET_SIM + uint16_t m_nTargSimAngle; + uint16_t m_nTargSimRange; + #endif WORKING_STATE_LRF2D m_eWState; diff --git a/lib/App/common/imageParser.cpp b/lib/App/common/imageParser.cpp new file mode 100644 index 00000000..120374ce --- /dev/null +++ b/lib/App/common/imageParser.cpp @@ -0,0 +1,7 @@ +#include "imageParser.h" +imageParser::imageParser(){ + m_pActiveJob = NULL; + m_bDataIsActive = false; + m_pEvtHeap = basicEventHeap::getInstance(); + m_pLog = basicLogCollection::getInstance(); +}; diff --git a/lib/App/common/imageParser.h b/lib/App/common/imageParser.h new file mode 100644 index 00000000..53b237a7 --- /dev/null +++ b/lib/App/common/imageParser.h @@ -0,0 +1,22 @@ +#ifndef __IMAGE_PARSER_HEADER__ +#define __IMAGE_PARSER_HEADER__ + +#include "imageParserDataStructs.h" +#include "../../components/base/basicEventHeap.h" + +class imageParser{ + protected: + cv::Mat m_oWorkingMat; + bool m_bDataIsActive; + IM_JOB * m_pActiveJob; + basicEventHeap * m_pEvtHeap; + basicLogCollection * m_pLog; + IM_RESULT * m_fImageAnalyzer( cv::Mat &Picture ); + public: + imageParser(); + virtual ~imageParser(){}; + virtual bool create( void ){ return false; }; + virtual bool enqueueJob( IM_JOB *ptr ){ return false; }; +}; + +#endif \ No newline at end of file diff --git a/Projects/img_mill/IM_DataStructs.cpp b/lib/App/common/imageParserDataStructs.cpp similarity index 93% rename from Projects/img_mill/IM_DataStructs.cpp rename to lib/App/common/imageParserDataStructs.cpp index 2cd4eb8c..6608aeec 100644 --- a/Projects/img_mill/IM_DataStructs.cpp +++ b/lib/App/common/imageParserDataStructs.cpp @@ -1,4 +1,4 @@ -#include "IM_DataStructs.h" +#include "imageParserDataStructs.h" CSTR buildMd5Path( CSTR base, CSTR md5, mode_t mode, CSTR user, CSTR group ){ char tPath[1024]; diff --git a/Projects/img_mill/IM_DataStructs.h b/lib/App/common/imageParserDataStructs.h similarity index 91% rename from Projects/img_mill/IM_DataStructs.h rename to lib/App/common/imageParserDataStructs.h index 2538579d..b90bd903 100644 --- a/Projects/img_mill/IM_DataStructs.h +++ b/lib/App/common/imageParserDataStructs.h @@ -1,8 +1,13 @@ #ifndef __IMAGE_MILL_DATA_STRUCTURES_HEADER__ #define __IMAGE_MILL_DATA_STRUCTURES_HEADER__ -#include "../../lib/components/base/basicFunctionality.h" #include +#include +#include + +using namespace cv; + +#include "../../lib/components/base/basicFunctionality.h" typedef struct S_IM_ITEM_DATA{ uint32_t item_id; diff --git a/lib/App/common/kernelEventFilterBubble.cpp b/lib/App/common/kernelEventFilterBubble.cpp index 60ff1237..7493c3f1 100644 --- a/lib/App/common/kernelEventFilterBubble.cpp +++ b/lib/App/common/kernelEventFilterBubble.cpp @@ -21,6 +21,7 @@ kernelEventFilterBubble::kernelEventFilterBubble( uint32_t id ):kernelEventFilte kernelEventFilterBubble::~kernelEventFilterBubble(){ stopFilter(); if ( m_vTargetBubbles.size() ) { + popSessionBubbles(); for (V_TARGET_SEGMENTS::iterator idx = m_vTargetBubbles.begin(); idx != m_vTargetBubbles.end(); idx++) free(*idx); m_vTargetBubbles.clear(); }; @@ -33,26 +34,51 @@ bool kernelEventFilterBubble::createBubble( TARGET_DATA *ptr ){ if ( tData ) { memset( tData, 0, sizeof(TARGET_SEGMENT) ); tData->segment_id = serial++; - ptr->segment_id = tData->segment_id; + ptr->segment_id = tData->segment_id & 0xFF; tData->boundary = m_sBubbleFilterData.beginning_range; tData->system_center.x = ptr->system_target.x; tData->system_center.y = ptr->system_target.y; tData->system_center.z = ptr->system_target.z; //Only In Case of Disabling //tData->id = m_pDBC->addRegisteredBubble( tData ); - if( createBubble( tData ) ) return true; + if( createBubble( tData, true ) ) return true; free( tData ); }; return false; }; -bool kernelEventFilterBubble::createBubble( TARGET_SEGMENT *ptr ){ - if ( ptr == NULL ) return false; - ptr->bts = getMilliseconds(); - ptr->ttl = ptr->bts + m_sBubbleFilterData.ttl; - m_mDataProtector.lock(); +bool kernelEventFilterBubble::createBubble( TARGET_SEGMENT *ptr, bool locking ){ + if ( ptr == NULL ) return false; + if( ptr->hit_count >= m_sBubbleFilterData.min_block_counts ){ + ptr->mode = TS_MODE_PERMANENT; + } else { + ptr->bts = getMilliseconds(); + ptr->ttl = ptr->bts + m_sBubbleFilterData.ttl; + }; + if( locking ) m_mDataProtector.lock(); m_vTargetBubbles.push_back( ptr ); - m_mDataProtector.unlock(); + if( locking ) m_mDataProtector.unlock(); + + if ( m_sBubbleFilterData.enable_evt && ( ptr->mode == 0 ) ) { + //Triggering Session in Kernel + kernelPrototype *AK = kernelPrototype::getInstance(); + if ( AK ) AK->startSession(); + + TARGET_DATA *tData = (TARGET_DATA *)malloc(sizeof(TARGET_DATA)); + if ( tData ) { + memset( tData, 0, sizeof(TARGET_DATA) ); + tData->area = ptr->boundary * 100; + tData->lrf_id = ptr->segment_id & 0xFF; + decart2spherical( ptr->system_center, tData->local_target ); + tData->digital = 0; + tData->system_target.x = ptr->system_center.x; + tData->system_target.y = ptr->system_center.y; + tData->system_target.z = ptr->system_center.z; + tData->segment_id = ptr->segment_id; + createFilterEvent( EVT_FLT_BUBBLE_CREATED, tData ); + free( tData ); + }; + }; return true; }; @@ -84,13 +110,17 @@ bool kernelEventFilterBubble::initFilter(){ LOG_ERROR("Cannot Fetch Filter Data from DB!"); return false; }; - DBC_INT_LIST *tList = m_pDBC->listRegisteredBubbles(); + DBC_INT_LIST *tList = m_pDBC->listFrozenBubbles( m_sBubbleFilterData.min_block_counts ); if ( tList ) { + LOG("Have List of Bubbles"); if ( tList->size() ) { + LOG("Have items in List of Bubbles"); for ( DBC_INT_LIST::iterator idx = tList->begin(); idx != tList->end(); idx++ ) { - TARGET_SEGMENT *tBubble = m_pDBC->getRegisteredBubble( *idx, m_sBubbleFilterData.min_block_counts ); + LOG("Creating Frozen Bubble"); + TARGET_SEGMENT *tBubble = m_pDBC->getRegisteredBubble( *idx ); if ( tBubble ) { - if ( !createBubble( tBubble ) ) free( tBubble ); + LOG("Adding Frozen Bubble"); + if ( !createBubble( tBubble, false ) ) free( tBubble ); }; }; }; @@ -118,7 +148,8 @@ void kernelEventFilterBubble::m_fThreadProc( void ){ if ( tData ) { memset( tData, 0, sizeof(TARGET_DATA) ); decart2spherical( (*idx)->system_center, tData->local_target ); - tData->area = (*idx)->ttl - (*idx)->bts; + tData->area = (*idx)->boundary * 100; + tData->lrf_id = (*idx)->segment_id & 0xFF; tData->digital = 0; tData->system_target.x = (*idx)->system_center.x; tData->system_target.y = (*idx)->system_center.y; @@ -163,12 +194,11 @@ bool kernelEventFilterBubble::updateBubble( TARGET_SEGMENT *bubble, TARGET_DATA if ( target == NULL ) return false; uint64_t cts = getMilliseconds(); bubble->ttl = cts + m_sBubbleFilterData.ttl; - //Only Active Bubles if( bubble->mode < TS_MODE_PERMANENT ){ - if ( !bubble->mode < TS_MODE_PUNCHED ) { + if ( bubble->mode < TS_MODE_PUNCHED ) { #ifdef BUBBLE_TIME_BUCKET - uint8_t bucket_id = ( cts - bubble->bts ) / m_sBubbleFilterData.bucket_time; + uint8_t bucket_id = (uint8_t) (( cts - bubble->bts ) / m_sBubbleFilterData.bucket_time ) & 0x1F ; if( bucket_id < 32 ){ bubble->hit_map |= (1 << bucket_id) & 0xFFFFFFFF; @@ -183,7 +213,10 @@ bool kernelEventFilterBubble::updateBubble( TARGET_SEGMENT *bubble, TARGET_DATA bubble->boundary = m_sBubbleFilterData.maximal_range; }; } else { - // gen signal to Kernel to continue session on blocked target + // Generate signal to Kernel to continue session on TS_MODE_BLOCKED target + // Triggering Session in Kernel + kernelPrototype *AK = kernelPrototype::getInstance(); + if ( AK ) AK->startSession(); }; switch ( m_sBubbleFilterData.method ) { @@ -226,7 +259,13 @@ bool kernelEventFilterBubble::updateBubble( TARGET_SEGMENT *bubble, TARGET_DATA bool kernelEventFilterBubble::blockCurrentActiveBubbles(){ m_mDataProtector.lock(); for( V_TARGET_SEGMENTS::iterator idx = m_vTargetBubbles.begin(); idx != m_vTargetBubbles.end(); idx++ ) { - if( (*idx)->mode == TS_MODE_PUNCHED ) (*idx)->mode = TS_MODE_BLOCKED; + if( (*idx)->mode == TS_MODE_PUNCHED ){ + if( m_pDBC->updateRegisteredBubble((*idx)) < m_sBubbleFilterData.min_block_counts ){ + (*idx)->mode = TS_MODE_BLOCKED; + } else { + (*idx)->mode = TS_MODE_PERMANENT; + }; + }; }; m_mDataProtector.unlock(); }; @@ -246,11 +285,6 @@ bool kernelEventFilterBubble::validateTarget( uint32_t DevID, TARGET_DATA *ptr ) TARGET_SEGMENT *cBubble = NULL; if( m_bActive && ( ptr != NULL ) ){ m_mDataProtector.lock(); -#ifdef DEBUG_EXTRA - char tB[129]; - sprintf( tB, "In Mem %d Bubbles", m_vTargetBubbles.size() ); - LOG( tB ); -#endif if ( m_vTargetBubbles.size() ) { for( V_TARGET_SEGMENTS::iterator idx = m_vTargetBubbles.begin(); idx != m_vTargetBubbles.end(); idx++ ){ if ( checkBubble ( *idx, ptr ) ) { @@ -264,6 +298,7 @@ bool kernelEventFilterBubble::validateTarget( uint32_t DevID, TARGET_DATA *ptr ) if ( cBubble != NULL ) { if( cBubble->mode == TS_MODE_PUNCHED ) { ptr->segment_id = cBubble->segment_id; + ptr->lrf_id = cBubble->segment_id & 0xFF; if ( m_sBubbleFilterData.propogate == 1 ) { ptr->system_target.x = cBubble->system_center.x; ptr->system_target.y = cBubble->system_center.y; @@ -275,6 +310,18 @@ bool kernelEventFilterBubble::validateTarget( uint32_t DevID, TARGET_DATA *ptr ) ptr->global_target.alt = ptr->system_target.z; }; } else { + if ( m_sBubbleFilterData.enable_evt && cBubble->mode > TS_MODE_PUNCHED ) { + //Create blocking events + kernelPrototype *AK = kernelPrototype::getInstance(); + if ( AK ) AK->startSession(); + ptr->lrf_id = cBubble->segment_id & 0xFF; + ptr->segment_id = cBubble->segment_id; + if ( cBubble->mode == TS_MODE_BLOCKED ) { + createFilterEvent(EVT_FLT_BUBBLE_BLOCK_T, ptr ); + } else { + createFilterEvent(EVT_FLT_BUBBLE_BLOCK_P, ptr ); + }; + }; RetValue = true; }; } else { @@ -289,13 +336,27 @@ bool kernelEventFilterBubble::popSessionBubbles(){ if ( m_vTargetBubbles.size() ) { for( V_TARGET_SEGMENTS::iterator idx = m_vTargetBubbles.begin(); idx != m_vTargetBubbles.end(); ){ if( (*idx)->mode == TS_MODE_BLOCKED ) { - m_pDBC->updateRegisteredBubble((*idx)); + free(*idx); m_vTargetBubbles.erase(idx); } else { idx++; }; }; }; + /* + DBC_INT_LIST *tList = m_pDBC->listFrozenBubbles( m_sBubbleFilterData.min_block_counts ); + if ( tList ) { + if ( tList->size() ) { + for ( DBC_INT_LIST::iterator idx = tList->begin(); idx != tList->end(); idx++ ) { + TARGET_SEGMENT *tBubble = m_pDBC->getRegisteredBubble( *idx ); + if ( tBubble ) { + if ( !createBubble( tBubble, false ) ) free( tBubble ); + }; + }; + }; + delete( tList ); + }; + */ m_mDataProtector.unlock(); return true; }; @@ -308,6 +369,31 @@ bool kernelEventFilterBubble::dispatchEvent( EVENT_CONTAINER *Evt ){ switch (Evt->m_eType) { case EVT_LRF_END_SESSION_TO: case EVT_LRF_END_SESSION_MA: popSessionBubbles(); break; + case EVT_FLT_BUBBLES_BLOCK: blockCurrentActiveBubbles(); break; + case EVT_FLT_BUBBLES_RELOAD:{ + m_mDataProtector.lock(); + if ( m_vTargetBubbles.size() ) { + for (V_TARGET_SEGMENTS::iterator idx = m_vTargetBubbles.begin(); idx != m_vTargetBubbles.end(); ) + if( (*idx)->mode > TS_MODE_BLOCKED ){ + free(*idx); + m_vTargetBubbles.erase(idx); + } else idx++; + }; + DBC_INT_LIST *tList = m_pDBC->listFrozenBubbles( m_sBubbleFilterData.min_block_counts ); + if ( tList ) { + if ( tList->size() ) { + for ( DBC_INT_LIST::iterator idx = tList->begin(); idx != tList->end(); idx++ ) { + TARGET_SEGMENT *tBubble = m_pDBC->getRegisteredBubble( *idx ); + if ( tBubble ) { + if ( !createBubble( tBubble, false ) ) free( tBubble ); + }; + }; + }; + delete( tList ); + }; + m_mDataProtector.unlock(); + break; + }; }; break; }; diff --git a/lib/App/common/kernelEventFilterBubble.h b/lib/App/common/kernelEventFilterBubble.h index 3f6f68cd..bda7dd2e 100644 --- a/lib/App/common/kernelEventFilterBubble.h +++ b/lib/App/common/kernelEventFilterBubble.h @@ -24,7 +24,7 @@ class kernelEventFilterBubble: public kernelEventFilter, public basicEventHandle basicMutex m_mDataProtector; V_TARGET_SEGMENTS m_vTargetBubbles; bool createBubble( TARGET_DATA *ptr ); // From Target First Time - bool createBubble( TARGET_SEGMENT *data ); // From Loaded Data + bool createBubble( TARGET_SEGMENT *data, bool locking ); // From Loaded Data bool checkBubble( TARGET_SEGMENT *bubble, TARGET_DATA *target ); bool updateBubble( TARGET_SEGMENT *bubble, TARGET_DATA *target ); bool popSessionBubbles(); diff --git a/lib/App/common/kernelModuleEmbedVideo.cpp b/lib/App/common/kernelModuleEmbedVideo.cpp index f1e0bdc1..01b973ae 100644 --- a/lib/App/common/kernelModuleEmbedVideo.cpp +++ b/lib/App/common/kernelModuleEmbedVideo.cpp @@ -125,7 +125,7 @@ kernelModuleEmbedVideo::kernelModuleEmbedVideo( uint32_t moduleID ): kernelModul mkdir( m_pVideoScratchPath, 0775 ); chmod( m_pVideoScratchPath, 0775 ); } else { - if( !fileExist( m_pVideoScratchPath )) { + if( !fileExist( (CSTR) m_pVideoScratchPath )) { mkdir( m_pVideoScratchPath, 0775 ); chmod( m_pVideoScratchPath, 0775 ); } else { @@ -193,7 +193,7 @@ kernelModuleEmbedVideo::~kernelModuleEmbedVideo(){ #ifdef HAVE_SMAL_PREVIEW_STREAMS if( n_pNoSignalSmallData ) free(n_pNoSignalSmallData); #endif - if( fileExist( m_pVideoScratchPath )) { + if( fileExist( (CSTR) m_pVideoScratchPath )) { // Clean Video Scratch char tCMD[MAX_PATH]; sprintf( tCMD, "rm -r -f -d %s/* ", m_pVideoScratchPath ); @@ -1353,8 +1353,10 @@ bool kernelModuleEmbedVideo::validate(){ }; free( tA ); tA = NULL; +#ifdef DEBUG_EXTRA } else { LOG("No Camera Defined/Enabled In the system!"); +#endif }; if ( RetVal ) { DBC_INT_LIST tInvalidList; diff --git a/lib/App/mojo/mojoKernel.cpp b/lib/App/mojo/mojoKernel.cpp index 2d657c2c..2fa6d03f 100644 --- a/lib/App/mojo/mojoKernel.cpp +++ b/lib/App/mojo/mojoKernel.cpp @@ -647,6 +647,30 @@ void mojoKernel::m_fThreadProc( void ){ stopSession(); break; }; + case CMD_FORCE_FREEZE_BUBBLES:{ + LOG("Freeze Bubbles NCQ"); + EVENT_CONTAINER *tTT = createBasicEvent( m_nServerNodeID, EVT_CLASS_SYSTEM, EVT_FLT_BUBBLES_BLOCK ); + if ( tTT ) { + m_pEventHeap->broadcast( tTT ); + }; + break; + }; + case CMD_FORCE_POP_BUBBLE:{ + LOG("POP Bubbles NCQ"); + EVENT_CONTAINER *tTT = createBasicEvent( m_nServerNodeID, EVT_CLASS_SYSTEM, EVT_FLT_BUBBLES_DEL_FB ); + if ( tTT ) { + m_pEventHeap->broadcast( tTT ); + }; + break; + }; + case CMD_FORCE_RELOAD_BUBBLES:{ + LOG("Reload Bubbles NCQ"); + EVENT_CONTAINER *tTT = createBasicEvent( m_nServerNodeID, EVT_CLASS_SYSTEM, EVT_FLT_BUBBLES_RELOAD ); + if ( tTT ) { + m_pEventHeap->broadcast( tTT ); + }; + break; + }; }; free( tCMD ); }; @@ -1050,7 +1074,7 @@ bool mojoKernel::dispatchEvent( EVENT_CONTAINER *Evt ){ strncpy( tRecord.uuid, Evt->m_UUID, 64 ); tRecord.ts_s = TS_A; tRecord.ts_ms = TS_B; - + tRecord.lrf_id = tDATA->lrf_id; tRecord.range_digital = tDATA->digital; tRecord.az = tDATA->local_target.fi; tRecord.ra = tDATA->local_target.r; @@ -1199,7 +1223,7 @@ bool mojoKernel::dispatchEvent( EVENT_CONTAINER *Evt ){ break; }; case EVT_CLASS_KRNL_FILTER_BUBBLE:{ - if( Evt->m_eType == EVT_FLT_BUBBLE_POPED ){ + if( Evt->m_eType == EVT_FLT_BUBBLE_POPED || Evt->m_eType == EVT_FLT_BUBBLE_CREATED || Evt->m_eType == EVT_FLT_BUBBLE_BLOCK_T || Evt->m_eType == EVT_FLT_BUBBLE_BLOCK_P ){ preserveSession(); @@ -1237,7 +1261,7 @@ bool mojoKernel::dispatchEvent( EVENT_CONTAINER *Evt ){ }; case EVT_CLASS_REMOTE_SERVER_CMD:{ switch ( Evt->m_eType ) { - case EVT_RSC_FRIZE_ACTIVE_B:{ + case EVT_RPC_FRIZE_ACTIVE_B:{ //getFilterId break; }; diff --git a/lib/components/base/basicEvent.h b/lib/components/base/basicEvent.h index fe2fa3ac..68df5c21 100644 --- a/lib/components/base/basicEvent.h +++ b/lib/components/base/basicEvent.h @@ -74,7 +74,7 @@ typedef enum E_basicEventTypeID:uint8_t { EVT_FLT_LATF_TRP_DET = 42, EVT_FLT_LATF_TRP_UPDT = 43, EVT_FLT_LATF_SUSP_START = 44, - _EVT_FLT_LATF_SUSP_NAK = 45, + EVT_FLT_BUBBLES_BLOCK = 45, EVT_FLT_LATF_REGULAR = 46, EVT_FLT_LATF_DISABLED = 47, EVT_FLT_LATF_SUSP_DET = 48, @@ -114,9 +114,17 @@ typedef enum E_basicEventTypeID:uint8_t { EVT_SRV_SESSION_ENDED = 82, EVT_SRV_TEST_MODBUS = 83, EVT_SRV_MODULE_HEALTH = 84, - EVT_FLT_BUBBLE_POPED = 85, - EVT_RSC_FRIZE_ACTIVE_B = 86, - EVT_COUNT = 87 + EVT_RPC_FRIZE_ACTIVE_B = 85, + EVT_FLT_BUBBLE_CREATED = 86, + EVT_FLT_BUBBLE_POPED = 87, + EVT_FLT_ATEN_ROI = 88, + EVT_CAM_ATEN_ONPOS = 89, + EVT_FLT_YOLO_RECOG_RDY = 90, + EVT_FLT_BUBBLES_DEL_FB = 91, + EVT_FLT_BUBBLES_RELOAD = 92, + EVT_FLT_BUBBLE_BLOCK_T = 93, + EVT_FLT_BUBBLE_BLOCK_P = 94, + EVT_COUNT = 95 } basicEventTypeID; typedef enum E_basicEventClassID:uint8_t{ diff --git a/lib/components/base/basicFunctionality.cpp b/lib/components/base/basicFunctionality.cpp index 242d9a05..654cb6fc 100644 --- a/lib/components/base/basicFunctionality.cpp +++ b/lib/components/base/basicFunctionality.cpp @@ -103,7 +103,7 @@ int fileCopy( const char* source, const char* destination ){ }; #endif -bool fileExist(const char *strFilename) { +bool fileExist( CSTR strFilename) { struct stat stFileInfo; int intStat; intStat = stat( strFilename ,&stFileInfo); @@ -113,7 +113,7 @@ bool fileExist(const char *strFilename) { return false; }; -bool dirEmpty( const char *dirname ){ +bool dirEmpty( CSTR dirname ){ int n = 0; struct dirent *d; DIR *dir = opendir(dirname); diff --git a/lib/components/base/basicFunctionality.h b/lib/components/base/basicFunctionality.h index d1493497..b3b5bbe2 100644 --- a/lib/components/base/basicFunctionality.h +++ b/lib/components/base/basicFunctionality.h @@ -46,8 +46,8 @@ #include "basicTypes.h" int fileCopy( const char* source, const char* destination ); -bool fileExist( const char *strFilename ); -bool dirEmpty( const char *dirname ); +bool fileExist( CSTR strFilename ); +bool dirEmpty( CSTR dirname ); CSTR trim( CSTR string ); uint8_t checksum8( uint8_t *Buffer, size_t BufferSize ); diff --git a/lib/data/darknet/darknetWraper.cpp b/lib/data/darknet/darknetWraper.cpp new file mode 100644 index 00000000..4e4d9470 --- /dev/null +++ b/lib/data/darknet/darknetWraper.cpp @@ -0,0 +1,65 @@ +#include "darknetWraper.h" +#include +#define DARKNET_INCLUDE_ORIGINAL_API +#include +//#include + +darknetWraper::darknetWraper(){ + m_pNET = NULL; +}; + +darknetWraper::~darknetWraper(){ + if ( m_pNET ) free_network_ptr( ( DarknetNetworkPtr ) m_pNET ); +}; + +bool darknetWraper::l_n( CSTR conf, CSTR weights, uint8_t clear, uint8_t batch ){ + if ( !fileExist( conf ) ) return false; + if ( !fileExist( weights ) ) return false; + if ( batch ) { + m_pNET = (void *)load_network_custom( conf, weights, clear, batch ); + } else { + m_pNET = (void *)load_network( conf, weights, clear ); + }; + if ( m_pNET ) return true; + return false; +}; + +bool darknetWraper::detect( cv::Mat &Picture ){ + DarknetNetworkPtr tNET = ( DarknetNetworkPtr ) m_pNET; + if ( m_pNET == NULL ) return false; + int nW, nH, nC; + darknet_network_dimensions( tNET, &nW, &nH, &nC ); + //image im = rgb_mat_to_rgb_image( Picture ); + Darknet::Image im = mat_to_image( Picture ); + + // Resize image to network dimensions + //image sized = letterbox_image( im, tNET->w, tNET->h ); + Darknet::Image sized = letterbox_image( im, nW, nH ); + + // 4. Run the prediction + // The results are stored internally in the network structure + network_predict_ptr( m_pNET, sized.data ); + + // 5. Get and process results (example for a single image) + int nms_t = 0.45; // NMS threshold + float thresh = 0.5; // Confidence threshold + detection *dets = get_network_boxes( tNET, Picture.cols, Picture.rows, thresh, thresh, 0, 1, &nms_t, 0); + + // You would then iterate through 'dets' to draw boxes using OpenCV calls + // The bounding boxes (x, y, w, h) in `dets` are relative to the original image dimensions + + //LOG("Detections found. Processing results..."); + // Example loop to print detections + for (int i = 0; i < tNET->layers[ tNET->n-1 ].outputs; ++i) { + if( dets[i].prob[0] > thresh ){ // Check if confidence > threshold + // Process the detection + }; + }; + + + // 6. Free allocated memory + free_detections( dets, m_pNet->layers[ tNET->n-1 ].outputs ); + free_image( im ); + free_image( sized ); + return true; +}; diff --git a/lib/data/darknet/darknetWraper.h b/lib/data/darknet/darknetWraper.h new file mode 100644 index 00000000..bf3acadf --- /dev/null +++ b/lib/data/darknet/darknetWraper.h @@ -0,0 +1,24 @@ +#ifndef __DARKNET_WRAPER_HEADER__ +#define __DARKNET_WRAPER_HEADER__ +#include "../../components/base/basicFunctionality.h" + +#include +#include +#include +#include +#include + +using namespace cv; + +class darknetWraper{ + private: + void * m_pNET; + public: + darknetWraper(); + ~darknetWraper(); + bool l_n( CSTR conf, CSTR weights, uint8_t clear = 0, uint8_t batch = 1 ); + bool detect( cv::Mat &Picture ); +}; + + +#endif \ No newline at end of file