更新PLC-tcp部分;更新加密lib文件(适配开机自启动软件)

CigaretteSH
CJ980606 9 months ago
parent 17bb01c5be
commit 1f0d18b37c

File diff suppressed because it is too large Load Diff

@ -41,33 +41,12 @@
<ClCompile Include="cigarette.cpp"> <ClCompile Include="cigarette.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="GeneratedFiles\Debug\moc_cigarette.cpp">
<Filter>Generated Files\Debug</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\Release\moc_cigarette.cpp">
<Filter>Generated Files\Release</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\qrc_cigarette.cpp">
<Filter>Generated Files</Filter>
</ClCompile>
<ClCompile Include="dialogsetuppasswd.cpp"> <ClCompile Include="dialogsetuppasswd.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="GeneratedFiles\Debug\moc_dialogsetuppasswd.cpp">
<Filter>Generated Files\Debug</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\Release\moc_dialogsetuppasswd.cpp">
<Filter>Generated Files\Release</Filter>
</ClCompile>
<ClCompile Include="dialogsetup.cpp"> <ClCompile Include="dialogsetup.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="GeneratedFiles\Debug\moc_dialogsetup.cpp">
<Filter>Generated Files\Debug</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\Release\moc_dialogsetup.cpp">
<Filter>Generated Files\Release</Filter>
</ClCompile>
<ClCompile Include="basecamera.cpp"> <ClCompile Include="basecamera.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
@ -83,42 +62,18 @@
<ClCompile Include="plcsetup.cpp"> <ClCompile Include="plcsetup.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="GeneratedFiles\Debug\moc_plcsetup.cpp">
<Filter>Generated Files\Debug</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\Release\moc_plcsetup.cpp">
<Filter>Generated Files\Release</Filter>
</ClCompile>
<ClCompile Include="CaptureThread.cpp"> <ClCompile Include="CaptureThread.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="GeneratedFiles\Debug\moc_CaptureThread.cpp">
<Filter>Generated Files\Debug</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\Release\moc_CaptureThread.cpp">
<Filter>Generated Files\Release</Filter>
</ClCompile>
<ClCompile Include="plc_item.cpp"> <ClCompile Include="plc_item.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="db_label.cpp"> <ClCompile Include="db_label.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="GeneratedFiles\Debug\moc_db_label.cpp">
<Filter>Generated Files\Debug</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\Release\moc_db_label.cpp">
<Filter>Generated Files\Release</Filter>
</ClCompile>
<ClCompile Include="alarmdialog.cpp"> <ClCompile Include="alarmdialog.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="GeneratedFiles\Debug\moc_alarmdialog.cpp">
<Filter>Generated Files\Debug</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\Release\moc_alarmdialog.cpp">
<Filter>Generated Files\Release</Filter>
</ClCompile>
<ClCompile Include="AlarmInfo.cpp"> <ClCompile Include="AlarmInfo.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
@ -128,60 +83,24 @@
<ClCompile Include="debugthread.cpp"> <ClCompile Include="debugthread.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="GeneratedFiles\Debug\moc_debugthread.cpp">
<Filter>Generated Files\Debug</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\Release\moc_debugthread.cpp">
<Filter>Generated Files\Release</Filter>
</ClCompile>
<ClCompile Include="dialogin.cpp"> <ClCompile Include="dialogin.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="GeneratedFiles\Debug\moc_dialogin.cpp">
<Filter>Generated Files\Debug</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\Release\moc_dialogin.cpp">
<Filter>Generated Files\Release</Filter>
</ClCompile>
<ClCompile Include="ASyncQueue.cpp"> <ClCompile Include="ASyncQueue.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="baslercamera.cpp"> <ClCompile Include="baslercamera.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="GeneratedFiles\Debug\moc_workthread.cpp">
<Filter>Generated Files\Debug</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\Release\moc_workthread.cpp">
<Filter>Generated Files\Release</Filter>
</ClCompile>
<ClCompile Include="workthread.cpp"> <ClCompile Include="workthread.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="GeneratedFiles\Debug\moc_CaptureThreadBasler.cpp">
<Filter>Generated Files\Debug</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\Release\moc_CaptureThreadBasler.cpp">
<Filter>Generated Files\Release</Filter>
</ClCompile>
<ClCompile Include="CaptureThreadBasler.cpp"> <ClCompile Include="CaptureThreadBasler.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="GeneratedFiles\Debug\moc_savethread.cpp">
<Filter>Generated Files\Debug</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\Release\moc_savethread.cpp">
<Filter>Generated Files\Release</Filter>
</ClCompile>
<ClCompile Include="hikcamera.cpp"> <ClCompile Include="hikcamera.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="GeneratedFiles\Debug\moc_CaptureThreadHIK.cpp">
<Filter>Generated Files\Debug</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\Release\moc_CaptureThreadHIK.cpp">
<Filter>Generated Files\Release</Filter>
</ClCompile>
<ClCompile Include="CaptureThreadHIK.cpp"> <ClCompile Include="CaptureThreadHIK.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
@ -191,66 +110,24 @@
<ClCompile Include="threadSend.cpp"> <ClCompile Include="threadSend.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="GeneratedFiles\Debug\moc_camera_glue.cpp">
<Filter>Generated Files\Debug</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\Release\moc_camera_glue.cpp">
<Filter>Generated Files\Release</Filter>
</ClCompile>
<ClCompile Include="camera_glue.cpp"> <ClCompile Include="camera_glue.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="GeneratedFiles\Debug\moc_change_shift.cpp">
<Filter>Generated Files\Debug</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\Release\moc_change_shift.cpp">
<Filter>Generated Files\Release</Filter>
</ClCompile>
<ClCompile Include="change_shift.cpp"> <ClCompile Include="change_shift.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="GeneratedFiles\Debug\moc_output_statistic.cpp">
<Filter>Generated Files\Debug</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\Release\moc_output_statistic.cpp">
<Filter>Generated Files\Release</Filter>
</ClCompile>
<ClCompile Include="output_statistic.cpp"> <ClCompile Include="output_statistic.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="GeneratedFiles\Debug\moc_Logthread.cpp">
<Filter>Generated Files\Debug</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\Release\moc_Logthread.cpp">
<Filter>Generated Files\Release</Filter>
</ClCompile>
<ClCompile Include="Logthread.cpp"> <ClCompile Include="Logthread.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="GeneratedFiles\Debug\moc_Cleanthread.cpp">
<Filter>Generated Files\Debug</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\Release\moc_Cleanthread.cpp">
<Filter>Generated Files\Release</Filter>
</ClCompile>
<ClCompile Include="Cleanthread.cpp"> <ClCompile Include="Cleanthread.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="threadReceive.cpp"> <ClCompile Include="threadReceive.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="GeneratedFiles\Debug\moc_threadReceive.cpp">
<Filter>Generated Files\Debug</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\Release\moc_threadReceive.cpp">
<Filter>Generated Files\Release</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\Debug\moc_exportData.cpp">
<Filter>Generated Files\Debug</Filter>
</ClCompile>
<ClCompile Include="GeneratedFiles\Release\moc_exportData.cpp">
<Filter>Generated Files\Release</Filter>
</ClCompile>
<ClCompile Include="exportData.cpp"> <ClCompile Include="exportData.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
@ -263,118 +140,106 @@
<ClCompile Include="SyncWorkThread.cpp"> <ClCompile Include="SyncWorkThread.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="GeneratedFiles\Release\moc_SyncWorkThread.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<CustomBuild Include="cigarette.h"> <QtMoc Include="cigarette.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</CustomBuild> </QtMoc>
<CustomBuild Include="cigarette.ui"> <QtUic Include="cigarette.ui">
<Filter>Form Files</Filter> <Filter>Form Files</Filter>
</CustomBuild> </QtUic>
<CustomBuild Include="cigarette.qrc"> <QtRcc Include="cigarette.qrc">
<Filter>Resource Files</Filter> <Filter>Resource Files</Filter>
</CustomBuild> </QtRcc>
<CustomBuild Include="dialogsetuppasswd.hpp"> <QtMoc Include="dialogsetuppasswd.hpp">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</CustomBuild> </QtMoc>
<CustomBuild Include="dialogsetuppasswd.ui"> <QtUic Include="dialogsetuppasswd.ui">
<Filter>Form Files</Filter> <Filter>Form Files</Filter>
</CustomBuild> </QtUic>
<CustomBuild Include="dialogsetup.hpp"> <QtMoc Include="dialogsetup.hpp">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</CustomBuild> </QtMoc>
<CustomBuild Include="dialogsetup.ui"> <QtUic Include="dialogsetup.ui">
<Filter>Form Files</Filter> <Filter>Form Files</Filter>
</CustomBuild> </QtUic>
<CustomBuild Include="plcsetup.hpp"> <QtMoc Include="plcsetup.hpp">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</CustomBuild> </QtMoc>
<CustomBuild Include="plcsetup.ui"> <QtUic Include="plcsetup.ui">
<Filter>Form Files</Filter> <Filter>Form Files</Filter>
</CustomBuild> </QtUic>
<CustomBuild Include="CaptureThread.h"> <QtMoc Include="CaptureThread.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</CustomBuild> </QtMoc>
<CustomBuild Include="db_label.h"> <QtMoc Include="db_label.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</CustomBuild> </QtMoc>
<CustomBuild Include="alarmdialog.hpp"> <QtMoc Include="alarmdialog.hpp">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</CustomBuild> </QtMoc>
<CustomBuild Include="alarmdialog.ui"> <QtUic Include="alarmdialog.ui">
<Filter>Form Files</Filter> <Filter>Form Files</Filter>
</CustomBuild> </QtUic>
<CustomBuild Include="debugthread.h"> <QtMoc Include="debugthread.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</CustomBuild> </QtMoc>
<CustomBuild Include="dialogin.hpp"> <QtMoc Include="dialogin.hpp">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</CustomBuild> </QtMoc>
<CustomBuild Include="dialogin.ui"> <QtUic Include="dialogin.ui">
<Filter>Form Files</Filter> <Filter>Form Files</Filter>
</CustomBuild> </QtUic>
<CustomBuild Include="workthread.h"> <QtMoc Include="workthread.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</CustomBuild> </QtMoc>
<CustomBuild Include="CaptureThreadBasler.h"> <QtMoc Include="CaptureThreadBasler.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</CustomBuild> </QtMoc>
<CustomBuild Include="savethread.h"> <QtMoc Include="savethread.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</CustomBuild> </QtMoc>
<CustomBuild Include="CaptureThreadHIK.h"> <QtMoc Include="CaptureThreadHIK.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</CustomBuild> </QtMoc>
<CustomBuild Include="threadSend.h"> <CustomBuild Include="threadSend.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</CustomBuild> </CustomBuild>
<CustomBuild Include="camera_glue.h"> <QtMoc Include="camera_glue.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</CustomBuild> </QtMoc>
<CustomBuild Include="camera_glue.ui"> <QtUic Include="camera_glue.ui">
<Filter>Form Files</Filter> <Filter>Form Files</Filter>
</CustomBuild> </QtUic>
<CustomBuild Include="change_shift.h"> <QtMoc Include="change_shift.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</CustomBuild> </QtMoc>
<CustomBuild Include="change_shift.ui"> <QtUic Include="change_shift.ui">
<Filter>Form Files</Filter> <Filter>Form Files</Filter>
</CustomBuild> </QtUic>
<CustomBuild Include="output_statistic.h"> <QtMoc Include="output_statistic.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</CustomBuild> </QtMoc>
<CustomBuild Include="output_statistic.ui"> <QtUic Include="output_statistic.ui">
<Filter>Form Files</Filter> <Filter>Form Files</Filter>
</CustomBuild> </QtUic>
<CustomBuild Include="Logthread.h"> <QtMoc Include="Logthread.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</CustomBuild> </QtMoc>
<CustomBuild Include="Cleanthread.h"> <QtMoc Include="Cleanthread.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</CustomBuild> </QtMoc>
<CustomBuild Include="threadReceive.h"> <QtMoc Include="threadReceive.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</CustomBuild> </QtMoc>
<CustomBuild Include="exportData.h"> <QtMoc Include="exportData.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</CustomBuild> </QtMoc>
<CustomBuild Include="SyncWorkThread.h"> <QtMoc Include="SyncWorkThread.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</CustomBuild> </QtMoc>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="GeneratedFiles\ui_cigarette.h">
<Filter>Generated Files</Filter>
</ClInclude>
<ClInclude Include="GeneratedFiles\ui_dialogsetuppasswd.h">
<Filter>Generated Files</Filter>
</ClInclude>
<ClInclude Include="GeneratedFiles\ui_dialogsetup.h">
<Filter>Generated Files</Filter>
</ClInclude>
<ClInclude Include="basecamera.h"> <ClInclude Include="basecamera.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
@ -390,21 +255,12 @@
<ClInclude Include="common.h"> <ClInclude Include="common.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="GeneratedFiles\ui_plcsetup.h">
<Filter>Generated Files</Filter>
</ClInclude>
<ClInclude Include="plc_item.h"> <ClInclude Include="plc_item.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="GeneratedFiles\ui_alarmdialog.h">
<Filter>Generated Files</Filter>
</ClInclude>
<ClInclude Include="AlarmInfo.h"> <ClInclude Include="AlarmInfo.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="GeneratedFiles\ui_dialogin.h">
<Filter>Generated Files</Filter>
</ClInclude>
<ClInclude Include="ASyncQueue.h"> <ClInclude Include="ASyncQueue.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
@ -417,15 +273,6 @@
<ClInclude Include="PLC\PLCDevice.h"> <ClInclude Include="PLC\PLCDevice.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="GeneratedFiles\ui_camera_glue.h">
<Filter>Generated Files</Filter>
</ClInclude>
<ClInclude Include="GeneratedFiles\ui_change_shift.h">
<Filter>Generated Files</Filter>
</ClInclude>
<ClInclude Include="GeneratedFiles\ui_output_statistic.h">
<Filter>Generated Files</Filter>
</ClInclude>
<ClInclude Include="tinyxml2.h"> <ClInclude Include="tinyxml2.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>

