Add files via upload

This commit is contained in:
Chenglei98 2022-09-17 11:06:34 +08:00 committed by GitHub
parent 6586a20226
commit 2b9f2b859d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
49 changed files with 20871 additions and 0 deletions

1251
Makefile Normal file

File diff suppressed because it is too large Load Diff

467
camera.cpp Normal file
View File

@ -0,0 +1,467 @@
#include "camera.h"
#include <QDebug>
#include "thread.h"
void __stdcall onImageDataCallBackFunc(unsigned char * pData, MV_FRAME_OUT_INFO_EX* pFrameInfo, void* pUser);
void __stdcall onOfflineCallBackFunc(unsigned int nMsgType, void* pUser);
Camera::Camera()
{
camera_handle = NULL;
memset(&camera_param, 0, sizeof(camera_param));
camera_param.exposure_time = 10000.00;
camera_param.white_balance_ratio = 1000;
camera_param.gain = 1.0;
memset(&device_list, 0, sizeof(device_list));
}
uint32_t Camera::enum_device()
{
int ret = MV_CC_EnumDevices(MV_GIGE_DEVICE | MV_USB_DEVICE, &device_list);
if(ret != MV_OK)
{
return -1;
}
return device_list.nDeviceNum;
}
bool Camera::print_device_info()
{
for(int i =0; i < device_list.nDeviceNum; i++)
{
MV_CC_DEVICE_INFO* device_info = device_list.pDeviceInfo[i];
if(device_info == NULL)
{
qDebug()<<"device info:"<<i<<"can not get" ;
continue;
}
if (device_info->nTLayerType == MV_GIGE_DEVICE)
{
int nIp1 = ((device_info->SpecialInfo.stGigEInfo.nCurrentIp & 0xff000000) >> 24);
int nIp2 = ((device_info->SpecialInfo.stGigEInfo.nCurrentIp & 0x00ff0000) >> 16);
int nIp3 = ((device_info->SpecialInfo.stGigEInfo.nCurrentIp & 0x0000ff00) >> 8);
int nIp4 = (device_info->SpecialInfo.stGigEInfo.nCurrentIp & 0x000000ff);
qDebug()<<"Device index" << i;
qDebug()<<"Device Model Name: " << device_info->SpecialInfo.stGigEInfo.chModelName;
qDebug()<<"CurrentIp: " << nIp1 << "." << nIp2 << "." << nIp3 << "." << nIp4;
qDebug()<<"UserDefinedName: " << device_info->SpecialInfo.stGigEInfo.chUserDefinedName;
}
else if (device_info->nTLayerType == MV_USB_DEVICE)
{
qDebug()<<"Device Model Name:" << device_info->SpecialInfo.stUsb3VInfo.chModelName;
qDebug()<<"UserDefinedName: " << device_info->SpecialInfo.stUsb3VInfo.chUserDefinedName;
}
else
{
qDebug()<<"Not support";
}
}
return true;
}
bool Camera::select_device(int device_index)
{
int ret = MV_CC_CreateHandle(&camera_handle, device_list.pDeviceInfo[device_index]);
if(ret != MV_OK)
{
return false;
}
return true;
}
bool Camera::open_camera()
{
int ret = MV_CC_OpenDevice(camera_handle);
if(ret != MV_OK)
{
return false;
}
return true;
}
bool Camera::register_image_callback(imageCallbackFunc onImageDataCallBackFunc)
{
int ret = MV_CC_RegisterImageCallBackForBGR(camera_handle, onImageDataCallBackFunc, NULL);
if (MV_OK != ret)
{
return false;
}
return true;
}
bool Camera::register_offline_callback(exceptionCallbackFunc onOfflineCallBackFunc)
{
int nRet = MV_CC_RegisterExceptionCallBack(camera_handle, onOfflineCallBackFunc, NULL);
if (MV_OK != nRet)
{
return false;
}
return true;
}
bool Camera::start_capture()
{
int ret = MV_CC_StartGrabbing(camera_handle);
if (MV_OK != ret)
{
return false;
}
return true;
}
bool Camera::stop_capture()
{
int ret = MV_CC_StopGrabbing(camera_handle);
if (MV_OK != ret)
{
return false;
}
return true;
}
bool Camera::set_acquisition_mode()
{
int ret = MV_CC_SetEnumValue(camera_handle, "TriggerMode", 1);
if(MV_OK != ret)
{
return false;
}
ret = MV_CC_SetEnumValue(camera_handle, "TriggerSource", 2);
if(MV_OK != ret)
{
return false;
}
ret = MV_CC_SetEnumValue(camera_handle, "TriggerActivation", 1);
if(MV_OK != ret)
{
return false;
}
ret = MV_CC_SetEnumValue(camera_handle, "AcquisitionMode", 2);
if(MV_OK != ret)
{
return false;
}
return true;
}
bool Camera::set_test_acquisition_mode()
{
int ret = MV_CC_SetEnumValue(camera_handle, "TriggerMode", 0);
if(MV_OK != ret)
{
return false;
}
ret = MV_CC_SetEnumValue(camera_handle, "AcquisitionMode", 2);
if(MV_OK != ret)
{
return false;
}
return true;
}
bool Camera::set_ROI(int offset_x, int offset_y, int width, int height)
{
roi_offset_x = offset_x;
roi_offset_y = offset_y;
roi_width = width;
roi_height = height;
int ret = MV_CC_SetIntValue(camera_handle, "OffsetX", 0);
if(MV_OK != ret)
{
return false;
}
ret = MV_CC_SetIntValue(camera_handle, "OffsetY", 0);
if(MV_OK != ret)
{
return false;
}
ret = MV_CC_SetIntValue(camera_handle, "Width", roi_width);
if(MV_OK != ret)
{
return false;
}
ret = MV_CC_SetIntValue(camera_handle, "Height", roi_height);
if(MV_OK != ret)
{
return false;
}
ret = MV_CC_SetIntValue(camera_handle, "OffsetX", roi_offset_x);
if(MV_OK != ret)
{
return false;
}
ret = MV_CC_SetIntValue(camera_handle, "OffsetY", roi_offset_y);
if(MV_OK != ret)
{
return false;
}
return true;
}
bool Camera::close_camera()
{
int ret = MV_CC_CloseDevice(camera_handle);
if (MV_OK != ret)
{
return false;
}
return true;
}
bool Camera::destroy_handle()
{
int ret = MV_CC_DestroyHandle(camera_handle);
if (MV_OK != ret)
{
return false;
}
return true;
}
bool Camera::import_config_file()
{
int ret = MV_CC_FeatureLoad(camera_handle, CAMERA_CONFIG_PATH);
if(ret != MV_OK)
{
return false;
}
return true;
}
bool Camera::save_config_file()
{
int ret = MV_CC_FeatureSave(camera_handle, CAMERA_CONFIG_PATH);
if(ret != MV_OK)
{
return false;
}
return true;
}
bool Camera::set_param(Camera_param param_struct)
{
camera_param = param_struct;
int ret = MV_CC_SetIntValue(camera_handle, "BalanceRatio", camera_param.white_balance_ratio);
if (ret != MV_OK)
{
qDebug()<<"white balance ration set failed";
return false;
}
ret = MV_CC_SetFloatValue(camera_handle, "ExposureTime", camera_param.exposure_time);
if(ret != MV_OK)
{
qDebug()<<"exposure time set failed";
return false;
}
ret = MV_CC_SetFloatValue(camera_handle, "Gain", camera_param.gain);
if(ret != MV_OK)
{
qDebug()<<"gain set failed";
return false;
}
return true;
}
Camera_param Camera::get_param()
{
MVCC_INTVALUE BalanceRatio = {0};
int ret = MV_CC_GetIntValue(camera_handle, "BalanceRatio", &BalanceRatio);
if (ret == MV_OK)
{
camera_param.white_balance_ratio = BalanceRatio.nCurValue;
}
else
{
qDebug()<<"get white balance ratio failed";
}
MVCC_FLOATVALUE ExposureTime = {0};
ret = MV_CC_GetFloatValue(camera_handle, "ExposureTime", &ExposureTime);
if(ret == MV_OK)
{
camera_param.exposure_time = ExposureTime.fCurValue;
}
else
{
qDebug()<<"get exposure time failed";
}
MVCC_FLOATVALUE Gain = {0};
ret = MV_CC_GetFloatValue(camera_handle, "Gain", &Gain);
if(ret == MV_OK)
{
camera_param.gain = Gain.fCurValue;
}
else
{
qDebug()<<"get gain failed";
}
#if 1
qDebug()<< camera_param.white_balance_ratio;
qDebug()<<camera_param.exposure_time;
qDebug()<<camera_param.gain;
#endif
return camera_param;
}
bool Camera::init_camera()
{
int device_num = enum_device();
if(device_num == -1)
{
qDebug()<<"enum device failed";
if(camera_handle != NULL)
{
destroy_handle();
}
return false;
}
if(device_num == 0)
{
qDebug()<<"no camera found";
if(camera_handle != NULL)
{
destroy_handle();
}
return false;
}
//print_device_info();
bool isOk = select_device(0);
if(!isOk)
{
qDebug()<<"create handle failed";
if(camera_handle != NULL)
{
destroy_handle();
}
return false;
}
isOk = open_camera();
if(!isOk)
{
qDebug()<<"open camera failed";
if(camera_handle != NULL)
{
destroy_handle();
}
return false;
}
//set_ROI(0, 0, 2448, 2048);
isOk = import_config_file();
//set_ROI(0, 668, 1000, 2448);
if(!isOk)
{
qDebug()<<"import config file failed";
if(camera_handle != NULL)
{
destroy_handle();
}
return false;;
}
isOk = register_image_callback(onImageDataCallBackFunc);
if(!isOk)
{
qDebug()<<"register image callback function failed";
if(camera_handle != NULL)
{
destroy_handle();
}
return false;
}
isOk = register_offline_callback(onOfflineCallBackFunc);
if(!isOk)
{
qDebug()<<"register offline callback function failed";
if(camera_handle != NULL)
{
destroy_handle();
}
return false;
}
isOk = set_acquisition_mode();
if(!isOk)
{
qDebug()<<"set acquistion mode failed";
if(camera_handle != NULL)
{
destroy_handle();
}
return false;
}
//isOk = set_ROI(0, 668, 2448, 1000);
// if(!isOk)
// {
// qDebug()<<"SET ROI FAILED";
// if(camera_handle != NULL)
// {
// destroy_handle();
// }
// return false;
// }
MV_CC_SetBalanceWhiteAuto(camera_handle, 0);
MV_CC_SetIntValue(camera_handle, "LineDebouncerTime", 100);
return true;
}
bool Camera::fini_camera()
{
close_camera();
destroy_handle();
}

55
camera.h Normal file
View File

@ -0,0 +1,55 @@
#ifndef CAMERA_H
#define CAMERA_H
#include "MvCameraControl.h"
typedef void(*imageCallbackFunc)(unsigned char * , MV_FRAME_OUT_INFO_EX* , void* );
typedef void(*exceptionCallbackFunc)(unsigned int , void* );
struct Camera_param //相机参数在此添加,在构造函数中给出默认值,设置参数需要刷新
{
float exposure_time;
float gain;
int white_balance_ratio;
//... other params
};
class Camera
{
private:
void* camera_handle;
MV_CC_DEVICE_INFO_LIST device_list;
const char* config_file_path;
Camera_param camera_param;
int roi_width;
int roi_height;
int roi_offset_x;
int roi_offset_y;
public:
Camera();
uint32_t enum_device();
bool print_device_info();
bool select_device(int device_index);
bool open_camera();
bool start_capture();
bool close_camera();
bool set_acquisition_mode();
bool set_test_acquisition_mode();
bool set_ROI(int offset_x, int offset_y, int width, int height);
bool stop_capture();
bool register_image_callback(imageCallbackFunc onImageDataCallBackFunc);
bool register_offline_callback(exceptionCallbackFunc onOfflineCallBackFunc);
bool destroy_handle();
bool import_config_file();
bool save_config_file();
bool set_param(Camera_param value);
Camera_param get_param();
bool init_camera();
bool fini_camera();
};
#endif // CAMERA_H

BIN
camera.o Normal file

Binary file not shown.

2320
camera_config.mcfg Normal file

File diff suppressed because it is too large Load Diff

2316
camera_config_bak.ini Normal file

File diff suppressed because it is too large Load Diff

BIN
candy Normal file

Binary file not shown.

69
candy.pro Normal file
View File

@ -0,0 +1,69 @@
#-------------------------------------------------
#
# Project created by QtCreator 2021-04-27T04:47:05
#
#-------------------------------------------------
QT += core gui network
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = candy
TEMPLATE = app
# The following define makes your compiler emit warnings if you use
# any feature of Qt which has been marked as deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
SOURCES += \
main.cpp \
widget.cpp \
initwidget.cpp \
passwddialog.cpp \
camera.cpp \
thread.cpp \
correct.cpp \
modifypasswdialog.cpp
HEADERS += \
widget.h \
initwidget.h \
passwddialog.h \
camera.h \
thread.h \
correct.h \
modifypasswdialog.h
FORMS += \
widget.ui \
initwidget.ui \
passwddialog.ui \
modifypasswdialog.ui
# camera SDK
LIBS +=-L/opt/MVS/lib/aarch64/ -lMvCameraControl
INCLUDEPATH += /opt/MVS/include
DEPENDPATH += /opt/MVS/include
LIBS += -L/usr/lib/aarch64-linux-gnu/ -lopencv_core
LIBS += -L/usr/lib/aarch64-linux-gnu/ -lopencv_highgui
LIBS += -L/usr/lib/aarch64-linux-gnu/ -lopencv_imgcodecs
LIBS += -L/usr/lib/aarch64-linux-gnu/ -lopencv_imgproc
LIBS += -L/usr/lib/aarch64-linux-gnu/ -lopencv_videoio
LIBS += -L/usr/lib/aarch64-linux-gnu/ -lopencv_video
INCLUDEPATH += $$/usr/include/opencv4
DEPENDPATH += $$/usr/include/opencv4

