From 91480de3c387e5d1ef31fe5e4b508bc0a4d4b322 Mon Sep 17 00:00:00 2001 From: byloveletter Date: Wed, 5 Jul 2017 16:25:47 +0900 Subject: [PATCH] =?UTF-8?q?=EC=84=BC=EC=84=9C=20=EC=8B=A4=EC=8B=9C?= =?UTF-8?q?=EA=B0=84=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EB=A6=AC=EC=85=8B=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/gui/oven_control/ovenstatics.cpp | 5 +++++ app/gui/oven_control/ovenstatics.h | 1 + app/gui/oven_control/realtimesensorwindow.cpp | 7 +++++++ app/gui/oven_control/realtimesensorwindow.h | 2 ++ app/gui/oven_control/realtimesensorwindow.ui | 27 +++++++++++++++++++++++++-- app/gui/oven_control/servicedata.cpp | 8 +++++++- app/gui/oven_control/servicedata.h | 1 + 7 files changed, 48 insertions(+), 3 deletions(-) diff --git a/app/gui/oven_control/ovenstatics.cpp b/app/gui/oven_control/ovenstatics.cpp index f57a7e2..8ac7a14 100644 --- a/app/gui/oven_control/ovenstatics.cpp +++ b/app/gui/oven_control/ovenstatics.cpp @@ -648,6 +648,11 @@ type_temp OvenStatistics::getCurSensorValueByIdx(uint16_t idx){ return curSensorValue[idx]; } +void OvenStatistics::resetSensorHistory() +{ + srvdata->resetSensorlogData(); +} + void OvenStatistics::onErrorPopupClosed(int erridx){ qDebug() << "error idx" << erridx; if(m_mapPopupList.find(erridx)!= m_mapPopupList.end()){ diff --git a/app/gui/oven_control/ovenstatics.h b/app/gui/oven_control/ovenstatics.h index 4061379..fb26f5b 100644 --- a/app/gui/oven_control/ovenstatics.h +++ b/app/gui/oven_control/ovenstatics.h @@ -204,6 +204,7 @@ public: realtime_data getPartsRealtimeData(void); uint8_t getSensorTypeByIdx(uint16_t idx); type_temp getCurSensorValueByIdx(uint16_t idx); + void resetSensorHistory(void); private: diff --git a/app/gui/oven_control/realtimesensorwindow.cpp b/app/gui/oven_control/realtimesensorwindow.cpp index cf62a68..e0c5f13 100644 --- a/app/gui/oven_control/realtimesensorwindow.cpp +++ b/app/gui/oven_control/realtimesensorwindow.cpp @@ -177,3 +177,10 @@ void RealtimeSensorWindow::keyReleaseEvent(QKeyEvent *event) } } + +void RealtimeSensorWindow::on_resetButton_clicked() +{ + OvenStatistics* ovs = OvenStatistics::getInstance(); + ovs->resetSensorHistory(); + reloadUi(); +} diff --git a/app/gui/oven_control/realtimesensorwindow.h b/app/gui/oven_control/realtimesensorwindow.h index ca917f8..d7558be 100644 --- a/app/gui/oven_control/realtimesensorwindow.h +++ b/app/gui/oven_control/realtimesensorwindow.h @@ -28,6 +28,8 @@ private slots: void on_backButton_clicked(); void oneSecTimerFired(void); + void on_resetButton_clicked(); + private: const uint16_t m_arrSensorItemIdxs[REALSENSOR_CONTROL_LIST_ITEM_MAX]={ 0,1,4,5,6,7,8,12,13 diff --git a/app/gui/oven_control/realtimesensorwindow.ui b/app/gui/oven_control/realtimesensorwindow.ui index 9a018eb..af5c516 100644 --- a/app/gui/oven_control/realtimesensorwindow.ui +++ b/app/gui/oven_control/realtimesensorwindow.ui @@ -109,7 +109,7 @@ - 343 + 291 26 97 97 @@ -132,7 +132,7 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/b - 457 + 401 26 97 97 @@ -152,6 +152,29 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/h + + + + 512 + 26 + 97 + 97 + + + + + 0 + 0 + + + + QPushButton { border-image: url(:/images/bottom_bar/006_sys_icon_14.png); } +QPushButton:pressed , QPushButton:focus{ border-image: url(:/images/bottom_bar/006_sys_icon_14_ov.png); } + + + + + diff --git a/app/gui/oven_control/servicedata.cpp b/app/gui/oven_control/servicedata.cpp index 9c0d269..0dfcb7a 100644 --- a/app/gui/oven_control/servicedata.cpp +++ b/app/gui/oven_control/servicedata.cpp @@ -102,7 +102,13 @@ bool ServiceData::loadServiceData(void){ }else{ qDebug()<<"FRAM FILE Open fail!!"; } - return true; + return true; +} + +bool ServiceData::resetSensorlogData() +{ + memset((void*)sensor_log.data,0x00, sizeof(sensor_statics_log)); + saveServiceData(); } bool ServiceData::saveServiceData(void){ diff --git a/app/gui/oven_control/servicedata.h b/app/gui/oven_control/servicedata.h index 6e1ef0a..75bd50c 100644 --- a/app/gui/oven_control/servicedata.h +++ b/app/gui/oven_control/servicedata.h @@ -196,6 +196,7 @@ public: uint16_t m_nRepeatErrorIdx; bool saveServiceData(void); bool loadServiceData(void); + bool resetSensorlogData(void); }; #endif // SERVICEDATA_H -- 2.1.4