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

namespace ITC81DB_2H.Datastore
{
    public class Define
    {
        public delegate void EventHandlerAlarmStateChange(Define.E_TrackingAlarm alarm, string status);

        #region Enum
        public enum E_EquipmentStatus
        {
            Stop = 0,
            Start = 1,
        }

        public enum E_DisplayMode
        {
            Normal,
            Menu,
            Calibration,
            SystemSetting,
            IOTest,
            Bypass,
            EquipmentTest,
            SorterTest,
        }

        public enum E_DisplayStore
        {
            MainDisplay,

            BasicDataStatistics,
            BasicHelp,
            BasicProduct,
            BasicRandomMode,
            BasicTime,

            ConfiSerial,
            ConfiEthernet,
            ConfiHelp,
            ConfiOptionBoard,
            ConfiOptionBoard1,
            ConfiOptionBoard2,

            EquipHelp,
            EquipUpdate,
            EquipInitialize,
            EquipFuctionSetting,
            EquipUser,
            EquipEngineer,
            EquipMyPage,

            LogHelp,
            LogInspection,
            LogHistory,
            LogOthers,

            InforAS,
            InforHelp,
            InforSystem,
            InforSystem2,
            InforSystem3,

            SystemAutoZero,
            SystemCalibration,
            SystemHelp,
            SystemIOTest,
            SystemExternalOutput,
            SystemSorterSetting,
            SystemJudgment,
            SystemBLDCMotorSetting,
        }

        public enum E_FormStore
        {
            FormNone = 0,
            FormMainDisplay,
            FormMenu,
        }

        public enum E_MainDisplayStore
        {
            //DisplayStop,
            BarGraph,
            LineGraph,
            List,
            DataStat,
            SubMenu,
            Feedback,
            Modbus,
        }

        public enum E_MenuSide
        {
            Basic,
            Configuration,
            System,
            Equipment,
            Log,
            Information,
            HiddenMenu,
        }

        public enum E_MenuBottomBasic
        {
            DataStatistics,
            Help,
            Product,
            Time,
        }

        public enum E_MenuBottomConfiguration
        {
            SerialCOM1,
            SerialCOM3,
            SerialCOM4,
            Ethernet,
            Help,
            OptionBoard,
        }

        public enum E_MenuBottomEquipment
        {
            FunctionSetting,
            Help,
            Initialize,
            Update,
            User,
            Engineer,
            Manufacturer,
        }

        public enum E_MenuBottomSystem
        {
            AutoZero,
            Calibration,
            ExternalOutput,
            Help,
            IOTest,
            JudgmentSetting,
            SorterSetting,
            BLDCMotorSetting,
        }

        public enum E_MenuBottomLog
        {
            Help,
            LogInspection,
            LogHistory,
            LogOthers,
        }

        public enum E_MenuBottomInformation
        {
            Help,
            SystemInformation,
            AS,
            SystemInformation2,
            SystemInformation3,
        }

        public enum E_LanguageID
        {
            Korean,
            English,
            German,
            Chinese,
            Russian,
            Czech,
            Spanish,
            Turkish,
            French,
        }

        public enum E_JudgmentStatus
        {
            Empty,
            Under,
            Pass,
            Over,
            Double,
            Metal,
            ExNg,
            ExNg1, // 외부입력 PIN5
            ExNg2, // 외부입력 Photo B
            LengthError, // 제품길이 이상
        }

        public enum E_WeightStatus
        {
            Empty,
            WeightChange,
            WeightZero,
            CalNomal,
            CalBalans,
            CalWait,
            CalStandby,
            CalFinish,
            CalError,
            CalError_E1, // overload
            CalError_E2, // underload
            CalError_E3, // Zero-setting range exceeded
            CalError_E5, // The calibration process was error
        }

        public enum E_MessageBoxIcon
        {
            None,
            Hand,
            Question,
            Exclamation,
            Asterisk,
        }

