diff --git a/app/gui/oven_control/autocooksettingwidget.cpp b/app/gui/oven_control/autocooksettingwidget.cpp index fd88189..df213c9 100644 --- a/app/gui/oven_control/autocooksettingwidget.cpp +++ b/app/gui/oven_control/autocooksettingwidget.cpp @@ -65,16 +65,6 @@ AutoCookSettingWidget::~AutoCookSettingWidget() delete ui; } -void AutoCookSettingWidget::keyPressEvent(QKeyEvent *event) -{ - -} - -void AutoCookSettingWidget::keyReleaseEvent(QKeyEvent *event) -{ - -} - void AutoCookSettingWidget::setupUi(Cook cook) { ui->cookTypeIcon->setPixmap(Define::icon(cook.type)); @@ -148,18 +138,3 @@ QPushButton:checked { image: url(%3); }"); } } } - -void AutoCookSettingWidget::onEncoderLeft() -{ - -} - -void AutoCookSettingWidget::onEncoderRight() -{ - -} - -void AutoCookSettingWidget::onEncoderClicked(QWidget *clicked) -{ - -} diff --git a/app/gui/oven_control/autocooksettingwidget.h b/app/gui/oven_control/autocooksettingwidget.h index f0b1817..9697a94 100644 --- a/app/gui/oven_control/autocooksettingwidget.h +++ b/app/gui/oven_control/autocooksettingwidget.h @@ -30,21 +30,11 @@ public: explicit AutoCookSettingWidget(AutoCookSetting setting, QWidget *parent = 0); ~AutoCookSettingWidget(); -protected: - void keyPressEvent(QKeyEvent *event); - void keyReleaseEvent(QKeyEvent *event); - private: Ui::AutoCookSettingWidget *ui; QList configWidgets; void setupUi(Cook cook); - - QWidget *pushed = NULL; - - void onEncoderLeft(); - void onEncoderRight(); - void onEncoderClicked(QWidget *clicked); }; #endif // AUTOCOOKSETTINGWIDGET_H diff --git a/app/gui/oven_control/clock.cpp b/app/gui/oven_control/clock.cpp index ed0540f..17282ee 100644 --- a/app/gui/oven_control/clock.cpp +++ b/app/gui/oven_control/clock.cpp @@ -1,10 +1,10 @@ #include "clock.h" #include -#include #include #include #include +#include Clock::Clock(QWidget *parent) : QWidget(parent) { @@ -21,7 +21,7 @@ void Clock::checkUpdate() { if (ticking) { - QTime cur = QDateTime::currentDateTime().time(); + QTime cur = QTime::currentTime(); if (cur.second() != last.second()) { last = cur; @@ -34,7 +34,7 @@ void Clock::checkUpdate() void Clock::paintEvent(QPaintEvent */*event*/) { - QTime time = QDateTime::currentDateTime().time(); + QTime time = QTime::currentTime(); QPainter painter(this); painter.setRenderHint(QPainter::Antialiasing); @@ -46,86 +46,37 @@ void Clock::paintEvent(QPaintEvent */*event*/) QPen hourHand(Qt::white, 11, Qt::SolidLine, Qt::RoundCap); QPen hourArm(Qt::white, 4); - QPen hourLine(Qt::white, 5); QPen minHand(hourHand); QPen minArm(hourArm); - QPen minLine(Qt::white, 2); QPen secHand(Qt::red, 3); QPen capPen(Qt::white, 4); QBrush capBrush(Qt::black, Qt::SolidPattern); - QFont numberFont("Roboto"); - numberFont.setPixelSize(50); - - QFontMetrics numberFontMetrics(numberFont); - - QPen numberPen(Qt::white); - numberPen.setWidth(2); -/* - // Lines - painter.setPen(minLine); - for (int j = 0; j < 60; ++j) { - if ((j % 5) != 0) -// painter.drawLine(92, 0, 96, 0); - painter.drawLine(165, 0, 178, 0); - painter.rotate(6.0); - } - - painter.setPen(hourLine); - for (int i = 0; i < 12; ++i) { -// painter.drawLine(88, 0, 96, 0); -// painter.drawLine(92, 0, 96, 0); - painter.drawLine(165, 0, 178, 0); - painter.rotate(30.0); - } - - // Numbers - painter.setPen(numberPen); - painter.setFont(numberFont); - - QTransform transform; -// QPoint targetPoint(0, -75); - QPoint targetPoint(0, -138); - QPoint transformedTarget(targetPoint); - - QString strings[] = { "12", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11" }; - for (int i = 0; i < 12; i++) { - QString string = strings[i]; - QRect boundingRect = numberFontMetrics.boundingRect(string); - boundingRect.moveCenter(transformedTarget); - painter.drawText(boundingRect, Qt::AlignCenter, string); - - transform.rotate(30.0); - transformedTarget = transform.map(targetPoint); - } -*/ // Needles - qreal second = time.second() + time.msec() / 1000.0; + qreal sec = time.second() + time.msec() / 1000.0; if (ticking) - second = time.second(); + sec = time.second(); - qreal minute = time.minute() + second / 60.0; - qreal hour = time.hour() + minute / 60.0; + qreal min = time.minute() + sec / 60.0; + qreal hour = time.hour() + min / 60.0; // Sec painter.save(); - painter.rotate(6.0 * second); + painter.rotate(6.0 * sec); painter.setPen(secHand); painter.drawLine(0, 28, 0, -155); -// painter.drawImage(-28, -8, secondImg); painter.restore(); // Min painter.save(); - painter.rotate(6.0 * minute); + painter.rotate(6.0 * min); painter.setPen(minArm); painter.drawLine(0, 0, 0, -30); painter.setPen(minHand); painter.drawLine(0, -27, 0, -125); -// painter.drawImage(-8, -9, minuteImg); painter.restore(); // Hour diff --git a/app/gui/oven_control/config.cpp b/app/gui/oven_control/config.cpp index 44cbd95..7ab22b0 100644 --- a/app/gui/oven_control/config.cpp +++ b/app/gui/oven_control/config.cpp @@ -391,7 +391,6 @@ bool Config::loadFavorite(void){ } bool Config::saveFavorite(void){ - bool rst; uint32_t itemp; QFile file(FAVORITE_FILE_NAME); if(file.open(QIODevice::WriteOnly | QIODevice::Text)){ @@ -433,24 +432,6 @@ void Config::removeFavorite(Define::ConfigType idx){ m_setFavorite.remove((uint32_t)idx); } -QString Config::getDateTimeString(uint32_t sec){ - Config* ins = getInstance(); - QString strTemp=""; - if(ins->configlist.items.temptype.d32==0){ - - } - return strTemp; -} - -QString Config::getTempString(int cel_temp){ - Config* ins = getInstance(); - QString strTemp=""; - if(ins->configlist.items.temptype.d32==0){ - - } - return strTemp; -} - QString Config::getProductSerial() { QString strProductSerial; diff --git a/app/gui/oven_control/config.h b/app/gui/oven_control/config.h index 3b236cb..1238cf8 100644 --- a/app/gui/oven_control/config.h +++ b/app/gui/oven_control/config.h @@ -438,8 +438,6 @@ public: void copyConfigArea(const char* buff); void insertFavorite(Define::ConfigType idx); void removeFavorite(Define::ConfigType idx); - static QString getDateTimeString(uint32_t sec); - static QString getTempString(int cel_temp); QString getProductSerial(); diff --git a/app/gui/oven_control/config1digitsetandenablesetdlg.cpp b/app/gui/oven_control/config1digitsetandenablesetdlg.cpp index ef6e99c..a0d43f4 100644 --- a/app/gui/oven_control/config1digitsetandenablesetdlg.cpp +++ b/app/gui/oven_control/config1digitsetandenablesetdlg.cpp @@ -67,7 +67,6 @@ int Config1DigitSetAndEnableSetDlg::getValue(){ void Config1DigitSetAndEnableSetDlg::keyPressEvent(QKeyEvent *event){ - int i = 0; switch (event->key()) { case 0x01000032: // Turn left @@ -86,7 +85,6 @@ void Config1DigitSetAndEnableSetDlg::keyPressEvent(QKeyEvent *event){ } void Config1DigitSetAndEnableSetDlg::keyReleaseEvent(QKeyEvent *event){ - int i = 0; switch (event->key()) { case 0x01000032: // Turn left diff --git a/app/gui/oven_control/config1digitsetdlg.cpp b/app/gui/oven_control/config1digitsetdlg.cpp index 757ef8f..9f2f5c6 100644 --- a/app/gui/oven_control/config1digitsetdlg.cpp +++ b/app/gui/oven_control/config1digitsetdlg.cpp @@ -91,7 +91,6 @@ bool Config1DigitSetDlg::eventFilter(QObject *object, QEvent *event){ } void Config1DigitSetDlg::keyPressEvent(QKeyEvent *event){ - int i = 0; switch (event->key()) { case 0x01000032: // Turn left @@ -110,7 +109,6 @@ void Config1DigitSetDlg::keyPressEvent(QKeyEvent *event){ } void Config1DigitSetDlg::keyReleaseEvent(QKeyEvent *event){ - int i = 0; switch (event->key()) { case 0x01000032: // Turn left diff --git a/app/gui/oven_control/configdatetimedlg.cpp b/app/gui/oven_control/configdatetimedlg.cpp index 6ab5f98..b9d8b32 100644 --- a/app/gui/oven_control/configdatetimedlg.cpp +++ b/app/gui/oven_control/configdatetimedlg.cpp @@ -71,18 +71,12 @@ void ConfigDateTimeDlg::on_ctrBtnOk_clicked() this->accept(); } -void ConfigDateTimeDlg::on_spinBox_valueChanged(int arg1) -{ - -} - void ConfigDateTimeDlg::on_ctrBtnCancel_clicked() { this->reject(); } void ConfigDateTimeDlg::keyPressEvent(QKeyEvent *event){ - int i = 0; switch (event->key()) { case 0x01000032: // Turn left @@ -101,7 +95,6 @@ void ConfigDateTimeDlg::keyPressEvent(QKeyEvent *event){ } void ConfigDateTimeDlg::keyReleaseEvent(QKeyEvent *event){ - int i = 0; switch (event->key()) { case 0x01000032: // Turn left diff --git a/app/gui/oven_control/configdatetimedlg.h b/app/gui/oven_control/configdatetimedlg.h index 073f328..20d3b2f 100644 --- a/app/gui/oven_control/configdatetimedlg.h +++ b/app/gui/oven_control/configdatetimedlg.h @@ -21,8 +21,6 @@ public: private slots: void on_ctrBtnOk_clicked(); - void on_spinBox_valueChanged(int arg1); - void on_ctrBtnCancel_clicked(); void keyCancel_clicked(); diff --git a/app/gui/oven_control/configinfodlg.cpp b/app/gui/oven_control/configinfodlg.cpp index 593482f..729a132 100644 --- a/app/gui/oven_control/configinfodlg.cpp +++ b/app/gui/oven_control/configinfodlg.cpp @@ -165,7 +165,7 @@ void ConfigInfoDlg::loadHotlineServiceInfo(){ } } -void ConfigInfoDlg::keyPressEvent(QKeyEvent *event){ +void ConfigInfoDlg::keyPressEvent(QKeyEvent */*event*/){ } diff --git a/app/gui/oven_control/configwindow.cpp b/app/gui/oven_control/configwindow.cpp index 8b18d21..3cb606c 100644 --- a/app/gui/oven_control/configwindow.cpp +++ b/app/gui/oven_control/configwindow.cpp @@ -20,7 +20,6 @@ ConfigWindow::ConfigWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::ConfigWindow) { - uint32_t idx; ui->setupUi(this); ui->clockContainer->setParent(ui->upperStack); @@ -36,15 +35,6 @@ ConfigWindow::ConfigWindow(QWidget *parent) : config_item item; - - QSetIterator itr = cfg->getConstBeginFavorite(); - while(itr.hasNext()) itr.next(); - - while(itr.hasPrevious()){ - idx = itr.previous(); - //configbtn = new ConfigPanelButton(this,idx); - } - m_nCurConfigPos = config_menu_favorite; reloadUi(); diff --git a/app/gui/oven_control/cookpanelbutton.cpp b/app/gui/oven_control/cookpanelbutton.cpp index 3b6725f..619250b 100644 --- a/app/gui/oven_control/cookpanelbutton.cpp +++ b/app/gui/oven_control/cookpanelbutton.cpp @@ -13,8 +13,8 @@ CookPanelButton::CookPanelButton(CookRecord record, QWidget *parent) : record(record), ui(new Ui::CookPanelButton), rendered(false), - longPressEnabled(false), - emitted(false) + emitted(false), + longPressEnabled(false) { ui->setupUi(this); diff --git a/app/gui/oven_control/electricmodelsettingwindow.cpp b/app/gui/oven_control/electricmodelsettingwindow.cpp index bb7f9d9..e33081a 100644 --- a/app/gui/oven_control/electricmodelsettingwindow.cpp +++ b/app/gui/oven_control/electricmodelsettingwindow.cpp @@ -13,15 +13,11 @@ ElectricModelSettingWindow::ElectricModelSettingWindow(QWidget *parent) : ui->clockContainer->setParent(ui->upperStack); setAttribute(Qt::WA_DeleteOnClose); - - foreach (QPushButton *button, findChildren()) connect(button, &QPushButton::pressed, SoundPlayer::playClick); - Config* cfg = Config::getInstance(); - Define::config_item item; - item = cfg->getConfigValue(Define::config_model); - selitem = item.d32; + Define::config_item item = Config::getInstance()->getConfigValue(Define::config_model); + selitem = (Define::model_type) item.d32; switch(selitem){ case Define::model_electric_10: ui->e10Button->setChecked(true); @@ -35,7 +31,10 @@ ElectricModelSettingWindow::ElectricModelSettingWindow(QWidget *parent) : case Define::model_electric_40: ui->e40Button->setChecked(true); break; + default: + break; } + this->setFocus(); m_vectorTabOrder.append(this); m_vectorTabOrder.append(ui->e10Button); @@ -62,37 +61,27 @@ void ElectricModelSettingWindow::setModel(Define::model_type model) void ElectricModelSettingWindow::on_e10Button_clicked() { - //setModel(Define::model_electric_10); selitem = Define::model_electric_10; } void ElectricModelSettingWindow::on_e20Button_clicked() { - //setModel(Define::model_electric_20); selitem = Define::model_electric_20; } void ElectricModelSettingWindow::on_e24Button_clicked() { - //setModel(Define::model_electric_24); - selitem = Define::model_electric_24; - } void ElectricModelSettingWindow::on_e40Button_clicked() { - //setModel(Define::model_electric_40); - selitem = Define::model_electric_40; } void ElectricModelSettingWindow::on_backButton_clicked() { - Config* cfg = Config::getInstance(); - Define::config_item item; - item = cfg->getConfigValue(Define::config_model); - + Define::config_item item = Config::getInstance()->getConfigValue(Define::config_model); if(selitem != item.d32){ YesNoPopupDlg* yesnopop = new YesNoPopupDlg(this, tr("모델을 변경하시겠습니까?")); yesnopop->setModal(true); diff --git a/app/gui/oven_control/electricmodelsettingwindow.h b/app/gui/oven_control/electricmodelsettingwindow.h index 3d0cb55..ed3ecf7 100644 --- a/app/gui/oven_control/electricmodelsettingwindow.h +++ b/app/gui/oven_control/electricmodelsettingwindow.h @@ -36,7 +36,7 @@ private slots: private: Ui::ElectricModelSettingWindow *ui; - int selitem; + Define::model_type selitem; QWidget *pushed = NULL; QVector m_vectorTabOrder; diff --git a/app/gui/oven_control/fileprocessdlg.cpp b/app/gui/oven_control/fileprocessdlg.cpp index 7309744..46c0168 100644 --- a/app/gui/oven_control/fileprocessdlg.cpp +++ b/app/gui/oven_control/fileprocessdlg.cpp @@ -35,12 +35,9 @@ void ProgramCopyWorker::workerMain(){ uint16_t nCurProgress=0; int nRemainSec = 0; QStringList strdirlist; - QStringList strFilelist; QString srcFilepath; QString destFilePath; - int i; - //make destination folder QDir destdir(m_strDestDir); if(!destdir.isRoot() && destdir.exists()==false){ @@ -298,45 +295,16 @@ void FileProcessDlg::saveHistoryLineData(QTextStream &out, uint16_t i, uint16_t } else{ dt.setTime_t(first_fired); - strLine+= Stringer::DateTimeString(dt,Stringer::datetime_string_type_oneline) + ","; + strLine+= Stringer::dateTime(dt,Stringer::OneLine) + ","; strLine += QString("%1").arg(fired_cnt) + ","; dt.setTime_t(last_fried); - strLine += Stringer::DateTimeString(dt,Stringer::datetime_string_type_oneline) + ","; + strLine += Stringer::dateTime(dt,Stringer::OneLine) + ","; } out << strLine << "\n"; qDebug() << strLine; //} } -void FileProcessDlg::saveHistoryTotalData(QTextStream &out){ - int i = 0; - error_item *item; - time_t firsttimebuf=0,lasttimebuf=0; - uint16_t firecntbuf=0; - QString strLine; - QDateTime dt; - OvenStatistics *ovenst = OvenStatistics::getInstance(); - - //01 상부 점화 장치 데이터 초기화 -// for(i=0;isrvdata->err_log.values[m_arrErrorIdxs[ERROR_HISTORY_UPPERBUNNER][i]]); -// if(i==0) {firsttimebuf = item->first_fired;lasttimebuf = item->last_fried;firecntbuf=item->fired_cnt;} -// else{ -// if( firsttimebuf > item->first_fired && item->first_fired != 0 ) firsttimebuf = item->first_fired; -// if( lasttimebuf < item->last_fried ) lasttimebuf = item->last_fried; -// firecntbuf += item->fired_cnt; -// } - -// } -// total_items[0].fired_cnt = firecntbuf; -// total_items[0].first_fired = firsttimebuf; -// total_items[0].last_fried = lasttimebuf; - - -} - - - void FileProcessDlg::infodataDownload(){ QString strUsbPath; QString strFile; @@ -490,7 +458,6 @@ void FileProcessDlg::servicedataDownload(){ QString strHeader = "no,name,time\n"; QString strFile; QFile file; - error_item *item; uint32_t timetemp, totaltime=0; int i = 1; OvenStatistics *ovs = OvenStatistics::getInstance(); @@ -604,13 +571,11 @@ void FileProcessDlg::onProgressed(int progress, int sec){ min = sec/60; _sec = sec%60; if(min >0){ - //strTemp.sprintf("남은 예상 시간 : %d분 %d초", min, _sec); - strTemp = tr("남은 예상 시간 : %1분 %2초").arg(min).arg(sec); + strTemp = tr("남은 예상 시간 : %1분 %2초").arg(min).arg(_sec); ui->ctrLbRemainTime->setText(strTemp); } else{ - //strTemp.sprintf("남은 예상 시간 : %d초", sec); - strTemp = tr("남은 예상 시간 : %1초").arg(sec); + strTemp = tr("남은 예상 시간 : %1초").arg(_sec); ui->ctrLbRemainTime->setText(strTemp); } } @@ -755,7 +720,6 @@ void FileProcessDlg::standardInfoUpload() { QString strUsbPath; QString strSrcPath; - Config *cfg = Config::getInstance(); if(FileProcessor::detectUSB(strUsbPath)){ strSrcPath = QString("%1/%2").arg(strUsbPath).arg(MODEL_INFO_FILE_NAME); QFile file(MODEL_INFO_FILE_NAME); @@ -808,7 +772,7 @@ void FileProcessDlg::standardInfoUpload() } } -void FileProcessDlg::keyPressEvent(QKeyEvent *event){ +void FileProcessDlg::keyPressEvent(QKeyEvent */*event*/){ } diff --git a/app/gui/oven_control/fileprocessdlg.h b/app/gui/oven_control/fileprocessdlg.h index 7a73421..b9e8d36 100644 --- a/app/gui/oven_control/fileprocessdlg.h +++ b/app/gui/oven_control/fileprocessdlg.h @@ -15,7 +15,6 @@ using namespace Define; using namespace ERROR_LOG_SPACE; - namespace Ui { class FileProcessDlg; } @@ -39,7 +38,6 @@ public slots: void workerMain(); void workerStop(); - signals: void finished(); void progressed(int progress, int sec); @@ -49,9 +47,7 @@ class FileProcessDlg : public QDialog { Q_OBJECT - void saveHistoryLineData(QTextStream &out, uint16_t i, uint16_t cnt, time_t first_fired, time_t last_fried); - void saveHistoryTotalData(QTextStream &out); public: explicit FileProcessDlg(QWidget *parent = 0, ConfigType type = config_invalid, bool isDown = true); diff --git a/app/gui/oven_control/fileprocessgauge.cpp b/app/gui/oven_control/fileprocessgauge.cpp index 85de2fb..0c586d9 100644 --- a/app/gui/oven_control/fileprocessgauge.cpp +++ b/app/gui/oven_control/fileprocessgauge.cpp @@ -12,7 +12,7 @@ FileProcessGauge::FileProcessGauge(QWidget *parent) : PreheatTempGauge(parent) val = 30; } -void FileProcessGauge::paintEvent(QPaintEvent *event){ +void FileProcessGauge::paintEvent(QPaintEvent */*event*/){ QPainter painter(this); painter.setBrush(Qt::NoBrush); painter.setPen(Qt::NoPen); diff --git a/app/gui/oven_control/fileprocessor.cpp b/app/gui/oven_control/fileprocessor.cpp index f9b91b1..da00c79 100644 --- a/app/gui/oven_control/fileprocessor.cpp +++ b/app/gui/oven_control/fileprocessor.cpp @@ -18,8 +18,6 @@ bool FileProcessor::fileExist(const QString &path_file){ } bool FileProcessor::detectUSB(QString &usbPath){ - int curUsbNum=0xff; - bool usbMountErr = false; QString checkUsbName[3] = { "sda", "sdb", diff --git a/app/gui/oven_control/functiontestwindow.cpp b/app/gui/oven_control/functiontestwindow.cpp index e10f2fa..600df62 100644 --- a/app/gui/oven_control/functiontestwindow.cpp +++ b/app/gui/oven_control/functiontestwindow.cpp @@ -124,10 +124,8 @@ void FunctionTestWindow::onEncoderClicked(QWidget *clicked) b->click(); } -bool FunctionTestWindow::readFromRpmFilea(QMap &rpm_map, const QString &filename){ +bool FunctionTestWindow::readFromRpmFile(QMap &rpm_map, const QString &filename){ QFile file(filename); - QString label; - uint32_t value; if(file.open(QIODevice::ReadOnly | QIODevice::Text)){ while(!file.atEnd()){ @@ -184,9 +182,7 @@ void FunctionTestWindow::on_adjustBlowerFan_clicked() strUsbPath = QString("%1%2").arg(strUsbPath).arg(QString(RPM_INFO_FILE_NAME)); - if(readFromRpmFilea(rpm_infos,strUsbPath)){ - - YesNoPopupDlg* dlg = new YesNoPopupDlg(this, tr("송풍기 교정을 하시겠습니까?")); + if(readFromRpmFile(rpm_infos,strUsbPath)){ item.d32 = rpm_infos["config_burner1_pwr1_normal_rpm"]; cfg->setConfigValue(Define::config_burner1_pwr1_normal_rpm, item); diff --git a/app/gui/oven_control/functiontestwindow.h b/app/gui/oven_control/functiontestwindow.h index 84bde0a..b174f9d 100644 --- a/app/gui/oven_control/functiontestwindow.h +++ b/app/gui/oven_control/functiontestwindow.h @@ -43,7 +43,7 @@ private: void onEncoderLeft(); void onEncoderRight(); void onEncoderClicked(QWidget *clicked); - bool readFromRpmFilea(QMap &rpm_map, const QString &filename); + bool readFromRpmFile(QMap &rpm_map, const QString &filename); }; #endif // FUNCTIONTESTWINDOW_H diff --git a/app/gui/oven_control/historylistwindow.cpp b/app/gui/oven_control/historylistwindow.cpp index 9edba44..865f71a 100644 --- a/app/gui/oven_control/historylistwindow.cpp +++ b/app/gui/oven_control/historylistwindow.cpp @@ -88,9 +88,7 @@ void HistoryListWindow::reloadDataset(void){ int i = 0; QString strPrefix = tr("에러"); QString strTemp = ""; - char strTime[64]; error_item *item; - struct tm *timeptr; for(i=0;isetText(strTemp.sprintf("%d",item->fired_cnt)); QDateTime dt; dt.setTime_t(item->first_fired); - m_ctrlFirstTimeLabels[i]->setText(Stringer::DateTimeString(dt, Stringer::datetime_string_type_oneline)); + m_ctrlFirstTimeLabels[i]->setText(Stringer::dateTime(dt, Stringer::OneLine)); dt.setTime_t(item->last_fried); - m_ctrlLastTimeLabels[i]->setText(Stringer::DateTimeString(dt, Stringer::datetime_string_type_oneline)); + m_ctrlLastTimeLabels[i]->setText(Stringer::dateTime(dt, Stringer::OneLine)); } } else{ diff --git a/app/gui/oven_control/manualcooksettingwidget.cpp b/app/gui/oven_control/manualcooksettingwidget.cpp index a30b023..bac3464 100644 --- a/app/gui/oven_control/manualcooksettingwidget.cpp +++ b/app/gui/oven_control/manualcooksettingwidget.cpp @@ -112,53 +112,3 @@ void ManualCookSettingWidget::setFan(int level) break; } } - -void ManualCookSettingWidget::keyPressEvent(QKeyEvent *event) -{ - switch (event->key()) - { - case 0x01000032: // Turn left - onEncoderLeft(); - break; - case 0x01000031: // Push - pushed = focusWidget(); - break; - case 0x01000030: // Turn right - onEncoderRight(); - break; - } -} - -void ManualCookSettingWidget::keyReleaseEvent(QKeyEvent *event) -{ - switch (event->key()) - { - case 0x01000032: // Turn left - onEncoderLeft(); - break; - case 0x01000031: // Push - if (focusWidget() == pushed) - onEncoderClicked(pushed); - - pushed = NULL; - break; - case 0x01000030: // Turn right - onEncoderRight(); - break; - } -} - -void ManualCookSettingWidget::onEncoderLeft() -{ - -} - -void ManualCookSettingWidget::onEncoderRight() -{ - -} - -void ManualCookSettingWidget::onEncoderClicked(QWidget *clicked) -{ - -} diff --git a/app/gui/oven_control/manualcooksettingwidget.h b/app/gui/oven_control/manualcooksettingwidget.h index e4c58ee..33270aa 100644 --- a/app/gui/oven_control/manualcooksettingwidget.h +++ b/app/gui/oven_control/manualcooksettingwidget.h @@ -26,18 +26,8 @@ public: void setCoreTemp(int celsius); void setFan(int level); -protected: - void keyPressEvent(QKeyEvent *event); - void keyReleaseEvent(QKeyEvent *event); - private: Ui::ManualCookSettingWidget *ui; - - QWidget *pushed = NULL; - - void onEncoderLeft(); - void onEncoderRight(); - void onEncoderClicked(QWidget *clicked); }; #endif // MANUALCOOKSETTINGWIDGET_H diff --git a/app/gui/oven_control/notipopupdlg.cpp b/app/gui/oven_control/notipopupdlg.cpp index 40c8b5c..ed296f4 100644 --- a/app/gui/oven_control/notipopupdlg.cpp +++ b/app/gui/oven_control/notipopupdlg.cpp @@ -36,7 +36,7 @@ void NotiPopupDlg::on_ctrBtnOk_clicked() } -void NotiPopupDlg::keyPressEvent(QKeyEvent *event){ +void NotiPopupDlg::keyPressEvent(QKeyEvent */*event*/){ } diff --git a/app/gui/oven_control/oven_control.pro b/app/gui/oven_control/oven_control.pro index f99cb3f..9097705 100644 --- a/app/gui/oven_control/oven_control.pro +++ b/app/gui/oven_control/oven_control.pro @@ -65,7 +65,7 @@ SOURCES += main.cpp\ yesnopopupdlg.cpp \ configpanelbutton.cpp \ config.cpp \ - basicsettingwindow.cpp \ +#basicsettingwindow.cpp \ programmingwindow.cpp \ primewindow.cpp \ cookpanelbutton.cpp \ @@ -184,7 +184,7 @@ HEADERS += mainwindow.h \ yesnopopupdlg.h \ configpanelbutton.h \ config.h \ - basicsettingwindow.h \ + #basicsettingwindow.h \ programmingwindow.h \ primewindow.h \ cookpanelbutton.h \ @@ -280,7 +280,7 @@ FORMS += mainwindow.ui \ adjustmentwindow.ui \ yesnopopupdlg.ui \ configpanelbutton.ui \ - basicsettingwindow.ui \ + #basicsettingwindow.ui \ programmingwindow.ui \ primewindow.ui \ cookpanelbutton.ui \ diff --git a/app/gui/oven_control/realtimesensorwindow.cpp b/app/gui/oven_control/realtimesensorwindow.cpp index e0c5f13..df345f4 100644 --- a/app/gui/oven_control/realtimesensorwindow.cpp +++ b/app/gui/oven_control/realtimesensorwindow.cpp @@ -83,9 +83,7 @@ uint16_t i_temp1,i_temp2; type_temp temp_temp; void RealtimeSensorWindow::reloadUi(void){ - char strTime[64]; QString strTemp=""; - struct tm *timeptr; int i = 0; OvenStatistics* ovs = OvenStatistics::getInstance(); if(ovs!= NULL){ @@ -123,7 +121,7 @@ void RealtimeSensorWindow::reloadUi(void){ dt_tm.setTime_t(m_arrSensorItems[i]->last_high_time); //timeptr = localtime(&(m_arrSensorItems[i]->last_high_time)); //strftime(strTime,64,"%y-%m-%d\n%H:%M:%S",timeptr); - m_arrLbState[3][i]->setText(Stringer::DateTimeString(dt_tm)); + m_arrLbState[3][i]->setText(Stringer::dateTime(dt_tm)); } else{ m_arrLbState[3][i]->setText("-"); diff --git a/app/gui/oven_control/servicedata.cpp b/app/gui/oven_control/servicedata.cpp index 0dfcb7a..15c5192 100644 --- a/app/gui/oven_control/servicedata.cpp +++ b/app/gui/oven_control/servicedata.cpp @@ -108,7 +108,7 @@ bool ServiceData::loadServiceData(void){ bool ServiceData::resetSensorlogData() { memset((void*)sensor_log.data,0x00, sizeof(sensor_statics_log)); - saveServiceData(); + return saveServiceData(); } bool ServiceData::saveServiceData(void){ diff --git a/app/gui/oven_control/servicepassinputdlg.cpp b/app/gui/oven_control/servicepassinputdlg.cpp index 82b8f13..b364a53 100644 --- a/app/gui/oven_control/servicepassinputdlg.cpp +++ b/app/gui/oven_control/servicepassinputdlg.cpp @@ -81,7 +81,6 @@ void ServicePassInputDlg::keyboardInputEvent(QString strIn){ } void ServicePassInputDlg::keyPressEvent(QKeyEvent *event){ - int i = 0; switch (event->key()) { case 0x01000032: // Turn left @@ -100,7 +99,6 @@ void ServicePassInputDlg::keyPressEvent(QKeyEvent *event){ } void ServicePassInputDlg::keyReleaseEvent(QKeyEvent *event){ - int i = 0; switch (event->key()) { case 0x01000032: // Turn left diff --git a/app/gui/oven_control/stringer.cpp b/app/gui/oven_control/stringer.cpp index 25f1ac4..e952d18 100644 --- a/app/gui/oven_control/stringer.cpp +++ b/app/gui/oven_control/stringer.cpp @@ -216,21 +216,21 @@ QString Stringer::unusedTemperature(QString style) } } - -QString Stringer::DateTimeString(const QDateTime &dt_tm, datetime_string_type type) +QString Stringer::dateTime(const QDateTime &dateTime, DateTimeType type) { - QString strTemp; Define::config_item item = Config::getInstance()->getConfigValue(Define::config_time_type); - switch(item.d32){ - case Define::time_type_12h: - if(type == datetime_string_type_oneline) strTemp = dt_tm.toString("yy-MM-dd a hh:mm" ); - else strTemp = dt_tm.toString("yy-MM-dd\na hh:mm" ); - break; + switch(item.d32) + { + case Define::time_type_12h: + if (type == OneLine) + return dateTime.toString("yy-MM-dd a hh:mm"); + else + return dateTime.toString("yy-MM-dd\na hh:mm"); case Define::time_type_24h: default: - if(type == datetime_string_type_oneline) strTemp = dt_tm.toString("yy-MM-dd HH:mm" ); - else strTemp = dt_tm.toString("yy-MM-dd\nHH:mm" ); - break; + if (type == OneLine) + return dateTime.toString("yy-MM-dd HH:mm"); + else + return dateTime.toString("yy-MM-dd\nHH:mm"); } - return strTemp; } diff --git a/app/gui/oven_control/stringer.h b/app/gui/oven_control/stringer.h index ca296ab..f4abc69 100644 --- a/app/gui/oven_control/stringer.h +++ b/app/gui/oven_control/stringer.h @@ -7,10 +7,7 @@ namespace Stringer { -enum datetime_string_type{ - datetime_string_type_oneline=0, - datetime_string_type_twoline -}; +enum DateTimeType { OneLine, TwoLine }; const QString fontSize14("\