up:校验逻辑进度更新。
This commit is contained in:
@@ -91,11 +91,11 @@ void ClientCore::handleAsk(QSharedPointer<FrameBuffer> frame)
|
|||||||
for (auto& item : msg.mapData) {
|
for (auto& item : msg.mapData) {
|
||||||
if (item.mark == STRMSG_AC_UP) {
|
if (item.mark == STRMSG_AC_UP) {
|
||||||
if (!Util::DirExist(item.key, true)) {
|
if (!Util::DirExist(item.key, true)) {
|
||||||
item.properD = static_cast<qint32>(FCS_DIR_NOT_EXIST);
|
item.state = static_cast<qint32>(FCS_DIR_NOT_EXIST);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!Util::FileExist(item.key)) {
|
if (!Util::FileExist(item.key)) {
|
||||||
item.properD = static_cast<qint32>(FCS_FILE_NOT_EXIST);
|
item.state = static_cast<qint32>(FCS_FILE_NOT_EXIST);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -162,6 +162,11 @@ void CheckCondition::SetTasks(const QVector<TransTask>& tasks)
|
|||||||
tasks_ = tasks;
|
tasks_ = tasks;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
InfoMsg CheckCondition::GetInfoMsg() const
|
||||||
|
{
|
||||||
|
return infoMsg_;
|
||||||
|
}
|
||||||
|
|
||||||
void CheckCondition::recvFrame(QSharedPointer<FrameBuffer> frame)
|
void CheckCondition::recvFrame(QSharedPointer<FrameBuffer> frame)
|
||||||
{
|
{
|
||||||
InfoMsg info = infoUnpack<InfoMsg>(frame->data);
|
InfoMsg info = infoUnpack<InfoMsg>(frame->data);
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ public:
|
|||||||
public:
|
public:
|
||||||
void SetClientCore(ClientCore* clientCore);
|
void SetClientCore(ClientCore* clientCore);
|
||||||
void SetTasks(const QVector<TransTask>& tasks);
|
void SetTasks(const QVector<TransTask>& tasks);
|
||||||
|
InfoMsg GetInfoMsg() const;
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void sigCheckOver();
|
void sigCheckOver();
|
||||||
|
|||||||
@@ -145,20 +145,27 @@ void frelayGUI::HandleTask(const QVector<TransTask>& tasks)
|
|||||||
transform_->SetTasks(tasks);
|
transform_->SetTasks(tasks);
|
||||||
|
|
||||||
// 检查文件
|
// 检查文件
|
||||||
CheckCondition checkThread(this);
|
CheckCondition cond(this);
|
||||||
checkThread.SetTasks(tasks);
|
cond.SetTasks(tasks);
|
||||||
checkThread.SetClientCore(clientCore_);
|
cond.SetClientCore(clientCore_);
|
||||||
|
|
||||||
LoadingDialog checking(this);
|
LoadingDialog checking(this);
|
||||||
checking.setTipsText("正在检查文件...");
|
checking.setTipsText("正在检查文件...");
|
||||||
|
|
||||||
connect(&checkThread, &CheckCondition::sigCheckOver, &checking, &LoadingDialog::cancelBtnClicked);
|
connect(&cond, &CheckCondition::sigCheckOver, &checking, &LoadingDialog::cancelBtnClicked);
|
||||||
connect(&checking, &LoadingDialog::cancelWaiting, &checkThread, &CheckCondition::interrupCheck);
|
connect(&checking, &LoadingDialog::cancelWaiting, &cond, &CheckCondition::interrupCheck);
|
||||||
connect(clientCore_, &ClientCore::sigMsgAnswer, &checkThread, &CheckCondition::recvFrame);
|
connect(clientCore_, &ClientCore::sigMsgAnswer, &cond, &CheckCondition::recvFrame);
|
||||||
|
|
||||||
checkThread.start();
|
cond.start();
|
||||||
checking.exec();
|
checking.exec();
|
||||||
|
|
||||||
|
auto msg = cond.GetInfoMsg();
|
||||||
|
for (auto& data : msg.mapData) {
|
||||||
|
if (data.state == static_cast<qint32>(FCS_NORMAL)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
transform_->exec();
|
transform_->exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -80,6 +80,9 @@ enum FileCheckState {
|
|||||||
#define STRMSG_AC_ANSWER_FILEINFO "answerFileInfo"
|
#define STRMSG_AC_ANSWER_FILEINFO "answerFileInfo"
|
||||||
#define STRMSG_AC_UP "upAction"
|
#define STRMSG_AC_UP "upAction"
|
||||||
#define STRMSG_AC_DOWN "downAction"
|
#define STRMSG_AC_DOWN "downAction"
|
||||||
|
#define STRMSG_AC_ACCEPT "acceptAction"
|
||||||
|
#define STRMSG_AC_REJECT "rejectAction"
|
||||||
|
#define STRMSG_AC_CANCEL "cancelAction"
|
||||||
|
|
||||||
#define STRMSG_ST_FILEEXIT "fileExist"
|
#define STRMSG_ST_FILEEXIT "fileExist"
|
||||||
#define STRMSG_ST_FILENOEXIT "fileNotExist"
|
#define STRMSG_ST_FILENOEXIT "fileNotExist"
|
||||||
|
|||||||
@@ -11,10 +11,10 @@
|
|||||||
struct PropertyData {
|
struct PropertyData {
|
||||||
QString key;
|
QString key;
|
||||||
QString mark;
|
QString mark;
|
||||||
QString properA;
|
QString userAction;
|
||||||
QString properB;
|
QString properB;
|
||||||
QString properC;
|
QString properC;
|
||||||
qint32 properD;
|
qint32 state;
|
||||||
qint32 properE;
|
qint32 properE;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ struct InfoMsg {
|
|||||||
}
|
}
|
||||||
data << mapData.size();
|
data << mapData.size();
|
||||||
for (const auto& item : mapData) {
|
for (const auto& item : mapData) {
|
||||||
data << item.key << item.mark << item.properA << item.properB << item.properC << item.properD << item.properE;
|
data << item.key << item.mark << item.userAction << item.properB << item.properC << item.state << item.properE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ struct InfoMsg {
|
|||||||
data >> mapSize;
|
data >> mapSize;
|
||||||
for (int i = 0; i < mapSize; ++i) {
|
for (int i = 0; i < mapSize; ++i) {
|
||||||
PropertyData prop;
|
PropertyData prop;
|
||||||
data >> prop.key >> prop.mark >> prop.properA >> prop.properB >> prop.properC >> prop.properD >> prop.properE;
|
data >> prop.key >> prop.mark >> prop.userAction >> prop.properB >> prop.properC >> prop.state >> prop.properE;
|
||||||
mapData.insert(prop.key, prop);
|
mapData.insert(prop.key, prop);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user