        public enum E_UserGroup
        {
            None = 0,
            Level1 = 1,
            Level2 = 2,
            Level3 = 3,
            Admin = 4,
            Developer = 5,
            NotLogin = 6,
            LogOut = 7,
        }

        public enum E_ResponseData
        {
            NAK = 0,
            ACK = 1,
        }

        public enum E_UpdateCheck
        {
            Fail,
            Success,
            NotUsbMomery,
            NotUpdateFolder,
            NotFile,
        }

        public enum E_WeightInputMode
        {
            Weight,
            Deviation,
        }

        public enum E_Step2
        {
            Step1,
            Step2,
        }

        public enum E_Step3
        {
            Step1,
            Step2,
            Step3,
        }

        public enum E_Step4
        {
            Step1,
            Step2,
            Step3,
            Step4,
        }

        public enum E_Step5
        {
            Step1 = 1,
            Step2 = 2,
            Step3 = 3,
            Step4 = 4,
            Step5 = 5,
        }

        public enum E_SeparateType
        {
            STXANDETX,
            ETXONLY,
            NONEFRAME_READTIMEOUT,
            STXONLY,
        }

        public enum E_FileUserPassword
        {
            f0_Level1 = 0,
            f1_Level2 = 1,
            f2_Level3 = 2,
        }

        public enum E_FileUserGroup
        {
            f0_Level1 = 0,
            f1_Level2 = 1,
            f2_Level3 = 2,
            f3_NotLogin = 3,
            f4_Admin = 4,
        }

        public enum E_JudgmentResult
        {
            None,
            OK,
            NG,
            STOP, // 정지
            Timeout, // 타임아웃
        }

        public enum E_CharValue
        {
            ENQ, // 0x05
            ACK, // 0x06
            NAK, // 0x15
            Space, // 0x20
        }

        public enum E_SerialCOM
        {
            COM1 = 0,
            COM3 = 1,
            COM4 = 2,
        }

        public enum E_CommMode
        {
            f0_None = 0,
            f1_STD1,
            f2_Remote,
            f3_Printer,
            f4_imaje_9410_OPT1,
            f5_imaje_9028_OPT1 = 5,
            f6_OPT0,
            f7_imaje_9410_OPT2,
            f8_imaje_9028_OPT2,
            f9_Hitachi,
            f10_MACSA_Laser = 10,
            f11_Markoprint,
            f12_alphaJET,
            f13_Marking_VJ1510,
            f14_OPT1,
            f15_OPT2 = 15,
            f16_OPC,
            f17_OPT3,
            f18_HP_200,
            f19_SmartJet,
            f20_imaje_9410_OPT3 = 20,
            f21_Impinj_Speedway_R420 = 21, // RFID
            f22_Modbus,
            f23_STD2,
            f24_MULTi_JET,
            f25_DJ_VIDEOJET,
            f26_LINX8830,
            f27_MYJET,
            f28_OPT4,
        }

        public enum E_ExternalOutputMode
        {
            OUT0_None,
            OUT1_Over,
            OUT2_Under,
            OUT3_NG,
            OUT4_Pass,
            OUT5_Run,
            OUT6_Count,
            OUT10_LatchControl = 10,
        }

        public enum E_ExternalInputMode
        {
            IN0_None,
            IN1_Metal,
            IN2_START,
            IN3_STOP,
            IN4_DischargeSorterA,
            IN5_Air = 5,
            IN6_Door,
            IN7_Stopper,
            IN8_Windproof,
            IN9_ExternalOperation,
            IN10_DispensorEntry1 = 10,
            IN11_DispensorEntry2,
            IN12_StackUp,
            IN13_ExNG1,
            IN14_ExNG2,
            IN15_ExInputCheck,
            IN16_DischargeSorterB,
        }

        public enum E_ModbusFunction
        {
            _04_ReadInputRegister,
            _16_WriteMultipleRegister,
            _03_ReadHoldingRegister,
        }

