From 4c8eff3826030921dd89718a2a477b48c15c685e Mon Sep 17 00:00:00 2001 From: victor Date: Thu, 17 Aug 2017 11:47:33 +0900 Subject: [PATCH] =?UTF-8?q?=EB=8D=94=20=EC=A0=81=EC=A0=88=ED=95=9C=20?= =?UTF-8?q?=ED=95=B4=EA=B2=B0=20=EB=B0=A9=EB=B2=95=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/gui/oven_control/config.cpp | 6 +++--- app/gui/oven_control/fileprocessdlg.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/gui/oven_control/config.cpp b/app/gui/oven_control/config.cpp index e6692f1..c1ce186 100644 --- a/app/gui/oven_control/config.cpp +++ b/app/gui/oven_control/config.cpp @@ -153,12 +153,12 @@ bool Config::saveConfig(void){ } bool Config::loadConfig(){ - char buff[sizeof(config_lists)+1]; + uint8_t buff[sizeof(config_lists)+1]; qint64 readlen; QFile file(CONFIG_FILE_NAME); initConfig(); if(file.open(QIODevice::ReadOnly)){ - readlen = file.read(buff,sizeof(config_lists)+1); + readlen = file.read((char *) buff,sizeof(config_lists)+1); file.close(); if(readlen != (sizeof(configlist)+1)){ //File size is wrong. apply default config value & save default value; @@ -166,7 +166,7 @@ bool Config::loadConfig(){ saveConfig(); return false; } - if((unsigned char) buff[sizeof(config_lists)] ==0x9c){ + if (buff[sizeof(config_lists)] ==0x9c){ memcpy(configlist.data,buff,sizeof(config_lists)); qDebug() << "loading config file success"; } diff --git a/app/gui/oven_control/fileprocessdlg.cpp b/app/gui/oven_control/fileprocessdlg.cpp index e1f5781..9a2cf8b 100644 --- a/app/gui/oven_control/fileprocessdlg.cpp +++ b/app/gui/oven_control/fileprocessdlg.cpp @@ -658,7 +658,7 @@ void FileProcessDlg::configDownload(){ } void FileProcessDlg::configUpload(){ - char buff[sizeof(config_lists)+1]; + uint8_t buff[sizeof(config_lists)+1]; qint64 readlen; QString strUsbPath; QString strSrcPath; @@ -668,7 +668,7 @@ void FileProcessDlg::configUpload(){ QFile srcFile(strSrcPath); //Check Source File is valid this machine if(srcFile.open(QIODevice::ReadOnly)){ - readlen = srcFile.read(buff,sizeof(config_lists)+1); + readlen = srcFile.read((char *) buff,sizeof(config_lists)+1); srcFile.close(); if(readlen != (sizeof(config_lists)+1)) { qDebug() << "SRC config.ini file size wrong"; @@ -676,13 +676,13 @@ void FileProcessDlg::configUpload(){ QTimer::singleShot(1000,this,SLOT(close())); return; } - if((unsigned char) buff[sizeof(config_lists)] != 0x9C){ + if(buff[sizeof(config_lists)] != 0x9C){ qDebug() << "SRC config.ini file check fail"; ui->ctrLbRemainTime->setText(tr("설정 업로드에 실패하였습니다.")); QTimer::singleShot(1000,this,SLOT(close())); return; } - cfg->copyConfigArea(buff); + cfg->copyConfigArea((char *) buff); cfg->saveConfig(); cfg->applyConfig(); } -- 2.1.4