1、增加型号名修改,同步修改模板识别型号名和气门芯定位型号名
2、气门芯定位标定页面调整,修改参数增加自动刷新功能 3、气门芯定位检测算法增加圆心偏移参数阈值设置功能,开放到调参页面 4、增加ROI圆心坐标设置功能master
parent
7e5d572e21
commit
b450f4e040
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,14 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by lpCoreCtrl.rc
|
||||
|
||||
// 新对象的下一组默认值
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 101
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1001
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
Binary file not shown.
Binary file not shown.
@ -0,0 +1,14 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by lpbengine.rc
|
||||
|
||||
// 新对象的下一组默认值
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 101
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1001
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
@ -0,0 +1,24 @@
|
||||
#ifndef _QSETCENTERDLG_H_
|
||||
#define _QSETCENTERDLG_H_
|
||||
|
||||
#include <QDialog>
|
||||
#include "ui_QSetCenterDlg.h"
|
||||
|
||||
class QSetCenterDlg : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QSetCenterDlg(QWidget *parent = Q_NULLPTR);
|
||||
~QSetCenterDlg();
|
||||
void setCenter(double x, double y);
|
||||
void getCenter(double &x, double &y);
|
||||
void setRange(QRect rect, QPointF imgSize);
|
||||
Q_SLOT void onButtonClicked();
|
||||
private:
|
||||
Ui::QSetCenterDlg ui;
|
||||
QRect m_ItemRect;
|
||||
QPointF m_ImgSize;
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,76 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>QSetCenterDlg</class>
|
||||
<widget class="QDialog" name="QSetCenterDlg">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>209</width>
|
||||
<height>100</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>圆心坐标设置</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetFixedSize</enum>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>圆心X坐标</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit">
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>圆心Y坐标</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_2">
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="text">
|
||||
<string>确定</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_2">
|
||||
<property name="text">
|
||||
<string>取消</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,14 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by lpdesigner1.rc
|
||||
|
||||
// 新对象的下一组默认值
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 101
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1001
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
@ -0,0 +1,129 @@
|
||||
#ifndef _H_DUMPFILE_H_
|
||||
#define _H_DUMPFILE_H_
|
||||
|
||||
/*!
|
||||
*FileName: dumpfile.h
|
||||
*Author: Pan Yingdong
|
||||
*Email: bob.pan@hzleaper.com
|
||||
*Created:2020/5/19 16:02
|
||||
*Note:
|
||||
*/
|
||||
#include <windows.h>
|
||||
#include <Dbghelp.h>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <tchar.h>
|
||||
#include <iomanip>
|
||||
#include <ctime>
|
||||
#include <chrono>
|
||||
|
||||
using namespace std;
|
||||
using namespace std::chrono;
|
||||
|
||||
#pragma comment(lib, "Dbghelp.lib")
|
||||
|
||||
namespace NSDumpFile
|
||||
{
|
||||
void CreateDumpFile(LPCWSTR lpstrDumpFilePathName, EXCEPTION_POINTERS *pException)
|
||||
{
|
||||
// 创建Dump文件
|
||||
//
|
||||
HANDLE hDumpFile = CreateFile(lpstrDumpFilePathName, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
|
||||
|
||||
// Dump信息
|
||||
//
|
||||
MINIDUMP_EXCEPTION_INFORMATION dumpInfo;
|
||||
dumpInfo.ExceptionPointers = pException;
|
||||
dumpInfo.ThreadId = GetCurrentThreadId();
|
||||
dumpInfo.ClientPointers = TRUE;
|
||||
|
||||
|
||||
// 写入Dump文件内容
|
||||
//
|
||||
MiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), hDumpFile, MiniDumpNormal, &dumpInfo, NULL, NULL);
|
||||
|
||||
|
||||
CloseHandle(hDumpFile);
|
||||
}
|
||||
|
||||
|
||||
LPTOP_LEVEL_EXCEPTION_FILTER WINAPI MyDummySetUnhandledExceptionFilter(LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
BOOL PreventSetUnhandledExceptionFilter()
|
||||
{
|
||||
HMODULE hKernel32 = LoadLibrary(_T("kernel32.dll"));
|
||||
if (hKernel32 == NULL)
|
||||
return FALSE;
|
||||
|
||||
|
||||
void *pOrgEntry = GetProcAddress(hKernel32, "SetUnhandledExceptionFilter");
|
||||
if (pOrgEntry == NULL)
|
||||
return FALSE;
|
||||
|
||||
|
||||
unsigned char newJump[100];
|
||||
DWORD dwOrgEntryAddr = (DWORD)pOrgEntry;
|
||||
dwOrgEntryAddr += 5; // add 5 for 5 op-codes for jmp far
|
||||
|
||||
|
||||
void *pNewFunc = &MyDummySetUnhandledExceptionFilter;
|
||||
DWORD dwNewEntryAddr = (DWORD)pNewFunc;
|
||||
DWORD dwRelativeAddr = dwNewEntryAddr - dwOrgEntryAddr;
|
||||
|
||||
|
||||
newJump[0] = 0xE9; // JMP absolute
|
||||
memcpy(&newJump[1], &dwRelativeAddr, sizeof(pNewFunc));
|
||||
SIZE_T bytesWritten;
|
||||
BOOL bRet = WriteProcessMemory(GetCurrentProcess(), pOrgEntry, newJump, sizeof(pNewFunc) + 1, &bytesWritten);
|
||||
return bRet;
|
||||
}
|
||||
|
||||
LONG WINAPI UnhandledExceptionFilterEx(struct _EXCEPTION_POINTERS *pException)
|
||||
{
|
||||
TCHAR szMbsFile[MAX_PATH] = { 0 };
|
||||
::GetModuleFileName(NULL, szMbsFile, MAX_PATH);
|
||||
TCHAR* pFind = _tcsrchr(szMbsFile, '\\');
|
||||
if (pFind)
|
||||
{
|
||||
*(pFind + 1) = 0;
|
||||
|
||||
char buffer[80];
|
||||
time_t rawtime;
|
||||
struct tm info;
|
||||
time(&rawtime);
|
||||
localtime_s(&info, &rawtime);
|
||||
TCHAR szMbsFile[MAX_PATH] = { 0 };
|
||||
strftime(buffer, 80, "%Y-%m-%d %H-%M-%S", &info);
|
||||
std::string strName = buffer;
|
||||
strName += ".dmp";
|
||||
_stprintf_s(szMbsFile, MAX_PATH, _T("%S"), strName.c_str());
|
||||
CreateDumpFile(szMbsFile, pException);
|
||||
}
|
||||
|
||||
|
||||
// TODO: MiniDumpWriteDump
|
||||
FatalAppExit(-1, _T("Fatal Error"));
|
||||
return EXCEPTION_CONTINUE_SEARCH;
|
||||
}
|
||||
|
||||
|
||||
void RunCrashHandler()
|
||||
{
|
||||
SetUnhandledExceptionFilter(UnhandledExceptionFilterEx);
|
||||
PreventSetUnhandledExceptionFilter();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#define DeclareDumpFile() NSDumpFile::RunCrashHandler();
|
||||
/*
|
||||
使用方法
|
||||
在main文件中添加头文件
|
||||
main函数中调用DeclareDumpFile()即可
|
||||
*/
|
||||
#endif
|
||||
Loading…
Reference in New Issue