-/***
- * @Date: 2024-09-09 17:47:36
- * @LastEditors: Caisking 3449750381@qq.com
- * @LastEditTime: 2024-09-09 18:56:07
- * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/safemodemanager/src/ResourceCheckView.cpp
- */
#include "safemodemanager/include/ResourceCheckView.h"
#include "safemodemanager/include/SafeModeManagerPresenter.h"
#include "safemodemanager/include/SafeModeManagerModel.h"
notelabel->SetViewId("label4");
notelabel->SetStyle(STYLE_TEXT_FONT, 30);
- notelabel->SetText("file verification...");
+ notelabel->SetText("File verification...");
notelabel->SetLineBreakMode(UILabel::LINE_BREAK_WRAP);
notelabel->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
notelabel->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
}
void ResourceCheckView::UpdateView(int date)
{
- std::string display = "file verification";
+ std::string display = "File verification";
if (date == -1)
{
- notelabel->SetText("file verification is error...");
+ notelabel->SetText("File verification is error...");
return;
}
else if (date >= 0 && date <= 60)
}
else if (date == 61)
{
- notelabel->SetText("file verification is ok...");
+ notelabel->SetText("File verification is ok...");
return;
}
else
{
- notelabel->SetText("file verification is unkown...");
+ notelabel->SetText("File verification is unkown...");
return;
}
}
void ResourceCheckView::UpdateView()
{
- printf("开始显示校验结果\r\n");
- // 进行文件读取
+ printf("Start showing verification results.\r\n");
if (SafeModeManagerModel::GetInstance()->ReadCheckFile())
{
- // 读取数组
+ // Read the array
std::vector<std::string> filenames = SafeModeManagerModel::GetInstance()->GetCheckDifferentialFiles();
- // 清空 notelabel 的文本
+ // Clear the text of notelabel
std::string allFilenames;
- #if 0
- // 更新 notelabel 的文本为文件名列表
+#if 0
for (const auto &filename : filenames)
{
- allFilenames += filename + "\n"; // 逐行添加文件名
+ allFilenames += filename + "\n"; // Add filenames line by line
}
printf("allFilenames %s\r\n", allFilenames.c_str());
- notelabel->SetText(allFilenames.c_str()); // 一次性设置文本
- #endif
+ notelabel->SetText(allFilenames.c_str()); // Set the text at once
+#endif
int num = SafeModeManagerModel::GetInstance()->GetCheckFileCount();
- allFilenames = "本次校验结果校验成功:校验文件:"+ std::to_string(num) ;
- notelabel->SetText(allFilenames.c_str()); // 一次性设置文本
- printf("file verification num is %d\r\n", num);
+ allFilenames = "This verification result is successful. Number of verified files: " + std::to_string(num);
+ notelabel->SetText(allFilenames.c_str()); // Set the text at once
+ printf("Number of verified files is %d\r\n", num);
}
else
{
- notelabel->SetText("file verification is same");
- printf("校验结果校验失败\r\n");
+ notelabel->SetText("File verification is the same.");
+ printf("Verification result is failure.\r\n");
}
- printf("校验结果校验完成\r\n");
+ printf("Verification result is completed.\r\n");
}
-}
\ No newline at end of file
+}