@ -9,4 +9,16 @@
<QTDIR>C:\Qt\5.15.2\msvc2019_64</QTDIR> <QTDIR>C:\Qt\5.15.2\msvc2019_64</QTDIR>
<LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3bD:\Qt\5.15.2\msvc2019_64\bin%3b$(PATH)</LocalDebuggerEnvironment> <LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3bD:\Qt\5.15.2\msvc2019_64\bin%3b$(PATH)</LocalDebuggerEnvironment>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<QtLastBackgroundBuild>2024-04-28T07:53:26.8147850Z</QtLastBackgroundBuild>
</PropertyGroup>
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<QtLastBackgroundBuild>2024-04-28T07:53:26.8795721Z</QtLastBackgroundBuild>
</PropertyGroup>
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<QtLastBackgroundBuild>2024-04-28T07:53:26.9413622Z</QtLastBackgroundBuild>
</PropertyGroup>
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<QtLastBackgroundBuild>2024-04-28T07:53:26.9872078Z</QtLastBackgroundBuild>
</PropertyGroup>
</Project> </Project>

Binary file not shown.

@ -54,8 +54,9 @@ bool PLCDevice::init_plc_tcp(PLCDevice* PLCptr)
else else
{ {
PLCptr->g_plc_ok = true; PLCptr->g_plc_ok = true;
}
qDebug("TCP connect successful "); qDebug("TCP connect successful ");
}
return true; return true;
} }
@ -105,9 +106,9 @@ int PLCDevice::write_short_2_plc(int addr, int nb, uint16_t* value)
{ {
if (g_plc_ok) if (g_plc_ok)
{ {
g_mutex.lock(); //g_mutex.lock();
int ret = modbus_write_registers(g_modbus, addr, nb, value); int ret = modbus_write_registers(g_modbus, addr, nb, value);
g_mutex.unlock(); //g_mutex.unlock();
//printf("modbus_write_registers:addr=%d,nb=%d,value=%d,ret=%d\n", addr, nb, *value, ret); //printf("modbus_write_registers:addr=%d,nb=%d,value=%d,ret=%d\n", addr, nb, *value, ret);
return ret; return ret;
} }

@ -2,7 +2,7 @@
#include <opencv2/opencv.hpp> #include <opencv2/opencv.hpp>
#define NumberOfSupportedCameras 2 #define NumberOfSupportedCameras 3
//双软件 //双软件
#define NumberOfIdentityCameras 8 #define NumberOfIdentityCameras 8
#define EdgeEvent 1 #define EdgeEvent 1

@ -40,7 +40,8 @@
#define DEFAULT_CONFPATH_PATH "D:/conf" #define DEFAULT_CONFPATH_PATH "D:/conf"
#define DEFAULT_PIC_SAVE_PATH "D:/image" #define DEFAULT_PIC_SAVE_PATH "D:/image"
// 主界面基本参数配置文件 // 主界面基本参数配置文件
#define CONFPATH "conf_path3.txt" //#define CONFPATH "D:/Release/conf_path2.txt"//小盒
#define CONFPATH "D:/Release/conf_path3.txt"//条盒
// 相机旋转角度配置文件 // 相机旋转角度配置文件
#define ROTATE_FILE "rotate.txt" #define ROTATE_FILE "rotate.txt"
#define MODBUS_CONFIGURE_FILE "modbus.txt" #define MODBUS_CONFIGURE_FILE "modbus.txt"

@ -339,14 +339,15 @@ void ExportDataThread::run()
QString remotePath; QString remotePath;
QStringList zipFilePaths; QStringList zipFilePaths;
QStringList fileList; QStringList fileList;
QString okStr = "OK"; QString okStr = "1";
QProcess process(0); QProcess process(0);
//QDateTime now_ts = QDateTime::currentDateTime(); //QDateTime now_ts = QDateTime::currentDateTime();
QStringList argsNg; QStringList argsNg;
QStringList argsOk; QStringList argsOk;
zipFilePaths.append(g_conf_path.save_pics_path + "/" + "416_BJ_" + zipTimeStamp[0] + "-00_" + zipTimeStamp[0] + "-59_0.zip"); //条盒TJ 小盒BJ
zipFilePaths.append(g_conf_path.save_pics_path + "/" + "416_BJ_" + zipTimeStamp[0] + "-00_" + zipTimeStamp[0] + "-59_1.zip"); zipFilePaths.append(g_conf_path.save_pics_path + "/" + "416_TJ_" + zipTimeStamp[0] + "-00_" + zipTimeStamp[0] + "-59_0.zip");
zipFilePaths.append(g_conf_path.save_pics_path + "/" + "416_TJ_" + zipTimeStamp[0] + "-00_" + zipTimeStamp[0] + "-59_1.zip");
fileList.append(g_conf_path.save_pics_path + "/" + zipTimeStamp[0] + "ng.txt"); fileList.append(g_conf_path.save_pics_path + "/" + zipTimeStamp[0] + "ng.txt");
fileList.append(g_conf_path.save_pics_path + "/" + zipTimeStamp[0] + "ok.txt"); fileList.append(g_conf_path.save_pics_path + "/" + zipTimeStamp[0] + "ok.txt");

@ -25,8 +25,8 @@ int main(int argc, char* argv[])
splash.show(); splash.show();
a.processEvents(); a.processEvents();
Cigarette w; Cigarette w;
//w.show(); w.show();
w.showFullScreen(); //w.showFullScreen();
splash.finish(&w); splash.finish(&w);
return a.exec(); return a.exec();
} }

