diff --git a/部署版本/------HWCV-exe/HWCV-exe/segmentation.cpp b/部署版本/------HWCV-exe/HWCV-exe/segmentation.cpp deleted file mode 100644 index 9476a0c..0000000 --- a/部署版本/------HWCV-exe/HWCV-exe/segmentation.cpp +++ /dev/null @@ -1,241 +0,0 @@ -/* -ļsegmentation.cpp ʵļ -*/ -#include "segmentation.h" -#pragma comment( linker, "/subsystem:windows /entry:mainCRTStartup" )//޽ -/**/ -int main(int argc,char* argv[]) -{ - if(argc<2) return -1; - //for(int iii=0;iii suspict; //¼ͼƬַ - vector suspict_wcd; //ͼƬwcdֵ - vector files; //洢пļ· - vector dateVec, subjectVec, stuNum2; - vector flagVec;//¼鵽ѧпϢ - - /*ȡļø*/ - if (!ReadConfig("D:/HWCV/config/configure.cfg")) - { - SaveLog("\tļȡʧ\n", g_log_adr, "a"); - - return 0; - } - -// cout<<"ReadConfig success"< output_bzc; - if (!ReadScanf("D:\\HWCV\\config\\stdfile.db", bzccolumns, output_bzc)) - { - memset(g_log_rec, 0, sizeof(g_log_rec)); - - SaveLog("\nȡ·D:\\HWCV\\config\\stdfile.db ı׼ļʧܣ\n", g_log_adr, "a"); - return 0; - } - for (ii = 0; ii < 48; ii++)//output_vectorΪά;Ԫأ - for (jj = ii + 1; jj < 47; jj++) - bzckesa[ii][jj] = output_bzc[ii][jj]; - - /*ԣȨwcd*/ - for (i = 0; i < realSize; i++) - for (ii = 0; ii < 48; ii++) - for (jj = ii + 1; jj < 47; jj++) - if (featurep[ii][jj][i] * featurep[ii][jj][g_conti] != 0 && bzckesa[ii][jj] != -1) - wcd[i] += pow((featurep[ii][jj][i] - featurep[ii][jj][g_conti]), 2) / ((featurep[ii][jj][i] + featurep[ii][jj][g_conti])*bzckesa[ii][jj]); - - //ɵͼ1ɵͼ0 - for (i = 0; i < dateVec.size(); i++) - { - if (wcd[i] > 0.12) - { - xyimgnum++; - suspict.push_back(files[i].c_str()); - suspict_wcd.push_back(wcd[i]); - flagVec.push_back("1");//ɱ1 - } - else - { - flagVec.push_back("0"); - } - } - - //ݿ - DbUpdate(stuNum, dateVec, subjectVec, stuNum2, flagVec); -// cout << "ݿ" << endl; - - /*logļ*/ - strcat(g_log_rec, "\n"); - memset(g_log_rec, 0, sizeof(g_log_rec)); - strcat(g_log_rec, GetTime()); - strcat(g_log_rec, "\tţ"); - strcat(g_log_rec, fpname1); - strcat(g_log_rec, " ͼƬΪ"); - char pic_num[20]; - _itoa(realSize, pic_num, 10); - strcat(g_log_rec, pic_num); - if (xyimgnum > 0) - { - - /* strcat(g_log_rec, "\t"); - strcat(g_log_rec, suspict[0].c_str()); - strcat(g_log_rec, "\t"); - char a[20]; - sprintf(a, "%g", suspict_wcd[0]); - strcat(g_log_rec, a); - */ strcat(g_log_rec, "\n"); - for (i = 0; i < xyimgnum; i++) - { - strcat(g_log_rec, "\t\t\t\tͼ"); - strcat(g_log_rec, suspict[i].c_str()); - strcat(g_log_rec, "\tƶȣ"); - float sim=(1.0-suspict_wcd[i])*100; - char a[20]; - sprintf(a, "%g", sim); - strcat(g_log_rec, a); - strcat(g_log_rec, "%%\n"); - } - } - else - strcat(g_log_rec, "\tÿûͼ\n"); - SaveLog(g_log_rec, g_log_adr, "a"); - - - /*ƺ*/ - suspict.clear(); - suspict_wcd.clear(); - output_bzc.clear(); - memset(g_log_rec, 0, sizeof(g_log_rec)); - memset(feature, 0, sizeof(feature)); - memset(featurep, 0, sizeof(featurep)); - memset(bzckesa, 0, sizeof(bzckesa)); - memset(wcd, 0, sizeof(wcd)); - memset(featdif, 0, sizeof(featdif)); - files.clear(); - dateVec.clear(); - subjectVec.clear(); - stuNum2.clear(); - flagVec.clear(); - - /*ֵ*/ - return 0; -} - - diff --git a/部署版本/wei服务-监控文件夹/Check.cpp b/部署版本/wei服务-监控文件夹/Check.cpp new file mode 100644 index 0000000..81f482d --- /dev/null +++ b/部署版本/wei服务-监控文件夹/Check.cpp @@ -0,0 +1,64 @@ +#include "Check.h" + +char* GetTime(); + +/*ܣ鵱ǰľļУȡļɾļ +@ path ļλ +@ֵ ؼ⵽ı +*/ +int CheckFile(char* path, vector& files) +{ + using namespace std;//ռ + //ļ + long hFile = 0; + //ļϢ + struct _finddata_t fileinfo; + string p; + if ((hFile = _findfirst(p.assign(path).append("/*").c_str(), &fileinfo)) != -1) + { + do + { + //Ŀ¼,ֱӷ + if ((fileinfo.attrib & _A_SUBDIR)) + { + } + else //,б + { + //files.push_back(p.assign(path).append("/").append(fileinfo.name)); + files.push_back(fileinfo.name); + remove(p.assign(path).append("\\").append(fileinfo.name).c_str()); + } + } while (_findnext(hFile, &fileinfo) == 0); + + _findclose(hFile); + } + + return 0; +} + + +/** +ܣкļ־ + */ +int WriteToLog(char* str) +{ + FILE* log; + log = fopen(LOGFILE, "a+"); + if (log == NULL) return -1; + fprintf(log, "%s ", str); + fclose(log); + return 0; +} + +/** +ȡصǰʱ + */ +char* GetTime() +{ + time( <ime ); + srcTime = ctime( <ime ); + strncpy(timeNow, srcTime, strlen(srcTime)-1); // + timeNow[strlen(srcTime)-1] = '\0'; //ӽ'\0' + + return timeNow; +} \ No newline at end of file diff --git a/部署版本/wei服务-监控文件夹/Check.h b/部署版本/wei服务-监控文件夹/Check.h new file mode 100644 index 0000000..b1131e4 --- /dev/null +++ b/部署版本/wei服务-监控文件夹/Check.h @@ -0,0 +1,41 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace std; + + +/*ʱȡu*/ +#define LOGFILE "D:\\HWCV\\memstatus.txt" //־洢λ + +extern time_t ltime; +extern char *srcTime; +extern char timeNow[22]; +extern char msg[100]; + +/*ܣд־ +@ str д +@ֵ ̶ +*/ +int WriteToLog(char* str); + + +/** +:ȡصǰʱ + */ +char* GetTime(); + + +/*ܣ鵱ǰľļУȡļɾļ +@ path ļλ +@ files ȡļ +@ֵ ؼ⵽ı +*/ +int CheckFile(char* path, vector& files); + + diff --git a/部署版本/wei服务-监控文件夹/HWCV-exe.exe b/部署版本/wei服务-监控文件夹/HWCV-exe.exe new file mode 100644 index 0000000..fe6ed75 Binary files /dev/null and b/部署版本/wei服务-监控文件夹/HWCV-exe.exe differ diff --git a/部署版本/wei服务-监控文件夹/HWCVServe.dsp b/部署版本/wei服务-监控文件夹/HWCVServe.dsp new file mode 100644 index 0000000..765385c --- /dev/null +++ b/部署版本/wei服务-监控文件夹/HWCVServe.dsp @@ -0,0 +1,112 @@ +# Microsoft Developer Studio Project File - Name="HWCVServe" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=HWCVServe - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "HWCVServe.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "HWCVServe.mak" CFG="HWCVServe - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "HWCVServe - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "HWCVServe - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "HWCVServe - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE RSC /l 0x804 /d "NDEBUG" +# ADD RSC /l 0x804 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "HWCVServe - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD BASE RSC /l 0x804 /d "_DEBUG" +# ADD RSC /l 0x804 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "HWCVServe - Win32 Release" +# Name "HWCVServe - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\Check.cpp +# End Source File +# Begin Source File + +SOURCE=.\Main.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\Check.h +# End Source File +# Begin Source File + +SOURCE=.\Main.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/部署版本/wei服务-监控文件夹/HWCVServe.dsw b/部署版本/wei服务-监控文件夹/HWCVServe.dsw new file mode 100644 index 0000000..d8ca624 --- /dev/null +++ b/部署版本/wei服务-监控文件夹/HWCVServe.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# : ܱ༭ɾùļ + +############################################################################### + +Project: "HWCVServe"=".\HWCVServe.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/部署版本/wei服务-监控文件夹/HWCVServe.opt b/部署版本/wei服务-监控文件夹/HWCVServe.opt new file mode 100644 index 0000000..c800c25 Binary files /dev/null and b/部署版本/wei服务-监控文件夹/HWCVServe.opt differ diff --git a/部署版本/wei服务-监控文件夹/HWCVServe.plg b/部署版本/wei服务-监控文件夹/HWCVServe.plg new file mode 100644 index 0000000..a21eda5 --- /dev/null +++ b/部署版本/wei服务-监控文件夹/HWCVServe.plg @@ -0,0 +1,25 @@ + + +
+

