| | |
| | | import com.ycl.api.YS.lib.NetDEVSDKLib; |
| | | import com.ycl.api.YS.login.Login; |
| | | import com.ycl.platform.domain.result.OSDResult; |
| | | import com.ycl.utils.StringUtils; |
| | | import enumeration.DeviceType; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | |
| | | return null; |
| | | } |
| | | stOSDInfo.read(); |
| | | //省份 |
| | | |
| | | |
| | | String name = new String(stOSDInfo.stNameOSD.szOSDText, StandardCharsets.UTF_8).trim(); |
| | | osdResult.setOSD1(name); |
| | | // log.info("name"+name); |
| | | int num = 0; |
| | | for (NetDEVSDKLib.NETDEV_OSD_TEXT_OVERLAY_S osd : stOSDInfo.astTextOverlay) { |
| | | String text = new String(osd.szOSDText, StandardCharsets.UTF_8).trim(); |
| | | // log.info("num:"+num+",texr:"+text); |
| | | if (num == 0) { |
| | | osdResult.setOSD2(text); |
| | | } else if (num == 1) { |
| | | osdResult.setOSD3(text); |
| | | } else if (num == 2) { |
| | | osdResult.setName(text); |
| | | } else if (num == 3) { |
| | | osdResult.setOSD4(text); |
| | | if (StringUtils.isNotEmpty(name) && name.contains("|")){ |
| | | String[] osdNames = name.split("\\|"); |
| | | osdResult.setOSD1(osdNames[0]); |
| | | osdResult.setOSD2(osdNames[1]); |
| | | osdResult.setOSD3(osdNames[2]); |
| | | osdResult.setName(osdNames[3]); |
| | | }else { |
| | | //省份 |
| | | osdResult.setOSD1(name); |
| | | // log.info("YSname"+name); |
| | | int num = 0; |
| | | for (NetDEVSDKLib.NETDEV_OSD_TEXT_OVERLAY_S osd : stOSDInfo.astTextOverlay) { |
| | | String text = new String(osd.szOSDText, StandardCharsets.UTF_8).trim(); |
| | | // log.info("YSnum:"+num+",YStexr:"+text); |
| | | if (num == 0) { |
| | | osdResult.setOSD2(text); |
| | | } else if (num == 1) { |
| | | osdResult.setOSD3(text); |
| | | } else if (num == 2) { |
| | | osdResult.setName(text); |
| | | } else if (num == 3) { |
| | | osdResult.setOSD4(text); |
| | | } |
| | | num++; |
| | | } |
| | | num++; |
| | | } |
| | | |
| | | |
| | | //登出 |
| | | YSInit.netdevsdk.NETDEV_Logout(lpUserID); |
| | | osdResult.setDeviceBrand(DeviceType.YS.getType()); |