using System;
using System.Collections.Generic;
using System.Runtime.Remoting.Messaging;

namespace CyberX8_Core
{
    public class DeviceName
    {
        //Eefem
        public const string EfemRobot = "EfemRobot";
    }

    public enum EfemOperation
    {
        None,
        Home,
        //HomeLP,
        Pick,
        Place,
        PickExtend,
        PickRetract,
        PlaceExtend,
        PlaceRetract,
        Goto,
        GotoMap,
        RequestMapResult,
        Extend,
        Retract,
        Align,
        Light,
        TurnOffBuzzer,
        //SwitchOnBuzzerAndRed,
        GetWaferInfo,
        Orgsh,
        Lift,
        SigStatus,
        Ready,
        Abort,
        ClearError,
        PmPinUp,
        PmPinDown,
        Load,
        Unload,
        CarrierId,
        Dock,
        Undock,
        Map,
        DummyMap,
        Clamp,
        Unclamp,
        SetThickness,
        StateTrack,
        //WriteCarrierId,
        Grip,
        EmsStop,
        Swap,
        Size,
        Speed,
        Vacuum,
        PowerOn,
        Error,
        RobotCycle
    }

    public class EfemConstant
    {
        public static readonly Dictionary<EfemOperation, string> OperationString = new Dictionary<EfemOperation, string>()
        {
            { EfemOperation.Ready,          "READY" },
            { EfemOperation.Home,           "INIT" },
            { EfemOperation.Orgsh,          "ORGSH" },
            { EfemOperation.ClearError,     "ERROR"},
            { EfemOperation.Map,            "WAFSH" },
            { EfemOperation.GetWaferInfo,   "MAPDT" },
            { EfemOperation.Pick,           "LOAD" },
            { EfemOperation.Place,          "UNLOAD" },
            { EfemOperation.Extend,         "MPNT" },
            { EfemOperation.Align,          "ALIGN" },
            { EfemOperation.SigStatus,      "SIGSTAT" },
            { EfemOperation.Lift,           "LIFT" },
            { EfemOperation.Light,          "SIGOUT" },
            { EfemOperation.Abort,           "ABORT" },
            { EfemOperation.Goto,           "GOTO" },
            { EfemOperation.Load,           "OPEN" },
            { EfemOperation.Unload,         "CLOSE" },
            { EfemOperation.CarrierId,      "CSTID" },
            { EfemOperation.Dock,           "DOCK" },
            { EfemOperation.Undock,         "UNDOCK" },
            { EfemOperation.Clamp,          "LOCK" },
            { EfemOperation.Unclamp,        "UNLOCK" },
            { EfemOperation.SetThickness,   "THICKNESS" },
            { EfemOperation.StateTrack,     "STATE" },
            { EfemOperation.Grip,           "CLAMP" },
            { EfemOperation.EmsStop,        "EMS"},
            { EfemOperation.PickExtend,     "LOAD_EXTEND"},
            { EfemOperation.PickRetract,    "LOAD_RETRACT"},
            { EfemOperation.PlaceExtend,    "UNLOAD_EXTEND"},
            { EfemOperation.PlaceRetract,   "UNLOAD_RETRACT"},
            { EfemOperation.Size,   "SIZE"},
            {EfemOperation.Speed,"SPEED"},
            {EfemOperation.Vacuum,"VAC"},
            {EfemOperation.PowerOn,"SERVOS"}
        };

        public static EfemOperation ToOperation(string str)
        {
            foreach (var item in OperationString)
            {
                if (item.Value == str)
                {
                    return item.Key;
                }
            }

            return default(EfemOperation);
        }
    }

    public enum ChillerType
    { 
    Chiller,
    InnerChiller,
    OuterChiller,
    TopChiller
    }
}