216
candy.pro.user Normal file
View File

@ -0,0 +1,216 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.5.2, 2022-06-26T14:44:07. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
<value type="QByteArray">{f40858e6-f94a-4d17-9db8-96ef47726f77}</value>
</data>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
<value type="int">0</value>
</data>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
<valuemap type="QVariantMap">
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
<value type="QString" key="language">Cpp</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
</valuemap>
</valuemap>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
<value type="QString" key="language">QmlJS</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
</valuemap>
</valuemap>
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
<value type="int" key="EditorConfiguration.IndentSize">4</value>
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
<value type="int" key="EditorConfiguration.TabSize">8</value>
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.PluginSettings</variable>
<valuemap type="QVariantMap"/>
</data>
<data>
<variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{8fde18c1-a446-458e-9f45-046b48cb1bad}</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/nvidia/CandyProject/candy</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
<value type="QString">-w</value>
<value type="QString">-r</value>
</valuelist>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
<value type="QString">-w</value>
<value type="QString">-r</value>
</valuelist>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy locally</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
<value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value>
<value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value>
<value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value>
<value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value>
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
<value type="int">0</value>
<value type="int">1</value>
<value type="int">2</value>
<value type="int">3</value>
<value type="int">4</value>
<value type="int">5</value>
<value type="int">6</value>
<value type="int">7</value>
<value type="int">8</value>
<value type="int">9</value>
<value type="int">10</value>
<value type="int">11</value>
<value type="int">12</value>
<value type="int">13</value>
<value type="int">14</value>
</valuelist>
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">candy</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/home/nvidia/CandyProject/candy/candy.pro</value>
<value type="bool" key="QmakeProjectManager.QmakeRunConfiguration.UseLibrarySearchPath">true</value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">candy.pro</value>
<value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory.default">/home/nvidia/CandyProject/candy</value>
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.TargetCount</variable>
<value type="int">1</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
<value type="int">18</value>
</data>
<data>
<variable>Version</variable>
<value type="int">18</value>
</data>
</qtcreator>

253
ccc.mfs Normal file
View File

@ -0,0 +1,253 @@
# {05D8C294-F295-4dfb-9D01-096BD04049F4}
# GenApi persistence file (version 3.0.0)
# Device = HIKROBOT::HIKCamera -- HIKROBOT GigE Vision Camera Interface -- Device version = 1.2.0 -- Product GUID = EE4B7E09-DA29-4956-A1EC-212263331CFC -- Product version GUID = 79ace398-62e3-44a6-8845-f81aaf104382
DeviceLinkSelector 0
DeviceLinkHeartbeatMode On
DeviceLinkSelector 0
DeviceStreamChannelSelector 0
DeviceStreamChannelPacketSize 1500
DeviceStreamChannelSelector 0
RegionSelector Region0
RegionDestination Stream0
RegionSelector Region0
RegionSelector Region0
Width 2376
RegionSelector Region0
RegionSelector Region0
Height 584
RegionSelector Region0
RegionSelector Region0
OffsetX 72
RegionSelector Region0
RegionSelector Region0
OffsetY 700
RegionSelector Region0
ReverseX 0
ReverseY 0
PixelFormat BayerRG8
TestPatternGeneratorSelector Region0
TestPatternGeneratorSelector Region0
TestPattern Off
TestPatternGeneratorSelector Region0
BinningSelector Region0
BinningSelector Region0
BinningHorizontal BinningHorizontal1
BinningSelector Region0
BinningSelector Region0
BinningVertical BinningVertical1
BinningSelector Region0
DecimationHorizontal DecimationHorizontal1
DecimationVertical DecimationVertical1
FrameSpecInfoSelector Timestamp
FrameSpecInfoSelector Timestamp
FrameSpecInfo 0
FrameSpecInfoSelector Gain
FrameSpecInfo 0
FrameSpecInfoSelector Exposure
FrameSpecInfo 0
FrameSpecInfoSelector BrightnessInfo
FrameSpecInfo 0
FrameSpecInfoSelector WhiteBalance
FrameSpecInfo 0
FrameSpecInfoSelector Framecounter
FrameSpecInfo 0
FrameSpecInfoSelector ExtTriggerCount
FrameSpecInfo 0
FrameSpecInfoSelector LineInputOutput
FrameSpecInfo 0
FrameSpecInfoSelector ROIPosition
FrameSpecInfo 0
FrameSpecInfoSelector Timestamp
AcquisitionMode Continuous
AcquisitionBurstFrameCount 1
AcquisitionFrameRate 11.57
AcquisitionFrameRateEnable 1
TriggerSelector FrameBurstStart
TriggerSelector FrameBurstStart
TriggerMode On
TriggerSelector FrameBurstStart
TriggerSelector FrameBurstStart
TriggerSource Line2
TriggerSelector FrameBurstStart
TriggerSelector FrameBurstStart
TriggerActivation FallingEdge
TriggerSelector FrameBurstStart
TriggerSelector FrameBurstStart
TriggerDelay 0
TriggerSelector FrameBurstStart
TriggerCacheEnable 0
ExposureMode Timed
ExposureTimeMode Standard
ExposureTime 1800
ExposureAuto Off
AutoExposureTimeLowerLimit 15
AutoExposureTimeUpperLimit 85930
HDREnable 0
HDRSelector 0
HDRSelector 0
HDRShutter 15
HDRSelector 1
HDRShutter 15
HDRSelector 2
HDRShutter 15
HDRSelector 3
HDRShutter 15
HDRSelector 0
HDRSelector 0
HDRGain 0
HDRSelector 1
HDRGain 0
HDRSelector 2
HDRGain 0
HDRSelector 3
HDRGain 0
HDRSelector 0
LineSelector Line0
LineSelector Line1
LineMode Strobe
LineSelector Line0
LineSelector Line1
LineInverter 0
LineSelector Line0
LineSelector Line1
LineSource ExposureStartActive
LineSelector Line0
LineSelector Line1
StrobeEnable 0
LineSelector Line0
LineSelector Line0
LineDebouncerTime 100
LineSelector Line2
LineDebouncerTime 50
LineSelector Line0
LineSelector Line1
StrobeLineDuration 0
LineSelector Line0
LineSelector Line1
StrobeLineDelay 0
LineSelector Line0
LineSelector Line1
StrobeLinePreDelay 0
LineSelector Line0
ActionDeviceKey 0
ActionSelector 0
ActionSelector 0
ActionGroupMask 0
ActionSelector 0
ActionSelector 0
ActionGroupKey 0
ActionSelector 0
CounterSelector Counter0
CounterSelector Counter0
CounterEventSource Off
CounterSelector Counter0
CounterSelector Counter0
CounterResetSource Off
CounterSelector Counter0
CounterSelector Counter0
CounterValue 1
CounterSelector Counter0
FileSelector UserSet1
FileSelector UserSet1
FileOperationSelector Open
FileSelector UserSet2
FileOperationSelector Open
FileSelector UserSet3
FileOperationSelector Open
FileSelector DPC
FileOperationSelector Open
FileSelector UserSet1
FileSelector UserSet1
FileOpenMode Read
FileSelector UserSet2
FileOpenMode Read
FileSelector UserSet3
FileOpenMode Read
FileSelector DPC
FileOpenMode Read
FileSelector UserSet1
EventSelector AcquisitionStart
EventSelector AcquisitionStart
EventNotification Off
EventSelector AcquisitionEnd
EventNotification Off
EventSelector FrameStart
EventNotification Off
EventSelector FrameEnd
EventNotification Off
EventSelector FrameBurstStart
EventNotification Off
EventSelector FrameBurstEnd
EventNotification Off
EventSelector ExposureStart
EventNotification Off
EventSelector ExposureEnd
EventNotification Off
EventSelector Line0RisingEdge
EventNotification Off
EventSelector Line0FallingEdge
EventNotification Off
EventSelector FrameStartOverTrigger
EventNotification Off
EventSelector AcquisitionStart
ChunkModeActive 0
ColorTransformationSelector RGBtoRGB
ColorTransformationEnable 1
ColorTransformationValueSelector Gain00
Gain 8.0057
GainAuto Off
AutoGainLowerLimit 0
AutoGainUpperLimit 16.9807
DigitalShiftEnable 0
BlackLevel 240
BlackLevelEnable 1
BalanceWhiteAuto Off
BalanceRatioSelector Red
BalanceRatioSelector Red
BalanceRatio 1458
BalanceRatioSelector Green
BalanceRatio 1024
BalanceRatioSelector Blue
BalanceRatio 1957
BalanceRatioSelector Red
AutoFunctionAOISelector AOI1
AutoFunctionAOISelector AOI1
AutoFunctionAOIWidth 2448
AutoFunctionAOISelector AOI2
AutoFunctionAOIWidth 2448
AutoFunctionAOISelector AOI1
AutoFunctionAOISelector AOI1
AutoFunctionAOIHeight 2048
AutoFunctionAOISelector AOI2
AutoFunctionAOIHeight 2048
AutoFunctionAOISelector AOI1
AutoFunctionAOISelector AOI1
AutoFunctionAOIOffsetX 0
AutoFunctionAOISelector AOI2
AutoFunctionAOIOffsetX 0
AutoFunctionAOISelector AOI1
AutoFunctionAOISelector AOI1
AutoFunctionAOIOffsetY 0
AutoFunctionAOISelector AOI2
AutoFunctionAOIOffsetY 0
AutoFunctionAOISelector AOI1
AutoFunctionAOISelector AOI1
AutoFunctionAOIUsageIntensity 0
AutoFunctionAOISelector AOI1
AutoFunctionAOISelector AOI2
AutoFunctionAOIUsageWhiteBalance 0
AutoFunctionAOISelector AOI1
UserSetSelector Default
UserSetDefault Default
GevHeartbeatTimeout 3000
GevGVCPHeartbeatDisable 0
GevMCTT 0
GevMCRC 0
GevStreamChannelSelector 0
GevSCPSPacketSize 1500
GevStreamChannelSelector 0
GevStreamChannelSelector 0
GevSCPD 400
GevStreamChannelSelector 0
GevIEEE1588 0
GevGVSPExtendedIDMode Off

50
correct.cpp Normal file
View File

@ -0,0 +1,50 @@
#include "correct.h"
Correct::Correct()
{
is_corrected = false;
correction_ratio_r = 1;
correction_ratio_g = 1;
correction_ratio_b = 1;
}
void Correct::get_rgb(cv::Mat img)
{
int b_temp = 0;
int g_temp = 0;
int r_temp = 0;
for(int i=0; i<=img.rows; i++)
{
for(int j=0; j<=img.cols; j++)
{
b_temp += (int)img.at<cv::Vec3b>(i, j)[0];
g_temp += (int)img.at<cv::Vec3b>(i, j)[1];
r_temp += (int)img.at<cv::Vec3b>(i, j)[2];
}
}
b = b_temp / (img.cols * img.rows);
g = g_temp / (img.cols * img.rows);
r = r_temp / (img.cols * img.rows);
}
void Correct::cal_correction_ratio()
{
correction_ratio_b = b / b_base;
correction_ratio_g = g / g_base;
correction_ratio_r = r / r_base;
qDebug()<<"correction ratio"<<correction_ratio_b<<correction_ratio_g<<correction_ratio_r;
}
void Correct::correct_img(cv::Mat img)
{
for(int i=0; i<img.cols; i++)
{
for(int j=0; j<img.rows; j++)
{
((img.at<cv::Vec3b>(j, i)[0] * correction_ratio_b) > 255) ? img.at<cv::Vec3b>(j, i)[0] = 255 :img.at<cv::Vec3b>(j, i)[0] *= correction_ratio_b;
((img.at<cv::Vec3b>(j, i)[1] * correction_ratio_g) > 255) ? img.at<cv::Vec3b>(j, i)[1] = 255 :img.at<cv::Vec3b>(j, i)[1] *= correction_ratio_g;
((img.at<cv::Vec3b>(j, i)[2] * correction_ratio_r) > 255) ? img.at<cv::Vec3b>(j, i)[2] = 255 :img.at<cv::Vec3b>(j, i)[2] *= correction_ratio_r;
}
}
}

27
correct.h Normal file
View File

@ -0,0 +1,27 @@
#ifndef CORRECT_H
#define CORRECT_H
#include "opencv2/opencv.hpp"
#include <QDebug>
class Correct
{
private:
float correction_ratio;
float r;
float g;
float b;
float correction_ratio_r;
float correction_ratio_g;
float correction_ratio_b;
int b_base = 125.0f;
int g_base = 125.0f;
int r_base = 125.0f;
public:
Correct();
bool is_corrected;
void get_rgb(cv::Mat img);
void cal_correction_ratio();
void correct_img(cv::Mat img);
};
#endif // CORRECT_H

BIN
correct.o Normal file

Binary file not shown.

42
initwidget.cpp Normal file
View File

@ -0,0 +1,42 @@
#include "initwidget.h"
#include "ui_initwidget.h"
InitWidget::InitWidget(QWidget *parent) :
QWidget(parent),
ui(new Ui::InitWidget)
{
ui->setupUi(this);
resize(1024, 768);
this->showFullScreen();
this->setAutoFillBackground(true);
this->setPalette(QColor(211, 239, 251));
init_mainwindow = new QTimer(this);
change_window = new QTimer(this);
connect(init_mainwindow, SIGNAL(timeout()), this, SLOT(init_mainwindow_slot()));
connect(change_window, SIGNAL(timeout()), this, SLOT(change_window_slot()));
change_window->start(25000);
init_mainwindow->start(15000);
}
InitWidget::~InitWidget()
{
delete ui;
}
void InitWidget::change_window_slot()
{
change_window->stop();
this->hide();
w->show();
}
void InitWidget::init_mainwindow_slot()
{
init_mainwindow->stop();
w = new Widget();
}

