# Generated by the protocol buffer compiler.  DO NOT EDIT!
# sources: plcclasstype.proto, plchandler.proto, plchandler_rte.proto, websocket.proto
# plugin: python-betterproto
from dataclasses import dataclass
from typing import List

import betterproto


class PLC_TYPE_CLASS_HIGH(betterproto.Enum):
    """HIHGORD of the ulTypeId"""

    TYPECLASS_SIMPLE = 0
    DATATYPE_USERDEF = 65536
    DATATYPE_ARRAY = 131072
    TYPECLASS_POINTER = 262144
    TYPECLASS_ENUM = 524288
    TYPECLASS_PROPERTY = 1048576
    TYPECLASS_REFERENCE = 2097152


class PLC_TYPE_CLASS_LOW(betterproto.Enum):
    """LOWORD of the ulTypeId"""

    DATATYPE_BOOL = 0
    DATATYPE_SINT = 1
    DATATYPE_USINT = 2
    DATATYPE_BYTE = 3
    DATATYPE_INT = 4
    DATATYPE_UINT = 5
    DATATYPE_WORD = 6
    DATATYPE_DINT = 7
    DATATYPE_UDINT = 8
    DATATYPE_DWORD = 9
    DATATYPE_REAL = 10
    DATATYPE_LREAL = 11
    DATATYPE_TIME = 12
    DATATYPE_STRING = 13
    DATATYPE_BITORBYTE = 14
    DATATYPE_DATE = 15
    DATATYPE_TOD = 16
    DATATYPE_DT = 17
    DATATYPE_REF = 18
    DATATYPE_VOID = 19
    DATATYPE_LINT = 20
    DATATYPE_ULINT = 21
    DATATYPE_LTIME = 22
    DATATYPE_WSTRING = 23
    DATATYPE_LWORD = 24
    DATATYPE_BIT = 25
    DATATYPE_MAX = 26


class PLC_TYPE_CLASS_SIZE(betterproto.Enum):
    DATATYPE_INVALID_SIZE = 0
    DATATYPE_BOOL_SIZE = 1
    DATATYPE_SINT_SIZE = 1
    DATATYPE_USINT_SIZE = 1
    DATATYPE_BYTE_SIZE = 1
    DATATYPE_INT_SIZE = 2
    DATATYPE_UINT_SIZE = 2
    DATATYPE_WORD_SIZE = 2
    DATATYPE_DINT_SIZE = 4
    DATATYPE_UDINT_SIZE = 4
    DATATYPE_DWORD_SIZE = 4
    DATATYPE_REAL_SIZE = 4
    DATATYPE_LREAL_SIZE = 8
    DATATYPE_TIME_SIZE = 4
    DATATYPE_STRING_SIZE = 80
    DATATYPE_BITORBYTE_SIZE = 1
    DATATYPE_DATE_SIZE = 4
    DATATYPE_TOD_SIZE = 4
    DATATYPE_DT_SIZE = 4
    # DATATYPE_REF_SIZE = 0; DATATYPE_VOID_SIZE = 0;
    DATATYPE_LINT_SIZE = 8
    DATATYPE_ULINT_SIZE = 8
    DATATYPE_LTIME_SIZE = 8
    DATATYPE_WSTRING_SIZE = 2
    DATATYPE_LWORD_SIZE = 8
    DATATYPE_BIT_SIZE = 1


class RESET_OPTION_ENUM(betterproto.Enum):
    """RESET_OPTION_ENUM RTE重制选项"""

    PLC_RESET_WARM = 0
    PLC_RESET_COLD = 1
    PLC_RESET_ORIGIN = 2


class DEVICE_OPERATION_MODE_ENUM(betterproto.Enum):
    """DEVICE_OPERATION_MODE_ENUM 设备操作模式"""

    DEVICE_OPMODE_UNKNOWN = 0
    DEVICE_OPMODE_DEBUG = 1
    DEVICE_OPMODE_LOCKED = 2
    DEVICE_OPMODE_OPERATIONAL = 3


