新增代码检索功能、提升业务转码效率等
This commit is contained in:
@@ -12,6 +12,14 @@
|
||||
#include <QGridLayout>
|
||||
#include <QMessageBox>
|
||||
#include <QThread>
|
||||
#include <QFutureWatcher>
|
||||
#include <QElapsedTimer>
|
||||
|
||||
// 后台线程执行结果:success 表示整体是否成功,needReload 表示是否需要重新加载数据缓存
|
||||
struct UpdateResult {
|
||||
bool success;
|
||||
bool needReload;
|
||||
};
|
||||
|
||||
class MetadataUpdatePage : public ElaScrollPage
|
||||
{
|
||||
@@ -35,22 +43,30 @@ private slots:
|
||||
private slots:
|
||||
void onUpdateProgress(int progress, const QString& message);
|
||||
void onUpdateFinished(bool success, const QString& message);
|
||||
void onWorkerFinished(); // QFutureWatcher::finished 的回调(运行在主线程)
|
||||
|
||||
signals:
|
||||
void sigProgress(int progress, const QString& message); // 后台线程 -> 主线程回传进度
|
||||
|
||||
private:
|
||||
void initUI();
|
||||
void showUpdateItems();
|
||||
void updateUf2Interfaces(const QStringList& items);
|
||||
void updateUft3Interfaces(const QStringList& items);
|
||||
|
||||
|
||||
// 后台线程执行体(由 QtConcurrent 调用,禁止直接操作 UI)
|
||||
UpdateResult runUpdateUf2(const QStringList& items);
|
||||
UpdateResult runUpdateUft3(const QStringList& items);
|
||||
// 在主线程启动后台任务
|
||||
void startUpdate(const QStringList& items, const QString& taskName);
|
||||
|
||||
void processUf2StdFields();
|
||||
void processUf2DataType();
|
||||
void processUf2ErrNumber();
|
||||
void processUf2Interface(const QString& basePath);
|
||||
|
||||
bool processUf2Interface(const QString& basePath);
|
||||
|
||||
void processUft3StdFields();
|
||||
void processUft3DataType();
|
||||
void processUft3Table();
|
||||
void processUft3Interface(const QString& basePath);
|
||||
bool processUft3Interface(const QString& basePath);
|
||||
|
||||
QGridLayout* _updateGridLayout{nullptr};
|
||||
QGridLayout* _updateUf2GridLayout{nullptr};
|
||||
@@ -60,14 +76,17 @@ private:
|
||||
ElaPushButton* _uft3CancelBtn{nullptr};
|
||||
ElaPushButton* _uf2AllBtn{nullptr};
|
||||
ElaPushButton* _uft3UpdateBtn{nullptr};
|
||||
ElaCheckBox* _forceFullCheckBox{nullptr};
|
||||
ElaText* _processLabel{nullptr};
|
||||
ElaProgressBar* _progressBar{nullptr};
|
||||
|
||||
QList<ElaCheckBox*> uft3CheckBoxes;
|
||||
QList<ElaCheckBox*> uf20CheckBoxes;
|
||||
|
||||
|
||||
MetadataProcessor* _processor{nullptr};
|
||||
QThread* _workerThread{nullptr};
|
||||
QFutureWatcher<UpdateResult>* _watcher{nullptr};
|
||||
QElapsedTimer _updateTimer;
|
||||
QString m_currentTaskName; // "UF20" / "UFT30",用于区分当前任务
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user