合并代码,添加100 3399 110 ppm
This commit is contained in:
commit
d6ef2e7fcf
|
@ -8,6 +8,10 @@
|
|||
2021年7月31日
|
||||
1.增加3399 板子g100 g200 校正及配置功能
|
||||
|
||||
2021年9月14日
|
||||
1、增加G300/G400速率可配置
|
||||
2、处理G300/G400不能出图问题
|
||||
|
||||
2021年8月17日
|
||||
1. 界面增加速度模式配置功能;
|
||||
2. 增加明场暗场校正最大明场值配置;
|
||||
|
|
|
@ -60,6 +60,13 @@ BOOL CA3::OnInitDialog()
|
|||
{
|
||||
m_cmbSpeedmode.InsertString(i, speedmodeMapString[i]);
|
||||
}
|
||||
speedemodelen = speedmodeMap.size() + G300G400speedmodeMapString.size();
|
||||
size_t j = 1;
|
||||
for (size_t i = speedmodeMap.size(); i < speedemodelen; i++)
|
||||
{
|
||||
m_cmbSpeedmode.InsertString(i, G300G400speedmodeMapString[j]);
|
||||
++j;
|
||||
}
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
// 异常: OCX 属性页应返回 FALSE
|
||||
}
|
||||
|
@ -288,12 +295,20 @@ void CA3::updatespeedmode(bool get)
|
|||
auto parent = (CHuaGoCorrectDlg*)GetParent();
|
||||
if (parent != NULL)
|
||||
{
|
||||
if (parent->m_drv.get() && parent->m_drv->IsConnected()) {
|
||||
if (parent->m_drv.get() && parent->m_drv->IsConnected())
|
||||
{
|
||||
int speedmode;
|
||||
std::string ver = parent->m_drv->GetFWVersion();
|
||||
if (!ver.empty())
|
||||
{
|
||||
ver = ver.substr(0, 2);
|
||||
}
|
||||
if (get)
|
||||
{
|
||||
parent->m_drv->GetSpeedMode(speedmode, true);
|
||||
bool bfound = false;
|
||||
if (ver != "G3" && ver != "G4")
|
||||
{
|
||||
for (size_t i = 0; i < speedmodeMap.size(); i++)
|
||||
{
|
||||
if (speedmodeMap[i].Speedmode == speedmode)
|
||||
|
@ -305,18 +320,52 @@ void CA3::updatespeedmode(bool get)
|
|||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
size_t j = 1;
|
||||
for (size_t i = speedmodeMap.size(); i < speedemodelen; i++)
|
||||
{
|
||||
if (j == speedmode)
|
||||
{
|
||||
m_cmbSpeedmode.SetCurSel(i);
|
||||
bfound = true;
|
||||
break;
|
||||
}
|
||||
++j;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!bfound)
|
||||
MessageBox(L"未找到对应的速度模式!", L"提示", MB_OK | MB_ICONINFORMATION);
|
||||
}
|
||||
else
|
||||
{
|
||||
int cmbindex = m_cmbSpeedmode.GetCurSel();
|
||||
if (cmbindex != -1)
|
||||
if (cmbindex != -1 && cmbindex < speedmodeMap.size())
|
||||
{
|
||||
if (ver == "G3" || ver == "G4")
|
||||
{
|
||||
MessageBox(L"设备序列号前两位为G3/G4,请确认设备!", L"速率选择错误", MB_OK | MB_ICONINFORMATION);
|
||||
return;
|
||||
}
|
||||
|
||||
auto t_speedmode = speedmodeMap[cmbindex];
|
||||
parent->m_drv->GetSpeedMode(t_speedmode.Speedmode, false);
|
||||
parent->m_drv->SetSptime(0, t_speedmode.GraySp);
|
||||
parent->m_drv->SetSptime(1, t_speedmode.ColorSp);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ver != "G3" && ver != "G4")
|
||||
{
|
||||
MessageBox(L"设备序列号前两位不为G3/G4,请确认设备!", L"速率选择错误", MB_OK | MB_ICONINFORMATION);
|
||||
return;
|
||||
}
|
||||
cmbindex = cmbindex - speedmodeMap.size() + 1;
|
||||
parent->m_drv->GetSpeedMode(cmbindex, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,24 +51,35 @@ private:
|
|||
unsigned int ColorSp;
|
||||
unsigned int GraySp;
|
||||
};
|
||||
int speedemodelen;
|
||||
std::map<int, speedmodeparam> speedmodeMap = {
|
||||
{0,{70,0x42d,0xc88}},
|
||||
{1,{80,0x37f,0xa7f}},
|
||||
{2,{90,0x2b6,0x882}},
|
||||
{3,{100,0x27c,0x775}},
|
||||
{4,{110,0x27c,0x775}},
|
||||
{5,{120,0x27c,0x775}},
|
||||
{6,{130,0x27c,0x775}}
|
||||
{3,{110,0x24e,0x706}},
|
||||
{4,{100,0x27c,0x775}},
|
||||
{5,{110,0x27c,0x775}},
|
||||
{6,{120,0x27c,0x775}},
|
||||
{7,{130,0x27c,0x775}}
|
||||
};
|
||||
|
||||
std::map<int, CString> speedmodeMapString = {
|
||||
{0,L"G100_70PPM"},
|
||||
{1,L"G100_80PPM"},
|
||||
{2,L"G100_90PPM"},
|
||||
{3,L"G200_100PPM"},
|
||||
{4,L"G200_110PPM"},
|
||||
{5,L"G200_120PPM"},
|
||||
{6,L"G200_130PPM"}
|
||||
{3,L"G100_110PPM"},
|
||||
{4,L"G200_100PPM"},
|
||||
{5,L"G200_110PPM"},
|
||||
{6,L"G200_120PPM"},
|
||||
{7,L"G200_130PPM"}
|
||||
};
|
||||
|
||||
std::map<int, CString> G300G400speedmodeMapString = {
|
||||
{1,L"G300/G400_40PPM"},
|
||||
{2,L"G300/G400_50PPM"},
|
||||
{3,L"G300/G400_60PPM"},
|
||||
{4,L"G300/G400_70PPM"},
|
||||
{5,L"G400_80PPM"},
|
||||
};
|
||||
CComboBox m_cmbSpeedmode;
|
||||
};
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
#include "filetools.h"
|
||||
#include "imageprocess.h"
|
||||
#include <atlconv.h>
|
||||
#include<iostream>
|
||||
using namespace std;
|
||||
static int imgindex = 0;
|
||||
ImageMatQueue::ImageMatQueue(void)
|
||||
{
|
||||
|
@ -111,11 +113,13 @@ void ImageMatQueue::proc()
|
|||
{
|
||||
if (pixType != -1)
|
||||
{
|
||||
std::string csName;
|
||||
//string csName;
|
||||
SYSTEMTIME st = { 0 };
|
||||
GetLocalTime(&st); //»ñÈ¡µ±Ç°Ê±¼ä ¿É¾«È·µ½ms
|
||||
//csName.Format("%02d%02d%02d-%d.bmp", st.wHour, st.wMinute, st.wSecond,++imgindex);
|
||||
|
||||
//csName.Format(_T("%02d%02d%02d-%d.bmp"), st.wHour, st.wMinute, st.wSecond,++imgindex);
|
||||
char szDateTime[20] = { 0 };
|
||||
sprintf(szDateTime,"%02d%02d%02d-%d.bmp", st.wHour, st.wMinute, st.wSecond, ++imgindex);
|
||||
string csName(szDateTime);
|
||||
cv::Mat matPicImage;
|
||||
cv::Mat matFront, matBack;
|
||||
//vector<cv::Mat> mats;
|
||||
|
@ -139,12 +143,15 @@ void ImageMatQueue::proc()
|
|||
{
|
||||
std::string csImage;
|
||||
csImage = csPath + "\\G300"+ csName;
|
||||
|
||||
//cv::Mat mat = m_pImages.Take().getMat(pixType);
|
||||
//matPicImage = mat(cv::Rect(0, 0, mat.cols, mat.rows));
|
||||
////mats.push_back(matPicImage);
|
||||
//IplImage qqImg;
|
||||
//qqImg = IplImage(matPicImage); // cv::Mat -> IplImage
|
||||
//cvSaveImage(csImage, &qqImg);
|
||||
cv::Mat mat = m_pImages.Take().getMat(pixType);//1 color 6 gray
|
||||
cv::imwrite(csImage, mat);
|
||||
m_images.Put(csImage);
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -238,6 +238,23 @@ void GScn_Drv::SetFlatCallback(std::function<void(std::string)> func)
|
|||
|
||||
void GScn_Drv::GetSpeedMode(int& speedmode, bool get)
|
||||
{
|
||||
if (m_usb.get() && m_usb->is_connected())
|
||||
{
|
||||
if (get)
|
||||
{
|
||||
|
||||
USBCB usb = { GET_SPEED_MODE ,speedmode,0 };
|
||||
m_usb->write_bulk(&usb, sizeof(usb));
|
||||
m_usb->read_bulk(&usb, sizeof(usb));
|
||||
speedmode = usb.u32_Data;
|
||||
}
|
||||
else
|
||||
{
|
||||
USBCB usb = { SET_SPEED_MODE,speedmode,0 };
|
||||
m_usb->write_bulk(&usb, sizeof(usb));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void GScn_Drv::reset()
|
||||
|
|
Loading…
Reference in New Issue