@ -258,7 +258,7 @@ void SyncWorkThread::run()
#ifdef SYNC_CAMERA #ifdef SYNC_CAMERA
emit event_ok(local_camera_number); emit event_ok(local_camera_number);
#endif #endif
local_g_result_queue->put(true); // local_g_result_queue->put(true);
} }
} }
else else
@ -269,7 +269,7 @@ void SyncWorkThread::run()
#ifdef SYNC_CAMERA #ifdef SYNC_CAMERA
emit event_ng(local_camera_number); emit event_ng(local_camera_number);
#endif #endif
local_g_result_queue->put(false); //local_g_result_queue->put(false);
IsNGForAll = TRUE; IsNGForAll = TRUE;
} }
@ -337,13 +337,13 @@ void SyncWorkThread::run()
{ {
ngReason = 0; ngReason = 0;
} }
//条盒TJ 小盒BJ
file_name = g_conf_path.save_pics_path + "/" file_name = g_conf_path.save_pics_path + "/"
+ now_ts.toString("yyyy-MM-dd") + "/"+"416_BJ_01_" + now_ts.toString("yyyy-MM-dd") + "/"+"416_TJ_01_"
+ now_ts.toString("yyyy-MM-dd_HH-mm-ss.zzz_") + ng_reason_maps[ngReason] + ".jpg"; + now_ts.toString("yyyy-MM-dd_HH-mm-ss.zzz_") + ng_reason_maps[ngReason] + ".jpg";
g_save_queue->put(std::make_pair(file_name.toLocal8Bit().constData(), merge_image)); g_save_queue->put(std::make_pair(file_name.toLocal8Bit().constData(), merge_image));
#ifdef __TCPSend #ifdef __TCPSend
QString sendName = "416_BJ_01_" + now_ts.toString("yyyy-MM-dd_HH-mm-ss.zzz_") + ng_reason_maps[ngReason]; QString sendName = "416_TJ_01_" + now_ts.toString("yyyy-MM-dd_HH-mm-ss.zzz_") + ng_reason_maps[ngReason];
TCPSendInfo.pics_name = sendName.toLocal8Bit().constData(); TCPSendInfo.pics_name = sendName.toLocal8Bit().constData();
TCP_Info_queue->put(TCPSendInfo); TCP_Info_queue->put(TCPSendInfo);
#endif #endif
@ -362,7 +362,7 @@ void SyncWorkThread::run()
emit event_ng(local_camera_number); emit event_ng(local_camera_number);
else if (local_SysConf.MisMatchAct == 0)//as ok else if (local_SysConf.MisMatchAct == 0)//as ok
emit event_ok(local_camera_number); emit event_ok(local_camera_number);
emit display_check_total(local_camera_number, ++(frame_total[local_camera_number])); //emit display_check_total(local_camera_number, ++(frame_total[local_camera_number]));
qDebug() << local_camera_number << "#camera# " << now_ts.toString("yyyy-MM-dd_HH-mm-ss_zzz_") << "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx " << unit_count; qDebug() << local_camera_number << "#camera# " << now_ts.toString("yyyy-MM-dd_HH-mm-ss_zzz_") << "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx " << unit_count;
} }
#endif #endif

