#include #include "operationtimeparts.h" #include "ui_operationtimeparts.h" #include "ovenstatics.h" operationTimeParts::operationTimeParts(QWidget *parent) : QMainWindow(parent), ui(new Ui::operationTimeParts) { int i=0; OvenStatistics* ovs = OvenStatistics::getInstance(); ui->setupUi(this); m_arrTimeLabels[0] = ui->m_ctrlLbListTime_1; m_arrTimeLabels[1] = ui->m_ctrlLbListTime_2; m_arrTimeLabels[2] = ui->m_ctrlLbListTime_3; m_arrTimeLabels[3] = ui->m_ctrlLbListTime_4; m_arrTimeLabels[4] = ui->m_ctrlLbListTime_5; m_arrTimeLabels[5] = ui->m_ctrlLbListTime_6; m_arrTimeLabels[6] = ui->m_ctrlLbListTime_7; m_arrTimeLabels[7] = ui->m_ctrlLbListTime_8; m_arrTimeLabels[8] = ui->m_ctrlLbListTime_9; m_arrTimeLabels[9] = ui->m_ctrlLbListTime_10; m_arrTimeLabels[10] = ui->m_ctrlLbListTime_11; m_arrResetBtn[0] = ui->btnReset_1; m_arrResetBtn[1] = ui->btnReset_2; m_arrResetBtn[2] = ui->btnReset_3; m_arrResetBtn[3] = ui->btnReset_4; m_arrResetBtn[4] = ui->btnReset_5; m_arrResetBtn[5] = ui->btnReset_6; m_arrResetBtn[6] = ui->btnReset_7; m_arrResetBtn[7] = ui->btnReset_8; m_arrResetBtn[8] = ui->btnReset_9; m_arrResetBtn[9] = ui->btnReset_10; m_arrResetBtn[10] = ui->btnReset_11; m_btnGrops = new QButtonGroup(); for(i=0;iaddButton(m_arrResetBtn[i],i); } connect(m_btnGrops,SIGNAL(buttonClicked(int)),this,SLOT(on_btnResets_clicked(int))); if(ovs != NULL){ for( i =0;isrvdatas->use_log.values[m_arrPartItemIdxs[i]]); } else m_arrUseItems[i] = NULL; } } reloadUi(); } operationTimeParts::~operationTimeParts() { delete ui; } void operationTimeParts::on_backButton_clicked() { deleteLater(); } void operationTimeParts::reloadUi(void){ uint32_t timetemp; OvenStatistics* ovs = OvenStatistics::getInstance(); QString strTemp=""; int i = 0; if(ovs != NULL){ for(i = 0; isetText(strTemp); } else{ m_arrTimeLabels[i]->setText("-"); } } } else{ for(i=0;isetText("-"); } } } void operationTimeParts::on_btnReset_2_clicked() { } void operationTimeParts::on_btnResets_clicked(int idx){ qDebug() << "PUSH BUTTON " << idx; if(idx < OPERATION_TIME_CONTROL_MAX){ if(m_arrUseItems[idx] !=NULL){ *m_arrUseItems[idx]=0; reloadUi(); } } }