refactor(*):03LaserCut_V00.00.01,Spark100项目发货前功能提取
This commit is contained in:
@@ -657,7 +657,7 @@ void DeviceControlPanelWidget::on_pbStop_clicked()
|
||||
|
||||
|
||||
}
|
||||
|
||||
extern bool bReadApFlag;
|
||||
void DeviceControlPanelWidget::on_pbSemiAutoMach_clicked()
|
||||
{
|
||||
|
||||
@@ -667,6 +667,7 @@ void DeviceControlPanelWidget::on_pbSemiAutoMach_clicked()
|
||||
// machCodeFilePath = machCodeFilePath + QString("_%1.txt").arg(index);
|
||||
//DEV->bRunning = true;
|
||||
//ShowSmallAreasDialog();
|
||||
bReadApFlag = false;
|
||||
if (ui->chkAuto->checkState() == Qt::Checked)
|
||||
{
|
||||
DEV->runType = 1;
|
||||
@@ -2237,7 +2238,9 @@ void DeviceControlPanelWidget::on_pbCompenTestPos_clicked()
|
||||
|
||||
void DeviceControlPanelWidget::on_pbFindEdge_clicked()
|
||||
{
|
||||
DEV->FindEdge();
|
||||
DEV->RSToZero_Z0();
|
||||
//DEV->reset_z();
|
||||
//DEV->FindEdge();
|
||||
}
|
||||
|
||||
void DeviceControlPanelWidget::on_cmbType_currentTextChanged(const QString &strValue)
|
||||
@@ -2758,3 +2761,24 @@ void DeviceControlPanelWidget::on_spbPowerAdjust_valueChanged(int arg1)
|
||||
|
||||
Sleep(50);
|
||||
}
|
||||
|
||||
void DeviceControlPanelWidget::on_pbReset_clicked()
|
||||
{
|
||||
// DEVICE_INFO->printDeviceSystemInfo(QString("Z2轴工作位置改变完成1231242"));
|
||||
// double value = 2.333;
|
||||
// DEVICE_INFO->printDeviceSystemInfo(QString("Z2轴工作位置改变完成,当前位置为:%1mm").arg(value));
|
||||
|
||||
int choose= QMessageBox::question(this, tr("强制复位"),
|
||||
QString(tr("是否强制复位?")),
|
||||
QMessageBox::Yes | QMessageBox::No);
|
||||
|
||||
if (choose== QMessageBox::No)
|
||||
{
|
||||
|
||||
}
|
||||
else if (choose== QMessageBox::Yes)
|
||||
{
|
||||
DEV->reset();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -205,6 +205,8 @@ private slots:
|
||||
|
||||
void on_spbPowerAdjust_valueChanged(int arg1);
|
||||
|
||||
void on_pbReset_clicked();
|
||||
|
||||
private:
|
||||
|
||||
Ui::DeviceControlPanelWidget* ui;
|
||||
|
||||
@@ -37,6 +37,56 @@
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="pbStop">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>微软雅黑</family>
|
||||
<pointsize>12</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QPushButton {
|
||||
color: #333;
|
||||
border: 2px solid #555;
|
||||
border-radius: 20px;
|
||||
border-style: outset;
|
||||
background: qradialgradient(spread:pad, cx:0.5, cy:0.5, radius:0.8, fx:0.6, fy:0.6, stop:0.772727 rgba(136, 9, 21, 255), stop:1 rgba(255, 255, 255, 255));
|
||||
padding: 5px;
|
||||
color: rgb(255, 255, 255);
|
||||
}
|
||||
|
||||
QPushButton:hover {
|
||||
|
||||
background-color: qradialgradient(spread:pad, cx:0.5, cy:0.5, radius:0.8, fx:0.5, fy:0.5, stop:0.392045 rgba(184, 53, 21, 255), stop:1 rgba(255, 255, 255, 255));
|
||||
|
||||
}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>停 止</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="pbSemiAutoMach">
|
||||
<property name="sizePolicy">
|
||||
@@ -81,6 +131,50 @@ QPushButton:hover {
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="pbDEVInit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>微软雅黑</family>
|
||||
<pointsize>12</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QPushButton {
|
||||
color: #333;
|
||||
border: 2px solid #555;
|
||||
border-radius: 20px;
|
||||
border-style: outset;
|
||||
background: qradialgradient(spread:pad, cx:0.5, cy:0.5, radius:0.8, fx:0.6, fy:0.6, stop:0.772727 rgba(136, 9, 21, 255), stop:1 rgba(255, 255, 255, 255));
|
||||
padding: 5px;
|
||||
color: rgb(255, 255, 255);
|
||||
}
|
||||
|
||||
QPushButton:hover {
|
||||
|
||||
background-color: qradialgradient(spread:pad, cx:0.5, cy:0.5, radius:0.7, fx:0.5, fy:0.5, stop:0.392045 rgba(184, 53, 21, 255), stop:1 rgba(255, 255, 255, 255));
|
||||
|
||||
}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>初始化</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="pbEStop">
|
||||
<property name="sizePolicy">
|
||||
@@ -131,8 +225,8 @@ QPushButton:hover {
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="pbStop">
|
||||
<item row="2" column="1">
|
||||
<widget class="QPushButton" name="pbReset">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
@@ -157,6 +251,7 @@ QPushButton:hover {
|
||||
<pointsize>12</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
<kerning>true</kerning>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
@@ -177,51 +272,7 @@ QPushButton:hover {
|
||||
}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>停 止</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="pbDEVInit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>微软雅黑</family>
|
||||
<pointsize>12</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QPushButton {
|
||||
color: #333;
|
||||
border: 2px solid #555;
|
||||
border-radius: 20px;
|
||||
border-style: outset;
|
||||
background: qradialgradient(spread:pad, cx:0.5, cy:0.5, radius:0.8, fx:0.6, fy:0.6, stop:0.772727 rgba(136, 9, 21, 255), stop:1 rgba(255, 255, 255, 255));
|
||||
padding: 5px;
|
||||
color: rgb(255, 255, 255);
|
||||
}
|
||||
|
||||
QPushButton:hover {
|
||||
|
||||
background-color: qradialgradient(spread:pad, cx:0.5, cy:0.5, radius:0.7, fx:0.5, fy:0.5, stop:0.392045 rgba(184, 53, 21, 255), stop:1 rgba(255, 255, 255, 255));
|
||||
|
||||
}</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>初始化</string>
|
||||
<string>复 位</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -823,7 +874,7 @@ QRadioButton::unchecked{color:rgb(0, 0, 0);}</string>
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>200.000000000000000</double>
|
||||
<double>500.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -1959,6 +2010,7 @@ QPushButton:hover {
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>微软雅黑</family>
|
||||
<pointsize>9</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
@@ -2006,6 +2058,7 @@ QPushButton:hover {
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>微软雅黑</family>
|
||||
<pointsize>9</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
|
||||
@@ -44,7 +44,7 @@ void DeviceSystemInfoWidget::insertInformationToText(const QString text,SYS_INFO
|
||||
switch (level)
|
||||
{
|
||||
case D_NOTHING:
|
||||
fmt.setForeground(QColor(255, 255, 255));
|
||||
fmt.setForeground(QColor(0, 0, 0));
|
||||
break;
|
||||
case D_WARNING:
|
||||
fmt.setForeground(QColor(255, 160, 14));
|
||||
|
||||
@@ -20,10 +20,11 @@ GeneralSetWidget::GeneralSetWidget(QWidget* parent):
|
||||
}
|
||||
|
||||
ui->cmbSetParam->addItems(doTextList);
|
||||
connect(ui->cmbSetParam,SIGNAL(currentTextChanged(const QString &)),this,SLOT(cmbSetParam_currentTextChanged(QString)));
|
||||
|
||||
connect(DEV,SIGNAL(show_Q_PP_SGL()),this,SLOT(show_Q_PP()));
|
||||
loadSet();
|
||||
//ui->pbLaserSet2->setVisible(false);
|
||||
|
||||
}
|
||||
|
||||
void GeneralSetWidget::loadSet()
|
||||
@@ -53,6 +54,10 @@ void GeneralSetWidget::loadSet()
|
||||
RS_SETTINGS->beginGroup("device/Rposition");
|
||||
double FindEdageOffset = RS_SETTINGS->readNumDEntry("/FindEdageOffset");
|
||||
RS_SETTINGS->endGroup();
|
||||
|
||||
RS_SETTINGS->beginGroup("device/Rposition");//From R
|
||||
double RCheckOffset = RS_SETTINGS->readNumDEntry("/RCheckOffset");
|
||||
RS_SETTINGS->endGroup();
|
||||
|
||||
RS_SETTINGS->beginGroup("device/Rposition");
|
||||
double PixelSize = RS_SETTINGS->readNumDEntry("/PixelSize");
|
||||
@@ -77,6 +82,127 @@ void GeneralSetWidget::loadSet()
|
||||
DEV->R_detection_po = RS_SETTINGS->readNumDEntry("/dsbPPO");
|
||||
RS_SETTINGS->endGroup();
|
||||
ui->dsbPP_O->setValue(DEV->R_detection_po);
|
||||
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
int valueE = RS_SETTINGS->readNumEntry("/PPEnable");
|
||||
RS_SETTINGS->endGroup();
|
||||
|
||||
if(valueE == 1)
|
||||
{
|
||||
ui->checkBox->setCheckState(Qt::Checked);
|
||||
//if (ui->chkAuto->checkState() == Qt::Checked)
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->checkBox->setCheckState(Qt::Unchecked);
|
||||
}
|
||||
QString value = ui->cmbSetParam->currentText();
|
||||
if (value == "设置参数1")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
QString value1 = RS_SETTINGS->readEntry("/PP1");
|
||||
QString value2 = RS_SETTINGS->readEntry("/PG1");
|
||||
QString value3 = RS_SETTINGS->readEntry("/AM1");
|
||||
QString value4 = RS_SETTINGS->readEntry("/MODE1");
|
||||
RS_SETTINGS->endGroup();
|
||||
ui->lineEdit->setText(value1);
|
||||
ui->lineEdit_2->setText(value2);
|
||||
ui->lineEdit_3->setText(value3);
|
||||
ui->lineEdit_4->setText(value4);
|
||||
}
|
||||
else if (value == "设置参数2")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
QString value1 = RS_SETTINGS->readEntry("/PP2");
|
||||
QString value2 = RS_SETTINGS->readEntry("/PG2");
|
||||
QString value3 = RS_SETTINGS->readEntry("/AM2");
|
||||
QString value4 = RS_SETTINGS->readEntry("/MODE2");
|
||||
RS_SETTINGS->endGroup();
|
||||
ui->lineEdit->setText(value1);
|
||||
ui->lineEdit_2->setText(value2);
|
||||
ui->lineEdit_3->setText(value3);
|
||||
ui->lineEdit_4->setText(value4);
|
||||
}
|
||||
else if (value == "设置参数3")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
QString value1 = RS_SETTINGS->readEntry("/PP3");
|
||||
QString value2 = RS_SETTINGS->readEntry("/PG3");
|
||||
QString value3 = RS_SETTINGS->readEntry("/AM3");
|
||||
QString value4 = RS_SETTINGS->readEntry("/MODE3");
|
||||
RS_SETTINGS->endGroup();
|
||||
ui->lineEdit->setText(value1);
|
||||
ui->lineEdit_2->setText(value2);
|
||||
ui->lineEdit_3->setText(value3);
|
||||
ui->lineEdit_4->setText(value4);
|
||||
}
|
||||
else if (value == "设置参数4")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
QString value1 = RS_SETTINGS->readEntry("/PP4");
|
||||
QString value2 = RS_SETTINGS->readEntry("/PG4");
|
||||
QString value3 = RS_SETTINGS->readEntry("/AM4");
|
||||
QString value4 = RS_SETTINGS->readEntry("/MODE4");
|
||||
RS_SETTINGS->endGroup();
|
||||
ui->lineEdit->setText(value1);
|
||||
ui->lineEdit_2->setText(value2);
|
||||
ui->lineEdit_3->setText(value3);
|
||||
ui->lineEdit_4->setText(value4);
|
||||
}
|
||||
else if (value == "设置参数5")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
QString value1 = RS_SETTINGS->readEntry("/PP5");
|
||||
QString value2 = RS_SETTINGS->readEntry("/PG5");
|
||||
QString value3 = RS_SETTINGS->readEntry("/AM5");
|
||||
QString value4 = RS_SETTINGS->readEntry("/MODE5");
|
||||
RS_SETTINGS->endGroup();
|
||||
ui->lineEdit->setText(value1);
|
||||
ui->lineEdit_2->setText(value2);
|
||||
ui->lineEdit_3->setText(value3);
|
||||
ui->lineEdit_4->setText(value4);
|
||||
}
|
||||
else if (value == "设置参数6")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
QString value1 = RS_SETTINGS->readEntry("/PP6");
|
||||
QString value2 = RS_SETTINGS->readEntry("/PG6");
|
||||
QString value3 = RS_SETTINGS->readEntry("/AM6");
|
||||
QString value4 = RS_SETTINGS->readEntry("/MODE6");
|
||||
RS_SETTINGS->endGroup();
|
||||
ui->lineEdit->setText(value1);
|
||||
ui->lineEdit_2->setText(value2);
|
||||
ui->lineEdit_3->setText(value3);
|
||||
ui->lineEdit_4->setText(value4);
|
||||
}
|
||||
else if (value == "设置参数7")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
QString value1 = RS_SETTINGS->readEntry("/PP7");
|
||||
QString value2 = RS_SETTINGS->readEntry("/PG7");
|
||||
QString value3 = RS_SETTINGS->readEntry("/AM7");
|
||||
QString value4 = RS_SETTINGS->readEntry("/MODE7");
|
||||
RS_SETTINGS->endGroup();
|
||||
ui->lineEdit->setText(value1);
|
||||
ui->lineEdit_2->setText(value2);
|
||||
ui->lineEdit_3->setText(value3);
|
||||
ui->lineEdit_4->setText(value4);
|
||||
}
|
||||
else if (value == "设置参数8")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
QString value1 = RS_SETTINGS->readEntry("/PP8");
|
||||
QString value2 = RS_SETTINGS->readEntry("/PG8");
|
||||
QString value3 = RS_SETTINGS->readEntry("/AM8");
|
||||
QString value4 = RS_SETTINGS->readEntry("/MODE8");
|
||||
RS_SETTINGS->endGroup();
|
||||
ui->lineEdit->setText(value1);
|
||||
ui->lineEdit_2->setText(value2);
|
||||
ui->lineEdit_3->setText(value3);
|
||||
ui->lineEdit_4->setText(value4);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void GeneralSetWidget::on_leIP_IPChanged(QString value)
|
||||
@@ -110,65 +236,6 @@ void GeneralSetWidget::on_dsbZAAxisSafeVel_valueChanged(double value)
|
||||
RS_SETTINGS->endGroup();
|
||||
DEVICE_INFO->printDeviceSystemInfo(QString("Z轴回安全位置速度设置为:%1mm/s").arg(value));
|
||||
}
|
||||
void GeneralSetWidget::cmbSetParam_currentTextChanged(const QString &value)
|
||||
{
|
||||
if (IPGLASER->m_hComm == nullptr)
|
||||
{
|
||||
IPGLASER->OpenComm();
|
||||
}
|
||||
IPGLASER->LaserClose();
|
||||
IPGLASER->getIPGLaerPara("IPGLaser");
|
||||
if (IPGLASER->m_hComm == nullptr)
|
||||
{
|
||||
IPGLASER->OpenComm();
|
||||
}
|
||||
int ret;
|
||||
if (value == "设置参数1")
|
||||
{
|
||||
ret = IPGLASER->SetParam(1);
|
||||
}
|
||||
else if (value == "设置参数2")
|
||||
{
|
||||
ret = IPGLASER->SetParam(2);
|
||||
}
|
||||
else if (value == "设置参数3")
|
||||
{
|
||||
ret = IPGLASER->SetParam(3);
|
||||
}
|
||||
else if (value == "设置参数4")
|
||||
{
|
||||
ret = IPGLASER->SetParam(4);
|
||||
}
|
||||
else if (value == "设置参数5")
|
||||
{
|
||||
ret = IPGLASER->SetParam(5);
|
||||
}
|
||||
else if (value == "设置参数6")
|
||||
{
|
||||
ret = IPGLASER->SetParam(6);
|
||||
}
|
||||
else if (value == "设置参数7")
|
||||
{
|
||||
ret = IPGLASER->SetParam(7);
|
||||
}
|
||||
else if (value == "设置参数8")
|
||||
{
|
||||
ret = IPGLASER->SetParam(8);
|
||||
}
|
||||
if (ret != 0)
|
||||
{
|
||||
QMessageBox msg(this);
|
||||
DEVICE_INFO->printDeviceSalamInfo("参数设置错误!");
|
||||
msg.setWindowTitle("异常提示");
|
||||
msg.setText("参数设置错误!");
|
||||
msg.setIcon(QMessageBox::Critical);
|
||||
msg.exec();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void GeneralSetWidget::on_dsbPanFindHeight_valueChanged(double value)
|
||||
@@ -278,29 +345,29 @@ void GeneralSetWidget::on_dsbGlobalCameraOffset_valueChanged(double arg1)
|
||||
|
||||
|
||||
|
||||
void GeneralSetWidget::on_pbSetPP_clicked()
|
||||
{
|
||||
QString strPower;
|
||||
strPower = QString::number(ui->dsbSetPPValue->value(),'f',2);
|
||||
int ret = IPGLASER->SetSingleParam("32",strPower);
|
||||
if (ret != 0)
|
||||
{
|
||||
QMessageBox msg(this);
|
||||
DEVICE_INFO->printDeviceSalamInfo("参数设置错误!");
|
||||
msg.setWindowTitle("异常提示");
|
||||
msg.setText("参数设置错误!");
|
||||
msg.setIcon(QMessageBox::Critical);
|
||||
msg.exec();
|
||||
return;
|
||||
}
|
||||
QMessageBox msg(this);
|
||||
DEVICE_INFO->printDeviceSalamInfo("参数设置成功!");
|
||||
msg.setWindowTitle("提示");
|
||||
msg.setText("参数设置成功!");
|
||||
msg.setIcon(QMessageBox::Critical);
|
||||
msg.exec();
|
||||
return;
|
||||
}
|
||||
//void GeneralSetWidget::on_pbSetPP_clicked()
|
||||
//{
|
||||
// QString strPower;
|
||||
// strPower = QString::number(ui->dsbSetPPValue->value(),'f',2);
|
||||
// int ret = IPGLASER->SetSingleParam("32",strPower);
|
||||
// if (ret != 0)
|
||||
// {
|
||||
// QMessageBox msg(this);
|
||||
// DEVICE_INFO->printDeviceSalamInfo("参数设置错误!");
|
||||
// msg.setWindowTitle("异常提示");
|
||||
// msg.setText("参数设置错误!");
|
||||
// msg.setIcon(QMessageBox::Critical);
|
||||
// msg.exec();
|
||||
// return;
|
||||
// }
|
||||
// QMessageBox msg(this);
|
||||
// DEVICE_INFO->printDeviceSalamInfo("参数设置成功!");
|
||||
// msg.setWindowTitle("提示");
|
||||
// msg.setText("参数设置成功!");
|
||||
// msg.setIcon(QMessageBox::Critical);
|
||||
// msg.exec();
|
||||
// return;
|
||||
//}
|
||||
void GeneralSetWidget::show_Q_PP()
|
||||
{
|
||||
ui->dsbQ_T->setValue(DEV->R_detection_pt);
|
||||
@@ -360,3 +427,422 @@ void GeneralSetWidget::on_oneDot_clicked()
|
||||
ui->dsbR->setValue(single*1000);
|
||||
//ui->dsbR->setValue(DEV->TypeForTest);
|
||||
}
|
||||
|
||||
void GeneralSetWidget::on_lineEdit_textChanged(const QString &arg1)
|
||||
{
|
||||
QString value = ui->cmbSetParam->currentText();
|
||||
if (value == "设置参数1")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
RS_SETTINGS->writeEntry("/PP1",arg1);
|
||||
RS_SETTINGS->endGroup();
|
||||
}
|
||||
else if (value == "设置参数2")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
RS_SETTINGS->writeEntry("/PP2",arg1);
|
||||
RS_SETTINGS->endGroup();
|
||||
}
|
||||
else if (value == "设置参数3")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
RS_SETTINGS->writeEntry("/PP3",arg1);
|
||||
RS_SETTINGS->endGroup();
|
||||
}
|
||||
else if (value == "设置参数4")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
RS_SETTINGS->writeEntry("/PP4",arg1);
|
||||
RS_SETTINGS->endGroup();
|
||||
}
|
||||
else if (value == "设置参数5")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
RS_SETTINGS->writeEntry("/PP5",arg1);
|
||||
RS_SETTINGS->endGroup();
|
||||
}
|
||||
else if (value == "设置参数6")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
RS_SETTINGS->writeEntry("/PP6",arg1);
|
||||
RS_SETTINGS->endGroup();
|
||||
}
|
||||
else if (value == "设置参数7")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
RS_SETTINGS->writeEntry("/PP7",arg1);
|
||||
RS_SETTINGS->endGroup();
|
||||
}
|
||||
else if (value == "设置参数8")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
RS_SETTINGS->writeEntry("/PP8",arg1);
|
||||
RS_SETTINGS->endGroup();
|
||||
}
|
||||
|
||||
IPGLASER->UpdateIPGPara();
|
||||
if (value == "设置参数1") IPGLASER->SetParam(1);
|
||||
else if (value == "设置参数2") IPGLASER->SetParam(2);
|
||||
else if (value == "设置参数3") IPGLASER->SetParam(3);
|
||||
else if (value == "设置参数4") IPGLASER->SetParam(4);
|
||||
else if (value == "设置参数5") IPGLASER->SetParam(5);
|
||||
else if (value == "设置参数6") IPGLASER->SetParam(6);
|
||||
else if (value == "设置参数7") IPGLASER->SetParam(7);
|
||||
else if (value == "设置参数8") IPGLASER->SetParam(8);
|
||||
|
||||
}
|
||||
|
||||
void GeneralSetWidget::on_lineEdit_2_textChanged(const QString &arg1)
|
||||
{
|
||||
QString value = ui->cmbSetParam->currentText();
|
||||
if (value == "设置参数1")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
RS_SETTINGS->writeEntry("/PG1",arg1);
|
||||
RS_SETTINGS->endGroup();
|
||||
}
|
||||
else if (value == "设置参数2")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
RS_SETTINGS->writeEntry("/PG2",arg1);
|
||||
RS_SETTINGS->endGroup();
|
||||
}
|
||||
else if (value == "设置参数3")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
RS_SETTINGS->writeEntry("/PG3",arg1);
|
||||
RS_SETTINGS->endGroup();
|
||||
}
|
||||
else if (value == "设置参数4")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
RS_SETTINGS->writeEntry("/PG4",arg1);
|
||||
RS_SETTINGS->endGroup();
|
||||
}
|
||||
else if (value == "设置参数5")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
RS_SETTINGS->writeEntry("/PG5",arg1);
|
||||
RS_SETTINGS->endGroup();
|
||||
}
|
||||
else if (value == "设置参数6")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
RS_SETTINGS->writeEntry("/PG6",arg1);
|
||||
RS_SETTINGS->endGroup();
|
||||
}
|
||||
else if (value == "设置参数7")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
RS_SETTINGS->writeEntry("/PG7",arg1);
|
||||
RS_SETTINGS->endGroup();
|
||||
}
|
||||
else if (value == "设置参数8")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
RS_SETTINGS->writeEntry("/PG8",arg1);
|
||||
RS_SETTINGS->endGroup();
|
||||
}
|
||||
|
||||
IPGLASER->UpdateIPGPara();
|
||||
if (value == "设置参数1") IPGLASER->SetParam(1);
|
||||
else if (value == "设置参数2") IPGLASER->SetParam(2);
|
||||
else if (value == "设置参数3") IPGLASER->SetParam(3);
|
||||
else if (value == "设置参数4") IPGLASER->SetParam(4);
|
||||
else if (value == "设置参数5") IPGLASER->SetParam(5);
|
||||
else if (value == "设置参数6") IPGLASER->SetParam(6);
|
||||
else if (value == "设置参数7") IPGLASER->SetParam(7);
|
||||
else if (value == "设置参数8") IPGLASER->SetParam(8);
|
||||
|
||||
}
|
||||
|
||||
void GeneralSetWidget::on_lineEdit_3_textChanged(const QString &arg1)
|
||||
{
|
||||
QString value = ui->cmbSetParam->currentText();
|
||||
if (value == "设置参数1")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
RS_SETTINGS->writeEntry("/AM1",arg1);
|
||||
RS_SETTINGS->endGroup();
|
||||
}
|
||||
else if (value == "设置参数2")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
RS_SETTINGS->writeEntry("/AM2",arg1);
|
||||
RS_SETTINGS->endGroup();
|
||||
}
|
||||
else if (value == "设置参数3")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
RS_SETTINGS->writeEntry("/AM3",arg1);
|
||||
RS_SETTINGS->endGroup();
|
||||
}
|
||||
else if (value == "设置参数4")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
RS_SETTINGS->writeEntry("/AM4",arg1);
|
||||
RS_SETTINGS->endGroup();
|
||||
}
|
||||
else if (value == "设置参数5")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
RS_SETTINGS->writeEntry("/AM5",arg1);
|
||||
RS_SETTINGS->endGroup();
|
||||
}
|
||||
else if (value == "设置参数6")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
RS_SETTINGS->writeEntry("/AM6",arg1);
|
||||
RS_SETTINGS->endGroup();
|
||||
}
|
||||
else if (value == "设置参数7")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
RS_SETTINGS->writeEntry("/AM7",arg1);
|
||||
RS_SETTINGS->endGroup();
|
||||
}
|
||||
else if (value == "设置参数8")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
RS_SETTINGS->writeEntry("/AM8",arg1);
|
||||
RS_SETTINGS->endGroup();
|
||||
}
|
||||
|
||||
IPGLASER->UpdateIPGPara();
|
||||
if (value == "设置参数1") IPGLASER->SetParam(1);
|
||||
else if (value == "设置参数2") IPGLASER->SetParam(2);
|
||||
else if (value == "设置参数3") IPGLASER->SetParam(3);
|
||||
else if (value == "设置参数4") IPGLASER->SetParam(4);
|
||||
else if (value == "设置参数5") IPGLASER->SetParam(5);
|
||||
else if (value == "设置参数6") IPGLASER->SetParam(6);
|
||||
else if (value == "设置参数7") IPGLASER->SetParam(7);
|
||||
else if (value == "设置参数8") IPGLASER->SetParam(8);
|
||||
|
||||
}
|
||||
|
||||
void GeneralSetWidget::on_lineEdit_4_textChanged(const QString &arg1)
|
||||
{
|
||||
QString value = ui->cmbSetParam->currentText();
|
||||
if (value == "设置参数1")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
RS_SETTINGS->writeEntry("/MODE1",arg1);
|
||||
RS_SETTINGS->endGroup();
|
||||
}
|
||||
else if (value == "设置参数2")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
RS_SETTINGS->writeEntry("/MODE2",arg1);
|
||||
RS_SETTINGS->endGroup();
|
||||
}
|
||||
else if (value == "设置参数3")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
RS_SETTINGS->writeEntry("/MODE3",arg1);
|
||||
RS_SETTINGS->endGroup();
|
||||
}
|
||||
else if (value == "设置参数4")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
RS_SETTINGS->writeEntry("/MODE4",arg1);
|
||||
RS_SETTINGS->endGroup();
|
||||
}
|
||||
else if (value == "设置参数5")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
RS_SETTINGS->writeEntry("/MODE5",arg1);
|
||||
RS_SETTINGS->endGroup();
|
||||
}
|
||||
else if (value == "设置参数6")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
RS_SETTINGS->writeEntry("/MODE6",arg1);
|
||||
RS_SETTINGS->endGroup();
|
||||
}
|
||||
else if (value == "设置参数7")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
RS_SETTINGS->writeEntry("/MODE7",arg1);
|
||||
RS_SETTINGS->endGroup();
|
||||
}
|
||||
else if (value == "设置参数8")
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
RS_SETTINGS->writeEntry("/MODE8",arg1);
|
||||
RS_SETTINGS->endGroup();
|
||||
}
|
||||
|
||||
IPGLASER->UpdateIPGPara();
|
||||
if (value == "设置参数1") IPGLASER->SetParam(1);
|
||||
else if (value == "设置参数2") IPGLASER->SetParam(2);
|
||||
else if (value == "设置参数3") IPGLASER->SetParam(3);
|
||||
else if (value == "设置参数4") IPGLASER->SetParam(4);
|
||||
else if (value == "设置参数5") IPGLASER->SetParam(5);
|
||||
else if (value == "设置参数6") IPGLASER->SetParam(6);
|
||||
else if (value == "设置参数7") IPGLASER->SetParam(7);
|
||||
else if (value == "设置参数8") IPGLASER->SetParam(8);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void GeneralSetWidget::on_lineEdit_5_textChanged(const QString &arg1)
|
||||
{
|
||||
DEV->ingotNumber = arg1;
|
||||
}
|
||||
|
||||
|
||||
void GeneralSetWidget::on_checkBox_clicked()
|
||||
{
|
||||
bool flag;
|
||||
|
||||
flag = ui->checkBox->isChecked();
|
||||
if (flag)
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
RS_SETTINGS->writeEntry("/PPEnable",1);
|
||||
RS_SETTINGS->endGroup();
|
||||
}
|
||||
else
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
RS_SETTINGS->writeEntry("/PPEnable",0);
|
||||
RS_SETTINGS->endGroup();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void GeneralSetWidget::on_dsbR_check_valueChanged(double arg1)
|
||||
{
|
||||
RS_SETTINGS->beginGroup("device/Rposition");
|
||||
RS_SETTINGS->writeEntry("/RCheckOffset", arg1);
|
||||
RS_SETTINGS->endGroup();
|
||||
}
|
||||
|
||||
void GeneralSetWidget::on_cmbSetParam_currentTextChanged(const QString &arg1)
|
||||
{
|
||||
if (IPGLASER->m_hComm == nullptr)
|
||||
{
|
||||
IPGLASER->OpenComm();
|
||||
}
|
||||
IPGLASER->LaserClose();
|
||||
IPGLASER->getIPGLaerPara("IPGLaser");
|
||||
if (IPGLASER->m_hComm == nullptr)
|
||||
{
|
||||
IPGLASER->OpenComm();
|
||||
}
|
||||
int ret;
|
||||
if (arg1 == "设置参数1")
|
||||
{
|
||||
ret = IPGLASER->SetParam(1);
|
||||
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
QString value1 = RS_SETTINGS->readEntry("/PP1");
|
||||
QString value2 = RS_SETTINGS->readEntry("/PG1");
|
||||
QString value3 = RS_SETTINGS->readEntry("/AM1");
|
||||
QString value4 = RS_SETTINGS->readEntry("/MODE1");
|
||||
RS_SETTINGS->endGroup();
|
||||
ui->lineEdit->setText(value1);
|
||||
ui->lineEdit_2->setText(value2);
|
||||
ui->lineEdit_3->setText(value3);
|
||||
ui->lineEdit_4->setText(value4);
|
||||
}
|
||||
else if (arg1 == "设置参数2")
|
||||
{
|
||||
ret = IPGLASER->SetParam(2);
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
QString value1 = RS_SETTINGS->readEntry("/PP2");
|
||||
QString value2 = RS_SETTINGS->readEntry("/PG2");
|
||||
QString value3 = RS_SETTINGS->readEntry("/AM2");
|
||||
QString value4 = RS_SETTINGS->readEntry("/MODE2");
|
||||
RS_SETTINGS->endGroup();
|
||||
ui->lineEdit->setText(value1);
|
||||
ui->lineEdit_2->setText(value2);
|
||||
ui->lineEdit_3->setText(value3);
|
||||
ui->lineEdit_4->setText(value4);
|
||||
}
|
||||
else if (arg1 == "设置参数3")
|
||||
{
|
||||
ret = IPGLASER->SetParam(3);
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
QString value1 = RS_SETTINGS->readEntry("/PP3");
|
||||
QString value2 = RS_SETTINGS->readEntry("/PG3");
|
||||
QString value3 = RS_SETTINGS->readEntry("/AM3");
|
||||
QString value4 = RS_SETTINGS->readEntry("/MODE3");
|
||||
RS_SETTINGS->endGroup();
|
||||
ui->lineEdit->setText(value1);
|
||||
ui->lineEdit_2->setText(value2);
|
||||
ui->lineEdit_3->setText(value3);
|
||||
ui->lineEdit_4->setText(value4);
|
||||
}
|
||||
else if (arg1 == "设置参数4")
|
||||
{
|
||||
ret = IPGLASER->SetParam(4);
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
QString value1 = RS_SETTINGS->readEntry("/PP4");
|
||||
QString value2 = RS_SETTINGS->readEntry("/PG4");
|
||||
QString value3 = RS_SETTINGS->readEntry("/AM4");
|
||||
QString value4 = RS_SETTINGS->readEntry("/MODE4");
|
||||
RS_SETTINGS->endGroup();
|
||||
ui->lineEdit->setText(value1);
|
||||
ui->lineEdit_2->setText(value2);
|
||||
ui->lineEdit_3->setText(value3);
|
||||
ui->lineEdit_4->setText(value4);
|
||||
}
|
||||
else if (arg1 == "设置参数5")
|
||||
{
|
||||
ret = IPGLASER->SetParam(5);
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
QString value1 = RS_SETTINGS->readEntry("/PP5");
|
||||
QString value2 = RS_SETTINGS->readEntry("/PG5");
|
||||
QString value3 = RS_SETTINGS->readEntry("/AM5");
|
||||
QString value4 = RS_SETTINGS->readEntry("/MODE5");
|
||||
RS_SETTINGS->endGroup();
|
||||
ui->lineEdit->setText(value1);
|
||||
ui->lineEdit_2->setText(value2);
|
||||
ui->lineEdit_3->setText(value3);
|
||||
ui->lineEdit_4->setText(value4);
|
||||
}
|
||||
else if (arg1 == "设置参数6")
|
||||
{
|
||||
ret = IPGLASER->SetParam(6);
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
QString value1 = RS_SETTINGS->readEntry("/PP6");
|
||||
QString value2 = RS_SETTINGS->readEntry("/PG6");
|
||||
QString value3 = RS_SETTINGS->readEntry("/AM6");
|
||||
QString value4 = RS_SETTINGS->readEntry("/MODE6");
|
||||
RS_SETTINGS->endGroup();
|
||||
ui->lineEdit->setText(value1);
|
||||
ui->lineEdit_2->setText(value2);
|
||||
ui->lineEdit_3->setText(value3);
|
||||
ui->lineEdit_4->setText(value4);
|
||||
}
|
||||
else if (arg1 == "设置参数7")
|
||||
{
|
||||
ret = IPGLASER->SetParam(7);
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
QString value1 = RS_SETTINGS->readEntry("/PP7");
|
||||
QString value2 = RS_SETTINGS->readEntry("/PG7");
|
||||
QString value3 = RS_SETTINGS->readEntry("/AM7");
|
||||
QString value4 = RS_SETTINGS->readEntry("/MODE7");
|
||||
RS_SETTINGS->endGroup();
|
||||
ui->lineEdit->setText(value1);
|
||||
ui->lineEdit_2->setText(value2);
|
||||
ui->lineEdit_3->setText(value3);
|
||||
ui->lineEdit_4->setText(value4);
|
||||
}
|
||||
else if (arg1 == "设置参数8")
|
||||
{
|
||||
ret = IPGLASER->SetParam(8);
|
||||
RS_SETTINGS->beginGroup("device/LaserCmb");
|
||||
QString value1 = RS_SETTINGS->readEntry("/PP8");
|
||||
QString value2 = RS_SETTINGS->readEntry("/PG8");
|
||||
QString value3 = RS_SETTINGS->readEntry("/AM8");
|
||||
QString value4 = RS_SETTINGS->readEntry("/MODE8");
|
||||
RS_SETTINGS->endGroup();
|
||||
ui->lineEdit->setText(value1);
|
||||
ui->lineEdit_2->setText(value2);
|
||||
ui->lineEdit_3->setText(value3);
|
||||
ui->lineEdit_4->setText(value4);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#ifndef GENERALSETWIDGET_H
|
||||
#define GENERALSETWIDGET_H
|
||||
#include "ui_generalsetwidget.h"
|
||||
#include "RMS_Dll_global.h"
|
||||
#include "rms_dll.h"
|
||||
class GeneralSetWidget:public QFrame
|
||||
{
|
||||
@@ -14,7 +13,6 @@ public slots:
|
||||
void on_sbPort_valueChanged(int value);
|
||||
void on_dsbZAAxisSafePos_valueChanged(double value);
|
||||
void on_dsbZAAxisSafeVel_valueChanged(double value);
|
||||
void cmbSetParam_currentTextChanged(const QString &value);
|
||||
|
||||
private slots:
|
||||
void on_dsbPanFindHeight_valueChanged(double value);
|
||||
@@ -34,7 +32,7 @@ private slots:
|
||||
void on_dsbGlobalCameraOffset_valueChanged(double arg1);
|
||||
|
||||
|
||||
void on_pbSetPP_clicked();
|
||||
//void on_pbSetPP_clicked();
|
||||
void show_Q_PP();
|
||||
void on_show_image_clicked();
|
||||
|
||||
@@ -46,6 +44,22 @@ private slots:
|
||||
|
||||
void on_Empty_clicked();
|
||||
|
||||
void on_lineEdit_textChanged(const QString &arg1);
|
||||
|
||||
void on_lineEdit_2_textChanged(const QString &arg1);
|
||||
|
||||
void on_lineEdit_3_textChanged(const QString &arg1);
|
||||
|
||||
void on_lineEdit_4_textChanged(const QString &arg1);
|
||||
|
||||
void on_lineEdit_5_textChanged(const QString &arg1);
|
||||
|
||||
void on_checkBox_clicked();
|
||||
|
||||
void on_dsbR_check_valueChanged(double arg1);
|
||||
|
||||
void on_cmbSetParam_currentTextChanged(const QString &arg1);
|
||||
|
||||
private:
|
||||
void loadSet();
|
||||
private:
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -326,7 +326,7 @@ int writePowerfile(QString strFileName, float powerP1,float powerP2)
|
||||
|
||||
// }
|
||||
//}
|
||||
|
||||
#include "deviceproxy.h"
|
||||
void myReadPowerValue()
|
||||
{
|
||||
|
||||
@@ -346,7 +346,7 @@ void myReadPowerValue()
|
||||
{
|
||||
path+=QString("/");
|
||||
}
|
||||
filename = path+"LookupTable_"+timestr+"_laser_test.csv";
|
||||
filename = path+DEV->ingotNumber+"_LookupTable_"+timestr+"_laser_test.csv";
|
||||
|
||||
RS_SETTINGS->beginGroup("device/Rposition");
|
||||
double p1k = RS_SETTINGS->readNumDEntry("/p1k");
|
||||
@@ -415,7 +415,7 @@ void myPidProc()
|
||||
{
|
||||
path+=QString("/");
|
||||
}
|
||||
filename = path+"LookupTable_"+timestr+"_laser_test.csv";
|
||||
filename = path+DEV->ingotNumber+"_LookupTable_"+timestr+"_laser_test.csv";
|
||||
|
||||
RS_SETTINGS->beginGroup("device/Rposition");
|
||||
double p1kt = RS_SETTINGS->readNumDEntry("/p1k_t");
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include "opencv2/opencv.hpp"
|
||||
#include "rs_settings.h"
|
||||
#define NUMBER 3
|
||||
QImage* img=new QImage;
|
||||
|
||||
cv::Mat imgcv;//拼接完成的图片
|
||||
QImage* qimgRecv;//从python返回的img转化为qimage
|
||||
cv::Mat imgRecv;//从python返回的img
|
||||
@@ -210,17 +210,22 @@ void SpecificAreasWidget::on_rbSrcImg_clicked()
|
||||
|
||||
//imgcv = DEV->Func_merge(StartPos,StartPos+(int)GlobalPix*10);
|
||||
cv::cvtColor(imgcv, imgcv, cv::COLOR_BGR2RGB);
|
||||
*img = QImage(imgcv.data, imgcv.cols, imgcv.rows, QImage::Format_RGB888);
|
||||
//QImage img = QImage(imgcv.data, imgcv.cols, imgcv.rows, QImage::Format_RGB888);
|
||||
QImage img= QImage(imgcv.data,imgcv.cols, imgcv.rows,imgcv.cols*3, QImage::Format_RGB888);
|
||||
//调用完成之后把img显示在窗口上
|
||||
|
||||
if((double)img->width()/(double)ui->lbImage->width() >= (double)img->height()/(double)ui->lbImage->height())
|
||||
Mul=(double)img->width()/(double)ui->lbImage->width();
|
||||
// QString fileName = QFileDialog::getSaveFileName(this, tr("png file"), qApp->applicationDirPath(),
|
||||
// tr("Files (*.png)"));
|
||||
// img.save(fileName);
|
||||
|
||||
if((double)img.width()/(double)ui->lbImage->width() >= (double)img.height()/(double)ui->lbImage->height())
|
||||
Mul=(double)img.width()/(double)ui->lbImage->width();
|
||||
else
|
||||
Mul=(double)img->height()/(double)ui->lbImage->height();
|
||||
Mul=(double)img.height()/(double)ui->lbImage->height();
|
||||
|
||||
ui->edLog->append("缩放倍数:" + QString::number(Mul,'f',3));
|
||||
|
||||
*scaledimg=img->scaled(ui->lbImage->width(),ui->lbImage->height(),Qt::KeepAspectRatio);
|
||||
*scaledimg=img.scaled(ui->lbImage->width(),ui->lbImage->height(),Qt::KeepAspectRatio);
|
||||
*scaledimgInit = scaledimg->copy();
|
||||
ui->lbImage->setPixmap(QPixmap::fromImage(*scaledimg));
|
||||
}
|
||||
@@ -233,8 +238,9 @@ void SpecificAreasWidget::on_rbDstImg_clicked()
|
||||
{
|
||||
if (!imgRecv.empty())
|
||||
{
|
||||
const uchar *pSrc = (const uchar*)imgRecv.data;
|
||||
QImage qimgRecv(pSrc, imgRecv.cols, imgRecv.rows, imgRecv.step, QImage::Format_RGB888);
|
||||
//const uchar *pSrc = (const uchar*)imgRecv.data;
|
||||
//QImage qimgRecv(pSrc, imgRecv.cols, imgRecv.rows, imgRecv.step, QImage::Format_RGB888);
|
||||
QImage qimgRecv(imgRecv.data,imgRecv.cols, imgRecv.rows,imgRecv.cols*3, QImage::Format_RGB888);
|
||||
//调用完成之后把img显示在窗口上
|
||||
|
||||
if((double)qimgRecv.width()/(double)ui->lbImage->width() >= (double)qimgRecv.height()/(double)ui->lbImage->height())
|
||||
@@ -257,7 +263,7 @@ void SpecificAreasWidget::ShowMergeSlots()
|
||||
{
|
||||
if (!imgRecv.empty())
|
||||
{
|
||||
const uchar *pSrc = (const uchar*)imgRecv.data;
|
||||
//const uchar *pSrc = (const uchar*)imgRecv.data;
|
||||
/***************************************************************
|
||||
* 修改码:1008610010
|
||||
* 日期:
|
||||
@@ -267,7 +273,9 @@ void SpecificAreasWidget::ShowMergeSlots()
|
||||
* 描述:
|
||||
* Format_Grayscale8改为Format_RGB888
|
||||
**************************************************************/
|
||||
QImage qimgRecv(pSrc, imgRecv.cols, imgRecv.rows, imgRecv.step, QImage::Format_RGB888);
|
||||
//QImage qimgRecv(pSrc, imgRecv.cols, imgRecv.rows, imgRecv.step, QImage::Format_RGB888);
|
||||
QImage qimgRecv(imgRecv.data,imgRecv.cols, imgRecv.rows,imgRecv.cols*3, QImage::Format_RGB888);
|
||||
|
||||
//调用完成之后把img显示在窗口上
|
||||
|
||||
if((double)qimgRecv.width()/(double)ui->lbImage->width() >= (double)qimgRecv.height()/(double)ui->lbImage->height())
|
||||
|
||||
@@ -332,8 +332,11 @@
|
||||
<property name="decimals">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-100.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>200.000000000000000</double>
|
||||
<double>100.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>1.000000000000000</double>
|
||||
|
||||
Reference in New Issue
Block a user