This commit is contained in:
Chenwenxuan
2024-03-06 14:54:30 +08:00
commit edac2715f0
1525 changed files with 809982 additions and 0 deletions

View File

@@ -0,0 +1,170 @@
#include "absmovesetwidget.h"
#include "rs_settings.h"
#include "deviceinfo.h"
#include "deviceproxy.h"
ABSMoveSetWidget::ABSMoveSetWidget(QWidget *parent)
:QFrame(parent)
,ui(new Ui::ABSMoveSetWidget)
{
ui->setupUi(this);
loadSet();
}
void ABSMoveSetWidget::loadSet()
{
// 加载PTP位置设置
RS_SETTINGS->beginGroup("device/ABSMove/Vel");
double XAxisVel = RS_SETTINGS->readNumDEntry("/XAxis");
double YAxisVel = RS_SETTINGS->readNumDEntry("/YAxis");
double ZAxisVel = RS_SETTINGS->readNumDEntry("/ZAxis");
double ZAAxisVel = RS_SETTINGS->readNumDEntry("/ZAAxis");
RS_SETTINGS->endGroup();
ui->dsbXAxisVel->setValue(XAxisVel);
ui->dsbYAxisVel->setValue(YAxisVel);
ui->dsbZAxisVel->setValue(ZAxisVel);
ui->dsbZAAxisVel->setValue(ZAAxisVel);
RS_SETTINGS->beginGroup("device/ABSMove/Safe");
double X1 = RS_SETTINGS->readNumDEntry("/X1");
double X2 = RS_SETTINGS->readNumDEntry("/X2");
double Y1 = RS_SETTINGS->readNumDEntry("/Y1");
double Y2 = RS_SETTINGS->readNumDEntry("/Y2");
double CompensationX1 = RS_SETTINGS->readNumDEntry("/CompensationX1");
double CompensationX2 = RS_SETTINGS->readNumDEntry("/CompensationX2");
double CompensationOffset = RS_SETTINGS->readNumDEntry("/CompensationOffset");
double CompensationMaxValue = RS_SETTINGS->readNumDEntry("/CompensationMaxValue");
RS_SETTINGS->endGroup();
ui->dsbX1->setValue(X1);
ui->dsbX2->setValue(X2);
ui->dsbY1->setValue(Y1);
ui->dsbY2->setValue(Y2);
ui->dsbCompensationX1->setValue(CompensationX1);
ui->dsbCompensationX2->setValue(CompensationX2);
ui->dsbCompensationOffset->setValue(CompensationOffset);
ui->dsbCompensationMaxValue->setValue(CompensationMaxValue);
//ui->dsbZ1->setValue(Z1);
//ui->label_9->setVisible(false);
//ui->dsbZZA->setVisible(false);
//DEV->ZZA = ZZA;
}
void ABSMoveSetWidget::on_dsbXAxisVel_valueChanged(double value)
{
RS_SETTINGS->beginGroup("device/ABSMove/Vel");
RS_SETTINGS->writeEntry("/XAxis", value);
RS_SETTINGS->endGroup();
DEVICE_INFO->printDeviceSystemInfo(QString("X轴绝对运动速度改变为%1mm/s").arg(value));
}
void ABSMoveSetWidget::on_dsbYAxisVel_valueChanged(double value)
{
RS_SETTINGS->beginGroup("device/ABSMove/Vel");
RS_SETTINGS->writeEntry("/YAxis", value);
RS_SETTINGS->endGroup();
DEVICE_INFO->printDeviceSystemInfo(QString("Y轴绝对运动速度改变为%1mm/s").arg(value));
}
void ABSMoveSetWidget::on_dsbZAxisVel_valueChanged(double value)
{
RS_SETTINGS->beginGroup("device/ABSMove/Vel");
RS_SETTINGS->writeEntry("/ZAxis", value);
RS_SETTINGS->endGroup();
DEVICE_INFO->printDeviceSystemInfo(QString("Z1轴绝对运动速度改变为%1mm/s").arg(value));
}
void ABSMoveSetWidget::on_dsbZAAxisVel_valueChanged(double value)
{
RS_SETTINGS->beginGroup("device/ABSMove/Vel");
RS_SETTINGS->writeEntry("/ZAAxis", value);
RS_SETTINGS->endGroup();
DEVICE_INFO->printDeviceSystemInfo(QString("Z轴绝对运动速度改变为%1mm/s").arg(value));
}
void ABSMoveSetWidget::on_dsbX1_valueChanged(double value)
{
RS_SETTINGS->beginGroup("device/ABSMove/Safe");
RS_SETTINGS->writeEntry("/X1", value);
RS_SETTINGS->endGroup();
//DEVICE_INFO->printDeviceSystemInfo(QString("安全范围X1改变为%1mm/s").arg(value));
}
void ABSMoveSetWidget::on_dsbX2_valueChanged(double value)
{
RS_SETTINGS->beginGroup("device/ABSMove/Safe");
RS_SETTINGS->writeEntry("/X2", value);
RS_SETTINGS->endGroup();
//DEVICE_INFO->printDeviceSystemInfo(QString("安全范围X2改变为%1mm/s").arg(value));
}
void ABSMoveSetWidget::on_dsbY1_valueChanged(double value)
{
RS_SETTINGS->beginGroup("device/ABSMove/Safe");
RS_SETTINGS->writeEntry("/Y1", value);
RS_SETTINGS->endGroup();
//DEVICE_INFO->printDeviceSystemInfo(QString("安全范围Y1改变为%1mm/s").arg(value));
}
void ABSMoveSetWidget::on_dsbY2_valueChanged(double value)
{
RS_SETTINGS->beginGroup("device/ABSMove/Safe");
RS_SETTINGS->writeEntry("/Y2", value);
RS_SETTINGS->endGroup();
//DEVICE_INFO->printDeviceSystemInfo(QString("安全范围Y2改变为%1mm/s").arg(value));
}
//void ABSMoveSetWidget::on_dsbZZA_valueChanged(double value)
//{
// RS_SETTINGS->beginGroup("device/ABSMove/Safe");
// RS_SETTINGS->writeEntry("/ZZA", value);
// RS_SETTINGS->endGroup();
// DEVICE_INFO->printDeviceSystemInfo(QString("安全范围Z+ZA改变为%1mm/s").arg(value));
// //DEV->ZZA = value;
//}
//void ABSMoveSetWidget::on_dsbZ1_valueChanged(double arg1)
//{
// RS_SETTINGS->beginGroup("device/ABSMove/Safe");
// RS_SETTINGS->writeEntry("/Z1", arg1);
// RS_SETTINGS->endGroup();
// DEVICE_INFO->printDeviceSystemInfo(QString("加工偏差:%1mm/s").arg(arg1));
// //DEV->ZZA = value;
//}
void ABSMoveSetWidget::on_dsbCompensationX1_valueChanged(double arg1)
{
RS_SETTINGS->beginGroup("device/ABSMove/Safe");
RS_SETTINGS->writeEntry("/CompensationX1", arg1);
RS_SETTINGS->endGroup();
//DEVICE_INFO->printDeviceSystemInfo(QString("补偿范围X1改变为%1mm/s").arg(arg1));
}
void ABSMoveSetWidget::on_dsbCompensationX2_valueChanged(double arg1)
{
RS_SETTINGS->beginGroup("device/ABSMove/Safe");
RS_SETTINGS->writeEntry("/CompensationX2", arg1);
RS_SETTINGS->endGroup();
//DEVICE_INFO->printDeviceSystemInfo(QString("补偿范围X2改变为%1mm/s").arg(arg1));
}
void ABSMoveSetWidget::on_dsbCompensationOffset_valueChanged(double arg1)
{
RS_SETTINGS->beginGroup("device/ABSMove/Safe");
RS_SETTINGS->writeEntry("/CompensationOffset", arg1);
RS_SETTINGS->endGroup();
//DEVICE_INFO->printDeviceSystemInfo(QString("补偿偏移改变为:%1mm/s").arg(arg1));
}
void ABSMoveSetWidget::on_dsbCompensationMaxValue_valueChanged(double arg1)
{
RS_SETTINGS->beginGroup("device/ABSMove/Safe");
RS_SETTINGS->writeEntry("/CompensationMaxValue", arg1);
RS_SETTINGS->endGroup();
DEVICE_INFO->printDeviceSystemInfo(QString("最大补偿值改变为:%1mm/s").arg(arg1));
}