#!D:\IDE\Anaconda3\envs\Microscope_Scan python
# -*- coding: UTF-8 -*-
"""
 @Author: Administrator
 @FileName: ModBusLevel.py
 @DateTime: 2025/4/8 20:13
 @SoftWare: PyCharm
 @Author  ：xsh
"""
class ModBusLevel(int):
    Bool    = 0
    Int16   = 1
    UInt16  = 2
    Int32   = 3
    UInt32  = 4
    Float   = 5
    Other   = 6

    @staticmethod
    def toList() -> list[int]:
        return [
            ModBusLevel.Bool           ,
            ModBusLevel.Int16          ,
            ModBusLevel.UInt16         ,
            ModBusLevel.Int32          ,
            ModBusLevel.UInt32         ,
            ModBusLevel.Float          ,
            ModBusLevel.Other          ,

        ]
    @staticmethod
    def exists(value: int) -> bool:
        return ModBusLevel.toList().indexOf(value) >= 0