|
|
@ -253,39 +253,33 @@ void A8kOptTab::construct(QTabWidget *fathertab) { |
|
|
|
ZQFunctionListBox *box = new ZQFunctionListBox(tab, "结果处理", 4); |
|
|
|
// 预分析结果
|
|
|
|
|
|
|
|
box->newSubButton("光学结果预分析", [this](int argn, const char **args) { |
|
|
|
int32_t lasterGain = atoi(args[0]); |
|
|
|
int32_t scanGain = atoi(args[1]); |
|
|
|
ICM->callcmd2(getDeviceId(), ka8k_opt_v2_t_open_laster, lasterGain, scanGain); |
|
|
|
|
|
|
|
box->newSubButton("光学结果(预)分析", [this](int argn, const char **args) { |
|
|
|
if (m_optData.dataNum == 0) { |
|
|
|
ZQUI::ins()->ishow("请先进行光学分析,并读取扫描结果"); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
ISHOW("------ OptRawResultInfo ------"); |
|
|
|
ISHOW("laster gain:%d", lasterGain); |
|
|
|
ISHOW("scan gain:%d", scanGain); |
|
|
|
ISHOW("laster gain:%d", m_laserGain); |
|
|
|
ISHOW("scan gain:%d", m_scanGain); |
|
|
|
ISHOW("opt Type:%s", optType2Str(m_optType)); |
|
|
|
|
|
|
|
// 1. 预分析
|
|
|
|
OptAlgoPreProcessResult result; |
|
|
|
if (m_optType == kfopt) { |
|
|
|
F_A8kOptAlgoPreProcess(array2vector(m_optData), scanGain, 2600, 2800, result); |
|
|
|
F_A8kOptAlgoPreProcess(array2vector(m_optData), m_scanGain, 2600, 2800, result); |
|
|
|
} else if (m_optType == ktopt) { |
|
|
|
T_A8kOptAlgoPreProcess(array2vector(m_optData), scanGain, 2600, 2800, result); |
|
|
|
T_A8kOptAlgoPreProcess(array2vector(m_optData), m_scanGain, 2600, 2800, result); |
|
|
|
} |
|
|
|
ISHOW("------ OptPreParseResult ------"); |
|
|
|
ISHOW("scanAgain :%s", result.scanAgain ? "true" : "false"); |
|
|
|
ISHOW("suggestScanGain:%d", result.suggestScanGain); |
|
|
|
ISHOW("重新扫描 :%s", result.scanAgain ? "true" : "false"); |
|
|
|
ISHOW("重新扫描建议增益 :%d", result.suggestScanGain); |
|
|
|
}); |
|
|
|
box->newSubButtonEnd(); |
|
|
|
// 分析结果
|
|
|
|
|
|
|
|
box->newSubButton("光学结果分析", [this](int argn, const char **args) { |
|
|
|
int32_t lasterGain = atoi(args[0]); |
|
|
|
int32_t scanGain = atoi(args[1]); |
|
|
|
ICM->callcmd2(getDeviceId(), ka8k_opt_v2_t_open_laster, lasterGain, scanGain); |
|
|
|
box->newSubButton("光学结果分析2", [this](int argn, const char **args) { |
|
|
|
DoInUi([]() {}); |
|
|
|
|
|
|
|
if (m_optData.dataNum == 0) { |
|
|
|
ZQUI::ins()->ishow("请先进行光学分析,并读取扫描结果"); |
|
|
@ -293,20 +287,47 @@ void A8kOptTab::construct(QTabWidget *fathertab) { |
|
|
|
} |
|
|
|
|
|
|
|
ISHOW("------ OptRawResultInfo ------"); |
|
|
|
ISHOW("laster gain:%d", lasterGain); |
|
|
|
ISHOW("scan gain:%d", scanGain); |
|
|
|
ISHOW("laster gain:%d", m_laserGain); |
|
|
|
ISHOW("scan gain:%d", m_scanGain); |
|
|
|
ISHOW("opt Type:%s", optType2Str(m_optType)); |
|
|
|
OptAlgoResult result; |
|
|
|
PorcessContext context; |
|
|
|
A8kOptAlgoProcess(array2vector(m_optData), result); |
|
|
|
A8kOptAlgoGetProcessContext(context); |
|
|
|
|
|
|
|
DoInUi([result, context]() { |
|
|
|
WidgetPlot2D *plot2d = new WidgetPlot2D(); |
|
|
|
|
|
|
|
QStringList lines; |
|
|
|
lines.push_back("opt"); |
|
|
|
lines.push_back("diff"); |
|
|
|
lines.push_back("diffX2"); |
|
|
|
plot2d->initGraphName(lines); |
|
|
|
|
|
|
|
for (int i = 0; i < result.displayData.size(); i++) { |
|
|
|
plot2d->addData("opt", result.displayData[i]); |
|
|
|
} |
|
|
|
for (int i = 0; i < context.diff.size(); i++) { |
|
|
|
plot2d->addData("diff", context.diff[i]); |
|
|
|
} |
|
|
|
for (int i = 0; i < context.diffX2.size(); i++) { |
|
|
|
plot2d->addData("diffX2", context.diffX2[i]); |
|
|
|
} |
|
|
|
|
|
|
|
// 1. 预分析
|
|
|
|
OptAlgoPreProcessResult result; |
|
|
|
if (m_optType == kfopt) { |
|
|
|
F_A8kOptAlgoPreProcess(array2vector(m_optData), scanGain, 2600, 2800, result); |
|
|
|
} else if (m_optType == ktopt) { |
|
|
|
T_A8kOptAlgoPreProcess(array2vector(m_optData), scanGain, 2600, 2800, result); |
|
|
|
} |
|
|
|
ISHOW("------ OptPreParseResult ------"); |
|
|
|
ISHOW("scanAgain :%s", result.scanAgain ? "true" : "false"); |
|
|
|
ISHOW("suggestScanGain:%d", result.suggestScanGain); |
|
|
|
// 250 个点的情况下,峰的标准位置在 40 80 120 160 200
|
|
|
|
for (int i = 1; i < 6; i++) { |
|
|
|
plot2d->addRefLine(40 * i); |
|
|
|
} |
|
|
|
plot2d->show(); |
|
|
|
|
|
|
|
ISHOW_RAW("Peak,find,pos,startpos,endpos"); |
|
|
|
ISHOW_RAW("040,%s,%d,%d,%d,%f", result.pin040.find_peak ? "true" : "false", result.pin040.peak_pos, result.pin040.peak_start_pos, result.pin040.peak_end_pos, result.pin040.area); |
|
|
|
ISHOW_RAW("080,%s,%d,%d,%d,%f", result.pin080.find_peak ? "true" : "false", result.pin080.peak_pos, result.pin080.peak_start_pos, result.pin080.peak_end_pos, result.pin080.area); |
|
|
|
ISHOW_RAW("120,%s,%d,%d,%d,%f", result.pin120.find_peak ? "true" : "false", result.pin120.peak_pos, result.pin120.peak_start_pos, result.pin120.peak_end_pos, result.pin120.area); |
|
|
|
ISHOW_RAW("160,%s,%d,%d,%d,%f", result.pin160.find_peak ? "true" : "false", result.pin160.peak_pos, result.pin160.peak_start_pos, result.pin160.peak_end_pos, result.pin160.area); |
|
|
|
ISHOW_RAW("200,%s,%d,%d,%d,%f", result.pin200.find_peak ? "true" : "false", result.pin200.peak_pos, result.pin200.peak_start_pos, result.pin200.peak_end_pos, result.pin200.area); |
|
|
|
}); |
|
|
|
//
|
|
|
|
}); |
|
|
|
box->newSubButtonEnd(); |
|
|
|
// 打印分析报告
|
|
|
|