        public enum E_TrackingOperation
        {
            None,
            PowerOn,
            Booting,
            Start,
            Stop,
            Bypass,
            Login,
            Logout,
            Zero,
            Clear,
            BarcodeClear,
            CountClear,

            OPT1Using,

            UserEditor,
            Update,
            Init_Main,
            Init_LCD,
            DataBackup,
            Calibration,
            GroupEditor,

            ProductCopy,
            ProductPaste,
            ProductAllPaste,

            TryEthernetStart,
            TryEthernetStop,
            EthernetConnect,
            EthernetDisconnect,
        }

        public enum E_TrackingParameter
        {
            None,

            ProductNo,
            OverRange,
            PassRange,
            UnderRange,
            TareRange,

            ChangeTime,

            ChangeName,
            ChangeLOT,

            COM1Baudrate,
            COM1Mode,
            COM3Baudrate,
            COM3Mode,
            COM4Baudrate,
            COM4Mode,
            TCPOpMode,
            TCPComMode,
            TCPLocalPort,
            TCPLocalIPConfig,
            TCPLocalIPAddress,
            TCPLocalSubnetMask,
            TCPLocalGateway,
            TCPServerIPAddress,
            TCPServerPort,
            Mod_Role,
            Mod_SlaveID,
            Mod_Timeout,
            Mod_StartAddr,

            CalBalanceWeight,
            CalDecimalPoint,

            JudgeFilter,
            JudgeDelay,
            JudgeDoubleDelay,
            JudgeNumber,
            JudgeSpeed,
            JudgeDynamic,
            JudgeDesDelay,
            JudgeAscDelay,

            SorAMode,
            SorADelay,
            SorARun,
            SorBMode,
            SorBDelay,
            SorBRun,
            SorDoubleEntry,
            SorExternalInput,
            SorExternalNG,

            Auto0IsUsing,
            Auto0RangePlus,
            Auto0RangeMinus,
            Auto0Variation,

            ExIn2Mode,
            ExIn3Mode,
            ExIn4Mode,
            ExIn5Mode,
            ExIn6Mode,

            ExOut1Mode,
            ExOut1Delay,
            ExOut1Run,
            ExOut2Mode,
            ExOut2Delay,
            ExOut2Run,
            ExOut3Mode,
            ExOut3Delay,
            ExOut3Run,
            ExOut4Mode,
            ExOut4Delay,
            ExOut4Run,
            ExOut5Mode,
            ExOut5Delay,
            ExOut5Run,
            ExOut6Mode,
            ExOut6Delay,
            ExOut6Run,

            OPT1SampleCount,
            OPT1DelayCount,
            OPT1PulseWidth,
            OPT1OverRange,
            OPT1UnderRange,
            OPT2Delay1,
            OPT2Delay2,
            OPT2Port,
            OPT2ZeroCycle,
            OPT2ZeroCount,
            
            ChangeL1Name,
            ChangeL2Name,
            ChangeL3Name,

            EquipmentID,
            BuzzerONTime,
            RelayONTime,
            Chattering,
            SwitchChattering,
            Language,
            IsLogin,

            AutoLogout,
            NumberOfLoginFailure,

            BLDCMotorNum,
            BLDCMotorSpeed,
            BLDCPollNum,
            BLDCAttenuatorRatio,
            BLDCMotorDirection,
        }

        public enum E_TrackingAlarm
        {
            None,
            a1_EntrySensorError = 1,
            a2_LoadCellError = 2,
            a3_PressureSensingError = 3,
            a4_DoorInterlock = 4,
            a6_StackUpSensorError = 6,
            a7_SorterAError = 7,
            a8_EmergencyStop = 8,
            a9_InverterError = 9,
            a13_WindProofError = 13,
        }

        public enum E_DataType
        {
            None,
            History,
            Inspection,
            Others,
        }
        public enum E_FileHeaderItem
        {
            LoginId,
            SerialNumber,
            EquipmentColumns,
            TimeStamp,
            EquipmentType,
        }
        #endregion
    }
}
