|
|
|
@ -3,7 +3,7 @@
|
|
|
|
#include "colossusbase.h"
|
|
|
|
#include "colossusbase.h"
|
|
|
|
#include <QHeaderView>
|
|
|
|
#include <QHeaderView>
|
|
|
|
#pragma execution_character_set("utf-8")
|
|
|
|
#pragma execution_character_set("utf-8")
|
|
|
|
|
|
|
|
#define WINDOWS_ICON ":/resource/app.png"
|
|
|
|
QString showVariant(const AlgoParamType type, const QVariant &var) {
|
|
|
|
QString showVariant(const AlgoParamType type, const QVariant &var) {
|
|
|
|
switch (type)
|
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -104,7 +104,7 @@ QString showVariant(const AlgoParamType type, const QVariant &var) {
|
|
|
|
|
|
|
|
|
|
|
|
return var.toString();
|
|
|
|
return var.toString();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*定位标定页面*/
|
|
|
|
CMainFrame::CMainFrame(QWidget *parent)
|
|
|
|
CMainFrame::CMainFrame(QWidget *parent)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_pDE = NULL;
|
|
|
|
m_pDE = NULL;
|
|
|
|
@ -116,7 +116,7 @@ CMainFrame::CMainFrame(QWidget *parent)
|
|
|
|
ui = new Ui::MainFrame;
|
|
|
|
ui = new Ui::MainFrame;
|
|
|
|
ui->setupUi(this);
|
|
|
|
ui->setupUi(this);
|
|
|
|
setContextMenuPolicy(Qt::NoContextMenu);
|
|
|
|
setContextMenuPolicy(Qt::NoContextMenu);
|
|
|
|
setWindowIcon(QIcon(":/img/resource/app.png"));
|
|
|
|
setWindowIcon(QIcon(WINDOWS_ICON));
|
|
|
|
//task列表控件设置
|
|
|
|
//task列表控件设置
|
|
|
|
connect(ui->treeWidget, SIGNAL(itemClicked(QTreeWidgetItem*, int)), this, SLOT(OnTreeItemClick()));
|
|
|
|
connect(ui->treeWidget, SIGNAL(itemClicked(QTreeWidgetItem*, int)), this, SLOT(OnTreeItemClick()));
|
|
|
|
ui->treeWidget->setStyleSheet("QTreeWidget::item{height:30px}");
|
|
|
|
ui->treeWidget->setStyleSheet("QTreeWidget::item{height:30px}");
|
|
|
|
@ -242,6 +242,8 @@ bool CMainFrame::InitGraphView()
|
|
|
|
ui->tableWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
|
|
|
|
ui->tableWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
|
|
|
|
ui->tableWidget->setSelectionMode(QAbstractItemView::SingleSelection);
|
|
|
|
ui->tableWidget->setSelectionMode(QAbstractItemView::SingleSelection);
|
|
|
|
ui->tableWidget->verticalHeader()->setHidden(true);
|
|
|
|
ui->tableWidget->verticalHeader()->setHidden(true);
|
|
|
|
|
|
|
|
ui->tableWidget->horizontalHeader()->setSectionResizeMode(4, QHeaderView::Stretch);
|
|
|
|
|
|
|
|
ui->tableWidget->hideColumn(2);
|
|
|
|
|
|
|
|
|
|
|
|
ui->tableWidget_2->setSelectionBehavior(QAbstractItemView::SelectRows);
|
|
|
|
ui->tableWidget_2->setSelectionBehavior(QAbstractItemView::SelectRows);
|
|
|
|
ui->tableWidget_2->setSelectionMode(QAbstractItemView::SingleSelection);
|
|
|
|
ui->tableWidget_2->setSelectionMode(QAbstractItemView::SingleSelection);
|
|
|
|
@ -251,8 +253,7 @@ bool CMainFrame::InitGraphView()
|
|
|
|
ui->tableWidget_2->horizontalHeader()->setSectionResizeMode(1, QHeaderView::Custom);
|
|
|
|
ui->tableWidget_2->horizontalHeader()->setSectionResizeMode(1, QHeaderView::Custom);
|
|
|
|
ui->tableWidget_2->horizontalHeader()->setSectionResizeMode(2, QHeaderView::Custom);
|
|
|
|
ui->tableWidget_2->horizontalHeader()->setSectionResizeMode(2, QHeaderView::Custom);
|
|
|
|
ui->tableWidget_2->horizontalHeader()->setSectionResizeMode(3, QHeaderView::Stretch);
|
|
|
|
ui->tableWidget_2->horizontalHeader()->setSectionResizeMode(3, QHeaderView::Stretch);
|
|
|
|
ui->tableWidget->horizontalHeader()->setSectionResizeMode(4, QHeaderView::Stretch);
|
|
|
|
|
|
|
|
ui->tableWidget->hideColumn(2);
|
|
|
|
|
|
|
|
ui->tableWidget_2->hideColumn(2);
|
|
|
|
ui->tableWidget_2->hideColumn(2);
|
|
|
|
ui->textEdit->setWordWrapMode(QTextOption::NoWrap);
|
|
|
|
ui->textEdit->setWordWrapMode(QTextOption::NoWrap);
|
|
|
|
|
|
|
|
|
|
|
|
@ -301,6 +302,7 @@ bool CMainFrame::InitGraphView()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
m_TaskChangeList.clear();
|
|
|
|
m_TaskChangeList.clear();
|
|
|
|
|
|
|
|
|
|
|
|
if (!InitCurrentTask())
|
|
|
|
if (!InitCurrentTask())
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
@ -308,9 +310,6 @@ bool CMainFrame::InitGraphView()
|
|
|
|
|
|
|
|
|
|
|
|
bool CMainFrame::InitCurrentTask()
|
|
|
|
bool CMainFrame::InitCurrentTask()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!InitCurrentNode())
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ui->tableWidget->setRowCount(0);
|
|
|
|
ui->tableWidget->setRowCount(0);
|
|
|
|
ui->tableWidget->clearContents();
|
|
|
|
ui->tableWidget->clearContents();
|
|
|
|
ui->tableWidget_2->setRowCount(0);
|
|
|
|
ui->tableWidget_2->setRowCount(0);
|
|
|
|
@ -319,6 +318,12 @@ bool CMainFrame::InitCurrentTask()
|
|
|
|
ui->gv_output->clear();
|
|
|
|
ui->gv_output->clear();
|
|
|
|
|
|
|
|
|
|
|
|
ui->textEdit->clear();
|
|
|
|
ui->textEdit->clear();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!InitCurrentNode())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
IDetectorTask* ptask = currentTask();
|
|
|
|
IDetectorTask* ptask = currentTask();
|
|
|
|
if (ptask)
|
|
|
|
if (ptask)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -619,7 +624,7 @@ bool CMainFrame::OnAddAlgo()
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
m_tAlgoDlg.setParent(this);
|
|
|
|
m_tAlgoDlg.setParent(this);
|
|
|
|
m_tAlgoDlg.setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint);
|
|
|
|
m_tAlgoDlg.setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint);
|
|
|
|
m_tAlgoDlg.setWindowIcon(QIcon(":/image/leaper"));
|
|
|
|
m_tAlgoDlg.setWindowIcon(QIcon(WINDOWS_ICON));
|
|
|
|
m_tAlgoDlg.setWindowModality(Qt::ApplicationModal);
|
|
|
|
m_tAlgoDlg.setWindowModality(Qt::ApplicationModal);
|
|
|
|
m_tAlgoDlg.setAttribute(Qt::WA_ShowModal, true);
|
|
|
|
m_tAlgoDlg.setAttribute(Qt::WA_ShowModal, true);
|
|
|
|
IDetectorAlgorithm* pAlgo = m_tAlgoDlg.ShowAlgoDlg(NULL);
|
|
|
|
IDetectorAlgorithm* pAlgo = m_tAlgoDlg.ShowAlgoDlg(NULL);
|
|
|
|
@ -661,7 +666,7 @@ bool CMainFrame::OnEditAlgo()
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
m_tAlgoDlg.setParent(this);
|
|
|
|
m_tAlgoDlg.setParent(this);
|
|
|
|
m_tAlgoDlg.setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint);
|
|
|
|
m_tAlgoDlg.setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint);
|
|
|
|
m_tAlgoDlg.setWindowIcon(QIcon(":/image/leaper"));
|
|
|
|
m_tAlgoDlg.setWindowIcon(QIcon(WINDOWS_ICON));
|
|
|
|
m_tAlgoDlg.setWindowModality(Qt::ApplicationModal);
|
|
|
|
m_tAlgoDlg.setWindowModality(Qt::ApplicationModal);
|
|
|
|
m_tAlgoDlg.setAttribute(Qt::WA_ShowModal, true);
|
|
|
|
m_tAlgoDlg.setAttribute(Qt::WA_ShowModal, true);
|
|
|
|
pAlgo = m_tAlgoDlg.ShowAlgoDlg(pAlgo);
|
|
|
|
pAlgo = m_tAlgoDlg.ShowAlgoDlg(pAlgo);
|
|
|
|
@ -731,7 +736,7 @@ bool CMainFrame::OnSetAlgo()
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
m_tParamMgrDlg.setParent(this);
|
|
|
|
m_tParamMgrDlg.setParent(this);
|
|
|
|
m_tParamMgrDlg.setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint);
|
|
|
|
m_tParamMgrDlg.setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint);
|
|
|
|
m_tParamMgrDlg.setWindowIcon(QIcon(":/image/leaper"));
|
|
|
|
m_tParamMgrDlg.setWindowIcon(QIcon(WINDOWS_ICON));
|
|
|
|
m_tParamMgrDlg.setWindowModality(Qt::ApplicationModal);
|
|
|
|
m_tParamMgrDlg.setWindowModality(Qt::ApplicationModal);
|
|
|
|
m_tParamMgrDlg.setAttribute(Qt::WA_ShowModal, true);
|
|
|
|
m_tParamMgrDlg.setAttribute(Qt::WA_ShowModal, true);
|
|
|
|
m_tParamMgrDlg.ShowParamMgrDlg(pAlgo);
|
|
|
|
m_tParamMgrDlg.ShowParamMgrDlg(pAlgo);
|
|
|
|
@ -761,7 +766,7 @@ bool CMainFrame::OnSetOutParam()
|
|
|
|
|
|
|
|
|
|
|
|
m_tParamMgrDlg.setParent(this);
|
|
|
|
m_tParamMgrDlg.setParent(this);
|
|
|
|
m_tParamMgrDlg.setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint);
|
|
|
|
m_tParamMgrDlg.setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint);
|
|
|
|
m_tParamMgrDlg.setWindowIcon(QIcon(":/image/leaper"));
|
|
|
|
m_tParamMgrDlg.setWindowIcon(QIcon(WINDOWS_ICON));
|
|
|
|
m_tParamMgrDlg.setWindowModality(Qt::ApplicationModal);
|
|
|
|
m_tParamMgrDlg.setWindowModality(Qt::ApplicationModal);
|
|
|
|
m_tParamMgrDlg.setAttribute(Qt::WA_ShowModal, true);
|
|
|
|
m_tParamMgrDlg.setAttribute(Qt::WA_ShowModal, true);
|
|
|
|
m_tParamMgrDlg.ShowParamMgrDlg(pAlgo);
|
|
|
|
m_tParamMgrDlg.ShowParamMgrDlg(pAlgo);
|
|
|
|
@ -860,7 +865,6 @@ bool CMainFrame::OnRunAlgo()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ColossusBase::showImage(img, ui->gv_output);
|
|
|
|
ColossusBase::showImage(img, ui->gv_output);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
@ -1111,7 +1115,7 @@ bool CMainFrame::OnAddParam()
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
m_tParamDlg.setParent(this);
|
|
|
|
m_tParamDlg.setParent(this);
|
|
|
|
m_tParamDlg.setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint);
|
|
|
|
m_tParamDlg.setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint);
|
|
|
|
m_tParamDlg.setWindowIcon(QIcon(":/image/leaper"));
|
|
|
|
m_tParamDlg.setWindowIcon(QIcon(WINDOWS_ICON));
|
|
|
|
m_tParamDlg.setWindowModality(Qt::ApplicationModal);
|
|
|
|
m_tParamDlg.setWindowModality(Qt::ApplicationModal);
|
|
|
|
m_tParamDlg.setAttribute(Qt::WA_ShowModal, true);
|
|
|
|
m_tParamDlg.setAttribute(Qt::WA_ShowModal, true);
|
|
|
|
PLP_ALGORITHM_PARAM pParam = m_tParamDlg.ShowParamDlg(NULL);
|
|
|
|
PLP_ALGORITHM_PARAM pParam = m_tParamDlg.ShowParamDlg(NULL);
|
|
|
|
@ -1184,15 +1188,18 @@ bool CMainFrame::OnEditParam()
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
m_tParamDlg.setParent(this);
|
|
|
|
m_tParamDlg.setParent(this);
|
|
|
|
m_tParamDlg.setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint);
|
|
|
|
m_tParamDlg.setWindowFlags(Qt::Dialog | Qt::WindowCloseButtonHint);
|
|
|
|
m_tParamDlg.setWindowIcon(QIcon(":/image/leaper"));
|
|
|
|
m_tParamDlg.setWindowIcon(QIcon(WINDOWS_ICON));
|
|
|
|
m_tParamDlg.setWindowModality(Qt::ApplicationModal);
|
|
|
|
m_tParamDlg.setWindowModality(Qt::ApplicationModal);
|
|
|
|
m_tParamDlg.setAttribute(Qt::WA_ShowModal, true);
|
|
|
|
m_tParamDlg.setAttribute(Qt::WA_ShowModal, true);
|
|
|
|
m_tParamDlg.ShowParamDlg(pParam);
|
|
|
|
m_tParamDlg.ShowParamDlg(pParam);
|
|
|
|
|
|
|
|
if (_pOldTask)
|
|
|
|
|
|
|
|
{
|
|
|
|
QString st = _pOldTask->GetTaskInfo()->strName;
|
|
|
|
QString st = _pOldTask->GetTaskInfo()->strName;
|
|
|
|
if (!m_TaskChangeList.contains(st))
|
|
|
|
if (!m_TaskChangeList.contains(st))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_TaskChangeList.append(st);
|
|
|
|
m_TaskChangeList.append(st);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|