| | |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.swing.*; |
| | | import java.io.File; |
| | | |
| | | @Component |
| | |
| | | @Value("${spring.profiles.active}") |
| | | private String activeEnv; |
| | | |
| | | public static NetDEVSDKLib netdevsdk = NetDEVSDKLib.NETDEVSDK_INSTANCE; |
| | | public static NetDEVSDKLib netdevsdk; |
| | | public static String strPicturePath = "."+File.separator+"Picture"+File.separator; |
| | | @PostConstruct |
| | | void init() { |
| | | if("prod".equals(activeEnv)) { |
| | | netdevsdk = NetDEVSDKLib.NETDEVSDK_INSTANCE; |
| | | String strLogPath = "./sdklog/"; |
| | | boolean bRet = netdevsdk.NETDEV_SetLogPath(strLogPath); |
| | | if(false == bRet){ |
| | |
| | | file.mkdir(); |
| | | } |
| | | |
| | | NetDEVSDKLib.NETDEV_REV_TIMEOUT_S pstRevTimeout=new NetDEVSDKLib.NETDEV_REV_TIMEOUT_S(); |
| | | pstRevTimeout.dwRevTimeOut=3; |
| | | pstRevTimeout.dwFileReportTimeOut=30; |
| | | pstRevTimeout.write(); |
| | | boolean rbet1=netdevsdk.NETDEV_SetRevTimeOut(pstRevTimeout); |
| | | boolean rbet2=netdevsdk.NETDEV_SetConnectTime(3, 1); |
| | | |
| | | |
| | | } |
| | | } |
| | | @PreDestroy |