1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- #include "ProgrammPage.h"
- #include "QTimer"
- #include "Src/Common/JSignalSlotManager.h"
- ProgrammPage::ProgrammPage(QWidget *parent)
- : QWidget(parent)
- {
- ui.setupUi(this);
- //this->setAttribute(Qt::WA_DeleteOnClose);
- ui.tabWidget->tabBar()->setStyleSheet("QTabBar::tab { min-width: 50px; max-width: 80px; }");
- InitPage();
- }
- ProgrammPage::~ProgrammPage()
- {
- //qDebug() << "enter sedtruct function !!!";
- }
- void ProgrammPage::InitPage()
- {
- m_pTempControlPage = new TempControlPage;
- ui.ProgramPage->addTab(m_pTempControlPage, tr("Temperature control", "温度控制"));
- // 连接选项卡切换信号
- connect(ui.tabWidget, &QTabWidget::currentChanged, this, &ProgrammPage::onTabChanged);
- onTabChanged(0);
- }
- void ProgrammPage::onTabChanged(int index)
- {
- switch (index)
- {
- case 0: // Bond Matrix 页面
- if (!m_BondMatrixProgramPage)
- {
- qDebug() << "创建 BondMatrixProgramPage";
- m_BondMatrixProgramPage = new BondMatrixProgramPage(this);
- ui.verticalLayoutBondMatrix->addWidget(m_BondMatrixProgramPage);
- }
- break;
- case 1: // Wafer 页面
- if (!m_WaferProgramPage)
- {
- qDebug() << "创建 WaferProgramPage";
- m_WaferProgramPage = new WaferProgramPage(this);
- ui.verticalLayoutWaferMatrix->addWidget(m_WaferProgramPage);
- }
- break;
- case 2: // Waffle 页面
- if (!m_pWaffleProgrammPage)
- {
- qDebug() << "创建 WaffleProgramPage";
- m_pWaffleProgrammPage = new WaffleProgramPage(this);
- ui.verticalLayoutWaffleMatrix->addWidget(m_pWaffleProgrammPage);
- }
- break;
- case 3: // Template 页面
- if (!m_TemplateProgramPage)
- {
- qDebug() << "创建 TemplateProgramPage";
- m_TemplateProgramPage = new TemplateProgramPage(this);
- ui.verticalLayoutTemplate->addWidget(m_TemplateProgramPage);
- }
- break;
- }
- // 如果当前页不是 Template 页面,发送信号
- if (index != 3) {
- if (m_TemplateProgramPage && m_TemplateProgramPage->m_StrategyOrTemplateChanged) {
- qDebug() << "切换离开 Template 页面,发送信号";
- QTSignalSlotManager::get_instance()->SendSignalUpdateBondMatrixTemplateID(1, -1);
- m_TemplateProgramPage->m_StrategyOrTemplateChanged = false;
- }
- }
- }
|