Cgw.T28181.T28181VideoMonitor.GetResourceType C# (CSharp) Method

GetResourceType() public static method

获取资源类型
public static GetResourceType ( string deviceId ) : string
deviceId string 设备编码
return string
        public static string GetResourceType(string deviceId)
        {
            String gDevTypeValue = "";

            if (deviceId.Length < 20)
            {
                gDevTypeValue = CgwConst.RESOURCE_TYPE_DIR;
                return gDevTypeValue;
            }

            int subDevType = int.Parse(deviceId.Substring(10, 3));

            if (subDevType >= CgwConst.DEVICE_TYPE_MAIN_START
                && subDevType <= CgwConst.DEVICE_TYPE_MAIN_END)
            {
                gDevTypeValue = CgwConst.RESOURCE_TYPE_MAIN;
            }
            else if (subDevType == CgwConst.DEVICE_TYPE_CAMERA
                || subDevType == CgwConst.DEVICE_TYPE_NET_CAMERA)
            {
                gDevTypeValue = CgwConst.RESOURCE_TYPE_CAMERA;
            }
            else if (subDevType == CgwConst.DEVICE_TYPE_ALARM_IN)
            {
                gDevTypeValue = CgwConst.RESOURCE_TYPE_ALARM_IN;
            }
            else if (subDevType == CgwConst.DEVICE_TYPE_ALARM_OUT)
            {
                gDevTypeValue = CgwConst.RESOURCE_TYPE_ALARM_OUT;
            }
            else if (subDevType >= CgwConst.DEVICE_TYPE_PLAT_DEV_START
                && subDevType <= CgwConst.DEVICE_TYPE_PLAT_DEV_END)
            {
                gDevTypeValue = CgwConst.RESOURCE_TYPE_PLAT_DEV;
            }
            else if (subDevType == CgwConst.DEVICE_TYPE_ORG)
            {
                gDevTypeValue = CgwConst.RESOURCE_TYPE_DIR;
            }

            return gDevTypeValue;
        }