Commit 44c81f0cb11f2e99694a045d8c3a37637978cc12
1 parent
7519794134
Exists in
master
and in
2 other branches
요리 시간 및 요리 카운터 불합리 부분 정리
- ServiceData 클래스 수정
Showing
1 changed file
with
0 additions
and
12 deletions
Show diff stats
app/gui/oven_control/servicedata.cpp
| @@ -19,8 +19,6 @@ ServiceData::ServiceData() | @@ -19,8 +19,6 @@ ServiceData::ServiceData() | ||
| 19 | memset((void*)err_log.data,0x00,sizeof(error_log)); | 19 | memset((void*)err_log.data,0x00,sizeof(error_log)); |
| 20 | memset((void*)use_log.data,0x00,sizeof(use_statics_log)); | 20 | memset((void*)use_log.data,0x00,sizeof(use_statics_log)); |
| 21 | memset((void*)sensor_log.data,0x00, sizeof(sensor_statics_log)); | 21 | memset((void*)sensor_log.data,0x00, sizeof(sensor_statics_log)); |
| 22 | - DirtyLevel::setCookingCount(0); | ||
| 23 | - DirtyLevel::setCookingTime(0); | ||
| 24 | #if INIT_FRAM == 1 | 22 | #if INIT_FRAM == 1 |
| 25 | saveServiceData(); | 23 | saveServiceData(); |
| 26 | #else | 24 | #else |
| @@ -34,8 +32,6 @@ bool ServiceData::loadServiceData(void){ | @@ -34,8 +32,6 @@ bool ServiceData::loadServiceData(void){ | ||
| 34 | uint8_t buffs[FRAM_SIZE]; | 32 | uint8_t buffs[FRAM_SIZE]; |
| 35 | uint8_t* pBuff; | 33 | uint8_t* pBuff; |
| 36 | int fd; | 34 | int fd; |
| 37 | - qint64 temp_cookingTime = 0; | ||
| 38 | - int temp_cookingCount = 0; | ||
| 39 | pBuff = buffs; | 35 | pBuff = buffs; |
| 40 | 36 | ||
| 41 | 37 | ||
| @@ -93,10 +89,6 @@ bool ServiceData::loadServiceData(void){ | @@ -93,10 +89,6 @@ bool ServiceData::loadServiceData(void){ | ||
| 93 | memcpy((void*)err_log.data,pBuff,sizeof(error_log)); pBuff += sizeof(error_log); | 89 | memcpy((void*)err_log.data,pBuff,sizeof(error_log)); pBuff += sizeof(error_log); |
| 94 | memcpy((void*)use_log.data, pBuff,sizeof(use_statics_log));pBuff += sizeof(use_statics_log); | 90 | memcpy((void*)use_log.data, pBuff,sizeof(use_statics_log));pBuff += sizeof(use_statics_log); |
| 95 | memcpy((void*)sensor_log.data,pBuff,sizeof(sensor_statics_log)); pBuff+= sizeof(sensor_statics_log); | 91 | memcpy((void*)sensor_log.data,pBuff,sizeof(sensor_statics_log)); pBuff+= sizeof(sensor_statics_log); |
| 96 | - memcpy(&temp_cookingTime,pBuff, sizeof(qint64)); pBuff += sizeof(qint64); | ||
| 97 | - memcpy(&temp_cookingCount,pBuff, sizeof(int)); | ||
| 98 | - DirtyLevel::setCookingCount(temp_cookingCount); | ||
| 99 | - DirtyLevel::setCookingTime(temp_cookingTime); | ||
| 100 | close(fd); | 92 | close(fd); |
| 101 | qDebug() <<"FRAM Load Success"; | 93 | qDebug() <<"FRAM Load Success"; |
| 102 | }else{ | 94 | }else{ |
| @@ -150,8 +142,6 @@ bool ServiceData::saveServiceData(void){ | @@ -150,8 +142,6 @@ bool ServiceData::saveServiceData(void){ | ||
| 150 | uint8_t buffs[FRAM_SIZE]; | 142 | uint8_t buffs[FRAM_SIZE]; |
| 151 | uint8_t* pBuff; | 143 | uint8_t* pBuff; |
| 152 | int fd; | 144 | int fd; |
| 153 | - qint64 temp_cookingTime = DirtyLevel::cookingTime(); | ||
| 154 | - int temp_cookingCount = DirtyLevel::cookingCount(); | ||
| 155 | pBuff = buffs; | 145 | pBuff = buffs; |
| 156 | fd = open(fRam_path, O_RDWR | O_SYNC); | 146 | fd = open(fRam_path, O_RDWR | O_SYNC); |
| 157 | if(fd>0){ | 147 | if(fd>0){ |
| @@ -159,8 +149,6 @@ bool ServiceData::saveServiceData(void){ | @@ -159,8 +149,6 @@ bool ServiceData::saveServiceData(void){ | ||
| 159 | memcpy(pBuff,(void*)err_log.data,sizeof(error_log)); pBuff += sizeof(err_log); | 149 | memcpy(pBuff,(void*)err_log.data,sizeof(error_log)); pBuff += sizeof(err_log); |
| 160 | memcpy(pBuff,(void*)use_log.data,sizeof(use_statics_log)); pBuff += sizeof(use_statics_log); | 150 | memcpy(pBuff,(void*)use_log.data,sizeof(use_statics_log)); pBuff += sizeof(use_statics_log); |
| 161 | memcpy(pBuff,(void*)sensor_log.data,sizeof(sensor_statics_log)); pBuff += sizeof(sensor_statics_log); | 151 | memcpy(pBuff,(void*)sensor_log.data,sizeof(sensor_statics_log)); pBuff += sizeof(sensor_statics_log); |
| 162 | - memcpy(pBuff, &temp_cookingTime, sizeof(qint64)); pBuff += sizeof(qint64); | ||
| 163 | - memcpy(pBuff, &temp_cookingCount, sizeof(int)); pBuff += sizeof(int); | ||
| 164 | *pBuff = 0x9C; | 152 | *pBuff = 0x9C; |
| 165 | 153 | ||
| 166 | write(fd,buffs,FRAM_SIZE); | 154 | write(fd,buffs,FRAM_SIZE); |