#ifndef DEFINE_H
#define DEFINE_H
#include <QString>

#define TITLE_FONT_SIZE                 22
#define API_VERSION                     "2023-11-18"
#define SOFTWARE_VERSION                "0.01"
#define HARDWARE_VERSION                "1.00"
#define DEV_NAME                        "一体柜"
#define BleKeyName                      "keyLock"

enum WIN_STATUS
{
    WIN_LOADING=0,
    WIN_SET,
    WIN_LOGIN,
    WIN_USERNAME,
    WIN_MAIN,
};

#define SERVER_MATERIAL_LOANSTATE_IN    1       // 在柜中
#define SERVER_MATERIAL_LOANSTATE_OUT   0       // 借出

#define ELECTLOCKBOARD_ADDR             0x80

#define DEVTYPE_REG                     0x0000
#define LOCKCONTRO_REG                  0x0011
#define LIGHTCONTROL_REG                0x0015

#define DEVTYPE_KEY                     0x0000
#define DEVTYPE_LOCK                    0x0001
#define DEVTYPE_ELECTLOCK               0x0002
#define DEVTYPE_PORTABEL                0x0003

#define KEYBOARD_SUBDEV_COUNT           2
#define LOCKBOARD_SUBDEV_COUNT          10
#define PORTABELKEY_SUBDEV_COUNT        1
#define PORTABELLOCK_SUBDEV_COUNT       3

#define KEY_UNCHARGE                    0x01
#define KEY_CHARGING                    0x02
#define KEY_CHARGEFULL                  0x03

enum LOGINTYPE
{
    LOGIN_CARD = 0,
    LOGIN_USERNAME = 1,
    LOGIN_FINGER = 2,
    LOGINT_FACE = 3,
};

struct login_s{
    LOGINTYPE type;
    QString username;
    QString password;
    QString cardNo;
};

struct win_notice_s{
    QString title;
    void *value;
};

struct workTask_s{
    QString equipId;
    QString infoRfidNo;
    QString equipName;
    QString fileName;
    QString infoId;
    int dataId;
    QString equipNo;
    QString equipRfidNo;
    int target;
    int status;
    int prevId;
};

#endif // DEFINE_H
