12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- #include "JIoMapPage.h"
- #include <Machine.h>
- JIoMapPage::JIoMapPage() {}
- QWidget* JIoMapPage::CreateIoPage(const CONFIG_BASE_STRUCT& control)
- {
- // 1.用到表中的变量
- QString strName = control.strName.c_str();
- // 2. 创建垂直布局
- QHBoxLayout* pHLayout = new QHBoxLayout();
- IoStateLab* pIoState = new IoStateLab();
- pIoState->setIoName(strName);
- QLabel* pAxisNmae = new QLabel();
- QString strAxisName = tr("AxisNmae:", "轴名称:");
- strAxisName += strName;
- pAxisNmae->setText(strAxisName);
- //QLabel* pLow = new QLabel();
- //pLow->setText(tr("Voltage status", "电压状态"));
- //QComboBox* pComBox = new QComboBox();
- //pComBox->addItem(tr("Low", "低电平"));
- //pComBox->addItem(tr("High","高电平"));
- //pComBox->setCurrentIndex(1);
- //// 连接信号和槽
- //connect(pComBox, &QComboBox::currentTextChanged, []() {
- // });
- // 轴名称
- pHLayout->addWidget(pAxisNmae);
- //// 电平组合
- //pHLayout->addWidget(pLow);
- //pHLayout->addWidget(pComBox);
- // 改变状态标记
- pHLayout->addWidget(pIoState);
- QWidget* pWidget = new QWidget;
- pWidget->setLayout(pHLayout);
- return pWidget;
- }
- QWidget* JIoMapPage::CreateAxisTestPage(const CONFIG_BASE_STRUCT& control)
- {
- // 1.用到表中的变量
- QString strName = control.strName.c_str();
- QHBoxLayout* pHLayout = new QHBoxLayout();
- QLabel* pAxisNmae = new QLabel();
- QString strAxisName = tr("AxisNmae:", "轴名称:");
- strAxisName += strName;
- pAxisNmae->setText(strAxisName);
- pHLayout->addWidget(pAxisNmae);
- QLineEdit* pCardNumberType = new QLineEdit(tr("Card Number Type", "卡号类型"));
- pCardNumberType->setText("0");
- pHLayout->addWidget(pCardNumberType);
- QLineEdit* pCardNumber = new QLineEdit(tr("Card Number", "卡号"));
- pCardNumber->setText("0");
- pHLayout->addWidget(pCardNumberType);
- QPushButton* pTest = new QPushButton(tr("Axis Test","轴测试"));
- QObject::connect(pTest, &QPushButton::clicked, [strName]()
- {
- ns_module::CViewMotion::GetInstance()->ShowMotionAdjustPage(strName.toStdString());
- });
- pHLayout->addWidget(pTest);
- QWidget* pWidget = new QWidget;
- pWidget->setLayout(pHLayout);
- return pWidget;
- }
|