using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AR
{
    public enum eswPLCAddr
    {
        Ready = 0,
        Spare1,
        Spare2,

        /// <summary>
        /// 1=Limit Down
        /// 2=Detect
        /// 3=Limit Up
        /// </summary>
        LPort,
        CPort,
        RPort,

        /// <summary>
        /// 1 = Down,
        /// 2 = Up
        /// 3 = stop
        /// </summary>
        LMotor,
        CMotor,
        RMotor,

        /// <summary>
        /// 시퀀스값 0~
        /// 0 : nothing
        /// 1 : ~ running
        /// </summary>
        LSts,
        CSts,
        RSts,

        /// <summary>
        /// 1=down,
        /// 2=up,
        /// 3=stop,
        /// 4=refresh
        /// </summary>
        LCmd,
        CCmd,
        RCmd,

    }

    //public enum eVarUInt32
    //{
    //}

    //public enum eVarByte
    //{
    //    None = 0,
       


        
    //}

    public enum eVarBool
    {
        None = 0,
        NeedUserTouchAfterHome,
        BarcodeHook,
        NeedTopJigUnloaderPosition,
        Use_Conveyor,
        LEFT_ITEM_PICKOFF,
        RIGT_ITEM_PICKOFF,

        //Option_vname,
        Opt_UserConfim,
        Opt_ServerQty,
        Opt_UserQtyRQ,
        Option_partUpdate,
        Opt_NewReelID,
        Option_AutoConf,
        Opt_SIDConvert,
        Opt_ApplySIDConv,
        Opt_ApplyWMSInfo,
        Opt_ApplySIDInfo,
        Opt_ApplyJobInfo,
        Opt_CheckSIDExist,



        Opt_WMS_Apply_PartNo,
        Opt_WMS_Apply_CustCode,
        Opt_WMS_Apply_SID,
        Opt_WMS_Apply_VenderName,
        Opt_WMS_Apply_batch,
        Opt_WMS_Apply_qty,
        Opt_WMS_Where_PartNo,
        Opt_WMS_Where_CustCode,
        Opt_WMS_Where_SID,
        Opt_WMS_Where_VLOT,
        Opt_WMS_Where_MC,
        Opt_WMS_WriteServer,


        Opt_SID_Apply_PartNo,
        Opt_SID_Apply_CustCode,
        Opt_SID_Apply_SID,
        Opt_SID_Apply_VenderName,
        Opt_SID_Apply_PrintPos,
        Opt_SID_Apply_batch,
        Opt_SID_Apply_qty,
        Opt_SID_Where_PartNo,
        Opt_SID_Where_CustCode,
        Opt_SID_Where_SID,
        Opt_SID_Where_VLOT,
        Opt_SID_Where_MC,
        Opt_SID_WriteServer,


        Opt_Job_Apply_PartNo,
        Opt_Job_Apply_CustCode,
        Opt_Job_Apply_SID,
        Opt_Job_Apply_VenderName,
        Opt_Job_Apply_PrintPos,
        Opt_Job_Where_PartNo,
        Opt_Job_Where_CustCode,
        Opt_Job_Where_SID,
        Opt_Job_Where_VLOT,

        Opt_Conv_Apply_PartNo,
        Opt_Conv_Apply_CustCode,
        Opt_Conv_Apply_SID,
        Opt_Conv_Apply_VenderName,
        Opt_Conv_Apply_PrintPos,
        Opt_Conv_Apply_Batch,
        Opt_Conv_Apply_QtyMax,
        Opt_Conv_Where_PartNo,
        Opt_Conv_Where_CustCode,
        Opt_Conv_Where_SID,
        Opt_Conv_Where_VLOT,
        Opt_Conv_WriteServer,

        /// <summary>
        /// 카메라  사용안함
        /// </summary>
        Opt_DisableCamera,

        /// <summary>
        /// 프린터사용안함
        /// </summary>
        Opt_DisablePrinter,

        Enable_PickerMoveX,

        VisionL_Retry,
        VisionR_Retry,

        Need_UserConfirm_Data,

        /// <summary>
        /// 키엔스바코드의 수신을 확인합니다
        /// </summary>
        wait_for_keyence,
        wait_for_keyenceL,
        wait_for_keyenceR,

        /// <summary>
        /// 피커 키엔스 인식 실패로 재시도를 하고 있습니다.
        /// </summary>
        JOB_PickON_Retry,
        JOB_Empty_SIDConvertInfo,
        // JOB_BYPASS_LEFT,
        // JOB_BYPASS_RIGHT,

        FG_RDY_CAMERA_L,
        FG_RDY_CAMERA_R,
        FG_INIT_MOTIO,
        FG_DOORSAFTY,
        FG_AREASAFTY,
        FG_INIT_PRINTER,


        FG_KEYENCE_READOK_L,
        FG_KEYENCE_READOK_R,
        FG_KEYENCE_TRIGGER,
        FG_KEYENCE_OFFF,
        FG_KEYENCE_OFFR,

        FG_RUN_LEFT,
        FG_RUN_RIGHT,

        FG_BUSY_LEFT,
        FG_BUSY_RIGHT,

        FG_PORT0_ENDDOWN,
        FG_PORT1_ENDDOWN,
        FG_PORT2_ENDDOWN,

        FG_WAIT_PAPERDETECTL,
        FG_WAIT_PAPERDETECTR,

        FG_RUN_PLZ_PICKON,
        FG_RUN_PRZ_PICKON,
        FG_RUN_PLZ_PICKOF,
        FG_RUN_PRZ_PICKOF,

        FG_RUN_PLM_PICKON,
        FG_RUN_PLM_PICKOF,
        FG_RUN_PRM_PICKON,
        FG_RUN_PRM_PICKOF,

        FG_WAT_MAGNET0,
        FG_WAT_MAGNET1,
        FG_WAT_MAGNET2,



        FG_PRC_VISIONL,
        FG_PRC_VISIONR,

        FG_END_VISIONL,
        FG_END_VISIONR,

        FG_MOVE_PICKER,
        FG_JOYSTICK,

        /// <summary>
        /// Y축이 Front로 가지러 가기로 함
        /// </summary>
        FG_CMD_YP_LPICKON,
        FG_CMD_YP_LPICKOF,
        FG_CMD_YP_RPICKON,
        FG_CMD_YP_RPICKOF,

        //피커의 X축이 일을 하러 갔는가?        
        FG_RDY_PX_PICKON,
        FG_RDY_PX_PICKONWAITL,
        FG_RDY_PX_PICKONWAITR,
        FG_RDY_PX_LPICKOF,
        FG_RDY_PX_RPICKOF,

        //X축이 이동한후 해당 언로더에 자료를 셋팅했는가?
        FG_SET_DATA_PORT0,
        FG_SET_DATA_PORT2,

        FG_RDY_PZ_PICKON,
        FG_RDY_PZ_LPICKOF,
        FG_RDY_PZ_RPICKOF,

        FG_RUN_PRINTL,
        FG_RUN_PRINTR,

        FG_OK_PRINTL,
        FG_OK_PRINTR,

        /// <summary>
        /// 해당 포트의 자재 준비여부
        /// </summary>
        FG_RDY_PORT_PL,
        FG_RDY_PORT_PC,
        FG_RDY_PORT_PR,


        FG_ENABLE_LEFT,
        FG_ENABLE_RIGHT,


        /// <summary>
        /// 자재를 PICK 했다
        /// </summary>
        FG_PK_ITEMON,
        FG_PL_ITEMON,
        FG_PR_ITEMON,

        FG_KEYENCE_IMAGEPROGRESS,

        /// <summary>
        /// 포트에 아이템이 있는가? 
        /// 1번의 경우 Detect 센서가 들어오면 ItemON 설정을 한다.
        /// 0,2번의 경우 피커가 아이템을 놓을때 설정한다
        /// 실제로는 ITEMON 과 Align =1, 일때 촬영이가능하게한다
        /// </summary>
        FG_PORTL_ITEMON,
        FG_PORTR_ITEMON,

        /// <summary>
        /// 사용자가 바코드 확인 또는 정보를 편집하는 창
        /// </summary>
        FG_WAIT_LOADERINFO,

        /// <summary>
        /// SID정보가 복수가 검출되었을때 사용자가 선택하는 창
        /// </summary>
        FG_WAIT_INFOSELECT,
        /// <summary>
        /// 작업시작화면
        /// </summary>
        FG_SCR_JOBSELECT,
        /// <summary>
        /// 작업종료화면
        /// </summary>
        //SCR_JOBFINISH,
        /// <summary>
        /// 작업완료
        /// </summary>
        FG_JOB_END,

        FG_USERSTEP,
        FG_MINSPACE,
        FG_DEBUG,

        FG_AUTOOUTCONVL,
        FG_AUTOOUTCONVR,

        VS_DETECT_REEL_L,
        VS_DETECT_REEL_R,
        VS_DETECT_CONV_L,
        VS_DETECT_CONV_R,

    }

    public enum eVarString
    {
        Vision_Select_command,
        Vision_Trig_command,
        PrePick_ReelIDNew,
        PrePick_ReelIDOld,
        PrePick_ReelIDTarget,
        JOB_CUSTOMER_CODE,
        MULTISID_QUERY,
        MULTISID_FIELDS,
    }

    public enum eVarTime
    {
        DET5ON,
        DET4ON,
        PORT0,
        PORT1,
        PORT2,
        MAGNET2,
        MAGNET1,
        MAGNET0,
        QRCHECK0,
        QRCHECK2,
        KEYENCEWAIT,
        LIVEVIEW0,
        LIVEVIEW1,
        LIVEVIEW2,
        CHK_POSRSTCONVTIME,
        PRINTL,
        PRINTR,
        CMDTIME_MOTYP,
        CMDTIME_MOTZL,
        CMDTIME_MOTZR,
        JOB_END,
        SMRUNERROR,
        LOG_NEWIDERROR,
        StatusReporttime,
        JOBEVENT,
        REFRESHLIST,
        LEFT_ITEM_PICKOFF,
        RIGT_ITEM_PICKOFF,
        lastRecvWSL,
        lastRecvWSR,
        CONVL_START,
        CONVR_START,
    }


    public enum eVarInt32
    {
        PickOnCount = 0,
        PickOfCount,
        LPickOnCount,
        RPickOnCount,
        LPickOfCount,
        RPickOfCount,

        LEFT_ITEM_COUNT,
        RIGT_ITEM_COUNT,

        Front_Brush_Cleaning,
        Rear_Brush_Cleaning,
        Front_Laser_Cleaning,
        Rear_Laser_Cleaning,


        /// <summary>
        /// 2번축, 3번축 각 축번호가 들어있다
        /// </summary>
        PreBrushTargetF,
        PreBrushTargetR,

        /// <summary>
        /// 2번축, 3번축 각 축번호가 들어있다
        /// </summary>
        PostBrushTargetF,
        PostBrushTargetR,

        TopjigUnloadPort,
        TopJigLoadPort,
        DevConnectSeq,
        BitmapCompatErr,
        PickOnRetry,
    }

    public enum eVarDBL
    {
        ThetaPosition = 0,
        ThetaPositionL,
        ThetaPositionR,
        LEFT_ITEM_PICKOFF,
        RIGT_ITEM_PICKOFF,
        CONVL_RUNTIME,
        CONVR_RUNTIME,
    }

    public enum eECode : byte
    {

        NOERROR = 0,
        EMERGENCY = 1,
        NOMODELV = 2,//작업모델
        NOMODELM = 3,//모션모델
        HOME_TIMEOUT = 9,
        NOFUNCTION = 11,

        DOOFF = 27,//출력 off
        DOON = 28,//출력 on
        DIOFF = 29,//입력off
        DION = 30,//입력 on

        MESSAGE_INFO = 32,
        MESSAGE_ERROR = 33,

        AZJINIT = 39, //DIO 혹은 모션카드 초기화 X
                      //MOT_HSET = 41,
        MOT_SVOFF = 42,

        MOT_CMD = 71,
        USER_STOP = 72,
        USER_STEP = 73,
        POSITION_ERROR = 86,
        MOTIONMODEL_MISSMATCH = 96,


        //여기서부터는 전용코드로한다(소켓은 조금 섞여 있음)
        VISCONF = 100,
        UNSUPPORT,
        NOJOBMODE,
        PRINT,
        SELECTNEXTREEL,
        BCD_LEFT,
        BCD_LEFT_TEMP,
        BCD_LEFT_NEW,
        BCD_RIGHT,
        BCD_RIGHT_TEMP,
        BCD_RIGHT_NEW,
        BARCODEVALIDERR,
        PRINTER,
        QRDATAMISSMATCHL,
        QRDATAMISSMATCHR,
        MOTX_SAFETY,
        CHANGEALERTLEFT,
        CHANGEALERTRIGHT,
        SIDVALIDATION,

    }
}
