#pragma once

#ifndef FEKORESULTIMPORT_H
#define FEKORESULTIMPORT_H
#include <QtWidgets/QMainWindow>
#include <QtWidgets/QApplication>
#include "ui_FEKOResultImport.h"
#include "TaskXml/TaskTreeClass.h"
#include "CMDExcuteApp.h"
#include <QStandardItemModel>
#include <QStringListModel>
#include <stdlib.h>
#include <stdio.h>
#include <vector>
#include <QObject>


class FEKOResultImport : public QMainWindow
{
    Q_OBJECT


public:
    QString FEKOProjectFolderPath;
    QString FEKOPreFileName;
    std::vector<QString> nearFieldNames;
    std::vector<QString> farFieldNames;
    QString FEKOResultCSVPath;
private :
    QStandardItemModel* ListViewmodel;
    QStandardItemModel* selectListViewmodel;
    bool saveSucessfully;
    CMDExcuteApp* p;

public:
    FEKOResultImport(QWidget* parent = nullptr);
    ~FEKOResultImport();
    
    QString getFEKOPreFileName();
    int setFEKOPreFileName(QString preFileName);
    
    int setNearFieldNames(std::vector<QString> nearFieldNames);
    std::vector<QString> getNearFieldNames();
    
    int setFarFieldNames(std::vector<QString> farFieldNames);
    std::vector<QString> getFarFieldNames();
    
    int setSelectFieldNames(std::vector<QString> SelectFieldNames,bool nearOrfar);
    std::vector<QString> getSelectFieldNames();
    
    int setFEKOResultCSVPath(QString csvPath);
    QString getFEKOResultCSVPath();

    int setFEKOPreProjectFolderPath(QString FolderPath);
    QString getFEKOPreProjectFolderPath();

    int initView();
    int InitListView();
    bool getNearChecked();
    bool getFarChecked();
    bool getSaveSucessfully();
    QString getSaveCsvFilePath();

private:
    Ui::FEKOResultImportWindow ui;

signals: 
    void callbackFekoResultImport(FEKOResultImport* obj);

public slots: // 信号（或者事件）
    int OpenPrejectFolderPath();
    int closeWindows();
    int NearRadioButtonSelect(bool);
    int FarRadioButtonSelect(bool);
    int FEKOResultImportButtonClick(); // 执行导入
    int AddFekoResultClick();
    int DeleteFekoResultClick();
    int SaveCsvFilePath();
    void waitCMDExcute(); // 导入完成
};
 

#endif