31
initwidget.h Normal file
View File

@ -0,0 +1,31 @@
#ifndef INITWIDGET_H
#define INITWIDGET_H
#include <QWidget>
#include "widget.h"
#include <QTimer>
namespace Ui {
class InitWidget;
}
class InitWidget : public QWidget
{
Q_OBJECT
public:
explicit InitWidget(QWidget *parent = 0);
~InitWidget();
private slots:
void init_mainwindow_slot();
void change_window_slot();
private:
Ui::InitWidget *ui;
Widget* w;
QTimer* init_mainwindow;
QTimer* change_window;
};
#endif // INITWIDGET_H

BIN
initwidget.o Normal file

Binary file not shown.

63
initwidget.ui Normal file
View File

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>InitWidget</class>
<widget class="QWidget" name="InitWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1024</width>
<height>768</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>130</x>
<y>80</y>
<width>741</width>
<height>220</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>36</pointsize>
</font>
</property>
<property name="text">
<string>南通维尔斯机械科技有限公司
Nantong Wealth Technical Co, Ltd</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>342</x>
<y>656</y>
<width>340</width>
<height>71</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>21</pointsize>
</font>
</property>
<property name="text">
<string>系统初始化中...
Initialization...</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>

11
main.cpp Normal file
View File

@ -0,0 +1,11 @@
#include "widget.h"
#include <QApplication>
#include "initwidget.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
InitWidget w;
w.show();
return a.exec();
}

BIN
main.o Normal file

Binary file not shown.

96
moc_initwidget.cpp Normal file
View File

