849 lines
27 KiB
C++
849 lines
27 KiB
C++
#include "generalsetwidget.h"
|
||
#include "deviceproxy.h"
|
||
#include "rs_settings.h"
|
||
#include "deviceinfo.h"
|
||
#include "IPG_laser.h"
|
||
#include "imagebox.h"
|
||
#include "modbustcp.h"
|
||
|
||
|
||
GeneralSetWidget::GeneralSetWidget(QWidget* parent):
|
||
QFrame(parent),
|
||
ui(new Ui::GeneralSetWidget)
|
||
{
|
||
ui->setupUi(this);
|
||
|
||
QStringList doTextList;
|
||
for(auto i=0;i<8;i++)
|
||
{
|
||
doTextList.append("设置参数"+QString::number(i+1));
|
||
}
|
||
|
||
ui->cmbSetParam->addItems(doTextList);
|
||
|
||
connect(DEV,SIGNAL(show_Q_PP_SGL()),this,SLOT(show_Q_PP()));
|
||
loadSet();
|
||
//ui->pbLaserSet2->setVisible(false);
|
||
|
||
}
|
||
|
||
void GeneralSetWidget::loadSet()
|
||
{
|
||
RS_SETTINGS->beginGroup("device/Comm/NET");
|
||
QString ip = RS_SETTINGS->readEntry("/ip");
|
||
int port = RS_SETTINGS->readNumEntry("/port");
|
||
RS_SETTINGS->endGroup();
|
||
|
||
ui->leIP->setIp(ip);
|
||
ui->sbPort->setValue(port);
|
||
|
||
RS_SETTINGS->beginGroup("device/ZAAxisSafe");
|
||
double ZAAxisSafePos = RS_SETTINGS->readNumDEntry("/pos");
|
||
double ZAAxisSafeVel = RS_SETTINGS->readNumDEntry("/vel");
|
||
RS_SETTINGS->endGroup();
|
||
|
||
ui->dsbZAAxisSafePos->setValue(ZAAxisSafePos);
|
||
ui->dsbZAAxisSafeVel->setValue(ZAAxisSafeVel);
|
||
|
||
|
||
RS_SETTINGS->beginGroup("device/Rposition");
|
||
//double FindCameraPos = RS_SETTINGS->readNumDEntry("/FindCamera");
|
||
double PanFindHeightPos = RS_SETTINGS->readNumDEntry("/Palletheight");
|
||
RS_SETTINGS->endGroup();
|
||
|
||
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");
|
||
RS_SETTINGS->endGroup();
|
||
|
||
RS_SETTINGS->beginGroup("device/Rposition");
|
||
double GlobalCameraOffset = RS_SETTINGS->readNumDEntry("/GlobalCameraOffset");
|
||
RS_SETTINGS->endGroup();
|
||
|
||
//ui->dsbFindCamera->setValue(FindCameraPos);
|
||
ui->dsbPanFindHeight->setValue(PanFindHeightPos);
|
||
ui->dsbFindEdageOffset->setValue(FindEdageOffset);
|
||
//ui->dsbPixelSize->setValue(PixelSize);
|
||
ui->dsbGlobalCameraOffset->setValue(GlobalCameraOffset);
|
||
|
||
RS_SETTINGS->beginGroup("device/Para");
|
||
DEV->R_detection_pm = RS_SETTINGS->readNumDEntry("/dsbPPM");
|
||
RS_SETTINGS->endGroup();
|
||
ui->dsbPP_M->setValue(DEV->R_detection_pm);
|
||
|
||
RS_SETTINGS->beginGroup("device/Para");
|
||
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)
|
||
{
|
||
RS_SETTINGS->beginGroup("device/Comm/NET");
|
||
RS_SETTINGS->writeEntry("/ip", value);
|
||
RS_SETTINGS->endGroup();
|
||
//DEVICE_INFO->printDeviceSystemInfo(QString("待连接IP(控制器)改变为:%1").arg(value));
|
||
}
|
||
|
||
void GeneralSetWidget::on_sbPort_valueChanged(int value)
|
||
{
|
||
RS_SETTINGS->beginGroup("device/Comm/NET");
|
||
RS_SETTINGS->writeEntry("/port", value);
|
||
RS_SETTINGS->endGroup();
|
||
//DEVICE_INFO->printDeviceSystemInfo(QString("待连接Port(控制器)设置为:%1").arg(value));
|
||
}
|
||
|
||
void GeneralSetWidget::on_dsbZAAxisSafePos_valueChanged(double value)
|
||
{
|
||
RS_SETTINGS->beginGroup("device/ZAAxisSafe");
|
||
RS_SETTINGS->writeEntry("/pos", value);
|
||
RS_SETTINGS->endGroup();
|
||
DEVICE_INFO->printDeviceSystemInfo(QString("Z轴安全位置设置为:%1mm").arg(value));
|
||
}
|
||
|
||
void GeneralSetWidget::on_dsbZAAxisSafeVel_valueChanged(double value)
|
||
{
|
||
RS_SETTINGS->beginGroup("device/ZAAxisSafe");
|
||
RS_SETTINGS->writeEntry("/vel", value);
|
||
RS_SETTINGS->endGroup();
|
||
DEVICE_INFO->printDeviceSystemInfo(QString("Z轴回安全位置速度设置为:%1mm/s").arg(value));
|
||
}
|
||
|
||
|
||
void GeneralSetWidget::on_dsbPanFindHeight_valueChanged(double value)
|
||
{
|
||
RS_SETTINGS->beginGroup("device/Rposition");
|
||
RS_SETTINGS->writeEntry("/Palletheight", value);
|
||
RS_SETTINGS->endGroup();
|
||
DEVICE_INFO->printDeviceSystemInfo(QString("托盘高度设置为:%1mm/s").arg(value));
|
||
}
|
||
|
||
|
||
//void GeneralSetWidget::on_chkPID_clicked()
|
||
//{
|
||
// if (ui->chkPID->checkState() == Qt::Checked)
|
||
// {
|
||
// DEV->PidFlag = true;
|
||
// }
|
||
// else
|
||
// {
|
||
// DEV->PidFlag = false;
|
||
// }
|
||
|
||
//}
|
||
|
||
void GeneralSetWidget::on_pbLaserCnn_clicked()
|
||
{
|
||
//DEV->laserCtlCnn();
|
||
if (IPGLASER->m_hComm == nullptr)
|
||
{
|
||
|
||
IPGLASER->getIPGLaerPara("IPGLaser");
|
||
bool ret = IPGLASER->OpenComm();
|
||
if (!ret)
|
||
{
|
||
QMessageBox msg(this);
|
||
DEVICE_INFO->printDeviceSalamInfo("激光器串口打开错误!");
|
||
msg.setWindowTitle("异常提示");
|
||
msg.setText("激光器串口打开错误!");
|
||
msg.setIcon(QMessageBox::Critical);
|
||
msg.exec();
|
||
return;
|
||
}
|
||
|
||
}
|
||
}
|
||
|
||
void GeneralSetWidget::on_pbLaserClose_clicked()
|
||
{
|
||
bool ret;
|
||
int retclose;
|
||
retclose = IPGLASER->LaserClose();
|
||
ret = IPGLASER->CloseComm();
|
||
|
||
if (!ret || (retclose < 0))
|
||
{
|
||
{
|
||
QMessageBox msg(this);
|
||
DEVICE_INFO->printDeviceSalamInfo("激光器串口关闭错误!");
|
||
msg.setWindowTitle("异常提示");
|
||
msg.setText("激光器串口关闭错误!");
|
||
msg.setIcon(QMessageBox::Critical);
|
||
msg.exec();
|
||
return;
|
||
}
|
||
}
|
||
DEV->devLaserOpenTime = 0;
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
void GeneralSetWidget::on_pbLaserSet2_clicked()
|
||
{
|
||
|
||
if (ui->cmbBiaoDing->currentText() == "T标定")
|
||
DEV->BiaoDingFlag = true;
|
||
else
|
||
DEV->BiaoDingFlag = false;
|
||
DEV->GetRatioP1P2();
|
||
}
|
||
|
||
void GeneralSetWidget::on_dsbFindEdageOffset_valueChanged(double arg1)
|
||
{
|
||
RS_SETTINGS->beginGroup("device/Rposition");
|
||
RS_SETTINGS->writeEntry("/FindEdageOffset", arg1);
|
||
RS_SETTINGS->endGroup();
|
||
//DEVICE_INFO->printDeviceSystemInfo(QString("寻边Y轴偏移改变为:%1mm/s").arg(arg1));
|
||
}
|
||
|
||
//void GeneralSetWidget::on_dsbPixelSize_valueChanged(double arg1)
|
||
//{
|
||
// RS_SETTINGS->beginGroup("device/Rposition");
|
||
// RS_SETTINGS->writeEntry("/PixelSize", arg1);
|
||
// RS_SETTINGS->endGroup();
|
||
// //DEVICE_INFO->printDeviceSystemInfo(QString("像素尺寸改变为:%1mm/s").arg(arg1));
|
||
//}
|
||
|
||
void GeneralSetWidget::on_dsbGlobalCameraOffset_valueChanged(double arg1)
|
||
{
|
||
RS_SETTINGS->beginGroup("device/Rposition");
|
||
RS_SETTINGS->writeEntry("/GlobalCameraOffset", arg1);
|
||
RS_SETTINGS->endGroup();
|
||
//DEVICE_INFO->printDeviceSystemInfo(QString("全局相机偏移改变为:%1mm/s").arg(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::show_Q_PP()
|
||
{
|
||
ui->dsbQ_T->setValue(DEV->R_detection_pt);
|
||
ui->dsbQ_S->setValue(DEV->R_detection_ps);
|
||
ui->dsbPP_T->setValue(DEV->getPP(DEV->R_detection_pt,true));
|
||
ui->dsbPP_S->setValue(DEV->getPP(DEV->R_detection_ps,false));
|
||
ui->dsbR->setValue(DEV->mode*1000);
|
||
}
|
||
|
||
void GeneralSetWidget::on_show_image_clicked()
|
||
{
|
||
//DEV->imageGet();
|
||
ImageBox *form = new ImageBox;
|
||
form->show();
|
||
}
|
||
|
||
void GeneralSetWidget::on_dsbPP_M_valueChanged(double arg1)
|
||
{
|
||
RS_SETTINGS->beginGroup("device/Para");
|
||
RS_SETTINGS->writeEntry("/dsbPPM", arg1);
|
||
RS_SETTINGS->endGroup();
|
||
}
|
||
|
||
void GeneralSetWidget::on_dsbPP_O_valueChanged(double arg1)
|
||
{
|
||
RS_SETTINGS->beginGroup("device/Para");
|
||
RS_SETTINGS->writeEntry("/dsbPPO", arg1);
|
||
RS_SETTINGS->endGroup();
|
||
}
|
||
|
||
|
||
void GeneralSetWidget::on_Empty_clicked()
|
||
{
|
||
|
||
char* ip;
|
||
|
||
DEV->StopElectricResistanceCheckFlag = false;
|
||
int step = 0;
|
||
bool hasToBuffer = false;
|
||
|
||
QByteArray ba = MODBUSTCP->ipAddr_electric_resistance.toLatin1(); // must AF_LOCAL
|
||
ip=ba.data();
|
||
//bool ret = rms.RMS_Connect(ip,QString("10001").toUShort());
|
||
bool ret = DEV->rms.RMS_Connect("192.168.1.10",QString("10001").toUShort());
|
||
if (!ret)
|
||
{
|
||
//DEV->rms.RMS_Disconnect();
|
||
return;
|
||
}
|
||
|
||
DEV->rms.RMS_Read_Empty();
|
||
}
|
||
|
||
void GeneralSetWidget::on_oneDot_clicked()
|
||
{
|
||
double single = DEV->rms.RMS_Read_Single();
|
||
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);
|
||
}
|
||
|
||
}
|