| | |
| | | package com.iedscout;
|
| | |
|
| | | import java.io.File;
|
| | | import java.io.FileNotFoundException;
|
| | | import java.io.IOException;
|
| | | import java.io.UnsupportedEncodingException;
|
| | | import java.net.InetAddress;
|
| | |
| | |
|
| | | }
|
| | |
|
| | | public void connectIEDDevice() { |
| | | public void connectIEDDevice() throws FileNotFoundException { |
| | | try {
|
| | | param.setFail_reasion(IEDScout_Param.FAILREASION_NULL);
|
| | | while(m_App_IsConnect) {
|
| | |
| | | break;
|
| | | }
|
| | | logger.info("Start Load ICD File '" + param.target_icd + "'");
|
| | | |
| | | try {
|
| | | File file = new File(param.target_icd);
|
| | | if(!file.exists()) {
|
| | | param.setFail_reasion(IEDScout_Param.FAILREASION_FILENOTFOUND);
|
| | | param.setConn_st(IEDScout_Param.CONN_STATE_FAIL);
|
| | | break;
|
| | | }
|
| | | |
| | | try { |
| | | //加载模型文件
|
| | | List<ServerSap> serverSaps = ServerSap.getSapsFromSclFile(param.target_icd);
|
| | | m_ServerModel = serverSaps.get(0).serverModel;
|
| | | } catch (Exception e1) {
|
| | | m_App_IsConnect = false;
|
| | | param.setFail_reasion(IEDScout_Param.FAILREASION_FILENOTFOUND);
|
| | | }catch (Exception e1) {
|
| | | |
| | | param.setFail_reasion(IEDScout_Param.FAILREASION_FILEERROR);
|
| | | param.setConn_st(IEDScout_Param.CONN_STATE_FAIL);
|
| | |
|
| | | logger.error("Error Parsing ICD File: " + e1.getMessage());
|
| | | break;
|
| | | }
|
| | | logger.info("Successfully Read Model ");
|
| | | List<BasicDataAttribute> ms = m_ServerModel.getBasicDataAttributes();
|
| | |
| | |
|
| | |
|
| | | public static void main(String[] args) {
|
| | | MysqlConnPool pool = new MysqlConnPool("127.0.0.1",3360,10);
|
| | | MysqlConnPool pool = new MysqlConnPool("192.168.10.82",3360,10);
|
| | |
|
| | | BTS61850_IEDScout_Task_Thread thread = new BTS61850_IEDScout_Task_Thread(pool);
|
| | | thread.start();
|