@ -0,0 +1,96 @@
/****************************************************************************
** Meta object code from reading C++ file 'initwidget.h'
**
** Created by: The Qt Meta Object Compiler version 63 (Qt 4.8.7)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#include "initwidget.h"
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'initwidget.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 63
#error "This file was generated using the moc from 4.8.7. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif
QT_BEGIN_MOC_NAMESPACE
static const uint qt_meta_data_InitWidget[] = {
// content:
6, // revision
0, // classname
0, 0, // classinfo
2, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// slots: signature, parameters, type, tag, flags
11, 34, 34, 34, 0x08,
35, 34, 34, 34, 0x08,
0 // eod
};
static const char qt_meta_stringdata_InitWidget[] = {
"InitWidget\0init_mainwindow_slot()\0\0"
"change_window_slot()\0"
};
void InitWidget::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
Q_ASSERT(staticMetaObject.cast(_o));
InitWidget *_t = static_cast<InitWidget *>(_o);
switch (_id) {
case 0: _t->init_mainwindow_slot(); break;
case 1: _t->change_window_slot(); break;
default: ;
}
}
Q_UNUSED(_a);
}
const QMetaObjectExtraData InitWidget::staticMetaObjectExtraData = {
0, qt_static_metacall
};
const QMetaObject InitWidget::staticMetaObject = {
{ &QWidget::staticMetaObject, qt_meta_stringdata_InitWidget,
qt_meta_data_InitWidget, &staticMetaObjectExtraData }
};
#ifdef Q_NO_DATA_RELOCATION
const QMetaObject &InitWidget::getStaticMetaObject() { return staticMetaObject; }
#endif //Q_NO_DATA_RELOCATION
const QMetaObject *InitWidget::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
}
void *InitWidget::qt_metacast(const char *_clname)
{
if (!_clname) return 0;
if (!strcmp(_clname, qt_meta_stringdata_InitWidget))
return static_cast<void*>(const_cast< InitWidget*>(this));
return QWidget::qt_metacast(_clname);
}
int InitWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QWidget::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 2)
qt_static_metacall(this, _c, _id, _a);
_id -= 2;
}
return _id;
}
QT_END_MOC_NAMESPACE

BIN
moc_initwidget.o Normal file

Binary file not shown.

144
moc_modifypasswdialog.cpp Normal file
View File

@ -0,0 +1,144 @@
/****************************************************************************
** Meta object code from reading C++ file 'modifypasswdialog.h'
**
** Created by: The Qt Meta Object Compiler version 63 (Qt 4.8.7)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#include "modifypasswdialog.h"
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'modifypasswdialog.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 63
#error "This file was generated using the moc from 4.8.7. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif
QT_BEGIN_MOC_NAMESPACE
static const uint qt_meta_data_ModifyPasswdialog[] = {
// content:
6, // revision
0, // classname
0, 0, // classinfo
18, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
1, // signalCount
// signals: signature, parameters, type, tag, flags
18, 46, 46, 46, 0x05,
// slots: signature, parameters, type, tag, flags
47, 46, 46, 46, 0x08,
65, 46, 46, 46, 0x08,
83, 46, 46, 46, 0x08,
101, 46, 46, 46, 0x08,
119, 46, 46, 46, 0x08,
137, 46, 46, 46, 0x08,
155, 46, 46, 46, 0x08,
173, 46, 46, 46, 0x08,
191, 46, 46, 46, 0x08,
209, 46, 46, 46, 0x08,
227, 46, 46, 46, 0x08,
247, 46, 46, 46, 0x08,
266, 46, 46, 46, 0x08,
285, 46, 46, 46, 0x08,
308, 46, 46, 46, 0x08,
328, 46, 46, 46, 0x08,
349, 46, 46, 46, 0x08,
0 // eod
};
static const char qt_meta_stringdata_ModifyPasswdialog[] = {
"ModifyPasswdialog\0send_modify_passwd(QString)\0"
"\0on_btn1_clicked()\0on_btn2_clicked()\0"
"on_btn3_clicked()\0on_btn4_clicked()\0"
"on_btn5_clicked()\0on_btn6_clicked()\0"
"on_btn7_clicked()\0on_btn8_clicked()\0"
"on_btn9_clicked()\0on_btn0_clicked()\0"
"on_btnDot_clicked()\0on_btnCL_clicked()\0"
"on_btnDE_clicked()\0on_btnCancel_clicked()\0"
"on_btnEnt_clicked()\0On_editingFinished()\0"
"On_editingFinished_2()\0"
};
void ModifyPasswdialog::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
Q_ASSERT(staticMetaObject.cast(_o));
ModifyPasswdialog *_t = static_cast<ModifyPasswdialog *>(_o);
switch (_id) {
case 0: _t->send_modify_passwd((*reinterpret_cast< QString(*)>(_a[1]))); break;
case 1: _t->on_btn1_clicked(); break;
case 2: _t->on_btn2_clicked(); break;
case 3: _t->on_btn3_clicked(); break;
case 4: _t->on_btn4_clicked(); break;
case 5: _t->on_btn5_clicked(); break;
case 6: _t->on_btn6_clicked(); break;
case 7: _t->on_btn7_clicked(); break;
case 8: _t->on_btn8_clicked(); break;
case 9: _t->on_btn9_clicked(); break;
case 10: _t->on_btn0_clicked(); break;
case 11: _t->on_btnDot_clicked(); break;
case 12: _t->on_btnCL_clicked(); break;
case 13: _t->on_btnDE_clicked(); break;
case 14: _t->on_btnCancel_clicked(); break;
case 15: _t->on_btnEnt_clicked(); break;
case 16: _t->On_editingFinished(); break;
case 17: _t->On_editingFinished_2(); break;
default: ;
}
}
}
const QMetaObjectExtraData ModifyPasswdialog::staticMetaObjectExtraData = {
0, qt_static_metacall
};
const QMetaObject ModifyPasswdialog::staticMetaObject = {
{ &QDialog::staticMetaObject, qt_meta_stringdata_ModifyPasswdialog,
qt_meta_data_ModifyPasswdialog, &staticMetaObjectExtraData }
};
#ifdef Q_NO_DATA_RELOCATION
const QMetaObject &ModifyPasswdialog::getStaticMetaObject() { return staticMetaObject; }
#endif //Q_NO_DATA_RELOCATION
const QMetaObject *ModifyPasswdialog::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
}
void *ModifyPasswdialog::qt_metacast(const char *_clname)
{
if (!_clname) return 0;
if (!strcmp(_clname, qt_meta_stringdata_ModifyPasswdialog))
return static_cast<void*>(const_cast< ModifyPasswdialog*>(this));
return QDialog::qt_metacast(_clname);
}
int ModifyPasswdialog::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QDialog::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 18)
qt_static_metacall(this, _c, _id, _a);
_id -= 18;
}
return _id;
}
// SIGNAL 0
void ModifyPasswdialog::send_modify_passwd(QString _t1)
{
void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 0, _a);
}
QT_END_MOC_NAMESPACE

BIN
moc_modifypasswdialog.o Normal file

Binary file not shown.

141
moc_passwddialog.cpp Normal file
View File

@ -0,0 +1,141 @@
/****************************************************************************
** Meta object code from reading C++ file 'passwddialog.h'
**
** Created by: The Qt Meta Object Compiler version 63 (Qt 4.8.7)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#include "passwddialog.h"
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'passwddialog.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 63
#error "This file was generated using the moc from 4.8.7. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif
QT_BEGIN_MOC_NAMESPACE
static const uint qt_meta_data_PasswdDialog[] = {
// content:
6, // revision
0, // classname
0, 0, // classinfo
17, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
1, // signalCount
// signals: signature, parameters, type, tag, flags
13, 36, 36, 36, 0x05,
// slots: signature, parameters, type, tag, flags
37, 36, 36, 36, 0x08,
55, 36, 36, 36, 0x08,
73, 36, 36, 36, 0x08,
91, 36, 36, 36, 0x08,
109, 36, 36, 36, 0x08,
127, 36, 36, 36, 0x08,
145, 36, 36, 36, 0x08,
163, 36, 36, 36, 0x08,
181, 36, 36, 36, 0x08,
199, 36, 36, 36, 0x08,
217, 36, 36, 36, 0x08,
237, 36, 36, 36, 0x08,
256, 36, 36, 36, 0x08,
275, 36, 36, 36, 0x08,
298, 36, 36, 36, 0x08,
318, 36, 36, 36, 0x08,
0 // eod
};
static const char qt_meta_stringdata_PasswdDialog[] = {
"PasswdDialog\0send_password(QString)\0"
"\0on_btn1_clicked()\0on_btn2_clicked()\0"
"on_btn3_clicked()\0on_btn4_clicked()\0"
"on_btn5_clicked()\0on_btn6_clicked()\0"
"on_btn7_clicked()\0on_btn8_clicked()\0"
"on_btn9_clicked()\0on_btn0_clicked()\0"
"on_btnDot_clicked()\0on_btnCL_clicked()\0"
"on_btnDE_clicked()\0on_btnCancel_clicked()\0"
"on_btnEnt_clicked()\0deal_wrong_passwd()\0"
};
void PasswdDialog::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
Q_ASSERT(staticMetaObject.cast(_o));
PasswdDialog *_t = static_cast<PasswdDialog *>(_o);
switch (_id) {
case 0: _t->send_password((*reinterpret_cast< QString(*)>(_a[1]))); break;
case 1: _t->on_btn1_clicked(); break;
case 2: _t->on_btn2_clicked(); break;
case 3: _t->on_btn3_clicked(); break;
case 4: _t->on_btn4_clicked(); break;
case 5: _t->on_btn5_clicked(); break;
case 6: _t->on_btn6_clicked(); break;
case 7: _t->on_btn7_clicked(); break;
case 8: _t->on_btn8_clicked(); break;
case 9: _t->on_btn9_clicked(); break;
case 10: _t->on_btn0_clicked(); break;
case 11: _t->on_btnDot_clicked(); break;
case 12: _t->on_btnCL_clicked(); break;
case 13: _t->on_btnDE_clicked(); break;
case 14: _t->on_btnCancel_clicked(); break;
case 15: _t->on_btnEnt_clicked(); break;
case 16: _t->deal_wrong_passwd(); break;
default: ;
}
}
}
const QMetaObjectExtraData PasswdDialog::staticMetaObjectExtraData = {
0, qt_static_metacall
};
const QMetaObject PasswdDialog::staticMetaObject = {
{ &QDialog::staticMetaObject, qt_meta_stringdata_PasswdDialog,
qt_meta_data_PasswdDialog, &staticMetaObjectExtraData }
};
#ifdef Q_NO_DATA_RELOCATION
const QMetaObject &PasswdDialog::getStaticMetaObject() { return staticMetaObject; }
#endif //Q_NO_DATA_RELOCATION
const QMetaObject *PasswdDialog::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
}
void *PasswdDialog::qt_metacast(const char *_clname)
{
if (!_clname) return 0;
if (!strcmp(_clname, qt_meta_stringdata_PasswdDialog))
return static_cast<void*>(const_cast< PasswdDialog*>(this));
return QDialog::qt_metacast(_clname);
}
int PasswdDialog::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QDialog::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 17)
qt_static_metacall(this, _c, _id, _a);
_id -= 17;
}
return _id;
}
// SIGNAL 0
void PasswdDialog::send_password(QString _t1)
{
void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 0, _a);
}
QT_END_MOC_NAMESPACE

BIN
moc_passwddialog.o Normal file

Binary file not shown.

265
moc_thread.cpp Normal file
View File

@ -0,0 +1,265 @@
/****************************************************************************
** Meta object code from reading C++ file 'thread.h'
**
** Created by: The Qt Meta Object Compiler version 63 (Qt 4.8.7)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#include "thread.h"
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'thread.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 63
#error "This file was generated using the moc from 4.8.7. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif
QT_BEGIN_MOC_NAMESPACE
static const uint qt_meta_data_Process_img[] = {
// content:
6, // revision
0, // classname
0, 0, // classinfo
3, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
3, // signalCount
// signals: signature, parameters, type, tag, flags
12, 32, 32, 32, 0x05,
33, 32, 32, 32, 0x05,
66, 32, 32, 32, 0x05,
0 // eod
};
static const char qt_meta_stringdata_Process_img[] = {
"Process_img\0send_image(cv::Mat)\0\0"
"send_res(QVector<bad_candy_box>)\0"
"send_tab(uint8_t*)\0"
};
void Process_img::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
Q_ASSERT(staticMetaObject.cast(_o));
Process_img *_t = static_cast<Process_img *>(_o);
switch (_id) {
case 0: _t->send_image((*reinterpret_cast< cv::Mat(*)>(_a[1]))); break;
case 1: _t->send_res((*reinterpret_cast< QVector<bad_candy_box>(*)>(_a[1]))); break;
case 2: _t->send_tab((*reinterpret_cast< uint8_t*(*)>(_a[1]))); break;
default: ;
}
}
}
const QMetaObjectExtraData Process_img::staticMetaObjectExtraData = {
0, qt_static_metacall
};
const QMetaObject Process_img::staticMetaObject = {
{ &QThread::staticMetaObject, qt_meta_stringdata_Process_img,
qt_meta_data_Process_img, &staticMetaObjectExtraData }
};
#ifdef Q_NO_DATA_RELOCATION
const QMetaObject &Process_img::getStaticMetaObject() { return staticMetaObject; }
#endif //Q_NO_DATA_RELOCATION
const QMetaObject *Process_img::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
}
void *Process_img::qt_metacast(const char *_clname)
{
if (!_clname) return 0;
if (!strcmp(_clname, qt_meta_stringdata_Process_img))
return static_cast<void*>(const_cast< Process_img*>(this));
return QThread::qt_metacast(_clname);
}
int Process_img::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QThread::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 3)
qt_static_metacall(this, _c, _id, _a);
_id -= 3;
}
return _id;
}
// SIGNAL 0
void Process_img::send_image(cv::Mat _t1)
{
void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 0, _a);
}
// SIGNAL 1
void Process_img::send_res(QVector<bad_candy_box> _t1)
{
void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 1, _a);
}
// SIGNAL 2
void Process_img::send_tab(uint8_t * _t1)
{
void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 2, _a);
}
static const uint qt_meta_data_Adjust_para[] = {
// content:
6, // revision
0, // classname
0, 0, // classinfo
2, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
1, // signalCount
// signals: signature, parameters, type, tag, flags
12, 38, 38, 38, 0x05,
// slots: signature, parameters, type, tag, flags
39, 38, 38, 38, 0x0a,
0 // eod
};
static const char qt_meta_stringdata_Adjust_para[] = {
"Adjust_para\0send_image_debug(cv::Mat)\0"
"\0get_correct_siganl()\0"
};
void Adjust_para::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
Q_ASSERT(staticMetaObject.cast(_o));
Adjust_para *_t = static_cast<Adjust_para *>(_o);
switch (_id) {
case 0: _t->send_image_debug((*reinterpret_cast< cv::Mat(*)>(_a[1]))); break;
case 1: _t->get_correct_siganl(); break;
default: ;
}
}
}
const QMetaObjectExtraData Adjust_para::staticMetaObjectExtraData = {
0, qt_static_metacall
};
const QMetaObject Adjust_para::staticMetaObject = {
{ &QThread::staticMetaObject, qt_meta_stringdata_Adjust_para,
qt_meta_data_Adjust_para, &staticMetaObjectExtraData }
};
#ifdef Q_NO_DATA_RELOCATION
const QMetaObject &Adjust_para::getStaticMetaObject() { return staticMetaObject; }
#endif //Q_NO_DATA_RELOCATION
const QMetaObject *Adjust_para::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
}
void *Adjust_para::qt_metacast(const char *_clname)
{
if (!_clname) return 0;
if (!strcmp(_clname, qt_meta_stringdata_Adjust_para))
return static_cast<void*>(const_cast< Adjust_para*>(this));
return QThread::qt_metacast(_clname);
}
int Adjust_para::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QThread::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 2)
qt_static_metacall(this, _c, _id, _a);
_id -= 2;
}
return _id;
}
// SIGNAL 0
void Adjust_para::send_image_debug(cv::Mat _t1)
{
void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 0, _a);
}
static const uint qt_meta_data_Grab_img[] = {
// content:
6, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
0 // eod
};
static const char qt_meta_stringdata_Grab_img[] = {
"Grab_img\0"
};
void Grab_img::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}
const QMetaObjectExtraData Grab_img::staticMetaObjectExtraData = {
0, qt_static_metacall
};
const QMetaObject Grab_img::staticMetaObject = {
{ &QThread::staticMetaObject, qt_meta_stringdata_Grab_img,
qt_meta_data_Grab_img, &staticMetaObjectExtraData }
};
#ifdef Q_NO_DATA_RELOCATION
const QMetaObject &Grab_img::getStaticMetaObject() { return staticMetaObject; }
#endif //Q_NO_DATA_RELOCATION
const QMetaObject *Grab_img::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
}
void *Grab_img::qt_metacast(const char *_clname)
{
if (!_clname) return 0;
if (!strcmp(_clname, qt_meta_stringdata_Grab_img))
return static_cast<void*>(const_cast< Grab_img*>(this));
return QThread::qt_metacast(_clname);
}
int Grab_img::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QThread::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
return _id;
}
QT_END_MOC_NAMESPACE

BIN
moc_thread.o Normal file

Binary file not shown.

228
moc_widget.cpp Normal file
View File

@ -0,0 +1,228 @@
/****************************************************************************
** Meta object code from reading C++ file 'widget.h'
**
** Created by: The Qt Meta Object Compiler version 63 (Qt 4.8.7)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#include "widget.h"
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'widget.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 63
#error "This file was generated using the moc from 4.8.7. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif
QT_BEGIN_MOC_NAMESPACE
static const uint qt_meta_data_Widget[] = {
// content:
6, // revision
0, // classname
0, 0, // classinfo
48, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
2, // signalCount
// signals: signature, parameters, type, tag, flags
7, 24, 24, 24, 0x05,
25, 24, 24, 24, 0x05,
// slots: signature, parameters, type, tag, flags
40, 24, 24, 24, 0x08,
62, 24, 24, 24, 0x08,
84, 24, 24, 24, 0x08,
104, 24, 24, 24, 0x08,
123, 24, 24, 24, 0x08,
145, 24, 24, 24, 0x08,
167, 24, 24, 24, 0x08,
191, 24, 24, 24, 0x08,
213, 24, 24, 24, 0x08,
235, 24, 24, 24, 0x08,
257, 24, 24, 24, 0x08,
281, 24, 24, 24, 0x08,
303, 24, 24, 24, 0x08,
329, 24, 24, 24, 0x08,
356, 24, 24, 24, 0x08,
379, 24, 24, 24, 0x08,
405, 24, 24, 24, 0x08,
434, 24, 24, 24, 0x08,
456, 24, 24, 24, 0x08,
478, 24, 24, 24, 0x08,
508, 24, 24, 24, 0x08,
530, 24, 24, 24, 0x08,
551, 24, 24, 24, 0x08,
589, 24, 24, 24, 0x08,
613, 24, 24, 24, 0x08,
635, 24, 24, 24, 0x08,
659, 24, 24, 24, 0x08,
685, 24, 24, 24, 0x08,
715, 24, 24, 24, 0x08,
739, 24, 24, 24, 0x08,
764, 24, 24, 24, 0x08,
783, 24, 24, 24, 0x08,
815, 24, 24, 24, 0x08,
839, 24, 24, 24, 0x08,
861, 24, 24, 24, 0x08,
879, 24, 24, 24, 0x08,
897, 24, 24, 24, 0x08,
915, 24, 24, 24, 0x08,
933, 24, 24, 24, 0x08,
951, 24, 24, 24, 0x08,
969, 24, 24, 24, 0x08,
987, 24, 24, 24, 0x08,
1005, 24, 24, 24, 0x08,
1023, 24, 24, 24, 0x08,
1041, 24, 24, 24, 0x08,
1059, 24, 24, 24, 0x08,
0 // eod
};
static const char qt_meta_stringdata_Widget[] = {
"Widget\0correct_signal()\0\0wrong_passwd()\0"
"On_btn_Tab1_2_click()\0On_btn_Tab1_3_click()\0"
"On_btnStart_click()\0On_bthStop_click()\0"
"On_btn_Tab2_1_click()\0On_btn_Tab2_5_click()\0"
"On_btnValveTest_click()\0On_btn_Tab3_1_click()\0"
"On_btn_Tab3_4_click()\0On_btn_Tab3_6_click()\0"
"On_btnImportImg_click()\0On_btnSaveImg_click()\0"
"On_btnImportModel_click()\0"
"On_btnModifyPasswd_click()\0"
"On_btn_correct_click()\0On_btn_getcorrect_click()\0"
"On_btn_setcamerapara_click()\0"
"On_btn_Tab4_3_click()\0On_btn_Tab5_3_click()\0"
"On_btn_set_thereshold_click()\0"
"On_btn_Tab6_3_click()\0On_btn_close_click()\0"
"On_candy_select_box_index_change(int)\0"
"On_btnManualValveTest()\0On_btn_Tab7_3_click()\0"
"On_btnchannelup_click()\0"
"On_btnchanneldown_click()\0"
"On_btn_channel_send_clicked()\0"
"judge_password(QString)\0"
"modify_password(QString)\0showimage(cv::Mat)\0"
"drawbox(QVector<bad_candy_box>)\0"
"showimage_test(cv::Mat)\0ServerNewConnection()\0"
"get_tab(uint8_t*)\0On_btn1_clicked()\0"
"On_btn2_clicked()\0On_btn3_clicked()\0"
"On_btn4_clicked()\0On_btn5_clicked()\0"
"On_btn6_clicked()\0On_btn7_clicked()\0"
"On_btn8_clicked()\0On_btn9_clicked()\0"
"On_btn0_clicked()\0On_btn_DEL_clicked()\0"
};
void Widget::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
Q_ASSERT(staticMetaObject.cast(_o));
Widget *_t = static_cast<Widget *>(_o);
switch (_id) {
case 0: _t->correct_signal(); break;
case 1: _t->wrong_passwd(); break;
case 2: _t->On_btn_Tab1_2_click(); break;
case 3: _t->On_btn_Tab1_3_click(); break;
case 4: _t->On_btnStart_click(); break;
case 5: _t->On_bthStop_click(); break;
case 6: _t->On_btn_Tab2_1_click(); break;
case 7: _t->On_btn_Tab2_5_click(); break;
case 8: _t->On_btnValveTest_click(); break;
case 9: _t->On_btn_Tab3_1_click(); break;
case 10: _t->On_btn_Tab3_4_click(); break;
case 11: _t->On_btn_Tab3_6_click(); break;
case 12: _t->On_btnImportImg_click(); break;
case 13: _t->On_btnSaveImg_click(); break;
case 14: _t->On_btnImportModel_click(); break;
case 15: _t->On_btnModifyPasswd_click(); break;
case 16: _t->On_btn_correct_click(); break;
case 17: _t->On_btn_getcorrect_click(); break;
case 18: _t->On_btn_setcamerapara_click(); break;
case 19: _t->On_btn_Tab4_3_click(); break;
case 20: _t->On_btn_Tab5_3_click(); break;
case 21: _t->On_btn_set_thereshold_click(); break;
case 22: _t->On_btn_Tab6_3_click(); break;
case 23: _t->On_btn_close_click(); break;
case 24: _t->On_candy_select_box_index_change((*reinterpret_cast< int(*)>(_a[1]))); break;
case 25: _t->On_btnManualValveTest(); break;
case 26: _t->On_btn_Tab7_3_click(); break;
case 27: _t->On_btnchannelup_click(); break;
case 28: _t->On_btnchanneldown_click(); break;
case 29: _t->On_btn_channel_send_clicked(); break;
case 30: _t->judge_password((*reinterpret_cast< QString(*)>(_a[1]))); break;
case 31: _t->modify_password((*reinterpret_cast< QString(*)>(_a[1]))); break;
case 32: _t->showimage((*reinterpret_cast< cv::Mat(*)>(_a[1]))); break;
case 33: _t->drawbox((*reinterpret_cast< QVector<bad_candy_box>(*)>(_a[1]))); break;
case 34: _t->showimage_test((*reinterpret_cast< cv::Mat(*)>(_a[1]))); break;
case 35: _t->ServerNewConnection(); break;
case 36: _t->get_tab((*reinterpret_cast< uint8_t*(*)>(_a[1]))); break;
case 37: _t->On_btn1_clicked(); break;
case 38: _t->On_btn2_clicked(); break;
case 39: _t->On_btn3_clicked(); break;
case 40: _t->On_btn4_clicked(); break;
case 41: _t->On_btn5_clicked(); break;
case 42: _t->On_btn6_clicked(); break;
case 43: _t->On_btn7_clicked(); break;
case 44: _t->On_btn8_clicked(); break;
case 45: _t->On_btn9_clicked(); break;
case 46: _t->On_btn0_clicked(); break;
case 47: _t->On_btn_DEL_clicked(); break;
default: ;
}
}
}
const QMetaObjectExtraData Widget::staticMetaObjectExtraData = {
0, qt_static_metacall
};
const QMetaObject Widget::staticMetaObject = {
{ &QWidget::staticMetaObject, qt_meta_stringdata_Widget,
qt_meta_data_Widget, &staticMetaObjectExtraData }
};
#ifdef Q_NO_DATA_RELOCATION
const QMetaObject &Widget::getStaticMetaObject() { return staticMetaObject; }
#endif //Q_NO_DATA_RELOCATION
const QMetaObject *Widget::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
}
void *Widget::qt_metacast(const char *_clname)
{
if (!_clname) return 0;
if (!strcmp(_clname, qt_meta_stringdata_Widget))
return static_cast<void*>(const_cast< Widget*>(this));
return QWidget::qt_metacast(_clname);
}
int Widget::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QWidget::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 48)
qt_static_metacall(this, _c, _id, _a);
_id -= 48;
}
return _id;
}
// SIGNAL 0
void Widget::correct_signal()
{
QMetaObject::activate(this, &staticMetaObject, 0, 0);
}
// SIGNAL 1
void Widget::wrong_passwd()
{
QMetaObject::activate(this, &staticMetaObject, 1, 0);
}
QT_END_MOC_NAMESPACE

BIN
moc_widget.o Normal file

Binary file not shown.

250
modifypasswdialog.cpp Normal file
View File

@ -0,0 +1,250 @@
#include "modifypasswdialog.h"
#include "ui_modifypasswdialog.h"
#include <QDebug>
#include <QMessageBox>
ModifyPasswdialog::ModifyPasswdialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::ModifyPasswdialog)
{
ui->setupUi(this);
setWindowFlags(Qt::FramelessWindowHint); //隐藏窗体
setModal(true); //设置为模态对话框
// ui->lineEdit->setFocus(); //lineEdit为焦点
ui->lineEdit->setEchoMode(QLineEdit::Password); //显示模式为密码
ui->lineEdit_2->setEchoMode(QLineEdit::Password);
QList<QPushButton*> button = findChildren<QPushButton*>(); //设置所有按键不为焦点
for(int i=0; i<button.length(); i++)
{
button[i]->setFocusPolicy(Qt::NoFocus);
}
connect(ui->lineEdit, SIGNAL(editingFinished()), this, SLOT(On_editingFinished()));
connect(ui->lineEdit_2, SIGNAL(editingFinished()), this, SLOT(On_editingFinished_2()));
}
ModifyPasswdialog::~ModifyPasswdialog()
{
delete ui;
}
void ModifyPasswdialog::on_btn1_clicked()
{
if(which_edit == 1)
{
QString password = ui->lineEdit->text();
password.append("1");
ui->lineEdit->setText(password);
}
if(which_edit == 2)
{
QString password = ui->lineEdit_2->text();
password.append("1");
ui->lineEdit_2->setText(password);
}
}
void ModifyPasswdialog::on_btn2_clicked()
{
if(which_edit == 1)
{
QString password = ui->lineEdit->text();
password.append("2");
ui->lineEdit->setText(password);
}
if(which_edit == 2)
{
QString password = ui->lineEdit_2->text();
password.append("2");
ui->lineEdit_2->setText(password);
}
}
void ModifyPasswdialog::on_btn3_clicked()
{
if(which_edit == 1)
{
QString password = ui->lineEdit->text();
password.append("3");
ui->lineEdit->setText(password);
}
if(which_edit == 2)
{
QString password = ui->lineEdit_2->text();
password.append("3");
ui->lineEdit_2->setText(password);
}
}
void ModifyPasswdialog::on_btn4_clicked()
{
if(which_edit == 1)
{
QString password = ui->lineEdit->text();
password.append("4");
ui->lineEdit->setText(password);
}
if(which_edit == 2)
{
QString password = ui->lineEdit_2->text();
password.append("4");
ui->lineEdit_2->setText(password);
}
}
void ModifyPasswdialog::on_btn5_clicked()
{
if(which_edit == 1)
{
QString password = ui->lineEdit->text();
password.append("5");
ui->lineEdit->setText(password);
}
if(which_edit == 2)
{
QString password = ui->lineEdit_2->text();
password.append("5");
ui->lineEdit_2->setText(password);
}
}
void ModifyPasswdialog::on_btn6_clicked()
{
if(which_edit == 1)
{
QString password = ui->lineEdit->text();
password.append("6");
ui->lineEdit->setText(password);
}
if(which_edit == 2)
{
QString password = ui->lineEdit_2->text();
password.append("6");
ui->lineEdit_2->setText(password);
}
}
void ModifyPasswdialog::on_btn7_clicked()
{
if(which_edit == 1)
{
QString password = ui->lineEdit->text();
password.append("7");
ui->lineEdit->setText(password);
}
if(which_edit == 2)
{
QString password = ui->lineEdit_2->text();
password.append("8");
ui->lineEdit_2->setText(password);
}
}
void ModifyPasswdialog::on_btn8_clicked()
{
if(which_edit == 1)
{
QString password = ui->lineEdit->text();
password.append("8");
ui->lineEdit->setText(password);
}
if(which_edit == 2)
{
QString password = ui->lineEdit_2->text();
password.append("8");
ui->lineEdit_2->setText(password);
}
}
void ModifyPasswdialog::on_btn9_clicked()
{
if(which_edit == 1)
{
QString password = ui->lineEdit->text();
password.append("9");
ui->lineEdit->setText(password);
}
if(which_edit == 2)
{
QString password = ui->lineEdit_2->text();
password.append("9");
ui->lineEdit_2->setText(password);
}
}
void ModifyPasswdialog::on_btn0_clicked()
{
if(which_edit == 1)
{
QString password = ui->lineEdit->text();
password.append("0");
ui->lineEdit->setText(password);
}
if(which_edit == 2)
{
QString password = ui->lineEdit_2->text();
password.append("0");
ui->lineEdit_2->setText(password);
}
}
void ModifyPasswdialog::on_btnDot_clicked()
{
}
void ModifyPasswdialog::on_btnCL_clicked()
{
if(which_edit == 1)
{
ui->lineEdit->clear();
}
if(which_edit == 2)
{
ui->lineEdit_2->clear();
}
}
void ModifyPasswdialog::on_btnDE_clicked()
{
if(which_edit == 1)
{
ui->lineEdit->backspace();
}
if(which_edit == 2)
{
ui->lineEdit_2->backspace();
}
}
void ModifyPasswdialog::on_btnCancel_clicked()
{
this->close();
}
void ModifyPasswdialog::on_btnEnt_clicked()
{
QString password = ui->lineEdit->text();
QString password2 = ui->lineEdit_2->text();
if(password == password2)
{
emit send_modify_passwd(password);
}
else
{
QMessageBox::warning(this, "", QString::fromUtf8("密码不一致"));
ui->lineEdit->clear();
ui->lineEdit_2->clear();
}
}
void ModifyPasswdialog::On_editingFinished()
{
which_edit = 2;
}
void ModifyPasswdialog::On_editingFinished_2()
{
which_edit = 1;
}

46
modifypasswdialog.h Normal file
View File

@ -0,0 +1,46 @@
#ifndef MODIFYPASSWDIALOG_H
#define MODIFYPASSWDIALOG_H
#include <QDialog>
namespace Ui {
class ModifyPasswdialog;
}
class ModifyPasswdialog : public QDialog
{
Q_OBJECT
public:
explicit ModifyPasswdialog(QWidget *parent = 0);
~ModifyPasswdialog();
private slots:
void on_btn1_clicked();
void on_btn2_clicked();
void on_btn3_clicked();
void on_btn4_clicked();
void on_btn5_clicked();
void on_btn6_clicked();
void on_btn7_clicked();
void on_btn8_clicked();
void on_btn9_clicked();
void on_btn0_clicked();
void on_btnDot_clicked();
void on_btnCL_clicked();
void on_btnDE_clicked();
void on_btnCancel_clicked();
void on_btnEnt_clicked();
void On_editingFinished();
void On_editingFinished_2();
private:
Ui::ModifyPasswdialog *ui;
int which_edit = 1;
signals:
void send_modify_passwd(QString);
};
#endif // MODIFYPASSWDIALOG_H

BIN
modifypasswdialog.o Normal file

Binary file not shown.

300
modifypasswdialog.ui Normal file
View File

@ -0,0 +1,300 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ModifyPasswdialog</class>
<widget class="QDialog" name="ModifyPasswdialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>348</width>
<height>432</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<widget class="QLineEdit" name="lineEdit">
<property name="geometry">
<rect>
<x>10</x>
<y>60</y>
<width>221</width>
<height>31</height>
</rect>
</property>
<property name="maxLength">
<number>6</number>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>60</x>
<y>10</y>
<width>191</width>
<height>41</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>20</pointsize>
</font>
</property>
<property name="text">
<string>Input Password</string>
</property>
</widget>
<widget class="QPushButton" name="btn9">
<property name="geometry">
<rect>
<x>160</x>
<y>290</y>
<width>51</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>9</string>
</property>
</widget>
<widget class="QPushButton" name="btn4">
<property name="geometry">
<rect>
<x>20</x>
<y>220</y>
<width>51</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>4</string>
</property>
</widget>
<widget class="QPushButton" name="btnDot">
<property name="geometry">
<rect>
<x>90</x>
<y>360</y>
<width>51</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>.</string>
</property>
</widget>
<widget class="QPushButton" name="btn3">
<property name="geometry">
<rect>
<x>160</x>
<y>150</y>
<width>51</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>3</string>
</property>
</widget>
<widget class="QPushButton" name="btn6">
<property name="geometry">
<rect>
<x>160</x>
<y>220</y>
<width>51</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>6</string>
</property>
</widget>
<widget class="QPushButton" name="btnCL">
<property name="geometry">
<rect>
<x>230</x>
<y>290</y>
<width>61</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>CLEAR</string>
</property>
</widget>
<widget class="QPushButton" name="btn0">
<property name="geometry">
<rect>
<x>20</x>
<y>360</y>
<width>51</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>0</string>
</property>
</widget>
<widget class="QPushButton" name="btn8">
<property name="geometry">
<rect>
<x>90</x>
<y>290</y>
<width>51</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>8</string>
</property>
</widget>
<widget class="QPushButton" name="btnEnt">
<property name="geometry">
<rect>
<x>230</x>
<y>360</y>
<width>61</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>ENTER</string>
</property>
</widget>
<widget class="QPushButton" name="btn2">
<property name="geometry">
<rect>
<x>90</x>
<y>150</y>
<width>51</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>2</string>
</property>
</widget>
<widget class="QPushButton" name="btn7">
<property name="geometry">
<rect>
<x>20</x>
<y>290</y>
<width>51</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>7</string>
</property>
</widget>
<widget class="QPushButton" name="btn1">
<property name="geometry">
<rect>
<x>20</x>
<y>150</y>
<width>51</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>1</string>
</property>
</widget>
<widget class="QPushButton" name="btn5">
<property name="geometry">
<rect>
<x>90</x>
<y>220</y>
<width>51</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>5</string>
</property>
</widget>
<widget class="QPushButton" name="btnDE">
<property name="geometry">
<rect>
<x>230</x>
<y>150</y>
<width>61</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>DELETE</string>
</property>
</widget>
<widget class="QPushButton" name="btnCancel">
<property name="geometry">
<rect>
<x>230</x>
<y>220</y>
<width>61</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>CANCEL</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit_2">
<property name="geometry">
<rect>
<x>10</x>
<y>100</y>
<width>221</width>
<height>31</height>
</rect>
</property>
<property name="maxLength">
<number>6</number>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>240</x>
<y>60</y>
<width>81</width>
<height>31</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>17</pointsize>
</font>
</property>
<property name="text">
<string>NEW</string>
</property>
</widget>
<widget class="QLabel" name="label_3">
<property name="geometry">
<rect>
<x>240</x>
<y>100</y>
<width>101</width>
<height>31</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>17</pointsize>
</font>
</property>
<property name="text">
<string>CONFIRM</string>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>

BIN
para.ini Normal file

Binary file not shown.

129
passwddialog.cpp Normal file
View File

@ -0,0 +1,129 @@
#include "passwddialog.h"
#include "ui_passwddialog.h"
#include <QDebug>
PasswdDialog::PasswdDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::PasswdDialog)
{
ui->setupUi(this);
setWindowFlags(Qt::FramelessWindowHint); //隐藏窗体
setModal(true); //设置为模态对话框
ui->lineEdit->setFocus(); //lineEdit为焦点
ui->lineEdit->setEchoMode(QLineEdit::Password); //显示模式为密码
QList<QPushButton*> button = findChildren<QPushButton*>(); //设置所有按键不为焦点
for(int i=0; i<button.length(); i++)
{
button[i]->setFocusPolicy(Qt::NoFocus);
}
}
PasswdDialog::~PasswdDialog()
{
delete ui;
}
void PasswdDialog::on_btn1_clicked()
{
QString password = ui->lineEdit->text();
password.append("1");
ui->lineEdit->setText(password);
}
void PasswdDialog::on_btn2_clicked()
{
QString password = ui->lineEdit->text();
password.append("2");
ui->lineEdit->setText(password);
}
void PasswdDialog::on_btn3_clicked()
{
QString password = ui->lineEdit->text();
password.append("3");
ui->lineEdit->setText(password);
}
void PasswdDialog::on_btn4_clicked()
{
QString password = ui->lineEdit->text();
password.append("4");
ui->lineEdit->setText(password);
}
void PasswdDialog::on_btn5_clicked()
{
QString password = ui->lineEdit->text();
password.append("5");
ui->lineEdit->setText(password);
}
void PasswdDialog::on_btn6_clicked()
{
QString password = ui->lineEdit->text();
password.append("6");
ui->lineEdit->setText(password);
}
void PasswdDialog::on_btn7_clicked()
{
QString password = ui->lineEdit->text();
password.append("7");
ui->lineEdit->setText(password);
}
void PasswdDialog::on_btn8_clicked()
{
QString password = ui->lineEdit->text();
password.append("8");
ui->lineEdit->setText(password);
}
void PasswdDialog::on_btn9_clicked()
{
QString password = ui->lineEdit->text();
password.append("9");
ui->lineEdit->setText(password);
}
void PasswdDialog::on_btn0_clicked()
{
QString password = ui->lineEdit->text();
password.append("0");
ui->lineEdit->setText(password);
}
void PasswdDialog::on_btnDot_clicked()
{
}
void PasswdDialog::on_btnCL_clicked()
{
ui->lineEdit->clear();
}
void PasswdDialog::on_btnDE_clicked()
{
ui->lineEdit->backspace();
}
void PasswdDialog::on_btnCancel_clicked()
{
this->close();
}
void PasswdDialog::on_btnEnt_clicked()
{
QString password = ui->lineEdit->text();
emit send_password(password);
}
void PasswdDialog::deal_wrong_passwd()
{
ui->lineEdit->clear();
}

44
passwddialog.h Normal file
View File

@ -0,0 +1,44 @@
#ifndef PASSWDDIALOG_H
#define PASSWDDIALOG_H
#include <QDialog>
namespace Ui {
class PasswdDialog;
}
class PasswdDialog : public QDialog
{
Q_OBJECT
public:
explicit PasswdDialog(QWidget *parent = 0);
~PasswdDialog();
private slots:
void on_btn1_clicked();
void on_btn2_clicked();
void on_btn3_clicked();
void on_btn4_clicked();
void on_btn5_clicked();
void on_btn6_clicked();
void on_btn7_clicked();
void on_btn8_clicked();
void on_btn9_clicked();
void on_btn0_clicked();
void on_btnDot_clicked();
void on_btnCL_clicked();
void on_btnDE_clicked();
void on_btnCancel_clicked();
void on_btnEnt_clicked();
void deal_wrong_passwd();
signals:
void send_password(QString);
private:
Ui::PasswdDialog *ui;
};
#endif // PASSWDDIALOG_H

BIN
passwddialog.o Normal file

Binary file not shown.

248
passwddialog.ui Normal file
View File

@ -0,0 +1,248 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PasswdDialog</class>
<widget class="QDialog" name="PasswdDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>300</width>
<height>433</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<widget class="QPushButton" name="btn1">
<property name="geometry">
<rect>
<x>20</x>
<y>120</y>
<width>51</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>1</string>
</property>
</widget>
<widget class="QPushButton" name="btn2">
<property name="geometry">
<rect>
<x>90</x>
<y>120</y>
<width>51</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>2</string>
</property>
</widget>
<widget class="QPushButton" name="btn0">
<property name="geometry">
<rect>
<x>20</x>
<y>330</y>
<width>51</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>0</string>
</property>
</widget>
<widget class="QPushButton" name="btnDot">
<property name="geometry">
<rect>
<x>90</x>
<y>330</y>
<width>51</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>.</string>
</property>
</widget>
<widget class="QPushButton" name="btn5">
<property name="geometry">
<rect>
<x>90</x>
<y>190</y>
<width>51</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>5</string>
</property>
</widget>
<widget class="QPushButton" name="btn8">
<property name="geometry">
<rect>
<x>90</x>
<y>260</y>
<width>51</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>8</string>
</property>
</widget>
<widget class="QPushButton" name="btn6">
<property name="geometry">
<rect>
<x>160</x>
<y>190</y>
<width>51</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>6</string>
</property>
</widget>
<widget class="QPushButton" name="btn4">
<property name="geometry">
<rect>
<x>20</x>
<y>190</y>
<width>51</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>4</string>
</property>
</widget>
<widget class="QPushButton" name="btn7">
<property name="geometry">
<rect>
<x>20</x>
<y>260</y>
<width>51</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>7</string>
</property>
</widget>
<widget class="QLineEdit" name="lineEdit">
<property name="geometry">
<rect>
<x>10</x>
<y>60</y>
<width>281</width>
<height>31</height>
</rect>
</property>
<property name="maxLength">
<number>6</number>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QPushButton" name="btnCL">
<property name="geometry">
<rect>
<x>230</x>
<y>260</y>
<width>61</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>CLEAR</string>
</property>
</widget>
<widget class="QPushButton" name="btn3">
<property name="geometry">
<rect>
<x>160</x>
<y>120</y>
<width>51</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>3</string>
</property>
</widget>
<widget class="QPushButton" name="btn9">
<property name="geometry">
<rect>
<x>160</x>
<y>260</y>
<width>51</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>9</string>
</property>
</widget>
<widget class="QPushButton" name="btnDE">
<property name="geometry">
<rect>
<x>230</x>
<y>120</y>
<width>61</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>DELETE</string>
</property>
</widget>
<widget class="QPushButton" name="btnCancel">
<property name="geometry">
<rect>
<x>230</x>
<y>190</y>
<width>61</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>CANCEL</string>
</property>
</widget>
<widget class="QPushButton" name="btnEnt">
<property name="geometry">
<rect>
<x>230</x>
<y>330</y>
<width>61</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>ENTER</string>
</property>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>60</x>
<y>10</y>
<width>191</width>
<height>41</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>20</pointsize>
</font>
</property>
<property name="text">
<string>Input password</string>
</property>
</widget>
</widget>
<resources/>
<connections/>
</ui>

435
thread.cpp Normal file
View File

@ -0,0 +1,435 @@
#include "camera.h"
#include "thread.h"
#include <QSemaphore>
#include <QDebug>
#include <QDir>
#include <QString>
#include <QQueue>
#include "unistd.h"
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
QSemaphore emptybuff(2); //空缓冲区信号量
QSemaphore fullbuff(0); //正在处理的缓冲区信号量
QMutex judge_connect_mutex;
cv::Mat img_buf1, img_buf2; //抓取图像缓冲区
bool is_first_buf = true; //当前存入图像的缓冲区序号初始化第1个缓冲区
extern int save_flag;
extern bool is_connected;
extern int area_threshold;
extern int delay_time;
extern bool empty_flag;
extern int blow_time;
extern int fd_img;
int fd_result;
bool loss_flag = false;
uint8_t temp_buf[(PULSE_NUMBER - TRIGGER_PULSE_NUMBER)*(VALVE_NUMBER/8)]; //每次处理结果的最后100个脉冲数据暂存
extern void __stdcall onImageDataCallBackFunc(unsigned char * pData, MV_FRAME_OUT_INFO_EX* pFrameInfo, void* pUser)
{
if (pFrameInfo) //帧信息有效
{
cv::Mat img(pFrameInfo->nHeight, pFrameInfo->nWidth, CV_8UC3, pData); //构造图像
if(!emptybuff.tryAcquire()) //申请空缓冲区
{
loss_flag = true;
qDebug()<<"loss loss loss loss loss loss loss loss";
return;
}
if(is_first_buf)
{
img_buf1 = img;
is_first_buf = false; //切换缓冲区
fullbuff.release(); //释放正在处理的缓冲区
//qDebug()<<"_____buffer 1 get data_____";
}
else
{
img_buf2 = img;
is_first_buf = true;
fullbuff.release();
//qDebug()<<"_____buffer 2 get data_____";
}
}
return ;
}
extern void __stdcall onOfflineCallBackFunc(unsigned int nMsgType, void* pUser)
{
qDebug()<<"camera offline";
judge_connect_mutex.lock();
is_connected = false;
judge_connect_mutex.unlock();
return;
}
Process_img::Process_img(QObject *parent) : QThread(parent), m_stop(false)
{
}
void Process_img::run()
{
qDebug()<<"deal thread:"<<QThread::currentThreadId();
int n = fullbuff.available(); //申请处理使用的缓冲区
if(n > 0) //确保为0
{
fullbuff.acquire(n);
}
memset(temp_buf, 0, sizeof(temp_buf));
while(1)
{
stop_mutex.lock(); //是否停止
if(m_stop)
{
stop_mutex.unlock();
qDebug()<<"process thread quit_______________________";
return;
}
stop_mutex.unlock();
if(!fullbuff.tryAcquire())
{
continue;
}
if(is_first_buf)
{
emit send_image(img_buf2); //向主线程发送图片
data_process(img_buf2);
// cv::cvtColor(img_buf2, img_buf2, CV_BGRA2RGB);
// save_img(img_buf2);
emptybuff.release();
}
else
{
emit send_image(img_buf1);
data_process(img_buf1);
// cv::cvtColor(img_buf1, img_buf1, CV_BGRA2RGB);
// save_img(img_buf1);
emptybuff.release();
}
}
}
void Process_img::exitThread()
{
stop_mutex.lock();
m_stop = true;
stop_mutex.unlock();
}
void Process_img::data_process(cv::Mat img)
{
int ret = write(fd_img, img.data, img.rows*img.cols*3*sizeof(unsigned char));
if(ret<0)
{
qDebug()<<"write error";
}
uint8_t buf[1024];
fd_result = open(RESULT_PIPE, O_RDONLY);
if(fd_result != -1)
{
ret = read(fd_result, buf, 1024);
}
close(fd_result);
//qDebug()<<ret;
bad_candy_box bounding_box;
QVector<bad_candy_box> bounding_box_set;
for(int i=0; i<ret; i+=8)
{
uint16_t pointA_x = buf[i];
pointA_x <<= 8;
pointA_x |= buf[i+1];
bounding_box.pointA_x = pointA_x;
uint16_t pointA_y = buf[i+2];
pointA_y <<= 8;
pointA_y |= buf[i+3];
bounding_box.pointA_y = pointA_y;
uint16_t pointB_x = buf[i+4];
pointB_x <<= 8;
pointB_x |= buf[i+5];
bounding_box.pointB_x = pointB_x;
uint16_t pointB_y = buf[i+6];
pointB_y <<= 8;
pointB_y |= buf[i+7];
bounding_box.pointB_y = pointB_y;
bounding_box_set << bounding_box;
}
emit send_res(bounding_box_set);
// if(ret = 0)
// {
// empty_flag = true;
// }
// else
// {
// empty_flag = false;
// }
unsigned char plc_data[PULSE_NUMBER][VALVE_NUMBER];
memset(plc_data, 0, sizeof(plc_data)); //内存清空
for(int i =0; i < bounding_box_set.size(); i++) //循环遍历坐标对
{
int area = abs(bounding_box_set[i].pointB_y - bounding_box_set[i].pointA_y) * abs(bounding_box_set[i].pointB_x - bounding_box_set[i].pointA_x);
if(area< area_threshold)
{
continue;
}
//计算阀序号和起始脉冲
// qDebug() << bounding_box_set[i].pointA_x << bounding_box_set[i].pointB_x;
int valve_index1 = (int)((bounding_box_set[i].pointA_x) / VALVE_INTERVAL);
int valve_index2 = (int)((bounding_box_set[i].pointB_x)/ VALVE_INTERVAL);
//qDebug() << "aaa:" << valve_index1 << valve_index2;
// int temp = VALVE_NUMBER - 1 - valve_index1;
// valve_index1 = VALVE_NUMBER - 1 - valve_index2;
// valve_index2 = temp;
int start = (int)(bounding_box_set[i].pointA_y / TIME_INTERVAL);
int end = (int)(bounding_box_set[i].pointB_y / TIME_INTERVAL);
//qDebug() << "bbb:" << valve_index1 << valve_index2;
// 当3个通道时自动忽略两侧通道
// if(valve_index2 - valve_index1 >1)
// {
// valve_index1++;
// valve_index2 = valve_index1;
// }
// 延长过小的糖果缺陷所需脉冲个数
int defect_size = end - start;
//qDebug()<<blow_time;
if(defect_size < blow_time)
{
int compensation = (blow_time - defect_size) / 2;
// if (start - compensation < 0)
// {
// start = 0;
// }
// else
// {
// start = start - compensation;
// }
// if (end + compensation > (PULSE_NUMBER-1))
// {
// end = PULSE_NUMBER-1;
// }
// else
// {
// end = end + compensation;
// }
if((start - compensation > 0) && ((end + compensation) < PULSE_NUMBER - 1))
{
start = start - compensation;
end = end + compensation;
}
if((start - compensation) < 0)
{
start = 0;
end = end + compensation + (compensation - start);
}
if((end + compensation) > (PULSE_NUMBER - 1))
{
end = PULSE_NUMBER - 1;
start = start - compensation -(compensation - (PULSE_NUMBER - 1 - end));
}
}
//qDebug() << "valve_index1" << valve_index1 << " valve_index2" <<valve_index2 << " start: " << start << " end: " << end;
// 点坐标系变换对应喷阀和脉冲位置1
for(int m = valve_index1; m < valve_index2+1; m++)
{
for(int n = start; n < end; n++)
{
plc_data[n][m] = 1;
}
}
}
uint8_t send_buf[(VALVE_NUMBER/8) * PULSE_NUMBER]; //每8个阀合并一个脉冲时刻40个阀压缩为5个uint8一次图像高度为600个脉冲总共3000个uint8
uint8_t temp = 0x00;
for(int i = 0; i < PULSE_NUMBER; i++)
{
for (int j = (VALVE_NUMBER/8) - 1; j >=0; j--)
{
for(int k = 0; k < 8 ; k++)
temp = (temp << 1) | (plc_data[i][j*8 + k]);
send_buf[i * (VALVE_NUMBER/8) + j] = temp;
}
}
for(int i=0; i < (PULSE_NUMBER - TRIGGER_PULSE_NUMBER)*(VALVE_NUMBER/8); i++) //这次图像的前100个脉冲与上次图像的后100脉冲取或运算合并重合部分的两次处理结果
{
send_buf[i] &= temp_buf[i];
}
memcpy(temp_buf, &send_buf[TRIGGER_PULSE_NUMBER*(VALVE_NUMBER/8)], (PULSE_NUMBER - TRIGGER_PULSE_NUMBER)*(VALVE_NUMBER/8)); //保存这次成像的后100脉冲处理结果
emit send_tab(send_buf); //通知主线程向下位机发送结果
}
void Process_img::save_img(cv::Mat img)
{
QDateTime time = QDateTime::currentDateTime();
QString str = time.toString("yyyyMMddhhmmss");
QString filepath = SAVE_IMAGE_PATH + str + ".bmp";
cv::imwrite(filepath.toLatin1().data(), img);
}
Adjust_para::Adjust_para(QObject *parent) : QThread(parent), m_stop(false), correct_flag(false)
{
}
void Adjust_para::run()
{
int n = fullbuff.available();
if(n > 0)
{
fullbuff.acquire(n);
}
while(1)
{
stop_mutex.lock();
if(m_stop)
{
stop_mutex.unlock();
return;
}
stop_mutex.unlock();
if(!fullbuff.tryAcquire())
{
continue;
}
if(is_first_buf)
{
emit send_image_debug(img_buf2);
correct_mutex.lock();
if(correct_flag)
{
cv::imwrite("./correct.bmp", img_buf2);
correct_flag = false;
}
correct_mutex.unlock();
emptybuff.release();
}
else
{
emit send_image_debug(img_buf1);
correct_mutex.lock();
if(correct_flag)
{
cv::imwrite("./correct.bmp", img_buf1);
correct_flag = false;
}
correct_mutex.unlock();
emptybuff.release();
}
}
}
void Adjust_para::exitThread()
{
stop_mutex.lock();
m_stop = true;
stop_mutex.unlock();
}
void Adjust_para::get_correct_siganl()
{
correct_mutex.lock();
correct_flag = true;
correct_mutex.unlock();
}
//test_thread
Grab_img::Grab_img(QObject *parent) : QThread(parent)
{
is_stop = false;
}
void Grab_img::run()
{
int n = emptybuff.available();
if(n < 2)
{
emptybuff.release(2 - n);
}
while (1)
{
stop_mutex.lock();
if(is_stop)
{
stop_mutex.unlock();
qDebug()<<"grab thread will exit";
return;
}
stop_mutex.unlock();
if(!emptybuff.tryAcquire())
{
continue;
}
if(is_first_buf)
{
char file_name[128] = "20220524085547.bmp";
char test_img_path[128] = TEST_IMAGE_PATH;
strcat(test_img_path, file_name);
img_buf1 = cv::imread(test_img_path, 1);
is_first_buf = false;
fullbuff.release();
}
else
{
char file_name[128] = "20220524091200.bmp";
char test_img_path[128] = TEST_IMAGE_PATH;
strcat(test_img_path, file_name);
img_buf2 = cv::imread(test_img_path, 1);
is_first_buf = true;
fullbuff.release();
}
msleep(200);
}
}
void Grab_img::thread_quit()
{
stop_mutex.lock();
is_stop = true;
stop_mutex.unlock();
}

108
thread.h Normal file
View File

@ -0,0 +1,108 @@
#ifndef THREAD_H
#define THREAD_H
#include <QThread>
#include "opencv2/opencv.hpp"
#include <QMutex>
#include <QVector>
#include <QDateTime>
#include <QTime>
#define SAVE_IMAGE_PATH "/home/nvidia/candyPic/"
#define TEST_IMAGE_PATH "/home/nvidia/testImg/"
#define CONFIG_PATH "/home/nvidia/CandyProject/candy/para.ini"
#define CAMERA_CONFIG_PATH "/home/nvidia/CandyProject/candy/ccc.mfs"
#define RESULT_PATH "/home/nvidia/result/"
#define MODEL_INFO_PATH "/home/nvidia/CandyProject/yolov5/weights/model_info.txt"
#define CUR_MODEL_PATH "/home/nvidia/CandyProject/yolov5/weights/current_model.txt"
#define MODEL_PATH "/home/nvidia/CandyProject/yolov5/weights/"
#define VALVE_INTERVAL 49.5f // 2376(像素) / 48(喷阀个数)
#define TIME_INTERVAL 0.932f // 每个脉冲对应的像素个数 计算方法:图片像素数/对应脉冲数
#define IMG_SAVE_PATH "./images5/%d.bmp" //路径自己指定,必须存在
#define PULSE_NUMBER 626 // 一张图片占据648个编码器脉冲
#define TRIGGER_PULSE_NUMBER 500 // 相机每隔500个脉冲触发一次若修改则需要联系下位机
#define VALVE_NUMBER 48 // 喷阀个数(必须是8的倍数)
// 识别相关
#define SMALL_DEFECT_SIZE 170 // 当缺陷长度小于该值时自动补齐到EXPAND_SIZE
#define EXPAND_SIZE 170 // 将缺陷区域的大小以原位置为中心向上下延长到EXPAND_SIZE
#define RESULT_PIPE "/tmp/result_fifo.pipe"
typedef struct
{
int pointA_x;
int pointA_y;
int pointB_x;
int pointB_y;
}bad_candy_box;
class Process_img: public QThread
{ Q_OBJECT
private:
QMutex stop_mutex;
bool m_stop;
protected:
void run();
public:
explicit Process_img(QObject *parent = NULL);
void exitThread();
void data_process(cv::Mat img);
void save_img(cv::Mat img);
signals:
void send_image(cv::Mat);
void send_res(QVector<bad_candy_box>);
void send_tab(uint8_t*);
};
class Adjust_para: public QThread
{ Q_OBJECT
private:
QMutex stop_mutex;
bool m_stop;
bool correct_flag;
QMutex correct_mutex;
protected:
void run();
public:
explicit Adjust_para(QObject *parent = NULL);
void exitThread();
public slots:
void get_correct_siganl();
signals:
void send_image_debug(cv::Mat);
};
//test_thread
class Grab_img: public QThread
{ Q_OBJECT
private:
QMutex stop_mutex;
bool is_stop;
public:
explicit Grab_img(QObject *parent = NULL);
void judge_stop();
void thread_quit();
protected:
void run();
};
#endif // THREAD_H

BIN
thread.o Normal file

Binary file not shown.

70
ui_initwidget.h Normal file
View File

@ -0,0 +1,70 @@
/********************************************************************************
** Form generated from reading UI file 'initwidget.ui'
**
** Created by: Qt User Interface Compiler version 4.8.7
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_INITWIDGET_H
#define UI_INITWIDGET_H
#include <QtCore/QVariant>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QButtonGroup>
#include <QtGui/QHeaderView>
#include <QtGui/QLabel>
#include <QtGui/QWidget>
QT_BEGIN_NAMESPACE
class Ui_InitWidget
{
public:
QLabel *label;
QLabel *label_2;
void setupUi(QWidget *InitWidget)
{
if (InitWidget->objectName().isEmpty())
InitWidget->setObjectName(QString::fromUtf8("InitWidget"));
InitWidget->resize(1024, 768);
label = new QLabel(InitWidget);
label->setObjectName(QString::fromUtf8("label"));
label->setGeometry(QRect(130, 80, 741, 220));
QFont font;
font.setPointSize(36);
label->setFont(font);
label->setAlignment(Qt::AlignCenter);
label_2 = new QLabel(InitWidget);
label_2->setObjectName(QString::fromUtf8("label_2"));
label_2->setGeometry(QRect(342, 656, 340, 71));
QFont font1;
font1.setPointSize(21);
label_2->setFont(font1);
label_2->setAlignment(Qt::AlignCenter);
retranslateUi(InitWidget);
QMetaObject::connectSlotsByName(InitWidget);
} // setupUi
void retranslateUi(QWidget *InitWidget)
{
InitWidget->setWindowTitle(QApplication::translate("InitWidget", "Form", 0, QApplication::UnicodeUTF8));
label->setText(QApplication::translate("InitWidget", "\345\215\227\351\200\232\347\273\264\345\260\224\346\226\257\346\234\272\346\242\260\347\247\221\346\212\200\346\234\211\351\231\220\345\205\254\345\217\270\n"
"Nantong Wealth Technical Co, Ltd", 0, QApplication::UnicodeUTF8));
label_2->setText(QApplication::translate("InitWidget", "\347\263\273\347\273\237\345\210\235\345\247\213\345\214\226\344\270\255...\n"
"Initialization...", 0, QApplication::UnicodeUTF8));
} // retranslateUi
};
namespace Ui {
class InitWidget: public Ui_InitWidget {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_INITWIDGET_H

161
ui_modifypasswdialog.h Normal file
View File

@ -0,0 +1,161 @@
/********************************************************************************
** Form generated from reading UI file 'modifypasswdialog.ui'
**
** Created by: Qt User Interface Compiler version 4.8.7
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_MODIFYPASSWDIALOG_H
#define UI_MODIFYPASSWDIALOG_H
#include <QtCore/QVariant>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QButtonGroup>
#include <QtGui/QDialog>
#include <QtGui/QHeaderView>
#include <QtGui/QLabel>
#include <QtGui/QLineEdit>
#include <QtGui/QPushButton>
QT_BEGIN_NAMESPACE
class Ui_ModifyPasswdialog
{
public:
QLineEdit *lineEdit;
QLabel *label;
QPushButton *btn9;
QPushButton *btn4;
QPushButton *btnDot;
QPushButton *btn3;
QPushButton *btn6;
QPushButton *btnCL;
QPushButton *btn0;
QPushButton *btn8;
QPushButton *btnEnt;
QPushButton *btn2;
QPushButton *btn7;
QPushButton *btn1;
QPushButton *btn5;
QPushButton *btnDE;
QPushButton *btnCancel;
QLineEdit *lineEdit_2;
QLabel *label_2;
QLabel *label_3;
void setupUi(QDialog *ModifyPasswdialog)
{
if (ModifyPasswdialog->objectName().isEmpty())
ModifyPasswdialog->setObjectName(QString::fromUtf8("ModifyPasswdialog"));
ModifyPasswdialog->resize(348, 432);
lineEdit = new QLineEdit(ModifyPasswdialog);
lineEdit->setObjectName(QString::fromUtf8("lineEdit"));
lineEdit->setGeometry(QRect(10, 60, 221, 31));
lineEdit->setMaxLength(6);
lineEdit->setAlignment(Qt::AlignCenter);
label = new QLabel(ModifyPasswdialog);
label->setObjectName(QString::fromUtf8("label"));
label->setGeometry(QRect(60, 10, 191, 41));
QFont font;
font.setPointSize(20);
label->setFont(font);
btn9 = new QPushButton(ModifyPasswdialog);
btn9->setObjectName(QString::fromUtf8("btn9"));
btn9->setGeometry(QRect(160, 290, 51, 51));
btn4 = new QPushButton(ModifyPasswdialog);
btn4->setObjectName(QString::fromUtf8("btn4"));
btn4->setGeometry(QRect(20, 220, 51, 51));
btnDot = new QPushButton(ModifyPasswdialog);
btnDot->setObjectName(QString::fromUtf8("btnDot"));
btnDot->setGeometry(QRect(90, 360, 51, 51));
btn3 = new QPushButton(ModifyPasswdialog);
btn3->setObjectName(QString::fromUtf8("btn3"));
btn3->setGeometry(QRect(160, 150, 51, 51));
btn6 = new QPushButton(ModifyPasswdialog);
btn6->setObjectName(QString::fromUtf8("btn6"));
btn6->setGeometry(QRect(160, 220, 51, 51));
btnCL = new QPushButton(ModifyPasswdialog);
btnCL->setObjectName(QString::fromUtf8("btnCL"));
btnCL->setGeometry(QRect(230, 290, 61, 51));
btn0 = new QPushButton(ModifyPasswdialog);
btn0->setObjectName(QString::fromUtf8("btn0"));
btn0->setGeometry(QRect(20, 360, 51, 51));
btn8 = new QPushButton(ModifyPasswdialog);
btn8->setObjectName(QString::fromUtf8("btn8"));
btn8->setGeometry(QRect(90, 290, 51, 51));
btnEnt = new QPushButton(ModifyPasswdialog);
btnEnt->setObjectName(QString::fromUtf8("btnEnt"));
btnEnt->setGeometry(QRect(230, 360, 61, 51));
btn2 = new QPushButton(ModifyPasswdialog);
btn2->setObjectName(QString::fromUtf8("btn2"));
btn2->setGeometry(QRect(90, 150, 51, 51));
btn7 = new QPushButton(ModifyPasswdialog);
btn7->setObjectName(QString::fromUtf8("btn7"));
btn7->setGeometry(QRect(20, 290, 51, 51));
btn1 = new QPushButton(ModifyPasswdialog);
btn1->setObjectName(QString::fromUtf8("btn1"));
btn1->setGeometry(QRect(20, 150, 51, 51));
btn5 = new QPushButton(ModifyPasswdialog);
btn5->setObjectName(QString::fromUtf8("btn5"));
btn5->setGeometry(QRect(90, 220, 51, 51));
btnDE = new QPushButton(ModifyPasswdialog);
btnDE->setObjectName(QString::fromUtf8("btnDE"));
btnDE->setGeometry(QRect(230, 150, 61, 51));
btnCancel = new QPushButton(ModifyPasswdialog);
btnCancel->setObjectName(QString::fromUtf8("btnCancel"));
btnCancel->setGeometry(QRect(230, 220, 61, 51));
lineEdit_2 = new QLineEdit(ModifyPasswdialog);
lineEdit_2->setObjectName(QString::fromUtf8("lineEdit_2"));
lineEdit_2->setGeometry(QRect(10, 100, 221, 31));
lineEdit_2->setMaxLength(6);
lineEdit_2->setAlignment(Qt::AlignCenter);
label_2 = new QLabel(ModifyPasswdialog);
label_2->setObjectName(QString::fromUtf8("label_2"));
label_2->setGeometry(QRect(240, 60, 81, 31));
QFont font1;
font1.setPointSize(17);
label_2->setFont(font1);
label_3 = new QLabel(ModifyPasswdialog);
label_3->setObjectName(QString::fromUtf8("label_3"));
label_3->setGeometry(QRect(240, 100, 101, 31));
label_3->setFont(font1);
retranslateUi(ModifyPasswdialog);
QMetaObject::connectSlotsByName(ModifyPasswdialog);
} // setupUi
void retranslateUi(QDialog *ModifyPasswdialog)
{
ModifyPasswdialog->setWindowTitle(QApplication::translate("ModifyPasswdialog", "Dialog", 0, QApplication::UnicodeUTF8));
label->setText(QApplication::translate("ModifyPasswdialog", "Input Password", 0, QApplication::UnicodeUTF8));
btn9->setText(QApplication::translate("ModifyPasswdialog", "9", 0, QApplication::UnicodeUTF8));
btn4->setText(QApplication::translate("ModifyPasswdialog", "4", 0, QApplication::UnicodeUTF8));
btnDot->setText(QApplication::translate("ModifyPasswdialog", ".", 0, QApplication::UnicodeUTF8));
btn3->setText(QApplication::translate("ModifyPasswdialog", "3", 0, QApplication::UnicodeUTF8));
btn6->setText(QApplication::translate("ModifyPasswdialog", "6", 0, QApplication::UnicodeUTF8));
btnCL->setText(QApplication::translate("ModifyPasswdialog", "CLEAR", 0, QApplication::UnicodeUTF8));
btn0->setText(QApplication::translate("ModifyPasswdialog", "0", 0, QApplication::UnicodeUTF8));
btn8->setText(QApplication::translate("ModifyPasswdialog", "8", 0, QApplication::UnicodeUTF8));
btnEnt->setText(QApplication::translate("ModifyPasswdialog", "ENTER", 0, QApplication::UnicodeUTF8));
btn2->setText(QApplication::translate("ModifyPasswdialog", "2", 0, QApplication::UnicodeUTF8));
btn7->setText(QApplication::translate("ModifyPasswdialog", "7", 0, QApplication::UnicodeUTF8));
btn1->setText(QApplication::translate("ModifyPasswdialog", "1", 0, QApplication::UnicodeUTF8));
btn5->setText(QApplication::translate("ModifyPasswdialog", "5", 0, QApplication::UnicodeUTF8));
btnDE->setText(QApplication::translate("ModifyPasswdialog", "DELETE", 0, QApplication::UnicodeUTF8));
btnCancel->setText(QApplication::translate("ModifyPasswdialog", "CANCEL", 0, QApplication::UnicodeUTF8));
label_2->setText(QApplication::translate("ModifyPasswdialog", "NEW", 0, QApplication::UnicodeUTF8));
label_3->setText(QApplication::translate("ModifyPasswdialog", "CONFIRM", 0, QApplication::UnicodeUTF8));
} // retranslateUi
};
namespace Ui {
class ModifyPasswdialog: public Ui_ModifyPasswdialog {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_MODIFYPASSWDIALOG_H

141
ui_passwddialog.h Normal file
View File

@ -0,0 +1,141 @@
/********************************************************************************
** Form generated from reading UI file 'passwddialog.ui'
**
** Created by: Qt User Interface Compiler version 4.8.7
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_PASSWDDIALOG_H
#define UI_PASSWDDIALOG_H
#include <QtCore/QVariant>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QButtonGroup>
#include <QtGui/QDialog>
#include <QtGui/QHeaderView>
#include <QtGui/QLabel>
#include <QtGui/QLineEdit>
#include <QtGui/QPushButton>
QT_BEGIN_NAMESPACE
class Ui_PasswdDialog
{
public:
QPushButton *btn1;
QPushButton *btn2;
QPushButton *btn0;
QPushButton *btnDot;
QPushButton *btn5;
QPushButton *btn8;
QPushButton *btn6;
QPushButton *btn4;
QPushButton *btn7;
QLineEdit *lineEdit;
QPushButton *btnCL;
QPushButton *btn3;
QPushButton *btn9;
QPushButton *btnDE;
QPushButton *btnCancel;
QPushButton *btnEnt;
QLabel *label;
void setupUi(QDialog *PasswdDialog)
{
if (PasswdDialog->objectName().isEmpty())
PasswdDialog->setObjectName(QString::fromUtf8("PasswdDialog"));
PasswdDialog->resize(300, 433);
btn1 = new QPushButton(PasswdDialog);
btn1->setObjectName(QString::fromUtf8("btn1"));
btn1->setGeometry(QRect(20, 120, 51, 51));
btn2 = new QPushButton(PasswdDialog);
btn2->setObjectName(QString::fromUtf8("btn2"));
btn2->setGeometry(QRect(90, 120, 51, 51));
btn0 = new QPushButton(PasswdDialog);
btn0->setObjectName(QString::fromUtf8("btn0"));
btn0->setGeometry(QRect(20, 330, 51, 51));
btnDot = new QPushButton(PasswdDialog);
btnDot->setObjectName(QString::fromUtf8("btnDot"));
btnDot->setGeometry(QRect(90, 330, 51, 51));
btn5 = new QPushButton(PasswdDialog);
btn5->setObjectName(QString::fromUtf8("btn5"));
btn5->setGeometry(QRect(90, 190, 51, 51));
btn8 = new QPushButton(PasswdDialog);
btn8->setObjectName(QString::fromUtf8("btn8"));
btn8->setGeometry(QRect(90, 260, 51, 51));
btn6 = new QPushButton(PasswdDialog);
btn6->setObjectName(QString::fromUtf8("btn6"));
btn6->setGeometry(QRect(160, 190, 51, 51));
btn4 = new QPushButton(PasswdDialog);
btn4->setObjectName(QString::fromUtf8("btn4"));
btn4->setGeometry(QRect(20, 190, 51, 51));
btn7 = new QPushButton(PasswdDialog);
btn7->setObjectName(QString::fromUtf8("btn7"));
btn7->setGeometry(QRect(20, 260, 51, 51));
lineEdit = new QLineEdit(PasswdDialog);
lineEdit->setObjectName(QString::fromUtf8("lineEdit"));
lineEdit->setGeometry(QRect(10, 60, 281, 31));
lineEdit->setMaxLength(6);
lineEdit->setAlignment(Qt::AlignCenter);
btnCL = new QPushButton(PasswdDialog);
btnCL->setObjectName(QString::fromUtf8("btnCL"));
btnCL->setGeometry(QRect(230, 260, 61, 51));
btn3 = new QPushButton(PasswdDialog);
btn3->setObjectName(QString::fromUtf8("btn3"));
btn3->setGeometry(QRect(160, 120, 51, 51));
btn9 = new QPushButton(PasswdDialog);
btn9->setObjectName(QString::fromUtf8("btn9"));
btn9->setGeometry(QRect(160, 260, 51, 51));
btnDE = new QPushButton(PasswdDialog);
btnDE->setObjectName(QString::fromUtf8("btnDE"));
btnDE->setGeometry(QRect(230, 120, 61, 51));
btnCancel = new QPushButton(PasswdDialog);
btnCancel->setObjectName(QString::fromUtf8("btnCancel"));
btnCancel->setGeometry(QRect(230, 190, 61, 51));
btnEnt = new QPushButton(PasswdDialog);
btnEnt->setObjectName(QString::fromUtf8("btnEnt"));
btnEnt->setGeometry(QRect(230, 330, 61, 51));
label = new QLabel(PasswdDialog);
label->setObjectName(QString::fromUtf8("label"));
label->setGeometry(QRect(60, 10, 191, 41));
QFont font;
font.setPointSize(20);
label->setFont(font);
retranslateUi(PasswdDialog);
QMetaObject::connectSlotsByName(PasswdDialog);
} // setupUi
void retranslateUi(QDialog *PasswdDialog)
{
PasswdDialog->setWindowTitle(QApplication::translate("PasswdDialog", "Dialog", 0, QApplication::UnicodeUTF8));
btn1->setText(QApplication::translate("PasswdDialog", "1", 0, QApplication::UnicodeUTF8));
btn2->setText(QApplication::translate("PasswdDialog", "2", 0, QApplication::UnicodeUTF8));
btn0->setText(QApplication::translate("PasswdDialog", "0", 0, QApplication::UnicodeUTF8));
btnDot->setText(QApplication::translate("PasswdDialog", ".", 0, QApplication::UnicodeUTF8));
btn5->setText(QApplication::translate("PasswdDialog", "5", 0, QApplication::UnicodeUTF8));
btn8->setText(QApplication::translate("PasswdDialog", "8", 0, QApplication::UnicodeUTF8));
btn6->setText(QApplication::translate("PasswdDialog", "6", 0, QApplication::UnicodeUTF8));
btn4->setText(QApplication::translate("PasswdDialog", "4", 0, QApplication::UnicodeUTF8));
btn7->setText(QApplication::translate("PasswdDialog", "7", 0, QApplication::UnicodeUTF8));
btnCL->setText(QApplication::translate("PasswdDialog", "CLEAR", 0, QApplication::UnicodeUTF8));
btn3->setText(QApplication::translate("PasswdDialog", "3", 0, QApplication::UnicodeUTF8));
btn9->setText(QApplication::translate("PasswdDialog", "9", 0, QApplication::UnicodeUTF8));
btnDE->setText(QApplication::translate("PasswdDialog", "DELETE", 0, QApplication::UnicodeUTF8));
btnCancel->setText(QApplication::translate("PasswdDialog", "CANCEL", 0, QApplication::UnicodeUTF8));
btnEnt->setText(QApplication::translate("PasswdDialog", "ENTER", 0, QApplication::UnicodeUTF8));
label->setText(QApplication::translate("PasswdDialog", "Input password", 0, QApplication::UnicodeUTF8));
} // retranslateUi
};
namespace Ui {
class PasswdDialog: public Ui_PasswdDialog {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_PASSWDDIALOG_H

1478
ui_widget.h Normal file

File diff suppressed because it is too large Load Diff

1466
widget.cpp Normal file

File diff suppressed because it is too large Load Diff

155
widget.h Normal file
View File

@ -0,0 +1,155 @@
#ifndef WIDGET_H
#define WIDGET_H
#include <QWidget>
#include "passwddialog.h"
#include "modifypasswdialog.h"
#include <opencv2/opencv.hpp>
#include <QPixmap>
#include <QTcpServer>
#include <QTcpSocket>
#include "thread.h"
#include "camera.h"
#include "correct.h"
//#define DEBUG
typedef struct
{
char passwd[7]; //密码
int delay; //延时时间
int defect_area; //缺陷大小阈值
int blow_time; //吹气量
int save_img; //保是否存图片标志位
int rigorous;
}Para;
typedef struct
{
QString name;
int index;
}Models;
namespace Ui {
class Widget;
}
class Widget : public QWidget
{
Q_OBJECT
public:
explicit Widget(QWidget *parent = 0);
~Widget();
private slots:
//button
//Tab_1
void On_btn_Tab1_2_click();
void On_btn_Tab1_3_click();
//Tab_2
void On_btnStart_click();
void On_bthStop_click();
void On_btn_Tab2_1_click();
void On_btn_Tab2_5_click();
//Tab_3
void On_btnValveTest_click();
void On_btn_Tab3_1_click();
void On_btn_Tab3_4_click();
void On_btn_Tab3_6_click();
void On_btnImportImg_click();
void On_btnSaveImg_click();
void On_btnImportModel_click();
void On_btnModifyPasswd_click();
//Tab_4
void On_btn_correct_click();
void On_btn_getcorrect_click();
void On_btn_setcamerapara_click();
void On_btn_Tab4_3_click();
//Tab_5
void On_btn_Tab5_3_click();
void On_btn_set_thereshold_click();
//Tab_6
void On_btn_Tab6_3_click();
void On_btn_close_click();
void On_candy_select_box_index_change(int);
void On_btnManualValveTest();
void On_btn_Tab7_3_click();
void On_btnchannelup_click();
void On_btnchanneldown_click();
void On_btn_channel_send_clicked();
void judge_password(QString);
void modify_password(QString);
void showimage(cv::Mat);
void drawbox(QVector<bad_candy_box>);
void showimage_test(cv::Mat);
//void deal_camera_offline();
void ServerNewConnection();
void get_tab(uint8_t*);
void On_btn1_clicked();
void On_btn2_clicked();
void On_btn3_clicked();
void On_btn4_clicked();
void On_btn5_clicked();
void On_btn6_clicked();
void On_btn7_clicked();
void On_btn8_clicked();
void On_btn9_clicked();
void On_btn0_clicked();
void On_btn_DEL_clicked();
// void On_btn_1_clicked();
// void On_btn_2_clicked();
// void On_btn_3_clicked();
// void On_btn_4_clicked();
// void On_btn_5_clicked();
// void On_btn_6_clicked();
// void On_btn_7_clicked();
// void On_btn_8_clicked();
// void On_btn_9_clicked();
// void On_btn_0_clicked();
// void On_btn_dot_clicked();
// void On_btn_del_clicked();
// void On_btn_clr_clicked();
private:
Ui::Widget *ui;
PasswdDialog* passwd_dialog;
ModifyPasswdialog* modify_passwd_dialog;
QPixmap pix;
QPixmap pix_test;
Process_img* process_img;
Adjust_para* adjust_para;
Camera* m_camera;
QVector<Models> models_vector;
//Correct* m_correct;
QTcpServer* server;
QTcpSocket* socket;
Correct* m_correct;
char passwd[7];
int channel;
#ifdef DEBUG
cv::Mat defect_pic;
#endif
Grab_img* grab_img;//test_thread
void connect_signals();
void init_window();
bool init_script();
bool select_candy();
void load_para_config();
void set_candy_select_box();
signals:
void correct_signal();
void wrong_passwd();
};
#endif // WIDGET_H

BIN
widget.o Normal file

Binary file not shown.

7795
widget.ui Normal file

File diff suppressed because it is too large Load Diff