class PLC_STATUS_ENUM(betterproto.Enum):
    """PLC_STATUS_ENUM RTE 状态信息"""

    PLC_STATE_RUNNNING = 0
    PLC_STATE_STOP = 1
    PLC_STATE_STOP_ON_BP = 2
    PLC_STATE_UNKNOWN = 255


class PLC_HANDLER_STATUS_ENUM(betterproto.Enum):
    PLC_STATE_PLC_NOT_CONNECTED = 0
    PLC_STATE_PLC_CONNECTED = 1
    PLC_STATE_NO_SYMBOLS = 2
    PLC_STATE_SYMBOLS_LOADED = 3
    PLC_STATE_RUNNING = 4
    PLC_STATE_DISCONNECT = 5
    PLC_STATE_NO_CONFIGURATION = 6
    PLC_STATE_PLC_NOT_CONNECTED_SYMBOLS_LOADED = 7
    PLC_STATE_PLC_CONNECT_ERROR = 8
    PLC_STATE_PLC_CONFIG_ERROR = 9
    PLC_STATE_TERMINATE = 255


class WsSubResponseEnum(betterproto.Enum):
    SUCCESS = 0
    FAILED = 1
    LIMIT = 2
    NOTREADY = 3
    DATA = 4


@dataclass
class VarInfo(betterproto.Message):
    """VarInfo codesys工程变量内存信息"""

    psz_name: str = betterproto.string_field(1)
    ul_type_id: int = betterproto.uint32_field(2)
    psz_type: str = betterproto.string_field(3)
    us_ref_id: int = betterproto.uint32_field(4)
    ul_offset: int = betterproto.uint64_field(5)
    ul_size: int = betterproto.uint64_field(6)
    sz_access: bytes = betterproto.bytes_field(7)
    by_swap_size: int = betterproto.uint32_field(8)
    value: bytes = betterproto.bytes_field(9)
    ul_time_stamp: int = betterproto.uint64_field(10)


@dataclass
class VarList(betterproto.Message):
    varinfo: List["VarInfo"] = betterproto.message_field(1)


@dataclass
class RESET_OPTION(betterproto.Message):
    resetop: "RESET_OPTION_ENUM" = betterproto.enum_field(1)


@dataclass
class DEVICE_OPERATION_MODE(betterproto.Message):
    devop: "DEVICE_OPERATION_MODE_ENUM" = betterproto.enum_field(1)


@dataclass
class BackupIECApplicationsArgs(betterproto.Message):
    backup_file_path: str = betterproto.string_field(1)
    fource_backup: bool = betterproto.bool_field(2)


@dataclass
class RestoreIECApplicationsArgs(betterproto.Message):
    restore_file_path: str = betterproto.string_field(1)
    b_start_bootprojects: bool = betterproto.bool_field(2)


@dataclass
class ApplicationStatusArgs(betterproto.Message):
    status: "PLC_STATUS_ENUM" = betterproto.enum_field(1)
    psz_application: str = betterproto.string_field(2)


@dataclass
class ResetApplicationArgs(betterproto.Message):
    resetop: "RESET_OPTION_ENUM" = betterproto.enum_field(1)
    psz_application: str = betterproto.string_field(2)


@dataclass
class PlcStatus(betterproto.Message):
    status: "PLC_STATUS_ENUM" = betterproto.enum_field(1)


@dataclass
class PlcHandlerStatus(betterproto.Message):
    status: "PLC_HANDLER_STATUS_ENUM" = betterproto.enum_field(1)


@dataclass
class RteSysSerialNumber(betterproto.Message):
    ppsz_serial_number: str = betterproto.string_field(1)


@dataclass
class RteSysEventCallback(betterproto.Message):
    event_type: int = betterproto.uint32_field(1)


@dataclass
class WsSubResponse(betterproto.Message):
    code: "WsSubResponseEnum" = betterproto.enum_field(1)
    varinfo: List["VarInfo"] = betterproto.message_field(2)