@ -82,17 +82,10 @@ void threadSendTCP::run()
#endif #endif
//mySocket->write("Hello! here is tcp client!\n"); //mySocket->write("Hello! here is tcp client!\n");
//mySocket->flush(); //mySocket->flush();
} }
} }
//字符串转ASCII
std::vector<int> stringToAscii(const std::string& str)
{
std::vector<int> asciiValues;
for (char c : str) {
asciiValues.push_back(static_cast<int>(c));
}
return asciiValues;
}
void threadSendTCP::sendData(_TCPSendInfo* TCPSendInfo, int Num) { void threadSendTCP::sendData(_TCPSendInfo* TCPSendInfo, int Num) {
std::string fileName = TCPSendInfo->pics_name; std::string fileName = TCPSendInfo->pics_name;
@ -104,12 +97,28 @@ void threadSendTCP::sendData(_TCPSendInfo* TCPSendInfo, int Num) {
//mySocket->flush(); //mySocket->flush();
// //
//遍历发送 //遍历发送
int i = 0; int val_[35] = {};
for (int val:asciiVals) QDateTime now_ts = QDateTime::currentDateTime();
qDebug() << "now_ts=" << now_ts;
for (int i = 0; i < asciiVals.size(); i++)
{ {
m_PLCTCPDevice->write_short_2_plc(40000 + i, 1, (uint16_t*)&val); val_[i] = asciiVals[i];
i++;
} }
//m_PLCTCPDevice->write_short_2_plc(40000, 70, (uint16_t*)&val_);//小盒
m_PLCTCPDevice->write_short_2_plc(40070, 70, (uint16_t*)&val_);//条盒
now_ts = QDateTime::currentDateTime();
qDebug() << "end-now_ts=" << now_ts;
}
//字符串转ASCII
std::vector<int> threadSendTCP::stringToAscii(const std::string& str)
{
std::vector<int> asciiValues;
for (char c : str) {
asciiValues.push_back(static_cast<int>(c));
}
return asciiValues;
} }
#ifdef __TCPServer #ifdef __TCPServer

@ -55,6 +55,7 @@ public:
void init(SyncQueue<_TCPSendInfo>* p_TCP_Info_queue, std::string ip_, int port_); void init(SyncQueue<_TCPSendInfo>* p_TCP_Info_queue, std::string ip_, int port_);
void start_work(); void start_work();
void sendData(_TCPSendInfo* TCPSendInfo, int Num); void sendData(_TCPSendInfo* TCPSendInfo, int Num);
std::vector<int> stringToAscii(const std::string& str);
#ifdef __TCPServer #ifdef __TCPServer
private slots: private slots:
void onNewConnection(); void onNewConnection();

Loading…
Cancel
Save