#ifndef CTRANSFER_MANAGER_H
#define CTRANSFER_MANAGER_H
#include "ccassette.h"
#include <QReadWriteLock>
class CTransferManager {
public:
    enum PosTag {
        kCassete,
        kRail1PrepareGrab,
        kRail1Grabed,
        kRail1Scan,
        kRail1Ready,
        kRail1Location,
        kTrans,
        kCoat,
        kLoad,
        kRail2Ready,
        kRail2Location,
        kUnload,
        kCheckbox,
    };

    struct ResStatus {
        bool bLocked;
        int iOwner;
    };
    enum ResourceTarget {
        kResCassete=0,
        kResRailNear,
        kResRailFar,
        kResTransfer,
        kResCoat,
        kResClean,
        kResLoad,
        kResWt,
        kResUnload,
        kResCheckBox,
        kResDoor,
    };
    struct WaferStatus {
        PosTag posMark;     //位置标识
        int CheckStatus;
        bool bProcessing;
    };
public:
    //数据转移及真空处理
    bool TransSlot(PosTag srcPos, PosTag dstPos);

    //多线程使用,必须加锁
    CASSSLOT* m_pSlotGrab;	    //!> 夹抓状态
    CASSSLOT* m_pSlotRail1;     //!> 轨道1
    CASSSLOT* m_pSlotRail2;     //!> 轨道2
    CASSSLOT* m_pSlotTrans;     //!> 转移吸嘴
    CASSSLOT* m_pSlotCoat;	    //!> 涂敷台
    CASSSLOT* m_pSlotLoad;	    //!> 上料位的晶圆
    CASSSLOT* m_pSlotWT;	    //!> 平台上的晶圆
    CASSSLOT* m_pSlotUnload;	//!> 下料手上的晶圆
    CASSSLOT* m_pSlotClean;		//!> 清洗台
    CASSSLOT* m_pSlotCheckBox;	//!> 检查料盒的晶圆

    QReadWriteLock m_transLock; //!>传片
};
#endif // CTRANSFER_MANAGER_H
