Commit 91480de3c387e5d1ef31fe5e4b508bc0a4d4b322
1 parent
ecc75a7273
Exists in
master
and in
2 other branches
센서 실시간 데이터 리셋 기능 추가
Showing
7 changed files
with
48 additions
and
3 deletions
Show diff stats
app/gui/oven_control/ovenstatics.cpp
| @@ -648,6 +648,11 @@ type_temp OvenStatistics::getCurSensorValueByIdx(uint16_t idx){ | @@ -648,6 +648,11 @@ type_temp OvenStatistics::getCurSensorValueByIdx(uint16_t idx){ | ||
| 648 | return curSensorValue[idx]; | 648 | return curSensorValue[idx]; |
| 649 | } | 649 | } |
| 650 | 650 | ||
| 651 | +void OvenStatistics::resetSensorHistory() | ||
| 652 | +{ | ||
| 653 | + srvdata->resetSensorlogData(); | ||
| 654 | +} | ||
| 655 | + | ||
| 651 | void OvenStatistics::onErrorPopupClosed(int erridx){ | 656 | void OvenStatistics::onErrorPopupClosed(int erridx){ |
| 652 | qDebug() << "error idx" << erridx; | 657 | qDebug() << "error idx" << erridx; |
| 653 | if(m_mapPopupList.find(erridx)!= m_mapPopupList.end()){ | 658 | if(m_mapPopupList.find(erridx)!= m_mapPopupList.end()){ |
app/gui/oven_control/ovenstatics.h
| @@ -204,6 +204,7 @@ public: | @@ -204,6 +204,7 @@ public: | ||
| 204 | realtime_data getPartsRealtimeData(void); | 204 | realtime_data getPartsRealtimeData(void); |
| 205 | uint8_t getSensorTypeByIdx(uint16_t idx); | 205 | uint8_t getSensorTypeByIdx(uint16_t idx); |
| 206 | type_temp getCurSensorValueByIdx(uint16_t idx); | 206 | type_temp getCurSensorValueByIdx(uint16_t idx); |
| 207 | + void resetSensorHistory(void); | ||
| 207 | 208 | ||
| 208 | private: | 209 | private: |
| 209 | 210 |
app/gui/oven_control/realtimesensorwindow.cpp
| @@ -177,3 +177,10 @@ void RealtimeSensorWindow::keyReleaseEvent(QKeyEvent *event) | @@ -177,3 +177,10 @@ void RealtimeSensorWindow::keyReleaseEvent(QKeyEvent *event) | ||
| 177 | } | 177 | } |
| 178 | } | 178 | } |
| 179 | 179 | ||
| 180 | + | ||
| 181 | +void RealtimeSensorWindow::on_resetButton_clicked() | ||
| 182 | +{ | ||
| 183 | + OvenStatistics* ovs = OvenStatistics::getInstance(); | ||
| 184 | + ovs->resetSensorHistory(); | ||
| 185 | + reloadUi(); | ||
| 186 | +} |
app/gui/oven_control/realtimesensorwindow.h
| @@ -28,6 +28,8 @@ private slots: | @@ -28,6 +28,8 @@ private slots: | ||
| 28 | void on_backButton_clicked(); | 28 | void on_backButton_clicked(); |
| 29 | void oneSecTimerFired(void); | 29 | void oneSecTimerFired(void); |
| 30 | 30 | ||
| 31 | + void on_resetButton_clicked(); | ||
| 32 | + | ||
| 31 | private: | 33 | private: |
| 32 | const uint16_t m_arrSensorItemIdxs[REALSENSOR_CONTROL_LIST_ITEM_MAX]={ | 34 | const uint16_t m_arrSensorItemIdxs[REALSENSOR_CONTROL_LIST_ITEM_MAX]={ |
| 33 | 0,1,4,5,6,7,8,12,13 | 35 | 0,1,4,5,6,7,8,12,13 |
app/gui/oven_control/realtimesensorwindow.ui
| @@ -109,7 +109,7 @@ | @@ -109,7 +109,7 @@ | ||
| 109 | <widget class="QPushButton" name="backButton"> | 109 | <widget class="QPushButton" name="backButton"> |
| 110 | <property name="geometry"> | 110 | <property name="geometry"> |
| 111 | <rect> | 111 | <rect> |
| 112 | - <x>343</x> | 112 | + <x>291</x> |
| 113 | <y>26</y> | 113 | <y>26</y> |
| 114 | <width>97</width> | 114 | <width>97</width> |
| 115 | <height>97</height> | 115 | <height>97</height> |
| @@ -132,7 +132,7 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/b | @@ -132,7 +132,7 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/b | ||
| 132 | <widget class="QPushButton" name="helpButton"> | 132 | <widget class="QPushButton" name="helpButton"> |
| 133 | <property name="geometry"> | 133 | <property name="geometry"> |
| 134 | <rect> | 134 | <rect> |
| 135 | - <x>457</x> | 135 | + <x>401</x> |
| 136 | <y>26</y> | 136 | <y>26</y> |
| 137 | <width>97</width> | 137 | <width>97</width> |
| 138 | <height>97</height> | 138 | <height>97</height> |
| @@ -152,6 +152,29 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/h | @@ -152,6 +152,29 @@ QPushButton:pressed, QPushButton:focus { border-image: url(:/images/bottom_bar/h | ||
| 152 | <string/> | 152 | <string/> |
| 153 | </property> | 153 | </property> |
| 154 | </widget> | 154 | </widget> |
| 155 | + <widget class="QPushButton" name="resetButton"> | ||
| 156 | + <property name="geometry"> | ||
| 157 | + <rect> | ||
| 158 | + <x>512</x> | ||
| 159 | + <y>26</y> | ||
| 160 | + <width>97</width> | ||
| 161 | + <height>97</height> | ||
| 162 | + </rect> | ||
| 163 | + </property> | ||
| 164 | + <property name="sizePolicy"> | ||
| 165 | + <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> | ||
| 166 | + <horstretch>0</horstretch> | ||
| 167 | + <verstretch>0</verstretch> | ||
| 168 | + </sizepolicy> | ||
| 169 | + </property> | ||
| 170 | + <property name="styleSheet"> | ||
| 171 | + <string notr="true">QPushButton { border-image: url(:/images/bottom_bar/006_sys_icon_14.png); } | ||
| 172 | +QPushButton:pressed , QPushButton:focus{ border-image: url(:/images/bottom_bar/006_sys_icon_14_ov.png); }</string> | ||
| 173 | + </property> | ||
| 174 | + <property name="text"> | ||
| 175 | + <string/> | ||
| 176 | + </property> | ||
| 177 | + </widget> | ||
| 155 | </widget> | 178 | </widget> |
| 156 | <widget class="QWidget" name="midwidget" native="true"> | 179 | <widget class="QWidget" name="midwidget" native="true"> |
| 157 | <property name="geometry"> | 180 | <property name="geometry"> |
app/gui/oven_control/servicedata.cpp
| @@ -102,7 +102,13 @@ bool ServiceData::loadServiceData(void){ | @@ -102,7 +102,13 @@ bool ServiceData::loadServiceData(void){ | ||
| 102 | }else{ | 102 | }else{ |
| 103 | qDebug()<<"FRAM FILE Open fail!!"; | 103 | qDebug()<<"FRAM FILE Open fail!!"; |
| 104 | } | 104 | } |
| 105 | - return true; | 105 | + return true; |
| 106 | +} | ||
| 107 | + | ||
| 108 | +bool ServiceData::resetSensorlogData() | ||
| 109 | +{ | ||
| 110 | + memset((void*)sensor_log.data,0x00, sizeof(sensor_statics_log)); | ||
| 111 | + saveServiceData(); | ||
| 106 | } | 112 | } |
| 107 | 113 | ||
| 108 | bool ServiceData::saveServiceData(void){ | 114 | bool ServiceData::saveServiceData(void){ |
app/gui/oven_control/servicedata.h
| @@ -196,6 +196,7 @@ public: | @@ -196,6 +196,7 @@ public: | ||
| 196 | uint16_t m_nRepeatErrorIdx; | 196 | uint16_t m_nRepeatErrorIdx; |
| 197 | bool saveServiceData(void); | 197 | bool saveServiceData(void); |
| 198 | bool loadServiceData(void); | 198 | bool loadServiceData(void); |
| 199 | + bool resetSensorlogData(void); | ||
| 199 | }; | 200 | }; |
| 200 | 201 | ||
| 201 | #endif // SERVICEDATA_H | 202 | #endif // SERVICEDATA_H |