#pragma once
#ifndef __WIDGETSETTINGCLASS__H__
#define __WIDGETSETTINGCLASS__H__
#include <QCoreApplication>
#include <QSettings>
#include <QDebug>
#include <QString>
#include <QObject>
#include <QMutex>
#include <QScopedPointer>


// 定义访问参数
#define RASTERFILEFILTER u8"所有文件 (*.*);;TIF (*.tif);;TIFF (*.tiff);;bin (*.bin);;dat (*.dat);;"
#define LAMPWINDDATAFILEFILTER u8"所有文件 (*.*);;风场文件 (*.lampwind);;TIF (*.tif);;TIFF (*.tiff);;bin (*.bin);;dat (*.dat);;"


class WidgetSettingClass : public QObject
{
	Q_OBJECT
public:
    // 获取单例实例的静态方法
    static WidgetSettingClass& instance();


	// 禁止拷贝构造和赋值
	WidgetSettingClass(const WidgetSettingClass&) = delete;
	WidgetSettingClass& operator=(const WidgetSettingClass&) = delete;

public:
    static QScopedPointer<WidgetSettingClass> m_instance;
    
public:
    // 私有构造函数和析构函数
    explicit WidgetSettingClass(QObject* parent = nullptr);
    ~WidgetSettingClass();

private:
    QSettings* m_settings;
    QString lastFileDialogPath;
    QString iniPath;
public:
    QString getWindTool_nc2WindDataToolPath();
    QString getWindTool_PythonEnvPath();
    QString getExeApplicationPath();
    QString getExeDirectionApplicationPath();
    QString getWindReaddLLApplicationPath();
    QString getLastFileDialogPath();
    void setLastFileDialogPath(QString path);
    QString getTempFolder();
};



#endif