Build Log

+

+--------------------Configuration: HWCVServe - Win32 Debug-------------------- +

+

Command Lines

+Creating temporary file "C:\Users\˧˧\AppData\Local\Temp\RSPC9C7.tmp" with contents +[ +kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:yes /pdb:"Debug/HWCVServe.pdb" /debug /machine:I386 /out:"Debug/HWCVServe.exe" /pdbtype:sept +".\Debug\Check.obj" +".\Debug\Main.obj" +] +Creating command line "link.exe @"C:\Users\˧˧\AppData\Local\Temp\RSPC9C7.tmp"" +

Output Window

+Linking... + + + +

Results

+HWCVServe.exe - 0 error(s), 0 warning(s) +
+ + diff --git a/部署版本/wei服务-监控文件夹/Main.cpp b/部署版本/wei服务-监控文件夹/Main.cpp new file mode 100644 index 0000000..f8749db --- /dev/null +++ b/部署版本/wei服务-监控文件夹/Main.cpp @@ -0,0 +1,47 @@ +#include "Main.h" +#include "Check.h" + + +using namespace std; +int main(int argc, char** argv) +{ + //..\Check\·ûļ + char * path = "./Check/"; + vector files; + WriteToLog(GetTime()); + WriteToLog("--ʼз--\n"); + + while(true) + { + + //ûµļУvector filesд洢 + CheckFile(path, files); + + for (int iter = 0; iter < files.size();iter++) + { + // string cmd="D:/HWCV/config/HWCV-exe "; + // cmd += files[iter]; + + // WinExec((char*)cmd.c_str(),SW_HIDE); + + try{ + ShellExecute(NULL,"open", + "HWCV-exe.exe", + (char*)files[iter].c_str(), + NULL, + SW_SHOWNORMAL); + }catch(exception e) + { + + } + } + files.clear(); + + Sleep(SLEEP_TIME); + } + + WriteToLog(GetTime()); + WriteToLog("----\n"); + + return 1; +} diff --git a/部署版本/wei服务-监控文件夹/Main.h b/部署版本/wei服务-监控文件夹/Main.h new file mode 100644 index 0000000..6187b74 --- /dev/null +++ b/部署版本/wei服务-监控文件夹/Main.h @@ -0,0 +1,21 @@ +#include +#include +#include +#include +#include +#include +#include +#pragma comment(lib, "Advapi32") + +//#pragma comment( linker, "/subsystem:windows /entry:mainCRTStartup" )//ûн + +using namespace std; +/*ȫֱ*/ +#define SLEEP_TIME 1000 //5000ˢһ + + +/*ʱȡu*/ +time_t ltime; +char *srcTime=NULL; +char timeNow[22]={0}; +char msg[100]={0}; \ No newline at end of file diff --git a/部署版本/wei服务-监控文件夹/读我.txt b/部署版本/wei服务-监控文件夹/读我.txt new file mode 100644 index 0000000..3c2b8b6 --- /dev/null +++ b/部署版本/wei服务-监控文件夹/读我.txt @@ -0,0 +1 @@ +˳ʱ̼ CheckļµļʱļݸHWCV-exe.exeִм \ No newline at end of file